Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
keyescgm
jadx
提交
210c8e54
J
jadx
项目概览
keyescgm
/
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,发现更多精彩内容 >>
提交
210c8e54
编写于
5月 04, 2013
作者:
S
Skylot
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Adjust types merge, other code improvements
上级
4e284c4c
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
26 addition
and
39 deletion
+26
-39
src/main/java/jadx/codegen/RegionGen.java
src/main/java/jadx/codegen/RegionGen.java
+1
-3
src/main/java/jadx/dex/instructions/args/ArgType.java
src/main/java/jadx/dex/instructions/args/ArgType.java
+11
-23
src/main/java/jadx/dex/visitors/BlockProcessingHelper.java
src/main/java/jadx/dex/visitors/BlockProcessingHelper.java
+0
-1
src/main/java/jadx/dex/visitors/ModVisitor.java
src/main/java/jadx/dex/visitors/ModVisitor.java
+6
-1
src/main/java/jadx/dex/visitors/regions/RegionMaker.java
src/main/java/jadx/dex/visitors/regions/RegionMaker.java
+6
-4
src/main/java/jadx/utils/RegionUtils.java
src/main/java/jadx/utils/RegionUtils.java
+1
-2
src/test/java/jadx/tests/TypeMergeTest.java
src/test/java/jadx/tests/TypeMergeTest.java
+1
-5
未找到文件。
src/main/java/jadx/codegen/RegionGen.java
浏览文件 @
210c8e54
...
...
@@ -124,9 +124,7 @@ public class RegionGen extends InsnGen {
}
code
.
add
(
'{'
);
code
.
incIndent
();
makeRegion
(
code
,
els
);
code
.
decIndent
();
makeRegionIndent
(
code
,
els
);
code
.
startLine
(
'}'
);
}
}
...
...
src/main/java/jadx/dex/instructions/args/ArgType.java
浏览文件 @
210c8e54
...
...
@@ -187,18 +187,12 @@ public abstract class ArgType {
@Override
public
int
getArrayDimension
()
{
if
(
isArray
())
return
1
+
arrayElement
.
getArrayDimension
();
else
return
0
;
return
1
+
arrayElement
.
getArrayDimension
();
}
@Override
public
ArgType
getArrayRootElement
()
{
if
(
isArray
())
return
arrayElement
.
getArrayRootElement
();
else
return
this
;
return
arrayElement
.
getArrayRootElement
();
}
@Override
...
...
@@ -235,7 +229,6 @@ public abstract class ArgType {
@Override
public
ArgType
selectFirst
()
{
assert
possibleTypes
!=
null
;
PrimitiveType
f
=
possibleTypes
[
0
];
if
(
f
==
PrimitiveType
.
OBJECT
||
f
==
PrimitiveType
.
ARRAY
)
return
object
(
Consts
.
CLASS_OBJECT
);
...
...
@@ -280,10 +273,6 @@ public abstract class ArgType {
return
null
;
}
public
ArgType
getArrayElement
()
{
return
null
;
}
public
boolean
isArray
()
{
return
false
;
}
...
...
@@ -292,6 +281,10 @@ public abstract class ArgType {
return
0
;
}
public
ArgType
getArrayElement
()
{
return
null
;
}
public
ArgType
getArrayRootElement
()
{
return
this
;
}
...
...
@@ -363,8 +356,7 @@ public abstract class ArgType {
return
a
;
else
// different objects
return
OBJECT
;
// return null;
return
null
;
}
if
(
a
.
isArray
()
&&
b
.
isArray
())
{
...
...
@@ -526,7 +518,6 @@ public abstract class ArgType {
if
(
prev
!=
null
)
{
genericMap
.
put
(
prev
,
genList
);
}
// LOG.debug("sign: {} -> {}", gen, genericMap);
}
return
genericMap
;
}
catch
(
Throwable
e
)
{
...
...
@@ -570,7 +561,7 @@ public abstract class ArgType {
@Override
public
String
toString
()
{
return
"
UNKNOWN
"
;
return
"
ARG_TYPE
"
;
}
@Override
...
...
@@ -583,11 +574,8 @@ public abstract class ArgType {
if
(
this
==
obj
)
return
true
;
if
(
obj
==
null
)
return
false
;
if
(
hash
!=
obj
.
hashCode
())
return
false
;
if
(
getClass
()
!=
obj
.
getClass
())
{
return
false
;
}
if
(
getClass
()
!=
obj
.
getClass
())
return
false
;
// TODO: don't use toString
return
toString
().
equals
(
obj
.
toString
());
}
return
toString
().
equals
(
obj
.
toString
());
}
}
src/main/java/jadx/dex/visitors/BlockProcessingHelper.java
浏览文件 @
210c8e54
...
...
@@ -48,7 +48,6 @@ public class BlockProcessingHelper {
excArg
.
getTypedVar
().
forceSetType
(
ArgType
.
THROWABLE
);
else
excArg
.
getTypedVar
().
forceSetType
(
excHandler
.
getCatchType
().
getType
());
// excArg.getTypedVar().merge(excHandler.getCatchType().getType());
excHandler
.
setArg
(
excArg
);
block
.
getAttributes
().
add
(
handlerAttr
);
...
...
src/main/java/jadx/dex/visitors/ModVisitor.java
浏览文件 @
210c8e54
...
...
@@ -193,7 +193,12 @@ public class ModVisitor extends AbstractVisitor {
// move not removed instructions to 'finally' block
if
(
size
!=
0
)
{
// TODO: support instructions from several blocks
tryBlock
.
setFinalBlockFromInsns
(
mth
,
insns
);
// tryBlock.setFinalBlockFromInsns(mth, insns);
// TODO; because of incomplete realization don't extract final block,
// just remove unnecessary instructions
insns
.
clear
();
size
=
insns
.
size
();
}
}
...
...
src/main/java/jadx/dex/visitors/regions/RegionMaker.java
浏览文件 @
210c8e54
...
...
@@ -3,7 +3,6 @@ package jadx.dex.visitors.regions;
import
jadx.dex.attributes.AttributeFlag
;
import
jadx.dex.attributes.AttributeType
;
import
jadx.dex.attributes.AttributesList
;
import
jadx.dex.attributes.ForceReturnAttr
;
import
jadx.dex.attributes.IAttribute
;
import
jadx.dex.attributes.LoopAttr
;
import
jadx.dex.instructions.IfNode
;
...
...
@@ -210,17 +209,20 @@ public class RegionMaker {
if
(
BlockUtils
.
isPathExists
(
loopExit
,
next
))
{
// found cross
if
(
next
.
getCleanSuccessors
().
size
()
==
1
)
{
// TODO: do nothing until return is splitted
BlockNode
r
=
BlockUtils
.
getNextBlock
(
next
);
if
(
r
!=
null
&&
r
.
getAttributes
().
contains
(
AttributeFlag
.
RETURN
)
&&
r
.
getInstructions
().
size
()
>
0
&&
r
.
getInstructions
().
get
(
0
).
getType
()
==
InsnType
.
RETURN
)
{
next
.
getAttributes
().
add
(
new
ForceReturnAttr
(
r
.
getInstructions
().
get
(
0
)));
//
next.getAttributes().add(new ForceReturnAttr(r.getInstructions().get(0)));
}
else
{
next
.
getAttributes
().
add
(
AttributeFlag
.
BREAK
);
// next.getAttributes().add(AttributeFlag.BREAK);
// stack.addExit(r);
}
}
else
{
stack
.
addExit
(
next
);
}
stack
.
addExit
(
next
);
break
;
}
next
=
BlockUtils
.
getNextBlock
(
next
);
...
...
src/main/java/jadx/utils/RegionUtils.java
浏览文件 @
210c8e54
...
...
@@ -100,8 +100,7 @@ public class RegionUtils {
}
/**
* Check if region contains in container
*
* Check if {@code region} contains in {@code container}.<br>
* For simple region (not from exception handlers) search in parents
* otherwise run recursive search because exception handlers can have several parents
*/
...
...
src/test/java/jadx/tests/TypeMergeTest.java
浏览文件 @
210c8e54
...
...
@@ -39,12 +39,8 @@ public class TypeMergeTest extends TestCase {
unknown
(
PrimitiveType
.
OBJECT
));
first
(
object
(
"Lsomeobj;"
),
object
(
"Lsomeobj;"
));
merge
(
object
(
"Lsomeobj;"
),
object
(
"Lotherobj;"
),
OBJECT
);
merge
(
object
(
"Lsomeobj;"
),
object
(
"Lotherobj;"
),
null
);
first
(
object
(
"Lsomeobj;"
),
OBJECT
);
// first(object("Lsomeobj;"), object("Lsomeobj;"));
// merge(object("Lsomeobj;"), object("Lotherobj;"), null);
// merge(object("Lsomeobj;"), OBJECT, null);
}
private
void
first
(
ArgType
t1
,
ArgType
t2
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录