@@ -49,11 +49,10 @@ public void run() {
49
49
}
50
50
51
51
private void copySoFile () {
52
- String apkSoLibPath = findTargetLibPath ();
53
- String apkSoFullPath = fullLibPath (apkSoLibPath );
54
-
55
- copyLibFile (apkSoFullPath , SO_FILE_PATH_MAP .get (apkSoLibPath ));
56
-
52
+ for (String libPath : APK_LIB_PATH_ARRAY ) {
53
+ String apkSoFullPath = fullLibPath (libPath );
54
+ copyLibFile (apkSoFullPath , SO_FILE_PATH_MAP .get (libPath ));
55
+ }
57
56
// copy xposed modules into the lib path
58
57
if (xposedModuleArray != null && xposedModuleArray .length > 0 ) {
59
58
int index = 0 ;
@@ -66,8 +65,12 @@ private void copySoFile() {
66
65
if (!moduleFile .exists ()) {
67
66
continue ;
68
67
}
69
- String outputModuleFile = XPOSED_MODULE_FILE_NAME_PREFIX + index + SO_FILE_SUFFIX ;
70
- FileUtils .copyFile (moduleFile , new File (apkSoFullPath , outputModuleFile ));
68
+ for (String libPath : APK_LIB_PATH_ARRAY ) {
69
+ String apkSoFullPath = fullLibPath (libPath );
70
+ String outputModuleFile = XPOSED_MODULE_FILE_NAME_PREFIX + index + SO_FILE_SUFFIX ;
71
+
72
+ FileUtils .copyFile (moduleFile , new File (apkSoFullPath , outputModuleFile ));
73
+ }
71
74
index ++;
72
75
}
73
76
}
@@ -99,31 +102,7 @@ private void copyLibFile(String libFilePath, String srcSoPath) {
99
102
FileUtils .copyFileFromJar (srcSoPath , new File (apkSoParentFile , soFileName ).getAbsolutePath ());
100
103
}
101
104
102
- // Try to find the lib path where the so file should put.
103
- // If there is many lib path, try to find the path which has the most so files
104
- private String findTargetLibPath () {
105
- int maxChildFileCount = 0 ;
106
- int maxChildFileIndex = 0 ;
107
- int index = 0 ;
108
- for (String libPath : APK_LIB_PATH_ARRAY ) {
109
- String fullPath = fullLibPath (libPath );
110
- File file = new File (fullPath );
111
- if (file .exists ()) {
112
- String [] childList = file .list ();
113
- int childCount = 0 ;
114
- if (childList != null ) {
115
- childCount = childList .length ;
116
- }
117
- if (childCount > maxChildFileCount ) {
118
- maxChildFileCount = childCount ;
119
- maxChildFileIndex = index ;
120
- }
121
- }
122
- index ++;
123
- }
124
105
125
- return APK_LIB_PATH_ARRAY [maxChildFileIndex ];
126
- }
127
106
128
107
private void deleteMetaInfo () {
129
108
String metaInfoFilePath = "META-INF" ;
0 commit comments