javaandroiddecompilingrecompile

Decompile an APK, modify it and then recompile it


I need to modify an existing APK, modify the sources and then recompile it.

But now I would like to know how to recompile the java files and put them back into a jar file! (the jar part should be easy, the main problem seems to be how to recompile the java files for android)

I know that an other solution is to use apktool and then modify the smali files, but it seems to be really complicated when we want to add a lot of code!

My application is a basic a HelloWorld whitout obfuscation.


Solution

  • Thanks to Chris Jester-Young I managed to make it work!

    I think the way I managed to do it will work only on really simple projects:

    /!\ be sure you removed the old apk from the device an error will be thrown stating that the apk signature is not the same as the old one!