forked from Floorp-Projects/Floorp
-
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.
Bug 1529082 - Locate lib folder within the APK. r=owlish
Before this patch, we would load mozglue using the unqualified `System.loadLibrary("mozglue")` and then we would try to load all the other native libraries from the path returned from `nativeLibraryDir`. Note that since the path is unqualified, we might end up loading a library that's not inside the APK, potentially a malicious one. Android App Bundles (or AAB) is a new feature of Android where apps can be split in multiple APKs (called "splits"). Each APK split contains a functinal part of the app, e.g. a specific resolution asset folder, all the native libraries for one CPU architecture etc. For AAB, `nativeLibraryDir` returns an empty folder as the libraries are stored, uncompressed, inside one of the APK splits, so GeckoView fails to load libxul and other libraries when starting up. The current code also doesn't work for any case where `System.loadLibrary` fails to load mozglue (we do have code that accounts for that, but I'm not sure how much of it is funcitonal). To fix that, we locate the mozglue using code ported from Chromium and use that to locate all the other native libraries. Note this still doesn't fix the problem of loading an unqualified mozglue library, but there's not a lot we can do about that right now (and that's not a new problem, so we can address it in a separate patch). Differential Revision: https://phabricator.services.mozilla.com/D122909
- Loading branch information
Showing
1 changed file
with
44 additions
and
73 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