mirror of
https://github.com/revanced/smali.git
synced 2025-05-20 16:07:05 +02:00
Using standard InlineMethodResolver if no custom one is provided.
This commit is contained in:
parent
d6737943e1
commit
9c72df65f7
@ -34,6 +34,7 @@ import com.google.common.collect.Iterables;
|
||||
import org.jf.baksmali.Adaptors.ClassDefinition;
|
||||
import org.jf.dexlib2.analysis.ClassPath;
|
||||
import org.jf.dexlib2.analysis.CustomInlineMethodResolver;
|
||||
import org.jf.dexlib2.analysis.InlineMethodResolver;
|
||||
import org.jf.dexlib2.dexbacked.DexBackedOdexFile;
|
||||
import org.jf.dexlib2.iface.ClassDef;
|
||||
import org.jf.dexlib2.iface.DexFile;
|
||||
@ -91,6 +92,8 @@ public class baksmali {
|
||||
|
||||
if (inlineTable != null) {
|
||||
options.inlineResolver = new CustomInlineMethodResolver(options.classPath, new File(inlineTable));
|
||||
} else if (dexFile instanceof DexBackedOdexFile) {
|
||||
options.inlineResolver = InlineMethodResolver.createInlineMethodResolver(((DexBackedOdexFile) dexFile).getVersion());
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
System.err.println("\n\nError occured while loading boot class path files. Aborting.");
|
||||
|
@ -33,6 +33,7 @@ package org.jf.dexlib2.dexbacked;
|
||||
|
||||
import com.google.common.io.ByteStreams;
|
||||
import org.jf.dexlib2.Opcodes;
|
||||
import org.jf.dexlib2.dexbacked.raw.HeaderItem;
|
||||
import org.jf.dexlib2.dexbacked.raw.OdexHeaderItem;
|
||||
import org.jf.dexlib2.dexbacked.util.VariableSizeList;
|
||||
|
||||
@ -121,6 +122,10 @@ public class DexBackedOdexFile extends DexBackedDexFile {
|
||||
}
|
||||
}
|
||||
|
||||
public int getVersion() {
|
||||
return HeaderItem.getVersion(getBuf(), 0);
|
||||
}
|
||||
|
||||
public static class NotAnOdexFile extends RuntimeException {
|
||||
public NotAnOdexFile() {
|
||||
}
|
||||
|
@ -219,7 +219,7 @@ public class HeaderItem {
|
||||
return "Invalid";
|
||||
}
|
||||
|
||||
private static int getVersion(byte[] buf, int offset) {
|
||||
public static int getVersion(byte[] buf, int offset) {
|
||||
if (buf.length - offset < 8) {
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user