Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
colcode
jadx
提交
a324376e
J
jadx
项目概览
colcode
/
jadx
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
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,发现更多精彩内容 >>
提交
a324376e
编写于
6月 27, 2015
作者:
S
Skylot
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
core: replace assertions with jadx exceptions throw
上级
04e50afa
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
28 addition
and
17 deletion
+28
-17
jadx-core/src/main/java/jadx/core/Jadx.java
jadx-core/src/main/java/jadx/core/Jadx.java
+1
-5
jadx-core/src/main/java/jadx/core/codegen/InsnGen.java
jadx-core/src/main/java/jadx/core/codegen/InsnGen.java
+12
-6
jadx-core/src/main/java/jadx/core/dex/instructions/ArithNode.java
...e/src/main/java/jadx/core/dex/instructions/ArithNode.java
+0
-1
jadx-core/src/main/java/jadx/core/dex/instructions/args/InsnWrapArg.java
...ain/java/jadx/core/dex/instructions/args/InsnWrapArg.java
+4
-1
jadx-core/src/main/java/jadx/core/dex/nodes/parser/DebugInfoParser.java
...main/java/jadx/core/dex/nodes/parser/DebugInfoParser.java
+7
-3
jadx-core/src/main/java/jadx/core/dex/regions/conditions/IfRegion.java
.../main/java/jadx/core/dex/regions/conditions/IfRegion.java
+4
-1
未找到文件。
jadx-core/src/main/java/jadx/core/Jadx.java
浏览文件 @
a324376e
...
...
@@ -31,7 +31,6 @@ import jadx.core.dex.visitors.ssa.EliminatePhiNodes;
import
jadx.core.dex.visitors.ssa.SSATransform
;
import
jadx.core.dex.visitors.typeinference.FinishTypeInference
;
import
jadx.core.dex.visitors.typeinference.TypeInference
;
import
jadx.core.utils.Utils
;
import
java.io.File
;
import
java.net.URL
;
...
...
@@ -50,9 +49,6 @@ public class Jadx {
if
(
Consts
.
DEBUG
)
{
LOG
.
info
(
"debug enabled"
);
}
if
(
Jadx
.
class
.
desiredAssertionStatus
())
{
LOG
.
info
(
"assertions enabled"
);
}
}
public
static
List
<
IDexTreeVisitor
>
getPassesList
(
IJadxArgs
args
,
File
outDir
)
{
...
...
@@ -115,7 +111,7 @@ public class Jadx {
public
static
String
getVersion
()
{
try
{
ClassLoader
classLoader
=
Utils
.
class
.
getClassLoader
();
ClassLoader
classLoader
=
Jadx
.
class
.
getClassLoader
();
if
(
classLoader
!=
null
)
{
Enumeration
<
URL
>
resources
=
classLoader
.
getResources
(
"META-INF/MANIFEST.MF"
);
while
(
resources
.
hasMoreElements
())
{
...
...
jadx-core/src/main/java/jadx/core/codegen/InsnGen.java
浏览文件 @
a324376e
...
...
@@ -450,7 +450,7 @@ public class InsnGen {
/* fallback mode instructions */
case
IF:
assert
isFallback
()
:
"if insn in not fallback mode"
;
fallbackOnlyInsn
(
insn
)
;
IfNode
ifInsn
=
(
IfNode
)
insn
;
code
.
add
(
"if ("
);
addArg
(
code
,
insn
.
getArg
(
0
));
...
...
@@ -461,17 +461,17 @@ public class InsnGen {
break
;
case
GOTO:
assert
isFallback
(
);
fallbackOnlyInsn
(
insn
);
code
.
add
(
"goto "
).
add
(
MethodGen
.
getLabelName
(((
GotoNode
)
insn
).
getTarget
()));
break
;
case
MOVE_EXCEPTION:
assert
isFallback
(
);
fallbackOnlyInsn
(
insn
);
code
.
add
(
"move-exception"
);
break
;
case
SWITCH:
assert
isFallback
(
);
fallbackOnlyInsn
(
insn
);
SwitchNode
sw
=
(
SwitchNode
)
insn
;
code
.
add
(
"switch("
);
addArg
(
code
,
insn
.
getArg
(
0
));
...
...
@@ -489,7 +489,7 @@ public class InsnGen {
break
;
case
FILL_ARRAY:
assert
isFallback
(
);
fallbackOnlyInsn
(
insn
);
FillArrayNode
arrayNode
=
(
FillArrayNode
)
insn
;
Object
data
=
arrayNode
.
getData
();
String
arrStr
;
...
...
@@ -509,7 +509,7 @@ public class InsnGen {
case
NEW_INSTANCE:
// only fallback - make new instance in constructor invoke
assert
isFallback
(
);
fallbackOnlyInsn
(
insn
);
code
.
add
(
"new "
+
insn
.
getResult
().
getType
());
break
;
...
...
@@ -518,6 +518,12 @@ public class InsnGen {
}
}
private
void
fallbackOnlyInsn
(
InsnNode
insn
)
throws
CodegenException
{
if
(!
fallback
)
{
throw
new
CodegenException
(
insn
.
getType
()
+
" can be used only in fallback mode"
);
}
}
private
void
filledNewArray
(
FilledNewArrayNode
insn
,
CodeWriter
code
)
throws
CodegenException
{
code
.
add
(
"new "
);
useType
(
code
,
insn
.
getArrayType
());
...
...
jadx-core/src/main/java/jadx/core/dex/instructions/ArithNode.java
浏览文件 @
a324376e
...
...
@@ -40,7 +40,6 @@ public class ArithNode extends InsnNode {
addReg
(
insn
,
2
,
type
);
}
}
assert
getArgsCount
()
==
2
;
}
public
ArithNode
(
ArithOp
op
,
RegisterArg
res
,
InsnArg
a
,
InsnArg
b
)
{
...
...
jadx-core/src/main/java/jadx/core/dex/instructions/args/InsnWrapArg.java
浏览文件 @
a324376e
package
jadx.core.dex.instructions.args
;
import
jadx.core.dex.nodes.InsnNode
;
import
jadx.core.utils.exceptions.JadxRuntimeException
;
import
org.jetbrains.annotations.NotNull
;
...
...
@@ -20,7 +21,9 @@ public final class InsnWrapArg extends InsnArg {
@Override
public
void
setParentInsn
(
InsnNode
parentInsn
)
{
assert
parentInsn
!=
wrappedInsn
:
"Can't wrap instruction info itself: "
+
parentInsn
;
if
(
parentInsn
==
wrappedInsn
)
{
throw
new
JadxRuntimeException
(
"Can't wrap instruction info itself: "
+
parentInsn
);
}
this
.
parentInsn
=
parentInsn
;
}
...
...
jadx-core/src/main/java/jadx/core/dex/nodes/parser/DebugInfoParser.java
浏览文件 @
a324376e
...
...
@@ -11,10 +11,14 @@ import jadx.core.utils.exceptions.DecodeException;
import
java.util.List
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
com.android.dex.Dex.Section
;
public
class
DebugInfoParser
{
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
DebugInfoParser
.
class
);
private
static
final
int
DBG_END_SEQUENCE
=
0x00
;
private
static
final
int
DBG_ADVANCE_PC
=
0x01
;
private
static
final
int
DBG_ADVANCE_LINE
=
0x02
;
...
...
@@ -58,13 +62,13 @@ public class DebugInfoParser {
int
paramsCount
=
section
.
readUleb128
();
List
<
RegisterArg
>
mthArgs
=
mth
.
getArguments
(
false
);
assert
paramsCount
==
mthArgs
.
size
();
for
(
int
i
=
0
;
i
<
paramsCount
;
i
++)
{
int
id
=
section
.
readUleb128
()
-
1
;
if
(
id
!=
DexNode
.
NO_INDEX
)
{
String
name
=
dex
.
getString
(
id
);
mthArgs
.
get
(
i
).
setName
(
name
);
if
(
i
<
mthArgs
.
size
())
{
mthArgs
.
get
(
i
).
setName
(
name
);
}
}
}
...
...
jadx-core/src/main/java/jadx/core/dex/regions/conditions/IfRegion.java
浏览文件 @
a324376e
...
...
@@ -5,6 +5,7 @@ import jadx.core.dex.nodes.IBranchRegion;
import
jadx.core.dex.nodes.IContainer
;
import
jadx.core.dex.nodes.IRegion
;
import
jadx.core.dex.regions.AbstractRegion
;
import
jadx.core.utils.exceptions.JadxRuntimeException
;
import
java.util.ArrayList
;
import
java.util.Collections
;
...
...
@@ -20,7 +21,9 @@ public final class IfRegion extends AbstractRegion implements IBranchRegion {
public
IfRegion
(
IRegion
parent
,
BlockNode
header
)
{
super
(
parent
);
assert
header
.
getInstructions
().
size
()
==
1
;
if
(
header
.
getInstructions
().
size
()
!=
1
)
{
throw
new
JadxRuntimeException
(
"Expected only one instruction in 'if' header"
);
}
this
.
header
=
header
;
this
.
condition
=
IfCondition
.
fromIfBlock
(
header
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录