- Apktool:http://ibotpeaches.github.io/apktool/install/Latest Version 2.0.1
- Dex2jar:https://github.com/pxb1988/dex2jar Latest Version 2.0
- jd-gui:http://jd.benow.ca/Latest Version 1.4.0
The installation of the three software Apktool a little trouble, others are OK, basically downloaded down to be able to use the decompression.
Installation of Apktool on Mac
1, found in the website link below:
Basically follow the above 6 steps to OK. The first step is to download a shell script, save the name is "Apktool", do not take the. sh suffix. You can copy it to Sublimetext and save it under.
2, download the latest apktool-2, on the BitBucket:
3. Rename the downloaded jar file to "Apktool.jar"
4, put the shell script "Apktool" and "Apktool.jar" in the "/usr/local/bin" directory
5, add these two files executable permissions, chmod a+x file
6, execute the shell apktool is OK.
After the installation is complete, you can run Apktool-v to view version information:
Apktool v2.0.1-a tool for reengineering Android apk fileswith smali v2.0.6 and Baksmali v2.0.6copyright to Ryszard Wi? Niewski <[email protected]>updated by Connor Tumbleson <[email Protected]>usage:apktool-Advance,--Advanced Prints advance information. -Version,--version prints the versionThen Exitsusage:apktool if|install-framework [options] <framework.apk>-P,--Frame-path <dir>Stores framework files into <dir>. -T,--tag <tag>Tag frameworks using <tag>.usage:apktool D[ecode] [options] <file_apk>-F,--ForceForce Delete Destination directory. -o,--Output <dir>The name of the folder that gets written.Default is Apk.out-P,--Frame-path <dir>Uses Framework Files locatedIn <dir>. -R,--No-resDonot decode resources.-s,--no-src do Span class= "Hljs-keyword" >not decode sources. -t,--frame-tag <tag> uses framework files tagged by <tag>. Usage:apktool b[uild] [options] <app_path>-f,--force-all skip Changes detection and build All files.-o,--output <dir> the name of the apk that gets written. default is dist/name.apk-p,--frame-path <dir> uses framework files located in <dir>. For additional info, see:http://ibotpeaches.github.io/apktool/for Smali/baksmali info, see:http://code.google.com/p/ smali/
Installation of Dex2jar and Jd-gui
These two are downloaded directly and then decompressed on OK:
The installation of the software said this, the following is the process of cracking. In order to detect whether it can be cracked, we first use Apktool anti-compilation, lest we last empty. (Only Apktool can decompile/compile, our hack is meaningful).
1. Create a new apk folder, put the apk you want to decipher, and then go to this directory to run the command: Apktool D hongbao.apk
yanzidemacbook-pro:apk yanzi$ Apktool D hongbao.apki: using apktool 2.0.1 on Hongbao.apki:loading Resource Table ... i:decoding androidmanifest.xml with resources ... i:loading Resource table from file:/users/yanzi/library/apktool/framework/1.apki:regular manifest package ... i:decoding file-resources ... i:decoding values */* xmls ... i:baksmaling classes.dex ... i:copying assets and Libs ... i:copying unknown files ... i:copying original files ...
The directory is as follows:
Then run the command back to compile the APK:
Apktool b Hongbao (Hongbao is the anti-compiled folder)
yanzideMacBook-Pro:apk yanzi$ apktool b hongbaoI: Using Apktool 2.0.1I: Checking whether sources has changed...I: Smaling smali folder into classes.dex...I: Checking whether resources has changed...I: Building resources...I: Building apk file...
The above build and dist is what is generated during the APK process, the compiled apk in the Dist directory, open build/apk folder will find less original folder under the Meta-inf folder:
It means that the apk file in the dist is unsigned and will be discussed later.
2, we want to use Dex2jar to turn the apk into a jar file, in essence, the APK classes.dex into a jar. Add d2j_invoke.sh/d2j-dex2jar.sh in Dex2jar to execute permissions. Then go to dex2jar this folder to run:
./d2j-dex2jar.sh/users/yanzi/apk/hongbao.apk
Get the Hongbao-dex2jar.jar file.
3, open the Jd-gui, will hongbao-dex2jar.jar drag into the source of the see.
By looking at the Java source code comparison Smali file, modified back to compile on OK!
How do I manually add a signature to an APK?
The post-compilation apk is not successfully installed and always prompts
Failure [Install_parse_failed_unexpected_exception]
The substance is not signed.
1, Generate Signature:
-genkey -keystore hongbao.keystore -keyalg RSA -validity 10000 -alias hongbao
Note: The above-keystore followed by the name of the signature file, and-alias is the alias, generally-keystore behind-alias is the same, but in fact there is no relationship between the two, which is why I deliberately made a different reason.
2. Add signature to APK:
-digestalg SHA1 -sigalg MD5withRSA -tsa -verbose -keystore hongbao.keystore -signedjar hongbao-signed.apk hongbao.apk hongbao
Attention:
1, the last "Hongbao" is-alias back belt, must be consistent.
2, if not with-digestalg Sha1-sigalg Md5withrsa signed APK installation is also unsuccessful, said Install_parse_failed_no_certificates error, If you do not bring-tsa, you will be warned of a time.
The download of the attachments mentioned in the article:
- Apktool
- Dex2jar
- Jd-gui
Transferred from: http://blog.csdn.net/yanzi1225627/article/details/48215549
Mac Apktool Configuration