diff --git a/brut.apktool.smali/dexlib/src/main/java/org/jf/dexlib/Code/Analysis/ClassPath.java b/brut.apktool.smali/dexlib/src/main/java/org/jf/dexlib/Code/Analysis/ClassPath.java index 794cec60..da34e121 100644 --- a/brut.apktool.smali/dexlib/src/main/java/org/jf/dexlib/Code/Analysis/ClassPath.java +++ b/brut.apktool.smali/dexlib/src/main/java/org/jf/dexlib/Code/Analysis/ClassPath.java @@ -44,6 +44,8 @@ import static org.jf.dexlib.ClassDataItem.EncodedField; import static org.jf.dexlib.ClassDataItem.EncodedMethod; public class ClassPath { + public static boolean dontLoadClassPath = false; + private static ClassPath theClassPath = null; /** @@ -261,6 +263,10 @@ public class ClassPath { @Nonnull public static ClassDef getClassDef(String classType, boolean createUnresolvedClassDef) { + if (dontLoadClassPath) { + return null; + } + ClassDef classDef = theClassPath.classDefs.get(classType); if (classDef == null) { //if it's an array class, try to create it diff --git a/brut.apktool.smali/dexlib/src/main/java/org/jf/dexlib/Code/Analysis/MethodAnalyzer.java b/brut.apktool.smali/dexlib/src/main/java/org/jf/dexlib/Code/Analysis/MethodAnalyzer.java index 9edf37b1..f01599b2 100644 --- a/brut.apktool.smali/dexlib/src/main/java/org/jf/dexlib/Code/Analysis/MethodAnalyzer.java +++ b/brut.apktool.smali/dexlib/src/main/java/org/jf/dexlib/Code/Analysis/MethodAnalyzer.java @@ -2434,7 +2434,7 @@ public class MethodAnalyzer { RegisterType arrayRegisterType = analyzedInstruction.getPreInstructionRegisterType(instruction.getRegisterB()); assert arrayRegisterType != null; - if (arrayRegisterType.category != RegisterType.Category.Null) { + if (! ClassPath.dontLoadClassPath && arrayRegisterType.category != RegisterType.Category.Null) { assert arrayRegisterType.type != null; if (arrayRegisterType.type.getClassType().charAt(0) != '[') { 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()); assert arrayRegisterType != null; - if (arrayRegisterType.category != RegisterType.Category.Null) { + if (! ClassPath.dontLoadClassPath && arrayRegisterType.category != RegisterType.Category.Null) { assert arrayRegisterType.type != null; if (arrayRegisterType.type.getClassType().charAt(0) != '[') { throw new ValidationException(String.format("Cannot use aget-object with non-array type %s",