Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
colcode
jadx
提交
81ee9e6b
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,发现更多精彩内容 >>
提交
81ee9e6b
编写于
5月 25, 2013
作者:
S
Skylot
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove unused code
上级
d5737ade
变更
18
隐藏空白更改
内联
并排
Showing
18 changed file
with
24 addition
and
53 deletion
+24
-53
src/main/java/jadx/codegen/ClassGen.java
src/main/java/jadx/codegen/ClassGen.java
+1
-1
src/main/java/jadx/codegen/RegionGen.java
src/main/java/jadx/codegen/RegionGen.java
+1
-1
src/main/java/jadx/codegen/TypeGen.java
src/main/java/jadx/codegen/TypeGen.java
+0
-15
src/main/java/jadx/dex/info/ClassInfo.java
src/main/java/jadx/dex/info/ClassInfo.java
+2
-6
src/main/java/jadx/dex/info/LocalVarInfo.java
src/main/java/jadx/dex/info/LocalVarInfo.java
+1
-1
src/main/java/jadx/dex/instructions/IfNode.java
src/main/java/jadx/dex/instructions/IfNode.java
+1
-1
src/main/java/jadx/dex/instructions/mods/TernaryInsn.java
src/main/java/jadx/dex/instructions/mods/TernaryInsn.java
+1
-1
src/main/java/jadx/dex/nodes/BlockNode.java
src/main/java/jadx/dex/nodes/BlockNode.java
+1
-1
src/main/java/jadx/dex/nodes/DexNode.java
src/main/java/jadx/dex/nodes/DexNode.java
+1
-2
src/main/java/jadx/dex/nodes/RootNode.java
src/main/java/jadx/dex/nodes/RootNode.java
+1
-9
src/main/java/jadx/dex/nodes/parser/DebugInfoParser.java
src/main/java/jadx/dex/nodes/parser/DebugInfoParser.java
+1
-1
src/main/java/jadx/dex/visitors/BlockMakerVisitor.java
src/main/java/jadx/dex/visitors/BlockMakerVisitor.java
+5
-5
src/main/java/jadx/dex/visitors/BlockProcessingHelper.java
src/main/java/jadx/dex/visitors/BlockProcessingHelper.java
+2
-2
src/main/java/jadx/dex/visitors/ConstInlinerVisitor.java
src/main/java/jadx/dex/visitors/ConstInlinerVisitor.java
+1
-1
src/main/java/jadx/dex/visitors/MethodInlinerVisitor.java
src/main/java/jadx/dex/visitors/MethodInlinerVisitor.java
+1
-1
src/main/java/jadx/utils/BlockUtils.java
src/main/java/jadx/utils/BlockUtils.java
+3
-3
src/main/java/jadx/utils/Utils.java
src/main/java/jadx/utils/Utils.java
+1
-1
src/main/java/jadx/utils/exceptions/JadxRuntimeException.java
...main/java/jadx/utils/exceptions/JadxRuntimeException.java
+0
-1
未找到文件。
src/main/java/jadx/codegen/ClassGen.java
浏览文件 @
81ee9e6b
...
...
@@ -177,7 +177,7 @@ public class ClassGen {
clsCode
.
startLine
(
'}'
);
}
private
CodeWriter
makeInnerClasses
(
ClassNode
cls
2
,
int
indent
)
throws
CodegenException
{
private
CodeWriter
makeInnerClasses
(
ClassNode
cls
,
int
indent
)
throws
CodegenException
{
CodeWriter
innerClsCode
=
new
CodeWriter
(
indent
+
1
);
for
(
ClassNode
inCls
:
cls
.
getInnerClasses
())
{
if
(
inCls
.
isAnonymous
())
...
...
src/main/java/jadx/codegen/RegionGen.java
浏览文件 @
81ee9e6b
...
...
@@ -72,7 +72,7 @@ public class RegionGen extends InsnGen {
}
}
private
void
declareVars
(
CodeWriter
code
,
IContainer
cont
)
throws
CodegenException
{
private
void
declareVars
(
CodeWriter
code
,
IContainer
cont
)
{
DeclareVariableAttr
declVars
=
(
DeclareVariableAttr
)
cont
.
getAttributes
().
get
(
AttributeType
.
DECLARE_VARIABLE
);
if
(
declVars
!=
null
)
{
...
...
src/main/java/jadx/codegen/TypeGen.java
浏览文件 @
81ee9e6b
...
...
@@ -22,21 +22,6 @@ public class TypeGen {
return
stype
.
getLongName
();
}
@Deprecated
public
static
String
shortString
(
ArgType
type
)
{
final
PrimitiveType
stype
=
type
.
getPrimitiveType
();
if
(
stype
==
null
)
return
type
.
toString
();
if
(
stype
==
PrimitiveType
.
OBJECT
)
{
return
"L"
;
}
if
(
stype
==
PrimitiveType
.
ARRAY
)
{
return
shortString
(
type
.
getArrayElement
())
+
"A"
;
}
return
stype
.
getLongName
();
}
public
static
String
signature
(
ArgType
type
)
{
final
PrimitiveType
stype
=
type
.
getPrimitiveType
();
if
(
stype
==
PrimitiveType
.
OBJECT
)
{
...
...
src/main/java/jadx/dex/info/ClassInfo.java
浏览文件 @
81ee9e6b
...
...
@@ -72,12 +72,8 @@ public final class ClassInfo {
int
sep
=
name
.
lastIndexOf
(
'$'
);
if
(
sep
>
0
&&
sep
!=
name
.
length
()
-
1
)
{
String
parClsName
=
pkg
+
'.'
+
name
.
substring
(
0
,
sep
);
if
(
notObfuscated
||
dex
.
root
().
isClassExists
(
parClsName
))
{
parentClass
=
fromName
(
dex
,
parClsName
);
name
=
name
.
substring
(
sep
+
1
);
}
else
{
parentClass
=
null
;
}
parentClass
=
fromName
(
dex
,
parClsName
);
name
=
name
.
substring
(
sep
+
1
);
}
else
{
parentClass
=
null
;
}
...
...
src/main/java/jadx/dex/info/LocalVarInfo.java
浏览文件 @
81ee9e6b
...
...
@@ -22,7 +22,7 @@ public class LocalVarInfo extends RegisterArg {
init
(
name
,
type
,
sign
);
}
public
LocalVarInfo
(
DexNode
dex
,
RegisterArg
arg
)
{
public
LocalVarInfo
(
RegisterArg
arg
)
{
super
(
arg
.
getRegNum
());
init
(
arg
.
getTypedVar
().
getName
(),
arg
.
getType
(),
null
);
}
...
...
src/main/java/jadx/dex/instructions/IfNode.java
浏览文件 @
81ee9e6b
...
...
@@ -13,7 +13,7 @@ public class IfNode extends GotoNode {
protected
boolean
zeroCmp
;
protected
IfOp
op
;
public
IfNode
(
IfOp
op
,
int
targ
,
InsnArg
then
,
InsnArg
els
)
{
public
IfNode
(
int
targ
,
InsnArg
then
,
InsnArg
els
)
{
super
(
InsnType
.
IF
,
targ
);
addArg
(
then
);
if
(
els
==
null
)
{
...
...
src/main/java/jadx/dex/instructions/mods/TernaryInsn.java
浏览文件 @
81ee9e6b
...
...
@@ -11,7 +11,7 @@ import jadx.utils.Utils;
public
class
TernaryInsn
extends
IfNode
{
public
TernaryInsn
(
IfOp
op
,
InsnNode
then
,
InsnNode
els
)
{
super
(
op
,
then
.
getOffset
(),
super
(
then
.
getOffset
(),
InsnArg
.
wrap
(
then
),
els
==
null
?
null
:
InsnArg
.
wrap
(
els
));
}
...
...
src/main/java/jadx/dex/nodes/BlockNode.java
浏览文件 @
81ee9e6b
...
...
@@ -27,7 +27,7 @@ public class BlockNode extends AttrNode implements IBlock {
private
BlockRegState
startState
;
private
BlockRegState
endState
;
public
BlockNode
(
MethodNode
mth
,
int
id
,
int
offset
)
{
public
BlockNode
(
int
id
,
int
offset
)
{
this
.
id
=
id
;
this
.
startOffset
=
offset
;
}
...
...
src/main/java/jadx/dex/nodes/DexNode.java
浏览文件 @
81ee9e6b
...
...
@@ -6,7 +6,6 @@ import jadx.dex.instructions.args.ArgType;
import
jadx.utils.exceptions.DecodeException
;
import
jadx.utils.files.InputFile
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -38,7 +37,7 @@ public class DexNode {
this
.
strings
=
stringList
.
toArray
(
new
String
[
stringList
.
size
()]);
}
public
void
loadClasses
(
RootNode
root
)
throws
DecodeException
{
public
void
loadClasses
()
throws
DecodeException
{
for
(
ClassDef
cls
:
dexBuf
.
classDefs
())
{
classes
.
add
(
new
ClassNode
(
this
,
cls
));
}
...
...
src/main/java/jadx/dex/nodes/RootNode.java
浏览文件 @
81ee9e6b
...
...
@@ -40,7 +40,7 @@ public class RootNode {
}
for
(
DexNode
dexNode
:
dexNodes
)
dexNode
.
loadClasses
(
this
);
dexNode
.
loadClasses
();
for
(
DexNode
dexNode
:
dexNodes
)
{
for
(
ClassNode
cls
:
dexNode
.
getClasses
())
...
...
@@ -76,14 +76,6 @@ public class RootNode {
return
names
.
get
(
fullName
);
}
/**
* Without full classpath listing this function is useless
*/
@Deprecated
public
boolean
isClassExists
(
String
fullName
)
{
return
true
;
}
public
ClassNode
resolveClass
(
ClassInfo
cls
)
{
String
fullName
=
cls
.
getFullName
();
ClassNode
rCls
=
searchClassByName
(
fullName
);
...
...
src/main/java/jadx/dex/nodes/parser/DebugInfoParser.java
浏览文件 @
81ee9e6b
...
...
@@ -67,7 +67,7 @@ public class DebugInfoParser {
for
(
RegisterArg
arg
:
mthArgs
)
{
int
rn
=
arg
.
getRegNum
();
locals
[
rn
]
=
new
LocalVarInfo
(
dex
,
arg
);
locals
[
rn
]
=
new
LocalVarInfo
(
arg
);
activeRegisters
[
rn
]
=
arg
;
}
...
...
src/main/java/jadx/dex/visitors/BlockMakerVisitor.java
浏览文件 @
81ee9e6b
...
...
@@ -143,8 +143,8 @@ public class BlockMakerVisitor extends AbstractVisitor {
List
<
IAttribute
>
jumps
=
insn
.
getAttributes
().
getAll
(
AttributeType
.
JUMP
);
for
(
IAttribute
attr
:
jumps
)
{
JumpAttribute
jump
=
(
JumpAttribute
)
attr
;
BlockNode
srcBlock
=
getBlock
(
mth
,
jump
.
getSrc
(),
blocksMap
);
BlockNode
thisblock
=
getBlock
(
mth
,
jump
.
getDest
(),
blocksMap
);
BlockNode
srcBlock
=
getBlock
(
jump
.
getSrc
(),
blocksMap
);
BlockNode
thisblock
=
getBlock
(
jump
.
getDest
(),
blocksMap
);
connect
(
srcBlock
,
thisblock
);
}
...
...
@@ -156,7 +156,7 @@ public class BlockMakerVisitor extends AbstractVisitor {
if
(
spl
!=
null
)
{
BlockNode
connBlock
=
((
SplitterBlockAttr
)
spl
).
getBlock
();
for
(
ExceptionHandler
h
:
catches
.
getTryBlock
().
getHandlers
())
{
BlockNode
destBlock
=
getBlock
(
mth
,
h
.
getHandleOffset
(),
blocksMap
);
BlockNode
destBlock
=
getBlock
(
h
.
getHandleOffset
(),
blocksMap
);
// skip self loop in handler
if
(
connBlock
!=
destBlock
)
// && !connBlock.getPredecessors().contains(destBlock))
...
...
@@ -183,7 +183,7 @@ public class BlockMakerVisitor extends AbstractVisitor {
}
}
private
static
BlockNode
getBlock
(
MethodNode
mth
,
int
offset
,
Map
<
Integer
,
BlockNode
>
blocksMap
)
{
private
static
BlockNode
getBlock
(
int
offset
,
Map
<
Integer
,
BlockNode
>
blocksMap
)
{
BlockNode
block
=
blocksMap
.
get
(
offset
);
assert
block
!=
null
;
return
block
;
...
...
@@ -202,7 +202,7 @@ public class BlockMakerVisitor extends AbstractVisitor {
}
private
static
BlockNode
startNewBlock
(
MethodNode
mth
,
int
offset
)
{
BlockNode
block
=
new
BlockNode
(
mth
,
++
nextBlockId
,
offset
);
BlockNode
block
=
new
BlockNode
(++
nextBlockId
,
offset
);
mth
.
getBasicBlocks
().
add
(
block
);
return
block
;
}
...
...
src/main/java/jadx/dex/visitors/BlockProcessingHelper.java
浏览文件 @
81ee9e6b
...
...
@@ -19,7 +19,7 @@ public class BlockProcessingHelper {
return
;
for
(
BlockNode
block
:
mth
.
getBasicBlocks
())
{
markExceptionHandlers
(
mth
,
block
);
markExceptionHandlers
(
block
);
}
for
(
BlockNode
block
:
mth
.
getBasicBlocks
())
{
block
.
updateCleanSuccessors
();
...
...
@@ -35,7 +35,7 @@ public class BlockProcessingHelper {
/**
* Set exception handler attribute for whole block
*/
private
static
void
markExceptionHandlers
(
MethodNode
mth
,
BlockNode
block
)
{
private
static
void
markExceptionHandlers
(
BlockNode
block
)
{
if
(!
block
.
getInstructions
().
isEmpty
())
{
InsnNode
me
=
block
.
getInstructions
().
get
(
0
);
ExcHandlerAttr
handlerAttr
=
(
ExcHandlerAttr
)
me
.
getAttributes
().
get
(
AttributeType
.
EXC_HANDLER
);
...
...
src/main/java/jadx/dex/visitors/ConstInlinerVisitor.java
浏览文件 @
81ee9e6b
...
...
@@ -105,7 +105,7 @@ public class ConstInlinerVisitor extends AbstractVisitor {
/**
* This is method similar to PostTypeResolver.visit method,
* but contains some expensive operations needed only after const
s inlining
* but contains some expensive operations needed only after const
ant inline
*/
private
static
void
fixTypes
(
MethodNode
mth
,
InsnNode
insn
)
{
switch
(
insn
.
getType
())
{
...
...
src/main/java/jadx/dex/visitors/MethodInlinerVisitor.java
浏览文件 @
81ee9e6b
...
...
@@ -40,7 +40,7 @@ public class MethodInlinerVisitor extends AbstractVisitor {
if
(
block
.
getInstructions
().
size
()
==
1
)
{
InsnNode
insn
=
block
.
getInstructions
().
get
(
0
);
addInlineAttr
(
mth
,
insn
);
}
}
}
}
}
...
...
src/main/java/jadx/utils/BlockUtils.java
浏览文件 @
81ee9e6b
...
...
@@ -52,8 +52,8 @@ public class BlockUtils {
if
(
from
.
getCleanSuccessors
().
contains
(
to
))
return
false
;
// already checked
return
from
.
getSuccessors
().
contains
(
to
);
}
return
from
.
getSuccessors
().
contains
(
to
);
}
/**
* Remove exception handlers from block nodes bitset
...
...
@@ -66,7 +66,7 @@ public class BlockUtils {
}
}
public
static
BlockNode
canMergeNextBlock
(
MethodNode
mth
,
BlockNode
block
)
{
public
static
BlockNode
canMergeNextBlock
(
BlockNode
block
)
{
BlockNode
next
=
getNextBlock
(
block
);
if
(
next
!=
null
)
{
if
(
next
.
getIDom
()
==
block
)
{
...
...
src/main/java/jadx/utils/Utils.java
浏览文件 @
81ee9e6b
...
...
@@ -126,7 +126,7 @@ public class Utils {
public
static
String
getJadxVersion
()
{
try
{
Enumeration
<
URL
>
resources
=
Utils
.
class
.
getClassLoader
().
getResources
(
"META-INF/MANIFEST.MF"
);
Utils
.
class
.
getClassLoader
().
getResources
(
"META-INF/MANIFEST.MF"
);
while
(
resources
.
hasMoreElements
())
{
Manifest
manifest
=
new
Manifest
(
resources
.
nextElement
().
openStream
());
String
ver
=
manifest
.
getMainAttributes
().
getValue
(
"jadx-version"
);
...
...
src/main/java/jadx/utils/exceptions/JadxRuntimeException.java
浏览文件 @
81ee9e6b
package
jadx.utils.exceptions
;
public
class
JadxRuntimeException
extends
RuntimeException
{
private
static
final
long
serialVersionUID
=
-
7410848445429898248L
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录