DroidPluginTeam / DroidPluginTeam/DroidPlugin
一个可能的bug:关于64位系统运行32位的library
- Dominant language
- Java
- Stars
- 7k
- Forks
- 2.5k
- PR merge metrics
- No merged PRs in 30d
Description
Class:
com.morgoo.helper.compat.NativeLibraryHelperCompat
问题:原来的代码使得VM64无法安装32bit的library,但很多VM64的手机是可以运行32bit库的
参见下面的修改:
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private static int copyNativeBinariesAfterL(File apkFile, File sharedLibraryDir) {
try {
Object handleInstance = MethodUtils.invokeStaticMethod(handleClass(), "create", apkFile);
if (handleInstance == null) {
return -1;
}
```
String abi = null;
if (isVM64()) {
if (Build.SUPPORTED_64_BIT_ABIS.length > 0) {
Set abis = getAbisFromApk(apkFile.getAbsolutePath());
if (abis == null || abis.isEmpty()) {
return 0;
}
for (String item : Build.SUPPORTED_64_BIT_ABIS) {
abis.add(item);
}
String[] supportedAbis = new String[abis.size()];
supportedAbis = abis.toArray(supportedAbis);
int abiIndex = (int) MethodUtils.invokeStaticMethod(nativeLibraryHelperClass(), "findSupportedAbi", handleInstance, supportedAbis);
if (abiIndex >= 0) {
abi = supportedAbis[abiIndex];
}
}
} else {
if (Build.SUPPORTED_32_BIT_ABIS.length > 0) {
Set abis = getAbisFromApk(apkFile.getAbsolutePath());
if (abis == null || abis.isEmpty()) {
return 0;
}
for (String item : Build.SUPPORTED_32_BIT_ABIS) {
abis.add(item);
}
String[] supportedAbis = new String[abis.size()];
supportedAbis = abis.toArray(supportedAbis);
int abiIndex = (int) MethodUtils.invokeStaticMethod(nativeLibraryHelperClass(), "findSupportedAbi", handleInstance, supportedAbis);
if (abiIndex >= 0) {
abi = supportedAbis[abiIndex];
}
}
}
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.