Dizzy Dream of Android Development

These are my personal notes.

Sign APK

1. Generate Keystore (Only Once)

keytool -genkey -v -keystore chaos.keystore -keyalg RSA -keysize 2048 -validity 10000 -alias app

2. Zipalign

/home/chaos/Android/Sdk/build-tools/26.0.1/zipalign -p -v 4 '/home/chaos/Websites/App/chaos/app-release.apk' '/home/chaos/Websites/App/chaos/chaos-1.0.6-aligned.apk'

3.Sign & Verify

The script file can be found in %ANDROID_HOME%/sdk/build-tools/24.0.3/ (the .jar is in the /lib subfolder). Use it like this

/home/chaos/Android/Sdk/build-tools/26.0.1/apksigner sign --ks '/home/chaos/.apkstudio/vendor/chaos.keystore' --out '/home/chaos/Websites/Nethunter/themes/Dreamhunter/source/app/download/chaos-1.0.6.apk'  '/home/chaos/Websites/App/chaos/chaos-1.0.6-aligned.apk' 

Verify:

/home/chaos/Android/Sdk/build-tools/26.0.1/apksigner verify '/home/chaos/Websites/App/chaos/chaos-1.0.6.apk'

Decomplie

Tools

Apktool:

apktool d chaos.apk
apktool b chaos

Apk Studio:

'/home/chaos/Softwares/APK Studio/apkstudio/apkstudio'
Install Qt5 on Debian
apt install qt5-default qttools5-dev-tools

Replace and Delete something

Keywords: license, License, link

cd /home/chaos/Websites/App/chaos/app-release/
  • io/xxxxx/android/a/a$c.smali, etc.

    • Remove the link, array-data
  • sed -i s/Toast/Toastr/g `grep Toast -rl ./`

    • Except android/d.smali and android/d$c.smali

Commands:

sed -i s/Toast/Toastr/g `grep Toast -rl /home/chaos/Websites/App/chaos/app-release/`
grep -r xxxx.io /home/chaos/Websites/App/chaos/app-release/

Check Download Permisson:

grep -r download /home/chaos/Websites/App/chaos/app-release/
grep -r Download /home/chaos/Websites/App/chaos/app-release/

Summary

  1. Decomplie

  2. Remove a$c.smali link and array_data

  3. Turn Toast to Toastr in a$c.smali

  4. Remove b$a.smali link

  5. Remove b$b.smali link

  6. Remove v.smali link

  7. Build

  8. Sign