mirror of
https://github.com/revanced/Apktool.git
synced 2025-01-05 17:45:52 +01:00
Add backwards compatible version of DexFileFactory.loadDexFile and Opcodes
Keep the old prototype, so we don't break existing code.
This commit is contained in:
parent
008b12f97c
commit
fd489e990c
@ -44,12 +44,23 @@ import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipFile;
|
||||
|
||||
public final class DexFileFactory {
|
||||
@Nonnull
|
||||
public static DexBackedDexFile loadDexFile(String path, int api)
|
||||
throws IOException {
|
||||
return loadDexFile(path, api, false);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public static DexBackedDexFile loadDexFile(String path, int api, boolean experimental)
|
||||
throws IOException {
|
||||
return loadDexFile(new File(path), "classes.dex", new Opcodes(api, experimental));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public static DexBackedDexFile loadDexFile(File dexFile, int api) throws IOException {
|
||||
return loadDexFile(dexFile, api, false);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public static DexBackedDexFile loadDexFile(File dexFile, int api, boolean experimental)
|
||||
throws IOException {
|
||||
|
@ -40,6 +40,10 @@ public class Opcodes {
|
||||
private final Opcode[] opcodesByValue;
|
||||
private final HashMap<String, Opcode> opcodesByName;
|
||||
|
||||
public Opcodes(int api) {
|
||||
this(api, false);
|
||||
}
|
||||
|
||||
public Opcodes(int api, boolean experimental) {
|
||||
opcodesByValue = new Opcode[256];
|
||||
opcodesByName = Maps.newHashMap();
|
||||
|
Loading…
Reference in New Issue
Block a user