Tool for reverse engineering 3rd party, closed, binary Android apps. It can decode resources to nearly original form and rebuild them after making some modifications.
Commands
Decode
# Decode apk/file to a folderapktooldpackage.apk-opackage# Options:-b:donotwritedebuginfo-f:forcedeletedestinationfolder-k:useiftherewasanerrorandsomeresourcesweredropped-m:keepfilestoclosesttooriginalaspossible (prevent rebuilds)-o:outputfolder (default: apk.out)-p:useframeworkfileslocatedin<folder>-r:donotdecoderesources-s:donotdecodesources-t:useframeworkfilestaggedby<tag>
Build
# Build an apk/jar file from folderapktoolbpackage-opackage.apk# Options:-a:loadaaptfromspecifiedlocation-api:numericapi-levelofthefiletogenerate-c:copyoriginalAndroidManifest.xmlandMETA-INF-d:setandroid:debuggableto"true"intheAPK's compiled manifest-f: skip changes detection and build all files-n: add generic network security configuration file in the output apk-nc: disable crunching of resource files during the build step-o: that name of apk that gets written (default: dist/name.apk)-p: use framework files located in <folder>
How to rebuild a modified apk
# Decompile apkapktoolpackage.apk# Modify the files that you want!!# Rebuild apkapktoolbpackage# Generate the key to signkeytool-genkey-keystore<name>.keystore-alias<name>-keyalgRSA# Sign the apk with the keyjarsigner-keystore<name>.keystorepackage.apk<name>