mirror of
https://github.com/revanced/Apktool.git
synced 2025-01-21 17:27:41 +01:00
Added dontLoadClassPath feature to smali.
This commit is contained in:
parent
12c958c355
commit
62ac6fa870
@ -44,6 +44,8 @@ import static org.jf.dexlib.ClassDataItem.EncodedField;
|
|||||||
import static org.jf.dexlib.ClassDataItem.EncodedMethod;
|
import static org.jf.dexlib.ClassDataItem.EncodedMethod;
|
||||||
|
|
||||||
public class ClassPath {
|
public class ClassPath {
|
||||||
|
public static boolean dontLoadClassPath = false;
|
||||||
|
|
||||||
private static ClassPath theClassPath = null;
|
private static ClassPath theClassPath = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -261,6 +263,10 @@ public class ClassPath {
|
|||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
public static ClassDef getClassDef(String classType, boolean createUnresolvedClassDef) {
|
public static ClassDef getClassDef(String classType, boolean createUnresolvedClassDef) {
|
||||||
|
if (dontLoadClassPath) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
ClassDef classDef = theClassPath.classDefs.get(classType);
|
ClassDef classDef = theClassPath.classDefs.get(classType);
|
||||||
if (classDef == null) {
|
if (classDef == null) {
|
||||||
//if it's an array class, try to create it
|
//if it's an array class, try to create it
|
||||||
|
@ -2434,7 +2434,7 @@ public class MethodAnalyzer {
|
|||||||
RegisterType arrayRegisterType = analyzedInstruction.getPreInstructionRegisterType(instruction.getRegisterB());
|
RegisterType arrayRegisterType = analyzedInstruction.getPreInstructionRegisterType(instruction.getRegisterB());
|
||||||
assert arrayRegisterType != null;
|
assert arrayRegisterType != null;
|
||||||
|
|
||||||
if (arrayRegisterType.category != RegisterType.Category.Null) {
|
if (! ClassPath.dontLoadClassPath && arrayRegisterType.category != RegisterType.Category.Null) {
|
||||||
assert arrayRegisterType.type != null;
|
assert arrayRegisterType.type != null;
|
||||||
if (arrayRegisterType.type.getClassType().charAt(0) != '[') {
|
if (arrayRegisterType.type.getClassType().charAt(0) != '[') {
|
||||||
throw new ValidationException(String.format("Cannot use aget-wide with non-array type %s",
|
throw new ValidationException(String.format("Cannot use aget-wide with non-array type %s",
|
||||||
@ -2503,7 +2503,7 @@ public class MethodAnalyzer {
|
|||||||
RegisterType arrayRegisterType = analyzedInstruction.getPreInstructionRegisterType(instruction.getRegisterB());
|
RegisterType arrayRegisterType = analyzedInstruction.getPreInstructionRegisterType(instruction.getRegisterB());
|
||||||
assert arrayRegisterType != null;
|
assert arrayRegisterType != null;
|
||||||
|
|
||||||
if (arrayRegisterType.category != RegisterType.Category.Null) {
|
if (! ClassPath.dontLoadClassPath && arrayRegisterType.category != RegisterType.Category.Null) {
|
||||||
assert arrayRegisterType.type != null;
|
assert arrayRegisterType.type != null;
|
||||||
if (arrayRegisterType.type.getClassType().charAt(0) != '[') {
|
if (arrayRegisterType.type.getClassType().charAt(0) != '[') {
|
||||||
throw new ValidationException(String.format("Cannot use aget-object with non-array type %s",
|
throw new ValidationException(String.format("Cannot use aget-object with non-array type %s",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user