Android Basics Beginner Tutorial--1.10 anti-compilation apk wins replacement code & resources

Source: Internet
Author: User

Android Basics Beginner Tutorial--1.10 anti-compilation apk wins replacement code & Resources

tags (space delimited): Android Basics Beginner Tutorial

Introduction to this section:

"Anti-compilation apk". It looks as if it's a very high-end look, in fact, it's through some anti-compilation software. Decompile our apk to get the program's source code, images, XML resources and other files. Do not know if you have done so, see a person's app interface done very beautifully, or you fancy someone else's picture material, simple point, we can download others apk. Then change the suffix name to Xxx.zip. Then unzip:
The author randomly extracted an apk:

We are able to open the Res folder and get the picture material inside

But. This scheme will only get some. png, or. jpg Such a bitmap file resource, which is assumed to be an XML class resource, open we will find is garbled. And if we want to see the APK program Java code, it will not work, because they are packed into the Classes.dex file!
But the anti-compilation can solve your need ~ Also, do not take anti-compilation to do illegal things. For example, the other people's apk once again after packaging use their own signature and then published to the relevant market ... In addition, we are involved in other people's code, not completely copy!

!!

Remember!

1. Three tools to prepare
  1. Apktool: Gets the resource file. Extract picture files, layout files, and other XML resource files
  2. Dex2jar: decompile the apk into Java source code (convert Classes.dex to jar file)
  3. Jd-gui: View the converted jar file in 2, that is, view the Java file
    For the convenience of readers, here are three packaged together in a cloud disk, and need to be able to download:
    Anti-compilation related three tools. zip
2. Use Apktool decompile apk to get pictures and XML resources:

Unzip the downloaded Apktool. We can see the following files (ignoring those two csdn. One is the anti-compilation apk. One is a post-compilation file):


Next. Double-click Cmd.exe, go to the command line, type:
Apktool.bat D csdn.apk can. Enter ENTER:

Then you'll be able to see the generated Csdn folder, where we want the resources

Okay, that's the XML resource. The picture material is also hand in hand!

3. Convert the Classes.dex to a jar file using Dex2jar:

Unzip the downloaded Dex2jar folder, and the Classes.dex copy of the APK after decompression to the folder where Dex2jar.bat is located:

Open cmd and come to this folder: type:d2j-dex2jar.bat classes.dex

And then we can see. A jar package was generated:


OK, the conversion is complete!

4. Use Jd-gui to view the Java code in the jar package:

Okay, open the Jd-gui folder.

After opening. Open the converted jar package in our 3. We can see the code inside:


CSDN's client doesn't confuse the code ... May be in the spirit of open source, to learn the code for us! In general, the APK release will
And then make some encryption, or use a third-party encryption platform. With more than the "Love Encryption", interested in Baidu also self-view more specific introduction.

This section summarizes:

Good. The anti-compilation of APK is introduced here. Believe that you have been ready to try, then try it, and finally remind one, don't do bad things! Respect the fruits of others ' work. Other than that. About the first chapter of environmental construction and some of the frequent use of development skills to get here, the next section begins with a tutorial in the second chapter of this series--android the use of UI control often learning!

Because of the related basic control more, is expected to have dozens of, assume that the control may not be interesting, may be written in parallel tutorial, every day to learn a control + a little other knowledge points so, I want to conceive the idea, please look forward to ~ Thank you ~

Android Basics Beginner Tutorial--1.10 anti-compilation apk wins replacement code & resources

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.