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
554e119e
Commit
554e119e
authored
Jun 15, 2019
by
Skylot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: don't rename constructors
parent
aad70c71
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
7 deletions
+13
-7
RenameVisitor.java
...e/src/main/java/jadx/core/dex/visitors/RenameVisitor.java
+12
-6
TestDuplicatedNames.java
...ava/jadx/tests/integration/names/TestDuplicatedNames.java
+1
-1
No files found.
jadx-core/src/main/java/jadx/core/dex/visitors/RenameVisitor.java
View file @
554e119e
package
jadx
.
core
.
dex
.
visitors
;
import
java.nio.file.Path
;
import
java.util.ArrayList
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Set
;
...
...
@@ -152,7 +153,14 @@ public class RenameVisitor extends AbstractVisitor {
}
private
static
void
checkMethods
(
Deobfuscator
deobfuscator
,
ClassNode
cls
,
JadxArgs
args
)
{
for
(
MethodNode
mth
:
cls
.
getMethods
())
{
List
<
MethodNode
>
methods
=
new
ArrayList
<>(
cls
.
getMethods
().
size
());
for
(
MethodNode
method
:
cls
.
getMethods
())
{
if
(!
method
.
getAccessFlags
().
isConstructor
())
{
methods
.
add
(
method
);
}
}
for
(
MethodNode
mth
:
methods
)
{
String
alias
=
mth
.
getAlias
();
boolean
notValid
=
args
.
isRenameValid
()
&&
!
NameMapper
.
isValidIdentifier
(
alias
);
...
...
@@ -162,12 +170,10 @@ public class RenameVisitor extends AbstractVisitor {
mth
.
addAttr
(
new
RenameReasonAttr
(
mth
,
notValid
,
notPrintable
));
}
}
Set
<
String
>
names
=
new
HashSet
<>();
for
(
MethodNode
mth
:
cls
.
getMethods
()
)
{
Set
<
String
>
names
=
new
HashSet
<>(
methods
.
size
()
);
for
(
MethodNode
mth
:
methods
)
{
AccessInfo
accessFlags
=
mth
.
getAccessFlags
();
if
(
accessFlags
.
isConstructor
()
||
accessFlags
.
isBridge
()
||
accessFlags
.
isSynthetic
()
if
(
accessFlags
.
isBridge
()
||
accessFlags
.
isSynthetic
()
||
mth
.
contains
(
AFlag
.
DONT_GENERATE
)
/* this flag not set yet */
)
{
continue
;
}
...
...
jadx-core/src/test/java/jadx/tests/integration/names/TestDuplicatedNames.java
View file @
554e119e
...
...
@@ -50,6 +50,6 @@ public class TestDuplicatedNames extends SmaliTest {
assertThat
(
code
,
containsOne
(
"this.f0fieldName"
));
assertThat
(
code
,
containsOne
(
"public Object run() {"
));
assertThat
(
code
,
containsOne
(
"public String m
1
run() {"
));
assertThat
(
code
,
containsOne
(
"public String m
0
run() {"
));
}
}
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