Optimize the replication logic of so and modules

This commit is contained in:
luoyesiqiu 2019-05-14 23:11:59 +08:00
parent 62769e196c
commit 31ce4b2acd
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++;
}