Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_39073359
jadx
提交
7f4da306
J
jadx
项目概览
qq_39073359
/
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,发现更多精彩内容 >>
提交
7f4da306
编写于
7月 05, 2019
作者:
S
Skylot
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: remove cloning library dependency
上级
424a8ffa
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
100 addition
and
30 deletion
+100
-30
jadx-core/build.gradle
jadx-core/build.gradle
+0
-1
jadx-core/src/main/java/jadx/core/dex/instructions/ArithNode.java
...e/src/main/java/jadx/core/dex/instructions/ArithNode.java
+5
-0
jadx-core/src/main/java/jadx/core/dex/instructions/FillArrayNode.java
...c/main/java/jadx/core/dex/instructions/FillArrayNode.java
+13
-6
jadx-core/src/main/java/jadx/core/dex/instructions/FilledNewArrayNode.java
...n/java/jadx/core/dex/instructions/FilledNewArrayNode.java
+5
-0
jadx-core/src/main/java/jadx/core/dex/instructions/GotoNode.java
...re/src/main/java/jadx/core/dex/instructions/GotoNode.java
+6
-0
jadx-core/src/main/java/jadx/core/dex/instructions/IfNode.java
...core/src/main/java/jadx/core/dex/instructions/IfNode.java
+14
-2
jadx-core/src/main/java/jadx/core/dex/instructions/NewArrayNode.java
...rc/main/java/jadx/core/dex/instructions/NewArrayNode.java
+11
-2
jadx-core/src/main/java/jadx/core/dex/instructions/PhiInsn.java
...ore/src/main/java/jadx/core/dex/instructions/PhiInsn.java
+11
-2
jadx-core/src/main/java/jadx/core/dex/instructions/SwitchNode.java
.../src/main/java/jadx/core/dex/instructions/SwitchNode.java
+13
-1
jadx-core/src/main/java/jadx/core/dex/instructions/mods/ConstructorInsn.java
...java/jadx/core/dex/instructions/mods/ConstructorInsn.java
+5
-0
jadx-core/src/main/java/jadx/core/dex/instructions/mods/TernaryInsn.java
...ain/java/jadx/core/dex/instructions/mods/TernaryInsn.java
+12
-1
jadx-core/src/main/java/jadx/core/dex/nodes/InsnNode.java
jadx-core/src/main/java/jadx/core/dex/nodes/InsnNode.java
+5
-15
未找到文件。
jadx-core/build.gradle
浏览文件 @
7f4da306
...
...
@@ -7,7 +7,6 @@ dependencies {
compile
'org.ow2.asm:asm:7.1'
compile
'org.jetbrains:annotations:17.0.0'
compile
'uk.com.robust-it:cloning:1.9.12'
compile
'com.google.code.gson:gson:2.8.5'
compile
'org.smali:baksmali:2.2.7'
...
...
jadx-core/src/main/java/jadx/core/dex/instructions/ArithNode.java
浏览文件 @
7f4da306
...
...
@@ -71,6 +71,11 @@ public class ArithNode extends InsnNode {
return
op
==
other
.
op
;
}
@Override
public
InsnNode
copy
()
{
return
copyCommonParams
(
new
ArithNode
(
op
,
getResult
(),
getArg
(
0
),
getArg
(
1
)));
}
@Override
public
String
toString
()
{
return
InsnUtils
.
formatOffset
(
offset
)
+
": "
...
...
jadx-core/src/main/java/jadx/core/dex/instructions/FillArrayNode.java
浏览文件 @
7f4da306
...
...
@@ -25,13 +25,15 @@ public final class FillArrayNode extends InsnNode {
private
ArgType
elemType
;
public
FillArrayNode
(
int
resReg
,
FillArrayDataPayloadDecodedInstruction
payload
)
{
super
(
InsnType
.
FILL_ARRAY
,
1
);
ArgType
elType
=
getElementType
(
payload
.
getElementWidthUnit
(
));
addArg
(
InsnArg
.
reg
(
resReg
,
ArgType
.
array
(
elType
)));
this
(
payload
.
getData
(),
payload
.
getSize
(),
getElementType
(
payload
.
getElementWidthUnit
())
);
addArg
(
InsnArg
.
reg
(
resReg
,
ArgType
.
array
(
elemType
)
));
}
this
.
data
=
payload
.
getData
();
this
.
size
=
payload
.
getSize
();
this
.
elemType
=
elType
;
private
FillArrayNode
(
Object
data
,
int
size
,
ArgType
elemType
)
{
super
(
InsnType
.
FILL_ARRAY
,
1
);
this
.
data
=
data
;
this
.
size
=
size
;
this
.
elemType
=
elemType
;
}
private
static
ArgType
getElementType
(
short
elementWidthUnit
)
{
...
...
@@ -98,6 +100,11 @@ public final class FillArrayNode extends InsnNode {
return
elemType
.
equals
(
other
.
elemType
)
&&
data
==
other
.
data
;
}
@Override
public
InsnNode
copy
()
{
return
copyCommonParams
(
new
FillArrayNode
(
data
,
size
,
elemType
));
}
public
String
dataToString
()
{
if
(
data
instanceof
int
[])
{
return
Arrays
.
toString
((
int
[])
data
);
...
...
jadx-core/src/main/java/jadx/core/dex/instructions/FilledNewArrayNode.java
浏览文件 @
7f4da306
...
...
@@ -34,6 +34,11 @@ public class FilledNewArrayNode extends InsnNode {
return
elemType
==
other
.
elemType
;
}
@Override
public
InsnNode
copy
()
{
return
copyCommonParams
(
new
FilledNewArrayNode
(
elemType
,
getArgsCount
()));
}
@Override
public
String
toString
()
{
return
super
.
toString
()
+
" elemType: "
+
elemType
;
...
...
jadx-core/src/main/java/jadx/core/dex/instructions/GotoNode.java
浏览文件 @
7f4da306
package
jadx.core.dex.instructions
;
import
jadx.core.dex.nodes.InsnNode
;
import
jadx.core.utils.InsnUtils
;
public
class
GotoNode
extends
TargetInsnNode
{
...
...
@@ -19,6 +20,11 @@ public class GotoNode extends TargetInsnNode {
return
target
;
}
@Override
public
InsnNode
copy
()
{
return
copyCommonParams
(
new
GotoNode
(
target
));
}
@Override
public
String
toString
()
{
return
super
.
toString
()
+
"-> "
+
InsnUtils
.
formatOffset
(
target
);
...
...
jadx-core/src/main/java/jadx/core/dex/instructions/IfNode.java
浏览文件 @
7f4da306
...
...
@@ -34,12 +34,16 @@ public class IfNode extends GotoNode {
}
public
IfNode
(
IfOp
op
,
int
targetOffset
,
InsnArg
arg1
,
InsnArg
arg2
)
{
super
(
InsnType
.
IF
,
targetOffset
,
2
);
this
.
op
=
op
;
this
(
op
,
targetOffset
);
addArg
(
arg1
);
addArg
(
arg2
);
}
private
IfNode
(
IfOp
op
,
int
targetOffset
)
{
super
(
InsnType
.
IF
,
targetOffset
,
2
);
this
.
op
=
op
;
}
// change default types priority
private
static
final
ArgType
WIDE_TYPE
=
ArgType
.
unknown
(
PrimitiveType
.
INT
,
PrimitiveType
.
BOOLEAN
,
...
...
@@ -123,6 +127,14 @@ public class IfNode extends GotoNode {
return
op
==
other
.
op
;
}
@Override
public
InsnNode
copy
()
{
IfNode
copy
=
new
IfNode
(
op
,
target
);
copy
.
thenBlock
=
thenBlock
;
copy
.
elseBlock
=
elseBlock
;
return
copyCommonParams
(
copy
);
}
@Override
public
String
toString
()
{
return
InsnUtils
.
formatOffset
(
offset
)
+
": "
...
...
jadx-core/src/main/java/jadx/core/dex/instructions/NewArrayNode.java
浏览文件 @
7f4da306
...
...
@@ -12,12 +12,16 @@ public class NewArrayNode extends InsnNode {
private
final
ArgType
arrType
;
public
NewArrayNode
(
@NotNull
ArgType
arrType
,
RegisterArg
res
,
InsnArg
size
)
{
super
(
InsnType
.
NEW_ARRAY
,
1
);
this
.
arrType
=
arrType
;
this
(
arrType
);
setResult
(
res
);
addArg
(
size
);
}
private
NewArrayNode
(
ArgType
arrType
)
{
super
(
InsnType
.
NEW_ARRAY
,
1
);
this
.
arrType
=
arrType
;
}
public
ArgType
getArrayType
()
{
return
arrType
;
}
...
...
@@ -34,6 +38,11 @@ public class NewArrayNode extends InsnNode {
return
arrType
==
other
.
arrType
;
}
@Override
public
InsnNode
copy
()
{
return
copyCommonParams
(
new
NewArrayNode
(
arrType
));
}
@Override
public
String
toString
()
{
return
super
.
toString
()
+
" type: "
+
arrType
;
...
...
jadx-core/src/main/java/jadx/core/dex/instructions/PhiInsn.java
浏览文件 @
7f4da306
...
...
@@ -21,13 +21,17 @@ public final class PhiInsn extends InsnNode {
private
final
List
<
BlockNode
>
blockBinds
;
public
PhiInsn
(
int
regNum
,
int
predecessors
)
{
super
(
InsnType
.
PHI
,
predecessors
);
this
.
blockBinds
=
new
ArrayList
<>(
predecessors
);
this
(
predecessors
);
setResult
(
InsnArg
.
reg
(
regNum
,
ArgType
.
UNKNOWN
));
add
(
AFlag
.
DONT_INLINE
);
add
(
AFlag
.
DONT_GENERATE
);
}
private
PhiInsn
(
int
argsCount
)
{
super
(
InsnType
.
PHI
,
argsCount
);
this
.
blockBinds
=
new
ArrayList
<>(
argsCount
);
}
public
RegisterArg
bindArg
(
BlockNode
pred
)
{
RegisterArg
arg
=
InsnArg
.
reg
(
getResult
().
getRegNum
(),
getResult
().
getInitType
());
bindArg
(
arg
,
pred
);
...
...
@@ -111,6 +115,11 @@ public final class PhiInsn extends InsnNode {
throw
new
JadxRuntimeException
(
"Direct setArg is forbidden for PHI insn, bindArg must be used"
);
}
@Override
public
InsnNode
copy
()
{
return
copyCommonParams
(
new
PhiInsn
(
getArgsCount
()));
}
@Override
public
String
toString
()
{
return
"PHI: "
+
getResult
()
+
" = "
+
Utils
.
listToString
(
getArguments
())
...
...
jadx-core/src/main/java/jadx/core/dex/instructions/SwitchNode.java
浏览文件 @
7f4da306
...
...
@@ -20,11 +20,15 @@ public class SwitchNode extends TargetInsnNode {
private
BlockNode
defTargetBlock
;
public
SwitchNode
(
InsnArg
arg
,
Object
[]
keys
,
int
[]
targets
,
int
def
)
{
this
(
keys
,
targets
,
def
);
addArg
(
arg
);
}
private
SwitchNode
(
Object
[]
keys
,
int
[]
targets
,
int
def
)
{
super
(
InsnType
.
SWITCH
,
1
);
this
.
keys
=
keys
;
this
.
targets
=
targets
;
this
.
def
=
def
;
addArg
(
arg
);
}
public
int
getCasesCount
()
{
...
...
@@ -96,6 +100,14 @@ public class SwitchNode extends TargetInsnNode {
&&
Arrays
.
equals
(
targets
,
other
.
targets
);
}
@Override
public
InsnNode
copy
()
{
SwitchNode
copy
=
new
SwitchNode
(
keys
,
targets
,
def
);
copy
.
targetBlocks
=
targetBlocks
;
copy
.
defTargetBlock
=
defTargetBlock
;
return
copyCommonParams
(
copy
);
}
@Override
public
String
toString
()
{
StringBuilder
targ
=
new
StringBuilder
();
...
...
jadx-core/src/main/java/jadx/core/dex/instructions/mods/ConstructorInsn.java
浏览文件 @
7f4da306
...
...
@@ -104,6 +104,11 @@ public class ConstructorInsn extends InsnNode implements CallMthInterface {
&&
callType
==
other
.
callType
;
}
@Override
public
InsnNode
copy
()
{
return
copyCommonParams
(
new
ConstructorInsn
(
callMth
,
callType
,
instanceArg
));
}
@Override
public
String
toString
()
{
return
super
.
toString
()
+
' '
+
callMth
+
' '
+
callType
;
...
...
jadx-core/src/main/java/jadx/core/dex/instructions/mods/TernaryInsn.java
浏览文件 @
7f4da306
...
...
@@ -16,7 +16,7 @@ public final class TernaryInsn extends InsnNode {
private
IfCondition
condition
;
public
TernaryInsn
(
IfCondition
condition
,
RegisterArg
result
,
InsnArg
th
,
InsnArg
els
)
{
super
(
InsnType
.
TERNARY
,
2
);
this
(
);
setResult
(
result
);
if
(
th
.
equals
(
LiteralArg
.
FALSE
)
&&
els
.
equals
(
LiteralArg
.
TRUE
))
{
...
...
@@ -31,6 +31,10 @@ public final class TernaryInsn extends InsnNode {
}
}
private
TernaryInsn
()
{
super
(
InsnType
.
TERNARY
,
2
);
}
public
IfCondition
getCondition
()
{
return
condition
;
}
...
...
@@ -67,6 +71,13 @@ public final class TernaryInsn extends InsnNode {
return
condition
.
equals
(
that
.
condition
);
}
@Override
public
InsnNode
copy
()
{
TernaryInsn
copy
=
new
TernaryInsn
();
copy
.
condition
=
condition
;
return
copyCommonParams
(
copy
);
}
@Override
public
String
toString
()
{
return
InsnUtils
.
formatOffset
(
offset
)
+
": TERNARY"
...
...
jadx-core/src/main/java/jadx/core/dex/nodes/InsnNode.java
浏览文件 @
7f4da306
...
...
@@ -9,7 +9,6 @@ import java.util.Objects;
import
org.jetbrains.annotations.Nullable
;
import
com.android.dx.io.instructions.DecodedInstruction
;
import
com.rits.cloning.Cloner
;
import
jadx.core.dex.attributes.AFlag
;
import
jadx.core.dex.attributes.nodes.LineAttrNode
;
...
...
@@ -17,23 +16,14 @@ 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.InsnRemover
;
import
jadx.core.utils.InsnUtils
;
import
jadx.core.utils.Utils
;
import
jadx.core.utils.exceptions.JadxRuntimeException
;
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
;
...
...
@@ -324,7 +314,7 @@ public class InsnNode extends LineAttrNode {
&&
Objects
.
equals
(
arguments
,
other
.
arguments
);
}
protected
<
T
extends
InsnNode
>
T
copyCommonParams
(
T
copy
)
{
protected
final
<
T
extends
InsnNode
>
T
copyCommonParams
(
T
copy
)
{
copy
.
setResult
(
result
);
if
(
copy
.
getArgsCount
()
==
0
)
{
for
(
InsnArg
arg
:
this
.
getArguments
())
{
...
...
@@ -346,10 +336,10 @@ public class InsnNode extends LineAttrNode {
* Make copy of InsnNode object.
*/
public
InsnNode
copy
()
{
if
(
this
.
getClass
()
=
=
InsnNode
.
class
)
{
return
copyCommonParams
(
new
InsnNode
(
insnType
,
getArgsCount
()
));
if
(
this
.
getClass
()
!
=
InsnNode
.
class
)
{
throw
new
JadxRuntimeException
(
"Copy method not implemented in insn class "
+
this
.
getClass
().
getSimpleName
(
));
}
return
INSN_CLONER
.
deepClone
(
this
);
return
copyCommonParams
(
new
InsnNode
(
insnType
,
getArgsCount
())
);
}
public
boolean
canThrowException
()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录