This is a reference to reverse engineer personal applications built in order to do modifications, as well as to check the source of android applications built by others to determine if theirs any malicious content stored in the apps.
The include files in this repo are the tools needed to reverse engineer the APK's, these can be downloaded from the official sources.
(Windows)
Download ApkTool, its needed to reverse engineer the apk files, link is here: https://ibotpeaches.github.io/Apktool
Installation instructions can be found here: https://ibotpeaches.github.io/Apktool/install/
Instructions from apktool git:
- Download Windows wrapper script (Right click, Save Link As apktool.bat)
- Download apktool-2 from here: https://bitbucket.org/iBotPeaches/apktool/downloads/
- Rename downloaded jar to apktool.jar
- Move both files (apktool.jar & apktool.bat) to your Windows directory (Usually C://Windows)
- If you do not have access to C://Windows, you may place the two files anywhere then add that directory to your Environment Variables System PATH variable.
- Try running apktool via command prompt
Decompiling APK from directory, in this case the directory is titled "ReverseEngineering":
D:\ReverseEngineering > apktool.jar d fileName.apk
After modifications are done, to recompile folder to APK from ReverseEngineering directory use the following command with apktool:
D:\ReverseEngineering > apktool.jar b fileName
Signing the apk if not signed:
- check if apk is signed:
"C:\Program Files\Java\jdk1.8.0_152\bin\keytool" -list -printcert -jarfile fileName.apk
- if not signed use the keytool in the java bin directory to sign apk:
2.1. create key signature
"C:\Program Files\Java\jdk1.8.0_152\bin\keytool" -genkey -keystore keyName.keystore -validity 1000 -alias aliasName
2.2. use jar signer to sign the apk with the key signature
"C:\Program Files\Java\jdk1.8.0_152\bin\jarsigner.exe" -keystore keyName.keystore -verbose fileName.apk aliasName
To find the Key Alias and Certificate Fingerprints: Copy keytool.exe and keystore into C:\Program Files\Java\jdk1.8.0_152\bin directory. Open the command prompt from directory and use the following command:
keytool -list -v -keystore .keystore
Or from any directory open the command prompt and use this command with path to keytool:
"C:\Program Files\Java\jdk1.8.0_152\bin\keytool" -list -v -keystore .keystore
Password for key signature can be cracked with any password cracker.