Search code examples
androidapksmaliapktoolsnapchat

Compiling snapchat with apktools fails to install


Alright, so I have a problem with decompiling apks with apktools. I am currently trying to edit the current version of snapchat so that I can have unlimited caption length without root. To do this I decompiled the apk with apktools, edited the smali file needed and then recompiled it, but it will not install on the phone for some reason.

I then tried to just decompile and recompile the apk without any edits and it also did not work.

Is there some special signing that needs to happen for the app to be built and installed properly? Or maybe something that I am missing with apktools? I have decompiled many other apks and they worked fine, but snapchat is not having any of it. Any help is appreciated, thanks.


Solution

  • Well yes. You forgot to sign the apk, but assuming you did sign you will run into another bug which affects the functionality of the application which I've noted below. Check out signapk.jar for information on signing an apk.


    This is a known bug (859) in apktool. Basically you have this string

    <g id="username">$1%s</g> is typing...
    

    which apktool decodes as

    <g id=username>$1%s</g> is typing....
    

    Apktool uses a different decoder for arrays.xml <items> (which is where these strings reside). You can manually fix these arrays (happens in multiple places) after decode by re-adding the double quotes. This should fix the problem.