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
1bb53329
Commit
1bb53329
authored
Mar 26, 2019
by
Skylot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: use alias as a base for class rename if file system is case sensitive (#474)
parent
e026345a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
9 deletions
+13
-9
RenameVisitor.java
...e/src/main/java/jadx/core/dex/visitors/RenameVisitor.java
+13
-9
No files found.
jadx-core/src/main/java/jadx/core/dex/visitors/RenameVisitor.java
View file @
1bb53329
...
...
@@ -50,19 +50,23 @@ public class RenameVisitor extends AbstractVisitor {
}
private
void
checkClasses
(
RootNode
root
,
boolean
caseSensitive
)
{
Set
<
String
>
clsNames
=
new
HashSet
<>(
);
for
(
ClassNode
cls
:
root
.
getClasses
(
true
)
)
{
List
<
ClassNode
>
classes
=
root
.
getClasses
(
true
);
for
(
ClassNode
cls
:
classes
)
{
checkClassName
(
cls
);
checkFields
(
cls
);
checkMethods
(
cls
);
if
(!
caseSensitive
)
{
ClassInfo
classInfo
=
cls
.
getClassInfo
();
String
clsFileName
=
classInfo
.
getAlias
().
getFullPath
();
if
(!
clsNames
.
add
(
clsFileName
.
toLowerCase
()))
{
}
if
(!
caseSensitive
)
{
Set
<
String
>
clsFullPaths
=
new
HashSet
<>(
classes
.
size
());
for
(
ClassNode
cls
:
classes
)
{
ClassInfo
clsInfo
=
cls
.
getClassInfo
();
ClassInfo
aliasClsInfo
=
clsInfo
.
getAlias
();
if
(!
clsFullPaths
.
add
(
aliasClsInfo
.
getFullPath
().
toLowerCase
()))
{
String
newShortName
=
deobfuscator
.
getClsAlias
(
cls
);
String
newFullName
=
classInfo
.
makeFullClsName
(
newShortName
,
true
);
classInfo
.
rename
(
cls
.
root
(),
newFullName
);
clsNames
.
add
(
classInfo
.
getAlias
().
getFullPath
().
toLowerCase
());
String
newFullName
=
aliasClsInfo
.
makeFullClsName
(
newShortName
,
true
);
clsInfo
.
rename
(
root
,
newFullName
);
clsFullPaths
.
add
(
clsInfo
.
getAlias
().
getFullPath
().
toLowerCase
());
}
}
}
...
...
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