Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[illink] Do not preserve A.R.AndroidEnvironment #5362

Merged

Conversation

radekdoulik
Copy link
Member

@radekdoulik radekdoulik commented Dec 3, 2020

Part of #5167

Removed API from BuildReleaseArm64False test (ignore the SIGERR's in place of return types):

Type Android.Runtime.AndroidEnvironment
  -             Field public static string AndroidLogAppName
  -             Field static Javax.Net.Ssl.IX509TrustManager sslTrustManager
  -             Field static Java.Security.KeyStore certStore
  -             Method static SIGERR SetupTrustManager ()
  -             Method static SIGERR SetupCertStore ()
  -             Method public static SIGERR add_UnhandledExceptionRaiser (System.EventHandler`1<Android.Runtime.RaiseThrowableEventArgs>)
  -             Method public static SIGERR remove_UnhandledExceptionRaiser (System.EventHandler`1<Android.Runtime.RaiseThrowableEventArgs>)
  -             Method static SIGERR TrustEvaluateSsl (System.Collections.Generic.List`1<byte[]>)
  -             Method static SIGERR CertStoreLookup (long, bool)
  -             Method static SIGERR GetX509CertificateFactory ()
  -             Method static SIGERR ConvertCertificate (Java.Security.Cert.CertificateFactory, byte[])
  -             Method static SIGERR NotifyTimeZoneChanged ()
  -             Method static SIGERR GetDisplayDPI (float&, float&)
  -             Method static SIGERR GetDefaultTimeZone ()
  -             Method static SIGERR _monodroid_timezone_get_default_id ()
  -             Method static SIGERR GetDefaultSyncContext ()
  -             Method static SIGERR _monodroid_getifaddrs (IntPtr&)
  -             Method static SIGERR GetInterfaceAddresses (IntPtr&)
  -             Method static SIGERR _monodroid_freeifaddrs (IntPtr)
  -             Method static SIGERR FreeInterfaceAddresses (IntPtr)
  -             Method static SIGERR _monodroid_detect_cpu_and_architecture (ushort&, ushort&, byte&)
  -             Method static SIGERR DetectCPUAndArchitecture (ushort&, ushort&, bool&)
  -             Method static SIGERR GetDefaultProxy ()
  -             Method static SIGERR GetHttpMessageHandler ()
  -             Type _Proxy

Some of the removed API is obsolete on .NET5/6. Opened #5361
for it.

The template tests run OK on device after the removal.

Part of dotnet#5167

Removed API from `BuildReleaseArm64False` test:

    Type Android.Runtime.AndroidEnvironment
      -             Field public static string AndroidLogAppName
      -             Field static Javax.Net.Ssl.IX509TrustManager sslTrustManager
      -             Field static Java.Security.KeyStore certStore
      -             Method static SIGERR SetupTrustManager ()
      -             Method static SIGERR SetupCertStore ()
      -             Method public static SIGERR add_UnhandledExceptionRaiser (System.EventHandler`1<Android.Runtime.RaiseThrowableEventArgs>)
      -             Method public static SIGERR remove_UnhandledExceptionRaiser (System.EventHandler`1<Android.Runtime.RaiseThrowableEventArgs>)
      -             Method static SIGERR TrustEvaluateSsl (System.Collections.Generic.List`1<byte[]>)
      -             Method static SIGERR CertStoreLookup (long, bool)
      -             Method static SIGERR GetX509CertificateFactory ()
      -             Method static SIGERR ConvertCertificate (Java.Security.Cert.CertificateFactory, byte[])
      -             Method static SIGERR NotifyTimeZoneChanged ()
      -             Method static SIGERR GetDisplayDPI (float&, float&)
      -             Method static SIGERR GetDefaultTimeZone ()
      -             Method static SIGERR _monodroid_timezone_get_default_id ()
      -             Method static SIGERR GetDefaultSyncContext ()
      -             Method static SIGERR _monodroid_getifaddrs (IntPtr&)
      -             Method static SIGERR GetInterfaceAddresses (IntPtr&)
      -             Method static SIGERR _monodroid_freeifaddrs (IntPtr)
      -             Method static SIGERR FreeInterfaceAddresses (IntPtr)
      -             Method static SIGERR _monodroid_detect_cpu_and_architecture (ushort&, ushort&, byte&)
      -             Method static SIGERR DetectCPUAndArchitecture (ushort&, ushort&, bool&)
      -             Method static SIGERR GetDefaultProxy ()
      -             Method static SIGERR GetHttpMessageHandler ()
      -             Type _Proxy

Some of the removed API is obsolete on .NET5/6. Opened dotnet#5361
for it.

The template tests run OK on device after the removal.
@radekdoulik radekdoulik requested a review from jonpryor as a code owner December 3, 2020 11:13
@jonpryor
Copy link
Member

jonpryor commented Dec 3, 2020

Silly question: why is SIGERR showing up ~everywhere? There is no instance of SIGERR within AndroidEnvironment.cs.

Doubly odd is that that many of those SIGERRs are for void, of all things.

@radekdoulik
Copy link
Member Author

Silly question: why is SIGERR showing up ~everywhere?

It was result of workaround for signature reader bug in apkdiff. It is just replacement of return type and is no longer an issue in apkdiff anymore.

@jonpryor jonpryor merged commit 11f0e1b into dotnet:master Dec 9, 2020
jonpryor pushed a commit that referenced this pull request Dec 10, 2020
Context: #5167

Some members of `Android.Runtime.JNIEnv` are accessed via Reflection,
and need to be preserved, but that doesn't mean the *entire type*
needs to be preserved.

Update the `<type/>` preservation XML so that only the required
methods are always preserved, allowing the linker to remove other
unused members.
@github-actions github-actions bot locked and limited conversation to collaborators Jan 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants