Java decompilation jar package and Android APK (similar to. Net reflector)

Source: Internet
Author: User
Tags reflector
JD-GUI

This JD-GUI can decompile the jar package, the usage is to open the jar package directly browse.

 

JD-Eclipse

JD-Eclipse is an Eclipse plug-in. The installation method is to open eclipse, and the menu is help-> install new software... InputHttp://java.decompiler.free.fr/jd-eclipse/update, And then install it all the way. After downloading the plug-in Realignment for JD-Eclipse, copy it to the plug-in directory of eclipse and restart. Then configure the default open mode: Eclipse, menu window-> preference-General-Editors-File Association-*. Class, and set realignment for JD class file editor to default. Save it.

Create a project in eclipse, add a directory named Lib, and copy all the jar packages that need to be decompiled from the machine. Right-click the Directory and choose paste. Set the project's compile path to add those jar files to libraries, so that you can open each jar package. You can also jump.

 

Jad command

Download jad.exe first. This is a batchcompute command line tool with no interface and can only process. class files. You can decompress all jar packages using WinRAR or 7z to a directory named classes, and then write a bat batch file with the following content:

Jad.exe-r-FF-D Src-s Java classes/**/*. Class

This will decompile the file into *. java. Of course, the disadvantage is that the directory is gone.

 

 

If you want to batch process a large number of jar packages (assuming under the jars directory), you can do this:

 

1. Select All jar packages under the jars directory, right-click and choose 7z to decompress: Decompress *\
2. In this way, all jar packages can be decompressed to a directory with the same name as the jar package file.
3. Register path in the system environment variable: register the current Jad path
4. Run the script Jad-r-sjava jars/**/*. Class in cmd.
Before Running chdir/d to the jars directory level directory
5. In this way, you can decompile all the files into *. Java in batches without damaging the original directory structure.
6. In this way, you can search for files in Notepad ++.

 

 

 

Decompilation of Android APK

The first step is to rename the APK as zip and decompress it, and then use dex2jar to process the classes. Dex. The method is to copy classes. Dex to the directory where dex2jar. bat is located. Locate the directory of dex2jar. bat in the command line, run dex2jar. Bat classes.dex, generate classes.dex.dex2jar.jar, run jd-gui(jd-gui.exe), open the jar package generated above, and you will seeSource code. If you want to process the resource files, configuration files, images, and so on, you can use the apktool tool.

 

Decompilation

Even if you get all the *. java files, you may still not be able to compile them properly, because it is unclear about the dependencies between various projects, as well as resource files and configuration files. In short, the bigger the project, the more confusing the project, the more difficult it is to deal.

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.