Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
keyescgm
jadx
提交
cf25cc4f
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,发现更多精彩内容 >>
未验证
提交
cf25cc4f
编写于
4月 17, 2022
作者:
S
Skylot
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: prevent null type in code variables
上级
b57001d4
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
36 addition
and
13 deletion
+36
-13
jadx-core/src/main/java/jadx/core/Jadx.java
jadx-core/src/main/java/jadx/core/Jadx.java
+3
-0
jadx-core/src/main/java/jadx/core/dex/visitors/debuginfo/DebugInfoApplyVisitor.java
...dx/core/dex/visitors/debuginfo/DebugInfoApplyVisitor.java
+0
-13
jadx-core/src/main/java/jadx/core/dex/visitors/typeinference/FinishTypeInference.java
.../core/dex/visitors/typeinference/FinishTypeInference.java
+33
-0
未找到文件。
jadx-core/src/main/java/jadx/core/Jadx.java
浏览文件 @
cf25cc4f
...
...
@@ -62,6 +62,7 @@ import jadx.core.dex.visitors.rename.CodeRenameVisitor;
import
jadx.core.dex.visitors.rename.RenameVisitor
;
import
jadx.core.dex.visitors.shrink.CodeShrinkVisitor
;
import
jadx.core.dex.visitors.ssa.SSATransform
;
import
jadx.core.dex.visitors.typeinference.FinishTypeInference
;
import
jadx.core.dex.visitors.typeinference.TypeInferenceVisitor
;
import
jadx.core.dex.visitors.usage.UsageInfoVisitor
;
import
jadx.core.utils.exceptions.JadxRuntimeException
;
...
...
@@ -130,6 +131,7 @@ public class Jadx {
if
(
args
.
isDebugInfo
())
{
passes
.
add
(
new
DebugInfoApplyVisitor
());
}
passes
.
add
(
new
FinishTypeInference
());
if
(
args
.
getUseKotlinMethodsForVarNames
()
!=
JadxArgs
.
UseKotlinMethodsForVarNames
.
DISABLE
)
{
passes
.
add
(
new
ProcessKotlinInternals
());
}
...
...
@@ -204,6 +206,7 @@ public class Jadx {
if
(
args
.
isDebugInfo
())
{
passes
.
add
(
new
DebugInfoApplyVisitor
());
}
passes
.
add
(
new
FinishTypeInference
());
passes
.
add
(
new
CodeRenameVisitor
());
passes
.
add
(
new
DeboxingVisitor
());
passes
.
add
(
new
ModVisitor
());
...
...
jadx-core/src/main/java/jadx/core/dex/visitors/debuginfo/DebugInfoApplyVisitor.java
浏览文件 @
cf25cc4f
...
...
@@ -56,24 +56,11 @@ public class DebugInfoApplyVisitor extends AbstractVisitor {
mth
.
remove
(
AType
.
LOCAL_VARS_DEBUG_INFO
);
}
processMethodParametersAttribute
(
mth
);
checkTypes
(
mth
);
}
catch
(
Exception
e
)
{
mth
.
addWarnComment
(
"Failed to apply debug info"
,
e
);
}
}
private
static
void
checkTypes
(
MethodNode
mth
)
{
if
(
mth
.
isNoCode
()
||
mth
.
getSVars
().
isEmpty
())
{
return
;
}
mth
.
getSVars
().
forEach
(
var
->
{
ArgType
type
=
var
.
getTypeInfo
().
getType
();
if
(!
type
.
isTypeKnown
())
{
mth
.
addWarnComment
(
"Type inference failed for: "
+
var
.
getDetailedVarInfo
(
mth
));
}
});
}
private
static
void
applyDebugInfo
(
MethodNode
mth
)
{
if
(
Consts
.
DEBUG_TYPE_INFERENCE
)
{
LOG
.
info
(
"Apply debug info for method: {}"
,
mth
);
...
...
jadx-core/src/main/java/jadx/core/dex/visitors/typeinference/FinishTypeInference.java
0 → 100644
浏览文件 @
cf25cc4f
package
jadx.core.dex.visitors.typeinference
;
import
jadx.core.dex.instructions.args.ArgType
;
import
jadx.core.dex.nodes.MethodNode
;
import
jadx.core.dex.visitors.AbstractVisitor
;
import
jadx.core.dex.visitors.JadxVisitor
;
@JadxVisitor
(
name
=
"Finish Type Inference"
,
desc
=
"Check used types"
,
runAfter
=
{
TypeInferenceVisitor
.
class
}
)
public
final
class
FinishTypeInference
extends
AbstractVisitor
{
@Override
public
void
visit
(
MethodNode
mth
)
{
if
(
mth
.
isNoCode
()
||
mth
.
getSVars
().
isEmpty
())
{
return
;
}
mth
.
getSVars
().
forEach
(
var
->
{
ArgType
type
=
var
.
getTypeInfo
().
getType
();
if
(!
type
.
isTypeKnown
())
{
mth
.
addWarnComment
(
"Type inference failed for: "
+
var
.
getDetailedVarInfo
(
mth
));
}
ArgType
codeVarType
=
var
.
getCodeVar
().
getType
();
if
(
codeVarType
==
null
)
{
var
.
getCodeVar
().
setType
(
ArgType
.
UNKNOWN
);
}
});
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录