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
6e50ddf5
Commit
6e50ddf5
authored
Jun 26, 2018
by
Sergey Toshin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Generates and saves public.xml in apktool style
parent
dda49f15
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
1 deletion
+23
-1
ResTableParser.java
jadx-core/src/main/java/jadx/core/xmlgen/ResTableParser.java
+18
-1
ResourcesSaver.java
jadx-core/src/main/java/jadx/core/xmlgen/ResourcesSaver.java
+5
-0
No files found.
jadx-core/src/main/java/jadx/core/xmlgen/ResTableParser.java
View file @
6e50ddf5
...
@@ -65,7 +65,7 @@ public class ResTableParser extends CommonBinaryParser {
...
@@ -65,7 +65,7 @@ public class ResTableParser extends CommonBinaryParser {
ResXmlGen
resGen
=
new
ResXmlGen
(
resStorage
,
vp
);
ResXmlGen
resGen
=
new
ResXmlGen
(
resStorage
,
vp
);
ResContainer
res
=
ResContainer
.
multiFile
(
"res"
);
ResContainer
res
=
ResContainer
.
multiFile
(
"res"
);
res
.
setContent
(
makeDump
());
res
.
setContent
(
make
Xml
Dump
());
res
.
getSubFiles
().
addAll
(
resGen
.
makeResourcesXml
());
res
.
getSubFiles
().
addAll
(
resGen
.
makeResourcesXml
());
return
res
;
return
res
;
}
}
...
@@ -83,6 +83,23 @@ public class ResTableParser extends CommonBinaryParser {
...
@@ -83,6 +83,23 @@ public class ResTableParser extends CommonBinaryParser {
return
writer
;
return
writer
;
}
}
public
CodeWriter
makeXmlDump
()
{
CodeWriter
writer
=
new
CodeWriter
();
writer
.
startLine
(
"<?xml version=\"1.0\" encoding=\"utf-8\"?>"
);
writer
.
startLine
(
"<resources>"
);
writer
.
incIndent
();
for
(
ResourceEntry
ri
:
resStorage
.
getResources
())
{
String
format
=
String
.
format
(
"<public type=\"%s\" name=\"%s\" id=\"%s\" />"
,
ri
.
getTypeName
(),
ri
.
getKeyName
(),
ri
.
getId
());
writer
.
startLine
(
format
);
}
writer
.
decIndent
();
writer
.
startLine
(
"</resources>"
);
writer
.
finish
();
return
writer
;
}
public
ResourceStorage
getResStorage
()
{
public
ResourceStorage
getResStorage
()
{
return
resStorage
;
return
resStorage
;
}
}
...
...
jadx-core/src/main/java/jadx/core/xmlgen/ResourcesSaver.java
View file @
6e50ddf5
...
@@ -46,6 +46,7 @@ public class ResourcesSaver implements Runnable {
...
@@ -46,6 +46,7 @@ public class ResourcesSaver implements Runnable {
if
(
subFiles
.
isEmpty
())
{
if
(
subFiles
.
isEmpty
())
{
save
(
rc
,
outDir
);
save
(
rc
,
outDir
);
}
else
{
}
else
{
saveToFile
(
rc
,
new
File
(
outDir
,
"res/values/public.xml"
));
for
(
ResContainer
subFile
:
subFiles
)
{
for
(
ResContainer
subFile
:
subFiles
)
{
saveResources
(
subFile
);
saveResources
(
subFile
);
}
}
...
@@ -65,6 +66,10 @@ public class ResourcesSaver implements Runnable {
...
@@ -65,6 +66,10 @@ public class ResourcesSaver implements Runnable {
}
}
return
;
return
;
}
}
saveToFile
(
rc
,
outFile
);
}
private
void
saveToFile
(
ResContainer
rc
,
File
outFile
)
{
CodeWriter
cw
=
rc
.
getContent
();
CodeWriter
cw
=
rc
.
getContent
();
if
(
cw
!=
null
)
{
if
(
cw
!=
null
)
{
cw
.
save
(
outFile
);
cw
.
save
(
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