mirror of
https://github.com/revanced/smali.git
synced 2025-06-12 04:17:36 +02:00
Add initial support for allowing assembly of odex instructions
Initially, only throw-verification-error is supported
This commit is contained in:
@ -28,6 +28,8 @@
|
||||
|
||||
package org.jf.dexlib.Code;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public enum VerificationErrorType {
|
||||
None(0, "no-error"),
|
||||
Generic(1, "generic-error"),
|
||||
@ -40,6 +42,16 @@ public enum VerificationErrorType {
|
||||
ClassChange(8, "class-change-error"),
|
||||
Instantiation(9, "instantiation-error");
|
||||
|
||||
private static HashMap<String, VerificationErrorType> verificationErrorTypesByName;
|
||||
|
||||
static {
|
||||
verificationErrorTypesByName = new HashMap<String, VerificationErrorType>();
|
||||
|
||||
for (VerificationErrorType verificationErrorType: VerificationErrorType.values()) {
|
||||
verificationErrorTypesByName.put(verificationErrorType.getName(), verificationErrorType);
|
||||
}
|
||||
}
|
||||
|
||||
private int value;
|
||||
private String name;
|
||||
private VerificationErrorType(int value, String name) {
|
||||
@ -55,6 +67,10 @@ public enum VerificationErrorType {
|
||||
return name;
|
||||
}
|
||||
|
||||
public static VerificationErrorType fromString(String validationErrorType) {
|
||||
return verificationErrorTypesByName.get(validationErrorType);
|
||||
}
|
||||
|
||||
public static VerificationErrorType getValidationErrorType(int validationErrorType) {
|
||||
switch (validationErrorType) {
|
||||
case 0:
|
||||
|
Reference in New Issue
Block a user