-
-
Save ryanamaral/fb5dddf5c4fad39543b7133c8f8e88da to your computer and use it in GitHub Desktop.
1. Download latest apktool version. | |
2. Download the batch file and aapt.exe. | |
3. Create a folder anywhere in the PC and put all the apktool.jar, aapt.exe and the batch script in that folder. | |
4. Open command prompt. | |
5. Navigate to the folder where you placed apktool.jar, batch script and the aapt.exe. | |
6. Now, you need to install the file using the " IF " command. | |
7. Type the following command. | |
apktool if name-of-the-app.apk | |
8. For decompiling use the command "d". The "d" stands for decompile. | |
apktool d name-of-the-app.apk | |
9. After the app is correctly decompiled, a new folder will be created in the same folder where you placed your app. This contains all the xml's and smali files which can be edited for different mode's. | |
10. To recompile the app use the following command " B ". The "b" simply means recompile. | |
apktool b name-of-the-app-folder | |
11. The final modded app will be in the "dist" folder located inside the original app folder created by apktool. | |
Signing the apk | |
1. open a new command prompt and change into the sign-apk directory using cmd | |
2. move the modified-unsigned apk into this folder | |
3. then type the following command - | |
java -jar signapk.jar certificate.pem key.pk8 path-of-the-folder-contaning-the-apk.apk path-of-the-new-signed-apk.apk | |
4. Once compiled, the signed apk will be found in the same folder. |
How to edit the smali code?
@HarwinderSingh15 - Apktool only handles changes in smali code, not java sources.
@agambondan - Simply edit the '.smali' files in the 'smali_classes\d' folders. It just like editing .asm file, but using dalvik opcodes. Note for specs http://pallergabor.uw.hu/androidblog/dalvik_opcodes.html
Again, I'd recommend using buildapp tool to rebuild the smali, as it automates the process of recompile, zipalign and sign in the new singing-scheme + automates tools downloading for these task + has a github-action for workflows.
Note for repos under my user for references&examples of rebuilding apk, editing smali and using github automations.
NOTE to use these tools and methods for educational / legal purposes only!
@HarwinderSingh15 - Apktool only handles changes in smali code, not java sources. @agambondan - Simply edit the '.smali' files in the 'smali_classes\d' folders. It just like editing .asm file, but using dalvik opcodes. Note for specs http://pallergabor.uw.hu/androidblog/dalvik_opcodes.html
Again, I'd recommend using buildapp tool to rebuild the smali, as it automates the process of recompile, zipalign and sign in the new singing-scheme + automates tools downloading for these task + has a github-action for workflows. Note for repos under my user for references&examples of rebuilding apk, editing smali and using github automations.
NOTE to use these tools and methods for educational / legal purposes only!
I asked GPT if it was hard to edit Canal files. Can I recompile from an edited Jadx decompiler file and build it into an apk?
i have my code converted my samlli code to sources folder. Changes done in sources folder. if i start recompiling .do i need to convert sources folder to smalli files or apktool will handle it
![image](https://private-user-images.githubusercontent.com/112082796/309488096-c807fa06-ed09-4a61-8e22-f04c668faedf.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjEyNzAwMDIsIm5iZiI6MTcyMTI2OTcwMiwicGF0aCI6Ii8xMTIwODI3OTYvMzA5NDg4MDk2LWM4MDdmYTA2LWVkMDktNGE2MS04ZTIyLWYwNGM2NjhmYWVkZi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzE4JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcxOFQwMjI4MjJaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1kNzQ4ODg4Nzk0MmRjMGFlZmJjYzVkMDY3ZjE0YzIyNDdiMTk3ZGIwN2RhNWVlMzJjOTI1ZGY4OGFjMDViZGYzJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.m_kc6bMbzIYDCijji0oMQmUekCTKcDS-7srmd-eGqLE)