mirror of
https://github.com/iBotPeaches/Apktool.git
synced 2024-12-13 23:48:49 +00: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;
|
||||
|
||||
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
|
||||
|
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user