Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
极致猎手
jadx
提交
62826334
J
jadx
项目概览
极致猎手
/
jadx
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
J
jadx
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
62826334
编写于
5月 12, 2019
作者:
S
Skylot
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(gui): use alias for field and method types in tree view
上级
19cf7c9f
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
58 addition
and
8 deletion
+58
-8
jadx-core/src/main/java/jadx/api/JavaField.java
jadx-core/src/main/java/jadx/api/JavaField.java
+1
-1
jadx-core/src/main/java/jadx/api/JavaMethod.java
jadx-core/src/main/java/jadx/api/JavaMethod.java
+22
-2
jadx-core/src/main/java/jadx/core/dex/instructions/args/ArgType.java
...rc/main/java/jadx/core/dex/instructions/args/ArgType.java
+27
-0
jadx-core/src/main/java/jadx/core/dex/nodes/MethodNode.java
jadx-core/src/main/java/jadx/core/dex/nodes/MethodNode.java
+1
-2
jadx-gui/src/main/java/jadx/gui/utils/Utils.java
jadx-gui/src/main/java/jadx/gui/utils/Utils.java
+7
-3
未找到文件。
jadx-core/src/main/java/jadx/api/JavaField.java
浏览文件 @
62826334
...
...
@@ -39,7 +39,7 @@ public final class JavaField implements JavaNode {
}
public
ArgType
getType
()
{
return
field
.
getType
(
);
return
ArgType
.
tryToResolveClassAlias
(
field
.
dex
(),
field
.
getType
()
);
}
public
int
getDecompiledLine
()
{
...
...
jadx-core/src/main/java/jadx/api/JavaMethod.java
浏览文件 @
62826334
package
jadx.api
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
import
jadx.core.dex.info.AccessInfo
;
import
jadx.core.dex.instructions.args.ArgType
;
import
jadx.core.dex.instructions.args.RegisterArg
;
import
jadx.core.dex.nodes.MethodNode
;
public
final
class
JavaMethod
implements
JavaNode
{
...
...
@@ -40,11 +44,27 @@ public final class JavaMethod implements JavaNode {
}
public
List
<
ArgType
>
getArguments
()
{
return
mth
.
getMethodInfo
().
getArgumentsTypes
();
if
(
mth
.
getMethodInfo
().
getArgumentsTypes
().
isEmpty
())
{
return
Collections
.
emptyList
();
}
List
<
RegisterArg
>
arguments
=
mth
.
getArguments
(
false
);
Stream
<
ArgType
>
argTypeStream
;
if
(
arguments
==
null
||
arguments
.
isEmpty
()
||
mth
.
isNoCode
())
{
argTypeStream
=
mth
.
getMethodInfo
().
getArgumentsTypes
().
stream
();
}
else
{
argTypeStream
=
arguments
.
stream
().
map
(
RegisterArg:
:
getType
);
}
return
argTypeStream
.
map
(
type
->
ArgType
.
tryToResolveClassAlias
(
mth
.
dex
(),
type
))
.
collect
(
Collectors
.
toList
());
}
public
ArgType
getReturnType
()
{
return
mth
.
getReturnType
();
ArgType
retType
=
mth
.
getReturnType
();
if
(
retType
==
null
)
{
retType
=
mth
.
getMethodInfo
().
getReturnType
();
}
return
ArgType
.
tryToResolveClassAlias
(
mth
.
dex
(),
retType
);
}
public
boolean
isConstructor
()
{
...
...
jadx-core/src/main/java/jadx/core/dex/instructions/args/ArgType.java
浏览文件 @
62826334
...
...
@@ -5,6 +5,8 @@ import java.util.Collections;
import
java.util.List
;
import
jadx.core.Consts
;
import
jadx.core.dex.info.ClassInfo
;
import
jadx.core.dex.nodes.ClassNode
;
import
jadx.core.dex.nodes.DexNode
;
import
jadx.core.dex.nodes.RootNode
;
import
jadx.core.dex.nodes.parser.SignatureParser
;
...
...
@@ -620,6 +622,31 @@ public abstract class ArgType {
return
1
;
}
public
static
ArgType
tryToResolveClassAlias
(
DexNode
dex
,
ArgType
type
)
{
if
(!
type
.
isObject
()
||
type
.
isGenericType
())
{
return
type
;
}
ClassNode
cls
=
dex
.
resolveClass
(
type
);
if
(
cls
==
null
)
{
return
type
;
}
ClassInfo
clsInfo
=
cls
.
getClassInfo
();
if
(!
clsInfo
.
hasAlias
())
{
return
type
;
}
String
aliasFullName
=
clsInfo
.
getAliasFullName
();
if
(
type
.
isGeneric
())
{
if
(
type
instanceof
GenericObject
)
{
return
new
GenericObject
(
aliasFullName
,
type
.
getGenericTypes
());
}
if
(
type
instanceof
WildcardType
)
{
return
new
WildcardType
(
ArgType
.
object
(
aliasFullName
),
type
.
getWildcardBounds
());
}
}
return
ArgType
.
object
(
aliasFullName
);
}
@Override
public
String
toString
()
{
return
"ARG_TYPE"
;
...
...
jadx-core/src/main/java/jadx/core/dex/nodes/MethodNode.java
浏览文件 @
62826334
...
...
@@ -91,9 +91,8 @@ public class MethodNode extends LineAttrNode implements ILoadable, ICodeNode {
if
(
noCode
)
{
return
;
}
retType
=
null
;
// don't unload retType and argsList, will be used in jadx-gui after class unload
thisArg
=
null
;
argsList
=
Collections
.
emptyList
();
sVars
=
Collections
.
emptyList
();
genericMap
=
null
;
instructions
=
null
;
...
...
jadx-gui/src/main/java/jadx/gui/utils/Utils.java
浏览文件 @
62826334
...
...
@@ -65,17 +65,21 @@ public class Utils {
}
public
static
String
typeFormat
(
String
name
,
ArgType
type
)
{
return
"<html><body><nobr>"
+
name
+
"<span style='color:#888888;'>
: "
+
typeStr
(
type
)
+
"</span>"
return
"<html><body><nobr>"
+
escapeHtml
(
name
)
+
"<span style='color:#888888;'>
"
+
escapeHtml
(
typeStr
(
type
)
)
+
"</span>"
+
"</nobr></body></html>"
;
}
public
static
String
escapeHtml
(
String
str
)
{
return
str
.
replace
(
"<"
,
"<"
);
}
public
static
String
typeStr
(
ArgType
type
)
{
if
(
type
==
null
)
{
return
"null"
;
}
if
(
type
.
isObject
())
{
String
cls
=
type
.
getObject
();
String
cls
=
type
.
toString
();
int
dot
=
cls
.
lastIndexOf
(
'.'
);
if
(
dot
!=
-
1
)
{
return
cls
.
substring
(
dot
+
1
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录