简体   繁体   中英

Why do .classes files have weird-looking names in .jar file?

I decompiled a .jar file using JD-GUI, and a lot of packages that were weirdly named like a , b , c , d , and so on. It was also the same for the classes, so some of the .class files were also named like a.class , b.class and so on.

I don't believe the developers name the packages or Java files in such a way that they cannot recognize later what each file does. I believe that this is because of some other technical issues. Can someone be clear on this issue?

The Jar you've decompiled is probably protected using ProGuard :

By default, compiled bytecode still contains a lot of debugging information: source file names, line numbers, field names, method names, argument names, variable names, etc. This information makes it straightforward to decompile the bytecode and reverse-engineer entire programs. Sometimes, this is not desirable. Obfuscators such as ProGuard can remove the debugging information and replace all names by meaningless character sequences, making it much harder to reverse-engineer the code. It further compacts the code as a bonus. The program remains functionally equivalent, except for the class names, method names, and line numbers given in exception stack traces.

It is still possible to reverse engineer the program, but it's very often illegal to do so and then reuse the code (at least in the United States, the only country with which I have experience), as it's a licensing violation. People who use tools such as this one are almost always not writing open source software.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM