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
53be92c6
Commit
53be92c6
authored
Jan 03, 2015
by
Skylot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: fix decoding UTF-8 strings in xml resources
parent
5f8f454b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
204 additions
and
109 deletions
+204
-109
ResourceType.java
jadx-core/src/main/java/jadx/api/ResourceType.java
+1
-1
BinaryXMLParser.java
...-core/src/main/java/jadx/core/xmlgen/BinaryXMLParser.java
+120
-107
ParserStream.java
jadx-core/src/main/java/jadx/core/xmlgen/ParserStream.java
+82
-0
JResource.java
jadx-gui/src/main/java/jadx/gui/treemodel/JResource.java
+1
-1
No files found.
jadx-core/src/main/java/jadx/api/ResourceType.java
View file @
53be92c6
...
...
@@ -36,13 +36,13 @@ public enum ResourceType {
case
CODE:
case
ARSC:
case
LIB:
case
XML:
case
FONT:
case
IMG:
case
UNKNOWN:
return
false
;
case
MANIFEST:
case
XML:
return
true
;
}
return
false
;
...
...
jadx-core/src/main/java/jadx/core/xmlgen/BinaryXMLParser.java
View file @
53be92c6
This diff is collapsed.
Click to expand it.
jadx-core/src/main/java/jadx/core/xmlgen/ParserStream.java
0 → 100644
View file @
53be92c6
package
jadx
.
core
.
xmlgen
;
import
java.io.IOException
;
import
java.io.InputStream
;
public
class
ParserStream
{
private
final
InputStream
input
;
private
long
readPos
=
0
;
public
ParserStream
(
InputStream
inputStream
)
{
this
.
input
=
inputStream
;
}
public
long
getPos
()
{
return
readPos
;
}
public
int
readInt8
()
throws
IOException
{
readPos
++;
return
input
.
read
();
}
public
int
readInt16
()
throws
IOException
{
readPos
+=
2
;
int
b1
=
input
.
read
();
int
b2
=
input
.
read
();
return
(
b2
&
0xFF
)
<<
8
|
(
b1
&
0xFF
);
}
public
int
readInt32
()
throws
IOException
{
readPos
+=
4
;
InputStream
in
=
input
;
int
b1
=
in
.
read
();
int
b2
=
in
.
read
();
int
b3
=
in
.
read
();
int
b4
=
in
.
read
();
return
b4
<<
24
|
(
b3
&
0xFF
)
<<
16
|
(
b2
&
0xFF
)
<<
8
|
(
b1
&
0xFF
);
}
public
byte
[]
readArray
(
int
count
)
throws
IOException
{
readPos
+=
count
;
byte
[]
arr
=
new
byte
[
count
];
int
pos
=
input
.
read
(
arr
,
0
,
count
);
while
(
pos
<
count
)
{
int
read
=
input
.
read
(
arr
,
pos
,
count
-
pos
);
if
(
read
==
-
1
)
{
throw
new
IOException
(
"No data, can't read "
+
count
+
" bytes"
);
}
pos
+=
read
;
}
return
arr
;
}
public
void
skip
(
long
count
)
throws
IOException
{
readPos
+=
count
;
long
pos
=
input
.
skip
(
count
);
while
(
pos
<
count
)
{
long
skipped
=
input
.
skip
(
count
-
pos
);
if
(
skipped
==
-
1
)
{
throw
new
IOException
(
"No data, can't skip "
+
count
+
" bytes"
);
}
pos
+=
skipped
;
}
}
public
int
decodeLength8
()
throws
IOException
{
int
len
=
readInt8
();
if
((
len
&
0x80
)
!=
0
)
{
len
=
((
len
&
0x7F
)
<<
8
)
|
readInt8
();
}
return
len
;
}
public
int
decodeLength16
()
throws
IOException
{
int
len
=
readInt16
();
if
((
len
&
0x8000
)
!=
0
)
{
len
=
((
len
&
0x7FFF
)
<<
16
)
|
readInt16
();
}
return
len
;
}
}
jadx-gui/src/main/java/jadx/gui/treemodel/JResource.java
View file @
53be92c6
...
...
@@ -144,7 +144,6 @@ public class JResource extends JNode implements Comparable<JResource> {
private
boolean
isSupportedForView
(
ResourceType
type
)
{
switch
(
type
)
{
case
CODE:
case
XML:
case
ARSC:
case
FONT:
case
IMG:
...
...
@@ -152,6 +151,7 @@ public class JResource extends JNode implements Comparable<JResource> {
return
false
;
case
MANIFEST:
case
XML:
case
UNKNOWN:
return
true
;
}
...
...
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