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
28bcad20
Commit
28bcad20
authored
Feb 26, 2019
by
Skylot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: resolve deprecation warning for TypeGen.literalToString method
parent
16d8d41b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
8 deletions
+6
-8
TypeGen.java
jadx-core/src/main/java/jadx/core/codegen/TypeGen.java
+1
-7
LiteralArg.java
...main/java/jadx/core/dex/instructions/args/LiteralArg.java
+5
-1
No files found.
jadx-core/src/main/java/jadx/core/codegen/TypeGen.java
View file @
28bcad20
...
...
@@ -3,7 +3,6 @@ package jadx.core.codegen;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
jadx.api.JadxArgs
;
import
jadx.core.deobf.NameMapper
;
import
jadx.core.dex.instructions.args.ArgType
;
import
jadx.core.dex.instructions.args.PrimitiveType
;
...
...
@@ -38,12 +37,7 @@ public class TypeGen {
return
literalToString
(
lit
,
type
,
dexNode
.
root
().
getStringUtils
());
}
@Deprecated
public
static
String
literalToString
(
long
lit
,
ArgType
type
)
{
return
literalToString
(
lit
,
type
,
new
StringUtils
(
new
JadxArgs
()));
}
private
static
String
literalToString
(
long
lit
,
ArgType
type
,
StringUtils
stringUtils
)
{
public
static
String
literalToString
(
long
lit
,
ArgType
type
,
StringUtils
stringUtils
)
{
if
(
type
==
null
||
!
type
.
isTypeKnown
())
{
String
n
=
Long
.
toString
(
lit
);
if
(
Math
.
abs
(
lit
)
>
100
)
{
...
...
jadx-core/src/main/java/jadx/core/dex/instructions/args/LiteralArg.java
View file @
28bcad20
package
jadx
.
core
.
dex
.
instructions
.
args
;
import
jadx.api.JadxArgs
;
import
jadx.core.codegen.TypeGen
;
import
jadx.core.utils.StringUtils
;
import
jadx.core.utils.exceptions.JadxRuntimeException
;
public
final
class
LiteralArg
extends
InsnArg
{
...
...
@@ -63,10 +65,12 @@ public final class LiteralArg extends InsnArg {
return
literal
==
that
.
literal
&&
getType
().
equals
(
that
.
getType
());
}
private
static
final
StringUtils
DEF_STRING_UTILS
=
new
StringUtils
(
new
JadxArgs
());
@Override
public
String
toString
()
{
try
{
String
value
=
TypeGen
.
literalToString
(
literal
,
getType
());
String
value
=
TypeGen
.
literalToString
(
literal
,
getType
()
,
DEF_STRING_UTILS
);
if
(
getType
().
equals
(
ArgType
.
BOOLEAN
)
&&
(
value
.
equals
(
"true"
)
||
value
.
equals
(
"false"
)))
{
return
value
;
}
...
...
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