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
2963bb3f
Commit
2963bb3f
authored
Jul 28, 2014
by
Skylot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: fix issues reported by coverity
parent
09a6ceac
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
12 deletions
+38
-12
RegionMaker.java
...main/java/jadx/core/dex/visitors/regions/RegionMaker.java
+8
-3
AsmUtils.java
jadx-core/src/main/java/jadx/core/utils/AsmUtils.java
+12
-3
InputFile.java
jadx-core/src/main/java/jadx/core/utils/files/InputFile.java
+18
-6
No files found.
jadx-core/src/main/java/jadx/core/dex/visitors/regions/RegionMaker.java
View file @
2963bb3f
...
...
@@ -338,18 +338,23 @@ public class RegionMaker {
InstructionRemover
.
unbindInsn
(
mth
,
exitInsn
);
}
block
=
getNextBlock
(
block
);
BlockNode
body
=
getNextBlock
(
block
);
if
(
body
==
null
)
{
mth
.
add
(
AFlag
.
INCONSISTENT_CODE
);
LOG
.
warn
(
"Unexpected end of synchronized block"
);
return
null
;
}
BlockNode
exit
;
if
(
exits
.
size
()
==
1
)
{
exit
=
getNextBlock
(
exits
.
iterator
().
next
());
}
else
{
cacheSet
.
clear
();
exit
=
traverseMonitorExitsCross
(
b
lock
,
exits
,
cacheSet
);
exit
=
traverseMonitorExitsCross
(
b
ody
,
exits
,
cacheSet
);
}
stack
.
push
(
synchRegion
);
stack
.
addExit
(
exit
);
synchRegion
.
getSubBlocks
().
add
(
makeRegion
(
b
lock
,
stack
));
synchRegion
.
getSubBlocks
().
add
(
makeRegion
(
b
ody
,
stack
));
stack
.
pop
();
return
exit
;
}
...
...
jadx-core/src/main/java/jadx/core/utils/AsmUtils.java
View file @
2963bb3f
...
...
@@ -12,9 +12,18 @@ public class AsmUtils {
}
public
static
String
getNameFromClassFile
(
File
file
)
throws
IOException
{
FileInputStream
in
=
new
FileInputStream
(
file
);
ClassReader
classReader
=
new
ClassReader
(
in
);
return
classReader
.
getClassName
();
String
className
=
null
;
FileInputStream
in
=
null
;
try
{
in
=
new
FileInputStream
(
file
);
ClassReader
classReader
=
new
ClassReader
(
in
);
className
=
classReader
.
getClassName
();
}
finally
{
if
(
in
!=
null
)
{
in
.
close
();
}
}
return
className
;
}
}
jadx-core/src/main/java/jadx/core/utils/files/InputFile.java
View file @
2963bb3f
...
...
@@ -102,12 +102,24 @@ public class InputFile {
private
static
Dex
loadFromClassFile
(
File
file
)
throws
IOException
,
DecodeException
{
File
outFile
=
File
.
createTempFile
(
"jadx-tmp-"
,
System
.
nanoTime
()
+
".jar"
);
outFile
.
deleteOnExit
();
FileOutputStream
out
=
new
FileOutputStream
(
outFile
);
JarOutputStream
jo
=
new
JarOutputStream
(
out
);
String
clsName
=
AsmUtils
.
getNameFromClassFile
(
file
);
FileUtils
.
addFileToJar
(
jo
,
file
,
clsName
+
".class"
);
jo
.
close
();
out
.
close
();
FileOutputStream
out
=
null
;
JarOutputStream
jo
=
null
;
try
{
out
=
new
FileOutputStream
(
outFile
);
jo
=
new
JarOutputStream
(
out
);
String
clsName
=
AsmUtils
.
getNameFromClassFile
(
file
);
if
(
clsName
==
null
)
{
throw
new
IOException
(
"Can't read class name from file: "
+
file
);
}
FileUtils
.
addFileToJar
(
jo
,
file
,
clsName
+
".class"
);
}
finally
{
if
(
jo
!=
null
)
{
jo
.
close
();
}
if
(
out
!=
null
)
{
out
.
close
();
}
}
return
loadFromJar
(
outFile
);
}
...
...
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