mirror of
https://github.com/revanced/smali.git
synced 2025-05-03 08:04:28 +02:00
Add a placeholder ART version number / api level for aosp/master.
Also make invoke-polymorphic conditional on this new art version. This also fixes a bug where the version was being selected incorrectly due to a parameter name that shadowed a local variable.
This commit is contained in:
parent
615d383320
commit
55c33ebb09
@ -305,8 +305,8 @@ public enum Opcode
|
||||
SPARSE_SWITCH_PAYLOAD(0x200, "sparse-switch-payload", ReferenceType.NONE, Format.SparseSwitchPayload, 0),
|
||||
ARRAY_PAYLOAD(0x300, "array-payload", ReferenceType.NONE, Format.ArrayPayload, 0),
|
||||
|
||||
INVOKE_POLYMORPHIC(firstApi(0xfa, 26), "invoke-polymorphic", ReferenceType.METHOD, ReferenceType.METHOD_PROTO, Format.Format45cc, Opcode.CAN_THROW | Opcode.CAN_CONTINUE | Opcode.SETS_RESULT),
|
||||
INVOKE_POLYMORPHIC_RANGE(firstApi(0xfb, 26), "invoke-polymorphic/range", ReferenceType.METHOD, ReferenceType.METHOD_PROTO, Format.Format4rcc, Opcode.CAN_THROW | Opcode.CAN_CONTINUE | Opcode.SETS_RESULT);
|
||||
INVOKE_POLYMORPHIC(firstArtVersion(0xfa, 87), "invoke-polymorphic", ReferenceType.METHOD, ReferenceType.METHOD_PROTO, Format.Format45cc, Opcode.CAN_THROW | Opcode.CAN_CONTINUE | Opcode.SETS_RESULT),
|
||||
INVOKE_POLYMORPHIC_RANGE(firstArtVersion(0xfb, 87), "invoke-polymorphic/range", ReferenceType.METHOD, ReferenceType.METHOD_PROTO, Format.Format4rcc, Opcode.CAN_THROW | Opcode.CAN_CONTINUE | Opcode.SETS_RESULT);
|
||||
|
||||
//if the instruction can throw an exception
|
||||
public static final int CAN_THROW = 0x1;
|
||||
|
@ -92,9 +92,9 @@ public class Opcodes {
|
||||
|
||||
int version;
|
||||
if (isArt()) {
|
||||
version = artVersion;
|
||||
version = this.artVersion;
|
||||
} else {
|
||||
version = api;
|
||||
version = this.api;
|
||||
}
|
||||
|
||||
for (Opcode opcode: Opcode.values()) {
|
||||
|
@ -35,6 +35,12 @@ public class VersionMap {
|
||||
public static final int NO_VERSION = -1;
|
||||
|
||||
public static int mapArtVersionToApi(int artVersion) {
|
||||
// NOTE: Art version 87 and api level 26 do not correspond to any
|
||||
// particular android release and represent the current (as of
|
||||
// October 2016) state of aosp/master.
|
||||
if (artVersion >= 87) {
|
||||
return 26;
|
||||
}
|
||||
if (artVersion >= 79) {
|
||||
return 24;
|
||||
}
|
||||
@ -62,10 +68,15 @@ public class VersionMap {
|
||||
case 23:
|
||||
return 64;
|
||||
case 24:
|
||||
case 25:
|
||||
return 79;
|
||||
}
|
||||
if (api > 24) {
|
||||
return 79;
|
||||
|
||||
// NOTE: Art version 87 and api level 26 do not correspond to any
|
||||
// particular android release and represent the current (as of
|
||||
// October 2016) state of aosp/master.
|
||||
if (api > 25) {
|
||||
return 87;
|
||||
}
|
||||
return NO_VERSION;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user