fix: search smali class by original name

This commit is contained in:
Skylot
2019-05-03 18:29:35 +03:00
parent f846df5371
commit 156c979842
@@ -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);
}
}