Use Baksmali and Smali to modify APK and package

Source: Internet
Author: User

Using Baksmali and SmaliModify APK and Package

Download The tool, please Google yourself.

Sometimes an error occurs when you use the Apktool anti-compilation apk to modify the Smali file before making a build, in which case you can try a later version of Apktool.

If the later version of the Apktool still can not succeed, there is a bit of trouble, you can modify the Apktool, but this large-scale technology, I still do not.

In this case, you can choose to use baksmali+Smali to modify and repackage the APK.

1. First unzip the apk file to get the Classes.dex file

2. Use Baksmali to decompile the Classes.dex
The command is: java-jar baksmali.jar-o classout/classes.dex

3. The smali file of the anti-compilation exists./classout.

4. The smali file in the Classout directory can be modified at this time
After modification, the Smali. Jar will be used to recompile the Smali directory to Classes.dex

5. Replace the original Classes.dex with the new Classes.dex plug-in APK package using the compression tool

It is to be explained here that the generated Smali file using the Baksmali.jar decompile uses the Baksmali syntax, which is slightly different from the Smali syntax generated by Apktool anti-compilation .

6. After replacing the Classes.dex file in the APK package, you need to re-sign the APK to install

Use Baksmali and Smali to modify APK and package

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.