Skip to content

Instantly share code, notes, and snippets.

@tpai
Last active March 30, 2016 02:49
Show Gist options
  • Save tpai/b5cde95fa6ad6023a40a to your computer and use it in GitHub Desktop.
Save tpai/b5cde95fa6ad6023a40a to your computer and use it in GitHub Desktop.
Android apk security note

Decompile -> Analytic -> Pack -> Sign

Tools

  • apktool
  • dex2jar
  • jd-gui
  • ilspy
  • ildasm
  • SignAPK
  • Charles

apktool

>>setup for mac

apktool d xxx.apk
apktool b xxx

ilspy && MonoDevelop

assets/bin/data/Managed/Assemvly-CSharp.dll
assets/bin/data/Managed/Assemvly-UnityScript.dll

ildasm

>>decompile il

ilasm /dll xxx.il /resource=xxx.res

dex2jar & jd-gui

classes.dex -> Smali (dalvik)

  1. from classes.dex to classes_dex2jar.jar

    dex2jar classes.dex

  2. jd-gui viewer

signapk

>>signapk official

  1. remove /META-INF

  2. sign

    java -jar signapk.jar certificate.pem key.pk8 xxx.apk xxx_Signed.apk

Ref: how-to-sign-apk-zip-files

Mobile APP Reverse

  • Assets Hack (China)
    • Unzip > Modify > remove /META-INF > SignAPK
  • Unity Hack
    • ilSpy & ildasm
  • Packets Hack
    • dex2jar > apktool d > smali > apktool b > signapk
  • Charles Proxy + WireShark

Defense

Ref:

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