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
66aa2f8f
Commit
66aa2f8f
authored
Mar 09, 2015
by
Skylot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix issues reported by coverity and code style
parent
99d831c4
Hide whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
64 additions
and
62 deletions
+64
-62
ResourceType.java
jadx-core/src/main/java/jadx/api/ResourceType.java
+1
-1
ResourcesLoader.java
jadx-core/src/main/java/jadx/api/ResourcesLoader.java
+1
-1
ConditionGen.java
jadx-core/src/main/java/jadx/core/codegen/ConditionGen.java
+1
-4
EnumMapAttr.java
...main/java/jadx/core/dex/attributes/nodes/EnumMapAttr.java
+2
-2
AccessInfo.java
jadx-core/src/main/java/jadx/core/dex/info/AccessInfo.java
+3
-3
MethodInfo.java
jadx-core/src/main/java/jadx/core/dex/info/MethodInfo.java
+3
-10
LiteralArg.java
...main/java/jadx/core/dex/instructions/args/LiteralArg.java
+1
-1
TypeImmutableArg.java
...ava/jadx/core/dex/instructions/args/TypeImmutableArg.java
+3
-1
ClassNode.java
jadx-core/src/main/java/jadx/core/dex/nodes/ClassNode.java
+1
-1
InsnNode.java
jadx-core/src/main/java/jadx/core/dex/nodes/InsnNode.java
+2
-1
MethodNode.java
jadx-core/src/main/java/jadx/core/dex/nodes/MethodNode.java
+3
-3
DebugInfoParser.java
...main/java/jadx/core/dex/nodes/parser/DebugInfoParser.java
+3
-3
CodeShrinker.java
...re/src/main/java/jadx/core/dex/visitors/CodeShrinker.java
+1
-1
SimplifyVisitor.java
...src/main/java/jadx/core/dex/visitors/SimplifyVisitor.java
+1
-1
BlockSplitter.java
...ava/jadx/core/dex/visitors/blocksmaker/BlockSplitter.java
+1
-1
LoopRegionVisitor.java
...ava/jadx/core/dex/visitors/regions/LoopRegionVisitor.java
+2
-2
RegionMaker.java
...main/java/jadx/core/dex/visitors/regions/RegionMaker.java
+2
-8
DebugUtils.java
jadx-core/src/main/java/jadx/core/utils/DebugUtils.java
+2
-2
RegionUtils.java
jadx-core/src/main/java/jadx/core/utils/RegionUtils.java
+1
-1
Utils.java
jadx-core/src/main/java/jadx/core/utils/Utils.java
+4
-1
BinaryXMLParser.java
...-core/src/main/java/jadx/core/xmlgen/BinaryXMLParser.java
+2
-2
CommonBinaryParser.java
...re/src/main/java/jadx/core/xmlgen/CommonBinaryParser.java
+1
-1
ManifestAttributes.java
...re/src/main/java/jadx/core/xmlgen/ManifestAttributes.java
+10
-3
ParserConstants.java
...-core/src/main/java/jadx/core/xmlgen/ParserConstants.java
+2
-2
ParserStream.java
jadx-core/src/main/java/jadx/core/xmlgen/ParserStream.java
+2
-2
ValuesParser.java
...re/src/main/java/jadx/core/xmlgen/entry/ValuesParser.java
+2
-2
ContentArea.java
jadx-gui/src/main/java/jadx/gui/ui/ContentArea.java
+7
-2
No files found.
jadx-core/src/main/java/jadx/api/ResourceType.java
View file @
66aa2f8f
...
...
@@ -10,7 +10,7 @@ public enum ResourceType {
LIB
(
".so"
),
UNKNOWN
;
private
String
[]
exts
;
private
final
String
[]
exts
;
ResourceType
(
String
...
exts
)
{
this
.
exts
=
exts
;
...
...
jadx-core/src/main/java/jadx/api/ResourcesLoader.java
View file @
66aa2f8f
...
...
@@ -28,7 +28,7 @@ public final class ResourcesLoader {
private
static
final
int
READ_BUFFER_SIZE
=
8
*
1024
;
private
static
final
int
LOAD_SIZE_LIMIT
=
10
*
1024
*
1024
;
private
JadxDecompiler
jadxRef
;
private
final
JadxDecompiler
jadxRef
;
ResourcesLoader
(
JadxDecompiler
jadxRef
)
{
this
.
jadxRef
=
jadxRef
;
...
...
jadx-core/src/main/java/jadx/core/codegen/ConditionGen.java
View file @
66aa2f8f
...
...
@@ -162,10 +162,7 @@ public class ConditionGen extends InsnGen {
if
(
condition
.
isCompare
())
{
return
false
;
}
if
(
condition
.
getMode
()
!=
Mode
.
NOT
)
{
return
true
;
}
return
false
;
return
condition
.
getMode
()
!=
Mode
.
NOT
;
}
private
static
boolean
isArgWrapNeeded
(
InsnArg
arg
)
{
...
...
jadx-core/src/main/java/jadx/core/dex/attributes/nodes/EnumMapAttr.java
View file @
66aa2f8f
...
...
@@ -10,7 +10,7 @@ import java.util.Map;
public
class
EnumMapAttr
implements
IAttribute
{
public
static
class
KeyValueMap
{
private
Map
<
Object
,
Object
>
map
=
new
HashMap
<
Object
,
Object
>();
private
final
Map
<
Object
,
Object
>
map
=
new
HashMap
<
Object
,
Object
>();
public
Object
get
(
Object
key
)
{
return
map
.
get
(
key
);
...
...
@@ -21,7 +21,7 @@ public class EnumMapAttr implements IAttribute {
}
}
private
Map
<
FieldNode
,
KeyValueMap
>
fieldsMap
=
new
HashMap
<
FieldNode
,
KeyValueMap
>();
private
final
Map
<
FieldNode
,
KeyValueMap
>
fieldsMap
=
new
HashMap
<
FieldNode
,
KeyValueMap
>();
public
KeyValueMap
getMap
(
FieldNode
field
)
{
return
fieldsMap
.
get
(
field
);
...
...
jadx-core/src/main/java/jadx/core/dex/info/AccessInfo.java
View file @
66aa2f8f
...
...
@@ -32,9 +32,9 @@ public class AccessInfo {
}
public
AccessInfo
getVisibility
()
{
int
f
=
(
accFlags
&
AccessFlags
.
ACC_PUBLIC
)
|
(
accFlags
&
AccessFlags
.
ACC_PROTECTED
)
|
(
accFlags
&
AccessFlags
.
ACC_PRIVATE
)
;
int
f
=
accFlags
&
AccessFlags
.
ACC_PUBLIC
|
accFlags
&
AccessFlags
.
ACC_PROTECTED
|
accFlags
&
AccessFlags
.
ACC_PRIVATE
;
return
new
AccessInfo
(
f
,
type
);
}
...
...
jadx-core/src/main/java/jadx/core/dex/info/MethodInfo.java
View file @
66aa2f8f
...
...
@@ -111,16 +111,9 @@ public final class MethodInfo {
return
false
;
}
MethodInfo
other
=
(
MethodInfo
)
obj
;
if
(!
shortId
.
equals
(
other
.
shortId
))
{
return
false
;
}
if
(!
retType
.
equals
(
other
.
retType
))
{
return
false
;
}
if
(!
declClass
.
equals
(
other
.
declClass
))
{
return
false
;
}
return
true
;
return
shortId
.
equals
(
other
.
shortId
)
&&
retType
.
equals
(
other
.
retType
)
&&
declClass
.
equals
(
other
.
declClass
);
}
@Override
...
...
jadx-core/src/main/java/jadx/core/dex/instructions/args/LiteralArg.java
View file @
66aa2f8f
...
...
@@ -47,7 +47,7 @@ public final class LiteralArg extends InsnArg {
@Override
public
int
hashCode
()
{
return
(
int
)
(
literal
^
(
literal
>>>
32
)
)
+
31
*
getType
().
hashCode
();
return
(
int
)
(
literal
^
literal
>>>
32
)
+
31
*
getType
().
hashCode
();
}
@Override
...
...
jadx-core/src/main/java/jadx/core/dex/instructions/args/TypeImmutableArg.java
View file @
66aa2f8f
package
jadx
.
core
.
dex
.
instructions
.
args
;
import
org.jetbrains.annotations.NotNull
;
public
class
TypeImmutableArg
extends
RegisterArg
{
private
boolean
isThis
;
...
...
@@ -36,7 +38,7 @@ public class TypeImmutableArg extends RegisterArg {
}
@Override
void
setSVar
(
SSAVar
sVar
)
{
void
setSVar
(
@NotNull
SSAVar
sVar
)
{
if
(
isThis
)
{
sVar
.
setName
(
"this"
);
}
...
...
jadx-core/src/main/java/jadx/core/dex/nodes/ClassNode.java
View file @
66aa2f8f
...
...
@@ -282,7 +282,7 @@ public class ClassNode extends LineAttrNode implements ILoadable {
field
=
cn
.
constFields
.
get
(
obj
);
}
while
(
field
==
null
&&
(
cn
.
clsInfo
.
getParentClass
()
!=
null
)
&&
cn
.
clsInfo
.
getParentClass
()
!=
null
&&
(
cn
=
dex
.
resolveClass
(
cn
.
clsInfo
.
getParentClass
()))
!=
null
);
if
(
field
==
null
&&
searchGlobal
)
{
...
...
jadx-core/src/main/java/jadx/core/dex/nodes/InsnNode.java
View file @
66aa2f8f
...
...
@@ -74,7 +74,8 @@ public class InsnNode extends LineAttrNode {
public
boolean
containsArg
(
RegisterArg
arg
)
{
for
(
InsnArg
a
:
arguments
)
{
if
(
a
==
arg
||
(
a
.
isRegister
()
&&
((
RegisterArg
)
a
).
getRegNum
()
==
arg
.
getRegNum
()))
{
if
(
a
==
arg
||
a
.
isRegister
()
&&
((
RegisterArg
)
a
).
getRegNum
()
==
arg
.
getRegNum
())
{
return
true
;
}
}
...
...
jadx-core/src/main/java/jadx/core/dex/nodes/MethodNode.java
View file @
66aa2f8f
...
...
@@ -75,8 +75,8 @@ public class MethodNode extends LineAttrNode implements ILoadable {
this
.
mthInfo
=
MethodInfo
.
fromDex
(
classNode
.
dex
(),
mthData
.
getMethodIndex
());
this
.
parentClass
=
classNode
;
this
.
accFlags
=
new
AccessInfo
(
mthData
.
getAccessFlags
(),
AFType
.
METHOD
);
this
.
noCode
=
(
mthData
.
getCodeOffset
()
==
0
)
;
this
.
methodData
=
(
noCode
?
null
:
mthData
)
;
this
.
noCode
=
mthData
.
getCodeOffset
()
==
0
;
this
.
methodData
=
noCode
?
null
:
mthData
;
}
@Override
...
...
@@ -527,7 +527,7 @@ public class MethodNode extends LineAttrNode implements ILoadable {
defaultArgCount
=
1
;
}
}
result
=
(
argsList
==
null
)
||
(
argsList
.
size
()
==
defaultArgCount
)
;
result
=
argsList
==
null
||
argsList
.
size
()
==
defaultArgCount
;
}
return
result
;
}
...
...
jadx-core/src/main/java/jadx/core/dex/nodes/parser/DebugInfoParser.java
View file @
66aa2f8f
...
...
@@ -149,7 +149,7 @@ public class DebugInfoParser {
int
adjustedOpcode
=
c
-
DBG_FIRST_SPECIAL
;
int
addrInc
=
adjustedOpcode
/
DBG_LINE_RANGE
;
addr
=
addrChange
(
addr
,
addrInc
,
line
);
line
+=
DBG_LINE_BASE
+
(
adjustedOpcode
%
DBG_LINE_RANGE
)
;
line
+=
DBG_LINE_BASE
+
adjustedOpcode
%
DBG_LINE_RANGE
;
setLine
(
addr
,
line
);
}
else
{
throw
new
DecodeException
(
"Unknown debug insn code: "
+
c
);
...
...
@@ -263,8 +263,8 @@ public class DebugInfoParser {
int
localStart
=
var
.
getStartAddr
();
int
localEnd
=
var
.
getEndAddr
();
boolean
isIntersected
=
!(
(
localEnd
<
ssaStart
)
||
(
ssaEnd
<
localStart
)
);
if
(
isIntersected
&&
(
ssaEnd
<=
localEnd
)
)
{
boolean
isIntersected
=
!(
localEnd
<
ssaStart
||
ssaEnd
<
localStart
);
if
(
isIntersected
&&
ssaEnd
<=
localEnd
)
{
mergeRequired
=
true
;
}
}
else
{
...
...
jadx-core/src/main/java/jadx/core/dex/visitors/CodeShrinker.java
View file @
66aa2f8f
...
...
@@ -210,7 +210,7 @@ public class CodeShrinker extends AbstractVisitor {
// }
SSAVar
sVar
=
arg
.
getSVar
();
// allow inline only one use arg or 'this'
if
(
sVar
==
null
||
(
sVar
.
getVariableUseCount
()
!=
1
&&
!
arg
.
isThis
()
))
{
if
(
sVar
==
null
||
sVar
.
getVariableUseCount
()
!=
1
&&
!
arg
.
isThis
(
))
{
continue
;
}
InsnNode
assignInsn
=
sVar
.
getAssign
().
getParentInsn
();
...
...
jadx-core/src/main/java/jadx/core/dex/visitors/SimplifyVisitor.java
View file @
66aa2f8f
...
...
@@ -249,7 +249,7 @@ public class SimplifyVisitor extends AbstractVisitor {
}
InsnNode
wrap
=
((
InsnWrapArg
)
arg
).
getWrapInsn
();
InsnType
wrapType
=
wrap
.
getType
();
if
(
(
wrapType
!=
InsnType
.
ARITH
&&
wrapType
!=
InsnType
.
STR_CONCAT
)
if
(
wrapType
!=
InsnType
.
ARITH
&&
wrapType
!=
InsnType
.
STR_CONCAT
||
!
wrap
.
getArg
(
0
).
isInsnWrap
())
{
return
null
;
}
...
...
jadx-core/src/main/java/jadx/core/dex/visitors/blocksmaker/BlockSplitter.java
View file @
66aa2f8f
...
...
@@ -194,7 +194,7 @@ public class BlockSplitter extends AbstractVisitor {
private
static
boolean
isDoWhile
(
Map
<
Integer
,
BlockNode
>
blocksMap
,
BlockNode
curBlock
,
InsnNode
insn
)
{
// split 'do-while' block (last instruction: 'if', target this block)
if
(
insn
.
getType
()
==
InsnType
.
IF
)
{
IfNode
ifs
=
(
IfNode
)
(
insn
)
;
IfNode
ifs
=
(
IfNode
)
insn
;
BlockNode
targetBlock
=
blocksMap
.
get
(
ifs
.
getTarget
());
if
(
targetBlock
==
curBlock
)
{
return
true
;
...
...
jadx-core/src/main/java/jadx/core/dex/visitors/regions/LoopRegionVisitor.java
View file @
66aa2f8f
...
...
@@ -195,7 +195,7 @@ public class LoopRegionVisitor extends AbstractVisitor implements IRegionVisitor
CodeShrinker
.
shrinkMethod
(
mth
);
if
(
arrGetInsn
.
contains
(
AFlag
.
WRAPPED
))
{
InsnArg
wrapArg
=
BlockUtils
.
searchWrappedInsnParent
(
mth
,
arrGetInsn
);
if
(
wrapArg
!=
null
)
{
if
(
wrapArg
!=
null
&&
wrapArg
.
getParentInsn
()
!=
null
)
{
wrapArg
.
getParentInsn
().
replaceArg
(
wrapArg
,
iterVar
);
}
else
{
LOG
.
debug
(
" checkArrayForEach: Wrapped insn not found: {}, mth: {}"
,
arrGetInsn
,
mth
);
...
...
@@ -233,7 +233,7 @@ public class LoopRegionVisitor extends AbstractVisitor implements IRegionVisitor
RegisterArg
iterVar
=
nextCall
.
getResult
();
if
(
nextCall
.
contains
(
AFlag
.
WRAPPED
))
{
InsnArg
wrapArg
=
BlockUtils
.
searchWrappedInsnParent
(
mth
,
nextCall
);
if
(
wrapArg
!=
null
)
{
if
(
wrapArg
!=
null
&&
wrapArg
.
getParentInsn
()
!=
null
)
{
InsnNode
parentInsn
=
wrapArg
.
getParentInsn
();
if
(
parentInsn
.
getType
()
!=
InsnType
.
CHECK_CAST
)
{
parentInsn
.
replaceArg
(
wrapArg
,
iterVar
);
...
...
jadx-core/src/main/java/jadx/core/dex/visitors/regions/RegionMaker.java
View file @
66aa2f8f
...
...
@@ -203,7 +203,7 @@ public class RegionMaker {
BlockNode
out
;
if
(
loopRegion
.
isConditionAtEnd
())
{
BlockNode
thenBlock
=
condInfo
.
getThenBlock
();
out
=
(
thenBlock
==
loopStart
?
condInfo
.
getElseBlock
()
:
thenBlock
)
;
out
=
thenBlock
==
loopStart
?
condInfo
.
getElseBlock
()
:
thenBlock
;
loopStart
.
remove
(
AType
.
LOOP
);
loop
.
getEnd
().
add
(
AFlag
.
SKIP
);
stack
.
addExit
(
loop
.
getEnd
());
...
...
@@ -922,13 +922,7 @@ public class RegionMaker {
if
(
b1
==
null
||
b2
==
null
)
{
return
false
;
}
if
(
isReturnBlocks
(
b1
,
b2
))
{
return
true
;
}
if
(
isSyntheticPath
(
b1
,
b2
))
{
return
true
;
}
return
false
;
return
isReturnBlocks
(
b1
,
b2
)
||
isSyntheticPath
(
b1
,
b2
);
}
private
static
boolean
isSyntheticPath
(
BlockNode
b1
,
BlockNode
b2
)
{
...
...
jadx-core/src/main/java/jadx/core/utils/DebugUtils.java
View file @
66aa2f8f
...
...
@@ -103,7 +103,7 @@ public class DebugUtils {
}
for
(
InsnArg
arg
:
insn
.
getArguments
())
{
if
(
arg
instanceof
RegisterArg
)
{
checkSSAVar
(
mth
,
insn
,
(
(
RegisterArg
)
arg
)
);
checkSSAVar
(
mth
,
insn
,
(
RegisterArg
)
arg
);
}
}
}
...
...
@@ -131,7 +131,7 @@ public class DebugUtils {
List
<
PhiInsn
>
phis
=
new
ArrayList
<
PhiInsn
>();
for
(
InsnNode
insn
:
block
.
getInstructions
())
{
if
(
insn
.
getType
()
==
InsnType
.
PHI
)
{
PhiInsn
phi
=
(
(
PhiInsn
)
insn
)
;
PhiInsn
phi
=
(
PhiInsn
)
insn
;
phis
.
add
(
phi
);
if
(
phi
.
getArgsCount
()
!=
phi
.
getBlockBinds
().
size
())
{
throw
new
JadxRuntimeException
(
"Incorrect args and binds in PHI"
);
...
...
jadx-core/src/main/java/jadx/core/utils/RegionUtils.java
View file @
66aa2f8f
...
...
@@ -189,7 +189,7 @@ public class RegionUtils {
for
(
IContainer
b
:
r
.
getSubBlocks
())
{
// process try block
CatchAttr
cb
=
b
.
get
(
AType
.
CATCH_BLOCK
);
if
(
cb
!=
null
&&
(
b
instanceof
IRegion
)
)
{
if
(
cb
!=
null
&&
b
instanceof
IRegion
)
{
TryCatchBlock
tb
=
cb
.
getTryBlock
();
for
(
ExceptionHandler
eh
:
tb
.
getHandlers
())
{
if
(
isRegionContainsRegion
(
eh
.
getHandlerRegion
(),
region
))
{
...
...
jadx-core/src/main/java/jadx/core/utils/Utils.java
View file @
66aa2f8f
...
...
@@ -85,6 +85,9 @@ public class Utils {
}
public
static
String
getStackTrace
(
Throwable
throwable
)
{
if
(
throwable
==
null
)
{
return
""
;
}
StringWriter
sw
=
new
StringWriter
();
PrintWriter
pw
=
new
PrintWriter
(
sw
,
true
);
throwable
.
printStackTrace
(
pw
);
...
...
@@ -92,6 +95,6 @@ public class Utils {
}
public
static
int
compare
(
int
x
,
int
y
)
{
return
(
x
<
y
)
?
-
1
:
((
x
==
y
)
?
0
:
1
)
;
return
x
<
y
?
-
1
:
x
==
y
?
0
:
1
;
}
}
jadx-core/src/main/java/jadx/core/xmlgen/BinaryXMLParser.java
View file @
66aa2f8f
...
...
@@ -209,7 +209,7 @@ public class BinaryXMLParser extends CommonBinaryParser {
for
(
int
i
=
0
;
i
<
attributeCount
;
i
++)
{
parseAttribute
(
i
);
writer
.
add
(
'"'
);
if
(
(
i
+
1
)
<
attributeCount
)
{
if
(
i
+
1
<
attributeCount
)
{
writer
.
add
(
" "
);
}
}
...
...
@@ -267,7 +267,7 @@ public class BinaryXMLParser extends CommonBinaryParser {
}
}
else
{
String
str
=
valuesParser
.
decodeValue
(
attrValDataType
,
attrValData
);
writer
.
add
(
str
);
writer
.
add
(
str
!=
null
?
str
:
"null"
);
}
}
...
...
jadx-core/src/main/java/jadx/core/xmlgen/CommonBinaryParser.java
View file @
66aa2f8f
...
...
@@ -61,7 +61,7 @@ public class CommonBinaryParser extends ParserConstants {
return
""
;
}
if
((
len
&
0x80
)
!=
0
)
{
len
=
(
(
len
&
0x7F
)
<<
8
)
|
(
strArray
[
start
++]
&
0xFF
)
;
len
=
(
len
&
0x7F
)
<<
8
|
strArray
[
start
++]
&
0xFF
;
}
byte
[]
arr
=
Arrays
.
copyOfRange
(
strArray
,
start
,
start
+
len
);
return
new
String
(
arr
,
ParserStream
.
STRING_CHARSET_UTF8
);
...
...
jadx-core/src/main/java/jadx/core/xmlgen/ManifestAttributes.java
View file @
66aa2f8f
...
...
@@ -49,9 +49,16 @@ public class ManifestAttributes {
private
final
Map
<
String
,
MAttr
>
attrMap
=
new
HashMap
<
String
,
MAttr
>();
public
ManifestAttributes
()
throws
Exception
{
InputStream
xmlStream
=
ManifestAttributes
.
class
.
getResourceAsStream
(
MANIFEST_ATTR_XML
);
DocumentBuilder
dBuilder
=
DocumentBuilderFactory
.
newInstance
().
newDocumentBuilder
();
doc
=
dBuilder
.
parse
(
xmlStream
);
InputStream
xmlStream
=
null
;
try
{
xmlStream
=
ManifestAttributes
.
class
.
getResourceAsStream
(
MANIFEST_ATTR_XML
);
DocumentBuilder
dBuilder
=
DocumentBuilderFactory
.
newInstance
().
newDocumentBuilder
();
doc
=
dBuilder
.
parse
(
xmlStream
);
}
finally
{
if
(
xmlStream
!=
null
)
{
xmlStream
.
close
();
}
}
}
public
void
parse
()
{
...
...
jadx-core/src/main/java/jadx/core/xmlgen/ParserConstants.java
View file @
66aa2f8f
...
...
@@ -150,11 +150,11 @@ public class ParserConstants {
protected
static
final
int
ATTR_MANY
=
ResMakeInternal
(
9
);
private
static
int
ResMakeInternal
(
int
entry
)
{
return
0x01000000
|
(
entry
&
0xFFFF
)
;
return
0x01000000
|
entry
&
0xFFFF
;
}
protected
static
boolean
isResInternalId
(
int
resid
)
{
return
(
(
resid
&
0xFFFF0000
)
!=
0
&&
(
resid
&
0xFF0000
)
==
0
)
;
return
(
resid
&
0xFFFF0000
)
!=
0
&&
(
resid
&
0xFF0000
)
==
0
;
}
// Bit mask of allowed types, for use with ATTR_TYPE.
...
...
jadx-core/src/main/java/jadx/core/xmlgen/ParserStream.java
View file @
66aa2f8f
...
...
@@ -34,7 +34,7 @@ public class ParserStream {
readPos
+=
2
;
int
b1
=
input
.
read
();
int
b2
=
input
.
read
();
return
(
b2
&
0xFF
)
<<
8
|
(
b1
&
0xFF
)
;
return
(
b2
&
0xFF
)
<<
8
|
b1
&
0xFF
;
}
public
int
readInt32
()
throws
IOException
{
...
...
@@ -44,7 +44,7 @@ public class ParserStream {
int
b2
=
in
.
read
();
int
b3
=
in
.
read
();
int
b4
=
in
.
read
();
return
b4
<<
24
|
(
b3
&
0xFF
)
<<
16
|
(
b2
&
0xFF
)
<<
8
|
(
b1
&
0xFF
)
;
return
b4
<<
24
|
(
b3
&
0xFF
)
<<
16
|
(
b2
&
0xFF
)
<<
8
|
b1
&
0xFF
;
}
public
long
readUInt32
()
throws
IOException
{
...
...
jadx-core/src/main/java/jadx/core/xmlgen/entry/ValuesParser.java
View file @
66aa2f8f
...
...
@@ -113,8 +113,8 @@ public class ValuesParser extends ParserConstants {
}
private
String
decodeComplex
(
int
data
,
boolean
isFraction
)
{
double
value
=
(
data
&
(
COMPLEX_MANTISSA_MASK
<<
COMPLEX_MANTISSA_SHIFT
)
)
*
RADIX_MULTS
[
(
data
>>
COMPLEX_RADIX_SHIFT
)
&
COMPLEX_RADIX_MASK
];
double
value
=
(
data
&
COMPLEX_MANTISSA_MASK
<<
COMPLEX_MANTISSA_SHIFT
)
*
RADIX_MULTS
[
data
>>
COMPLEX_RADIX_SHIFT
&
COMPLEX_RADIX_MASK
];
int
unitType
=
data
&
COMPLEX_UNIT_MASK
;
String
unit
;
if
(
isFraction
)
{
...
...
jadx-gui/src/main/java/jadx/gui/ui/ContentArea.java
View file @
66aa2f8f
...
...
@@ -13,6 +13,7 @@ import javax.swing.text.BadLocationException;
import
javax.swing.text.Caret
;
import
javax.swing.text.DefaultCaret
;
import
java.awt.Color
;
import
java.awt.Dimension
;
import
java.awt.Point
;
import
java.awt.Rectangle
;
...
...
@@ -135,9 +136,13 @@ class ContentArea extends RSyntaxTextArea {
return
;
}
int
extentHeight
=
viewport
.
getExtentSize
().
height
;
int
viewHeight
=
viewport
.
getViewSize
().
height
;
Dimension
viewSize
=
viewport
.
getViewSize
();
if
(
viewSize
==
null
)
{
return
;
}
int
viewHeight
=
viewSize
.
height
;
int
y
=
Math
.
max
(
0
,
r
.
y
-
(
extentHeight
/
2
)
);
int
y
=
Math
.
max
(
0
,
r
.
y
-
extentHeight
/
2
);
y
=
Math
.
min
(
y
,
viewHeight
-
extentHeight
);
viewport
.
setViewPosition
(
new
Point
(
0
,
y
));
...
...
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