Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jadx
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open-source
jadx
Commits
6bc2d332
Commit
6bc2d332
authored
Sep 25, 2013
by
Skylot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
code refactoring
parent
c9521192
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
78 additions
and
72 deletions
+78
-72
build.gradle
build.gradle
+3
-3
JadxCLI.java
jadx-cli/src/main/java/jadx/cli/JadxCLI.java
+13
-11
JadxCLIArgs.java
jadx-cli/src/main/java/jadx/cli/JadxCLIArgs.java
+2
-2
logback.xml
jadx-cli/src/main/resources/logback.xml
+1
-1
InsnGen.java
jadx-core/src/main/java/jadx/core/codegen/InsnGen.java
+7
-7
ClassInfo.java
jadx-core/src/main/java/jadx/core/dex/info/ClassInfo.java
+1
-1
ConstClassNode.java
.../main/java/jadx/core/dex/instructions/ConstClassNode.java
+2
-2
ConstStringNode.java
...main/java/jadx/core/dex/instructions/ConstStringNode.java
+2
-2
FillArrayNode.java
...c/main/java/jadx/core/dex/instructions/FillArrayNode.java
+2
-2
InsnDecoder.java
...src/main/java/jadx/core/dex/instructions/InsnDecoder.java
+3
-3
InsnArg.java
...rc/main/java/jadx/core/dex/instructions/args/InsnArg.java
+32
-28
RegisterArg.java
...ain/java/jadx/core/dex/instructions/args/RegisterArg.java
+4
-4
ModVisitor.java
...core/src/main/java/jadx/core/dex/visitors/ModVisitor.java
+4
-4
build.gradle
jadx-samples/build.gradle
+2
-2
No files found.
build.gradle
View file @
6bc2d332
...
@@ -35,20 +35,20 @@ subprojects {
...
@@ -35,20 +35,20 @@ subprojects {
}
}
}
}
task
copyArtifacts
(
type:
Sync
,
dependsOn:
[
'jadx-cli:installApp'
,
'jadx-gui:installApp'
])
{
task
copyArtifacts
(
type:
Sync
,
dependsOn:
[
'jadx-cli:installApp'
,
'jadx-gui:installApp'
])
{
destinationDir
file
(
"$buildDir/jadx"
)
destinationDir
file
(
"$buildDir/jadx"
)
[
'jadx-cli'
,
'jadx-gui'
].
each
{
[
'jadx-cli'
,
'jadx-gui'
].
each
{
from
tasks
.
getByPath
(
":${it}:installApp"
).
destinationDir
from
tasks
.
getByPath
(
":${it}:installApp"
).
destinationDir
}
}
}
}
task
pack
(
type:
Zip
,
dependsOn:
copyArtifacts
)
{
task
pack
(
type:
Zip
,
dependsOn:
copyArtifacts
)
{
destinationDir
buildDir
destinationDir
buildDir
archiveName
"jadx-${jadxVersion}.zip"
archiveName
"jadx-${jadxVersion}.zip"
from
copyArtifacts
.
destinationDir
from
copyArtifacts
.
destinationDir
}
}
task
build
(
dependsOn:
pack
)
{
task
build
(
dependsOn:
pack
)
{
description
=
'Build jadx distribution zip'
description
=
'Build jadx distribution zip'
}
}
...
...
jadx-cli/src/main/java/jadx/cli/JadxCLI.java
View file @
6bc2d332
...
@@ -2,7 +2,6 @@ package jadx.cli;
...
@@ -2,7 +2,6 @@ package jadx.cli;
import
jadx.api.Decompiler
;
import
jadx.api.Decompiler
;
import
jadx.core.utils.ErrorsCounter
;
import
jadx.core.utils.ErrorsCounter
;
import
jadx.core.utils.exceptions.JadxException
;
import
java.io.File
;
import
java.io.File
;
...
@@ -17,7 +16,7 @@ public class JadxCLI {
...
@@ -17,7 +16,7 @@ public class JadxCLI {
JadxCLIArgs
jadxArgs
=
new
JadxCLIArgs
(
args
);
JadxCLIArgs
jadxArgs
=
new
JadxCLIArgs
(
args
);
checkArgs
(
jadxArgs
);
checkArgs
(
jadxArgs
);
processAndSave
(
jadxArgs
);
processAndSave
(
jadxArgs
);
}
catch
(
Jadx
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOG
.
error
(
e
.
getMessage
());
LOG
.
error
(
e
.
getMessage
());
System
.
exit
(
1
);
System
.
exit
(
1
);
}
}
...
@@ -40,26 +39,29 @@ public class JadxCLI {
...
@@ -40,26 +39,29 @@ public class JadxCLI {
System
.
exit
(
errorsCount
);
System
.
exit
(
errorsCount
);
}
}
private
static
void
checkArgs
(
JadxCLIArgs
jadxArgs
)
throws
JadxException
{
private
static
void
checkArgs
(
JadxCLIArgs
jadxArgs
)
throws
Exception
{
if
(
jadxArgs
.
getInput
().
isEmpty
())
if
(
jadxArgs
.
getInput
().
isEmpty
())
{
throw
new
JadxException
(
"Please specify input file"
);
LOG
.
error
(
"Please specify input file"
);
jadxArgs
.
printUsage
();
System
.
exit
(
1
);
}
File
outputDir
=
jadxArgs
.
getOutDir
();
File
outputDir
=
jadxArgs
.
getOutDir
();
if
(
outputDir
==
null
)
{
if
(
outputDir
==
null
)
{
String
outDirName
;
String
outDirName
;
File
file
=
jadxArgs
.
getInput
().
get
(
0
);
File
file
=
jadxArgs
.
getInput
().
get
(
0
);
String
name
=
file
.
getName
();
String
name
=
file
.
getName
();
int
pos
=
name
.
lastIndexOf
(
'.'
);
int
pos
=
name
.
lastIndexOf
(
'.'
);
if
(
pos
!=
-
1
)
if
(
pos
!=
-
1
)
{
outDirName
=
name
.
substring
(
0
,
pos
);
outDirName
=
name
.
substring
(
0
,
pos
);
else
}
else
{
outDirName
=
name
+
"-jadx-out"
;
outDirName
=
name
+
"-jadx-out"
;
}
LOG
.
info
(
"output directory: "
+
outDirName
);
LOG
.
info
(
"output directory: "
+
outDirName
);
outputDir
=
new
File
(
outDirName
);
outputDir
=
new
File
(
outDirName
);
jadxArgs
.
setOutputDir
(
outputDir
);
jadxArgs
.
setOutputDir
(
outputDir
);
}
}
if
(
outputDir
.
exists
()
&&
!
outputDir
.
isDirectory
())
if
(
outputDir
.
exists
()
&&
!
outputDir
.
isDirectory
())
{
throw
new
JadxException
(
"Output directory exists as file "
+
outputDir
);
throw
new
Exception
(
"Output directory exists as file "
+
outputDir
);
}
}
}
}
}
jadx-cli/src/main/java/jadx/cli/JadxCLIArgs.java
View file @
6bc2d332
...
@@ -20,7 +20,7 @@ import com.beust.jcommander.ParameterException;
...
@@ -20,7 +20,7 @@ import com.beust.jcommander.ParameterException;
public
final
class
JadxCLIArgs
implements
IJadxArgs
{
public
final
class
JadxCLIArgs
implements
IJadxArgs
{
@Parameter
(
description
=
"<input file> (.dex, .apk
, .jar or .class
)"
)
@Parameter
(
description
=
"<input file> (.dex, .apk
or .jar
)"
)
protected
List
<
String
>
files
;
protected
List
<
String
>
files
;
@Parameter
(
names
=
{
"-d"
,
"--output-dir"
},
description
=
"output directory"
)
@Parameter
(
names
=
{
"-d"
,
"--output-dir"
},
description
=
"output directory"
)
...
@@ -32,7 +32,7 @@ public final class JadxCLIArgs implements IJadxArgs {
...
@@ -32,7 +32,7 @@ public final class JadxCLIArgs implements IJadxArgs {
@Parameter
(
names
=
{
"-f"
,
"--fallback"
},
description
=
"make simple dump (using goto instead of 'if', 'for', etc)"
,
help
=
true
)
@Parameter
(
names
=
{
"-f"
,
"--fallback"
},
description
=
"make simple dump (using goto instead of 'if', 'for', etc)"
,
help
=
true
)
protected
boolean
fallbackMode
=
false
;
protected
boolean
fallbackMode
=
false
;
@Parameter
(
names
=
{
"--cfg"
},
description
=
"save methods control flow graph"
)
@Parameter
(
names
=
{
"--cfg"
},
description
=
"save methods control flow graph
to dot file
"
)
protected
boolean
cfgOutput
=
false
;
protected
boolean
cfgOutput
=
false
;
@Parameter
(
names
=
{
"--raw-cfg"
},
description
=
"save methods control flow graph (use raw instructions)"
)
@Parameter
(
names
=
{
"--raw-cfg"
},
description
=
"save methods control flow graph (use raw instructions)"
)
...
...
jadx-c
ore
/src/main/resources/logback.xml
→
jadx-c
li
/src/main/resources/logback.xml
View file @
6bc2d332
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<appender
name=
"STDOUT"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<appender
name=
"STDOUT"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<encoder>
<encoder>
<pattern>
%
d{HH:mm:ss} %
-5level - %msg%n
</pattern>
<pattern>
%-5level - %msg%n
</pattern>
</encoder>
</encoder>
</appender>
</appender>
...
...
jadx-core/src/main/java/jadx/core/codegen/InsnGen.java
View file @
6bc2d332
...
@@ -8,9 +8,9 @@ import jadx.core.dex.info.FieldInfo;
...
@@ -8,9 +8,9 @@ import jadx.core.dex.info.FieldInfo;
import
jadx.core.dex.info.MethodInfo
;
import
jadx.core.dex.info.MethodInfo
;
import
jadx.core.dex.instructions.ArithNode
;
import
jadx.core.dex.instructions.ArithNode
;
import
jadx.core.dex.instructions.ArithOp
;
import
jadx.core.dex.instructions.ArithOp
;
import
jadx.core.dex.instructions.ConstClass
Insn
;
import
jadx.core.dex.instructions.ConstClass
Node
;
import
jadx.core.dex.instructions.ConstString
Insn
;
import
jadx.core.dex.instructions.ConstString
Node
;
import
jadx.core.dex.instructions.FillArray
Op
;
import
jadx.core.dex.instructions.FillArray
Node
;
import
jadx.core.dex.instructions.GotoNode
;
import
jadx.core.dex.instructions.GotoNode
;
import
jadx.core.dex.instructions.IfNode
;
import
jadx.core.dex.instructions.IfNode
;
import
jadx.core.dex.instructions.IndexInsnNode
;
import
jadx.core.dex.instructions.IndexInsnNode
;
...
@@ -209,12 +209,12 @@ public class InsnGen {
...
@@ -209,12 +209,12 @@ public class InsnGen {
private
void
makeInsnBody
(
CodeWriter
code
,
InsnNode
insn
,
EnumSet
<
IGState
>
state
)
throws
CodegenException
{
private
void
makeInsnBody
(
CodeWriter
code
,
InsnNode
insn
,
EnumSet
<
IGState
>
state
)
throws
CodegenException
{
switch
(
insn
.
getType
())
{
switch
(
insn
.
getType
())
{
case
CONST_STR:
case
CONST_STR:
String
str
=
((
ConstString
Insn
)
insn
).
getString
();
String
str
=
((
ConstString
Node
)
insn
).
getString
();
code
.
add
(
StringUtils
.
unescapeString
(
str
));
code
.
add
(
StringUtils
.
unescapeString
(
str
));
break
;
break
;
case
CONST_CLASS:
case
CONST_CLASS:
ArgType
clsType
=
((
ConstClass
Insn
)
insn
).
getClsType
();
ArgType
clsType
=
((
ConstClass
Node
)
insn
).
getClsType
();
code
.
add
(
useType
(
clsType
)).
add
(
".class"
);
code
.
add
(
useType
(
clsType
)).
add
(
".class"
);
break
;
break
;
...
@@ -311,7 +311,7 @@ public class InsnGen {
...
@@ -311,7 +311,7 @@ public class InsnGen {
break
;
break
;
case
FILL_ARRAY:
case
FILL_ARRAY:
fillArray
((
FillArray
Op
)
insn
,
code
);
fillArray
((
FillArray
Node
)
insn
,
code
);
break
;
break
;
case
FILLED_NEW_ARRAY:
case
FILLED_NEW_ARRAY:
...
@@ -449,7 +449,7 @@ public class InsnGen {
...
@@ -449,7 +449,7 @@ public class InsnGen {
code
.
add
(
'}'
);
code
.
add
(
'}'
);
}
}
private
void
fillArray
(
FillArray
Op
insn
,
CodeWriter
code
)
throws
CodegenException
{
private
void
fillArray
(
FillArray
Node
insn
,
CodeWriter
code
)
throws
CodegenException
{
ArgType
elType
=
insn
.
getResult
().
getType
().
getArrayElement
();
ArgType
elType
=
insn
.
getResult
().
getType
().
getArrayElement
();
if
(
elType
.
getPrimitiveType
()
==
null
)
{
if
(
elType
.
getPrimitiveType
()
==
null
)
{
elType
=
elType
.
selectFirst
();
elType
=
elType
.
selectFirst
();
...
...
jadx-core/src/main/java/jadx/core/dex/info/ClassInfo.java
View file @
6bc2d332
...
@@ -80,7 +80,7 @@ public final class ClassInfo {
...
@@ -80,7 +80,7 @@ public final class ClassInfo {
char
firstChar
=
name
.
charAt
(
0
);
char
firstChar
=
name
.
charAt
(
0
);
if
(
Character
.
isDigit
(
firstChar
))
{
if
(
Character
.
isDigit
(
firstChar
))
{
name
=
"
Inner
Class_"
+
name
;
name
=
"
Anonymous
Class_"
+
name
;
}
else
if
(
firstChar
==
'$'
)
{
}
else
if
(
firstChar
==
'$'
)
{
name
=
"_"
+
name
;
name
=
"_"
+
name
;
}
}
...
...
jadx-core/src/main/java/jadx/core/dex/instructions/ConstClass
Insn
.java
→
jadx-core/src/main/java/jadx/core/dex/instructions/ConstClass
Node
.java
View file @
6bc2d332
...
@@ -3,11 +3,11 @@ package jadx.core.dex.instructions;
...
@@ -3,11 +3,11 @@ package jadx.core.dex.instructions;
import
jadx.core.dex.instructions.args.ArgType
;
import
jadx.core.dex.instructions.args.ArgType
;
import
jadx.core.dex.nodes.InsnNode
;
import
jadx.core.dex.nodes.InsnNode
;
public
class
ConstClass
Insn
extends
InsnNode
{
public
class
ConstClass
Node
extends
InsnNode
{
private
final
ArgType
clsType
;
private
final
ArgType
clsType
;
public
ConstClass
Insn
(
ArgType
clsType
)
{
public
ConstClass
Node
(
ArgType
clsType
)
{
super
(
InsnType
.
CONST_CLASS
,
0
);
super
(
InsnType
.
CONST_CLASS
,
0
);
this
.
clsType
=
clsType
;
this
.
clsType
=
clsType
;
}
}
...
...
jadx-core/src/main/java/jadx/core/dex/instructions/ConstString
Insn
.java
→
jadx-core/src/main/java/jadx/core/dex/instructions/ConstString
Node
.java
View file @
6bc2d332
...
@@ -2,11 +2,11 @@ package jadx.core.dex.instructions;
...
@@ -2,11 +2,11 @@ package jadx.core.dex.instructions;
import
jadx.core.dex.nodes.InsnNode
;
import
jadx.core.dex.nodes.InsnNode
;
public
class
ConstString
Insn
extends
InsnNode
{
public
class
ConstString
Node
extends
InsnNode
{
private
final
String
str
;
private
final
String
str
;
public
ConstString
Insn
(
String
str
)
{
public
ConstString
Node
(
String
str
)
{
super
(
InsnType
.
CONST_STR
,
0
);
super
(
InsnType
.
CONST_STR
,
0
);
this
.
str
=
str
;
this
.
str
=
str
;
}
}
...
...
jadx-core/src/main/java/jadx/core/dex/instructions/FillArray
Op
.java
→
jadx-core/src/main/java/jadx/core/dex/instructions/FillArray
Node
.java
View file @
6bc2d332
...
@@ -7,11 +7,11 @@ import jadx.core.dex.nodes.InsnNode;
...
@@ -7,11 +7,11 @@ import jadx.core.dex.nodes.InsnNode;
import
com.android.dx.io.instructions.FillArrayDataPayloadDecodedInstruction
;
import
com.android.dx.io.instructions.FillArrayDataPayloadDecodedInstruction
;
public
class
FillArray
Op
extends
InsnNode
{
public
class
FillArray
Node
extends
InsnNode
{
private
final
Object
data
;
private
final
Object
data
;
public
FillArray
Op
(
int
resReg
,
FillArrayDataPayloadDecodedInstruction
payload
)
{
public
FillArray
Node
(
int
resReg
,
FillArrayDataPayloadDecodedInstruction
payload
)
{
super
(
InsnType
.
FILL_ARRAY
,
0
);
super
(
InsnType
.
FILL_ARRAY
,
0
);
this
.
data
=
payload
.
getData
();
this
.
data
=
payload
.
getData
();
...
...
jadx-core/src/main/java/jadx/core/dex/instructions/InsnDecoder.java
View file @
6bc2d332
...
@@ -96,13 +96,13 @@ public class InsnDecoder {
...
@@ -96,13 +96,13 @@ public class InsnDecoder {
case
Opcodes
.
CONST_STRING
:
case
Opcodes
.
CONST_STRING
:
case
Opcodes
.
CONST_STRING_JUMBO
:
{
case
Opcodes
.
CONST_STRING_JUMBO
:
{
InsnNode
node
=
new
ConstString
Insn
(
dex
.
getString
(
insn
.
getIndex
()));
InsnNode
node
=
new
ConstString
Node
(
dex
.
getString
(
insn
.
getIndex
()));
node
.
setResult
(
InsnArg
.
reg
(
insn
,
0
,
ArgType
.
STRING
));
node
.
setResult
(
InsnArg
.
reg
(
insn
,
0
,
ArgType
.
STRING
));
return
node
;
return
node
;
}
}
case
Opcodes
.
CONST_CLASS
:
{
case
Opcodes
.
CONST_CLASS
:
{
InsnNode
node
=
new
ConstClass
Insn
(
dex
.
getType
(
insn
.
getIndex
()));
InsnNode
node
=
new
ConstClass
Node
(
dex
.
getType
(
insn
.
getIndex
()));
node
.
setResult
(
InsnArg
.
reg
(
insn
,
0
,
ArgType
.
CLASS
));
node
.
setResult
(
InsnArg
.
reg
(
insn
,
0
,
ArgType
.
CLASS
));
return
node
;
return
node
;
}
}
...
@@ -595,7 +595,7 @@ public class InsnDecoder {
...
@@ -595,7 +595,7 @@ public class InsnDecoder {
private
InsnNode
fillArray
(
DecodedInstruction
insn
)
{
private
InsnNode
fillArray
(
DecodedInstruction
insn
)
{
DecodedInstruction
payload
=
insnArr
[
insn
.
getTarget
()];
DecodedInstruction
payload
=
insnArr
[
insn
.
getTarget
()];
return
new
FillArray
Op
(
insn
.
getA
(),
(
FillArrayDataPayloadDecodedInstruction
)
payload
);
return
new
FillArray
Node
(
insn
.
getA
(),
(
FillArrayDataPayloadDecodedInstruction
)
payload
);
}
}
private
InsnNode
filledNewArray
(
DecodedInstruction
insn
,
int
offset
,
boolean
isRange
)
{
private
InsnNode
filledNewArray
(
DecodedInstruction
insn
,
int
offset
,
boolean
isRange
)
{
...
...
jadx-core/src/main/java/jadx/core/dex/instructions/args/InsnArg.java
View file @
6bc2d332
package
jadx
.
core
.
dex
.
instructions
.
args
;
package
jadx
.
core
.
dex
.
instructions
.
args
;
import
jadx.core.dex.instructions.InsnType
;
import
jadx.core.dex.nodes.InsnNode
;
import
jadx.core.dex.nodes.InsnNode
;
import
jadx.core.utils.InsnUtils
;
import
jadx.core.utils.InsnUtils
;
...
@@ -63,13 +62,22 @@ public abstract class InsnArg extends Typed {
...
@@ -63,13 +62,22 @@ public abstract class InsnArg extends Typed {
}
}
public
InsnArg
wrapInstruction
(
InsnNode
insn
)
{
public
InsnArg
wrapInstruction
(
InsnNode
insn
)
{
assert
parentInsn
!=
insn
:
"Can't wrap instruction info itself"
;
InsnNode
parent
=
parentInsn
;
int
count
=
parentInsn
.
getArgsCount
();
assert
parent
!=
insn
:
"Can't wrap instruction info itself"
;
int
count
=
parent
.
getArgsCount
();
for
(
int
i
=
0
;
i
<
count
;
i
++)
{
for
(
int
i
=
0
;
i
<
count
;
i
++)
{
if
(
parentInsn
.
getArg
(
i
)
==
this
)
{
if
(
parent
.
getArg
(
i
)
==
this
)
{
InsnArg
arg
=
wrapArg
(
insn
);
parent
.
setArg
(
i
,
arg
);
return
arg
;
}
}
return
null
;
}
private
static
InsnArg
wrapArg
(
InsnNode
insn
)
{
InsnArg
arg
;
InsnArg
arg
;
InsnType
insnType
=
insn
.
getType
();
switch
(
insn
.
getType
())
{
switch
(
insnType
)
{
case
MOVE:
case
MOVE:
case
CONST:
case
CONST:
arg
=
insn
.
getArg
(
0
);
arg
=
insn
.
getArg
(
0
);
...
@@ -90,12 +98,8 @@ public abstract class InsnArg extends Typed {
...
@@ -90,12 +98,8 @@ public abstract class InsnArg extends Typed {
arg
=
wrap
(
insn
);
arg
=
wrap
(
insn
);
break
;
break
;
}
}
parentInsn
.
setArg
(
i
,
arg
);
return
arg
;
return
arg
;
}
}
}
return
null
;
}
public
boolean
isThis
()
{
public
boolean
isThis
()
{
// must be implemented in RegisterArg
// must be implemented in RegisterArg
...
...
jadx-core/src/main/java/jadx/core/dex/instructions/args/RegisterArg.java
View file @
6bc2d332
package
jadx
.
core
.
dex
.
instructions
.
args
;
package
jadx
.
core
.
dex
.
instructions
.
args
;
import
jadx.core.dex.instructions.ConstClass
Insn
;
import
jadx.core.dex.instructions.ConstClass
Node
;
import
jadx.core.dex.instructions.ConstString
Insn
;
import
jadx.core.dex.instructions.ConstString
Node
;
import
jadx.core.dex.instructions.InsnType
;
import
jadx.core.dex.instructions.InsnType
;
import
jadx.core.dex.nodes.InsnNode
;
import
jadx.core.dex.nodes.InsnNode
;
import
jadx.core.dex.visitors.InstructionRemover
;
import
jadx.core.dex.visitors.InstructionRemover
;
...
@@ -53,9 +53,9 @@ public class RegisterArg extends InsnArg {
...
@@ -53,9 +53,9 @@ public class RegisterArg extends InsnArg {
case
CONST:
case
CONST:
return
parInsn
.
getArg
(
0
);
return
parInsn
.
getArg
(
0
);
case
CONST_STR:
case
CONST_STR:
return
((
ConstString
Insn
)
parInsn
).
getString
();
return
((
ConstString
Node
)
parInsn
).
getString
();
case
CONST_CLASS:
case
CONST_CLASS:
return
((
ConstClass
Insn
)
parInsn
).
getClsType
();
return
((
ConstClass
Node
)
parInsn
).
getClsType
();
}
}
}
}
return
null
;
return
null
;
...
...
jadx-core/src/main/java/jadx/core/dex/visitors/ModVisitor.java
View file @
6bc2d332
...
@@ -3,8 +3,8 @@ package jadx.core.dex.visitors;
...
@@ -3,8 +3,8 @@ package jadx.core.dex.visitors;
import
jadx.core.deobf.NameMapper
;
import
jadx.core.deobf.NameMapper
;
import
jadx.core.dex.attributes.AttributeType
;
import
jadx.core.dex.attributes.AttributeType
;
import
jadx.core.dex.info.MethodInfo
;
import
jadx.core.dex.info.MethodInfo
;
import
jadx.core.dex.instructions.ConstClass
Insn
;
import
jadx.core.dex.instructions.ConstClass
Node
;
import
jadx.core.dex.instructions.ConstString
Insn
;
import
jadx.core.dex.instructions.ConstString
Node
;
import
jadx.core.dex.instructions.IndexInsnNode
;
import
jadx.core.dex.instructions.IndexInsnNode
;
import
jadx.core.dex.instructions.InsnType
;
import
jadx.core.dex.instructions.InsnType
;
import
jadx.core.dex.instructions.InvokeNode
;
import
jadx.core.dex.instructions.InvokeNode
;
...
@@ -104,10 +104,10 @@ public class ModVisitor extends AbstractVisitor {
...
@@ -104,10 +104,10 @@ public class ModVisitor extends AbstractVisitor {
ClassNode
parentClass
=
mth
.
getParentClass
();
ClassNode
parentClass
=
mth
.
getParentClass
();
FieldNode
f
=
null
;
FieldNode
f
=
null
;
if
(
insn
.
getType
()
==
InsnType
.
CONST_STR
)
{
if
(
insn
.
getType
()
==
InsnType
.
CONST_STR
)
{
String
s
=
((
ConstString
Insn
)
insn
).
getString
();
String
s
=
((
ConstString
Node
)
insn
).
getString
();
f
=
parentClass
.
getConstField
(
s
);
f
=
parentClass
.
getConstField
(
s
);
}
else
if
(
insn
.
getType
()
==
InsnType
.
CONST_CLASS
)
{
}
else
if
(
insn
.
getType
()
==
InsnType
.
CONST_CLASS
)
{
ArgType
t
=
((
ConstClass
Insn
)
insn
).
getClsType
();
ArgType
t
=
((
ConstClass
Node
)
insn
).
getClsType
();
f
=
parentClass
.
getConstField
(
t
);
f
=
parentClass
.
getConstField
(
t
);
}
else
{
}
else
{
LiteralArg
arg
=
(
LiteralArg
)
insn
.
getArg
(
0
);
LiteralArg
arg
=
(
LiteralArg
)
insn
.
getArg
(
0
);
...
...
jadx-samples/build.gradle
View file @
6bc2d332
...
@@ -40,10 +40,10 @@ task samplesJadxRun(type: JavaExec, dependsOn: samplesJadxCompile) {
...
@@ -40,10 +40,10 @@ task samplesJadxRun(type: JavaExec, dependsOn: samplesJadxCompile) {
main
=
mainSamplesClass
main
=
mainSamplesClass
}
}
task
samples
(
dependsOn:
samplesJadxRun
)
{
task
samples
(
dependsOn:
samplesJadxRun
)
{
}
}
task
cleanGeneratedFiles
(
type:
Delete
)
{
task
cleanGeneratedFiles
(
type:
Delete
)
{
delete
samplesJadxSrcDir
delete
samplesJadxSrcDir
delete
samplesJadxOutDir
delete
samplesJadxOutDir
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment