desword / android-apktool

Automatically exported from code.google.com/p/android-apktool
Other
1 stars 0 forks source link

Cannot rebuild decoded apk (InvalidTryException: Multiple overlapping catches for ClassNotFoundException) #675

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. apktool d ly.secret.android.apk
2. apktool b ly.secret.android.apk

What is the expected output? What do you see instead?
Decoding works and since there were no changes it should be able to rebuild the 
apk again. However, it fails with this error:

I: Using Apktool 2.0.0-3d2e93-SNAPSHOT on secret
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
Exception in thread "main" 
org.jf.dexlib2.writer.util.TryListBuilder$InvalidTryException: Multiple 
overlapping catches for Ljava/lang/ClassNotFoundException; with different 
handlers
    at org.jf.dexlib2.writer.util.TryListBuilder$MutableTryBlock.addHandler(TryListBuilder.java:180)
    at org.jf.dexlib2.writer.util.TryListBuilder.addHandler(TryListBuilder.java:311)
    at org.jf.dexlib2.writer.util.TryListBuilder.massageTryBlocks(TryListBuilder.java:69)
    at org.jf.dexlib2.writer.DexWriter.writeCodeItem(DexWriter.java:883)
    at org.jf.dexlib2.writer.DexWriter.writeDebugAndCodeItems(DexWriter.java:759)
    at org.jf.dexlib2.writer.DexWriter.writeTo(DexWriter.java:214)
    at org.jf.dexlib2.writer.DexWriter.writeTo(DexWriter.java:192)
    at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:57)
    at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:41)
    at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:358)
    at brut.androlib.Androlib.buildSources(Androlib.java:298)
    at brut.androlib.Androlib.build(Androlib.java:284)
    at brut.androlib.Androlib.build(Androlib.java:258)
    at brut.apktool.Main.cmdBuild(Main.java:240)
    at brut.apktool.Main.main(Main.java:89)

What version of the product are you using? On what operating system?
apktool version: top of tree snapshot 3d2e93 (26/08/2014). Built following the 
wiki instructions.
java version "1.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)
Running in Mac OS X 10.9.4

Please provide any additional information below.
Play store link to the apk: 
https://play.google.com/store/apps/details?id=ly.secret.android

Original issue reported on code.google.com by shirokur...@gmail.com on 26 Aug 2014 at 9:46

GoogleCodeExporter commented 9 years ago
This is an upstream bug with smali: 
https://code.google.com/p/smali/source/detail?r=0d8418ff1f253471dc5f579ec5b4976c
08649a09

Once merged the compilation completes but fails on an aapt problem.

Original comment by connor.tumbleson on 27 Aug 2014 at 6:17

GoogleCodeExporter commented 9 years ago
https://github.com/iBotPeaches/Apktool/commit/394bb25b7c2b1ad23ac802e6583f6a5b19
189d49

Fixed via cherry-pick of smali.

Original comment by connor.tumbleson on 24 Sep 2014 at 12:23