java - 为什么 JD-GUI 每行都加上注释和行号?

标签 java decompiling jad jd-gui

这个问题我遇到过好几次了。每当我反编译某些东西并使用 JD-GUI 保存所有源代码时,它都会在每一行前面加上一个 block 注释,并在方法主体中插入代码的行号。这是我刚刚反编译的 jar 中的一个示例:

/*    */   public void onEnable()
/*    */   {
/* 25 */     List DropList = new ArrayList();
/* 26 */     DropList.add(Integer.valueOf(264));
/* 27 */     DropList.add(Integer.valueOf(57));
/* 28 */     DropList.add(Integer.valueOf(278));
/*    */ 
/* 30 */     this.config = getConfig();
/*    */ 
/* 32 */     this.config.addDefault("GiftDrops", DropList);
/* 33 */     this.config.addDefault("DropRate", Integer.valueOf(0));
/* 34 */     this.config.addDefault("GiftBoxPlayerSkin", "lol768");
/* 35 */     this.config.addDefault("CraftingRecipe.LineOne", "339,339,339");
/* 36 */     this.config.addDefault("CraftingRecipe.LineTwo", "339,264,339");
/* 37 */     this.config.addDefault("CraftingRecipe.LineThree", "339,339,339");
/*    */ 
/* 39 */     this.config.options().copyDefaults(true);
/* 40 */     saveConfig();
/*    */ 
/* 43 */     SkullMeta giftboxskull = (SkullMeta)this.giftbox.getItemMeta();
/*    */ 
/* 45 */     giftboxskull.setOwner(this.config.getString("GiftBoxPlayerSkin"));
/* 46 */     giftboxskull.setDisplayName(ChatColor.GREEN + "Gift Box");
/* 47 */     this.giftbox.setItemMeta(giftboxskull);
/*    */ 
/* 49 */     this.giftboxrecipe = new ShapedRecipe(this.giftbox);
/* 50 */     this.giftboxrecipe.shape(new String[] { "123", "456", "789" });
/*    */ 
/* 52 */     String[] LineOne = getConfig().getString("CraftingRecipe.LineOne").split(",");
/* 53 */     String[] LineTwo = getConfig().getString("CraftingRecipe.LineTwo").split(",");
/* 54 */     String[] LineThree = getConfig().getString("CraftingRecipe.LineThree").split(",");
/*    */ 
/* 56 */     this.giftboxrecipe.setIngredient('1', new ItemStack(Integer.parseInt(LineOne[0])).getData());
/* 57 */     this.giftboxrecipe.setIngredient('2', new ItemStack(Integer.parseInt(LineOne[1])).getData());
/* 58 */     this.giftboxrecipe.setIngredient('3', new ItemStack(Integer.parseInt(LineOne[2])).getData());
/* 59 */     this.giftboxrecipe.setIngredient('4', new ItemStack(Integer.parseInt(LineTwo[0])).getData());
/* 60 */     this.giftboxrecipe.setIngredient('5', new ItemStack(Integer.parseInt(LineTwo[1])).getData());
/* 61 */     this.giftboxrecipe.setIngredient('6', new ItemStack(Integer.parseInt(LineTwo[2])).getData());
/* 62 */     this.giftboxrecipe.setIngredient('7', new ItemStack(Integer.parseInt(LineThree[0])).getData());
/* 63 */     this.giftboxrecipe.setIngredient('8', new ItemStack(Integer.parseInt(LineThree[1])).getData());
/* 64 */     this.giftboxrecipe.setIngredient('9', new ItemStack(Integer.parseInt(LineThree[2])).getData());
/*    */ 
/* 66 */     getServer().addRecipe(this.giftboxrecipe);
/*    */ 
/* 68 */     getServer().getPluginManager().registerEvents(new GiftBoxEventListener(this), this);
/*    */   }

这似乎是 JD-GUI 必须阻止人们使用他们通过编译获得的源文件的功能。我可以使用 bash 命令相当轻松地删除所有这些评论,但这仍然很烦人。有没有办法禁用此功能?

最佳答案

在“帮助”->“首选项”中,在“资源保存”组下,取消选中“显示行号”

关于java - 为什么 JD-GUI 每行都加上注释和行号?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25151153/

相关文章:

debugging - 反编译 1990 DOS 应用程序

c++ - 如何将 DLL 反转为 C++ 代码?

java - 有没有办法让 jadclipse 与 Eclipse 3.4 一起工作?

eclipse - jadclipse 反编译报告期间出错

java - arrayList for 循环到 hashMap 的大小显示是正确的,但元素少了一个。没有使用重复的 key

java - 是否可以断言元素的组合

java - Maven 正在拉取旧版本的 HTMLUnit,即使我指定了最新的(?)

java - 当我尝试调试单个单元测试时,IntelliJ IDEA 运行完整的测试套件

java - 阻碍android应用程序的反编译?

java - JADClipse 不适用于 Eclipse 3.6