Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2301_76393173
jadx
提交
69494c92
J
jadx
项目概览
2301_76393173
/
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 搜索 >>
提交
69494c92
编写于
6月 27, 2015
作者:
S
Skylot
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
core: add method for copy instruction nodes
上级
b2f0f025
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
70 addition
and
0 deletion
+70
-0
jadx-core/build.gradle
jadx-core/build.gradle
+1
-0
jadx-core/src/main/java/jadx/core/dex/attributes/nodes/LineAttrNode.java
...ain/java/jadx/core/dex/attributes/nodes/LineAttrNode.java
+5
-0
jadx-core/src/main/java/jadx/core/dex/instructions/ConstClassNode.java
.../main/java/jadx/core/dex/instructions/ConstClassNode.java
+5
-0
jadx-core/src/main/java/jadx/core/dex/instructions/ConstStringNode.java
...main/java/jadx/core/dex/instructions/ConstStringNode.java
+5
-0
jadx-core/src/main/java/jadx/core/dex/instructions/IndexInsnNode.java
...c/main/java/jadx/core/dex/instructions/IndexInsnNode.java
+5
-0
jadx-core/src/main/java/jadx/core/dex/instructions/InvokeNode.java
.../src/main/java/jadx/core/dex/instructions/InvokeNode.java
+11
-0
jadx-core/src/main/java/jadx/core/dex/nodes/InsnNode.java
jadx-core/src/main/java/jadx/core/dex/nodes/InsnNode.java
+38
-0
未找到文件。
jadx-core/build.gradle
浏览文件 @
69494c92
...
...
@@ -9,6 +9,7 @@ dependencies {
compile
'commons-io:commons-io:2.4'
compile
'org.ow2.asm:asm:5.0.3'
compile
'com.intellij:annotations:12.0'
compile
'uk.com.robust-it:cloning:1.9.2'
testCompile
'org.smali:smali:2.0.3'
}
...
...
jadx-core/src/main/java/jadx/core/dex/attributes/nodes/LineAttrNode.java
浏览文件 @
69494c92
...
...
@@ -23,4 +23,9 @@ public abstract class LineAttrNode extends AttrNode {
public
void
setDecompiledLine
(
int
decompiledLine
)
{
this
.
decompiledLine
=
decompiledLine
;
}
public
void
copyLines
(
LineAttrNode
lineAttrNode
)
{
setSourceLine
(
lineAttrNode
.
getSourceLine
());
setDecompiledLine
(
lineAttrNode
.
getDecompiledLine
());
}
}
jadx-core/src/main/java/jadx/core/dex/instructions/ConstClassNode.java
浏览文件 @
69494c92
...
...
@@ -16,6 +16,11 @@ public final class ConstClassNode extends InsnNode {
return
clsType
;
}
@Override
public
InsnNode
copy
()
{
return
copyCommonParams
(
new
ConstClassNode
(
clsType
));
}
@Override
public
boolean
isSame
(
InsnNode
obj
)
{
if
(
this
==
obj
)
{
...
...
jadx-core/src/main/java/jadx/core/dex/instructions/ConstStringNode.java
浏览文件 @
69494c92
...
...
@@ -15,6 +15,11 @@ public final class ConstStringNode extends InsnNode {
return
str
;
}
@Override
public
InsnNode
copy
()
{
return
copyCommonParams
(
new
ConstStringNode
(
str
));
}
@Override
public
boolean
isSame
(
InsnNode
obj
)
{
if
(
this
==
obj
)
{
...
...
jadx-core/src/main/java/jadx/core/dex/instructions/IndexInsnNode.java
浏览文件 @
69494c92
...
...
@@ -16,6 +16,11 @@ public class IndexInsnNode extends InsnNode {
return
index
;
}
@Override
public
IndexInsnNode
copy
()
{
return
copyCommonParams
(
new
IndexInsnNode
(
insnType
,
index
,
getArgsCount
()));
}
@Override
public
boolean
isSame
(
InsnNode
obj
)
{
if
(
this
==
obj
)
{
...
...
jadx-core/src/main/java/jadx/core/dex/instructions/InvokeNode.java
浏览文件 @
69494c92
...
...
@@ -36,6 +36,12 @@ public class InvokeNode extends InsnNode {
}
}
private
InvokeNode
(
MethodInfo
mth
,
InvokeType
invokeType
,
int
argsCount
)
{
super
(
InsnType
.
INVOKE
,
argsCount
);
this
.
mth
=
mth
;
this
.
type
=
invokeType
;
}
public
InvokeType
getInvokeType
()
{
return
type
;
}
...
...
@@ -44,6 +50,11 @@ public class InvokeNode extends InsnNode {
return
mth
;
}
@Override
public
InsnNode
copy
()
{
return
copyCommonParams
(
new
InvokeNode
(
mth
,
type
,
getArgsCount
()));
}
@Override
public
boolean
isSame
(
InsnNode
obj
)
{
if
(
this
==
obj
)
{
...
...
jadx-core/src/main/java/jadx/core/dex/nodes/InsnNode.java
浏览文件 @
69494c92
...
...
@@ -5,7 +5,10 @@ import jadx.core.dex.instructions.InsnType;
import
jadx.core.dex.instructions.args.ArgType
;
import
jadx.core.dex.instructions.args.InsnArg
;
import
jadx.core.dex.instructions.args.InsnWrapArg
;
import
jadx.core.dex.instructions.args.LiteralArg
;
import
jadx.core.dex.instructions.args.NamedArg
;
import
jadx.core.dex.instructions.args.RegisterArg
;
import
jadx.core.dex.instructions.args.SSAVar
;
import
jadx.core.utils.InsnUtils
;
import
jadx.core.utils.Utils
;
...
...
@@ -14,9 +17,17 @@ import java.util.Collections;
import
java.util.List
;
import
com.android.dx.io.instructions.DecodedInstruction
;
import
com.rits.cloning.Cloner
;
public
class
InsnNode
extends
LineAttrNode
{
private
static
final
Cloner
INSN_CLONER
=
new
Cloner
();
static
{
INSN_CLONER
.
dontClone
(
ArgType
.
class
,
SSAVar
.
class
,
LiteralArg
.
class
,
NamedArg
.
class
);
INSN_CLONER
.
dontCloneInstanceOf
(
RegisterArg
.
class
);
}
protected
final
InsnType
insnType
;
private
RegisterArg
result
;
...
...
@@ -228,4 +239,31 @@ public class InsnNode extends LineAttrNode {
&&
arguments
.
size
()
==
other
.
arguments
.
size
();
}
protected
<
T
extends
InsnNode
>
T
copyCommonParams
(
T
copy
)
{
copy
.
setResult
(
result
);
if
(
copy
.
getArgsCount
()
==
0
)
{
for
(
InsnArg
arg
:
this
.
getArguments
())
{
if
(
arg
.
isInsnWrap
())
{
InsnNode
wrapInsn
=
((
InsnWrapArg
)
arg
).
getWrapInsn
();
copy
.
addArg
(
InsnArg
.
wrapArg
(
wrapInsn
.
copy
()));
}
else
{
copy
.
addArg
(
arg
);
}
}
}
copy
.
copyAttributesFrom
(
this
);
copy
.
copyLines
(
this
);
copy
.
setOffset
(
this
.
getOffset
());
return
copy
;
}
/**
* Make copy of InsnNode object.
*/
public
InsnNode
copy
()
{
if
(
this
.
getClass
()
==
InsnNode
.
class
)
{
return
copyCommonParams
(
new
InsnNode
(
insnType
,
getArgsCount
()));
}
return
INSN_CLONER
.
deepClone
(
this
);
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录