Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to confuse Android code

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces "how to confuse Android code". In daily operation, I believe many people have doubts about how to confuse Android code. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubts of "how to confuse Android code"! Next, please follow the editor to study!

Apk can be unzipped directly, and then it can be easily decompiled into .java. I looked for it, and sure enough, it all took only a minute:

1. Get the classes.dex file; open the .apk file directly with the decompression software on your machine, and extract the classes.dex file.

2. Restore the .jar file; this step requires the use of a tool dex2jar (Google has http://code.google.com/p/dex2jar/ in its code base)

After downloading, extract it, and then put the product of step * * (that is, the classes.dex file) into the unzipped directory of dex2jar.

Cmd command line, change the directory to the directory of dex2jar:

"dex2jar.bat classes.dex"

After seeing the "Done" on the command line, there will be a "classes.dex.dex2jar.jar" file in the dex2jar folder. This is the legendary jar package.

3. Check the .jar file; this step is the traditional decompilation, which requires tool assistance. The tool I use here is jd-gui (http://java.decompiler.free.fr/?q=jdgui).

Download the corresponding version of your system, unzip it, and you will see a .exe file, double-click, and select the .jar generated in step 2. Well, is your project fully restored?

Very simple steps can expose the code.

So how do you confuse our code?

Create a new 2.3.3 project and you will see that there is a proguard.cfg file in the project file. Google has done so much for us, but it is a pity that it started from 2.3. what should I do with my miserable project (based on 2.2 sdk)?

Oh, no, you just need to copy the proguard.cfg file to your old project.

Of course, this is not enough, because google does not confuse the project by default:

To enable ProGuard so that it runs as part of an Ant or Eclipse build, set the proguard.config property in the / default.properties file. The path can be an absolute path or a path relative to the project's root.

Google tells us that we need to configure default.properties.

Well, add proguard.config=proguard.cfg, OK, generate a new .apk file again, and then decompile your project using the method above, and you'll see aa bb cc's package, aa bb cc's class, and aa bb cc's variable name, method name.

And look at the proguard.cfg file.

-optimizationpasses 5-dontusemixedcaseclassnames-dontskipnonpubliclibraryclasses-dontpreverify-verbose-optimizations! code _ }-keepclasseswithmembernames class * {public (android.content.Context, android.util.AttributeSet);}-keepclasseswithmembernames class * {public (android.content.Context, android.util.AttributeSet, int);}-keepclassmembers enum * {public static * * [] values (); public static * * valueOf (java.lang.String);}-keepclass * implements android.os.Parcelable {public static final android.os.Parcelable$Creator * At this point, the study on "how to confuse Android code" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report