Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Quincy379
jadx
提交
14cbfbc5
J
jadx
项目概览
Quincy379
/
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,发现更多精彩内容 >>
提交
14cbfbc5
编写于
9月 28, 2020
作者:
S
Skylot
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: rerun signature parser on class reload (#981)
上级
9b1761f7
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
42 addition
and
12 deletion
+42
-12
jadx-core/src/main/java/jadx/api/JavaClass.java
jadx-core/src/main/java/jadx/api/JavaClass.java
+1
-3
jadx-core/src/main/java/jadx/core/dex/nodes/ClassNode.java
jadx-core/src/main/java/jadx/core/dex/nodes/ClassNode.java
+1
-4
jadx-core/src/main/java/jadx/core/dex/nodes/RootNode.java
jadx-core/src/main/java/jadx/core/dex/nodes/RootNode.java
+9
-1
jadx-core/src/main/java/jadx/core/dex/visitors/SignatureProcessor.java
.../main/java/jadx/core/dex/visitors/SignatureProcessor.java
+4
-4
jadx-core/src/test/java/jadx/tests/integration/rename/TestFieldWithGenericRename.java
.../tests/integration/rename/TestFieldWithGenericRename.java
+27
-0
未找到文件。
jadx-core/src/main/java/jadx/api/JavaClass.java
浏览文件 @
14cbfbc5
...
...
@@ -59,9 +59,7 @@ public final class JavaClass implements JavaNode {
public
synchronized
void
refresh
()
{
listsLoaded
=
false
;
cls
.
unload
();
cls
.
deepUnload
();
cls
.
reRunDecompile
();
cls
.
reloadCode
();
}
public
synchronized
String
getSmali
()
{
...
...
jadx-core/src/main/java/jadx/core/dex/nodes/ClassNode.java
浏览文件 @
14cbfbc5
...
...
@@ -225,13 +225,10 @@ public class ClassNode extends NotificationAttrNode implements ILoadable, ICodeN
return
decompile
(
true
);
}
public
synchronized
ICodeInfo
reRunDecompile
()
{
return
decompile
(
false
);
}
public
synchronized
ICodeInfo
reloadCode
()
{
unload
();
deepUnload
();
root
.
runPreDecompileStageForClass
(
this
);
return
decompile
(
false
);
}
...
...
jadx-core/src/main/java/jadx/core/dex/nodes/RootNode.java
浏览文件 @
14cbfbc5
...
...
@@ -44,6 +44,7 @@ public class RootNode {
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
RootNode
.
class
);
private
final
JadxArgs
args
;
private
final
List
<
IDexTreeVisitor
>
preDecompilePasses
;
private
final
List
<
IDexTreeVisitor
>
passes
;
private
final
ErrorsCounter
errorsCounter
=
new
ErrorsCounter
();
...
...
@@ -68,6 +69,7 @@ public class RootNode {
public
RootNode
(
JadxArgs
args
)
{
this
.
args
=
args
;
this
.
preDecompilePasses
=
Jadx
.
getPreDecompilePassesList
();
this
.
passes
=
Jadx
.
getPassesList
(
args
);
this
.
stringUtils
=
new
StringUtils
(
args
);
this
.
constValues
=
new
ConstStorage
(
args
);
...
...
@@ -191,7 +193,7 @@ public class RootNode {
}
public
void
runPreDecompileStage
()
{
for
(
IDexTreeVisitor
pass
:
Jadx
.
getPreDecompilePassesList
()
)
{
for
(
IDexTreeVisitor
pass
:
preDecompilePasses
)
{
try
{
pass
.
init
(
this
);
}
catch
(
Exception
e
)
{
...
...
@@ -203,6 +205,12 @@ public class RootNode {
}
}
public
void
runPreDecompileStageForClass
(
ClassNode
cls
)
{
for
(
IDexTreeVisitor
pass
:
preDecompilePasses
)
{
DepthTraversal
.
visit
(
pass
,
cls
);
}
}
public
List
<
ClassNode
>
getClasses
()
{
return
classes
;
}
...
...
jadx-core/src/main/java/jadx/core/dex/visitors/SignatureProcessor.java
浏览文件 @
14cbfbc5
...
...
@@ -14,6 +14,7 @@ import jadx.core.dex.nodes.parser.SignatureParser;
import
jadx.core.dex.nodes.utils.TypeUtils
;
import
jadx.core.dex.visitors.typeinference.TypeCompareEnum
;
import
jadx.core.utils.Utils
;
import
jadx.core.utils.exceptions.JadxException
;
import
static
java
.
util
.
Collections
.
unmodifiableList
;
...
...
@@ -24,12 +25,10 @@ public class SignatureProcessor extends AbstractVisitor {
@Override
public
void
init
(
RootNode
root
)
{
this
.
root
=
root
;
for
(
ClassNode
cls
:
this
.
root
.
getClasses
())
{
processCls
(
cls
);
}
}
private
void
processCls
(
ClassNode
cls
)
{
@Override
public
boolean
visit
(
ClassNode
cls
)
throws
JadxException
{
parseClassSignature
(
cls
);
for
(
FieldNode
field
:
cls
.
getFields
())
{
parseFieldSignature
(
field
);
...
...
@@ -37,6 +36,7 @@ public class SignatureProcessor extends AbstractVisitor {
for
(
MethodNode
mth
:
cls
.
getMethods
())
{
parseMethodSignature
(
mth
);
}
return
true
;
}
private
void
parseClassSignature
(
ClassNode
cls
)
{
...
...
jadx-core/src/test/java/jadx/tests/integration/rename/TestFieldWithGenericRename.java
0 → 100644
浏览文件 @
14cbfbc5
package
jadx.tests.integration.rename
;
import
java.util.List
;
import
org.junit.jupiter.api.Test
;
import
jadx.core.dex.nodes.ClassNode
;
import
jadx.tests.api.IntegrationTest
;
import
static
jadx
.
tests
.
api
.
utils
.
assertj
.
JadxAssertions
.
assertThat
;
public
class
TestFieldWithGenericRename
extends
IntegrationTest
{
public
static
class
TestCls
{
List
<
String
>
list
;
}
@Test
public
void
test
()
{
ClassNode
cls
=
getClassNode
(
TestCls
.
class
);
assertThat
(
cls
.
getCode
()).
containsOnlyOnce
(
"List<String> list;"
);
cls
.
searchFieldByName
(
"list"
).
getFieldInfo
().
setAlias
(
"listFieldRenamed"
);
assertThat
(
cls
.
reloadCode
()).
print
().
containsOnlyOnce
(
"List<String> listFieldRenamed;"
);
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录