Good evening, I know that this subject is very common on StackOverFlow but my question is a little bit different and i couldn't find any solution on the WHOLE WEB ! ;)
SO THIS IS MY QUESTION :
"What are the building requirements (on Eclypse) to permit an app to be decompiled by Apktool ?"
I did some tests and couldn't find any rules... For example, i built an empty app (i just created it and exported it the project to an apk file), the building options were :
Minimum : API 14, Android 4.0
Targeting : API 14, Android 4.0
Compile With : API 14, Android 4.0
And i couldn't decompiled the apk... Anyway, i can't decompiled ANY of my apps ! What do i have to change in the building options? I did my tests on Apktool 1.4.3 and 2.0.0 Also, proguard isn't activated. This link says that it could have problem for building versions upper than 21.1.1 but that it was fixed in ApkTool 2.0.0... https://code.google.com/p/android-apktool/issues/detail?id=680
THE ERROR LOGS :
For ApkTool 1.4.3 :
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b18)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
I: Baksmaling...
I: Loading resource table...
Exception in thread "main" brut.androlib.AndrolibException: **Could not decode arsc file**
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:56)
at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibResources.java:491)
at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.java:74)
at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.java:66)
at brut.androlib.Androlib.getResTable(Androlib.java:50)
at brut.androlib.ApkDecoder.getResTable(ApkDecoder.java:189)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:114)
at brut.apktool.Main.cmdDecode(Main.java:146)
at brut.apktool.Main.main(Main.java:77)
Caused by: java.io.IOException: Expected: 0x001c0001, got: 0x00000000
at brut.util.ExtDataInput.skipCheckInt(ExtDataInput.java:48)
at brut.androlib.res.decoder.StringBlock.read(StringBlock.java:44)
at brut.androlib.res.decoder.ARSCDecoder.readPackage(ARSCDecoder.java:102)
at brut.androlib.res.decoder.ARSCDecoder.readTable(ARSCDecoder.java:83)
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:49)
... 8 more
For ApkTool 2.0.0 :
Microsoft Windows [version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. Tous droits r‚serv‚s.
C:\Users\user\Desktop\adt-bundle-windows-x86_64-201407020\AndroidMultitool_3.5.3\AndroidMultitool>cd C:\Users\user\Desktop\adt-bundle-windows-x86_64-201407020\AndroidMultitool_3.5.3\AndroidMultitool\Program_Files
C:\Users\user\Desktop\adt-bundle-windows-x86_64-201407020\AndroidMultitool_3.5.3\AndroidMultitool\Program_Files>apktool d C:\Users\user\Desktop\adt-bundle-windows-x86_64-201407020\AndroidMultitool_3.5.3\AndroidMultitool\Files\tes1.apk -o C:\Users\user\Desktop\adt-bundle-windows-x86_64-201407020\AndroidMultitool_3.5.3\AndroidMultitool\Decompiled_apk\tes1
I: Using Apktool 2.0.0-RC2 on tes1.apk
I: Loading resource table...
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\user\apktool\framework\1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
C:\Users\user\Desktop\adt-bundle-windows-x86_64-201407020\AndroidMultitool_3.5.3\AndroidMultitool\Program_Files>W: **Could not decode attr value**, using undecoded value instead: ns=android, name=showAsAction, value=0x00000000
Exception in thread "main" brut.androlib.err.UndefinedResObject: resource spec: 0x01030119
at brut.androlib.res.data.ResPackage.getResSpec(ResPackage.java:59)
at brut.androlib.res.data.ResTable.getResSpec(ResTable.java:58)
at brut.androlib.res.data.ResTable.getResSpec(ResTable.java:54)
at brut.androlib.res.data.value.ResReferenceValue.getReferent(ResReferenceValue.java:60)
at brut.androlib.res.data.value.ResReferenceValue.encodeAsResXml(ResReferenceValue.java:47)
at brut.androlib.res.data.value.ResScalarValue.encodeAsResXmlAttr(ResScalarValue.java:45)
at brut.androlib.res.data.value.ResStyleValue.serializeToResValuesXml(ResStyleValue.java:49)
at brut.androlib.res.data.value.ResBagValue.serializeToResValuesXml(ResBagValue.java:41)
at brut.androlib.res.AndrolibResources.generateValuesFile(AndrolibResources.java:564)
at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:327)
at brut.androlib.Androlib.decodeResourcesFull(Androlib.java:123)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:102)
at brut.apktool.Main.cmdDecode(Main.java:170)
at brut.apktool.Main.main(Main.java:86)
Thanks to everyone who will try to help me :) I love you guys !
You must have to download apktoo_2.0.0rc file. then after You can decompile your apk file and will not get arcs file error.
You can download latest file version from Here.
Now Rename your "apktool_2.0.0rc4.jar" to "apktool.jar".
Now delete old "apktool.jar" file from your apktool folder.
Now put this new "apktool.jar" file in your apktool folder where old "apktool.jar" was placed.
now same run your cmd commands like
apktool if framework-res.apk
and next
apktool d "your appname.apk without quotes"
and keep smile..