Commit 156c9798 authored by Skylot's avatar Skylot

fix: search smali class by original name

parent f846df53
package jadx.api; package jadx.api;
import java.io.File; import java.io.File;
import java.io.IOException;
import java.io.StringWriter; import java.io.StringWriter;
import java.nio.file.Path; import java.nio.file.Path;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -35,6 +34,7 @@ import jadx.core.dex.nodes.RootNode; ...@@ -35,6 +34,7 @@ import jadx.core.dex.nodes.RootNode;
import jadx.core.dex.visitors.IDexTreeVisitor; import jadx.core.dex.visitors.IDexTreeVisitor;
import jadx.core.dex.visitors.SaveCode; import jadx.core.dex.visitors.SaveCode;
import jadx.core.export.ExportGradleProject; import jadx.core.export.ExportGradleProject;
import jadx.core.utils.Utils;
import jadx.core.utils.exceptions.JadxRuntimeException; import jadx.core.utils.exceptions.JadxRuntimeException;
import jadx.core.utils.files.InputFile; import jadx.core.utils.files.InputFile;
import jadx.core.xmlgen.BinaryXMLParser; import jadx.core.xmlgen.BinaryXMLParser;
...@@ -308,8 +308,7 @@ public final class JadxDecompiler { ...@@ -308,8 +308,7 @@ public final class JadxDecompiler {
void generateSmali(ClassNode cls) { void generateSmali(ClassNode cls) {
Path path = cls.dex().getDexFile().getPath(); Path path = cls.dex().getDexFile().getPath();
String className = cls.getAlias().makeRawFullName(); String className = Utils.makeQualifiedObjectName(cls.getClassInfo().getType().getObject());
className = 'L' + className.replace('.', '/') + ';';
try { try {
DexBackedDexFile dexFile = DexFileFactory.loadDexFile(path.toFile(), Opcodes.getDefault()); DexBackedDexFile dexFile = DexFileFactory.loadDexFile(path.toFile(), Opcodes.getDefault());
boolean decompiled = false; boolean decompiled = false;
...@@ -326,7 +325,7 @@ public final class JadxDecompiler { ...@@ -326,7 +325,7 @@ public final class JadxDecompiler {
if (!decompiled) { if (!decompiled) {
LOG.error("Failed to find smali class {}", className); LOG.error("Failed to find smali class {}", className);
} }
} catch (IOException e) { } catch (Exception e) {
LOG.error("Error generating smali", e); LOG.error("Error generating smali", e);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment