Commit 50dbde56 authored by Administrator's avatar Administrator

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

parent e089b2ee
...@@ -165,7 +165,7 @@ public class UnPackerToolKit { ...@@ -165,7 +165,7 @@ public class UnPackerToolKit {
File apkFile = new File(RatelToolKit.sContext.getPackageCodePath()); File apkFile = new File(RatelToolKit.sContext.getPackageCodePath());
int maxIndex = 1; int maxIndex = 0;
File target = new File(workDir, "unpacked.apk"); File target = new File(workDir, "unpacked.apk");
try (FileOutputStream fileOutputStream = new FileOutputStream(target)) { try (FileOutputStream fileOutputStream = new FileOutputStream(target)) {
try (ZipOutputStream zipOutputStream = new ZipOutputStream(fileOutputStream)) { try (ZipOutputStream zipOutputStream = new ZipOutputStream(fileOutputStream)) {
...@@ -187,12 +187,14 @@ public class UnPackerToolKit { ...@@ -187,12 +187,14 @@ public class UnPackerToolKit {
Matcher matcher = classesIndexPattern.matcher(zipEntry.getName()); Matcher matcher = classesIndexPattern.matcher(zipEntry.getName());
if (matcher.matches()) { if (matcher.matches()) {
int nowIndex = NumberUtils.toInt(matcher.group(1)); int nowIndex = NumberUtils.toInt(matcher.group(1));
Log.i(TAG_UNPACK, "original dex: " + "classes" + nowIndex + ".dex");
if (nowIndex > maxIndex) { if (nowIndex > maxIndex) {
maxIndex = nowIndex; maxIndex = nowIndex;
} }
} }
} }
} }
maxIndex++;
// append dex // append dex
for (byte[] dexData : dumpedDex) { for (byte[] dexData : dumpedDex) {
if (dexData == null) { if (dexData == null) {
...@@ -209,6 +211,7 @@ public class UnPackerToolKit { ...@@ -209,6 +211,7 @@ public class UnPackerToolKit {
} }
} }
} }
Log.i(TAG_UNPACK, "dump apk to :" + target.getAbsolutePath());
return target; 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