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
99d98140
Commit
99d98140
authored
Feb 07, 2015
by
Skylot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
don't use concatenation in logger, fix other small code style issues
parent
141398ae
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
29 additions
and
27 deletions
+29
-27
JadxCLI.java
jadx-cli/src/main/java/jadx/cli/JadxCLI.java
+2
-2
JavaPackage.java
jadx-core/src/main/java/jadx/api/JavaPackage.java
+3
-1
ResourcesLoader.java
jadx-core/src/main/java/jadx/api/ResourcesLoader.java
+3
-3
MethodGen.java
jadx-core/src/main/java/jadx/core/codegen/MethodGen.java
+6
-6
RegionGen.java
jadx-core/src/main/java/jadx/core/codegen/RegionGen.java
+1
-1
TypeGen.java
jadx-core/src/main/java/jadx/core/codegen/TypeGen.java
+1
-1
CheckRegions.java
...ain/java/jadx/core/dex/visitors/regions/CheckRegions.java
+3
-3
ErrorsCounter.java
jadx-core/src/main/java/jadx/core/utils/ErrorsCounter.java
+1
-1
ResTableParser.java
jadx-core/src/main/java/jadx/core/xmlgen/ResTableParser.java
+1
-1
ValuesParser.java
...re/src/main/java/jadx/core/xmlgen/entry/ValuesParser.java
+1
-1
TestVariablesDefinitions.java
...tests/integration/variables/TestVariablesDefinitions.java
+1
-1
JadxGUI.java
jadx-gui/src/main/java/jadx/gui/JadxGUI.java
+1
-1
JadxWrapper.java
jadx-gui/src/main/java/jadx/gui/JadxWrapper.java
+2
-2
ContentArea.java
jadx-gui/src/main/java/jadx/gui/ui/ContentArea.java
+1
-1
SearchBar.java
jadx-gui/src/main/java/jadx/gui/ui/SearchBar.java
+1
-1
Link.java
jadx-gui/src/main/java/jadx/gui/utils/Link.java
+1
-1
No files found.
jadx-cli/src/main/java/jadx/cli/JadxCLI.java
View file @
99d98140
...
...
@@ -18,7 +18,7 @@ public class JadxCLI {
processAndSave
(
jadxArgs
);
}
}
catch
(
Throwable
e
)
{
LOG
.
error
(
"jadx error:
"
+
e
.
getMessage
(),
e
);
LOG
.
error
(
"jadx error:
{}"
,
e
.
getMessage
(),
e
);
System
.
exit
(
1
);
}
}
...
...
@@ -56,7 +56,7 @@ public class JadxCLI {
}
else
{
outDirName
=
name
+
"-jadx-out"
;
}
LOG
.
info
(
"output directory:
"
+
outDirName
);
LOG
.
info
(
"output directory:
{}"
,
outDirName
);
outputDir
=
new
File
(
outDirName
);
jadxArgs
.
setOutputDir
(
outputDir
);
}
...
...
jadx-core/src/main/java/jadx/api/JavaPackage.java
View file @
99d98140
...
...
@@ -2,6 +2,8 @@ package jadx.api;
import
java.util.List
;
import
org.jetbrains.annotations.NotNull
;
public
final
class
JavaPackage
implements
JavaNode
,
Comparable
<
JavaPackage
>
{
private
final
String
name
;
private
final
List
<
JavaClass
>
classes
;
...
...
@@ -32,7 +34,7 @@ public final class JavaPackage implements JavaNode, Comparable<JavaPackage> {
}
@Override
public
int
compareTo
(
JavaPackage
o
)
{
public
int
compareTo
(
@NotNull
JavaPackage
o
)
{
return
name
.
compareTo
(
o
.
name
);
}
...
...
jadx-core/src/main/java/jadx/api/ResourcesLoader.java
View file @
99d98140
...
...
@@ -42,7 +42,7 @@ public final class ResourcesLoader {
return
list
;
}
public
static
interface
ResourceDecoder
{
public
interface
ResourceDecoder
{
Object
decode
(
long
size
,
InputStream
is
)
throws
IOException
;
}
...
...
@@ -72,7 +72,7 @@ public final class ResourcesLoader {
inputStream
.
close
();
}
}
catch
(
Exception
e
)
{
LOG
.
debug
(
"Error close zip file:
"
+
zipRef
,
e
);
LOG
.
debug
(
"Error close zip file:
{}"
,
zipRef
,
e
);
}
}
}
...
...
@@ -130,7 +130,7 @@ public final class ResourcesLoader {
try
{
zip
.
close
();
}
catch
(
Exception
e
)
{
LOG
.
error
(
"Zip file close error:
"
+
file
.
getAbsolutePath
(),
e
);
LOG
.
error
(
"Zip file close error:
{}"
,
file
.
getAbsolutePath
(),
e
);
}
}
}
...
...
jadx-core/src/main/java/jadx/core/codegen/MethodGen.java
View file @
99d98140
...
...
@@ -153,12 +153,8 @@ public class MethodGen {
if
(
mth
.
contains
(
AType
.
JADX_ERROR
)
||
mth
.
contains
(
AFlag
.
INCONSISTENT_CODE
)
||
mth
.
getRegion
()
==
null
)
{
code
.
startLine
(
"throw new UnsupportedOperationException(\"Method not decompiled: "
)
.
add
(
mth
.
toString
())
.
add
(
"\");"
);
if
(
mth
.
contains
(
AType
.
JADX_ERROR
))
{
JadxErrorAttr
err
=
mth
.
get
(
AType
.
JADX_ERROR
);
JadxErrorAttr
err
=
mth
.
get
(
AType
.
JADX_ERROR
);
if
(
err
!=
null
)
{
code
.
startLine
(
"/* JADX: method processing error */"
);
Throwable
cause
=
err
.
getCause
();
if
(
cause
!=
null
)
{
...
...
@@ -171,6 +167,10 @@ public class MethodGen {
code
.
startLine
(
"/*"
);
addFallbackMethodCode
(
code
);
code
.
startLine
(
"*/"
);
code
.
startLine
(
"throw new UnsupportedOperationException(\"Method not decompiled: "
)
.
add
(
mth
.
toString
())
.
add
(
"\");"
);
}
else
{
RegionGen
regionGen
=
new
RegionGen
(
this
);
regionGen
.
makeRegion
(
code
,
mth
.
getRegion
());
...
...
jadx-core/src/main/java/jadx/core/codegen/RegionGen.java
View file @
99d98140
...
...
@@ -257,7 +257,7 @@ public class RegionGen extends InsnGen {
}
else
if
(
k
instanceof
Integer
)
{
code
.
add
(
TypeGen
.
literalToString
((
Integer
)
k
,
arg
.
getType
()));
}
else
{
throw
new
JadxRuntimeException
(
"Unexpected key in switch: "
+
(
k
!=
null
?
k
.
getClass
()
:
k
));
throw
new
JadxRuntimeException
(
"Unexpected key in switch: "
+
(
k
!=
null
?
k
.
getClass
()
:
null
));
}
code
.
add
(
':'
);
}
...
...
jadx-core/src/main/java/jadx/core/codegen/TypeGen.java
View file @
99d98140
...
...
@@ -63,7 +63,7 @@ public class TypeGen {
case
OBJECT:
case
ARRAY:
if
(
lit
!=
0
)
{
LOG
.
warn
(
"Wrong object literal:
"
+
lit
+
" for type: "
+
type
);
LOG
.
warn
(
"Wrong object literal:
{} for type: {}"
,
lit
,
type
);
return
Long
.
toString
(
lit
);
}
return
"null"
;
...
...
jadx-core/src/main/java/jadx/core/dex/visitors/regions/CheckRegions.java
View file @
99d98140
...
...
@@ -94,17 +94,17 @@ public class CheckRegions extends AbstractVisitor {
}
private
void
printRegion
(
MethodNode
mth
)
{
LOG
.
debug
(
"|
"
+
mth
.
toString
());
LOG
.
debug
(
"|
{}"
,
mth
.
toString
());
printRegion
(
mth
,
mth
.
getRegion
(),
"| "
);
}
private
void
printRegion
(
MethodNode
mth
,
IRegion
region
,
String
indent
)
{
LOG
.
debug
(
indent
+
region
);
LOG
.
debug
(
"{}{}"
,
indent
,
region
);
for
(
IContainer
container
:
region
.
getSubBlocks
())
{
if
(
container
instanceof
IRegion
)
{
printRegion
(
mth
,
(
IRegion
)
container
,
indent
+
" "
);
}
else
{
LOG
.
debug
(
indent
+
" "
+
container
);
LOG
.
debug
(
"{} {}"
,
indent
,
container
);
}
}
}
...
...
jadx-core/src/main/java/jadx/core/utils/ErrorsCounter.java
View file @
99d98140
...
...
@@ -40,7 +40,7 @@ public class ErrorsCounter {
if
(
e
.
getClass
()
==
JadxOverflowException
.
class
)
{
// don't print full stack trace
e
=
new
JadxOverflowException
(
e
.
getMessage
());
LOG
.
error
(
msg
+
", message: "
+
e
.
getMessage
());
LOG
.
error
(
"{}, message: {}"
,
msg
,
e
.
getMessage
());
}
else
{
LOG
.
error
(
msg
,
e
);
}
...
...
jadx-core/src/main/java/jadx/core/xmlgen/ResTableParser.java
View file @
99d98140
...
...
@@ -273,7 +273,7 @@ public class ResTableParser extends CommonBinaryParser {
if
((
b1
&
0x80
)
==
0
)
{
str
=
new
String
(
new
char
[]{(
char
)
b1
,
(
char
)
b2
});
}
else
{
LOG
.
warn
(
"TODO: parse locale: 0x
"
+
Integer
.
toHexString
(
b1
)
+
Integer
.
toHexString
(
b1
));
LOG
.
warn
(
"TODO: parse locale: 0x
{}{}"
,
Integer
.
toHexString
(
b1
),
Integer
.
toHexString
(
b2
));
}
}
return
str
;
...
...
jadx-core/src/main/java/jadx/core/xmlgen/entry/ValuesParser.java
View file @
99d98140
...
...
@@ -92,7 +92,7 @@ public class ValuesParser extends ParserConstants {
return
decodeComplex
(
data
,
true
);
default
:
LOG
.
warn
(
"Unknown data type: 0x
"
+
Integer
.
toHexString
(
dataType
)
+
" "
+
data
);
LOG
.
warn
(
"Unknown data type: 0x
{} {}"
,
Integer
.
toHexString
(
dataType
),
data
);
return
" ?0x"
+
Integer
.
toHexString
(
dataType
)
+
" "
+
data
;
}
}
...
...
jadx-core/src/test/java/jadx/tests/integration/variables/TestVariablesDefinitions.java
View file @
99d98140
...
...
@@ -29,7 +29,7 @@ public class TestVariablesDefinitions extends IntegrationTest {
DepthTraversal
.
visit
(
pass
,
cls
);
}
}
catch
(
Exception
e
)
{
LOG
.
error
(
"Decode exception:
"
+
cls
,
e
);
LOG
.
error
(
"Decode exception:
{}"
,
cls
,
e
);
}
}
}
...
...
jadx-gui/src/main/java/jadx/gui/JadxGUI.java
View file @
99d98140
...
...
@@ -38,7 +38,7 @@ public class JadxGUI {
}
});
}
catch
(
Throwable
e
)
{
LOG
.
error
(
"Error:
"
+
e
.
getMessage
());
LOG
.
error
(
"Error:
{}"
,
e
.
getMessage
());
System
.
exit
(
1
);
}
}
...
...
jadx-gui/src/main/java/jadx/gui/JadxWrapper.java
View file @
99d98140
...
...
@@ -31,9 +31,9 @@ public class JadxWrapper {
try
{
this
.
decompiler
.
loadFile
(
file
);
}
catch
(
DecodeException
e
)
{
LOG
.
error
(
"Error decode file:
"
+
file
,
e
);
LOG
.
error
(
"Error decode file:
{}"
,
file
,
e
);
}
catch
(
JadxException
e
)
{
LOG
.
error
(
"Error open file:
"
+
file
,
e
);
LOG
.
error
(
"Error open file:
{}"
,
file
,
e
);
}
}
...
...
jadx-gui/src/main/java/jadx/gui/ui/ContentArea.java
View file @
99d98140
...
...
@@ -150,7 +150,7 @@ class ContentArea extends RSyntaxTextArea {
try
{
setCaretPosition
(
getLineStartOffset
(
line
));
}
catch
(
BadLocationException
e
)
{
LOG
.
debug
(
"Can't scroll to
"
+
line
,
e
);
LOG
.
debug
(
"Can't scroll to
{}"
,
line
,
e
);
}
}
...
...
jadx-gui/src/main/java/jadx/gui/ui/SearchBar.java
View file @
99d98140
...
...
@@ -26,7 +26,7 @@ import org.slf4j.LoggerFactory;
class
SearchBar
extends
JToolBar
{
private
static
final
long
serialVersionUID
=
1836871286618633003L
;
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
Search
Dialog
.
class
);
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
Search
Bar
.
class
);
private
static
final
Color
COLOR_BG_ERROR
=
new
Color
(
0xFFDFDE
);
private
static
final
Color
COLOR_BG_WARN
=
new
Color
(
0xFFFDD9
);
...
...
jadx-gui/src/main/java/jadx/gui/utils/Link.java
View file @
99d98140
...
...
@@ -20,7 +20,7 @@ import static java.awt.Desktop.Action;
public
class
Link
extends
JLabel
implements
MouseListener
{
private
static
final
long
serialVersionUID
=
3655322136444908178L
;
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
JLabel
.
class
);
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
Link
.
class
);
private
String
url
;
...
...
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