personal-site/content/text/android-app-decompiling.txt

52 lines
1.3 KiB
Plaintext
Raw Normal View History

2021-10-14 07:42:11 +00:00
aka hacking apk reverse engineering
Guides:
https://blog.securityevaluators.com/how-to-view-tls-traffic-in-androids-logs-6a42ca7a6e55
https://archive.ph/zDaV6
- used during Lutron hacking
Tools:
2022-03-27 09:04:34 +00:00
$ sudo apt install adb apktool openjdk-11-jdk-headless zipalign apksigner
2021-10-14 07:42:11 +00:00
$ locate apktool
- replace apktool with new version:
- https://github.com/iBotPeaches/Apktool/releases
$ sudo mv /usr/share/apktool/apktool.jar /usr/share/apktool/apktool.jar.orig
$ sudo mv ~/Downloads/apktool_2.5.0.jar /usr/share/apktool/apktool.jar
Get APK file:
- find name of the app
$ adb shell pm list packages | grep covid
- find path of the app
$ adb shell pm path ca.ab.gov.covidrecordsverifier
- pull the apk
$ adb pull [path] .
Decompile:
$ apktool d application.apk -o output/
Compile:
$ apktool b output/ --use-aapt2 -o patched.apk
2022-03-27 09:04:34 +00:00
$ zipalign 4 patched.apk patched2.apk
2021-10-14 07:42:11 +00:00
Sign:
2022-03-27 09:04:34 +00:00
- disable verification over USB in developer settings?
2021-10-14 07:42:11 +00:00
- the following just once:
$ keytool -genkey -v -keystore release.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
2022-03-27 09:04:34 +00:00
$ apksigner sign --ks release.keystore patched2.apk
2021-10-14 07:42:11 +00:00
Install:
2022-03-27 09:04:34 +00:00
$ adb install patched2.apk
2021-10-14 07:42:11 +00:00
Read logs:
$ adb logcat -c
2022-03-27 09:04:34 +00:00
Old instructions
----------------
$ jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore release.keystore patched.apk alias_name