Java编译器自动重命名参数(混淆) [英] Java compiler automatically renaming parameters (obfuscating)

查看:36
本文介绍了Java编译器自动重命名参数(混淆)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我编译我正在编写的代码时,然后在 JD Gui 中查看,方法显示的标题如下所示:

When I compile the code I am writing, then look at in a a JD Gui, methods show up with headers such as the following:

public void growSurface(Random paramRandom, int paramInt1, int paramInt2){

我正在编译一个 .bat 文件.有没有办法指定我不想混淆代码.

I am compiling through a .bat file. Is there a way to specify that I don't want to obfuscate the code.

推荐答案

默认情况下 javac 不包括生成的 class 文件中的调试信息.该信息是例如方法参数名称(但始终存储方法和字段名称以允许反射).当参数名称未知时,JD-GUI 和其他反编译器会组成一些合理的名称.它们没有被混淆 - 只是它们不在那里.

By default javac is not including debug information in generated class files. This information is e.g. method parameter names (but method and field names are always stored to allow reflection). When the parameter names are not known, JD-GUI and other decompilers are making up some reasonable names. They are not obfuscated - simply they aren't there.

使用 -g 标志编译您的代码:

Compile your code with -g flag:

javac -g SomeClass.java

刚刚检查了 JD-GUI - 它显示了正确的参数名称.

Just checked JD-GUI - it shows correct parameter names then.

这篇关于Java编译器自动重命名参数(混淆)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆