Exception in thread "main" brut.androlib.AndrolibException: Multiple res specs: attr/fasten at brut.androlib.res.data.ResType.addResSpec(ResType.java:70) at brut.androlib.res.decoder.ARSCDecoder.readEntry(ARSCDecoder.java:221) at brut.androlib.res.decoder.ARSCDecoder.readConfig(ARSCDecoder.java:191) at brut.androlib.res.decoder.ARSCDecoder.readType(ARSCDecoder.java:159) at brut.androlib.res.decoder.ARSCDecoder.readPackage(ARSCDecoder.java:116) at brut.androlib.res.decoder.ARSCDecoder.readTable(ARSCDecoder.java:78) at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:47) at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibResources.java:538) at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.java:63) at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.java:55) at brut.androlib.Androlib.getResTable(Androlib.java:64) at brut.androlib.ApkDecoder.setTargetSdkVersion(ApkDecoder.java:209) at brut.androlib.ApkDecoder.decode(ApkDecoder.java:92) at brut.apktool.Main.cmdDecode(Main.java:165) at brut.apktool.Main.main(Main.java:81)
第二个错误,是由于腾讯加固修改了DexCode里面的debugInfoOff,竟然把这个位置的偏移量置成0xFFFFFFFF。这在解析dex文件是肯定会显示invalid DEX,所以看下面的提示信息就是说读取offet时out of range了,我的做法是忽略0xFFFFFFFF这种过大的偏移量。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
org.jf.util.ExceptionWithContext: Encountered small uint that is out of range at offset 0xffb78 at org.jf.dexlib2.dexbacked.BaseDexBuffer.readSmallUint(BaseDexBuffer.java:54) at org.jf.dexlib2.dexbacked.DexBackedMethodImplementation.getDebugInfo(DexBackedMethodImplementation.java:126) at org.jf.dexlib2.dexbacked.DexBackedMethodImplementation.getDebugItems(DexBackedMethodImplementation.java:131) at org.jf.baksmali.Adaptors.MethodDefinition.addDebugInfo(MethodDefinition.java:575) at org.jf.baksmali.Adaptors.MethodDefinition.getMethodItems(MethodDefinition.java:377) at org.jf.baksmali.Adaptors.MethodDefinition.writeTo(MethodDefinition.java:238) at org.jf.baksmali.Adaptors.ClassDefinition.writeDirectMethods(ClassDefinition.java:283) at org.jf.baksmali.Adaptors.ClassDefinition.writeTo(ClassDefinition.java:112) at org.jf.baksmali.baksmali.disassembleClass(baksmali.java:226) at org.jf.baksmali.baksmali.access$000(baksmali.java:56) at org.jf.baksmali.baksmali$1.call(baksmali.java:150) at org.jf.baksmali.baksmali$1.call(baksmali.java:148) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745)
java.lang.ArrayIndexOutOfBoundsException: -1 at org.jf.dexlib2.dexbacked.BaseDexReader.readBigUleb128(BaseDexReader.java:158) at org.jf.dexlib2.dexbacked.util.DebugInfo$DebugInfoImpl.iterator(DebugInfo.java:104) at org.jf.baksmali.Adaptors.MethodDefinition.addDebugInfo(MethodDefinition.java:575) at org.jf.baksmali.Adaptors.MethodDefinition.getMethodItems(MethodDefinition.java:377) at org.jf.baksmali.Adaptors.MethodDefinition.writeTo(MethodDefinition.java:238) at org.jf.baksmali.Adaptors.ClassDefinition.writeDirectMethods(ClassDefinition.java:283) at org.jf.baksmali.Adaptors.ClassDefinition.writeTo(ClassDefinition.java:112) at org.jf.baksmali.baksmali.disassembleClass(baksmali.java:226) at org.jf.baksmali.baksmali.access$000(baksmali.java:56) at org.jf.baksmali.baksmali$1.call(baksmali.java:150) at org.jf.baksmali.baksmali$1.call(baksmali.java:148) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745)
org.jf.util.ExceptionWithContext: -1 at org.jf.util.ExceptionWithContext.withContext(ExceptionWithContext.java:54) at org.jf.baksmali.Adaptors.MethodDefinition.(MethodDefinition.java:161) at org.jf.baksmali.Adaptors.ClassDefinition.writeDirectMethods(ClassDefinition.java:282) at org.jf.baksmali.Adaptors.ClassDefinition.writeTo(ClassDefinition.java:112) at org.jf.baksmali.baksmali.disassembleClass(baksmali.java:226) at org.jf.baksmali.baksmali.access$000(baksmali.java:56) at org.jf.baksmali.baksmali$1.call(baksmali.java:150) at org.jf.baksmali.baksmali$1.call(baksmali.java:148) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.ArrayIndexOutOfBoundsException: -1 at org.jf.dexlib2.dexbacked.BaseDexReader.skipUleb128(BaseDexReader.java:191) at org.jf.dexlib2.dexbacked.util.DebugInfo$DebugInfoImpl.getParameterNames(DebugInfo.java:251) at org.jf.dexlib2.dexbacked.util.DebugInfo$DebugInfoImpl.getParameterNames(DebugInfo.java:81) at org.jf.dexlib2.dexbacked.DexBackedMethodImplementation.getParameterNames(DexBackedMethodImplementation.java:136) at org.jf.dexlib2.dexbacked.DexBackedMethod.getParameterNames(DexBackedMethod.java:153) at org.jf.dexlib2.dexbacked.DexBackedMethod$1.iterator(DexBackedMethod.java:131) at java.util.AbstractCollection.toArray(AbstractCollection.java:137) at com.google.common.collect.ImmutableList.copyOf(ImmutableList.java:258) at org.jf.baksmali.Adaptors.MethodDefinition.(MethodDefinition.java:93) ... 10 more