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
207ce6cb
Commit
207ce6cb
authored
Apr 01, 2019
by
Ahmed Ashour
Committed by
skylot
Apr 01, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: fix "unused" warnings (PR #549)
parent
1d3e6ecb
Hide whitespace changes
Inline
Side-by-side
Showing
63 changed files
with
86 additions
and
90 deletions
+86
-90
BlockFinish.java
.../java/jadx/core/dex/visitors/blocksmaker/BlockFinish.java
+1
-6
DebugInfoParser.java
...ava/jadx/core/dex/visitors/debuginfo/DebugInfoParser.java
+0
-4
BinaryXMLParser.java
...-core/src/main/java/jadx/core/xmlgen/BinaryXMLParser.java
+1
-0
CommonBinaryParser.java
...re/src/main/java/jadx/core/xmlgen/CommonBinaryParser.java
+1
-0
ResTableParser.java
jadx-core/src/main/java/jadx/core/xmlgen/ResTableParser.java
+1
-0
TestWrongCode.java
...e/src/test/java/jadx/tests/integration/TestWrongCode.java
+3
-2
TestArith3.java
...rc/test/java/jadx/tests/integration/arith/TestArith3.java
+2
-2
TestLineNumbers2.java
...va/jadx/tests/integration/debuginfo/TestLineNumbers2.java
+0
-1
TestGenerics2.java
...t/java/jadx/tests/integration/generics/TestGenerics2.java
+2
-2
TestIssue86.java
.../test/java/jadx/tests/integration/inline/TestIssue86.java
+1
-1
TestAnonymousClass12.java
...va/jadx/tests/integration/inner/TestAnonymousClass12.java
+2
-2
TestAnonymousClass2.java
...ava/jadx/tests/integration/inner/TestAnonymousClass2.java
+2
-1
TestAnonymousClass3.java
...ava/jadx/tests/integration/inner/TestAnonymousClass3.java
+1
-1
TestAnonymousClass4.java
...ava/jadx/tests/integration/inner/TestAnonymousClass4.java
+1
-0
TestInnerClass4.java
...st/java/jadx/tests/integration/inner/TestInnerClass4.java
+1
-1
TestOuterConstructorCall.java
...adx/tests/integration/inner/TestOuterConstructorCall.java
+1
-0
TestInvoke1.java
.../test/java/jadx/tests/integration/invoke/TestInvoke1.java
+1
-1
TestInvokeInCatch.java
...java/jadx/tests/integration/invoke/TestInvokeInCatch.java
+1
-1
TestSuperInvokeWithGenerics.java
...tests/integration/invoke/TestSuperInvokeWithGenerics.java
+0
-1
TestArrayForEach.java
...t/java/jadx/tests/integration/loops/TestArrayForEach.java
+1
-1
TestArrayForEach2.java
.../java/jadx/tests/integration/loops/TestArrayForEach2.java
+1
-1
TestArrayForEachNegative.java
...adx/tests/integration/loops/TestArrayForEachNegative.java
+1
-1
TestBreakInLoop.java
...st/java/jadx/tests/integration/loops/TestBreakInLoop.java
+2
-2
TestContinueInLoop.java
...java/jadx/tests/integration/loops/TestContinueInLoop.java
+2
-2
TestIterableForEach.java
...ava/jadx/tests/integration/loops/TestIterableForEach.java
+1
-1
TestIterableForEach3.java
...va/jadx/tests/integration/loops/TestIterableForEach3.java
+1
-1
TestLoopCondition.java
.../java/jadx/tests/integration/loops/TestLoopCondition.java
+2
-2
TestLoopCondition5.java
...java/jadx/tests/integration/loops/TestLoopCondition5.java
+1
-1
TestLoopConditionInvoke.java
...jadx/tests/integration/loops/TestLoopConditionInvoke.java
+1
-1
TestLoopDetection.java
.../java/jadx/tests/integration/loops/TestLoopDetection.java
+1
-1
TestLoopDetection3.java
...java/jadx/tests/integration/loops/TestLoopDetection3.java
+1
-1
TestLoopDetection4.java
...java/jadx/tests/integration/loops/TestLoopDetection4.java
+1
-1
TestNestedLoops.java
...st/java/jadx/tests/integration/loops/TestNestedLoops.java
+1
-1
TestNestedLoops2.java
...t/java/jadx/tests/integration/loops/TestNestedLoops2.java
+1
-1
TestNameAssign2.java
...st/java/jadx/tests/integration/names/TestNameAssign2.java
+1
-1
TestDefConstructorNotRemoved.java
...ests/integration/others/TestDefConstructorNotRemoved.java
+1
-1
TestFieldInit.java
...est/java/jadx/tests/integration/others/TestFieldInit.java
+4
-4
TestFieldInit2.java
...st/java/jadx/tests/integration/others/TestFieldInit2.java
+2
-2
TestFieldInitInTryCatch.java
...adx/tests/integration/others/TestFieldInitInTryCatch.java
+5
-5
TestIfInTry.java
.../test/java/jadx/tests/integration/others/TestIfInTry.java
+1
-1
TestIfTryInCatch.java
.../java/jadx/tests/integration/others/TestIfTryInCatch.java
+1
-1
TestIssue13b.java
...test/java/jadx/tests/integration/others/TestIssue13b.java
+2
-2
TestLoopInTry2.java
...st/java/jadx/tests/integration/others/TestLoopInTry2.java
+1
-3
TestSynchronized2.java
...jadx/tests/integration/synchronize/TestSynchronized2.java
+1
-0
TestNestedTryCatch.java
...a/jadx/tests/integration/trycatch/TestNestedTryCatch.java
+1
-1
TestTryCatch.java
...st/java/jadx/tests/integration/trycatch/TestTryCatch.java
+1
-1
TestTryCatch2.java
...t/java/jadx/tests/integration/trycatch/TestTryCatch2.java
+1
-1
TestTryCatch4.java
...t/java/jadx/tests/integration/trycatch/TestTryCatch4.java
+2
-1
TestTryCatch7.java
...t/java/jadx/tests/integration/trycatch/TestTryCatch7.java
+1
-1
TestTryCatchFinally5.java
...jadx/tests/integration/trycatch/TestTryCatchFinally5.java
+1
-1
TestTryCatchFinally8.java
...jadx/tests/integration/trycatch/TestTryCatchFinally8.java
+1
-1
TestGenerics.java
.../test/java/jadx/tests/integration/types/TestGenerics.java
+1
-1
TestTypeInheritance.java
...ava/jadx/tests/integration/types/TestTypeInheritance.java
+1
-1
TestTypeResolver2.java
.../java/jadx/tests/integration/types/TestTypeResolver2.java
+1
-1
TestTypeResolver6.java
.../java/jadx/tests/integration/types/TestTypeResolver6.java
+1
-1
TestTypeResolver6a.java
...java/jadx/tests/integration/types/TestTypeResolver6a.java
+1
-1
TestDontInlineThis.java
...va/jadx/tests/integration/usethis/TestDontInlineThis.java
+1
-1
TestInlineThis.java
...t/java/jadx/tests/integration/usethis/TestInlineThis.java
+1
-1
TestInlineThis2.java
.../java/jadx/tests/integration/usethis/TestInlineThis2.java
+1
-1
TestVariables4.java
...java/jadx/tests/integration/variables/TestVariables4.java
+1
-1
TestGenerics.java
jadx-samples/src/main/java/jadx/samples/TestGenerics.java
+6
-6
TestTypeResolver.java
...-samples/src/main/java/jadx/samples/TestTypeResolver.java
+1
-1
TestTypeResolver2.java
...samples/src/main/java/jadx/samples/TestTypeResolver2.java
+3
-3
No files found.
jadx-core/src/main/java/jadx/core/dex/visitors/blocksmaker/BlockFinish.java
View file @
207ce6cb
...
...
@@ -3,9 +3,6 @@ package jadx.core.dex.visitors.blocksmaker;
import
java.util.HashMap
;
import
java.util.Map
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
jadx.core.dex.attributes.AType
;
import
jadx.core.dex.nodes.BlockNode
;
import
jadx.core.dex.nodes.MethodNode
;
...
...
@@ -16,8 +13,6 @@ import jadx.core.utils.BlockUtils;
public
class
BlockFinish
extends
AbstractVisitor
{
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
BlockFinish
.
class
);
@Override
public
void
visit
(
MethodNode
mth
)
{
if
(
mth
.
isNoCode
())
{
...
...
@@ -33,7 +28,7 @@ public class BlockFinish extends AbstractVisitor {
}
/**
* For evey exception handler must be only one splitter block,
* For eve
r
y exception handler must be only one splitter block,
* select correct one and remove others if necessary.
*/
private
static
void
fixSplitterBlock
(
MethodNode
mth
,
BlockNode
block
)
{
...
...
jadx-core/src/main/java/jadx/core/dex/visitors/debuginfo/DebugInfoParser.java
View file @
207ce6cb
...
...
@@ -4,9 +4,6 @@ import java.util.ArrayList;
import
java.util.List
;
import
com.android.dex.Dex.Section
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
jadx.core.dex.attributes.nodes.SourceFileAttr
;
import
jadx.core.dex.instructions.args.RegisterArg
;
import
jadx.core.dex.nodes.DexNode
;
...
...
@@ -15,7 +12,6 @@ import jadx.core.dex.nodes.MethodNode;
import
jadx.core.utils.exceptions.DecodeException
;
public
class
DebugInfoParser
{
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
DebugInfoParser
.
class
);
private
static
final
int
DBG_END_SEQUENCE
=
0x00
;
private
static
final
int
DBG_ADVANCE_PC
=
0x01
;
private
static
final
int
DBG_ADVANCE_LINE
=
0x02
;
...
...
jadx-core/src/main/java/jadx/core/xmlgen/BinaryXMLParser.java
View file @
207ce6cb
...
...
@@ -31,6 +31,7 @@ import jadx.core.xmlgen.entry.ValuesParser;
Check Element chunk size
*/
@SuppressWarnings
(
"unused"
)
public
class
BinaryXMLParser
extends
CommonBinaryParser
{
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
BinaryXMLParser
.
class
);
...
...
jadx-core/src/main/java/jadx/core/xmlgen/CommonBinaryParser.java
View file @
207ce6cb
...
...
@@ -11,6 +11,7 @@ public class CommonBinaryParser extends ParserConstants {
return
parseStringPoolNoType
();
}
@SuppressWarnings
(
"unused"
)
protected
String
[]
parseStringPoolNoType
()
throws
IOException
{
long
start
=
is
.
getPos
()
-
2
;
is
.
checkInt16
(
0x001c
,
"String pool header size not 0x001c"
);
...
...
jadx-core/src/main/java/jadx/core/xmlgen/ResTableParser.java
View file @
207ce6cb
...
...
@@ -164,6 +164,7 @@ public class ResTableParser extends CommonBinaryParser {
return
pkg
;
}
@SuppressWarnings
(
"unused"
)
private
void
parseTypeSpecChunk
()
throws
IOException
{
is
.
checkInt16
(
0x0010
,
"Unexpected type spec header size"
);
/*int size = */
...
...
jadx-core/src/test/java/jadx/tests/integration/TestWrongCode.java
View file @
207ce6cb
...
...
@@ -14,12 +14,13 @@ import static org.hamcrest.MatcherAssert.assertThat;
public
class
TestWrongCode
extends
IntegrationTest
{
public
static
class
TestCls
{
private
int
test
()
{
@SuppressWarnings
(
"null"
)
public
int
test
()
{
int
[]
a
=
null
;
return
a
.
length
;
}
p
rivate
int
test2
(
int
a
)
{
p
ublic
int
test2
(
int
a
)
{
if
(
a
==
0
)
{
}
return
a
;
...
...
jadx-core/src/test/java/jadx/tests/integration/arith/TestArith3.java
View file @
207ce6cb
...
...
@@ -13,9 +13,9 @@ import static org.hamcrest.MatcherAssert.assertThat;
public
class
TestArith3
extends
IntegrationTest
{
public
static
class
TestCls
{
p
rivate
int
vp
;
p
ublic
int
vp
;
p
rivate
void
test
(
byte
[]
buffer
)
{
p
ublic
void
test
(
byte
[]
buffer
)
{
int
n
=
((
buffer
[
3
]
&
255
)
+
4
)
+
((
buffer
[
2
]
&
15
)
<<
8
);
while
(
n
+
4
<
buffer
.
length
)
{
int
c
=
buffer
[
n
]
&
255
;
...
...
jadx-core/src/test/java/jadx/tests/integration/debuginfo/TestLineNumbers2.java
View file @
207ce6cb
...
...
@@ -37,7 +37,6 @@ public class TestLineNumbers2 extends IntegrationTest {
public
void
test
()
{
ClassNode
cls
=
getClassNode
(
TestCls
.
class
);
CodeWriter
codeWriter
=
cls
.
getCode
();
String
code
=
codeWriter
.
toString
();
Map
<
Integer
,
Integer
>
lineMapping
=
codeWriter
.
getLineMapping
();
assertEquals
(
"{8=18, 11=22, 12=23, 13=24, 14=28, 16=25, 17=26, 18=28, 21=31, 22=32}"
,
...
...
jadx-core/src/test/java/jadx/tests/integration/generics/TestGenerics2.java
View file @
207ce6cb
...
...
@@ -16,8 +16,8 @@ import static org.hamcrest.MatcherAssert.assertThat;
public
class
TestGenerics2
extends
IntegrationTest
{
public
static
class
TestCls
{
p
rivate
static
class
ItemReference
<
V
>
extends
WeakReference
<
V
>
{
p
rivate
Object
id
;
p
ublic
static
class
ItemReference
<
V
>
extends
WeakReference
<
V
>
{
p
ublic
Object
id
;
public
ItemReference
(
V
item
,
Object
objId
,
ReferenceQueue
<?
super
V
>
queue
)
{
super
(
item
,
queue
);
...
...
jadx-core/src/test/java/jadx/tests/integration/inline/TestIssue86.java
View file @
207ce6cb
...
...
@@ -24,7 +24,7 @@ public class TestIssue86 extends IntegrationTest {
private
static
final
String
WEATHER_TAG
=
"weather-tag"
;
private
static
final
String
DESC_TAG
=
"desc-tag"
;
p
rivate
List
<
Day
>
test
(
String
response
)
{
p
ublic
List
<
Day
>
test
(
String
response
)
{
List
<
Day
>
reportList
=
new
ArrayList
<>();
try
{
System
.
out
.
println
(
response
);
...
...
jadx-core/src/test/java/jadx/tests/integration/inner/TestAnonymousClass12.java
View file @
207ce6cb
...
...
@@ -16,8 +16,8 @@ public class TestAnonymousClass12 extends IntegrationTest {
public
abstract
void
doSomething
();
}
p
rivate
BasicAbstract
outer
;
p
rivate
BasicAbstract
inner
;
p
ublic
BasicAbstract
outer
;
p
ublic
BasicAbstract
inner
;
public
void
test
()
{
outer
=
new
BasicAbstract
()
{
...
...
jadx-core/src/test/java/jadx/tests/integration/inner/TestAnonymousClass2.java
View file @
207ce6cb
...
...
@@ -13,7 +13,7 @@ public class TestAnonymousClass2 extends IntegrationTest {
public
static
class
TestCls
{
public
static
class
Inner
{
p
rivate
int
f
;
p
ublic
int
f
;
public
Runnable
test
()
{
return
new
Runnable
()
{
...
...
@@ -27,6 +27,7 @@ public class TestAnonymousClass2 extends IntegrationTest {
public
Runnable
test2
()
{
return
new
Runnable
()
{
@Override
@SuppressWarnings
(
"unused"
)
public
void
run
()
{
Object
obj
=
Inner
.
this
;
}
...
...
jadx-core/src/test/java/jadx/tests/integration/inner/TestAnonymousClass3.java
View file @
207ce6cb
...
...
@@ -13,7 +13,7 @@ public class TestAnonymousClass3 extends IntegrationTest {
public
static
class
TestCls
{
public
static
class
Inner
{
private
int
f
;
p
rivate
double
d
;
p
ublic
double
d
;
public
void
test
()
{
new
Thread
()
{
...
...
jadx-core/src/test/java/jadx/tests/integration/inner/TestAnonymousClass4.java
View file @
207ce6cb
...
...
@@ -12,6 +12,7 @@ import static org.hamcrest.MatcherAssert.assertThat;
public
class
TestAnonymousClass4
extends
IntegrationTest
{
public
static
class
TestCls
{
@SuppressWarnings
(
"unused"
)
public
static
class
Inner
{
private
int
f
;
private
double
d
;
...
...
jadx-core/src/test/java/jadx/tests/integration/inner/TestInnerClass4.java
View file @
207ce6cb
...
...
@@ -19,7 +19,7 @@ public class TestInnerClass4 extends IntegrationTest {
}
}
p
rivate
String
test
()
{
p
ublic
String
test
()
{
return
new
C
().
c
;
}
}
...
...
jadx-core/src/test/java/jadx/tests/integration/inner/TestOuterConstructorCall.java
View file @
207ce6cb
...
...
@@ -17,6 +17,7 @@ public class TestOuterConstructorCall extends IntegrationTest {
}
private
class
Inner
{
@SuppressWarnings
(
"unused"
)
private
TestCls
test
()
{
return
new
TestCls
(
this
);
}
...
...
jadx-core/src/test/java/jadx/tests/integration/invoke/TestInvoke1.java
View file @
207ce6cb
...
...
@@ -16,7 +16,7 @@ public class TestInvoke1 extends IntegrationTest {
private
A
is
;
p
rivate
C
test
(
int
start
)
throws
IOException
{
p
ublic
C
test
(
int
start
)
throws
IOException
{
int
id
=
is
.
readInt32
();
String
name
=
is
.
readString16Fixed
(
128
);
...
...
jadx-core/src/test/java/jadx/tests/integration/invoke/TestInvokeInCatch.java
View file @
207ce6cb
...
...
@@ -17,7 +17,7 @@ public class TestInvokeInCatch extends IntegrationTest {
public
static
class
TestCls
{
private
static
final
String
TAG
=
"TAG"
;
p
rivate
void
test
(
int
[]
a
,
int
b
)
{
p
ublic
void
test
(
int
[]
a
,
int
b
)
{
try
{
exc
();
}
catch
(
IOException
e
)
{
...
...
jadx-core/src/test/java/jadx/tests/integration/invoke/TestSuperInvokeWithGenerics.java
View file @
207ce6cb
...
...
@@ -7,7 +7,6 @@ import jadx.tests.api.IntegrationTest;
import
static
jadx
.
tests
.
api
.
utils
.
JadxMatchers
.
containsOne
;
import
static
org
.
hamcrest
.
MatcherAssert
.
assertThat
;
import
static
org
.
hamcrest
.
Matchers
.
anyOf
;
public
class
TestSuperInvokeWithGenerics
extends
IntegrationTest
{
...
...
jadx-core/src/test/java/jadx/tests/integration/loops/TestArrayForEach.java
View file @
207ce6cb
...
...
@@ -12,7 +12,7 @@ public class TestArrayForEach extends IntegrationTest {
public
static
class
TestCls
{
p
rivate
int
test
(
int
[]
a
)
{
p
ublic
int
test
(
int
[]
a
)
{
int
sum
=
0
;
for
(
int
n
:
a
)
{
sum
+=
n
;
...
...
jadx-core/src/test/java/jadx/tests/integration/loops/TestArrayForEach2.java
View file @
207ce6cb
...
...
@@ -13,7 +13,7 @@ import static org.hamcrest.Matchers.not;
public
class
TestArrayForEach2
extends
IntegrationTest
{
public
static
class
TestCls
{
p
rivate
void
test
(
String
str
)
{
p
ublic
void
test
(
String
str
)
{
for
(
String
s
:
str
.
split
(
"\n"
))
{
String
t
=
s
.
trim
();
if
(
t
.
length
()
>
0
)
{
...
...
jadx-core/src/test/java/jadx/tests/integration/loops/TestArrayForEachNegative.java
View file @
207ce6cb
...
...
@@ -13,7 +13,7 @@ public class TestArrayForEachNegative extends IntegrationTest {
public
static
class
TestCls
{
p
rivate
int
test
(
int
[]
a
,
int
[]
b
)
{
p
ublic
int
test
(
int
[]
a
,
int
[]
b
)
{
int
sum
=
0
;
for
(
int
i
=
0
;
i
<
a
.
length
;
i
+=
2
)
{
sum
+=
a
[
i
];
...
...
jadx-core/src/test/java/jadx/tests/integration/loops/TestBreakInLoop.java
View file @
207ce6cb
...
...
@@ -12,9 +12,9 @@ import static org.hamcrest.MatcherAssert.assertThat;
public
class
TestBreakInLoop
extends
IntegrationTest
{
public
static
class
TestCls
{
p
rivate
int
f
;
p
ublic
int
f
;
p
rivate
void
test
(
int
[]
a
,
int
b
)
{
p
ublic
void
test
(
int
[]
a
,
int
b
)
{
for
(
int
i
=
0
;
i
<
a
.
length
;
i
++)
{
a
[
i
]++;
if
(
i
<
b
)
{
...
...
jadx-core/src/test/java/jadx/tests/integration/loops/TestContinueInLoop.java
View file @
207ce6cb
...
...
@@ -11,9 +11,9 @@ import static org.hamcrest.MatcherAssert.assertThat;
public
class
TestContinueInLoop
extends
IntegrationTest
{
public
static
class
TestCls
{
p
rivate
int
f
;
p
ublic
int
f
;
p
rivate
void
test
(
int
[]
a
,
int
b
)
{
p
ublic
void
test
(
int
[]
a
,
int
b
)
{
for
(
int
i
=
0
;
i
<
a
.
length
;
i
++)
{
int
v
=
a
[
i
];
if
(
v
<
b
)
{
...
...
jadx-core/src/test/java/jadx/tests/integration/loops/TestIterableForEach.java
View file @
207ce6cb
...
...
@@ -11,7 +11,7 @@ import static org.hamcrest.MatcherAssert.assertThat;
public
class
TestIterableForEach
extends
IntegrationTest
{
public
static
class
TestCls
{
p
rivate
String
test
(
Iterable
<
String
>
a
)
{
p
ublic
String
test
(
Iterable
<
String
>
a
)
{
StringBuilder
sb
=
new
StringBuilder
();
for
(
String
s
:
a
)
{
sb
.
append
(
s
);
...
...
jadx-core/src/test/java/jadx/tests/integration/loops/TestIterableForEach3.java
View file @
207ce6cb
...
...
@@ -16,7 +16,7 @@ public class TestIterableForEach3 extends IntegrationTest {
private
Set
<
T
>
a
;
private
Set
<
T
>
b
;
p
rivate
void
test
(
T
str
)
{
p
ublic
void
test
(
T
str
)
{
Set
<
T
>
set
=
str
.
length
()
==
1
?
a
:
b
;
for
(
T
s
:
set
)
{
if
(
s
.
length
()
==
str
.
length
())
{
...
...
jadx-core/src/test/java/jadx/tests/integration/loops/TestLoopCondition.java
View file @
207ce6cb
...
...
@@ -16,7 +16,7 @@ public class TestLoopCondition extends IntegrationTest {
private
void
setEnabled
(
boolean
r1z
)
{
}
p
rivate
void
testIfInLoop
()
{
p
ublic
void
testIfInLoop
()
{
int
j
=
0
;
for
(
int
i
=
0
;
i
<
f
.
length
();
i
++)
{
char
ch
=
f
.
charAt
(
i
);
...
...
@@ -31,7 +31,7 @@ public class TestLoopCondition extends IntegrationTest {
setEnabled
(
false
);
}
p
rivate
void
testMoreComplexIfInLoop
(
java
.
util
.
ArrayList
<
String
>
list
)
throws
Exception
{
p
ublic
void
testMoreComplexIfInLoop
(
java
.
util
.
ArrayList
<
String
>
list
)
throws
Exception
{
for
(
int
i
=
0
;
i
!=
16
&&
i
<
255
;
i
++)
{
list
.
set
(
i
,
"ABC"
);
if
(
i
==
128
)
{
...
...
jadx-core/src/test/java/jadx/tests/integration/loops/TestLoopCondition5.java
View file @
207ce6cb
...
...
@@ -13,7 +13,7 @@ import static org.hamcrest.Matchers.anyOf;
public
class
TestLoopCondition5
extends
SmaliTest
{
public
static
class
TestCls
{
p
rivate
static
int
lastIndexOf
(
int
[]
array
,
int
target
,
int
start
,
int
end
)
{
p
ublic
static
int
lastIndexOf
(
int
[]
array
,
int
target
,
int
start
,
int
end
)
{
for
(
int
i
=
end
-
1
;
i
>=
start
;
i
--)
{
if
(
array
[
i
]
==
target
)
{
return
i
;
...
...
jadx-core/src/test/java/jadx/tests/integration/loops/TestLoopConditionInvoke.java
View file @
207ce6cb
...
...
@@ -14,7 +14,7 @@ public class TestLoopConditionInvoke extends IntegrationTest {
private
static
final
char
STOP_CHAR
=
0
;
private
int
pos
;
p
rivate
boolean
test
(
char
lastChar
)
{
p
ublic
boolean
test
(
char
lastChar
)
{
int
startPos
=
pos
;
char
ch
;
while
((
ch
=
next
())
!=
STOP_CHAR
)
{
...
...
jadx-core/src/test/java/jadx/tests/integration/loops/TestLoopDetection.java
View file @
207ce6cb
...
...
@@ -13,7 +13,7 @@ public class TestLoopDetection extends IntegrationTest {
public
static
class
TestCls
{
p
rivate
void
test
(
int
[]
a
,
int
b
)
{
p
ublic
void
test
(
int
[]
a
,
int
b
)
{
int
i
=
0
;
while
(
i
<
a
.
length
&&
i
<
b
)
{
a
[
i
]++;
...
...
jadx-core/src/test/java/jadx/tests/integration/loops/TestLoopDetection3.java
View file @
207ce6cb
...
...
@@ -13,7 +13,7 @@ public class TestLoopDetection3 extends IntegrationTest {
public
static
class
TestCls
{
p
rivate
void
test
(
TestCls
parent
,
int
pos
)
{
p
ublic
void
test
(
TestCls
parent
,
int
pos
)
{
Object
item
;
while
(--
pos
>=
0
)
{
item
=
parent
.
get
(
pos
);
...
...
jadx-core/src/test/java/jadx/tests/integration/loops/TestLoopDetection4.java
View file @
207ce6cb
...
...
@@ -16,7 +16,7 @@ public class TestLoopDetection4 extends IntegrationTest {
private
Iterator
<
String
>
iterator
;
private
SomeCls
filter
;
p
rivate
String
test
()
{
p
ublic
String
test
()
{
while
(
iterator
.
hasNext
())
{
String
next
=
iterator
.
next
();
String
filtered
=
filter
.
filter
(
next
);
...
...
jadx-core/src/test/java/jadx/tests/integration/loops/TestNestedLoops.java
View file @
207ce6cb
...
...
@@ -14,7 +14,7 @@ public class TestNestedLoops extends IntegrationTest {
public
static
class
TestCls
{
p
rivate
void
test
(
List
<
String
>
l1
,
List
<
String
>
l2
)
{
p
ublic
void
test
(
List
<
String
>
l1
,
List
<
String
>
l2
)
{
for
(
String
s1
:
l1
)
{
for
(
String
s2
:
l2
)
{
if
(
s1
.
equals
(
s2
))
{
...
...
jadx-core/src/test/java/jadx/tests/integration/loops/TestNestedLoops2.java
View file @
207ce6cb
...
...
@@ -14,7 +14,7 @@ public class TestNestedLoops2 extends IntegrationTest {
public
static
class
TestCls
{
p
rivate
boolean
test
(
List
<
String
>
list
)
{
p
ublic
boolean
test
(
List
<
String
>
list
)
{
int
j
=
0
;
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++)
{
String
s
=
list
.
get
(
i
);
...
...
jadx-core/src/test/java/jadx/tests/integration/names/TestNameAssign2.java
View file @
207ce6cb
...
...
@@ -21,7 +21,7 @@ public class TestNameAssign2 extends IntegrationTest {
public
static
class
TestCls
{
p
rivate
static
void
test
(
MethodNode
mth
,
int
regNum
,
LiveVarAnalysis
la
)
{
p
ublic
static
void
test
(
MethodNode
mth
,
int
regNum
,
LiveVarAnalysis
la
)
{
List
<
BlockNode
>
blocks
=
mth
.
getBasicBlocks
();
int
blocksCount
=
blocks
.
size
();
BitSet
hasPhi
=
new
BitSet
(
blocksCount
);
...
...
jadx-core/src/test/java/jadx/tests/integration/others/TestDefConstructorNotRemoved.java
View file @
207ce6cb
...
...
@@ -19,7 +19,7 @@ public class TestDefConstructorNotRemoved extends IntegrationTest {
}
public
static
class
A
{
p
rivate
final
String
s
;
p
ublic
final
String
s
;
public
A
()
{
s
=
"a"
;
...
...
jadx-core/src/test/java/jadx/tests/integration/others/TestFieldInit.java
View file @
207ce6cb
...
...
@@ -21,11 +21,11 @@ public class TestFieldInit extends IntegrationTest {
public
class
A
{
}
p
rivate
static
List
<
String
>
s
=
new
ArrayList
<>();
p
ublic
static
List
<
String
>
s
=
new
ArrayList
<>();
p
rivate
A
a
=
new
A
();
p
rivate
int
i
=
1
+
Random
.
class
.
getSimpleName
().
length
();
p
rivate
int
n
=
0
;
p
ublic
A
a
=
new
A
();
p
ublic
int
i
=
1
+
Random
.
class
.
getSimpleName
().
length
();
p
ublic
int
n
=
0
;
public
TestCls
(
int
z
)
{
this
.
n
=
z
;
...
...
jadx-core/src/test/java/jadx/tests/integration/others/TestFieldInit2.java
View file @
207ce6cb
...
...
@@ -17,13 +17,13 @@ public class TestFieldInit2 extends IntegrationTest {
void
doSomething
();
}
p
rivate
BasicAbstract
x
=
new
BasicAbstract
()
{
p
ublic
BasicAbstract
x
=
new
BasicAbstract
()
{
@Override
public
void
doSomething
()
{
y
=
1
;
}
};
p
rivate
int
y
=
0
;
p
ublic
int
y
=
0
;
public
TestCls
()
{
}
...
...
jadx-core/src/test/java/jadx/tests/integration/others/TestFieldInitInTryCatch.java
View file @
207ce6cb
...
...
@@ -15,7 +15,7 @@ import static org.hamcrest.MatcherAssert.assertThat;
public
class
TestFieldInitInTryCatch
extends
IntegrationTest
{
public
static
class
TestCls
{
p
rivate
static
final
URL
a
;
p
ublic
static
final
URL
a
;
static
{
try
{
...
...
@@ -27,7 +27,7 @@ public class TestFieldInitInTryCatch extends IntegrationTest {
}
public
static
class
TestCls2
{
p
rivate
static
final
URL
[]
a
;
p
ublic
static
final
URL
[]
a
;
static
{
try
{
...
...
@@ -39,7 +39,7 @@ public class TestFieldInitInTryCatch extends IntegrationTest {
}
public
static
class
TestCls3
{
p
rivate
static
final
String
[]
a
;
p
ublic
static
final
String
[]
a
;
static
{
try
{
...
...
@@ -58,7 +58,7 @@ public class TestFieldInitInTryCatch extends IntegrationTest {
ClassNode
cls
=
getClassNode
(
TestCls
.
class
);
String
code
=
cls
.
getCode
().
toString
();
assertThat
(
code
,
containsOne
(
"p
rivate
static final URL a;"
));
assertThat
(
code
,
containsOne
(
"p
ublic
static final URL a;"
));
assertThat
(
code
,
containsOne
(
"a = new URL(\"http://www.example.com/\");"
));
assertThat
(
code
,
containsLines
(
2
,
"try {"
,
...
...
@@ -82,6 +82,6 @@ public class TestFieldInitInTryCatch extends IntegrationTest {
ClassNode
cls
=
getClassNode
(
TestCls3
.
class
);
String
code
=
cls
.
getCode
().
toString
();
assertThat
(
code
,
containsOne
(
"p
rivate
static final String[] a = new String[]{\"a\"};"
));
assertThat
(
code
,
containsOne
(
"p
ublic
static final String[] a = new String[]{\"a\"};"
));
}
}
jadx-core/src/test/java/jadx/tests/integration/others/TestIfInTry.java
View file @
207ce6cb
...
...
@@ -15,7 +15,7 @@ import static org.hamcrest.MatcherAssert.assertThat;
public
class
TestIfInTry
extends
IntegrationTest
{
public
static
class
TestCls
{
p
rivate
File
dir
;
p
ublic
File
dir
;
public
int
test
()
{
try
{
...
...
jadx-core/src/test/java/jadx/tests/integration/others/TestIfTryInCatch.java
View file @
207ce6cb
...
...
@@ -12,7 +12,7 @@ import static org.hamcrest.MatcherAssert.assertThat;
public
class
TestIfTryInCatch
extends
IntegrationTest
{
public
static
class
TestCls
{
p
rivate
Exception
exception
;
p
ublic
Exception
exception
;
private
java
.
lang
.
Object
data
;
public
java
.
lang
.
Object
test
(
final
Object
obj
)
{
...
...
jadx-core/src/test/java/jadx/tests/integration/others/TestIssue13b.java
View file @
207ce6cb
...
...
@@ -22,9 +22,9 @@ public class TestIssue13b extends IntegrationTest {
private
static
final
String
PROPERTIES_FILE
=
""
;
private
static
final
String
TAG
=
""
;
private
final
CountDownLatch
mInitializedLatch
=
new
CountDownLatch
(
1
);
p
rivate
int
mC2KServerPort
=
0
;
p
ublic
int
mC2KServerPort
=
0
;
private
String
mSuplServerHost
=
""
;
p
rivate
int
mSuplServerPort
=
0
;
p
ublic
int
mSuplServerPort
=
0
;
private
String
mC2KServerHost
=
""
;
public
TestCls
()
{
...
...
jadx-core/src/test/java/jadx/tests/integration/others/TestLoopInTry2.java
View file @
207ce6cb
...
...
@@ -8,7 +8,6 @@ import com.android.dx.io.instructions.ShortArrayCodeInput;
import
org.junit.jupiter.api.Test
;
import
jadx.core.dex.nodes.ClassNode
;
import
jadx.core.dex.nodes.DexNode
;
import
jadx.core.dex.nodes.MethodNode
;
import
jadx.core.utils.exceptions.DecodeException
;
import
jadx.tests.api.IntegrationTest
;
...
...
@@ -20,8 +19,7 @@ public class TestLoopInTry2 extends IntegrationTest {
public
static
class
TestCls
{
private
MethodNode
method
;
private
DexNode
dex
;
private
DecodedInstruction
[]
insnArr
;
public
DecodedInstruction
[]
insnArr
;
public
void
test
(
Code
mthCode
)
throws
DecodeException
{
short
[]
encodedInstructions
=
mthCode
.
getInstructions
();
...
...
jadx-core/src/test/java/jadx/tests/integration/synchronize/TestSynchronized2.java
View file @
207ce6cb
...
...
@@ -13,6 +13,7 @@ import static org.hamcrest.MatcherAssert.assertThat;
public
class
TestSynchronized2
extends
IntegrationTest
{
public
static
class
TestCls
{
@SuppressWarnings
(
"unused"
)
private
static
synchronized
boolean
test
(
Object
obj
)
{
return
obj
.
toString
()
!=
null
;
}
...
...
jadx-core/src/test/java/jadx/tests/integration/trycatch/TestNestedTryCatch.java
View file @
207ce6cb
...
...
@@ -12,7 +12,7 @@ import static org.hamcrest.MatcherAssert.assertThat;
public
class
TestNestedTryCatch
extends
IntegrationTest
{
public
static
class
TestCls
{
p
rivate
void
f
()
{
p
ublic
void
f
()
{
try
{
Thread
.
sleep
(
1
);
try
{
...
...
jadx-core/src/test/java/jadx/tests/integration/trycatch/TestTryCatch.java
View file @
207ce6cb
...
...
@@ -12,7 +12,7 @@ import static org.hamcrest.MatcherAssert.assertThat;
public
class
TestTryCatch
extends
IntegrationTest
{
public
static
class
TestCls
{
p
rivate
void
f
()
{
p
ublic
void
f
()
{
try
{
Thread
.
sleep
(
50
);
}
catch
(
InterruptedException
e
)
{
...
...
jadx-core/src/test/java/jadx/tests/integration/trycatch/TestTryCatch2.java
View file @
207ce6cb
...
...
@@ -13,7 +13,7 @@ public class TestTryCatch2 extends IntegrationTest {
public
static
class
TestCls
{
private
final
static
Object
obj
=
new
Object
();
p
rivate
static
boolean
test
()
{
p
ublic
static
boolean
test
()
{
try
{
synchronized
(
obj
)
{
obj
.
wait
(
5
);
...
...
jadx-core/src/test/java/jadx/tests/integration/trycatch/TestTryCatch4.java
View file @
207ce6cb
...
...
@@ -16,7 +16,8 @@ import static org.hamcrest.MatcherAssert.assertThat;
public
class
TestTryCatch4
extends
IntegrationTest
{
public
static
class
TestCls
{
private
Object
test
(
Object
obj
)
{
@SuppressWarnings
({
"resource"
,
"unused"
})
public
Object
test
(
Object
obj
)
{
FileOutputStream
output
=
null
;
try
{
output
=
new
FileOutputStream
(
new
File
(
"f"
));
...
...
jadx-core/src/test/java/jadx/tests/integration/trycatch/TestTryCatch7.java
View file @
207ce6cb
...
...
@@ -11,7 +11,7 @@ import static org.hamcrest.MatcherAssert.assertThat;
public
class
TestTryCatch7
extends
IntegrationTest
{
public
static
class
TestCls
{
p
rivate
Exception
test
()
{
p
ublic
Exception
test
()
{
Exception
e
=
new
Exception
();
try
{
Thread
.
sleep
(
50
);
...
...
jadx-core/src/test/java/jadx/tests/integration/trycatch/TestTryCatchFinally5.java
View file @
207ce6cb
...
...
@@ -15,7 +15,7 @@ import static org.hamcrest.MatcherAssert.assertThat;
public
class
TestTryCatchFinally5
extends
IntegrationTest
{
public
static
class
TestCls
{
p
rivate
<
E
>
List
<
E
>
test
(
A
a
,
B
<
E
>
b
)
{
p
ublic
<
E
>
List
<
E
>
test
(
A
a
,
B
<
E
>
b
)
{
C
c
=
p
(
a
);
if
(
c
==
null
)
{
return
null
;
...
...
jadx-core/src/test/java/jadx/tests/integration/trycatch/TestTryCatchFinally8.java
View file @
207ce6cb
...
...
@@ -16,7 +16,7 @@ import static org.hamcrest.MatcherAssert.assertThat;
public
class
TestTryCatchFinally8
extends
IntegrationTest
{
public
static
class
TestCls
{
p
rivate
Object
test
(
Object
obj
)
{
p
ublic
Object
test
(
Object
obj
)
{
File
file
=
new
File
(
"r"
);
FileOutputStream
output
=
null
;
try
{
...
...
jadx-core/src/test/java/jadx/tests/integration/types/TestGenerics.java
View file @
207ce6cb
...
...
@@ -11,7 +11,7 @@ import static org.hamcrest.MatcherAssert.assertThat;
public
class
TestGenerics
extends
IntegrationTest
{
public
static
class
TestCls
<
T
>
{
p
rivate
T
data
;
p
ublic
T
data
;
public
TestCls
<
T
>
data
(
T
t
)
{
this
.
data
=
t
;
...
...
jadx-core/src/test/java/jadx/tests/integration/types/TestTypeInheritance.java
View file @
207ce6cb
...
...
@@ -25,7 +25,7 @@ public class TestTypeInheritance extends IntegrationTest {
public
void
b
()
{}
}
p
rivate
static
void
test
(
boolean
z
)
{
p
ublic
static
void
test
(
boolean
z
)
{
IBase
impl
;
if
(
z
)
{
impl
=
new
A
();
...
...
jadx-core/src/test/java/jadx/tests/integration/types/TestTypeResolver2.java
View file @
207ce6cb
...
...
@@ -14,7 +14,7 @@ public class TestTypeResolver2 extends IntegrationTest {
public
static
class
TestCls
{
p
rivate
static
boolean
test
(
Object
obj
)
throws
IOException
{
p
ublic
static
boolean
test
(
Object
obj
)
throws
IOException
{
if
(
obj
!=
null
)
{
return
true
;
}
...
...
jadx-core/src/test/java/jadx/tests/integration/types/TestTypeResolver6.java
View file @
207ce6cb
...
...
@@ -11,7 +11,7 @@ import static org.hamcrest.MatcherAssert.assertThat;
public
class
TestTypeResolver6
extends
IntegrationTest
{
public
static
class
TestCls
{
p
rivate
final
Object
obj
;
p
ublic
final
Object
obj
;
public
TestCls
(
boolean
b
)
{
this
.
obj
=
b
?
this
:
makeObj
();
...
...
jadx-core/src/test/java/jadx/tests/integration/types/TestTypeResolver6a.java
View file @
207ce6cb
...
...
@@ -11,7 +11,7 @@ import static org.hamcrest.MatcherAssert.assertThat;
public
class
TestTypeResolver6a
extends
IntegrationTest
{
public
static
class
TestCls
implements
Runnable
{
p
rivate
final
Runnable
runnable
;
p
ublic
final
Runnable
runnable
;
public
TestCls
(
boolean
b
)
{
this
.
runnable
=
b
?
this
:
makeRunnable
();
...
...
jadx-core/src/test/java/jadx/tests/integration/usethis/TestDontInlineThis.java
View file @
207ce6cb
...
...
@@ -15,7 +15,7 @@ public class TestDontInlineThis extends IntegrationTest {
public
static
class
TestCls
{
public
int
field
=
new
Random
().
nextInt
();
p
rivate
TestCls
test
()
{
p
ublic
TestCls
test
()
{
TestCls
res
;
if
(
field
==
7
)
{
res
=
this
;
...
...
jadx-core/src/test/java/jadx/tests/integration/usethis/TestInlineThis.java
View file @
207ce6cb
...
...
@@ -15,7 +15,7 @@ public class TestInlineThis extends IntegrationTest {
public
static
class
TestCls
{
public
int
field
;
p
rivate
void
test
()
{
p
ublic
void
test
()
{
TestCls
something
=
this
;
something
.
method
();
something
.
field
=
123
;
...
...
jadx-core/src/test/java/jadx/tests/integration/usethis/TestInlineThis2.java
View file @
207ce6cb
...
...
@@ -17,7 +17,7 @@ public class TestInlineThis2 extends IntegrationTest {
public
static
class
TestCls
{
public
int
field
;
p
rivate
void
test
()
{
p
ublic
void
test
()
{
TestCls
thisVar
=
this
;
if
(
Objects
.
isNull
(
thisVar
))
{
System
.
out
.
println
(
"null"
);
...
...
jadx-core/src/test/java/jadx/tests/integration/variables/TestVariables4.java
View file @
207ce6cb
...
...
@@ -14,7 +14,7 @@ import static org.hamcrest.MatcherAssert.assertThat;
public
class
TestVariables4
extends
IntegrationTest
{
public
static
class
TestCls
{
p
rivate
static
boolean
runTest
(
String
clsName
)
{
p
ublic
static
boolean
runTest
(
String
clsName
)
{
try
{
boolean
pass
=
false
;
String
msg
=
null
;
...
...
jadx-samples/src/main/java/jadx/samples/TestGenerics.java
View file @
207ce6cb
...
...
@@ -13,7 +13,7 @@ public class TestGenerics extends AbstractTest {
public
Class
<?>[]
classes
;
public
interface
MyComparable
<
T
>
{
public
int
compareTo
(
T
o
);
int
compareTo
(
T
o
);
}
public
static
class
GenericClass
implements
MyComparable
<
String
>
{
...
...
@@ -38,9 +38,9 @@ public class TestGenerics extends AbstractTest {
public
static
Box
<
Integer
>
integerBox
=
new
Box
<>();
public
interface
Pair
<
K
,
LongGenericType
>
{
public
K
getKey
();
K
getKey
();
public
LongGenericType
getValue
();
LongGenericType
getValue
();
}
public
static
class
OrderedPair
<
K
,
V
>
implements
Pair
<
K
,
V
>
{
...
...
@@ -133,7 +133,7 @@ public class TestGenerics extends AbstractTest {
public
class
Node
<
T
extends
Comparable
<
T
>>
{
private
final
T
data
;
p
rivate
final
Node
<
T
>
next
;
p
ublic
final
Node
<
T
>
next
;
public
Node
(
T
data
,
Node
<
T
>
next
)
{
this
.
data
=
data
;
...
...
@@ -145,8 +145,8 @@ public class TestGenerics extends AbstractTest {
}
}
p
rivate
class
TestConstructor
implements
Enumeration
<
String
>
{
p
rivate
final
TestGenerics
a
;
p
ublic
class
TestConstructor
implements
Enumeration
<
String
>
{
p
ublic
final
TestGenerics
a
;
TestConstructor
(
TestGenerics
a
)
{
this
.
a
=
a
;
...
...
jadx-samples/src/main/java/jadx/samples/TestTypeResolver.java
View file @
207ce6cb
...
...
@@ -2,7 +2,7 @@ package jadx.samples;
public
class
TestTypeResolver
extends
AbstractTest
{
p
rivate
final
int
f1
;
p
ublic
final
int
f1
;
public
TestTypeResolver
()
{
this
.
f1
=
2
;
...
...
jadx-samples/src/main/java/jadx/samples/TestTypeResolver2.java
View file @
207ce6cb
...
...
@@ -21,11 +21,11 @@ public class TestTypeResolver2 extends AbstractTest {
}
}
p
rivate
static
void
doPrint
(
String
s1
)
{
p
ublic
static
void
doPrint
(
String
s1
)
{
fail
();
}
p
rivate
static
void
doPrint
(
Integer
s1
)
{
p
ublic
static
void
doPrint
(
Integer
s1
)
{
fail
();
}
...
...
@@ -43,6 +43,6 @@ public class TestTypeResolver2 extends AbstractTest {
}
public
static
void
main
(
String
[]
args
)
throws
Exception
{
(
new
TestTypeResolver2
()
).
testRun
();
new
TestTypeResolver2
(
).
testRun
();
}
}
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