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
fc58022d
Commit
fc58022d
authored
Jul 13, 2019
by
Skylot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
misc: show shorter exception stacktrace in code
parent
ed9fe8a5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
+8
-10
Utils.java
jadx-core/src/main/java/jadx/core/utils/Utils.java
+8
-10
No files found.
jadx-core/src/main/java/jadx/core/utils/Utils.java
View file @
fc58022d
...
...
@@ -17,10 +17,12 @@ import org.jetbrains.annotations.Nullable;
import
jadx.api.JadxDecompiler
;
import
jadx.core.codegen.CodeWriter
;
import
jadx.core.dex.visitors.DepthTraversal
;
public
class
Utils
{
public
static
final
String
JADX_API_PACKAGE
=
JadxDecompiler
.
class
.
getPackage
().
getName
();
private
static
final
String
JADX_API_PACKAGE
=
JadxDecompiler
.
class
.
getPackage
().
getName
();
private
static
final
String
STACKTRACE_STOP_CLS_NAME
=
DepthTraversal
.
class
.
getName
();
private
Utils
()
{
}
...
...
@@ -140,20 +142,16 @@ public class Utils {
private
static
void
filter
(
Throwable
th
)
{
StackTraceElement
[]
stackTrace
=
th
.
getStackTrace
();
int
cutIndex
=
-
1
;
int
length
=
stackTrace
.
length
;
for
(
int
i
=
0
;
i
<
length
;
i
++)
{
StackTraceElement
stackTraceElement
=
stackTrace
[
i
];
if
(
stackTraceElement
.
getClassName
().
startsWith
(
JADX_API_PACKAGE
))
{
cutIndex
=
i
;
}
else
if
(
cutIndex
>
0
)
{
cutIndex
=
i
;
break
;
String
clsName
=
stackTraceElement
.
getClassName
();
if
(
clsName
.
equals
(
STACKTRACE_STOP_CLS_NAME
)
||
clsName
.
startsWith
(
JADX_API_PACKAGE
)
)
{
th
.
setStackTrace
(
Arrays
.
copyOfRange
(
stackTrace
,
0
,
i
))
;
return
;
}
}
if
(
cutIndex
>
0
&&
cutIndex
<
length
)
{
th
.
setStackTrace
(
Arrays
.
copyOfRange
(
stackTrace
,
0
,
cutIndex
));
}
}
public
static
<
T
,
R
>
List
<
R
>
collectionMap
(
Collection
<
T
>
list
,
Function
<
T
,
R
>
mapFunc
)
{
...
...
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