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
73dd55ea
Commit
73dd55ea
authored
Nov 03, 2014
by
Skylot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: fix code style issues
parent
b5a9389c
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
30 additions
and
30 deletions
+30
-30
ProcessClass.java
jadx-core/src/main/java/jadx/core/ProcessClass.java
+1
-1
ClsSet.java
jadx-core/src/main/java/jadx/core/clsp/ClsSet.java
+2
-2
ConvertToClsSet.java
jadx-core/src/main/java/jadx/core/clsp/ConvertToClsSet.java
+2
-2
AnnotationGen.java
jadx-core/src/main/java/jadx/core/codegen/AnnotationGen.java
+2
-2
InsnGen.java
jadx-core/src/main/java/jadx/core/codegen/InsnGen.java
+2
-2
RegionGen.java
jadx-core/src/main/java/jadx/core/codegen/RegionGen.java
+1
-1
TypeImmutableArg.java
...ava/jadx/core/dex/instructions/args/TypeImmutableArg.java
+1
-0
ClassNode.java
jadx-core/src/main/java/jadx/core/dex/nodes/ClassNode.java
+3
-3
MethodNode.java
jadx-core/src/main/java/jadx/core/dex/nodes/MethodNode.java
+2
-3
LocalVar.java
...re/src/main/java/jadx/core/dex/nodes/parser/LocalVar.java
+1
-1
SimplifyVisitor.java
...src/main/java/jadx/core/dex/visitors/SimplifyVisitor.java
+1
-1
ProcessTryCatchRegions.java
...adx/core/dex/visitors/regions/ProcessTryCatchRegions.java
+1
-1
RegionMaker.java
...main/java/jadx/core/dex/visitors/regions/RegionMaker.java
+8
-4
ErrorsCounter.java
jadx-core/src/main/java/jadx/core/utils/ErrorsCounter.java
+2
-2
InstructionRemover.java
...ore/src/main/java/jadx/core/utils/InstructionRemover.java
+0
-4
InputFile.java
jadx-core/src/main/java/jadx/core/utils/files/InputFile.java
+1
-1
No files found.
jadx-core/src/main/java/jadx/core/ProcessClass.java
View file @
73dd55ea
...
...
@@ -22,7 +22,7 @@ public final class ProcessClass {
DepthTraversal
.
visit
(
visitor
,
cls
);
}
}
catch
(
Exception
e
)
{
LOG
.
error
(
"Class process exception:
"
+
cls
,
e
);
LOG
.
error
(
"Class process exception:
{}"
,
cls
,
e
);
}
finally
{
cls
.
unload
();
}
...
...
jadx-core/src/main/java/jadx/core/clsp/ClsSet.java
View file @
73dd55ea
...
...
@@ -96,7 +96,7 @@ public class ClsSet {
private
static
NClass
getCls
(
String
fullName
,
Map
<
String
,
NClass
>
names
)
{
NClass
id
=
names
.
get
(
fullName
);
if
(
id
==
null
&&
!
names
.
containsKey
(
fullName
))
{
LOG
.
warn
(
"Class not found:
"
+
fullName
);
LOG
.
warn
(
"Class not found:
{}"
,
fullName
);
}
return
id
;
}
...
...
@@ -132,7 +132,7 @@ public class ClsSet {
out
.
writeBytes
(
JADX_CLS_SET_HEADER
);
out
.
writeByte
(
VERSION
);
LOG
.
info
(
"Classes count:
"
+
classes
.
length
);
LOG
.
info
(
"Classes count:
{}"
,
classes
.
length
);
out
.
writeInt
(
classes
.
length
);
for
(
NClass
cls
:
classes
)
{
writeString
(
out
,
cls
.
getName
());
...
...
jadx-core/src/main/java/jadx/core/clsp/ConvertToClsSet.java
View file @
73dd55ea
...
...
@@ -39,7 +39,7 @@ public class ConvertToClsSet {
}
}
for
(
InputFile
inputFile
:
inputFiles
)
{
LOG
.
info
(
"Loaded:
"
+
inputFile
.
getFile
());
LOG
.
info
(
"Loaded:
{}"
,
inputFile
.
getFile
());
}
RootNode
root
=
new
RootNode
();
...
...
@@ -48,7 +48,7 @@ public class ConvertToClsSet {
ClsSet
set
=
new
ClsSet
();
set
.
load
(
root
);
set
.
save
(
output
);
LOG
.
info
(
"Output:
"
+
output
);
LOG
.
info
(
"Output:
{}"
,
output
);
LOG
.
info
(
"done"
);
}
...
...
jadx-core/src/main/java/jadx/core/codegen/AnnotationGen.java
View file @
73dd55ea
...
...
@@ -150,9 +150,9 @@ public class AnnotationGen {
// must be a static field
FieldInfo
field
=
(
FieldInfo
)
val
;
InsnGen
.
makeStaticFieldAccess
(
code
,
field
,
classGen
);
}
else
if
(
val
instanceof
List
)
{
}
else
if
(
val
instanceof
Iterable
)
{
code
.
add
(
'{'
);
Iterator
<?>
it
=
((
List
)
val
).
iterator
();
Iterator
<?>
it
=
((
Iterable
)
val
).
iterator
();
while
(
it
.
hasNext
())
{
Object
obj
=
it
.
next
();
encodeValue
(
code
,
obj
);
...
...
jadx-core/src/main/java/jadx/core/codegen/InsnGen.java
View file @
73dd55ea
...
...
@@ -25,7 +25,7 @@ import jadx.core.dex.instructions.args.FieldArg;
import
jadx.core.dex.instructions.args.InsnArg
;
import
jadx.core.dex.instructions.args.InsnWrapArg
;
import
jadx.core.dex.instructions.args.LiteralArg
;
import
jadx.core.dex.instructions.args.Named
Arg
;
import
jadx.core.dex.instructions.args.Named
;
import
jadx.core.dex.instructions.args.RegisterArg
;
import
jadx.core.dex.instructions.mods.ConstructorInsn
;
import
jadx.core.dex.instructions.mods.TernaryInsn
;
...
...
@@ -98,7 +98,7 @@ public class InsnGen {
Flags
flag
=
wrap
?
Flags
.
BODY_ONLY
:
Flags
.
BODY_ONLY_NOWRAP
;
makeInsn
(((
InsnWrapArg
)
arg
).
getWrapInsn
(),
code
,
flag
);
}
else
if
(
arg
.
isNamed
())
{
code
.
add
(((
Named
Arg
)
arg
).
getName
());
code
.
add
(((
Named
)
arg
).
getName
());
}
else
if
(
arg
.
isField
())
{
FieldArg
f
=
(
FieldArg
)
arg
;
if
(
f
.
isStatic
())
{
...
...
jadx-core/src/main/java/jadx/core/codegen/RegionGen.java
View file @
73dd55ea
...
...
@@ -292,7 +292,7 @@ public class RegionGen extends InsnGen {
makeCatchBlock
(
code
,
handler
);
}
else
{
if
(
allHandler
!=
null
)
{
LOG
.
warn
(
"Several 'all' handlers in try/catch block in
"
+
mth
);
LOG
.
warn
(
"Several 'all' handlers in try/catch block in
{}"
,
mth
);
}
allHandler
=
handler
;
}
...
...
jadx-core/src/main/java/jadx/core/dex/instructions/args/TypeImmutableArg.java
View file @
73dd55ea
...
...
@@ -15,6 +15,7 @@ public class TypeImmutableArg extends RegisterArg {
@Override
public
void
setType
(
ArgType
type
)
{
// not allowed
}
public
void
markAsThis
()
{
...
...
jadx-core/src/main/java/jadx/core/dex/nodes/ClassNode.java
View file @
73dd55ea
...
...
@@ -132,7 +132,7 @@ public class ClassNode extends LineAttrNode implements ILoadable {
try
{
new
AnnotationsParser
(
this
).
parse
(
offset
);
}
catch
(
DecodeException
e
)
{
LOG
.
error
(
"Error parsing annotations in
"
+
this
,
e
);
LOG
.
error
(
"Error parsing annotations in
{}"
,
this
,
e
);
}
}
}
...
...
@@ -184,7 +184,7 @@ public class ClassNode extends LineAttrNode implements ILoadable {
}
}
}
catch
(
JadxRuntimeException
e
)
{
LOG
.
error
(
"Class signature parse error:
"
+
this
,
e
);
LOG
.
error
(
"Class signature parse error:
{}"
,
this
,
e
);
}
}
...
...
@@ -198,7 +198,7 @@ public class ClassNode extends LineAttrNode implements ILoadable {
field
.
setType
(
gType
);
}
}
catch
(
JadxRuntimeException
e
)
{
LOG
.
error
(
"Field signature parse error:
"
+
field
,
e
);
LOG
.
error
(
"Field signature parse error:
{}"
,
field
,
e
);
}
}
}
...
...
jadx-core/src/main/java/jadx/core/dex/nodes/MethodNode.java
View file @
73dd55ea
...
...
@@ -147,8 +147,7 @@ public class MethodNode extends LineAttrNode implements ILoadable {
return
false
;
}
if
(!
mthInfo
.
isConstructor
())
{
LOG
.
warn
(
"Wrong signature parse result: "
+
sp
+
" -> "
+
argsTypes
+
", not generic version: "
+
mthArgs
);
LOG
.
warn
(
"Wrong signature parse result: {} -> {}, not generic version: {}"
,
sp
,
argsTypes
,
mthArgs
);
return
false
;
}
else
if
(
getParentClass
().
getAccessFlags
().
isEnum
())
{
// TODO:
...
...
@@ -164,7 +163,7 @@ public class MethodNode extends LineAttrNode implements ILoadable {
}
initArguments
(
argsTypes
);
}
catch
(
JadxRuntimeException
e
)
{
LOG
.
error
(
"Method signature parse error:
"
+
this
,
e
);
LOG
.
error
(
"Method signature parse error:
{}"
,
this
,
e
);
return
false
;
}
return
true
;
...
...
jadx-core/src/main/java/jadx/core/dex/nodes/parser/LocalVar.java
View file @
73dd55ea
...
...
@@ -41,7 +41,7 @@ final class LocalVar {
type
=
gType
;
}
}
catch
(
Exception
e
)
{
LOG
.
error
(
"Can't parse signature for local variable:
"
+
sign
,
e
);
LOG
.
error
(
"Can't parse signature for local variable:
{}"
,
sign
,
e
);
}
}
this
.
name
=
name
;
...
...
jadx-core/src/main/java/jadx/core/dex/visitors/SimplifyVisitor.java
View file @
73dd55ea
...
...
@@ -104,7 +104,7 @@ public class SimplifyVisitor extends AbstractVisitor {
&&
((
LiteralArg
)
insn
.
getArg
(
1
)).
getLiteral
()
==
0
)
{
insn
.
changeCondition
(
insn
.
getOp
(),
wi
.
getArg
(
0
),
wi
.
getArg
(
1
));
}
else
{
LOG
.
warn
(
"TODO: cmp
"
+
insn
);
LOG
.
warn
(
"TODO: cmp
{}"
,
insn
);
}
}
}
...
...
jadx-core/src/main/java/jadx/core/dex/visitors/regions/ProcessTryCatchRegions.java
View file @
73dd55ea
...
...
@@ -100,7 +100,7 @@ public class ProcessTryCatchRegions extends AbstractRegionVisitor {
TryCatchBlock
prevTB
=
tryBlocksMap
.
put
(
domBlock
,
tb
);
if
(
prevTB
!=
null
)
{
LOG
.
info
(
"!!! TODO: merge try blocks in
"
+
mth
);
LOG
.
info
(
"!!! TODO: merge try blocks in
{}"
,
mth
);
}
}
}
...
...
jadx-core/src/main/java/jadx/core/dex/visitors/regions/RegionMaker.java
View file @
73dd55ea
...
...
@@ -70,7 +70,7 @@ public class RegionMaker {
if
(
Consts
.
DEBUG
)
{
int
id
=
startBlock
.
getId
();
if
(
processedBlocks
.
get
(
id
))
{
LOG
.
debug
(
" Block already processed:
"
+
startBlock
+
", mth: "
+
mth
);
LOG
.
debug
(
" Block already processed:
{}, mth: {}"
,
startBlock
,
mth
);
}
else
{
processedBlocks
.
set
(
id
);
}
...
...
@@ -502,9 +502,13 @@ public class RegionMaker {
// invert simple condition (compiler often do it)
currentIf
=
IfInfo
.
invert
(
currentIf
);
}
currentIf
=
IfMakerHelper
.
restructureIf
(
mth
,
block
,
currentIf
);
if
(
currentIf
==
null
)
{
// invalid merged if, check simple one again
IfInfo
modifiedIf
=
IfMakerHelper
.
restructureIf
(
mth
,
block
,
currentIf
);
if
(
modifiedIf
!=
null
)
{
currentIf
=
modifiedIf
;
}
else
{
if
(
currentIf
.
getMergedBlocks
().
size
()
<=
1
)
{
return
null
;
}
currentIf
=
makeIfInfo
(
block
);
currentIf
=
IfMakerHelper
.
restructureIf
(
mth
,
block
,
currentIf
);
if
(
currentIf
==
null
)
{
...
...
jadx-core/src/main/java/jadx/core/utils/ErrorsCounter.java
View file @
73dd55ea
...
...
@@ -73,7 +73,7 @@ public class ErrorsCounter {
public
void
printReport
()
{
if
(
getErrorCount
()
>
0
)
{
LOG
.
error
(
getErrorCount
()
+
" errors occurred in following nodes:"
);
LOG
.
error
(
"{} errors occurred in following nodes:"
,
getErrorCount
()
);
List
<
Object
>
nodes
=
new
ArrayList
<
Object
>(
errorNodes
);
Collections
.
sort
(
nodes
,
new
Comparator
<
Object
>()
{
@Override
...
...
@@ -83,7 +83,7 @@ public class ErrorsCounter {
});
for
(
Object
node
:
nodes
)
{
String
nodeName
=
node
.
getClass
().
getSimpleName
().
replace
(
"Node"
,
""
);
LOG
.
error
(
"
"
+
nodeName
+
": "
+
node
);
LOG
.
error
(
"
{}: {}"
,
nodeName
,
node
);
}
}
}
...
...
jadx-core/src/main/java/jadx/core/utils/InstructionRemover.java
View file @
73dd55ea
package
jadx
.
core
.
utils
;
import
jadx.core.Consts
;
import
jadx.core.dex.attributes.AFlag
;
import
jadx.core.dex.instructions.args.InsnArg
;
import
jadx.core.dex.instructions.args.InsnWrapArg
;
...
...
@@ -66,9 +65,6 @@ public class InstructionRemover {
public
static
void
unbindInsn
(
MethodNode
mth
,
InsnNode
insn
)
{
RegisterArg
r
=
insn
.
getResult
();
if
(
r
!=
null
&&
r
.
getSVar
()
!=
null
)
{
if
(
Consts
.
DEBUG
&&
r
.
getSVar
().
getUseCount
()
!=
0
)
{
LOG
.
debug
(
"Unbind insn with result: {}"
,
insn
);
}
mth
.
removeSVar
(
r
.
getSVar
());
}
for
(
InsnArg
arg
:
insn
.
getArguments
())
{
...
...
jadx-core/src/main/java/jadx/core/utils/files/InputFile.java
View file @
73dd55ea
...
...
@@ -66,7 +66,7 @@ public class InputFile {
if
(
ba
.
length
==
0
)
{
throw
new
JadxException
(
j2d
.
isError
()
?
j2d
.
getDxErrors
()
:
"Empty dx output"
);
}
else
if
(
j2d
.
isError
())
{
LOG
.
warn
(
"dx message:
"
+
j2d
.
getDxErrors
());
LOG
.
warn
(
"dx message:
{}"
,
j2d
.
getDxErrors
());
}
return
new
Dex
(
ba
);
}
catch
(
Throwable
e
)
{
...
...
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