Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
keyescgm
jadx
提交
381405ea
J
jadx
项目概览
keyescgm
/
jadx
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
J
jadx
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
381405ea
编写于
1月 25, 2022
作者:
S
Skylot
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: always use deep resolve for fields and methods (#1357)
上级
ae5c0039
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
11 addition
and
25 deletion
+11
-25
jadx-core/src/main/java/jadx/core/codegen/InsnGen.java
jadx-core/src/main/java/jadx/core/codegen/InsnGen.java
+3
-3
jadx-core/src/main/java/jadx/core/dex/nodes/RootNode.java
jadx-core/src/main/java/jadx/core/dex/nodes/RootNode.java
+4
-18
jadx-core/src/main/java/jadx/core/dex/nodes/utils/MethodUtils.java
.../src/main/java/jadx/core/dex/nodes/utils/MethodUtils.java
+1
-1
jadx-core/src/main/java/jadx/core/dex/visitors/ClassModifier.java
...e/src/main/java/jadx/core/dex/visitors/ClassModifier.java
+1
-1
jadx-core/src/main/java/jadx/core/dex/visitors/MarkMethodsForInline.java
...ain/java/jadx/core/dex/visitors/MarkMethodsForInline.java
+1
-1
jadx-core/src/main/java/jadx/core/utils/InsnUtils.java
jadx-core/src/main/java/jadx/core/utils/InsnUtils.java
+1
-1
未找到文件。
jadx-core/src/main/java/jadx/core/codegen/InsnGen.java
浏览文件 @
381405ea
...
@@ -172,7 +172,7 @@ public class InsnGen {
...
@@ -172,7 +172,7 @@ public class InsnGen {
private
void
instanceField
(
ICodeWriter
code
,
FieldInfo
field
,
InsnArg
arg
)
throws
CodegenException
{
private
void
instanceField
(
ICodeWriter
code
,
FieldInfo
field
,
InsnArg
arg
)
throws
CodegenException
{
ClassNode
pCls
=
mth
.
getParentClass
();
ClassNode
pCls
=
mth
.
getParentClass
();
FieldNode
fieldNode
=
pCls
.
root
().
deepR
esolveField
(
field
);
FieldNode
fieldNode
=
pCls
.
root
().
r
esolveField
(
field
);
if
(
fieldNode
!=
null
)
{
if
(
fieldNode
!=
null
)
{
FieldReplaceAttr
replace
=
fieldNode
.
get
(
AType
.
FIELD_REPLACE
);
FieldReplaceAttr
replace
=
fieldNode
.
get
(
AType
.
FIELD_REPLACE
);
if
(
replace
!=
null
)
{
if
(
replace
!=
null
)
{
...
@@ -210,7 +210,7 @@ public class InsnGen {
...
@@ -210,7 +210,7 @@ public class InsnGen {
}
}
code
.
add
(
'.'
);
code
.
add
(
'.'
);
}
}
FieldNode
fieldNode
=
clsGen
.
getClassNode
().
root
().
deepR
esolveField
(
field
);
FieldNode
fieldNode
=
clsGen
.
getClassNode
().
root
().
r
esolveField
(
field
);
if
(
fieldNode
!=
null
)
{
if
(
fieldNode
!=
null
)
{
code
.
attachAnnotation
(
fieldNode
);
code
.
attachAnnotation
(
fieldNode
);
}
}
...
@@ -764,7 +764,7 @@ public class InsnGen {
...
@@ -764,7 +764,7 @@ public class InsnGen {
return
;
return
;
}
}
MethodInfo
callMth
=
insn
.
getCallMth
();
MethodInfo
callMth
=
insn
.
getCallMth
();
MethodNode
callMthNode
=
mth
.
root
().
deepR
esolveMethod
(
callMth
);
MethodNode
callMthNode
=
mth
.
root
().
r
esolveMethod
(
callMth
);
int
k
=
0
;
int
k
=
0
;
switch
(
type
)
{
switch
(
type
)
{
...
...
jadx-core/src/main/java/jadx/core/dex/nodes/RootNode.java
浏览文件 @
381405ea
...
@@ -378,15 +378,6 @@ public class RootNode {
...
@@ -378,15 +378,6 @@ public class RootNode {
@Nullable
@Nullable
public
MethodNode
resolveMethod
(
@NotNull
MethodInfo
mth
)
{
public
MethodNode
resolveMethod
(
@NotNull
MethodInfo
mth
)
{
ClassNode
cls
=
resolveClass
(
mth
.
getDeclClass
());
if
(
cls
!=
null
)
{
return
cls
.
searchMethod
(
mth
);
}
return
null
;
}
@Nullable
public
MethodNode
deepResolveMethod
(
@NotNull
MethodInfo
mth
)
{
ClassNode
cls
=
resolveClass
(
mth
.
getDeclClass
());
ClassNode
cls
=
resolveClass
(
mth
.
getDeclClass
());
if
(
cls
==
null
)
{
if
(
cls
==
null
)
{
return
null
;
return
null
;
...
@@ -430,19 +421,14 @@ public class RootNode {
...
@@ -430,19 +421,14 @@ public class RootNode {
@Nullable
@Nullable
public
FieldNode
resolveField
(
FieldInfo
field
)
{
public
FieldNode
resolveField
(
FieldInfo
field
)
{
ClassNode
cls
=
resolveClass
(
field
.
getDeclClass
());
if
(
cls
!=
null
)
{
return
cls
.
searchField
(
field
);
}
return
null
;
}
@Nullable
public
FieldNode
deepResolveField
(
@NotNull
FieldInfo
field
)
{
ClassNode
cls
=
resolveClass
(
field
.
getDeclClass
());
ClassNode
cls
=
resolveClass
(
field
.
getDeclClass
());
if
(
cls
==
null
)
{
if
(
cls
==
null
)
{
return
null
;
return
null
;
}
}
FieldNode
fieldNode
=
cls
.
searchField
(
field
);
if
(
fieldNode
!=
null
)
{
return
fieldNode
;
}
return
deepResolveField
(
cls
,
field
);
return
deepResolveField
(
cls
,
field
);
}
}
...
...
jadx-core/src/main/java/jadx/core/dex/nodes/utils/MethodUtils.java
浏览文件 @
381405ea
...
@@ -38,7 +38,7 @@ public class MethodUtils {
...
@@ -38,7 +38,7 @@ public class MethodUtils {
@Nullable
@Nullable
public
IMethodDetails
getMethodDetails
(
MethodInfo
callMth
)
{
public
IMethodDetails
getMethodDetails
(
MethodInfo
callMth
)
{
MethodNode
mthNode
=
root
.
deepR
esolveMethod
(
callMth
);
MethodNode
mthNode
=
root
.
r
esolveMethod
(
callMth
);
if
(
mthNode
!=
null
)
{
if
(
mthNode
!=
null
)
{
return
mthNode
;
return
mthNode
;
}
}
...
...
jadx-core/src/main/java/jadx/core/dex/visitors/ClassModifier.java
浏览文件 @
381405ea
...
@@ -244,7 +244,7 @@ public class ClassModifier extends AbstractVisitor {
...
@@ -244,7 +244,7 @@ public class ClassModifier extends AbstractVisitor {
return
false
;
return
false
;
}
}
MethodInfo
callMth
=
invokeInsn
.
getCallMth
();
MethodInfo
callMth
=
invokeInsn
.
getCallMth
();
MethodNode
wrappedMth
=
mth
.
root
().
deepR
esolveMethod
(
callMth
);
MethodNode
wrappedMth
=
mth
.
root
().
r
esolveMethod
(
callMth
);
if
(
wrappedMth
==
null
)
{
if
(
wrappedMth
==
null
)
{
return
false
;
return
false
;
}
}
...
...
jadx-core/src/main/java/jadx/core/dex/visitors/MarkMethodsForInline.java
浏览文件 @
381405ea
...
@@ -106,7 +106,7 @@ public class MarkMethodsForInline extends AbstractVisitor {
...
@@ -106,7 +106,7 @@ public class MarkMethodsForInline extends AbstractVisitor {
InsnType
insnType
=
insn
.
getType
();
InsnType
insnType
=
insn
.
getType
();
if
(
insnType
==
InsnType
.
INVOKE
)
{
if
(
insnType
==
InsnType
.
INVOKE
)
{
InvokeNode
invoke
=
(
InvokeNode
)
insn
;
InvokeNode
invoke
=
(
InvokeNode
)
insn
;
MethodNode
callMthNode
=
mth
.
root
().
deepR
esolveMethod
(
invoke
.
getCallMth
());
MethodNode
callMthNode
=
mth
.
root
().
r
esolveMethod
(
invoke
.
getCallMth
());
if
(
callMthNode
!=
null
)
{
if
(
callMthNode
!=
null
)
{
FixAccessModifiers
.
changeVisibility
(
callMthNode
,
newVisFlag
);
FixAccessModifiers
.
changeVisibility
(
callMthNode
,
newVisFlag
);
}
}
...
...
jadx-core/src/main/java/jadx/core/utils/InsnUtils.java
浏览文件 @
381405ea
...
@@ -96,7 +96,7 @@ public class InsnUtils {
...
@@ -96,7 +96,7 @@ public class InsnUtils {
return
((
ConstClassNode
)
insn
).
getClsType
();
return
((
ConstClassNode
)
insn
).
getClsType
();
case
SGET:
case
SGET:
FieldInfo
f
=
(
FieldInfo
)
((
IndexInsnNode
)
insn
).
getIndex
();
FieldInfo
f
=
(
FieldInfo
)
((
IndexInsnNode
)
insn
).
getIndex
();
FieldNode
fieldNode
=
root
.
deepR
esolveField
(
f
);
FieldNode
fieldNode
=
root
.
r
esolveField
(
f
);
if
(
fieldNode
==
null
)
{
if
(
fieldNode
==
null
)
{
LOG
.
warn
(
"Field {} not found"
,
f
);
LOG
.
warn
(
"Field {} not found"
,
f
);
return
null
;
return
null
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录