Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爽朗的琪琪
jadx
提交
b46093b3
J
jadx
项目概览
爽朗的琪琪
/
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,体验更适合开发者的 AI 搜索 >>
提交
b46093b3
编写于
8月 09, 2015
作者:
S
Skylot
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
core: add method info cache
上级
2b9c0927
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
18 addition
and
14 deletion
+18
-14
jadx-core/src/main/java/jadx/core/dex/info/MethodInfo.java
jadx-core/src/main/java/jadx/core/dex/info/MethodInfo.java
+1
-4
jadx-core/src/main/java/jadx/core/dex/nodes/ClassNode.java
jadx-core/src/main/java/jadx/core/dex/nodes/ClassNode.java
+13
-6
jadx-core/src/main/java/jadx/core/dex/nodes/MethodNode.java
jadx-core/src/main/java/jadx/core/dex/nodes/MethodNode.java
+4
-4
未找到文件。
jadx-core/src/main/java/jadx/core/dex/info/MethodInfo.java
浏览文件 @
b46093b3
...
...
@@ -132,10 +132,7 @@ public final class MethodInfo {
if
(
this
==
obj
)
{
return
true
;
}
if
(
obj
==
null
)
{
return
false
;
}
if
(
getClass
()
!=
obj
.
getClass
())
{
if
(!(
obj
instanceof
MethodInfo
))
{
return
false
;
}
MethodInfo
other
=
(
MethodInfo
)
obj
;
...
...
jadx-core/src/main/java/jadx/core/dex/nodes/ClassNode.java
浏览文件 @
b46093b3
...
...
@@ -25,6 +25,7 @@ import jadx.core.utils.exceptions.JadxRuntimeException;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
...
...
@@ -65,6 +66,9 @@ public class ClassNode extends LineAttrNode implements ILoadable {
private
ProcessState
state
=
ProcessState
.
NOT_LOADED
;
private
final
Set
<
ClassNode
>
dependencies
=
new
HashSet
<
ClassNode
>();
// cache maps
private
Map
<
MethodInfo
,
MethodNode
>
mthInfoMap
=
Collections
.
emptyMap
();
public
ClassNode
(
DexNode
dex
,
ClassDef
cls
)
throws
DecodeException
{
this
.
dex
=
dex
;
this
.
clsInfo
=
ClassInfo
.
fromDex
(
dex
,
cls
.
getTypeIndex
());
...
...
@@ -126,6 +130,7 @@ public class ClassNode extends LineAttrNode implements ILoadable {
}
this
.
accessFlags
=
new
AccessInfo
(
accFlagsValue
,
AFType
.
CLASS
);
buildCache
();
}
catch
(
Exception
e
)
{
throw
new
DecodeException
(
"Error decode class: "
+
clsInfo
,
e
);
}
...
...
@@ -278,6 +283,13 @@ public class ClassNode extends LineAttrNode implements ILoadable {
}
}
private
void
buildCache
()
{
mthInfoMap
=
new
HashMap
<
MethodInfo
,
MethodNode
>(
methods
.
size
());
for
(
MethodNode
mth
:
methods
)
{
mthInfoMap
.
put
(
mth
.
getMethodInfo
(),
mth
);
}
}
@Nullable
public
ArgType
getSuperClass
()
{
return
superClass
;
...
...
@@ -384,12 +396,7 @@ public class ClassNode extends LineAttrNode implements ILoadable {
}
public
MethodNode
searchMethod
(
MethodInfo
mth
)
{
for
(
MethodNode
m
:
methods
)
{
if
(
m
.
getMethodInfo
().
equals
(
mth
))
{
return
m
;
}
}
return
null
;
return
mthInfoMap
.
get
(
mth
);
}
public
MethodNode
searchMethodByName
(
String
shortId
)
{
...
...
jadx-core/src/main/java/jadx/core/dex/nodes/MethodNode.java
浏览文件 @
b46093b3
...
...
@@ -513,11 +513,11 @@ public class MethodNode extends LineAttrNode implements ILoadable {
}
String
name
=
getName
();
List
<
MethodNode
>
methods
=
parentClass
.
getMethods
();
for
(
MethodNode
method
:
methods
)
{
for
(
MethodNode
method
:
parentClass
.
getMethods
())
{
MethodInfo
otherMthInfo
=
method
.
mthInfo
;
if
(
this
!=
method
&&
method
.
getName
().
equals
(
name
)
&&
method
.
mthInfo
.
getArgumentsTypes
().
size
()
==
argsCount
)
{
&&
otherMthInfo
.
getArgumentsTypes
().
size
()
==
argsCount
&&
otherMthInfo
.
getName
().
equals
(
name
)
)
{
return
true
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录