From 156c97984245349741e4ef32a235f6957b6e431a Mon Sep 17 00:00:00 2001 From: Skylot Date: Fri, 3 May 2019 18:29:35 +0300 Subject: [PATCH] fix: search smali class by original name --- jadx-core/src/main/java/jadx/api/JadxDecompiler.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/jadx-core/src/main/java/jadx/api/JadxDecompiler.java b/jadx-core/src/main/java/jadx/api/JadxDecompiler.java index 712ae09fa..0b2e72cd2 100644 --- a/jadx-core/src/main/java/jadx/api/JadxDecompiler.java +++ b/jadx-core/src/main/java/jadx/api/JadxDecompiler.java @@ -1,7 +1,6 @@ package jadx.api; import java.io.File; -import java.io.IOException; import java.io.StringWriter; import java.nio.file.Path; import java.util.ArrayList; @@ -35,6 +34,7 @@ import jadx.core.dex.nodes.RootNode; import jadx.core.dex.visitors.IDexTreeVisitor; import jadx.core.dex.visitors.SaveCode; import jadx.core.export.ExportGradleProject; +import jadx.core.utils.Utils; import jadx.core.utils.exceptions.JadxRuntimeException; import jadx.core.utils.files.InputFile; import jadx.core.xmlgen.BinaryXMLParser; @@ -308,8 +308,7 @@ public final class JadxDecompiler { void generateSmali(ClassNode cls) { Path path = cls.dex().getDexFile().getPath(); - String className = cls.getAlias().makeRawFullName(); - className = 'L' + className.replace('.', '/') + ';'; + String className = Utils.makeQualifiedObjectName(cls.getClassInfo().getType().getObject()); try { DexBackedDexFile dexFile = DexFileFactory.loadDexFile(path.toFile(), Opcodes.getDefault()); boolean decompiled = false; @@ -326,7 +325,7 @@ public final class JadxDecompiler { if (!decompiled) { LOG.error("Failed to find smali class {}", className); } - } catch (IOException e) { + } catch (Exception e) { LOG.error("Error generating smali", e); } }