From 510035b7b72325ff51a0d6821513e919c9df2d93 Mon Sep 17 00:00:00 2001 From: NeoSpb Date: Mon, 18 May 2015 21:03:50 +0300 Subject: [PATCH] core: fix used name/path to the deobfuscation map file (used the same name/path as the APK file, but extension 'jobf') --- .../main/java/jadx/core/dex/visitors/RenameVisitor.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/jadx-core/src/main/java/jadx/core/dex/visitors/RenameVisitor.java b/jadx-core/src/main/java/jadx/core/dex/visitors/RenameVisitor.java index 043e1ee71..9e3013025 100644 --- a/jadx-core/src/main/java/jadx/core/dex/visitors/RenameVisitor.java +++ b/jadx-core/src/main/java/jadx/core/dex/visitors/RenameVisitor.java @@ -30,7 +30,13 @@ public class RenameVisitor extends AbstractVisitor { @Override public void init(RootNode root) { IJadxArgs args = root.getArgs(); - File deobfMapFile = new File(args.getOutDir(), "deobf_map.jobf"); + + final String firstInputFileName = root.getDexNodes().get(0).getInputFile().getFile().getAbsolutePath(); + final String inputPath = org.apache.commons.io.FilenameUtils.getFullPathNoEndSeparator( + firstInputFileName); + final String inputName = org.apache.commons.io.FilenameUtils.getBaseName(firstInputFileName); + + File deobfMapFile = new File(inputPath, inputName + ".jobf"); deobfuscator = new Deobfuscator(args, root.getDexNodes(), deobfMapFile); boolean deobfuscationOn = args.isDeobfuscationOn(); if (deobfuscationOn) {