Commit 50dbde56 authored by Administrator's avatar Administrator

脱壳dex编号冲突导致脱壳失败

parent e089b2ee
......@@ -165,7 +165,7 @@ public class UnPackerToolKit {
File apkFile = new File(RatelToolKit.sContext.getPackageCodePath());
int maxIndex = 1;
int maxIndex = 0;
File target = new File(workDir, "unpacked.apk");
try (FileOutputStream fileOutputStream = new FileOutputStream(target)) {
try (ZipOutputStream zipOutputStream = new ZipOutputStream(fileOutputStream)) {
......@@ -187,12 +187,14 @@ public class UnPackerToolKit {
Matcher matcher = classesIndexPattern.matcher(zipEntry.getName());
if (matcher.matches()) {
int nowIndex = NumberUtils.toInt(matcher.group(1));
Log.i(TAG_UNPACK, "original dex: " + "classes" + nowIndex + ".dex");
if (nowIndex > maxIndex) {
maxIndex = nowIndex;
}
}
}
}
maxIndex++;
// append dex
for (byte[] dexData : dumpedDex) {
if (dexData == null) {
......@@ -209,6 +211,7 @@ public class UnPackerToolKit {
}
}
}
Log.i(TAG_UNPACK, "dump apk to :" + target.getAbsolutePath());
return target;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment