forked from dotnet/android
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[monodroid] Remove __XA_DSO_IN_APK in favor of runtime checks (dotnet…
…#3337) Fixes: dotnet#3298 Context: dotnet#3298 (comment) We have discovered through our current preview of Android App Bundles in 16.2: the state of `//application/@android:extractNativeLibs` with app bundles can change on a per-device basis. [A comment from `bundletool`'s source code][0]: // If persistent app is not installable on external storage, only the split APKs targeting // devices above Android M should be uncompressed. If the persistent app is installable on // external storage only split APKs targeting device above Android P should be uncompressed (as // uncompressed native libraries crashes with ASEC external storage and support for ASEC // external storage is removed in Android P). Instant apps always support uncompressed native // libraries (even on Android L), because they are not always executed by the Android platform. boolean shouldCompress = That means we cannot decide the value of `__XA_DSO_IN_APK` at build time, or know what the appropriate value should be! Instead, we can check the value of [`ApplicationInfo.flags`][1] at runtime for [`FLAG_EXTRACT_NATIVE_LIBS`][2]. We will have to check this value on the Java side, and pass it through `Runtime.init()`. This means we can kill the `__XA_DSO_IN_APK` environment variable completely. Other changes: * I added to add some explicit padding for 64-bit architectures after removing the `uses_embedded_dsos` value * I added a new `Runtime.initInternal()` method so we can adjust parameters without breaking the designer. `Runtime.init()` can remain with its signature unchanged. * I adjusted all tests around embedded DSOs appropriately. [0]: https://github.com/google/bundletool/blob/5ac94cb61e949f135c50f6ce52bbb5f00e8e959f/src/main/java/com/android/tools/build/bundletool/splitters/NativeLibrariesCompressionSplitter.java#L75-L86 [1]: https://developer.android.com/reference/android/content/pm/ApplicationInfo.html#flags [2]: https://developer.android.com/reference/android/content/pm/ApplicationInfo.html#FLAG_EXTRACT_NATIVE_LIBS
- Loading branch information
1 parent
e13408f
commit feb9ea2
Showing
16 changed files
with
69 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters