"Goto definition" in decompiler mode may not match bytecode reference due to name shadowing
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- java
调研方向
首先,在反编译器模式下使用一个默认包中的类和一个同包的混淆类重现 "Goto definition" 失败,然后将字节码引用与 Recaf 选择的类进行比较。检查涉及 CFR 和汇编器视图的反编译器导航与名称解析路径。完成标准是导航打开被引用的类,而不是打开遮蔽它的类。
由索引模型根据 Issue 内容生成。
描述
While I was working on an obfuscated jar, I found a bug that causes you to find yourself in a random class that is not even relevant to what you would expect. Let me introduce a few images to explain.
I was on a pretty clean class and I though there was no problem to use "Goto definiton" option.

I used it and... I was here...

I was expecting a Packet class but I found a Predicate, my mind just blowed first time I faced this bug
Fortunately, I found a way to find the actual class after I let go of my persistent thoughts about a "clean class". I just opened it in the assembler.

It was the actual class. But it was in the default package. This is where the problem starts...
As Java do not allow importing classes in default package from a non-default package class and the other way around (since Java 1.5), we can't import like that. So, CFR couldn't put the import statement of that class. But Recaf somehow recognizes this class as a same-package class I guess (because there is no import statement for that) and redirects me to the same-packaged class. (Both Predicate class named j1 and it's initializer class are in the net.minecraft package)
- 主要语言
- Java
- 星标
- 7.5k
- 派生
- 549
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Col-E/Recaf 的其他 Issue
-
Copy/paste broken on Linux: ClassCastException (HeapByteBuffer → byte[]) in ClipboardActions.paste未关闭3rd party problem bug
难度 2/5 1-3 小时 新手友好度 68/100
-
enhancement
难度 4/5 3-5 天 新手友好度 52/100
-
enhancement
难度 4/5 3-5 天 新手友好度 48/100
-
enhancement
难度 5/5 一周以上 新手友好度 35/100
-
enhancement
难度 4/5 3-5 天 新手友好度 25/100
相似的 Issue
-
needs discussion
难度 2/5 1-3 小时 新手友好度 78/100
openfga/openfga.dev#1436 · 1 条评论 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 77/100
jooby-project/jooby#4047 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
MinecraftForge/MinecraftForge#10926 ·
维护者通常 1 天内回复
-
Bug feat:Syntax
难度 2/5 1-3 小时 新手友好度 80/100
ignatov/intellij-erlang#1342 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
commons-app/apps-android-commons#7379 · 3 条评论 ·
维护者通常 1 天内回复