未验证 提交 985ccd6b 编写于 作者: Y Yotam 提交者: GitHub

feat: save jobf when decompiling to Java (#1274) (PR #1275)

* 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: NYotam Nachum <me@yotam.net>
Co-authored-by: Nskylot <118523+skylot@users.noreply.github.com>
上级 570e7528
......@@ -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();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册