Skip to content

Instantly share code, notes, and snippets.

@MacKentoch
Last active August 8, 2021 19:35
Show Gist options
  • Save MacKentoch/8fb369d08beba6725e4e22800c33beb4 to your computer and use it in GitHub Desktop.
Save MacKentoch/8fb369d08beba6725e4e22800c33beb4 to your computer and use it in GitHub Desktop.

🔎Analyse assets (decompile <-> re-compile apk)

Using apktool you can decode resources to nearly original form and rebuild them after making some eventual modifications.

Grab apktool

brew install apktool

Download an APK or copy one off your (rooted) phone

Decompile the apk

apktool d my-cool.apk

Open up the smali source folder and edit the sources (not in JAVA but smali code. If you need a better code inspection check following dex2jar and JD-JUI).

Recompile the apk after making changes

apktool b my-cool.apk

🔎Analyse source code

Grab dex2jar and JD-JUI

brew install dex2jar

Download JD-GUI (or Github link)

Analyse source code

Apk to JAR:

d2j-dex2jar MY_APP.apk

Use JD_JUI to anayse source code

Open jd-gui.app and then pick MY_APP.jar

If JD-GUI won't open follow pilist changes: java-decompiler/jd-gui#360

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment