* Save jobf when decompiling to Java through the cli * Skip jobf saving if it's empty * Update jadx-core/src/main/java/jadx/core/deobf/DeobfPresets.java Co-authored-by: Yotam Nachum <me@yotam.net> Co-authored-by: skylot <118523+skylot@users.noreply.github.com>
This commit is contained in:
@@ -134,6 +134,12 @@ public class DeobfPresets {
|
||||
list.add(String.format("m %s = %s", mthEntry.getKey(), mthEntry.getValue()));
|
||||
}
|
||||
Collections.sort(list);
|
||||
if (list.isEmpty()) {
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("Deobfuscation map is empty, not saving it");
|
||||
}
|
||||
return;
|
||||
}
|
||||
Files.write(deobfMapFile, list, MAP_FILE_CHARSET,
|
||||
StandardOpenOption.WRITE, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING);
|
||||
if (LOG.isDebugEnabled()) {
|
||||
|
||||
@@ -46,7 +46,7 @@ public class RenameVisitor extends AbstractVisitor {
|
||||
checkClasses(deobfuscator, root, args);
|
||||
UserRenames.applyForNodes(root);
|
||||
|
||||
if (args.isDeobfuscationOn()) {
|
||||
if (args.isDeobfuscationOn() || !args.isJsonOutput()) {
|
||||
deobfuscator.savePresets();
|
||||
deobfuscator.clear();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user