Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
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
3bd11fa5
Commit
3bd11fa5
authored
Mar 28, 2013
by
Skylot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve loops parsing
parent
772c664d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
10 deletions
+23
-10
MarkTryCatchRegions.java
...n/java/jadx/dex/visitors/regions/MarkTryCatchRegions.java
+3
-0
RegionMaker.java
src/main/java/jadx/dex/visitors/regions/RegionMaker.java
+20
-10
No files found.
src/main/java/jadx/dex/visitors/regions/MarkTryCatchRegions.java
View file @
3bd11fa5
...
@@ -92,6 +92,9 @@ public class MarkTryCatchRegions extends AbstractRegionVisitor {
...
@@ -92,6 +92,9 @@ public class MarkTryCatchRegions extends AbstractRegionVisitor {
if
(
tryBlocksMap
.
isEmpty
())
if
(
tryBlocksMap
.
isEmpty
())
return
;
return
;
if
(!(
region
instanceof
Region
))
return
;
// search dominator blocks in this region (don't need to go deeper)
// search dominator blocks in this region (don't need to go deeper)
for
(
BlockNode
dominator
:
tryBlocksMap
.
keySet
())
{
for
(
BlockNode
dominator
:
tryBlocksMap
.
keySet
())
{
if
(
region
.
getSubBlocks
().
contains
(
dominator
))
{
if
(
region
.
getSubBlocks
().
contains
(
dominator
))
{
...
...
src/main/java/jadx/dex/visitors/regions/RegionMaker.java
View file @
3bd11fa5
...
@@ -147,20 +147,30 @@ public class RegionMaker {
...
@@ -147,20 +147,30 @@ public class RegionMaker {
InsnNode
insn
=
exit
.
getInstructions
().
get
(
0
);
InsnNode
insn
=
exit
.
getInstructions
().
get
(
0
);
if
(
insn
.
getType
()
==
InsnType
.
IF
)
{
if
(
insn
.
getType
()
==
InsnType
.
IF
)
{
boolean
found
=
true
;
ifnode
=
(
IfNode
)
insn
;
ifnode
=
(
IfNode
)
insn
;
condBlock
=
exit
;
condBlock
=
exit
;
loopRegion
=
new
LoopRegion
(
curRegion
,
condBlock
,
condBlock
==
loop
.
getEnd
());
loopRegion
=
new
LoopRegion
(
curRegion
,
condBlock
,
condBlock
==
loop
.
getEnd
());
if
(!
loopRegion
.
isConditionAtEnd
()
&&
condBlock
!=
loop
.
getStart
()
&&
condBlock
.
getPredecessors
().
contains
(
loopStart
))
{
if
(
loopRegion
.
isConditionAtEnd
())
{
// TODO: add some checks
}
else
{
if
(
condBlock
!=
loop
.
getStart
())
{
if
(
condBlock
.
getPredecessors
().
contains
(
loopStart
))
{
loopRegion
.
setPreCondition
(
loopStart
);
loopRegion
.
setPreCondition
(
loopStart
);
// if we can't merge pre-condition this is not correct header
// if we can't merge pre-condition this is not correct header
if
(!
loopRegion
.
checkPreCondition
())
{
found
=
loopRegion
.
checkPreCondition
();
}
else
{
found
=
false
;
}
}
}
if
(!
found
)
{
ifnode
=
null
;
ifnode
=
null
;
loopRegion
=
null
;
loopRegion
=
null
;
condBlock
=
null
;
// try another exit
// try another exit
continue
;
}
else
}
}
break
;
break
;
}
}
}
}
...
...
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