Merge pull request #11 from luoyesiqiu/master

Optimize the replication logic of so and modules
This commit is contained in:
Windy 2019-05-16 00:46:41 +08:00 committed by GitHub
commit 4067b02d7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 3 deletions

View File

@ -51,8 +51,10 @@ public class SoAndDexCopyTask implements Runnable {
private void copySoFile() {
for (String libPath : APK_LIB_PATH_ARRAY) {
String apkSoFullPath = fullLibPath(libPath);
if(new File(apkSoFullPath).exists()) {
copyLibFile(apkSoFullPath, SO_FILE_PATH_MAP.get(libPath));
}
}
// copy xposed modules into the lib path
if (xposedModuleArray != null && xposedModuleArray.length > 0) {
int index = 0;
@ -67,9 +69,12 @@ public class SoAndDexCopyTask implements Runnable {
}
for (String libPath : APK_LIB_PATH_ARRAY) {
String apkSoFullPath = fullLibPath(libPath);
String outputModuleFile = XPOSED_MODULE_FILE_NAME_PREFIX + index + SO_FILE_SUFFIX;
String outputModuleName= XPOSED_MODULE_FILE_NAME_PREFIX + index + SO_FILE_SUFFIX;
if(new File(apkSoFullPath).exists()) {
File outputModuleSoFile = new File(apkSoFullPath, outputModuleName);
FileUtils.copyFile(moduleFile, outputModuleSoFile);
}
FileUtils.copyFile(moduleFile, new File(apkSoFullPath, outputModuleFile));
}
index++;
}