Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
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
5d60f2cd
Commit
5d60f2cd
authored
Jan 14, 2018
by
Sergey Toshin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PR for issue #191
parent
c4765939
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
5 deletions
+29
-5
JadxCLIArgs.java
jadx-cli/src/main/java/jadx/cli/JadxCLIArgs.java
+9
-0
IJadxArgs.java
jadx-core/src/main/java/jadx/api/IJadxArgs.java
+2
-0
JadxArgs.java
jadx-core/src/main/java/jadx/api/JadxArgs.java
+11
-0
ClassGen.java
jadx-core/src/main/java/jadx/core/codegen/ClassGen.java
+6
-4
MethodGen.java
jadx-core/src/main/java/jadx/core/codegen/MethodGen.java
+1
-1
No files found.
jadx-cli/src/main/java/jadx/cli/JadxCLIArgs.java
View file @
5d60f2cd
...
...
@@ -47,6 +47,10 @@ public class JadxCLIArgs implements IJadxArgs {
@Parameter
(
names
=
{
"--show-bad-code"
},
description
=
"show inconsistent code (incorrectly decompiled)"
)
protected
boolean
showInconsistentCode
=
false
;
@Parameter
(
names
=
{
"--no-imports"
},
converter
=
InvertedBooleanConverter
.
class
,
description
=
"disables use of imports, always writes entire package name"
)
protected
boolean
useImports
=
true
;
@Parameter
(
names
=
"--no-replace-consts"
,
converter
=
InvertedBooleanConverter
.
class
,
description
=
"don't replace constant value with matching constant field"
)
protected
boolean
replaceConsts
=
true
;
...
...
@@ -247,6 +251,11 @@ public class JadxCLIArgs implements IJadxArgs {
}
@Override
public
boolean
isUsingImports
()
{
return
useImports
;
}
@Override
public
boolean
isVerbose
()
{
return
verbose
;
}
...
...
jadx-core/src/main/java/jadx/api/IJadxArgs.java
View file @
5d60f2cd
...
...
@@ -14,6 +14,8 @@ public interface IJadxArgs {
boolean
isFallbackMode
();
boolean
isShowInconsistentCode
();
boolean
isUsingImports
();
boolean
isVerbose
();
...
...
jadx-core/src/main/java/jadx/api/JadxArgs.java
View file @
5d60f2cd
...
...
@@ -13,6 +13,8 @@ public class JadxArgs implements IJadxArgs {
private
boolean
isVerbose
=
false
;
private
boolean
fallbackMode
=
false
;
private
boolean
showInconsistentCode
=
false
;
private
boolean
useImports
=
false
;
private
boolean
isSkipResources
=
false
;
private
boolean
isSkipSources
=
false
;
...
...
@@ -83,6 +85,15 @@ public class JadxArgs implements IJadxArgs {
}
@Override
public
boolean
isUsingImports
()
{
return
useImports
;
}
public
void
setUseImports
(
boolean
useImports
)
{
this
.
useImports
=
useImports
;
}
@Override
public
boolean
isVerbose
()
{
return
isVerbose
;
}
...
...
jadx-core/src/main/java/jadx/core/codegen/ClassGen.java
View file @
5d60f2cd
...
...
@@ -52,23 +52,25 @@ public class ClassGen {
private
final
ClassGen
parentGen
;
private
final
AnnotationGen
annotationGen
;
private
final
boolean
fallback
;
private
final
boolean
useImports
;
private
final
boolean
showInconsistentCode
;
private
final
Set
<
ClassInfo
>
imports
=
new
HashSet
<>();
private
int
clsDeclLine
;
public
ClassGen
(
ClassNode
cls
,
IJadxArgs
jadxArgs
)
{
this
(
cls
,
null
,
jadxArgs
.
isFallbackMode
(),
jadxArgs
.
isShowInconsistentCode
());
this
(
cls
,
null
,
jadxArgs
.
is
UsingImports
(),
jadxArgs
.
is
FallbackMode
(),
jadxArgs
.
isShowInconsistentCode
());
}
public
ClassGen
(
ClassNode
cls
,
ClassGen
parentClsGen
)
{
this
(
cls
,
parentClsGen
,
parentClsGen
.
fallback
,
parentClsGen
.
showInconsistentCode
);
this
(
cls
,
parentClsGen
,
parentClsGen
.
useImports
,
parentClsGen
.
fallback
,
parentClsGen
.
showInconsistentCode
);
}
public
ClassGen
(
ClassNode
cls
,
ClassGen
parentClsGen
,
boolean
fallback
,
boolean
showBadCode
)
{
public
ClassGen
(
ClassNode
cls
,
ClassGen
parentClsGen
,
boolean
useImports
,
boolean
fallback
,
boolean
showBadCode
)
{
this
.
cls
=
cls
;
this
.
parentGen
=
parentClsGen
;
this
.
fallback
=
fallback
;
this
.
useImports
=
useImports
;
this
.
showInconsistentCode
=
showBadCode
;
this
.
annotationGen
=
new
AnnotationGen
(
cls
,
this
);
...
...
@@ -480,7 +482,7 @@ public class ClassGen {
private
String
useClassInternal
(
ClassInfo
useCls
,
ClassInfo
extClsInfo
)
{
String
fullName
=
extClsInfo
.
getFullName
();
if
(
fallback
)
{
if
(
fallback
||
!
useImports
)
{
return
fullName
;
}
String
shortName
=
extClsInfo
.
getShortName
();
...
...
jadx-core/src/main/java/jadx/core/codegen/MethodGen.java
View file @
5d60f2cd
...
...
@@ -245,7 +245,7 @@ public class MethodGen {
* Return fallback variant of method codegen
*/
public
static
MethodGen
getFallbackMethodGen
(
MethodNode
mth
)
{
ClassGen
clsGen
=
new
ClassGen
(
mth
.
getParentClass
(),
null
,
true
,
true
);
ClassGen
clsGen
=
new
ClassGen
(
mth
.
getParentClass
(),
null
,
true
,
true
,
true
);
return
new
MethodGen
(
clsGen
,
mth
);
}
...
...
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