Are you looking for a way to decompile and recompile Jar Files? As you probably know, the Jar executable files are a set of files packed in the Android system which comprise of functionality of any app or module. If you have already decompiled an APK file, then you know that even with no jar files in the package, they still function and I am sure that some of you are confused.
Things have though a logical explanation: Android uses a classes.dex file which runs on the Dalvik runtime, so if you want to do some simple modifications to some functions in an Android system, you decompiling these DEX files is mandatory. The Jar files have such DEX file which can be easily decompiled and recompiled resulting in a set of Smali files which are the assembler files for the Android runtime.
Here you can find a detailed very guide of decompiling a.jar file and recompiling it again. However, before starting, I want to clarify something: if you make any mistake, if you mix the steps or skip them, there are big chances to end up with a bricked device and this is only your responsibility. I am not responding of any consequences that might occur during the process, so be careful and make no mistake:
How to Efficiently Decompile and Recompile Jar Files:
- Download the Apktool & smali files zip on your computer by accessing the provided link;
- Then, you have to copy the Jar file that you want to decompile to the same directory where you have extracted the Apktool file;
- Open the .jar file using an archive software of your choice;
- Extract the classes.dex file to the Apktool folder;
- It’s time to decompile the DEX file by dragging the classes.dex file onto the Quick-Baksmali.cmd file in the Apktool folder;
- This will automatically decompile the DEX file and will also create a folder called Classout in the same directory where the smali files are placed;
- Save the edited smali files;
- Drag the classout folder onto the Quick-Smali.cmd file;
- This script will recompile the smali files and provide you a compact DEX file with the name new-classes.dex;
- Open the Jar file and delete the classes.dex file;
- Now, you can replace it with the compiled classes.dex;
- Push the Jar file to the proper location with the help of an ADB Push command.
If you get any error or any problem following this guide, don’t hesitate to comment and I will help you as soon as possible.
Also learn How to:
- Install HTC BlinkFeed Launcher on any Android device Without Root with the help of this tutorial;
- Install HTC One M9 Music Player on any Android device by using this link;
- Test Display Performance on any Android device;
- Install HTC One M9 Keyboard on any Android Device (you can find this tutorial here);
- Install HTC One M9 Home Launcher on any Android device by accesing this link;
- Disable Bloat Apps on Android Devices with no Root and more.