Android Application cracking (decompilation) and android Decompilation

Source: Internet
Author: User

Android Application cracking (decompilation) and android Decompilation
1. decompile apktools1. First install the JAVA environment (JDK and JRE)Set the JAVA environment variable CLASSPATH % JAVA_HOME % \ lib \ dt. jar; % JAVA_HOME % \ lib \ tools. jar JAVA_HOME C: \ Program Files \ Java \ jdk1.8.0 _ 20 Path % JAVA_HOME % \ bin; C: \ Program Files \ Java \ jre1.8.0 _ 20 \ bin2. Download apktools and decompress it.(1)download apktool_2.0.0rc4.jarand apktool-install-windows-r04-brut1.tar.bz2 address: http://code.google.com/p/android-apktool/downloads/list connector for packaging. (3) Click the Start Menu. Run the command, Enter CMD and press Enter. Run the cd command to go To the folder where the unzipping apktool-install-windows is located, and enter apktool. If some commands are displayed, the installation is successful. Of course, we can also directly store the three files in the Windows directory on drive C to directly use apktool.
3.apk tools usage(1) decompilation and Packaging CommandsDecompilation command: usage: apktool d [ecode] [options] <file_apk>-f, -- force Force delete destination directory. -o, -- output <dir> The name of folder that gets written. default is apk. ou t-p, -- frame-path <dir> Uses framework files located in <dir>. -r, -- no-res Do not decode resources. -s, -- no-src Do not decode sources. -t, -- frame-tag <tag> Uses framework files tagged by <tag>. packaging command: usage: apktool B [uild] [options] <app_path>-f, -- force-all Skip changes detection and build all files. -o, -- output <dir> The name of apk that gets written. default is dist/name. apk(2) store the apk application to the current directory (which is assumed to be the root directory of the d disk) and decompile
Then, the decompiled folder "2015" is displayed in the current directory"Ii. Repackage apktools
After modifying the cracked apk, You can package it back to the APK file and run the following command:Apktool B <decode_dir>And then we can see the packaged APK in the current directory. The apk cannot be installed because it has no signature. In this case, you can use the keytool to generate a certificate (. keystore file), and use the jarsigner tool to sign the apk application.The procedure is as follows::1. Use apktool to rewrite and package into apkDecompress the modified application source code and package it back to apk. you must use two tools: aapt.exe and apktool. jar. Download the latest version of aapt.exe (which can also be copied from the build-tools directory of the Android SDK) and apktool from the Google official website.
2. Use keytool to generate a signature certificateKeytool-genkey-v-keystore 2015. keystore-alias 2015. keystore-keyalg RSA-validity 20000 Description: 1) keytool is the tool name.-genkey indicates that the digital certificate generation operation is executed, and-v indicates that the certificate generation details are printed out, display in dos window; 2)-keystore 2015. keystore indicates that the generated digital certificate is named "2015. keystore "; 3)-alias 2015. keystore indicates that the certificate alias is "2015. keystore ", of course, can not be the same as the above file name; 4)-keyalg RSA indicates that the algorithm used to generate the key file is RSA; 5) -validity 20000 indicates that the digital certificate is valid for 20000 days. It means that the certificate will expire after 20000 days. When you execute the preceding command to generate a digital certificate file, you will be prompted to enter some information, includes the password of the certificate, for example:Note: After the command is successfully executed, the system generates a "2015. keystore" certificate in the current directory (C: \ Users \ jiangdongguo.3. Use the jarsigner tool to sign Android applicationsJarsigner-verbose-keystore 2015. keystore -signedjar2015_signed.apk 2015.apk 2015. keystore Description: 1) jarsigner is the tool name.-verbose indicates that the detailed information in the signature process is printed and displayed in the dos window; 2)-keystore 2015. keystore indicates the location of the digital certificate used for the signature. There is no write path here, indicating that it is in the current directory; 3)-signedjar 2015_signed.apk 2015.apk success; 4) 2015 at the end. keystore indicates the certificate alias, which corresponds to the name comment after the-alias parameter when the digital certificate is generated: keytool: the tool is located in the bin directory of the jdk installation path; jarsigner tool: the tool is located in the bin directory of the jdk installation path;

Iii. FAQs

1. about installing and managing framework files

1. $ apktool d HtcContacts.apk 2. i: Loading resource table... 3. i: Decoding resources... 4. i: Loading resource table from file:/home/brutall/apktool/framework/1.apk 5. w: cocould not decode attr value, using undecoded value instead: ns = android, name = drawable, value = 0x02020542 6 .... 7. w: cocould not decode attr value, using undecoded value instead: ns = android, name = icon, value = 0x02020520 8. can't find framework resources for package of id: 2. you must install proper framework files, see project website for more info .......... w: cocould not decode attr value, using undecoded value instead: ns = android, name = hardwareAccelerated, value = 0xffffffff...

Cause: the C: \ Users \ jiangdongguo \ apktool \ framework \ 1.apk version is too low.You do not need to do anything else before using apktool for decompilation. However, some vendors, such as HTC and Samsung, have customized framework files and used them in their system applications, to decompile these apk files properly, you must copy the framework file from your device and install it in apktool.

Solution:


Put the framwork-res.apk file in the root directory of drive D.

2. An error occurred while defining public. xml resources.


Cause:

In fact, many other problems may occur during the compilation process, most of which are caused by deletion, modification, and addition of resources without modifying the res \ values \ public. xml file.

Solution

(1) Resources in the public. xml file cannot be defined repeatedly.

(2) the IDs of any two resources in the public. xml file cannot be the same.

(3) the file must be located for the resources defined in the public. xml file. (If you delete some files, you must delete the corresponding row in public. xml)

(4) Make sure the public. xml file is as comprehensive as possible (if you have added a resource, make sure it is also added in public. xml)

(5) The resource IDs in the public. xml file are as continuous as possible (when you add a declaration for the added file, the IDs are as continuous as possible)

Summary: The Ghost tool is directly stored in the Windows directory of the system disk (C.

Reference: http://blog.csdn.net/lyq8479/article/details/6401093http://www.cnblogs.com/CuriosityWzk/archive/2012/01/06/2315150.html

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.