Skip to content

Instantly share code, notes, and snippets.

@turicas
Created July 9, 2015 22:33
Show Gist options
  • Save turicas/8edaf1c52d23f687a81b to your computer and use it in GitHub Desktop.
Save turicas/8edaf1c52d23f687a81b to your computer and use it in GitHub Desktop.
Decompile Android from APK
#!/bin/bash
# Download dex2jar:
#URL=https://github.com/pxb1988/dex2jar/releases/download/2.0/dex-tools-2.0.zip
#wget $URL -O /tmp/dex-tools.zip
#cd /tmp
#unzip dex-tools.zip
#cd dex2jar-2.0
#chmod +x *.sh
# Download jd:
#URL=http://jd.benow.ca/jd-gui/downloads/jd-gui-0.3.5.linux.i686.tar.gz
#wget $URL -O /tmp/jd-gui.tar.gz
#cd /tmp
#tar xfz jd-gui.tar.gz
# Env:
dex2jar="/tmp/dex2jar-2.0/d2j-dex2jar.sh"
jd="/tmp/jd-gui"
# Input:
apk=$1
apk2=$(basename $apk)
# Config:
classes="/tmp/$apk2-classes.dex"
jar_filename="/tmp/$apk2-classes.jar"
unzip -p $apk classes.dex > $classes
$dex2jar $classes -o $jar_filename
$jd $jar_filename
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment