Skip to content

Instantly share code, notes, and snippets.

@jcalabres
Last active June 27, 2020 10:37
Show Gist options
  • Save jcalabres/9573da948dfc068d4e43e8b092d3efc8 to your computer and use it in GitHub Desktop.
Save jcalabres/9573da948dfc068d4e43e8b092d3efc8 to your computer and use it in GitHub Desktop.
Automates unpacking process.
# by jcalabres
"""
$1=APK PATH
"""
import os
from os import system
from sys import *
PRODUCTION=False
UNPACKER="FRIDA-DEXDump"
if __name__ == "__main__":
if len(argv)<2:
print("python3 monkey_dump.py MYAPK.apk")
exit(0)
else:
apk=argv[1]
package=os.path.split(apk)[1].split('.apk')[0]
cmd="su -c" if PRODUCTION else ""
system("adb install {}".format(apk))
if not os.path.isdir(UNPACKER):
system("git clone https://github.com/hluwa/FRIDA-DEXDump.git {}".format(UNPACKER))
system("adb shell {} /data/local/tmp/frida-server &".format(cmd))
system("adb shell monkey -p {} 1".format(package))
system("python3 {}/main.py".format(UNPACKER))
system("zip -rj {}.zip {}".format(package,package))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment