• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Root [Guide] How-To Properly Decompile and Recompile apk's with apktool

I get an error 'Could not decode arsc file' when running 'apktool.bat if MyAndroidApp.apk':

C:\apktool>apktool.bat if MyAndroidApp.apk
I: Baksmaling...
testI: Loading resource table...
Exception in thread "main" brut.androlib.AndrolibException: Could not decode arsc file
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:55)
at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibResources.java:315)
at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.java:50)
at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.java:43)
at brut.androlib.Androlib.getResTable(Androlib.java:44)
at brut.androlib.ApkDecoder.getResTable(ApkDecoder.java:148)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:98)
at brut.apktool.Main.cmdDecode(Main.java:128)
at brut.apktool.Main.main(Main.java:65)
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:45)
at brut.androlib.res.decoder.ARSCDecoder.readPackage(ARSCDecoder.java:97)
at brut.androlib.res.decoder.ARSCDecoder.readTable(ARSCDecoder.java:82)
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:48)
... 8 more

Can someone tell me how to fix this?
 
Upvote 0
Hi,
Since decompilation, modification and recompilation of apk required several commands so I created a java GUI tool APKRepatcher which helps you to modify an existing apk using a simple user friendly GUI. It lets you edit java/smali code from an APK and rewrite the changes back to the modified signed APK. Additionally, it provides you option to convert Dex, Jar, Class, Smali, Class from one format to another.

[Link removed]

Thanks
 
Last edited by a moderator:
Upvote 0
i wanted to change status bar icons colors...i followed the steps...recompiling succesfull...the problem is that 7zip cannot fully browse inside archive...folder res/values/ is not available to put back colors.xml...i tried to sign generated apk but i got a lot of UI fc and after restart the old systemui.apk is there.
did I do smth wrong??
 
Upvote 0
Hi,
Since decompilation, modification and recompilation of apk required several commands so I created a java GUI tool APKRepatcher which helps you to modify an existing apk using a simple user friendly GUI. It lets you edit java/smali code from an APK and rewrite the changes back to the modified signed APK. Additionally, it provides you option to convert Dex, Jar, Class, Smali, Class from one format to another.

[Link removed]

Thanks
can I use it for changing statusbar icons color?
 
Last edited by a moderator:
Upvote 0
Just a note to say that Android Forums does not condone the use of APK decompilation tools, for the purposes of modifying original source code, with the intention of re-publishing, or otherwise using modified apps for financial gain, without the original author's consent.

Legitimate uses of this tool would include changing app appearance or preferences, for personal use.

If you wish to modify the app's source code, then approach the original developer first to ask them to change it, or obtain permission to do this yourself.
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones