[AAB] Feature: Support AAB And extractNativeLibs=false #140
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
项目未配置
useLegacyPackaging=true
时,使用AAB安装, 或最低版本为Android M以上的APK
Native库不会从APK中解压, 参考:
https://developer.android.com/guide/topics/manifest/application-element#extractNativeLibs google/bundletool#39
此时xCrash通过
ctx.getApplicationInfo().nativeLibraryDir
获取的目录内容是空的 因此会出现加载xcrash_dumper失败而通过 PathClassloader.findLibrary(libName) 获取的路径是虚拟路径, 不是真实存在的 因此直接执行也会失败
此时我们参考 Crashpad 的逻辑, 使用linker加载
参考:
https://github.com/chromium/crashpad/blob/main/client/crashpad_client_linux.cc#L114
为了避免大的改动, 默认仅在加载虚拟路径时使用linker, 实际上在所有场景都可以直接通过linker加载
支持外部自定义配置
如果外部没有配置,内部会自动查找
参考: AbiPathProvider.java 逻辑