I decompiled an Android APK using Jadx-GUI to view the Java source code. I want to modify the application, but the only way to do that is to make changes to the smali code and repackage the files into an APK via apktool.
I currently have made some changes to the Java code for a particular file. I now want to make the changes to the corresponding smali and then repackage the app. I am confused on how to do this.
Convert .Java file to .Smali file
From this post: "You can compile the java classes using a normal java compiler, and then use Android's 'dx' utility to convert the compiled .class files to a dex file. And then run baksmali on the dex file to produce the smali files."
I'm not sure what this means. Do I need to just compile the one file I made the changes to? Or do I compile all the files of the project together? Since smali is android assembly, I would imagine that I would need to compile everything together so that registers are allocated properly, etc.
Lastly, if I use a normal java compiler, won't the compiler throw an error when it encounters Android specific imports? Eg. import android.graphics.drawable