Commit fd4289aa authored by NeoSpb's avatar NeoSpb

fix save AndroidManifest.xml when jadx-gui used

parent 716db8b9
......@@ -108,7 +108,25 @@ public final class JadxDecompiler {
parse();
}
public void parseAndSaveXML() {
if (this.args.isXMLTest()) {
InputFile inf = inputFiles.get(0);
try {
byte[] buffer = InputFile.loadXMLBuffer(inf.getFile());
if (buffer != null) {
File out = new File(outDir, "AndroidManifest.xml");
BinaryXMLParser bxp = new BinaryXMLParser(root);
bxp.parse(buffer, out);
}
} catch (Exception e) {
LOG.info("Decompiling AndroidManifest.xml failed!", e);
}
}
}
public void save() {
parseAndSaveXML();
try {
ExecutorService ex = getSaveExecutor();
ex.shutdown();
......@@ -204,20 +222,6 @@ public final class JadxDecompiler {
root = new RootNode();
LOG.info("loading ...");
root.load(inputFiles);
if (this.args.isXMLTest()) {
InputFile inf = inputFiles.get(0);
try {
byte[] buffer = InputFile.loadXMLBuffer(inf.getFile());
if (buffer != null) {
File out = new File(args.getOutDir(), "AndroidManifest.xml");
BinaryXMLParser bxp = new BinaryXMLParser(root);
bxp.parse(buffer, out);
}
} catch (Exception e) {
LOG.info("Decompiling AndroidManifest.xml failed!", e);
}
}
}
void processClass(ClassNode cls) {
......
......@@ -42,6 +42,7 @@ public class JadxWrapper {
public void run() {
try {
decompiler.setOutputDir(dir);
decompiler.parseAndSaveXML();
ThreadPoolExecutor ex = (ThreadPoolExecutor) decompiler.getSaveExecutor();
ex.shutdown();
while (ex.isTerminating()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment