Merge pull request #37 from NeoSpb/fix_gui_save_manifest
fix save AndroidManifest.xml when jadx-gui used
This commit is contained in:
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user