mirror of
https://github.com/revanced/Apktool.git
synced 2025-01-07 10:35: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;
|
import java.util.zip.ZipFile;
|
||||||
|
|
||||||
public final class DexFileFactory {
|
public final class DexFileFactory {
|
||||||
|
@Nonnull
|
||||||
|
public static DexBackedDexFile loadDexFile(String path, int api)
|
||||||
|
throws IOException {
|
||||||
|
return loadDexFile(path, api, false);
|
||||||
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
public static DexBackedDexFile loadDexFile(String path, int api, boolean experimental)
|
public static DexBackedDexFile loadDexFile(String path, int api, boolean experimental)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
return loadDexFile(new File(path), "classes.dex", new Opcodes(api, experimental));
|
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
|
@Nonnull
|
||||||
public static DexBackedDexFile loadDexFile(File dexFile, int api, boolean experimental)
|
public static DexBackedDexFile loadDexFile(File dexFile, int api, boolean experimental)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
@ -40,6 +40,10 @@ public class Opcodes {
|
|||||||
private final Opcode[] opcodesByValue;
|
private final Opcode[] opcodesByValue;
|
||||||
private final HashMap<String, Opcode> opcodesByName;
|
private final HashMap<String, Opcode> opcodesByName;
|
||||||
|
|
||||||
|
public Opcodes(int api) {
|
||||||
|
this(api, false);
|
||||||
|
}
|
||||||
|
|
||||||
public Opcodes(int api, boolean experimental) {
|
public Opcodes(int api, boolean experimental) {
|
||||||
opcodesByValue = new Opcode[256];
|
opcodesByValue = new Opcode[256];
|
||||||
opcodesByName = Maps.newHashMap();
|
opcodesByName = Maps.newHashMap();
|
||||||
|
Loading…
Reference in New Issue
Block a user