Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
colcode
jadx
提交
9bf7270b
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,发现更多精彩内容 >>
提交
9bf7270b
编写于
9月 24, 2013
作者:
S
Skylot
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
reformat code, resolve compiler warnings
上级
a99e0e96
变更
41
隐藏空白更改
内联
并排
Showing
41 changed file
with
120 addition
and
83 deletion
+120
-83
build.gradle
build.gradle
+4
-2
gradle/wrapper/gradle-wrapper.properties
gradle/wrapper/gradle-wrapper.properties
+1
-0
jadx-core/src/main/java/jadx/api/IJadxArgs.java
jadx-core/src/main/java/jadx/api/IJadxArgs.java
+5
-5
jadx-core/src/main/java/jadx/api/JavaPackage.java
jadx-core/src/main/java/jadx/api/JavaPackage.java
+18
-4
jadx-core/src/main/java/jadx/core/clsp/ClspGraph.java
jadx-core/src/main/java/jadx/core/clsp/ClspGraph.java
+2
-2
jadx-core/src/main/java/jadx/core/codegen/AnnotationGen.java
jadx-core/src/main/java/jadx/core/codegen/AnnotationGen.java
+3
-3
jadx-core/src/main/java/jadx/core/codegen/ClassGen.java
jadx-core/src/main/java/jadx/core/codegen/ClassGen.java
+3
-3
jadx-core/src/main/java/jadx/core/codegen/CodeWriter.java
jadx-core/src/main/java/jadx/core/codegen/CodeWriter.java
+1
-1
jadx-core/src/main/java/jadx/core/codegen/TypeGen.java
jadx-core/src/main/java/jadx/core/codegen/TypeGen.java
+1
-2
jadx-core/src/main/java/jadx/core/deobf/NameMapper.java
jadx-core/src/main/java/jadx/core/deobf/NameMapper.java
+1
-1
jadx-core/src/main/java/jadx/core/dex/attributes/AttributesList.java
...rc/main/java/jadx/core/dex/attributes/AttributesList.java
+2
-2
jadx-core/src/main/java/jadx/core/dex/info/ClassInfo.java
jadx-core/src/main/java/jadx/core/dex/info/ClassInfo.java
+1
-1
jadx-core/src/main/java/jadx/core/dex/info/MethodInfo.java
jadx-core/src/main/java/jadx/core/dex/info/MethodInfo.java
+1
-1
jadx-core/src/main/java/jadx/core/dex/instructions/InsnDecoder.java
...src/main/java/jadx/core/dex/instructions/InsnDecoder.java
+2
-2
jadx-core/src/main/java/jadx/core/dex/instructions/args/InsnArg.java
...rc/main/java/jadx/core/dex/instructions/args/InsnArg.java
+1
-1
jadx-core/src/main/java/jadx/core/dex/instructions/args/TypedVar.java
...c/main/java/jadx/core/dex/instructions/args/TypedVar.java
+1
-1
jadx-core/src/main/java/jadx/core/dex/instructions/mods/ConstructorInsn.java
...java/jadx/core/dex/instructions/mods/ConstructorInsn.java
+0
-1
jadx-core/src/main/java/jadx/core/dex/nodes/InsnNode.java
jadx-core/src/main/java/jadx/core/dex/nodes/InsnNode.java
+1
-1
jadx-core/src/main/java/jadx/core/dex/nodes/parser/AnnotationsParser.java
...in/java/jadx/core/dex/nodes/parser/AnnotationsParser.java
+1
-1
jadx-core/src/main/java/jadx/core/dex/visitors/BlockMakerVisitor.java
...c/main/java/jadx/core/dex/visitors/BlockMakerVisitor.java
+2
-2
jadx-core/src/main/java/jadx/core/dex/visitors/CodeShrinker.java
...re/src/main/java/jadx/core/dex/visitors/CodeShrinker.java
+1
-1
jadx-core/src/main/java/jadx/core/dex/visitors/DotGraphVisitor.java
...src/main/java/jadx/core/dex/visitors/DotGraphVisitor.java
+2
-2
jadx-core/src/main/java/jadx/core/dex/visitors/InstructionRemover.java
.../main/java/jadx/core/dex/visitors/InstructionRemover.java
+2
-2
jadx-core/src/main/java/jadx/core/dex/visitors/regions/CleanRegions.java
...ain/java/jadx/core/dex/visitors/regions/CleanRegions.java
+1
-1
jadx-core/src/main/java/jadx/core/dex/visitors/regions/ProcessVariables.java
...java/jadx/core/dex/visitors/regions/ProcessVariables.java
+2
-2
jadx-core/src/main/java/jadx/core/dex/visitors/regions/RegionStack.java
...main/java/jadx/core/dex/visitors/regions/RegionStack.java
+1
-2
jadx-core/src/main/java/jadx/core/utils/Utils.java
jadx-core/src/main/java/jadx/core/utils/Utils.java
+1
-1
jadx-core/src/main/java/jadx/core/utils/files/JavaToDex.java
jadx-core/src/main/java/jadx/core/utils/files/JavaToDex.java
+1
-1
jadx-core/src/main/resources/logback.xml
jadx-core/src/main/resources/logback.xml
+10
-10
jadx-core/src/test/java/jadx/api/InternalJadxTest.java
jadx-core/src/test/java/jadx/api/InternalJadxTest.java
+1
-1
jadx-core/src/test/java/jadx/tests/internal/TestStringBuilderElimination.java
...ava/jadx/tests/internal/TestStringBuilderElimination.java
+2
-0
jadx-gui/src/main/java/jadx/gui/MainWindow.java
jadx-gui/src/main/java/jadx/gui/MainWindow.java
+1
-0
jadx-gui/src/main/java/jadx/gui/treemodel/JClass.java
jadx-gui/src/main/java/jadx/gui/treemodel/JClass.java
+3
-3
jadx-gui/src/main/java/jadx/gui/treemodel/JField.java
jadx-gui/src/main/java/jadx/gui/treemodel/JField.java
+3
-2
jadx-gui/src/main/java/jadx/gui/treemodel/JMethod.java
jadx-gui/src/main/java/jadx/gui/treemodel/JMethod.java
+5
-4
jadx-gui/src/main/java/jadx/gui/treemodel/JNode.java
jadx-gui/src/main/java/jadx/gui/treemodel/JNode.java
+6
-5
jadx-gui/src/main/java/jadx/gui/treemodel/JPackage.java
jadx-gui/src/main/java/jadx/gui/treemodel/JPackage.java
+17
-2
jadx-gui/src/main/java/jadx/gui/treemodel/JRoot.java
jadx-gui/src/main/java/jadx/gui/treemodel/JRoot.java
+2
-2
jadx-gui/src/test/java/jadx/gui/treemodel/JRootTest.java
jadx-gui/src/test/java/jadx/gui/treemodel/JRootTest.java
+1
-1
jadx-samples/src/main/java/jadx/samples/TestInner.java
jadx-samples/src/main/java/jadx/samples/TestInner.java
+1
-0
jadx-samples/src/main/java/jadx/samples/TestSwitch.java
jadx-samples/src/main/java/jadx/samples/TestSwitch.java
+6
-5
未找到文件。
build.gradle
浏览文件 @
9bf7270b
...
...
@@ -10,8 +10,10 @@ subprojects {
version
=
jadxVersion
compileJava
{
options
.
compilerArgs
<<
'-Xlint'
gradle
.
projectsEvaluated
{
tasks
.
withType
(
Compile
)
{
options
.
compilerArgs
<<
"-Xlint"
<<
"-Xlint:unchecked"
<<
"-Xlint:deprecation"
}
}
jar
{
...
...
gradle/wrapper/gradle-wrapper.properties
浏览文件 @
9bf7270b
#Tue Sep 24 21:49:47 MSK 2013
distributionBase
=
GRADLE_USER_HOME
distributionPath
=
wrapper/dists
zipStoreBase
=
GRADLE_USER_HOME
...
...
jadx-core/src/main/java/jadx/api/IJadxArgs.java
浏览文件 @
9bf7270b
package
jadx.api
;
public
interface
IJadxArgs
{
int
getThreadsCount
();
int
getThreadsCount
();
boolean
isCFGOutput
();
boolean
isCFGOutput
();
boolean
isRawCFGOutput
();
boolean
isRawCFGOutput
();
boolean
isFallbackMode
();
boolean
isFallbackMode
();
boolean
isVerbose
();
boolean
isVerbose
();
}
jadx-core/src/main/java/jadx/api/JavaPackage.java
浏览文件 @
9bf7270b
...
...
@@ -20,12 +20,26 @@ public final class JavaPackage implements Comparable<JavaPackage> {
}
@Override
public
String
toString
(
)
{
return
name
;
public
int
compareTo
(
JavaPackage
o
)
{
return
name
.
compareTo
(
o
.
name
)
;
}
@Override
public
int
compareTo
(
JavaPackage
o
)
{
return
name
.
compareTo
(
o
.
name
);
public
boolean
equals
(
Object
o
)
{
if
(
this
==
o
)
return
true
;
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
return
false
;
JavaPackage
that
=
(
JavaPackage
)
o
;
if
(!
name
.
equals
(
that
.
name
))
return
false
;
return
true
;
}
@Override
public
int
hashCode
()
{
return
name
.
hashCode
();
}
@Override
public
String
toString
()
{
return
name
;
}
}
jadx-core/src/main/java/jadx/core/clsp/ClspGraph.java
浏览文件 @
9bf7270b
...
...
@@ -69,7 +69,7 @@ public class ClspGraph {
}
Set
<
String
>
anc
=
getAncestors
(
clsName
);
NClass
cls
=
nameMap
.
get
(
implClsName
);
if
(
cls
!=
null
)
{
if
(
cls
!=
null
)
{
return
searchCommonParent
(
anc
,
cls
);
}
else
{
LOG
.
debug
(
"Missing class: {}"
,
implClsName
);
...
...
@@ -97,7 +97,7 @@ public class ClspGraph {
result
=
new
HashSet
<
String
>();
ancestorCache
.
put
(
clsName
,
result
);
NClass
cls
=
nameMap
.
get
(
clsName
);
if
(
cls
!=
null
)
{
if
(
cls
!=
null
)
{
addAncestorsNames
(
cls
,
result
);
}
else
{
LOG
.
debug
(
"Missing class: {}"
,
clsName
);
...
...
jadx-core/src/main/java/jadx/core/codegen/AnnotationGen.java
浏览文件 @
9bf7270b
...
...
@@ -81,7 +81,7 @@ public class AnnotationGen {
if
(
vl
.
size
()
==
1
&&
vl
.
containsKey
(
"value"
))
{
code
.
add
(
encValueToString
(
vl
.
get
(
"value"
)));
}
else
{
for
(
Iterator
<
Entry
<
String
,
Object
>>
it
=
vl
.
entrySet
().
iterator
();
it
.
hasNext
();)
{
for
(
Iterator
<
Entry
<
String
,
Object
>>
it
=
vl
.
entrySet
().
iterator
();
it
.
hasNext
();
)
{
Entry
<
String
,
Object
>
e
=
it
.
next
();
code
.
add
(
e
.
getKey
());
code
.
add
(
" = "
);
...
...
@@ -101,7 +101,7 @@ public class AnnotationGen {
if
(
an
!=
null
)
{
Object
exs
=
an
.
getDefaultValue
();
code
.
add
(
" throws "
);
for
(
Iterator
<
ArgType
>
it
=
((
List
<
ArgType
>)
exs
).
iterator
();
it
.
hasNext
();)
{
for
(
Iterator
<
ArgType
>
it
=
((
List
<
ArgType
>)
exs
).
iterator
();
it
.
hasNext
();
)
{
ArgType
ex
=
it
.
next
();
code
.
add
(
TypeGen
.
translate
(
classGen
,
ex
));
if
(
it
.
hasNext
())
...
...
@@ -163,7 +163,7 @@ public class AnnotationGen {
StringBuilder
str
=
new
StringBuilder
();
str
.
append
(
'{'
);
List
<
Object
>
list
=
(
List
<
Object
>)
val
;
for
(
Iterator
<
Object
>
it
=
list
.
iterator
();
it
.
hasNext
();)
{
for
(
Iterator
<
Object
>
it
=
list
.
iterator
();
it
.
hasNext
();
)
{
Object
obj
=
it
.
next
();
str
.
append
(
encValueToString
(
obj
));
if
(
it
.
hasNext
())
...
...
jadx-core/src/main/java/jadx/core/codegen/ClassGen.java
浏览文件 @
9bf7270b
...
...
@@ -356,7 +356,7 @@ public class ClassGen {
return
shortName
;
// don't add import if this class from same package
if
(
classInfo
.
getPackage
().
equals
(
cls
.
getPackage
()))
if
(
classInfo
.
getPackage
().
equals
(
cls
.
getPackage
()))
return
shortName
;
for
(
ClassInfo
cls
:
imports
)
{
...
...
@@ -380,9 +380,9 @@ public class ClassGen {
private
void
insertSourceFileInfo
(
CodeWriter
code
,
AttrNode
node
)
{
IAttribute
sourceFileAttr
=
node
.
getAttributes
().
get
(
AttributeType
.
SOURCE_FILE
);
if
(
sourceFileAttr
!=
null
)
{
if
(
sourceFileAttr
!=
null
)
{
code
.
startLine
(
1
,
"// compiled from: "
);
code
.
add
(((
SourceFileAttr
)
sourceFileAttr
).
getFileName
());
code
.
add
(((
SourceFileAttr
)
sourceFileAttr
).
getFileName
());
}
}
...
...
jadx-core/src/main/java/jadx/core/codegen/CodeWriter.java
浏览文件 @
9bf7270b
...
...
@@ -167,7 +167,7 @@ public class CodeWriter {
buf
.
trimToSize
();
for
(
Map
.
Entry
<
Object
,
Integer
>
entry
:
annotations
.
entrySet
())
{
Object
v
=
entry
.
getKey
();
if
(
v
instanceof
LineAttrNode
)
{
if
(
v
instanceof
LineAttrNode
)
{
LineAttrNode
l
=
(
LineAttrNode
)
v
;
l
.
setDecompiledLine
(
entry
.
getValue
());
}
...
...
jadx-core/src/main/java/jadx/core/codegen/TypeGen.java
浏览文件 @
9bf7270b
...
...
@@ -36,8 +36,7 @@ public class TypeGen {
/**
* Convert literal value to string according to value type
*
* @throws JadxRuntimeException
* for incorrect type or literal value
* @throws JadxRuntimeException for incorrect type or literal value
*/
public
static
String
literalToString
(
long
lit
,
ArgType
type
)
{
if
(
type
==
null
||
!
type
.
isTypeKnown
())
{
...
...
jadx-core/src/main/java/jadx/core/deobf/NameMapper.java
浏览文件 @
9bf7270b
...
...
@@ -7,7 +7,7 @@ import java.util.Set;
public
class
NameMapper
{
private
static
final
Set
<
String
>
reservedNames
=
new
HashSet
<
String
>(
Arrays
.
asList
(
new
String
[]
{
Arrays
.
asList
(
new
String
[]{
"abstract"
,
"assert"
,
"boolean"
,
...
...
jadx-core/src/main/java/jadx/core/dex/attributes/AttributesList.java
浏览文件 @
9bf7270b
...
...
@@ -129,7 +129,7 @@ public final class AttributesList {
if
(
type
.
isUniq
())
{
uniqAttr
.
remove
(
type
);
}
else
{
for
(
Iterator
<
IAttribute
>
it
=
attributes
.
iterator
();
it
.
hasNext
();)
{
for
(
Iterator
<
IAttribute
>
it
=
attributes
.
iterator
();
it
.
hasNext
();
)
{
IAttribute
attr
=
it
.
next
();
if
(
attr
.
getType
()
==
type
)
it
.
remove
();
...
...
@@ -148,7 +148,7 @@ public final class AttributesList {
if
(
getMultiCountInternal
(
type
)
==
0
)
return
;
for
(
Iterator
<
IAttribute
>
it
=
attributes
.
iterator
();
it
.
hasNext
();)
{
for
(
Iterator
<
IAttribute
>
it
=
attributes
.
iterator
();
it
.
hasNext
();
)
{
IAttribute
a
=
it
.
next
();
if
(
a
==
attr
)
{
it
.
remove
();
...
...
jadx-core/src/main/java/jadx/core/dex/info/ClassInfo.java
浏览文件 @
9bf7270b
...
...
@@ -81,7 +81,7 @@ public final class ClassInfo {
char
firstChar
=
name
.
charAt
(
0
);
if
(
Character
.
isDigit
(
firstChar
))
{
name
=
"InnerClass_"
+
name
;
}
else
if
(
firstChar
==
'$'
)
{
}
else
if
(
firstChar
==
'$'
)
{
name
=
"_"
+
name
;
}
if
(
NameMapper
.
isReserved
(
name
))
{
...
...
jadx-core/src/main/java/jadx/core/dex/info/MethodInfo.java
浏览文件 @
9bf7270b
...
...
@@ -49,10 +49,10 @@ public final class MethodInfo {
return
declClass
.
getFullName
()
+
"."
+
name
;
}
public
String
getFullId
()
{
return
declClass
.
getFullName
()
+
"."
+
shortId
;
}
/**
* Method name and signature
*/
...
...
jadx-core/src/main/java/jadx/core/dex/instructions/InsnDecoder.java
浏览文件 @
9bf7270b
...
...
@@ -74,7 +74,7 @@ public class InsnDecoder {
case
Opcodes
.
FILL_ARRAY_DATA_PAYLOAD
:
return
null
;
// move-result will be process in invoke and filled-new-array instructions
// move-result will be process in invoke and filled-new-array instructions
case
Opcodes
.
MOVE_RESULT
:
case
Opcodes
.
MOVE_RESULT_WIDE
:
case
Opcodes
.
MOVE_RESULT_OBJECT
:
...
...
@@ -676,7 +676,7 @@ public class InsnDecoder {
return
node
;
}
private
InsnNode
insn
(
InsnType
type
,
RegisterArg
res
,
InsnArg
arg
)
{
private
InsnNode
insn
(
InsnType
type
,
RegisterArg
res
,
InsnArg
arg
)
{
InsnNode
node
=
new
InsnNode
(
type
,
1
);
node
.
setResult
(
res
);
node
.
addArg
(
arg
);
...
...
jadx-core/src/main/java/jadx/core/dex/instructions/args/InsnArg.java
浏览文件 @
9bf7270b
...
...
@@ -75,7 +75,7 @@ public abstract class InsnArg extends Typed {
arg
=
insn
.
getArg
(
0
);
String
name
=
insn
.
getResult
().
getTypedVar
().
getName
();
if
(
name
!=
null
)
{
arg
.
getTypedVar
().
setName
(
name
);
arg
.
getTypedVar
().
setName
(
name
);
}
break
;
case
CONST_STR:
...
...
jadx-core/src/main/java/jadx/core/dex/instructions/args/TypedVar.java
浏览文件 @
9bf7270b
...
...
@@ -83,7 +83,7 @@ public class TypedVar {
@Override
public
String
toString
()
{
StringBuilder
sb
=
new
StringBuilder
();
if
(
name
!=
null
)
if
(
name
!=
null
)
sb
.
append
(
'\''
).
append
(
name
).
append
(
"' "
);
sb
.
append
(
type
);
return
sb
.
toString
();
...
...
jadx-core/src/main/java/jadx/core/dex/instructions/mods/ConstructorInsn.java
浏览文件 @
9bf7270b
...
...
@@ -4,7 +4,6 @@ import jadx.core.dex.info.ClassInfo;
import
jadx.core.dex.info.MethodInfo
;
import
jadx.core.dex.instructions.InsnType
;
import
jadx.core.dex.instructions.InvokeNode
;
import
jadx.core.dex.instructions.args.InsnArg
;
import
jadx.core.dex.instructions.args.RegisterArg
;
import
jadx.core.dex.nodes.InsnNode
;
import
jadx.core.dex.nodes.MethodNode
;
...
...
jadx-core/src/main/java/jadx/core/dex/nodes/InsnNode.java
浏览文件 @
9bf7270b
...
...
@@ -71,7 +71,7 @@ public class InsnNode extends LineAttrNode {
public
boolean
containsArg
(
RegisterArg
arg
)
{
for
(
InsnArg
a
:
arguments
)
{
if
(
a
==
arg
||
(
a
.
isRegister
()
&&
((
RegisterArg
)
a
).
getRegNum
()
==
arg
.
getRegNum
()))
if
(
a
==
arg
||
(
a
.
isRegister
()
&&
((
RegisterArg
)
a
).
getRegNum
()
==
arg
.
getRegNum
()))
return
true
;
}
return
false
;
...
...
jadx-core/src/main/java/jadx/core/dex/nodes/parser/AnnotationsParser.java
浏览文件 @
9bf7270b
...
...
@@ -73,7 +73,7 @@ public class AnnotationsParser {
return
new
AnnotationsList
(
list
);
}
private
static
final
Annotation
.
Visibility
[]
visibilities
=
new
Annotation
.
Visibility
[]
{
private
static
final
Annotation
.
Visibility
[]
visibilities
=
new
Annotation
.
Visibility
[]{
Annotation
.
Visibility
.
BUILD
,
Annotation
.
Visibility
.
RUNTIME
,
Annotation
.
Visibility
.
SYSTEM
...
...
jadx-core/src/main/java/jadx/core/dex/visitors/BlockMakerVisitor.java
浏览文件 @
9bf7270b
...
...
@@ -276,7 +276,7 @@ public class BlockMakerVisitor extends AbstractVisitor {
idom
.
getDominatesOn
().
add
(
block
);
}
else
{
throw
new
JadxRuntimeException
(
"Can't find immediate dominator for block "
+
block
+
" in "
+
bs
+
" preds:"
+
preds
);
+
" in "
+
bs
+
" preds:"
+
preds
);
}
}
}
...
...
@@ -313,7 +313,7 @@ public class BlockMakerVisitor extends AbstractVisitor {
for
(
BlockNode
block
:
mth
.
getBasicBlocks
())
{
AttributesList
attributes
=
block
.
getAttributes
();
IAttribute
loop
=
attributes
.
get
(
AttributeType
.
LOOP
);
if
(
loop
!=
null
&&
attributes
.
contains
(
AttributeFlag
.
LOOP_START
))
{
if
(
loop
!=
null
&&
attributes
.
contains
(
AttributeFlag
.
LOOP_START
))
{
mth
.
registerLoop
((
LoopAttr
)
loop
);
}
}
...
...
jadx-core/src/main/java/jadx/core/dex/visitors/CodeShrinker.java
浏览文件 @
9bf7270b
...
...
@@ -237,7 +237,7 @@ public class CodeShrinker extends AbstractVisitor {
case
CHECK_CAST:
InsnArg
castArg
=
insn
.
getArg
(
0
);
ArgType
castType
=
(
ArgType
)
((
IndexInsnNode
)
insn
).
getIndex
();
ArgType
castType
=
(
ArgType
)
((
IndexInsnNode
)
insn
).
getIndex
();
if
(!
ArgType
.
isCastNeeded
(
castArg
.
getType
(),
castType
))
{
InsnNode
insnNode
=
new
InsnNode
(
InsnType
.
MOVE
,
1
);
insnNode
.
setResult
(
insn
.
getResult
());
...
...
jadx-core/src/main/java/jadx/core/dex/visitors/DotGraphVisitor.java
浏览文件 @
9bf7270b
...
...
@@ -66,8 +66,8 @@ public class DotGraphVisitor extends AbstractVisitor {
dot
.
startLine
(
"MethodNode[shape=record,label=\"{"
+
escape
(
mth
.
getAccessFlags
().
makeString
())
+
escape
(
mth
.
getReturnType
()
+
" "
+
mth
.
getParentClass
().
getFullName
()
+
"."
+
mth
.
getName
()
+
"("
+
Utils
.
listToString
(
mth
.
getArguments
(
true
))
+
") "
)
+
mth
.
getParentClass
().
getFullName
()
+
"."
+
mth
.
getName
()
+
"("
+
Utils
.
listToString
(
mth
.
getArguments
(
true
))
+
") "
)
+
(
attrs
.
length
()
==
0
?
""
:
" | "
+
attrs
)
+
(
mth
.
getSuperCall
()
!=
null
?
"| Super call: "
+
escape
(
mth
.
getSuperCall
().
toString
())
:
""
)
+
"}\"];"
);
...
...
jadx-core/src/main/java/jadx/core/dex/visitors/InstructionRemover.java
浏览文件 @
9bf7270b
...
...
@@ -63,7 +63,7 @@ public class InstructionRemover {
for
(
InsnNode
rem
:
toRemove
)
{
unbindInsn
(
rem
);
for
(
Iterator
<
InsnNode
>
it
=
insns
.
iterator
();
it
.
hasNext
();)
{
for
(
Iterator
<
InsnNode
>
it
=
insns
.
iterator
();
it
.
hasNext
();
)
{
InsnNode
insn
=
it
.
next
();
if
(
insn
==
rem
)
{
it
.
remove
();
...
...
@@ -76,7 +76,7 @@ public class InstructionRemover {
public
static
void
remove
(
BlockNode
block
,
InsnNode
insn
)
{
unbindInsn
(
insn
);
// remove by pointer (don't use equals)
for
(
Iterator
<
InsnNode
>
it
=
block
.
getInstructions
().
iterator
();
it
.
hasNext
();)
{
for
(
Iterator
<
InsnNode
>
it
=
block
.
getInstructions
().
iterator
();
it
.
hasNext
();
)
{
InsnNode
ir
=
it
.
next
();
if
(
ir
==
insn
)
{
it
.
remove
();
...
...
jadx-core/src/main/java/jadx/core/dex/visitors/regions/CleanRegions.java
浏览文件 @
9bf7270b
...
...
@@ -27,7 +27,7 @@ public class CleanRegions extends AbstractVisitor {
if
(!(
region
instanceof
Region
))
return
;
for
(
Iterator
<
IContainer
>
it
=
region
.
getSubBlocks
().
iterator
();
it
.
hasNext
();)
{
for
(
Iterator
<
IContainer
>
it
=
region
.
getSubBlocks
().
iterator
();
it
.
hasNext
();
)
{
IContainer
container
=
it
.
next
();
if
(
container
instanceof
BlockNode
)
{
BlockNode
block
=
(
BlockNode
)
container
;
...
...
jadx-core/src/main/java/jadx/core/dex/visitors/regions/ProcessVariables.java
浏览文件 @
9bf7270b
...
...
@@ -111,7 +111,7 @@ public class ProcessVariables extends AbstractVisitor {
usageMap
.
remove
(
arg
);
}
for
(
Iterator
<
Entry
<
RegisterArg
,
Usage
>>
it
=
usageMap
.
entrySet
().
iterator
();
it
.
hasNext
();)
{
for
(
Iterator
<
Entry
<
RegisterArg
,
Usage
>>
it
=
usageMap
.
entrySet
().
iterator
();
it
.
hasNext
();
)
{
Entry
<
RegisterArg
,
Usage
>
entry
=
it
.
next
();
Usage
u
=
entry
.
getValue
();
...
...
@@ -138,7 +138,7 @@ public class ProcessVariables extends AbstractVisitor {
// find region which contain all usage regions
Set
<
IRegion
>
set
=
u
.
getUseRegions
();
for
(
Iterator
<
IRegion
>
it
=
set
.
iterator
();
it
.
hasNext
();)
{
for
(
Iterator
<
IRegion
>
it
=
set
.
iterator
();
it
.
hasNext
();
)
{
IRegion
r
=
it
.
next
();
IRegion
parent
=
r
.
getParent
();
if
(
parent
!=
null
&&
set
.
contains
(
parent
))
...
...
jadx-core/src/main/java/jadx/core/dex/visitors/regions/RegionStack.java
浏览文件 @
9bf7270b
...
...
@@ -73,8 +73,7 @@ final class RegionStack {
/**
* Add boundary(exit) node for current stack frame
*
* @param exit
* boundary node, null will be ignored
* @param exit boundary node, null will be ignored
*/
public
void
addExit
(
BlockNode
exit
)
{
if
(
exit
!=
null
)
...
...
jadx-core/src/main/java/jadx/core/utils/Utils.java
浏览文件 @
9bf7270b
...
...
@@ -69,7 +69,7 @@ public class Utils {
return
""
;
StringBuilder
str
=
new
StringBuilder
();
for
(
Iterator
<?>
it
=
list
.
iterator
();
it
.
hasNext
();)
{
for
(
Iterator
<?>
it
=
list
.
iterator
();
it
.
hasNext
();
)
{
Object
o
=
it
.
next
();
str
.
append
(
o
);
if
(
it
.
hasNext
())
...
...
jadx-core/src/main/java/jadx/core/utils/files/JavaToDex.java
浏览文件 @
9bf7270b
...
...
@@ -34,7 +34,7 @@ public class JavaToDex {
ByteArrayOutputStream
baos
=
new
ByteArrayOutputStream
();
try
{
System
.
setOut
(
new
PrintStream
(
baos
));
DxArgs
args
=
new
DxArgs
(
"-"
,
new
String
[]
{
javaFile
});
DxArgs
args
=
new
DxArgs
(
"-"
,
new
String
[]
{
javaFile
});
Main
.
run
(
args
);
baos
.
close
();
}
catch
(
Throwable
e
)
{
...
...
jadx-core/src/main/resources/logback.xml
浏览文件 @
9bf7270b
<configuration>
<appender
name=
"STDOUT"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<encoder>
<pattern>
%d{HH:mm:ss} %-5level - %msg%n
</pattern>
</encoder>
</appender>
<appender
name=
"STDOUT"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<encoder>
<pattern>
%d{HH:mm:ss} %-5level - %msg%n
</pattern>
</encoder>
</appender>
<root
level=
"INFO"
>
<appender-ref
ref=
"STDOUT"
/>
</root>
</configuration>
\ No newline at end of file
<root
level=
"INFO"
>
<appender-ref
ref=
"STDOUT"
/>
</root>
</configuration>
jadx-core/src/test/java/jadx/api/InternalJadxTest.java
浏览文件 @
9bf7270b
...
...
@@ -21,7 +21,7 @@ import static junit.framework.Assert.fail;
public
abstract
class
InternalJadxTest
{
public
ClassNode
getClassNode
(
Class
clazz
)
{
public
ClassNode
getClassNode
(
Class
<?>
clazz
)
{
try
{
File
temp
=
getJarForClass
(
clazz
);
...
...
jadx-core/src/test/java/jadx/tests/internal/TestStringBuilderElimination.java
浏览文件 @
9bf7270b
...
...
@@ -12,6 +12,8 @@ import static org.junit.Assert.assertThat;
public
class
TestStringBuilderElimination
extends
InternalJadxTest
{
public
static
class
MyException
extends
Exception
{
private
static
final
long
serialVersionUID
=
4245254480662372757L
;
public
MyException
(
String
str
,
Exception
e
)
{
// super("msg:" + str, e);
}
...
...
jadx-gui/src/main/java/jadx/gui/MainWindow.java
浏览文件 @
9bf7270b
...
...
@@ -47,6 +47,7 @@ import org.fife.ui.rtextarea.RTextScrollPane;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
@SuppressWarnings
(
"serial"
)
public
class
MainWindow
extends
JFrame
{
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
MainWindow
.
class
);
...
...
jadx-gui/src/main/java/jadx/gui/treemodel/JClass.java
浏览文件 @
9bf7270b
...
...
@@ -8,9 +8,9 @@ import jadx.gui.utils.Utils;
import
javax.swing.Icon
;
import
javax.swing.ImageIcon
;
import
javax.swing.tree.DefaultMutableTreeNode
;
public
class
JClass
extends
DefaultMutableTreeNode
implements
JNode
{
public
class
JClass
extends
JNode
{
private
static
final
long
serialVersionUID
=
-
1239986875244097177L
;
private
static
final
ImageIcon
ICON_CLASS
=
Utils
.
openIcon
(
"class_obj"
);
private
static
final
ImageIcon
ICON_CLASS_DEFAULT
=
Utils
.
openIcon
(
"class_default_obj"
);
...
...
@@ -49,7 +49,7 @@ public class JClass extends DefaultMutableTreeNode implements JNode {
}
}
public
String
getCode
(){
public
String
getCode
()
{
return
cls
.
getCode
();
}
...
...
jadx-gui/src/main/java/jadx/gui/treemodel/JField.java
浏览文件 @
9bf7270b
...
...
@@ -7,9 +7,10 @@ import jadx.gui.utils.Utils;
import
javax.swing.Icon
;
import
javax.swing.ImageIcon
;
import
javax.swing.tree.DefaultMutableTreeNode
;
public
class
JField
extends
DefaultMutableTreeNode
implements
JNode
{
public
class
JField
extends
JNode
{
private
static
final
long
serialVersionUID
=
1712572192106793359L
;
private
static
final
ImageIcon
ICON_FLD_DEF
=
Utils
.
openIcon
(
"field_default_obj"
);
private
static
final
ImageIcon
ICON_FLD_PRI
=
Utils
.
openIcon
(
"field_private_obj"
);
private
static
final
ImageIcon
ICON_FLD_PRO
=
Utils
.
openIcon
(
"field_protected_obj"
);
...
...
jadx-gui/src/main/java/jadx/gui/treemodel/JMethod.java
浏览文件 @
9bf7270b
...
...
@@ -8,10 +8,11 @@ import jadx.gui.utils.Utils;
import
javax.swing.Icon
;
import
javax.swing.ImageIcon
;
import
javax.swing.tree.DefaultMutableTreeNode
;
import
java.util.Iterator
;
public
class
JMethod
extends
DefaultMutableTreeNode
implements
JNode
{
public
class
JMethod
extends
JNode
{
private
static
final
long
serialVersionUID
=
3834526867464663751L
;
private
static
final
ImageIcon
ICON_MTH_DEF
=
Utils
.
openIcon
(
"methdef_obj"
);
private
static
final
ImageIcon
ICON_MTH_PRI
=
Utils
.
openIcon
(
"methpri_obj"
);
private
static
final
ImageIcon
ICON_MTH_PRO
=
Utils
.
openIcon
(
"methpro_obj"
);
...
...
@@ -46,7 +47,7 @@ public class JMethod extends DefaultMutableTreeNode implements JNode {
public
Icon
getIcon
()
{
AccessInfo
accessFlags
=
mth
.
getAccessFlags
();
OverlayIcon
icon
=
Utils
.
makeIcon
(
accessFlags
,
ICON_MTH_PUB
,
ICON_MTH_PRI
,
ICON_MTH_PRO
,
ICON_MTH_DEF
);
if
(
accessFlags
.
isConstructor
())
icon
.
add
(
ICON_CONSTRUCTOR
);
if
(
accessFlags
.
isConstructor
())
icon
.
add
(
ICON_CONSTRUCTOR
);
if
(
accessFlags
.
isSynchronized
())
icon
.
add
(
ICON_SYNC
);
return
icon
;
}
...
...
@@ -62,7 +63,7 @@ public class JMethod extends DefaultMutableTreeNode implements JNode {
base
.
append
(
'('
);
for
(
Iterator
<
ArgType
>
it
=
mth
.
getArguments
().
iterator
();
it
.
hasNext
();
)
{
base
.
append
(
Utils
.
typeStr
(
it
.
next
()));
if
(
it
.
hasNext
())
if
(
it
.
hasNext
())
base
.
append
(
", "
);
}
base
.
append
(
')'
);
...
...
jadx-gui/src/main/java/jadx/gui/treemodel/JNode.java
浏览文件 @
9bf7270b
package
jadx.gui.treemodel
;
import
javax.swing.Icon
;
import
javax.swing.tree.DefaultMutableTreeNode
;
public
interface
J
Node
{
public
abstract
class
JNode
extends
DefaultMutableTree
Node
{
JClass
getJParent
();
public
abstract
JClass
getJParent
();
int
getLine
();
public
abstract
int
getLine
();
void
updateChilds
();
public
abstract
void
updateChilds
();
Icon
getIcon
();
public
abstract
Icon
getIcon
();
}
jadx-gui/src/main/java/jadx/gui/treemodel/JPackage.java
浏览文件 @
9bf7270b
...
...
@@ -6,11 +6,12 @@ import jadx.gui.utils.Utils;
import
javax.swing.Icon
;
import
javax.swing.ImageIcon
;
import
javax.swing.tree.DefaultMutableTreeNode
;
import
java.util.ArrayList
;
import
java.util.List
;
public
class
JPackage
extends
DefaultMutableTreeNode
implements
JNode
,
Comparable
<
JPackage
>
{
public
class
JPackage
extends
JNode
implements
Comparable
<
JPackage
>
{
private
static
final
long
serialVersionUID
=
-
4120718634156839804L
;
private
static
final
ImageIcon
PACKAGE_ICON
=
Utils
.
openIcon
(
"package_obj"
);
private
String
name
;
...
...
@@ -81,6 +82,20 @@ public class JPackage extends DefaultMutableTreeNode implements JNode, Comparabl
return
name
.
compareTo
(
o
.
name
);
}
@Override
public
boolean
equals
(
Object
o
)
{
if
(
this
==
o
)
return
true
;
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
return
false
;
JPackage
jPackage
=
(
JPackage
)
o
;
if
(!
name
.
equals
(
jPackage
.
name
))
return
false
;
return
true
;
}
@Override
public
int
hashCode
()
{
return
name
.
hashCode
();
}
@Override
public
String
toString
()
{
return
name
;
...
...
jadx-gui/src/main/java/jadx/gui/treemodel/JRoot.java
浏览文件 @
9bf7270b
...
...
@@ -6,7 +6,6 @@ import jadx.gui.utils.Utils;
import
javax.swing.Icon
;
import
javax.swing.ImageIcon
;
import
javax.swing.tree.DefaultMutableTreeNode
;
import
java.io.File
;
import
java.util.ArrayList
;
import
java.util.Collections
;
...
...
@@ -17,7 +16,8 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Set
;
public
class
JRoot
extends
DefaultMutableTreeNode
implements
JNode
{
public
class
JRoot
extends
JNode
{
private
static
final
long
serialVersionUID
=
8888495789773527342L
;
private
static
final
ImageIcon
ROOT_ICON
=
Utils
.
openIcon
(
"java_model_obj"
);
...
...
jadx-gui/src/test/java/jadx/gui/treemodel/JRootTest.java
浏览文件 @
9bf7270b
...
...
@@ -14,7 +14,7 @@ import java.util.List;
import
org.junit.Test
;
import
static
junit
.
framework
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
mockito
.
Mockito
.
mock
;
public
class
JRootTest
{
...
...
jadx-samples/src/main/java/jadx/samples/TestInner.java
浏览文件 @
9bf7270b
...
...
@@ -51,6 +51,7 @@ public class TestInner extends AbstractTest {
}.
run
();
}
@SuppressWarnings
(
"serial"
)
public
static
class
MyException
extends
Exception
{
public
MyException
(
String
str
,
Exception
e
)
{
super
(
"msg:"
+
str
,
e
);
...
...
jadx-samples/src/main/java/jadx/samples/TestSwitch.java
浏览文件 @
9bf7270b
...
...
@@ -2,7 +2,7 @@ package jadx.samples;
public
class
TestSwitch
extends
AbstractTest
{
public
static
final
int
test1
(
int
i
)
{
public
static
int
test1
(
int
i
)
{
int
k
=
i
*
4
;
switch
(
k
)
{
...
...
@@ -19,7 +19,7 @@ public class TestSwitch extends AbstractTest {
return
i
;
}
public
static
final
int
test2
(
int
i
)
{
public
static
int
test2
(
int
i
)
{
int
k
=
i
;
switch
(
k
)
{
case
1
:
...
...
@@ -39,7 +39,7 @@ public class TestSwitch extends AbstractTest {
return
-
i
;
}
public
static
final
int
test3
(
int
i
,
int
j
)
{
public
static
int
test3
(
int
i
,
int
j
)
{
int
k
=
i
;
switch
(
k
)
{
case
1
:
...
...
@@ -53,7 +53,7 @@ public class TestSwitch extends AbstractTest {
return
-
1
;
}
public
static
final
int
test4
(
int
i
)
{
public
static
int
test4
(
int
i
)
{
int
k
=
i
;
switch
(
k
)
{
case
1
:
...
...
@@ -64,7 +64,8 @@ public class TestSwitch extends AbstractTest {
return
-
1
;
}
public
static
final
int
test5
(
int
i
,
int
b
)
{
@SuppressWarnings
(
"fallthrough"
)
public
static
int
test5
(
int
i
,
int
b
)
{
int
k
=
i
;
switch
(
k
)
{
case
1
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录