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
9afacf72
Commit
9afacf72
authored
Mar 25, 2015
by
Skylot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: move 'escape' method to string utils
parent
78a7e65a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
37 deletions
+38
-37
NameGen.java
jadx-core/src/main/java/jadx/core/codegen/NameGen.java
+2
-2
DotGraphVisitor.java
...src/main/java/jadx/core/dex/visitors/DotGraphVisitor.java
+2
-1
StringUtils.java
jadx-core/src/main/java/jadx/core/utils/StringUtils.java
+34
-0
Utils.java
jadx-core/src/main/java/jadx/core/utils/Utils.java
+0
-34
No files found.
jadx-core/src/main/java/jadx/core/codegen/NameGen.java
View file @
9afacf72
...
...
@@ -15,7 +15,7 @@ import jadx.core.dex.instructions.args.SSAVar;
import
jadx.core.dex.instructions.mods.ConstructorInsn
;
import
jadx.core.dex.nodes.InsnNode
;
import
jadx.core.dex.nodes.MethodNode
;
import
jadx.core.utils.Utils
;
import
jadx.core.utils.
String
Utils
;
import
java.util.HashMap
;
import
java.util.HashSet
;
...
...
@@ -165,7 +165,7 @@ public class NameGen {
return
vName
;
}
}
return
Utils
.
escape
(
type
.
toString
());
return
String
Utils
.
escape
(
type
.
toString
());
}
private
static
String
fromName
(
String
name
)
{
...
...
jadx-core/src/main/java/jadx/core/dex/visitors/DotGraphVisitor.java
View file @
9afacf72
...
...
@@ -15,6 +15,7 @@ import jadx.core.dex.trycatch.ExceptionHandler;
import
jadx.core.utils.BlockUtils
;
import
jadx.core.utils.InsnUtils
;
import
jadx.core.utils.RegionUtils
;
import
jadx.core.utils.StringUtils
;
import
jadx.core.utils.Utils
;
import
java.io.File
;
...
...
@@ -100,7 +101,7 @@ public class DotGraphVisitor extends AbstractVisitor {
dot
.
startLine
(
'}'
);
dot
.
startLine
();
String
fileName
=
Utils
.
escape
(
mth
.
getMethodInfo
().
getShortId
())
String
fileName
=
String
Utils
.
escape
(
mth
.
getMethodInfo
().
getShortId
())
+
(
useRegions
?
".regions"
:
""
)
+
(
rawInsn
?
".raw"
:
""
)
+
".dot"
;
...
...
jadx-core/src/main/java/jadx/core/utils/StringUtils.java
View file @
9afacf72
...
...
@@ -61,4 +61,38 @@ public class StringUtils {
break
;
}
}
public
static
String
escape
(
String
str
)
{
int
len
=
str
.
length
();
StringBuilder
sb
=
new
StringBuilder
(
len
);
for
(
int
i
=
0
;
i
<
len
;
i
++)
{
char
c
=
str
.
charAt
(
i
);
switch
(
c
)
{
case
'.'
:
case
'/'
:
case
';'
:
case
'$'
:
case
' '
:
case
','
:
case
'<'
:
sb
.
append
(
'_'
);
break
;
case
'['
:
sb
.
append
(
'A'
);
break
;
case
']'
:
case
'>'
:
case
'?'
:
case
'*'
:
break
;
default
:
sb
.
append
(
c
);
break
;
}
}
return
sb
.
toString
();
}
}
jadx-core/src/main/java/jadx/core/utils/Utils.java
View file @
9afacf72
...
...
@@ -26,40 +26,6 @@ public class Utils {
return
'L'
+
obj
.
replace
(
'.'
,
'/'
)
+
';'
;
}
public
static
String
escape
(
String
str
)
{
int
len
=
str
.
length
();
StringBuilder
sb
=
new
StringBuilder
(
len
);
for
(
int
i
=
0
;
i
<
len
;
i
++)
{
char
c
=
str
.
charAt
(
i
);
switch
(
c
)
{
case
'.'
:
case
'/'
:
case
';'
:
case
'$'
:
case
' '
:
case
','
:
case
'<'
:
sb
.
append
(
'_'
);
break
;
case
'['
:
sb
.
append
(
'A'
);
break
;
case
']'
:
case
'>'
:
case
'?'
:
case
'*'
:
break
;
default
:
sb
.
append
(
c
);
break
;
}
}
return
sb
.
toString
();
}
public
static
String
listToString
(
Iterable
<?>
list
)
{
if
(
list
==
null
)
{
return
""
;
...
...
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