2729 lines
73 KiB
Smali
2729 lines
73 KiB
Smali
.class public abstract Lcom/esotericsoftware/reflectasm/FieldAccess;
|
|
.super Ljava/lang/Object;
|
|
.source "FieldAccess.java"
|
|
|
|
|
|
# instance fields
|
|
.field private fieldNames:[Ljava/lang/String;
|
|
|
|
.field private fieldTypes:[Ljava/lang/Class;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
.prologue
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static get(Ljava/lang/Class;)Lcom/esotericsoftware/reflectasm/FieldAccess;
|
|
.locals 26
|
|
.param p0, "type" # Ljava/lang/Class;
|
|
|
|
.prologue
|
|
new-instance v18, Ljava/util/ArrayList;
|
|
|
|
invoke-direct/range {v18 .. v18}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
.local v18, "fields":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Ljava/lang/reflect/Field;>;"
|
|
move-object/from16 v24, p0
|
|
|
|
.local v24, "nextClass":Ljava/lang/Class;
|
|
:goto_0
|
|
const-class v3, Ljava/lang/Object;
|
|
|
|
move-object/from16 v0, v24
|
|
|
|
if-eq v0, v3, :cond_3
|
|
|
|
invoke-virtual/range {v24 .. v24}, Ljava/lang/Class;->getDeclaredFields()[Ljava/lang/reflect/Field;
|
|
|
|
move-result-object v14
|
|
|
|
.local v14, "declaredFields":[Ljava/lang/reflect/Field;
|
|
const/16 v19, 0x0
|
|
|
|
.local v19, "i":I
|
|
array-length v0, v14
|
|
|
|
move/from16 v23, v0
|
|
|
|
.local v23, "n":I
|
|
:goto_1
|
|
move/from16 v0, v19
|
|
|
|
move/from16 v1, v23
|
|
|
|
if-ge v0, v1, :cond_2
|
|
|
|
aget-object v15, v14, v19
|
|
|
|
.local v15, "field":Ljava/lang/reflect/Field;
|
|
invoke-virtual {v15}, Ljava/lang/reflect/Field;->getModifiers()I
|
|
|
|
move-result v22
|
|
|
|
.local v22, "modifiers":I
|
|
invoke-static/range {v22 .. v22}, Ljava/lang/reflect/Modifier;->isStatic(I)Z
|
|
|
|
move-result v3
|
|
|
|
if-eqz v3, :cond_1
|
|
|
|
:cond_0
|
|
:goto_2
|
|
add-int/lit8 v19, v19, 0x1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
invoke-static/range {v22 .. v22}, Ljava/lang/reflect/Modifier;->isPrivate(I)Z
|
|
|
|
move-result v3
|
|
|
|
if-nez v3, :cond_0
|
|
|
|
move-object/from16 v0, v18
|
|
|
|
invoke-virtual {v0, v15}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
|
|
|
|
goto :goto_2
|
|
|
|
.end local v15 # "field":Ljava/lang/reflect/Field;
|
|
.end local v22 # "modifiers":I
|
|
:cond_2
|
|
invoke-virtual/range {v24 .. v24}, Ljava/lang/Class;->getSuperclass()Ljava/lang/Class;
|
|
|
|
move-result-object v24
|
|
|
|
goto :goto_0
|
|
|
|
.end local v14 # "declaredFields":[Ljava/lang/reflect/Field;
|
|
.end local v19 # "i":I
|
|
.end local v23 # "n":I
|
|
:cond_3
|
|
invoke-virtual/range {v18 .. v18}, Ljava/util/ArrayList;->size()I
|
|
|
|
move-result v3
|
|
|
|
new-array v0, v3, [Ljava/lang/String;
|
|
|
|
move-object/from16 v16, v0
|
|
|
|
.local v16, "fieldNames":[Ljava/lang/String;
|
|
invoke-virtual/range {v18 .. v18}, Ljava/util/ArrayList;->size()I
|
|
|
|
move-result v3
|
|
|
|
new-array v0, v3, [Ljava/lang/Class;
|
|
|
|
move-object/from16 v17, v0
|
|
|
|
.local v17, "fieldTypes":[Ljava/lang/Class;
|
|
const/16 v19, 0x0
|
|
|
|
.restart local v19 # "i":I
|
|
move-object/from16 v0, v16
|
|
|
|
array-length v0, v0
|
|
|
|
move/from16 v23, v0
|
|
|
|
.restart local v23 # "n":I
|
|
:goto_3
|
|
move/from16 v0, v19
|
|
|
|
move/from16 v1, v23
|
|
|
|
if-ge v0, v1, :cond_4
|
|
|
|
invoke-virtual/range {v18 .. v19}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v3
|
|
|
|
check-cast v3, Ljava/lang/reflect/Field;
|
|
|
|
invoke-virtual {v3}, Ljava/lang/reflect/Field;->getName()Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
aput-object v3, v16, v19
|
|
|
|
invoke-virtual/range {v18 .. v19}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v3
|
|
|
|
check-cast v3, Ljava/lang/reflect/Field;
|
|
|
|
invoke-virtual {v3}, Ljava/lang/reflect/Field;->getType()Ljava/lang/Class;
|
|
|
|
move-result-object v3
|
|
|
|
aput-object v3, v17, v19
|
|
|
|
add-int/lit8 v19, v19, 0x1
|
|
|
|
goto :goto_3
|
|
|
|
:cond_4
|
|
invoke-virtual/range {p0 .. p0}, Ljava/lang/Class;->getName()Ljava/lang/String;
|
|
|
|
move-result-object v12
|
|
|
|
.local v12, "className":Ljava/lang/String;
|
|
new-instance v3, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
invoke-virtual {v3, v12}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v3
|
|
|
|
const-string v4, "FieldAccess"
|
|
|
|
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v11
|
|
|
|
.local v11, "accessClassName":Ljava/lang/String;
|
|
const-string v3, "java."
|
|
|
|
invoke-virtual {v11, v3}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z
|
|
|
|
move-result v3
|
|
|
|
if-eqz v3, :cond_5
|
|
|
|
new-instance v3, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v4, "reflectasm."
|
|
|
|
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-virtual {v3, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v11
|
|
|
|
:cond_5
|
|
const/4 v10, 0x0
|
|
|
|
.local v10, "accessClass":Ljava/lang/Class;
|
|
invoke-static/range {p0 .. p0}, Lcom/esotericsoftware/reflectasm/AccessClassLoader;->get(Ljava/lang/Class;)Lcom/esotericsoftware/reflectasm/AccessClassLoader;
|
|
|
|
move-result-object v21
|
|
|
|
.local v21, "loader":Lcom/esotericsoftware/reflectasm/AccessClassLoader;
|
|
monitor-enter v21
|
|
|
|
:try_start_0
|
|
move-object/from16 v0, v21
|
|
|
|
invoke-virtual {v0, v11}, Lcom/esotericsoftware/reflectasm/AccessClassLoader;->loadClass(Ljava/lang/String;)Ljava/lang/Class;
|
|
:try_end_0
|
|
.catch Ljava/lang/ClassNotFoundException; {:try_start_0 .. :try_end_0} :catch_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
move-result-object v10
|
|
|
|
:goto_4
|
|
:try_start_1
|
|
monitor-exit v21
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
:try_start_2
|
|
invoke-virtual {v10}, Ljava/lang/Class;->newInstance()Ljava/lang/Object;
|
|
|
|
move-result-object v9
|
|
|
|
check-cast v9, Lcom/esotericsoftware/reflectasm/FieldAccess;
|
|
|
|
.local v9, "access":Lcom/esotericsoftware/reflectasm/FieldAccess;
|
|
move-object/from16 v0, v16
|
|
|
|
iput-object v0, v9, Lcom/esotericsoftware/reflectasm/FieldAccess;->fieldNames:[Ljava/lang/String;
|
|
|
|
move-object/from16 v0, v17
|
|
|
|
iput-object v0, v9, Lcom/esotericsoftware/reflectasm/FieldAccess;->fieldTypes:[Ljava/lang/Class;
|
|
:try_end_2
|
|
.catch Ljava/lang/Throwable; {:try_start_2 .. :try_end_2} :catch_1
|
|
|
|
return-object v9
|
|
|
|
.end local v9 # "access":Lcom/esotericsoftware/reflectasm/FieldAccess;
|
|
:catch_0
|
|
move-exception v20
|
|
|
|
.local v20, "ignored":Ljava/lang/ClassNotFoundException;
|
|
const/16 v3, 0x2e
|
|
|
|
const/16 v4, 0x2f
|
|
|
|
:try_start_3
|
|
invoke-virtual {v11, v3, v4}, Ljava/lang/String;->replace(CC)Ljava/lang/String;
|
|
|
|
move-result-object v5
|
|
|
|
.local v5, "accessClassNameInternal":Ljava/lang/String;
|
|
const/16 v3, 0x2e
|
|
|
|
const/16 v4, 0x2f
|
|
|
|
invoke-virtual {v12, v3, v4}, Ljava/lang/String;->replace(CC)Ljava/lang/String;
|
|
|
|
move-result-object v13
|
|
|
|
.local v13, "classNameInternal":Ljava/lang/String;
|
|
new-instance v2, Lorg/objectweb/asm/ClassWriter;
|
|
|
|
const/4 v3, 0x0
|
|
|
|
invoke-direct {v2, v3}, Lorg/objectweb/asm/ClassWriter;-><init>(I)V
|
|
|
|
.local v2, "cw":Lorg/objectweb/asm/ClassWriter;
|
|
const v3, 0x3002d
|
|
|
|
const/16 v4, 0x21
|
|
|
|
const/4 v6, 0x0
|
|
|
|
const-string v7, "com/esotericsoftware/reflectasm/FieldAccess"
|
|
|
|
const/4 v8, 0x0
|
|
|
|
invoke-virtual/range {v2 .. v8}, Lorg/objectweb/asm/ClassWriter;->visit(IILjava/lang/String;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;)V
|
|
|
|
invoke-static {v2}, Lcom/esotericsoftware/reflectasm/FieldAccess;->insertConstructor(Lorg/objectweb/asm/ClassWriter;)V
|
|
|
|
move-object/from16 v0, v18
|
|
|
|
invoke-static {v2, v13, v0}, Lcom/esotericsoftware/reflectasm/FieldAccess;->insertGetObject(Lorg/objectweb/asm/ClassWriter;Ljava/lang/String;Ljava/util/ArrayList;)V
|
|
|
|
move-object/from16 v0, v18
|
|
|
|
invoke-static {v2, v13, v0}, Lcom/esotericsoftware/reflectasm/FieldAccess;->insertSetObject(Lorg/objectweb/asm/ClassWriter;Ljava/lang/String;Ljava/util/ArrayList;)V
|
|
|
|
sget-object v3, Lorg/objectweb/asm/Type;->BOOLEAN_TYPE:Lorg/objectweb/asm/Type;
|
|
|
|
move-object/from16 v0, v18
|
|
|
|
invoke-static {v2, v13, v0, v3}, Lcom/esotericsoftware/reflectasm/FieldAccess;->insertGetPrimitive(Lorg/objectweb/asm/ClassWriter;Ljava/lang/String;Ljava/util/ArrayList;Lorg/objectweb/asm/Type;)V
|
|
|
|
sget-object v3, Lorg/objectweb/asm/Type;->BOOLEAN_TYPE:Lorg/objectweb/asm/Type;
|
|
|
|
move-object/from16 v0, v18
|
|
|
|
invoke-static {v2, v13, v0, v3}, Lcom/esotericsoftware/reflectasm/FieldAccess;->insertSetPrimitive(Lorg/objectweb/asm/ClassWriter;Ljava/lang/String;Ljava/util/ArrayList;Lorg/objectweb/asm/Type;)V
|
|
|
|
sget-object v3, Lorg/objectweb/asm/Type;->BYTE_TYPE:Lorg/objectweb/asm/Type;
|
|
|
|
move-object/from16 v0, v18
|
|
|
|
invoke-static {v2, v13, v0, v3}, Lcom/esotericsoftware/reflectasm/FieldAccess;->insertGetPrimitive(Lorg/objectweb/asm/ClassWriter;Ljava/lang/String;Ljava/util/ArrayList;Lorg/objectweb/asm/Type;)V
|
|
|
|
sget-object v3, Lorg/objectweb/asm/Type;->BYTE_TYPE:Lorg/objectweb/asm/Type;
|
|
|
|
move-object/from16 v0, v18
|
|
|
|
invoke-static {v2, v13, v0, v3}, Lcom/esotericsoftware/reflectasm/FieldAccess;->insertSetPrimitive(Lorg/objectweb/asm/ClassWriter;Ljava/lang/String;Ljava/util/ArrayList;Lorg/objectweb/asm/Type;)V
|
|
|
|
sget-object v3, Lorg/objectweb/asm/Type;->SHORT_TYPE:Lorg/objectweb/asm/Type;
|
|
|
|
move-object/from16 v0, v18
|
|
|
|
invoke-static {v2, v13, v0, v3}, Lcom/esotericsoftware/reflectasm/FieldAccess;->insertGetPrimitive(Lorg/objectweb/asm/ClassWriter;Ljava/lang/String;Ljava/util/ArrayList;Lorg/objectweb/asm/Type;)V
|
|
|
|
sget-object v3, Lorg/objectweb/asm/Type;->SHORT_TYPE:Lorg/objectweb/asm/Type;
|
|
|
|
move-object/from16 v0, v18
|
|
|
|
invoke-static {v2, v13, v0, v3}, Lcom/esotericsoftware/reflectasm/FieldAccess;->insertSetPrimitive(Lorg/objectweb/asm/ClassWriter;Ljava/lang/String;Ljava/util/ArrayList;Lorg/objectweb/asm/Type;)V
|
|
|
|
sget-object v3, Lorg/objectweb/asm/Type;->INT_TYPE:Lorg/objectweb/asm/Type;
|
|
|
|
move-object/from16 v0, v18
|
|
|
|
invoke-static {v2, v13, v0, v3}, Lcom/esotericsoftware/reflectasm/FieldAccess;->insertGetPrimitive(Lorg/objectweb/asm/ClassWriter;Ljava/lang/String;Ljava/util/ArrayList;Lorg/objectweb/asm/Type;)V
|
|
|
|
sget-object v3, Lorg/objectweb/asm/Type;->INT_TYPE:Lorg/objectweb/asm/Type;
|
|
|
|
move-object/from16 v0, v18
|
|
|
|
invoke-static {v2, v13, v0, v3}, Lcom/esotericsoftware/reflectasm/FieldAccess;->insertSetPrimitive(Lorg/objectweb/asm/ClassWriter;Ljava/lang/String;Ljava/util/ArrayList;Lorg/objectweb/asm/Type;)V
|
|
|
|
sget-object v3, Lorg/objectweb/asm/Type;->LONG_TYPE:Lorg/objectweb/asm/Type;
|
|
|
|
move-object/from16 v0, v18
|
|
|
|
invoke-static {v2, v13, v0, v3}, Lcom/esotericsoftware/reflectasm/FieldAccess;->insertGetPrimitive(Lorg/objectweb/asm/ClassWriter;Ljava/lang/String;Ljava/util/ArrayList;Lorg/objectweb/asm/Type;)V
|
|
|
|
sget-object v3, Lorg/objectweb/asm/Type;->LONG_TYPE:Lorg/objectweb/asm/Type;
|
|
|
|
move-object/from16 v0, v18
|
|
|
|
invoke-static {v2, v13, v0, v3}, Lcom/esotericsoftware/reflectasm/FieldAccess;->insertSetPrimitive(Lorg/objectweb/asm/ClassWriter;Ljava/lang/String;Ljava/util/ArrayList;Lorg/objectweb/asm/Type;)V
|
|
|
|
sget-object v3, Lorg/objectweb/asm/Type;->DOUBLE_TYPE:Lorg/objectweb/asm/Type;
|
|
|
|
move-object/from16 v0, v18
|
|
|
|
invoke-static {v2, v13, v0, v3}, Lcom/esotericsoftware/reflectasm/FieldAccess;->insertGetPrimitive(Lorg/objectweb/asm/ClassWriter;Ljava/lang/String;Ljava/util/ArrayList;Lorg/objectweb/asm/Type;)V
|
|
|
|
sget-object v3, Lorg/objectweb/asm/Type;->DOUBLE_TYPE:Lorg/objectweb/asm/Type;
|
|
|
|
move-object/from16 v0, v18
|
|
|
|
invoke-static {v2, v13, v0, v3}, Lcom/esotericsoftware/reflectasm/FieldAccess;->insertSetPrimitive(Lorg/objectweb/asm/ClassWriter;Ljava/lang/String;Ljava/util/ArrayList;Lorg/objectweb/asm/Type;)V
|
|
|
|
sget-object v3, Lorg/objectweb/asm/Type;->FLOAT_TYPE:Lorg/objectweb/asm/Type;
|
|
|
|
move-object/from16 v0, v18
|
|
|
|
invoke-static {v2, v13, v0, v3}, Lcom/esotericsoftware/reflectasm/FieldAccess;->insertGetPrimitive(Lorg/objectweb/asm/ClassWriter;Ljava/lang/String;Ljava/util/ArrayList;Lorg/objectweb/asm/Type;)V
|
|
|
|
sget-object v3, Lorg/objectweb/asm/Type;->FLOAT_TYPE:Lorg/objectweb/asm/Type;
|
|
|
|
move-object/from16 v0, v18
|
|
|
|
invoke-static {v2, v13, v0, v3}, Lcom/esotericsoftware/reflectasm/FieldAccess;->insertSetPrimitive(Lorg/objectweb/asm/ClassWriter;Ljava/lang/String;Ljava/util/ArrayList;Lorg/objectweb/asm/Type;)V
|
|
|
|
sget-object v3, Lorg/objectweb/asm/Type;->CHAR_TYPE:Lorg/objectweb/asm/Type;
|
|
|
|
move-object/from16 v0, v18
|
|
|
|
invoke-static {v2, v13, v0, v3}, Lcom/esotericsoftware/reflectasm/FieldAccess;->insertGetPrimitive(Lorg/objectweb/asm/ClassWriter;Ljava/lang/String;Ljava/util/ArrayList;Lorg/objectweb/asm/Type;)V
|
|
|
|
sget-object v3, Lorg/objectweb/asm/Type;->CHAR_TYPE:Lorg/objectweb/asm/Type;
|
|
|
|
move-object/from16 v0, v18
|
|
|
|
invoke-static {v2, v13, v0, v3}, Lcom/esotericsoftware/reflectasm/FieldAccess;->insertSetPrimitive(Lorg/objectweb/asm/ClassWriter;Ljava/lang/String;Ljava/util/ArrayList;Lorg/objectweb/asm/Type;)V
|
|
|
|
move-object/from16 v0, v18
|
|
|
|
invoke-static {v2, v13, v0}, Lcom/esotericsoftware/reflectasm/FieldAccess;->insertGetString(Lorg/objectweb/asm/ClassWriter;Ljava/lang/String;Ljava/util/ArrayList;)V
|
|
|
|
invoke-virtual {v2}, Lorg/objectweb/asm/ClassWriter;->visitEnd()V
|
|
|
|
invoke-virtual {v2}, Lorg/objectweb/asm/ClassWriter;->toByteArray()[B
|
|
|
|
move-result-object v3
|
|
|
|
move-object/from16 v0, v21
|
|
|
|
invoke-virtual {v0, v11, v3}, Lcom/esotericsoftware/reflectasm/AccessClassLoader;->defineClass(Ljava/lang/String;[B)Ljava/lang/Class;
|
|
|
|
move-result-object v10
|
|
|
|
goto/16 :goto_4
|
|
|
|
.end local v2 # "cw":Lorg/objectweb/asm/ClassWriter;
|
|
.end local v5 # "accessClassNameInternal":Ljava/lang/String;
|
|
.end local v13 # "classNameInternal":Ljava/lang/String;
|
|
.end local v20 # "ignored":Ljava/lang/ClassNotFoundException;
|
|
:catchall_0
|
|
move-exception v3
|
|
|
|
monitor-exit v21
|
|
:try_end_3
|
|
.catchall {:try_start_3 .. :try_end_3} :catchall_0
|
|
|
|
throw v3
|
|
|
|
:catch_1
|
|
move-exception v25
|
|
|
|
.local v25, "t":Ljava/lang/Throwable;
|
|
new-instance v3, Ljava/lang/RuntimeException;
|
|
|
|
new-instance v4, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v6, "Error constructing field access class: "
|
|
|
|
invoke-virtual {v4, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-virtual {v4, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v4
|
|
|
|
move-object/from16 v0, v25
|
|
|
|
invoke-direct {v3, v4, v0}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
|
|
|
|
throw v3
|
|
.end method
|
|
|
|
.method private static insertConstructor(Lorg/objectweb/asm/ClassWriter;)V
|
|
.locals 7
|
|
.param p0, "cw" # Lorg/objectweb/asm/ClassWriter;
|
|
|
|
.prologue
|
|
const/4 v4, 0x0
|
|
|
|
const/4 v1, 0x1
|
|
|
|
const-string v2, "<init>"
|
|
|
|
const-string v3, "()V"
|
|
|
|
move-object v0, p0
|
|
|
|
move-object v5, v4
|
|
|
|
invoke-virtual/range {v0 .. v5}, Lorg/objectweb/asm/ClassWriter;->visitMethod(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;)Lorg/objectweb/asm/MethodVisitor;
|
|
|
|
move-result-object v6
|
|
|
|
.local v6, "mv":Lorg/objectweb/asm/MethodVisitor;
|
|
invoke-virtual {v6}, Lorg/objectweb/asm/MethodVisitor;->visitCode()V
|
|
|
|
const/16 v0, 0x19
|
|
|
|
const/4 v2, 0x0
|
|
|
|
invoke-virtual {v6, v0, v2}, Lorg/objectweb/asm/MethodVisitor;->visitVarInsn(II)V
|
|
|
|
const/16 v0, 0xb7
|
|
|
|
const-string v2, "com/esotericsoftware/reflectasm/FieldAccess"
|
|
|
|
const-string v3, "<init>"
|
|
|
|
const-string v4, "()V"
|
|
|
|
invoke-virtual {v6, v0, v2, v3, v4}, Lorg/objectweb/asm/MethodVisitor;->visitMethodInsn(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
const/16 v0, 0xb1
|
|
|
|
invoke-virtual {v6, v0}, Lorg/objectweb/asm/MethodVisitor;->visitInsn(I)V
|
|
|
|
invoke-virtual {v6, v1, v1}, Lorg/objectweb/asm/MethodVisitor;->visitMaxs(II)V
|
|
|
|
invoke-virtual {v6}, Lorg/objectweb/asm/MethodVisitor;->visitEnd()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private static insertGetObject(Lorg/objectweb/asm/ClassWriter;Ljava/lang/String;Ljava/util/ArrayList;)V
|
|
.locals 13
|
|
.param p0, "cw" # Lorg/objectweb/asm/ClassWriter;
|
|
.param p1, "classNameInternal" # Ljava/lang/String;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Lorg/objectweb/asm/ClassWriter;",
|
|
"Ljava/lang/String;",
|
|
"Ljava/util/ArrayList",
|
|
"<",
|
|
"Ljava/lang/reflect/Field;",
|
|
">;)V"
|
|
}
|
|
.end annotation
|
|
|
|
.prologue
|
|
.local p2, "fields":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Ljava/lang/reflect/Field;>;"
|
|
const/4 v11, 0x6
|
|
|
|
.local v11, "maxStack":I
|
|
const/4 v1, 0x1
|
|
|
|
const-string v2, "get"
|
|
|
|
const-string v3, "(Ljava/lang/Object;I)Ljava/lang/Object;"
|
|
|
|
const/4 v4, 0x0
|
|
|
|
const/4 v5, 0x0
|
|
|
|
move-object v0, p0
|
|
|
|
invoke-virtual/range {v0 .. v5}, Lorg/objectweb/asm/ClassWriter;->visitMethod(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;)Lorg/objectweb/asm/MethodVisitor;
|
|
|
|
move-result-object v0
|
|
|
|
.local v0, "mv":Lorg/objectweb/asm/MethodVisitor;
|
|
invoke-virtual {v0}, Lorg/objectweb/asm/MethodVisitor;->visitCode()V
|
|
|
|
const/16 v1, 0x15
|
|
|
|
const/4 v2, 0x2
|
|
|
|
invoke-virtual {v0, v1, v2}, Lorg/objectweb/asm/MethodVisitor;->visitVarInsn(II)V
|
|
|
|
invoke-virtual {p2}, Ljava/util/ArrayList;->isEmpty()Z
|
|
|
|
move-result v1
|
|
|
|
if-nez v1, :cond_2
|
|
|
|
add-int/lit8 v11, v11, -0x1
|
|
|
|
invoke-virtual {p2}, Ljava/util/ArrayList;->size()I
|
|
|
|
move-result v1
|
|
|
|
new-array v10, v1, [Lorg/objectweb/asm/Label;
|
|
|
|
.local v10, "labels":[Lorg/objectweb/asm/Label;
|
|
const/4 v9, 0x0
|
|
|
|
.local v9, "i":I
|
|
array-length v12, v10
|
|
|
|
.local v12, "n":I
|
|
:goto_0
|
|
if-ge v9, v12, :cond_0
|
|
|
|
new-instance v1, Lorg/objectweb/asm/Label;
|
|
|
|
invoke-direct {v1}, Lorg/objectweb/asm/Label;-><init>()V
|
|
|
|
aput-object v1, v10, v9
|
|
|
|
add-int/lit8 v9, v9, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
new-instance v6, Lorg/objectweb/asm/Label;
|
|
|
|
invoke-direct {v6}, Lorg/objectweb/asm/Label;-><init>()V
|
|
|
|
.local v6, "defaultLabel":Lorg/objectweb/asm/Label;
|
|
const/4 v1, 0x0
|
|
|
|
array-length v2, v10
|
|
|
|
add-int/lit8 v2, v2, -0x1
|
|
|
|
invoke-virtual {v0, v1, v2, v6, v10}, Lorg/objectweb/asm/MethodVisitor;->visitTableSwitchInsn(IILorg/objectweb/asm/Label;[Lorg/objectweb/asm/Label;)V
|
|
|
|
const/4 v9, 0x0
|
|
|
|
array-length v12, v10
|
|
|
|
:goto_1
|
|
if-ge v9, v12, :cond_1
|
|
|
|
invoke-virtual {p2, v9}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v7
|
|
|
|
check-cast v7, Ljava/lang/reflect/Field;
|
|
|
|
.local v7, "field":Ljava/lang/reflect/Field;
|
|
aget-object v1, v10, v9
|
|
|
|
invoke-virtual {v0, v1}, Lorg/objectweb/asm/MethodVisitor;->visitLabel(Lorg/objectweb/asm/Label;)V
|
|
|
|
const/4 v1, 0x3
|
|
|
|
const/4 v2, 0x0
|
|
|
|
const/4 v3, 0x0
|
|
|
|
const/4 v4, 0x0
|
|
|
|
const/4 v5, 0x0
|
|
|
|
invoke-virtual/range {v0 .. v5}, Lorg/objectweb/asm/MethodVisitor;->visitFrame(II[Ljava/lang/Object;I[Ljava/lang/Object;)V
|
|
|
|
const/16 v1, 0x19
|
|
|
|
const/4 v2, 0x1
|
|
|
|
invoke-virtual {v0, v1, v2}, Lorg/objectweb/asm/MethodVisitor;->visitVarInsn(II)V
|
|
|
|
const/16 v1, 0xc0
|
|
|
|
invoke-virtual {v0, v1, p1}, Lorg/objectweb/asm/MethodVisitor;->visitTypeInsn(ILjava/lang/String;)V
|
|
|
|
const/16 v1, 0xb4
|
|
|
|
invoke-virtual {v7}, Ljava/lang/reflect/Field;->getName()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v7}, Ljava/lang/reflect/Field;->getType()Ljava/lang/Class;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-static {v3}, Lorg/objectweb/asm/Type;->getDescriptor(Ljava/lang/Class;)Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-virtual {v0, v1, p1, v2, v3}, Lorg/objectweb/asm/MethodVisitor;->visitFieldInsn(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v7}, Ljava/lang/reflect/Field;->getType()Ljava/lang/Class;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-static {v1}, Lorg/objectweb/asm/Type;->getType(Ljava/lang/Class;)Lorg/objectweb/asm/Type;
|
|
|
|
move-result-object v8
|
|
|
|
.local v8, "fieldType":Lorg/objectweb/asm/Type;
|
|
invoke-virtual {v8}, Lorg/objectweb/asm/Type;->getSort()I
|
|
|
|
move-result v1
|
|
|
|
packed-switch v1, :pswitch_data_0
|
|
|
|
:goto_2
|
|
const/16 v1, 0xb0
|
|
|
|
invoke-virtual {v0, v1}, Lorg/objectweb/asm/MethodVisitor;->visitInsn(I)V
|
|
|
|
add-int/lit8 v9, v9, 0x1
|
|
|
|
goto :goto_1
|
|
|
|
:pswitch_0
|
|
const/16 v1, 0xb8
|
|
|
|
const-string v2, "java/lang/Boolean"
|
|
|
|
const-string v3, "valueOf"
|
|
|
|
const-string v4, "(Z)Ljava/lang/Boolean;"
|
|
|
|
invoke-virtual {v0, v1, v2, v3, v4}, Lorg/objectweb/asm/MethodVisitor;->visitMethodInsn(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
goto :goto_2
|
|
|
|
:pswitch_1
|
|
const/16 v1, 0xb8
|
|
|
|
const-string v2, "java/lang/Byte"
|
|
|
|
const-string v3, "valueOf"
|
|
|
|
const-string v4, "(B)Ljava/lang/Byte;"
|
|
|
|
invoke-virtual {v0, v1, v2, v3, v4}, Lorg/objectweb/asm/MethodVisitor;->visitMethodInsn(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
goto :goto_2
|
|
|
|
:pswitch_2
|
|
const/16 v1, 0xb8
|
|
|
|
const-string v2, "java/lang/Character"
|
|
|
|
const-string v3, "valueOf"
|
|
|
|
const-string v4, "(C)Ljava/lang/Character;"
|
|
|
|
invoke-virtual {v0, v1, v2, v3, v4}, Lorg/objectweb/asm/MethodVisitor;->visitMethodInsn(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
goto :goto_2
|
|
|
|
:pswitch_3
|
|
const/16 v1, 0xb8
|
|
|
|
const-string v2, "java/lang/Short"
|
|
|
|
const-string v3, "valueOf"
|
|
|
|
const-string v4, "(S)Ljava/lang/Short;"
|
|
|
|
invoke-virtual {v0, v1, v2, v3, v4}, Lorg/objectweb/asm/MethodVisitor;->visitMethodInsn(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
goto :goto_2
|
|
|
|
:pswitch_4
|
|
const/16 v1, 0xb8
|
|
|
|
const-string v2, "java/lang/Integer"
|
|
|
|
const-string v3, "valueOf"
|
|
|
|
const-string v4, "(I)Ljava/lang/Integer;"
|
|
|
|
invoke-virtual {v0, v1, v2, v3, v4}, Lorg/objectweb/asm/MethodVisitor;->visitMethodInsn(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
goto :goto_2
|
|
|
|
:pswitch_5
|
|
const/16 v1, 0xb8
|
|
|
|
const-string v2, "java/lang/Float"
|
|
|
|
const-string v3, "valueOf"
|
|
|
|
const-string v4, "(F)Ljava/lang/Float;"
|
|
|
|
invoke-virtual {v0, v1, v2, v3, v4}, Lorg/objectweb/asm/MethodVisitor;->visitMethodInsn(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
goto :goto_2
|
|
|
|
:pswitch_6
|
|
const/16 v1, 0xb8
|
|
|
|
const-string v2, "java/lang/Long"
|
|
|
|
const-string v3, "valueOf"
|
|
|
|
const-string v4, "(J)Ljava/lang/Long;"
|
|
|
|
invoke-virtual {v0, v1, v2, v3, v4}, Lorg/objectweb/asm/MethodVisitor;->visitMethodInsn(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
goto :goto_2
|
|
|
|
:pswitch_7
|
|
const/16 v1, 0xb8
|
|
|
|
const-string v2, "java/lang/Double"
|
|
|
|
const-string v3, "valueOf"
|
|
|
|
const-string v4, "(D)Ljava/lang/Double;"
|
|
|
|
invoke-virtual {v0, v1, v2, v3, v4}, Lorg/objectweb/asm/MethodVisitor;->visitMethodInsn(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
goto :goto_2
|
|
|
|
.end local v7 # "field":Ljava/lang/reflect/Field;
|
|
.end local v8 # "fieldType":Lorg/objectweb/asm/Type;
|
|
:cond_1
|
|
invoke-virtual {v0, v6}, Lorg/objectweb/asm/MethodVisitor;->visitLabel(Lorg/objectweb/asm/Label;)V
|
|
|
|
const/4 v1, 0x3
|
|
|
|
const/4 v2, 0x0
|
|
|
|
const/4 v3, 0x0
|
|
|
|
const/4 v4, 0x0
|
|
|
|
const/4 v5, 0x0
|
|
|
|
invoke-virtual/range {v0 .. v5}, Lorg/objectweb/asm/MethodVisitor;->visitFrame(II[Ljava/lang/Object;I[Ljava/lang/Object;)V
|
|
|
|
.end local v6 # "defaultLabel":Lorg/objectweb/asm/Label;
|
|
.end local v9 # "i":I
|
|
.end local v10 # "labels":[Lorg/objectweb/asm/Label;
|
|
.end local v12 # "n":I
|
|
:cond_2
|
|
invoke-static {v0}, Lcom/esotericsoftware/reflectasm/FieldAccess;->insertThrowExceptionForFieldNotFound(Lorg/objectweb/asm/MethodVisitor;)Lorg/objectweb/asm/MethodVisitor;
|
|
|
|
const/4 v1, 0x3
|
|
|
|
invoke-virtual {v0, v11, v1}, Lorg/objectweb/asm/MethodVisitor;->visitMaxs(II)V
|
|
|
|
invoke-virtual {v0}, Lorg/objectweb/asm/MethodVisitor;->visitEnd()V
|
|
|
|
return-void
|
|
|
|
:pswitch_data_0
|
|
.packed-switch 0x1
|
|
:pswitch_0
|
|
:pswitch_2
|
|
:pswitch_1
|
|
:pswitch_3
|
|
:pswitch_4
|
|
:pswitch_5
|
|
:pswitch_6
|
|
:pswitch_7
|
|
.end packed-switch
|
|
.end method
|
|
|
|
.method private static insertGetPrimitive(Lorg/objectweb/asm/ClassWriter;Ljava/lang/String;Ljava/util/ArrayList;Lorg/objectweb/asm/Type;)V
|
|
.locals 21
|
|
.param p0, "cw" # Lorg/objectweb/asm/ClassWriter;
|
|
.param p1, "classNameInternal" # Ljava/lang/String;
|
|
.param p3, "primitiveType" # Lorg/objectweb/asm/Type;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Lorg/objectweb/asm/ClassWriter;",
|
|
"Ljava/lang/String;",
|
|
"Ljava/util/ArrayList",
|
|
"<",
|
|
"Ljava/lang/reflect/Field;",
|
|
">;",
|
|
"Lorg/objectweb/asm/Type;",
|
|
")V"
|
|
}
|
|
.end annotation
|
|
|
|
.prologue
|
|
.local p2, "fields":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Ljava/lang/reflect/Field;>;"
|
|
const/16 v17, 0x6
|
|
|
|
.local v17, "maxStack":I
|
|
invoke-virtual/range {p3 .. p3}, Lorg/objectweb/asm/Type;->getDescriptor()Ljava/lang/String;
|
|
|
|
move-result-object v20
|
|
|
|
.local v20, "typeNameInternal":Ljava/lang/String;
|
|
invoke-virtual/range {p3 .. p3}, Lorg/objectweb/asm/Type;->getSort()I
|
|
|
|
move-result v2
|
|
|
|
packed-switch v2, :pswitch_data_0
|
|
|
|
const-string v4, "get"
|
|
|
|
.local v4, "getterMethodName":Ljava/lang/String;
|
|
const/16 v19, 0xb0
|
|
|
|
.local v19, "returnValueInstruction":I
|
|
:goto_0
|
|
const/4 v3, 0x1
|
|
|
|
new-instance v2, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v6, "(Ljava/lang/Object;I)"
|
|
|
|
invoke-virtual {v2, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v2
|
|
|
|
move-object/from16 v0, v20
|
|
|
|
invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v5
|
|
|
|
const/4 v6, 0x0
|
|
|
|
const/4 v7, 0x0
|
|
|
|
move-object/from16 v2, p0
|
|
|
|
invoke-virtual/range {v2 .. v7}, Lorg/objectweb/asm/ClassWriter;->visitMethod(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;)Lorg/objectweb/asm/MethodVisitor;
|
|
|
|
move-result-object v5
|
|
|
|
.local v5, "mv":Lorg/objectweb/asm/MethodVisitor;
|
|
invoke-virtual {v5}, Lorg/objectweb/asm/MethodVisitor;->visitCode()V
|
|
|
|
const/16 v2, 0x15
|
|
|
|
const/4 v3, 0x2
|
|
|
|
invoke-virtual {v5, v2, v3}, Lorg/objectweb/asm/MethodVisitor;->visitVarInsn(II)V
|
|
|
|
invoke-virtual/range {p2 .. p2}, Ljava/util/ArrayList;->isEmpty()Z
|
|
|
|
move-result v2
|
|
|
|
if-nez v2, :cond_5
|
|
|
|
add-int/lit8 v17, v17, -0x1
|
|
|
|
invoke-virtual/range {p2 .. p2}, Ljava/util/ArrayList;->size()I
|
|
|
|
move-result v2
|
|
|
|
new-array v0, v2, [Lorg/objectweb/asm/Label;
|
|
|
|
move-object/from16 v16, v0
|
|
|
|
.local v16, "labels":[Lorg/objectweb/asm/Label;
|
|
new-instance v15, Lorg/objectweb/asm/Label;
|
|
|
|
invoke-direct {v15}, Lorg/objectweb/asm/Label;-><init>()V
|
|
|
|
.local v15, "labelForInvalidTypes":Lorg/objectweb/asm/Label;
|
|
const/4 v13, 0x0
|
|
|
|
.local v13, "hasAnyBadTypeLabel":Z
|
|
const/4 v14, 0x0
|
|
|
|
.local v14, "i":I
|
|
move-object/from16 v0, v16
|
|
|
|
array-length v0, v0
|
|
|
|
move/from16 v18, v0
|
|
|
|
.local v18, "n":I
|
|
:goto_1
|
|
move/from16 v0, v18
|
|
|
|
if-ge v14, v0, :cond_1
|
|
|
|
move-object/from16 v0, p2
|
|
|
|
invoke-virtual {v0, v14}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Ljava/lang/reflect/Field;
|
|
|
|
invoke-virtual {v2}, Ljava/lang/reflect/Field;->getType()Ljava/lang/Class;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-static {v2}, Lorg/objectweb/asm/Type;->getType(Ljava/lang/Class;)Lorg/objectweb/asm/Type;
|
|
|
|
move-result-object v2
|
|
|
|
move-object/from16 v0, p3
|
|
|
|
invoke-virtual {v2, v0}, Lorg/objectweb/asm/Type;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
new-instance v2, Lorg/objectweb/asm/Label;
|
|
|
|
invoke-direct {v2}, Lorg/objectweb/asm/Label;-><init>()V
|
|
|
|
aput-object v2, v16, v14
|
|
|
|
:goto_2
|
|
add-int/lit8 v14, v14, 0x1
|
|
|
|
goto :goto_1
|
|
|
|
.end local v4 # "getterMethodName":Ljava/lang/String;
|
|
.end local v5 # "mv":Lorg/objectweb/asm/MethodVisitor;
|
|
.end local v13 # "hasAnyBadTypeLabel":Z
|
|
.end local v14 # "i":I
|
|
.end local v15 # "labelForInvalidTypes":Lorg/objectweb/asm/Label;
|
|
.end local v16 # "labels":[Lorg/objectweb/asm/Label;
|
|
.end local v18 # "n":I
|
|
.end local v19 # "returnValueInstruction":I
|
|
:pswitch_0
|
|
const-string v4, "getBoolean"
|
|
|
|
.restart local v4 # "getterMethodName":Ljava/lang/String;
|
|
const/16 v19, 0xac
|
|
|
|
.restart local v19 # "returnValueInstruction":I
|
|
goto :goto_0
|
|
|
|
.end local v4 # "getterMethodName":Ljava/lang/String;
|
|
.end local v19 # "returnValueInstruction":I
|
|
:pswitch_1
|
|
const-string v4, "getByte"
|
|
|
|
.restart local v4 # "getterMethodName":Ljava/lang/String;
|
|
const/16 v19, 0xac
|
|
|
|
.restart local v19 # "returnValueInstruction":I
|
|
goto :goto_0
|
|
|
|
.end local v4 # "getterMethodName":Ljava/lang/String;
|
|
.end local v19 # "returnValueInstruction":I
|
|
:pswitch_2
|
|
const-string v4, "getChar"
|
|
|
|
.restart local v4 # "getterMethodName":Ljava/lang/String;
|
|
const/16 v19, 0xac
|
|
|
|
.restart local v19 # "returnValueInstruction":I
|
|
goto :goto_0
|
|
|
|
.end local v4 # "getterMethodName":Ljava/lang/String;
|
|
.end local v19 # "returnValueInstruction":I
|
|
:pswitch_3
|
|
const-string v4, "getShort"
|
|
|
|
.restart local v4 # "getterMethodName":Ljava/lang/String;
|
|
const/16 v19, 0xac
|
|
|
|
.restart local v19 # "returnValueInstruction":I
|
|
goto :goto_0
|
|
|
|
.end local v4 # "getterMethodName":Ljava/lang/String;
|
|
.end local v19 # "returnValueInstruction":I
|
|
:pswitch_4
|
|
const-string v4, "getInt"
|
|
|
|
.restart local v4 # "getterMethodName":Ljava/lang/String;
|
|
const/16 v19, 0xac
|
|
|
|
.restart local v19 # "returnValueInstruction":I
|
|
goto/16 :goto_0
|
|
|
|
.end local v4 # "getterMethodName":Ljava/lang/String;
|
|
.end local v19 # "returnValueInstruction":I
|
|
:pswitch_5
|
|
const-string v4, "getFloat"
|
|
|
|
.restart local v4 # "getterMethodName":Ljava/lang/String;
|
|
const/16 v19, 0xae
|
|
|
|
.restart local v19 # "returnValueInstruction":I
|
|
goto/16 :goto_0
|
|
|
|
.end local v4 # "getterMethodName":Ljava/lang/String;
|
|
.end local v19 # "returnValueInstruction":I
|
|
:pswitch_6
|
|
const-string v4, "getLong"
|
|
|
|
.restart local v4 # "getterMethodName":Ljava/lang/String;
|
|
const/16 v19, 0xad
|
|
|
|
.restart local v19 # "returnValueInstruction":I
|
|
goto/16 :goto_0
|
|
|
|
.end local v4 # "getterMethodName":Ljava/lang/String;
|
|
.end local v19 # "returnValueInstruction":I
|
|
:pswitch_7
|
|
const-string v4, "getDouble"
|
|
|
|
.restart local v4 # "getterMethodName":Ljava/lang/String;
|
|
const/16 v19, 0xaf
|
|
|
|
.restart local v19 # "returnValueInstruction":I
|
|
goto/16 :goto_0
|
|
|
|
.restart local v5 # "mv":Lorg/objectweb/asm/MethodVisitor;
|
|
.restart local v13 # "hasAnyBadTypeLabel":Z
|
|
.restart local v14 # "i":I
|
|
.restart local v15 # "labelForInvalidTypes":Lorg/objectweb/asm/Label;
|
|
.restart local v16 # "labels":[Lorg/objectweb/asm/Label;
|
|
.restart local v18 # "n":I
|
|
:cond_0
|
|
aput-object v15, v16, v14
|
|
|
|
const/4 v13, 0x1
|
|
|
|
goto :goto_2
|
|
|
|
:cond_1
|
|
new-instance v11, Lorg/objectweb/asm/Label;
|
|
|
|
invoke-direct {v11}, Lorg/objectweb/asm/Label;-><init>()V
|
|
|
|
.local v11, "defaultLabel":Lorg/objectweb/asm/Label;
|
|
const/4 v2, 0x0
|
|
|
|
move-object/from16 v0, v16
|
|
|
|
array-length v3, v0
|
|
|
|
add-int/lit8 v3, v3, -0x1
|
|
|
|
move-object/from16 v0, v16
|
|
|
|
invoke-virtual {v5, v2, v3, v11, v0}, Lorg/objectweb/asm/MethodVisitor;->visitTableSwitchInsn(IILorg/objectweb/asm/Label;[Lorg/objectweb/asm/Label;)V
|
|
|
|
const/4 v14, 0x0
|
|
|
|
move-object/from16 v0, v16
|
|
|
|
array-length v0, v0
|
|
|
|
move/from16 v18, v0
|
|
|
|
:goto_3
|
|
move/from16 v0, v18
|
|
|
|
if-ge v14, v0, :cond_3
|
|
|
|
move-object/from16 v0, p2
|
|
|
|
invoke-virtual {v0, v14}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v12
|
|
|
|
check-cast v12, Ljava/lang/reflect/Field;
|
|
|
|
.local v12, "field":Ljava/lang/reflect/Field;
|
|
aget-object v2, v16, v14
|
|
|
|
invoke-virtual {v2, v15}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v2
|
|
|
|
if-nez v2, :cond_2
|
|
|
|
aget-object v2, v16, v14
|
|
|
|
invoke-virtual {v5, v2}, Lorg/objectweb/asm/MethodVisitor;->visitLabel(Lorg/objectweb/asm/Label;)V
|
|
|
|
const/4 v6, 0x3
|
|
|
|
const/4 v7, 0x0
|
|
|
|
const/4 v8, 0x0
|
|
|
|
const/4 v9, 0x0
|
|
|
|
const/4 v10, 0x0
|
|
|
|
invoke-virtual/range {v5 .. v10}, Lorg/objectweb/asm/MethodVisitor;->visitFrame(II[Ljava/lang/Object;I[Ljava/lang/Object;)V
|
|
|
|
const/16 v2, 0x19
|
|
|
|
const/4 v3, 0x1
|
|
|
|
invoke-virtual {v5, v2, v3}, Lorg/objectweb/asm/MethodVisitor;->visitVarInsn(II)V
|
|
|
|
const/16 v2, 0xc0
|
|
|
|
move-object/from16 v0, p1
|
|
|
|
invoke-virtual {v5, v2, v0}, Lorg/objectweb/asm/MethodVisitor;->visitTypeInsn(ILjava/lang/String;)V
|
|
|
|
const/16 v2, 0xb4
|
|
|
|
invoke-virtual {v12}, Ljava/lang/reflect/Field;->getName()Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
move-object/from16 v0, p1
|
|
|
|
move-object/from16 v1, v20
|
|
|
|
invoke-virtual {v5, v2, v0, v3, v1}, Lorg/objectweb/asm/MethodVisitor;->visitFieldInsn(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
move/from16 v0, v19
|
|
|
|
invoke-virtual {v5, v0}, Lorg/objectweb/asm/MethodVisitor;->visitInsn(I)V
|
|
|
|
:cond_2
|
|
add-int/lit8 v14, v14, 0x1
|
|
|
|
goto :goto_3
|
|
|
|
.end local v12 # "field":Ljava/lang/reflect/Field;
|
|
:cond_3
|
|
if-eqz v13, :cond_4
|
|
|
|
invoke-virtual {v5, v15}, Lorg/objectweb/asm/MethodVisitor;->visitLabel(Lorg/objectweb/asm/Label;)V
|
|
|
|
const/4 v6, 0x3
|
|
|
|
const/4 v7, 0x0
|
|
|
|
const/4 v8, 0x0
|
|
|
|
const/4 v9, 0x0
|
|
|
|
const/4 v10, 0x0
|
|
|
|
invoke-virtual/range {v5 .. v10}, Lorg/objectweb/asm/MethodVisitor;->visitFrame(II[Ljava/lang/Object;I[Ljava/lang/Object;)V
|
|
|
|
invoke-virtual/range {p3 .. p3}, Lorg/objectweb/asm/Type;->getClassName()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-static {v5, v2}, Lcom/esotericsoftware/reflectasm/FieldAccess;->insertThrowExceptionForFieldType(Lorg/objectweb/asm/MethodVisitor;Ljava/lang/String;)Lorg/objectweb/asm/MethodVisitor;
|
|
|
|
:cond_4
|
|
invoke-virtual {v5, v11}, Lorg/objectweb/asm/MethodVisitor;->visitLabel(Lorg/objectweb/asm/Label;)V
|
|
|
|
const/4 v6, 0x3
|
|
|
|
const/4 v7, 0x0
|
|
|
|
const/4 v8, 0x0
|
|
|
|
const/4 v9, 0x0
|
|
|
|
const/4 v10, 0x0
|
|
|
|
invoke-virtual/range {v5 .. v10}, Lorg/objectweb/asm/MethodVisitor;->visitFrame(II[Ljava/lang/Object;I[Ljava/lang/Object;)V
|
|
|
|
.end local v11 # "defaultLabel":Lorg/objectweb/asm/Label;
|
|
.end local v13 # "hasAnyBadTypeLabel":Z
|
|
.end local v14 # "i":I
|
|
.end local v15 # "labelForInvalidTypes":Lorg/objectweb/asm/Label;
|
|
.end local v16 # "labels":[Lorg/objectweb/asm/Label;
|
|
.end local v18 # "n":I
|
|
:cond_5
|
|
invoke-static {v5}, Lcom/esotericsoftware/reflectasm/FieldAccess;->insertThrowExceptionForFieldNotFound(Lorg/objectweb/asm/MethodVisitor;)Lorg/objectweb/asm/MethodVisitor;
|
|
|
|
move-result-object v5
|
|
|
|
const/4 v2, 0x3
|
|
|
|
move/from16 v0, v17
|
|
|
|
invoke-virtual {v5, v0, v2}, Lorg/objectweb/asm/MethodVisitor;->visitMaxs(II)V
|
|
|
|
invoke-virtual {v5}, Lorg/objectweb/asm/MethodVisitor;->visitEnd()V
|
|
|
|
return-void
|
|
|
|
:pswitch_data_0
|
|
.packed-switch 0x1
|
|
:pswitch_0
|
|
:pswitch_2
|
|
:pswitch_1
|
|
:pswitch_3
|
|
:pswitch_4
|
|
:pswitch_5
|
|
:pswitch_6
|
|
:pswitch_7
|
|
.end packed-switch
|
|
.end method
|
|
|
|
.method private static insertGetString(Lorg/objectweb/asm/ClassWriter;Ljava/lang/String;Ljava/util/ArrayList;)V
|
|
.locals 13
|
|
.param p0, "cw" # Lorg/objectweb/asm/ClassWriter;
|
|
.param p1, "classNameInternal" # Ljava/lang/String;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Lorg/objectweb/asm/ClassWriter;",
|
|
"Ljava/lang/String;",
|
|
"Ljava/util/ArrayList",
|
|
"<",
|
|
"Ljava/lang/reflect/Field;",
|
|
">;)V"
|
|
}
|
|
.end annotation
|
|
|
|
.prologue
|
|
.local p2, "fields":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Ljava/lang/reflect/Field;>;"
|
|
const/4 v11, 0x6
|
|
|
|
.local v11, "maxStack":I
|
|
const/4 v1, 0x1
|
|
|
|
const-string v2, "getString"
|
|
|
|
const-string v3, "(Ljava/lang/Object;I)Ljava/lang/String;"
|
|
|
|
const/4 v4, 0x0
|
|
|
|
const/4 v5, 0x0
|
|
|
|
move-object v0, p0
|
|
|
|
invoke-virtual/range {v0 .. v5}, Lorg/objectweb/asm/ClassWriter;->visitMethod(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;)Lorg/objectweb/asm/MethodVisitor;
|
|
|
|
move-result-object v0
|
|
|
|
.local v0, "mv":Lorg/objectweb/asm/MethodVisitor;
|
|
invoke-virtual {v0}, Lorg/objectweb/asm/MethodVisitor;->visitCode()V
|
|
|
|
const/16 v1, 0x15
|
|
|
|
const/4 v2, 0x2
|
|
|
|
invoke-virtual {v0, v1, v2}, Lorg/objectweb/asm/MethodVisitor;->visitVarInsn(II)V
|
|
|
|
invoke-virtual {p2}, Ljava/util/ArrayList;->isEmpty()Z
|
|
|
|
move-result v1
|
|
|
|
if-nez v1, :cond_5
|
|
|
|
add-int/lit8 v11, v11, -0x1
|
|
|
|
invoke-virtual {p2}, Ljava/util/ArrayList;->size()I
|
|
|
|
move-result v1
|
|
|
|
new-array v10, v1, [Lorg/objectweb/asm/Label;
|
|
|
|
.local v10, "labels":[Lorg/objectweb/asm/Label;
|
|
new-instance v9, Lorg/objectweb/asm/Label;
|
|
|
|
invoke-direct {v9}, Lorg/objectweb/asm/Label;-><init>()V
|
|
|
|
.local v9, "labelForInvalidTypes":Lorg/objectweb/asm/Label;
|
|
const/4 v7, 0x0
|
|
|
|
.local v7, "hasAnyBadTypeLabel":Z
|
|
const/4 v8, 0x0
|
|
|
|
.local v8, "i":I
|
|
array-length v12, v10
|
|
|
|
.local v12, "n":I
|
|
:goto_0
|
|
if-ge v8, v12, :cond_1
|
|
|
|
invoke-virtual {p2, v8}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Ljava/lang/reflect/Field;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/reflect/Field;->getType()Ljava/lang/Class;
|
|
|
|
move-result-object v1
|
|
|
|
const-class v2, Ljava/lang/String;
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
new-instance v1, Lorg/objectweb/asm/Label;
|
|
|
|
invoke-direct {v1}, Lorg/objectweb/asm/Label;-><init>()V
|
|
|
|
aput-object v1, v10, v8
|
|
|
|
:goto_1
|
|
add-int/lit8 v8, v8, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
aput-object v9, v10, v8
|
|
|
|
const/4 v7, 0x1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
new-instance v6, Lorg/objectweb/asm/Label;
|
|
|
|
invoke-direct {v6}, Lorg/objectweb/asm/Label;-><init>()V
|
|
|
|
.local v6, "defaultLabel":Lorg/objectweb/asm/Label;
|
|
const/4 v1, 0x0
|
|
|
|
array-length v2, v10
|
|
|
|
add-int/lit8 v2, v2, -0x1
|
|
|
|
invoke-virtual {v0, v1, v2, v6, v10}, Lorg/objectweb/asm/MethodVisitor;->visitTableSwitchInsn(IILorg/objectweb/asm/Label;[Lorg/objectweb/asm/Label;)V
|
|
|
|
const/4 v8, 0x0
|
|
|
|
array-length v12, v10
|
|
|
|
:goto_2
|
|
if-ge v8, v12, :cond_3
|
|
|
|
aget-object v1, v10, v8
|
|
|
|
invoke-virtual {v1, v9}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v1
|
|
|
|
if-nez v1, :cond_2
|
|
|
|
aget-object v1, v10, v8
|
|
|
|
invoke-virtual {v0, v1}, Lorg/objectweb/asm/MethodVisitor;->visitLabel(Lorg/objectweb/asm/Label;)V
|
|
|
|
const/4 v1, 0x3
|
|
|
|
const/4 v2, 0x0
|
|
|
|
const/4 v3, 0x0
|
|
|
|
const/4 v4, 0x0
|
|
|
|
const/4 v5, 0x0
|
|
|
|
invoke-virtual/range {v0 .. v5}, Lorg/objectweb/asm/MethodVisitor;->visitFrame(II[Ljava/lang/Object;I[Ljava/lang/Object;)V
|
|
|
|
const/16 v1, 0x19
|
|
|
|
const/4 v2, 0x1
|
|
|
|
invoke-virtual {v0, v1, v2}, Lorg/objectweb/asm/MethodVisitor;->visitVarInsn(II)V
|
|
|
|
const/16 v1, 0xc0
|
|
|
|
invoke-virtual {v0, v1, p1}, Lorg/objectweb/asm/MethodVisitor;->visitTypeInsn(ILjava/lang/String;)V
|
|
|
|
const/16 v2, 0xb4
|
|
|
|
invoke-virtual {p2, v8}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Ljava/lang/reflect/Field;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/reflect/Field;->getName()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
const-string v3, "Ljava/lang/String;"
|
|
|
|
invoke-virtual {v0, v2, p1, v1, v3}, Lorg/objectweb/asm/MethodVisitor;->visitFieldInsn(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
const/16 v1, 0xb0
|
|
|
|
invoke-virtual {v0, v1}, Lorg/objectweb/asm/MethodVisitor;->visitInsn(I)V
|
|
|
|
:cond_2
|
|
add-int/lit8 v8, v8, 0x1
|
|
|
|
goto :goto_2
|
|
|
|
:cond_3
|
|
if-eqz v7, :cond_4
|
|
|
|
invoke-virtual {v0, v9}, Lorg/objectweb/asm/MethodVisitor;->visitLabel(Lorg/objectweb/asm/Label;)V
|
|
|
|
const/4 v1, 0x3
|
|
|
|
const/4 v2, 0x0
|
|
|
|
const/4 v3, 0x0
|
|
|
|
const/4 v4, 0x0
|
|
|
|
const/4 v5, 0x0
|
|
|
|
invoke-virtual/range {v0 .. v5}, Lorg/objectweb/asm/MethodVisitor;->visitFrame(II[Ljava/lang/Object;I[Ljava/lang/Object;)V
|
|
|
|
const-string v1, "String"
|
|
|
|
invoke-static {v0, v1}, Lcom/esotericsoftware/reflectasm/FieldAccess;->insertThrowExceptionForFieldType(Lorg/objectweb/asm/MethodVisitor;Ljava/lang/String;)Lorg/objectweb/asm/MethodVisitor;
|
|
|
|
:cond_4
|
|
invoke-virtual {v0, v6}, Lorg/objectweb/asm/MethodVisitor;->visitLabel(Lorg/objectweb/asm/Label;)V
|
|
|
|
const/4 v1, 0x3
|
|
|
|
const/4 v2, 0x0
|
|
|
|
const/4 v3, 0x0
|
|
|
|
const/4 v4, 0x0
|
|
|
|
const/4 v5, 0x0
|
|
|
|
invoke-virtual/range {v0 .. v5}, Lorg/objectweb/asm/MethodVisitor;->visitFrame(II[Ljava/lang/Object;I[Ljava/lang/Object;)V
|
|
|
|
.end local v6 # "defaultLabel":Lorg/objectweb/asm/Label;
|
|
.end local v7 # "hasAnyBadTypeLabel":Z
|
|
.end local v8 # "i":I
|
|
.end local v9 # "labelForInvalidTypes":Lorg/objectweb/asm/Label;
|
|
.end local v10 # "labels":[Lorg/objectweb/asm/Label;
|
|
.end local v12 # "n":I
|
|
:cond_5
|
|
invoke-static {v0}, Lcom/esotericsoftware/reflectasm/FieldAccess;->insertThrowExceptionForFieldNotFound(Lorg/objectweb/asm/MethodVisitor;)Lorg/objectweb/asm/MethodVisitor;
|
|
|
|
const/4 v1, 0x3
|
|
|
|
invoke-virtual {v0, v11, v1}, Lorg/objectweb/asm/MethodVisitor;->visitMaxs(II)V
|
|
|
|
invoke-virtual {v0}, Lorg/objectweb/asm/MethodVisitor;->visitEnd()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private static insertSetObject(Lorg/objectweb/asm/ClassWriter;Ljava/lang/String;Ljava/util/ArrayList;)V
|
|
.locals 13
|
|
.param p0, "cw" # Lorg/objectweb/asm/ClassWriter;
|
|
.param p1, "classNameInternal" # Ljava/lang/String;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Lorg/objectweb/asm/ClassWriter;",
|
|
"Ljava/lang/String;",
|
|
"Ljava/util/ArrayList",
|
|
"<",
|
|
"Ljava/lang/reflect/Field;",
|
|
">;)V"
|
|
}
|
|
.end annotation
|
|
|
|
.prologue
|
|
.local p2, "fields":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Ljava/lang/reflect/Field;>;"
|
|
const/4 v11, 0x6
|
|
|
|
.local v11, "maxStack":I
|
|
const/4 v1, 0x1
|
|
|
|
const-string v2, "set"
|
|
|
|
const-string v3, "(Ljava/lang/Object;ILjava/lang/Object;)V"
|
|
|
|
const/4 v4, 0x0
|
|
|
|
const/4 v5, 0x0
|
|
|
|
move-object v0, p0
|
|
|
|
invoke-virtual/range {v0 .. v5}, Lorg/objectweb/asm/ClassWriter;->visitMethod(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;)Lorg/objectweb/asm/MethodVisitor;
|
|
|
|
move-result-object v0
|
|
|
|
.local v0, "mv":Lorg/objectweb/asm/MethodVisitor;
|
|
invoke-virtual {v0}, Lorg/objectweb/asm/MethodVisitor;->visitCode()V
|
|
|
|
const/16 v1, 0x15
|
|
|
|
const/4 v2, 0x2
|
|
|
|
invoke-virtual {v0, v1, v2}, Lorg/objectweb/asm/MethodVisitor;->visitVarInsn(II)V
|
|
|
|
invoke-virtual {p2}, Ljava/util/ArrayList;->isEmpty()Z
|
|
|
|
move-result v1
|
|
|
|
if-nez v1, :cond_2
|
|
|
|
add-int/lit8 v11, v11, -0x1
|
|
|
|
invoke-virtual {p2}, Ljava/util/ArrayList;->size()I
|
|
|
|
move-result v1
|
|
|
|
new-array v10, v1, [Lorg/objectweb/asm/Label;
|
|
|
|
.local v10, "labels":[Lorg/objectweb/asm/Label;
|
|
const/4 v9, 0x0
|
|
|
|
.local v9, "i":I
|
|
array-length v12, v10
|
|
|
|
.local v12, "n":I
|
|
:goto_0
|
|
if-ge v9, v12, :cond_0
|
|
|
|
new-instance v1, Lorg/objectweb/asm/Label;
|
|
|
|
invoke-direct {v1}, Lorg/objectweb/asm/Label;-><init>()V
|
|
|
|
aput-object v1, v10, v9
|
|
|
|
add-int/lit8 v9, v9, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
new-instance v6, Lorg/objectweb/asm/Label;
|
|
|
|
invoke-direct {v6}, Lorg/objectweb/asm/Label;-><init>()V
|
|
|
|
.local v6, "defaultLabel":Lorg/objectweb/asm/Label;
|
|
const/4 v1, 0x0
|
|
|
|
array-length v2, v10
|
|
|
|
add-int/lit8 v2, v2, -0x1
|
|
|
|
invoke-virtual {v0, v1, v2, v6, v10}, Lorg/objectweb/asm/MethodVisitor;->visitTableSwitchInsn(IILorg/objectweb/asm/Label;[Lorg/objectweb/asm/Label;)V
|
|
|
|
const/4 v9, 0x0
|
|
|
|
array-length v12, v10
|
|
|
|
:goto_1
|
|
if-ge v9, v12, :cond_1
|
|
|
|
invoke-virtual {p2, v9}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v7
|
|
|
|
check-cast v7, Ljava/lang/reflect/Field;
|
|
|
|
.local v7, "field":Ljava/lang/reflect/Field;
|
|
invoke-virtual {v7}, Ljava/lang/reflect/Field;->getType()Ljava/lang/Class;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-static {v1}, Lorg/objectweb/asm/Type;->getType(Ljava/lang/Class;)Lorg/objectweb/asm/Type;
|
|
|
|
move-result-object v8
|
|
|
|
.local v8, "fieldType":Lorg/objectweb/asm/Type;
|
|
aget-object v1, v10, v9
|
|
|
|
invoke-virtual {v0, v1}, Lorg/objectweb/asm/MethodVisitor;->visitLabel(Lorg/objectweb/asm/Label;)V
|
|
|
|
const/4 v1, 0x3
|
|
|
|
const/4 v2, 0x0
|
|
|
|
const/4 v3, 0x0
|
|
|
|
const/4 v4, 0x0
|
|
|
|
const/4 v5, 0x0
|
|
|
|
invoke-virtual/range {v0 .. v5}, Lorg/objectweb/asm/MethodVisitor;->visitFrame(II[Ljava/lang/Object;I[Ljava/lang/Object;)V
|
|
|
|
const/16 v1, 0x19
|
|
|
|
const/4 v2, 0x1
|
|
|
|
invoke-virtual {v0, v1, v2}, Lorg/objectweb/asm/MethodVisitor;->visitVarInsn(II)V
|
|
|
|
const/16 v1, 0xc0
|
|
|
|
invoke-virtual {v0, v1, p1}, Lorg/objectweb/asm/MethodVisitor;->visitTypeInsn(ILjava/lang/String;)V
|
|
|
|
const/16 v1, 0x19
|
|
|
|
const/4 v2, 0x3
|
|
|
|
invoke-virtual {v0, v1, v2}, Lorg/objectweb/asm/MethodVisitor;->visitVarInsn(II)V
|
|
|
|
invoke-virtual {v8}, Lorg/objectweb/asm/Type;->getSort()I
|
|
|
|
move-result v1
|
|
|
|
packed-switch v1, :pswitch_data_0
|
|
|
|
:goto_2
|
|
const/16 v1, 0xb5
|
|
|
|
invoke-virtual {v7}, Ljava/lang/reflect/Field;->getName()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v8}, Lorg/objectweb/asm/Type;->getDescriptor()Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-virtual {v0, v1, p1, v2, v3}, Lorg/objectweb/asm/MethodVisitor;->visitFieldInsn(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
const/16 v1, 0xb1
|
|
|
|
invoke-virtual {v0, v1}, Lorg/objectweb/asm/MethodVisitor;->visitInsn(I)V
|
|
|
|
add-int/lit8 v9, v9, 0x1
|
|
|
|
goto :goto_1
|
|
|
|
:pswitch_0
|
|
const/16 v1, 0xc0
|
|
|
|
const-string v2, "java/lang/Boolean"
|
|
|
|
invoke-virtual {v0, v1, v2}, Lorg/objectweb/asm/MethodVisitor;->visitTypeInsn(ILjava/lang/String;)V
|
|
|
|
const/16 v1, 0xb6
|
|
|
|
const-string v2, "java/lang/Boolean"
|
|
|
|
const-string v3, "booleanValue"
|
|
|
|
const-string v4, "()Z"
|
|
|
|
invoke-virtual {v0, v1, v2, v3, v4}, Lorg/objectweb/asm/MethodVisitor;->visitMethodInsn(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
goto :goto_2
|
|
|
|
:pswitch_1
|
|
const/16 v1, 0xc0
|
|
|
|
const-string v2, "java/lang/Byte"
|
|
|
|
invoke-virtual {v0, v1, v2}, Lorg/objectweb/asm/MethodVisitor;->visitTypeInsn(ILjava/lang/String;)V
|
|
|
|
const/16 v1, 0xb6
|
|
|
|
const-string v2, "java/lang/Byte"
|
|
|
|
const-string v3, "byteValue"
|
|
|
|
const-string v4, "()B"
|
|
|
|
invoke-virtual {v0, v1, v2, v3, v4}, Lorg/objectweb/asm/MethodVisitor;->visitMethodInsn(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
goto :goto_2
|
|
|
|
:pswitch_2
|
|
const/16 v1, 0xc0
|
|
|
|
const-string v2, "java/lang/Character"
|
|
|
|
invoke-virtual {v0, v1, v2}, Lorg/objectweb/asm/MethodVisitor;->visitTypeInsn(ILjava/lang/String;)V
|
|
|
|
const/16 v1, 0xb6
|
|
|
|
const-string v2, "java/lang/Character"
|
|
|
|
const-string v3, "charValue"
|
|
|
|
const-string v4, "()C"
|
|
|
|
invoke-virtual {v0, v1, v2, v3, v4}, Lorg/objectweb/asm/MethodVisitor;->visitMethodInsn(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
goto :goto_2
|
|
|
|
:pswitch_3
|
|
const/16 v1, 0xc0
|
|
|
|
const-string v2, "java/lang/Short"
|
|
|
|
invoke-virtual {v0, v1, v2}, Lorg/objectweb/asm/MethodVisitor;->visitTypeInsn(ILjava/lang/String;)V
|
|
|
|
const/16 v1, 0xb6
|
|
|
|
const-string v2, "java/lang/Short"
|
|
|
|
const-string v3, "shortValue"
|
|
|
|
const-string v4, "()S"
|
|
|
|
invoke-virtual {v0, v1, v2, v3, v4}, Lorg/objectweb/asm/MethodVisitor;->visitMethodInsn(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
goto :goto_2
|
|
|
|
:pswitch_4
|
|
const/16 v1, 0xc0
|
|
|
|
const-string v2, "java/lang/Integer"
|
|
|
|
invoke-virtual {v0, v1, v2}, Lorg/objectweb/asm/MethodVisitor;->visitTypeInsn(ILjava/lang/String;)V
|
|
|
|
const/16 v1, 0xb6
|
|
|
|
const-string v2, "java/lang/Integer"
|
|
|
|
const-string v3, "intValue"
|
|
|
|
const-string v4, "()I"
|
|
|
|
invoke-virtual {v0, v1, v2, v3, v4}, Lorg/objectweb/asm/MethodVisitor;->visitMethodInsn(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
goto :goto_2
|
|
|
|
:pswitch_5
|
|
const/16 v1, 0xc0
|
|
|
|
const-string v2, "java/lang/Float"
|
|
|
|
invoke-virtual {v0, v1, v2}, Lorg/objectweb/asm/MethodVisitor;->visitTypeInsn(ILjava/lang/String;)V
|
|
|
|
const/16 v1, 0xb6
|
|
|
|
const-string v2, "java/lang/Float"
|
|
|
|
const-string v3, "floatValue"
|
|
|
|
const-string v4, "()F"
|
|
|
|
invoke-virtual {v0, v1, v2, v3, v4}, Lorg/objectweb/asm/MethodVisitor;->visitMethodInsn(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
goto/16 :goto_2
|
|
|
|
:pswitch_6
|
|
const/16 v1, 0xc0
|
|
|
|
const-string v2, "java/lang/Long"
|
|
|
|
invoke-virtual {v0, v1, v2}, Lorg/objectweb/asm/MethodVisitor;->visitTypeInsn(ILjava/lang/String;)V
|
|
|
|
const/16 v1, 0xb6
|
|
|
|
const-string v2, "java/lang/Long"
|
|
|
|
const-string v3, "longValue"
|
|
|
|
const-string v4, "()J"
|
|
|
|
invoke-virtual {v0, v1, v2, v3, v4}, Lorg/objectweb/asm/MethodVisitor;->visitMethodInsn(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
goto/16 :goto_2
|
|
|
|
:pswitch_7
|
|
const/16 v1, 0xc0
|
|
|
|
const-string v2, "java/lang/Double"
|
|
|
|
invoke-virtual {v0, v1, v2}, Lorg/objectweb/asm/MethodVisitor;->visitTypeInsn(ILjava/lang/String;)V
|
|
|
|
const/16 v1, 0xb6
|
|
|
|
const-string v2, "java/lang/Double"
|
|
|
|
const-string v3, "doubleValue"
|
|
|
|
const-string v4, "()D"
|
|
|
|
invoke-virtual {v0, v1, v2, v3, v4}, Lorg/objectweb/asm/MethodVisitor;->visitMethodInsn(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
goto/16 :goto_2
|
|
|
|
:pswitch_8
|
|
const/16 v1, 0xc0
|
|
|
|
invoke-virtual {v8}, Lorg/objectweb/asm/Type;->getDescriptor()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v0, v1, v2}, Lorg/objectweb/asm/MethodVisitor;->visitTypeInsn(ILjava/lang/String;)V
|
|
|
|
goto/16 :goto_2
|
|
|
|
:pswitch_9
|
|
const/16 v1, 0xc0
|
|
|
|
invoke-virtual {v8}, Lorg/objectweb/asm/Type;->getInternalName()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v0, v1, v2}, Lorg/objectweb/asm/MethodVisitor;->visitTypeInsn(ILjava/lang/String;)V
|
|
|
|
goto/16 :goto_2
|
|
|
|
.end local v7 # "field":Ljava/lang/reflect/Field;
|
|
.end local v8 # "fieldType":Lorg/objectweb/asm/Type;
|
|
:cond_1
|
|
invoke-virtual {v0, v6}, Lorg/objectweb/asm/MethodVisitor;->visitLabel(Lorg/objectweb/asm/Label;)V
|
|
|
|
const/4 v1, 0x3
|
|
|
|
const/4 v2, 0x0
|
|
|
|
const/4 v3, 0x0
|
|
|
|
const/4 v4, 0x0
|
|
|
|
const/4 v5, 0x0
|
|
|
|
invoke-virtual/range {v0 .. v5}, Lorg/objectweb/asm/MethodVisitor;->visitFrame(II[Ljava/lang/Object;I[Ljava/lang/Object;)V
|
|
|
|
.end local v6 # "defaultLabel":Lorg/objectweb/asm/Label;
|
|
.end local v9 # "i":I
|
|
.end local v10 # "labels":[Lorg/objectweb/asm/Label;
|
|
.end local v12 # "n":I
|
|
:cond_2
|
|
invoke-static {v0}, Lcom/esotericsoftware/reflectasm/FieldAccess;->insertThrowExceptionForFieldNotFound(Lorg/objectweb/asm/MethodVisitor;)Lorg/objectweb/asm/MethodVisitor;
|
|
|
|
move-result-object v0
|
|
|
|
const/4 v1, 0x4
|
|
|
|
invoke-virtual {v0, v11, v1}, Lorg/objectweb/asm/MethodVisitor;->visitMaxs(II)V
|
|
|
|
invoke-virtual {v0}, Lorg/objectweb/asm/MethodVisitor;->visitEnd()V
|
|
|
|
return-void
|
|
|
|
:pswitch_data_0
|
|
.packed-switch 0x1
|
|
:pswitch_0
|
|
:pswitch_2
|
|
:pswitch_1
|
|
:pswitch_3
|
|
:pswitch_4
|
|
:pswitch_5
|
|
:pswitch_6
|
|
:pswitch_7
|
|
:pswitch_8
|
|
:pswitch_9
|
|
.end packed-switch
|
|
.end method
|
|
|
|
.method private static insertSetPrimitive(Lorg/objectweb/asm/ClassWriter;Ljava/lang/String;Ljava/util/ArrayList;Lorg/objectweb/asm/Type;)V
|
|
.locals 21
|
|
.param p0, "cw" # Lorg/objectweb/asm/ClassWriter;
|
|
.param p1, "classNameInternal" # Ljava/lang/String;
|
|
.param p3, "primitiveType" # Lorg/objectweb/asm/Type;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Lorg/objectweb/asm/ClassWriter;",
|
|
"Ljava/lang/String;",
|
|
"Ljava/util/ArrayList",
|
|
"<",
|
|
"Ljava/lang/reflect/Field;",
|
|
">;",
|
|
"Lorg/objectweb/asm/Type;",
|
|
")V"
|
|
}
|
|
.end annotation
|
|
|
|
.prologue
|
|
.local p2, "fields":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Ljava/lang/reflect/Field;>;"
|
|
const/16 v18, 0x6
|
|
|
|
.local v18, "maxStack":I
|
|
const/16 v17, 0x4
|
|
|
|
.local v17, "maxLocals":I
|
|
invoke-virtual/range {p3 .. p3}, Lorg/objectweb/asm/Type;->getDescriptor()Ljava/lang/String;
|
|
|
|
move-result-object v20
|
|
|
|
.local v20, "typeNameInternal":Ljava/lang/String;
|
|
invoke-virtual/range {p3 .. p3}, Lorg/objectweb/asm/Type;->getSort()I
|
|
|
|
move-result v2
|
|
|
|
packed-switch v2, :pswitch_data_0
|
|
|
|
const-string v4, "set"
|
|
|
|
.local v4, "setterMethodName":Ljava/lang/String;
|
|
const/16 v16, 0x19
|
|
|
|
.local v16, "loadValueInstruction":I
|
|
:goto_0
|
|
const/4 v3, 0x1
|
|
|
|
new-instance v2, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v6, "(Ljava/lang/Object;I"
|
|
|
|
invoke-virtual {v2, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v2
|
|
|
|
move-object/from16 v0, v20
|
|
|
|
invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v2
|
|
|
|
const-string v6, ")V"
|
|
|
|
invoke-virtual {v2, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v5
|
|
|
|
const/4 v6, 0x0
|
|
|
|
const/4 v7, 0x0
|
|
|
|
move-object/from16 v2, p0
|
|
|
|
invoke-virtual/range {v2 .. v7}, Lorg/objectweb/asm/ClassWriter;->visitMethod(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;)Lorg/objectweb/asm/MethodVisitor;
|
|
|
|
move-result-object v5
|
|
|
|
.local v5, "mv":Lorg/objectweb/asm/MethodVisitor;
|
|
invoke-virtual {v5}, Lorg/objectweb/asm/MethodVisitor;->visitCode()V
|
|
|
|
const/16 v2, 0x15
|
|
|
|
const/4 v3, 0x2
|
|
|
|
invoke-virtual {v5, v2, v3}, Lorg/objectweb/asm/MethodVisitor;->visitVarInsn(II)V
|
|
|
|
invoke-virtual/range {p2 .. p2}, Ljava/util/ArrayList;->isEmpty()Z
|
|
|
|
move-result v2
|
|
|
|
if-nez v2, :cond_5
|
|
|
|
add-int/lit8 v18, v18, -0x1
|
|
|
|
invoke-virtual/range {p2 .. p2}, Ljava/util/ArrayList;->size()I
|
|
|
|
move-result v2
|
|
|
|
new-array v15, v2, [Lorg/objectweb/asm/Label;
|
|
|
|
.local v15, "labels":[Lorg/objectweb/asm/Label;
|
|
new-instance v14, Lorg/objectweb/asm/Label;
|
|
|
|
invoke-direct {v14}, Lorg/objectweb/asm/Label;-><init>()V
|
|
|
|
.local v14, "labelForInvalidTypes":Lorg/objectweb/asm/Label;
|
|
const/4 v12, 0x0
|
|
|
|
.local v12, "hasAnyBadTypeLabel":Z
|
|
const/4 v13, 0x0
|
|
|
|
.local v13, "i":I
|
|
array-length v0, v15
|
|
|
|
move/from16 v19, v0
|
|
|
|
.local v19, "n":I
|
|
:goto_1
|
|
move/from16 v0, v19
|
|
|
|
if-ge v13, v0, :cond_1
|
|
|
|
move-object/from16 v0, p2
|
|
|
|
invoke-virtual {v0, v13}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Ljava/lang/reflect/Field;
|
|
|
|
invoke-virtual {v2}, Ljava/lang/reflect/Field;->getType()Ljava/lang/Class;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-static {v2}, Lorg/objectweb/asm/Type;->getType(Ljava/lang/Class;)Lorg/objectweb/asm/Type;
|
|
|
|
move-result-object v2
|
|
|
|
move-object/from16 v0, p3
|
|
|
|
invoke-virtual {v2, v0}, Lorg/objectweb/asm/Type;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
new-instance v2, Lorg/objectweb/asm/Label;
|
|
|
|
invoke-direct {v2}, Lorg/objectweb/asm/Label;-><init>()V
|
|
|
|
aput-object v2, v15, v13
|
|
|
|
:goto_2
|
|
add-int/lit8 v13, v13, 0x1
|
|
|
|
goto :goto_1
|
|
|
|
.end local v4 # "setterMethodName":Ljava/lang/String;
|
|
.end local v5 # "mv":Lorg/objectweb/asm/MethodVisitor;
|
|
.end local v12 # "hasAnyBadTypeLabel":Z
|
|
.end local v13 # "i":I
|
|
.end local v14 # "labelForInvalidTypes":Lorg/objectweb/asm/Label;
|
|
.end local v15 # "labels":[Lorg/objectweb/asm/Label;
|
|
.end local v16 # "loadValueInstruction":I
|
|
.end local v19 # "n":I
|
|
:pswitch_0
|
|
const-string v4, "setBoolean"
|
|
|
|
.restart local v4 # "setterMethodName":Ljava/lang/String;
|
|
const/16 v16, 0x15
|
|
|
|
.restart local v16 # "loadValueInstruction":I
|
|
goto :goto_0
|
|
|
|
.end local v4 # "setterMethodName":Ljava/lang/String;
|
|
.end local v16 # "loadValueInstruction":I
|
|
:pswitch_1
|
|
const-string v4, "setByte"
|
|
|
|
.restart local v4 # "setterMethodName":Ljava/lang/String;
|
|
const/16 v16, 0x15
|
|
|
|
.restart local v16 # "loadValueInstruction":I
|
|
goto :goto_0
|
|
|
|
.end local v4 # "setterMethodName":Ljava/lang/String;
|
|
.end local v16 # "loadValueInstruction":I
|
|
:pswitch_2
|
|
const-string v4, "setChar"
|
|
|
|
.restart local v4 # "setterMethodName":Ljava/lang/String;
|
|
const/16 v16, 0x15
|
|
|
|
.restart local v16 # "loadValueInstruction":I
|
|
goto :goto_0
|
|
|
|
.end local v4 # "setterMethodName":Ljava/lang/String;
|
|
.end local v16 # "loadValueInstruction":I
|
|
:pswitch_3
|
|
const-string v4, "setShort"
|
|
|
|
.restart local v4 # "setterMethodName":Ljava/lang/String;
|
|
const/16 v16, 0x15
|
|
|
|
.restart local v16 # "loadValueInstruction":I
|
|
goto :goto_0
|
|
|
|
.end local v4 # "setterMethodName":Ljava/lang/String;
|
|
.end local v16 # "loadValueInstruction":I
|
|
:pswitch_4
|
|
const-string v4, "setInt"
|
|
|
|
.restart local v4 # "setterMethodName":Ljava/lang/String;
|
|
const/16 v16, 0x15
|
|
|
|
.restart local v16 # "loadValueInstruction":I
|
|
goto/16 :goto_0
|
|
|
|
.end local v4 # "setterMethodName":Ljava/lang/String;
|
|
.end local v16 # "loadValueInstruction":I
|
|
:pswitch_5
|
|
const-string v4, "setFloat"
|
|
|
|
.restart local v4 # "setterMethodName":Ljava/lang/String;
|
|
const/16 v16, 0x17
|
|
|
|
.restart local v16 # "loadValueInstruction":I
|
|
goto/16 :goto_0
|
|
|
|
.end local v4 # "setterMethodName":Ljava/lang/String;
|
|
.end local v16 # "loadValueInstruction":I
|
|
:pswitch_6
|
|
const-string v4, "setLong"
|
|
|
|
.restart local v4 # "setterMethodName":Ljava/lang/String;
|
|
const/16 v16, 0x16
|
|
|
|
.restart local v16 # "loadValueInstruction":I
|
|
add-int/lit8 v17, v17, 0x1
|
|
|
|
goto/16 :goto_0
|
|
|
|
.end local v4 # "setterMethodName":Ljava/lang/String;
|
|
.end local v16 # "loadValueInstruction":I
|
|
:pswitch_7
|
|
const-string v4, "setDouble"
|
|
|
|
.restart local v4 # "setterMethodName":Ljava/lang/String;
|
|
const/16 v16, 0x18
|
|
|
|
.restart local v16 # "loadValueInstruction":I
|
|
add-int/lit8 v17, v17, 0x1
|
|
|
|
goto/16 :goto_0
|
|
|
|
.restart local v5 # "mv":Lorg/objectweb/asm/MethodVisitor;
|
|
.restart local v12 # "hasAnyBadTypeLabel":Z
|
|
.restart local v13 # "i":I
|
|
.restart local v14 # "labelForInvalidTypes":Lorg/objectweb/asm/Label;
|
|
.restart local v15 # "labels":[Lorg/objectweb/asm/Label;
|
|
.restart local v19 # "n":I
|
|
:cond_0
|
|
aput-object v14, v15, v13
|
|
|
|
const/4 v12, 0x1
|
|
|
|
goto :goto_2
|
|
|
|
:cond_1
|
|
new-instance v11, Lorg/objectweb/asm/Label;
|
|
|
|
invoke-direct {v11}, Lorg/objectweb/asm/Label;-><init>()V
|
|
|
|
.local v11, "defaultLabel":Lorg/objectweb/asm/Label;
|
|
const/4 v2, 0x0
|
|
|
|
array-length v3, v15
|
|
|
|
add-int/lit8 v3, v3, -0x1
|
|
|
|
invoke-virtual {v5, v2, v3, v11, v15}, Lorg/objectweb/asm/MethodVisitor;->visitTableSwitchInsn(IILorg/objectweb/asm/Label;[Lorg/objectweb/asm/Label;)V
|
|
|
|
const/4 v13, 0x0
|
|
|
|
array-length v0, v15
|
|
|
|
move/from16 v19, v0
|
|
|
|
:goto_3
|
|
move/from16 v0, v19
|
|
|
|
if-ge v13, v0, :cond_3
|
|
|
|
aget-object v2, v15, v13
|
|
|
|
invoke-virtual {v2, v14}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v2
|
|
|
|
if-nez v2, :cond_2
|
|
|
|
aget-object v2, v15, v13
|
|
|
|
invoke-virtual {v5, v2}, Lorg/objectweb/asm/MethodVisitor;->visitLabel(Lorg/objectweb/asm/Label;)V
|
|
|
|
const/4 v6, 0x3
|
|
|
|
const/4 v7, 0x0
|
|
|
|
const/4 v8, 0x0
|
|
|
|
const/4 v9, 0x0
|
|
|
|
const/4 v10, 0x0
|
|
|
|
invoke-virtual/range {v5 .. v10}, Lorg/objectweb/asm/MethodVisitor;->visitFrame(II[Ljava/lang/Object;I[Ljava/lang/Object;)V
|
|
|
|
const/16 v2, 0x19
|
|
|
|
const/4 v3, 0x1
|
|
|
|
invoke-virtual {v5, v2, v3}, Lorg/objectweb/asm/MethodVisitor;->visitVarInsn(II)V
|
|
|
|
const/16 v2, 0xc0
|
|
|
|
move-object/from16 v0, p1
|
|
|
|
invoke-virtual {v5, v2, v0}, Lorg/objectweb/asm/MethodVisitor;->visitTypeInsn(ILjava/lang/String;)V
|
|
|
|
const/4 v2, 0x3
|
|
|
|
move/from16 v0, v16
|
|
|
|
invoke-virtual {v5, v0, v2}, Lorg/objectweb/asm/MethodVisitor;->visitVarInsn(II)V
|
|
|
|
const/16 v3, 0xb5
|
|
|
|
move-object/from16 v0, p2
|
|
|
|
invoke-virtual {v0, v13}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Ljava/lang/reflect/Field;
|
|
|
|
invoke-virtual {v2}, Ljava/lang/reflect/Field;->getName()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
move-object/from16 v0, p1
|
|
|
|
move-object/from16 v1, v20
|
|
|
|
invoke-virtual {v5, v3, v0, v2, v1}, Lorg/objectweb/asm/MethodVisitor;->visitFieldInsn(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
const/16 v2, 0xb1
|
|
|
|
invoke-virtual {v5, v2}, Lorg/objectweb/asm/MethodVisitor;->visitInsn(I)V
|
|
|
|
:cond_2
|
|
add-int/lit8 v13, v13, 0x1
|
|
|
|
goto :goto_3
|
|
|
|
:cond_3
|
|
if-eqz v12, :cond_4
|
|
|
|
invoke-virtual {v5, v14}, Lorg/objectweb/asm/MethodVisitor;->visitLabel(Lorg/objectweb/asm/Label;)V
|
|
|
|
const/4 v6, 0x3
|
|
|
|
const/4 v7, 0x0
|
|
|
|
const/4 v8, 0x0
|
|
|
|
const/4 v9, 0x0
|
|
|
|
const/4 v10, 0x0
|
|
|
|
invoke-virtual/range {v5 .. v10}, Lorg/objectweb/asm/MethodVisitor;->visitFrame(II[Ljava/lang/Object;I[Ljava/lang/Object;)V
|
|
|
|
invoke-virtual/range {p3 .. p3}, Lorg/objectweb/asm/Type;->getClassName()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-static {v5, v2}, Lcom/esotericsoftware/reflectasm/FieldAccess;->insertThrowExceptionForFieldType(Lorg/objectweb/asm/MethodVisitor;Ljava/lang/String;)Lorg/objectweb/asm/MethodVisitor;
|
|
|
|
:cond_4
|
|
invoke-virtual {v5, v11}, Lorg/objectweb/asm/MethodVisitor;->visitLabel(Lorg/objectweb/asm/Label;)V
|
|
|
|
const/4 v6, 0x3
|
|
|
|
const/4 v7, 0x0
|
|
|
|
const/4 v8, 0x0
|
|
|
|
const/4 v9, 0x0
|
|
|
|
const/4 v10, 0x0
|
|
|
|
invoke-virtual/range {v5 .. v10}, Lorg/objectweb/asm/MethodVisitor;->visitFrame(II[Ljava/lang/Object;I[Ljava/lang/Object;)V
|
|
|
|
.end local v11 # "defaultLabel":Lorg/objectweb/asm/Label;
|
|
.end local v12 # "hasAnyBadTypeLabel":Z
|
|
.end local v13 # "i":I
|
|
.end local v14 # "labelForInvalidTypes":Lorg/objectweb/asm/Label;
|
|
.end local v15 # "labels":[Lorg/objectweb/asm/Label;
|
|
.end local v19 # "n":I
|
|
:cond_5
|
|
invoke-static {v5}, Lcom/esotericsoftware/reflectasm/FieldAccess;->insertThrowExceptionForFieldNotFound(Lorg/objectweb/asm/MethodVisitor;)Lorg/objectweb/asm/MethodVisitor;
|
|
|
|
move-result-object v5
|
|
|
|
move/from16 v0, v18
|
|
|
|
move/from16 v1, v17
|
|
|
|
invoke-virtual {v5, v0, v1}, Lorg/objectweb/asm/MethodVisitor;->visitMaxs(II)V
|
|
|
|
invoke-virtual {v5}, Lorg/objectweb/asm/MethodVisitor;->visitEnd()V
|
|
|
|
return-void
|
|
|
|
nop
|
|
|
|
:pswitch_data_0
|
|
.packed-switch 0x1
|
|
:pswitch_0
|
|
:pswitch_2
|
|
:pswitch_1
|
|
:pswitch_3
|
|
:pswitch_4
|
|
:pswitch_5
|
|
:pswitch_6
|
|
:pswitch_7
|
|
.end packed-switch
|
|
.end method
|
|
|
|
.method private static insertThrowExceptionForFieldNotFound(Lorg/objectweb/asm/MethodVisitor;)Lorg/objectweb/asm/MethodVisitor;
|
|
.locals 5
|
|
.param p0, "mv" # Lorg/objectweb/asm/MethodVisitor;
|
|
|
|
.prologue
|
|
const/16 v2, 0xbb
|
|
|
|
const/16 v4, 0xb7
|
|
|
|
const/16 v3, 0xb6
|
|
|
|
const/16 v1, 0x59
|
|
|
|
const-string v0, "java/lang/IllegalArgumentException"
|
|
|
|
invoke-virtual {p0, v2, v0}, Lorg/objectweb/asm/MethodVisitor;->visitTypeInsn(ILjava/lang/String;)V
|
|
|
|
invoke-virtual {p0, v1}, Lorg/objectweb/asm/MethodVisitor;->visitInsn(I)V
|
|
|
|
const-string v0, "java/lang/StringBuilder"
|
|
|
|
invoke-virtual {p0, v2, v0}, Lorg/objectweb/asm/MethodVisitor;->visitTypeInsn(ILjava/lang/String;)V
|
|
|
|
invoke-virtual {p0, v1}, Lorg/objectweb/asm/MethodVisitor;->visitInsn(I)V
|
|
|
|
const-string v0, "Field not found: "
|
|
|
|
invoke-virtual {p0, v0}, Lorg/objectweb/asm/MethodVisitor;->visitLdcInsn(Ljava/lang/Object;)V
|
|
|
|
const-string v0, "java/lang/StringBuilder"
|
|
|
|
const-string v1, "<init>"
|
|
|
|
const-string v2, "(Ljava/lang/String;)V"
|
|
|
|
invoke-virtual {p0, v4, v0, v1, v2}, Lorg/objectweb/asm/MethodVisitor;->visitMethodInsn(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
const/16 v0, 0x15
|
|
|
|
const/4 v1, 0x2
|
|
|
|
invoke-virtual {p0, v0, v1}, Lorg/objectweb/asm/MethodVisitor;->visitVarInsn(II)V
|
|
|
|
const-string v0, "java/lang/StringBuilder"
|
|
|
|
const-string v1, "append"
|
|
|
|
const-string v2, "(I)Ljava/lang/StringBuilder;"
|
|
|
|
invoke-virtual {p0, v3, v0, v1, v2}, Lorg/objectweb/asm/MethodVisitor;->visitMethodInsn(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
const-string v0, "java/lang/StringBuilder"
|
|
|
|
const-string v1, "toString"
|
|
|
|
const-string v2, "()Ljava/lang/String;"
|
|
|
|
invoke-virtual {p0, v3, v0, v1, v2}, Lorg/objectweb/asm/MethodVisitor;->visitMethodInsn(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
const-string v0, "java/lang/IllegalArgumentException"
|
|
|
|
const-string v1, "<init>"
|
|
|
|
const-string v2, "(Ljava/lang/String;)V"
|
|
|
|
invoke-virtual {p0, v4, v0, v1, v2}, Lorg/objectweb/asm/MethodVisitor;->visitMethodInsn(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
const/16 v0, 0xbf
|
|
|
|
invoke-virtual {p0, v0}, Lorg/objectweb/asm/MethodVisitor;->visitInsn(I)V
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method private static insertThrowExceptionForFieldType(Lorg/objectweb/asm/MethodVisitor;Ljava/lang/String;)Lorg/objectweb/asm/MethodVisitor;
|
|
.locals 5
|
|
.param p0, "mv" # Lorg/objectweb/asm/MethodVisitor;
|
|
.param p1, "fieldType" # Ljava/lang/String;
|
|
|
|
.prologue
|
|
const/16 v2, 0xbb
|
|
|
|
const/16 v4, 0xb7
|
|
|
|
const/16 v3, 0xb6
|
|
|
|
const/16 v1, 0x59
|
|
|
|
const-string v0, "java/lang/IllegalArgumentException"
|
|
|
|
invoke-virtual {p0, v2, v0}, Lorg/objectweb/asm/MethodVisitor;->visitTypeInsn(ILjava/lang/String;)V
|
|
|
|
invoke-virtual {p0, v1}, Lorg/objectweb/asm/MethodVisitor;->visitInsn(I)V
|
|
|
|
const-string v0, "java/lang/StringBuilder"
|
|
|
|
invoke-virtual {p0, v2, v0}, Lorg/objectweb/asm/MethodVisitor;->visitTypeInsn(ILjava/lang/String;)V
|
|
|
|
invoke-virtual {p0, v1}, Lorg/objectweb/asm/MethodVisitor;->visitInsn(I)V
|
|
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v1, "Field not declared as "
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, ": "
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p0, v0}, Lorg/objectweb/asm/MethodVisitor;->visitLdcInsn(Ljava/lang/Object;)V
|
|
|
|
const-string v0, "java/lang/StringBuilder"
|
|
|
|
const-string v1, "<init>"
|
|
|
|
const-string v2, "(Ljava/lang/String;)V"
|
|
|
|
invoke-virtual {p0, v4, v0, v1, v2}, Lorg/objectweb/asm/MethodVisitor;->visitMethodInsn(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
const/16 v0, 0x15
|
|
|
|
const/4 v1, 0x2
|
|
|
|
invoke-virtual {p0, v0, v1}, Lorg/objectweb/asm/MethodVisitor;->visitVarInsn(II)V
|
|
|
|
const-string v0, "java/lang/StringBuilder"
|
|
|
|
const-string v1, "append"
|
|
|
|
const-string v2, "(I)Ljava/lang/StringBuilder;"
|
|
|
|
invoke-virtual {p0, v3, v0, v1, v2}, Lorg/objectweb/asm/MethodVisitor;->visitMethodInsn(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
const-string v0, "java/lang/StringBuilder"
|
|
|
|
const-string v1, "toString"
|
|
|
|
const-string v2, "()Ljava/lang/String;"
|
|
|
|
invoke-virtual {p0, v3, v0, v1, v2}, Lorg/objectweb/asm/MethodVisitor;->visitMethodInsn(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
const-string v0, "java/lang/IllegalArgumentException"
|
|
|
|
const-string v1, "<init>"
|
|
|
|
const-string v2, "(Ljava/lang/String;)V"
|
|
|
|
invoke-virtual {p0, v4, v0, v1, v2}, Lorg/objectweb/asm/MethodVisitor;->visitMethodInsn(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
const/16 v0, 0xbf
|
|
|
|
invoke-virtual {p0, v0}, Lorg/objectweb/asm/MethodVisitor;->visitInsn(I)V
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public abstract get(Ljava/lang/Object;I)Ljava/lang/Object;
|
|
.end method
|
|
|
|
.method public get(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object;
|
|
.locals 1
|
|
.param p1, "instance" # Ljava/lang/Object;
|
|
.param p2, "fieldName" # Ljava/lang/String;
|
|
|
|
.prologue
|
|
invoke-virtual {p0, p2}, Lcom/esotericsoftware/reflectasm/FieldAccess;->getIndex(Ljava/lang/String;)I
|
|
|
|
move-result v0
|
|
|
|
invoke-virtual {p0, p1, v0}, Lcom/esotericsoftware/reflectasm/FieldAccess;->get(Ljava/lang/Object;I)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public abstract getBoolean(Ljava/lang/Object;I)Z
|
|
.end method
|
|
|
|
.method public abstract getByte(Ljava/lang/Object;I)B
|
|
.end method
|
|
|
|
.method public abstract getChar(Ljava/lang/Object;I)C
|
|
.end method
|
|
|
|
.method public abstract getDouble(Ljava/lang/Object;I)D
|
|
.end method
|
|
|
|
.method public getFieldCount()I
|
|
.locals 1
|
|
|
|
.prologue
|
|
iget-object v0, p0, Lcom/esotericsoftware/reflectasm/FieldAccess;->fieldTypes:[Ljava/lang/Class;
|
|
|
|
array-length v0, v0
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public getFieldNames()[Ljava/lang/String;
|
|
.locals 1
|
|
|
|
.prologue
|
|
iget-object v0, p0, Lcom/esotericsoftware/reflectasm/FieldAccess;->fieldNames:[Ljava/lang/String;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public getFieldTypes()[Ljava/lang/Class;
|
|
.locals 1
|
|
|
|
.prologue
|
|
iget-object v0, p0, Lcom/esotericsoftware/reflectasm/FieldAccess;->fieldTypes:[Ljava/lang/Class;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public abstract getFloat(Ljava/lang/Object;I)F
|
|
.end method
|
|
|
|
.method public getIndex(Ljava/lang/String;)I
|
|
.locals 5
|
|
.param p1, "fieldName" # Ljava/lang/String;
|
|
|
|
.prologue
|
|
const/4 v0, 0x0
|
|
|
|
.local v0, "i":I
|
|
iget-object v2, p0, Lcom/esotericsoftware/reflectasm/FieldAccess;->fieldNames:[Ljava/lang/String;
|
|
|
|
array-length v1, v2
|
|
|
|
.local v1, "n":I
|
|
:goto_0
|
|
if-ge v0, v1, :cond_1
|
|
|
|
iget-object v2, p0, Lcom/esotericsoftware/reflectasm/FieldAccess;->fieldNames:[Ljava/lang/String;
|
|
|
|
aget-object v2, v2, v0
|
|
|
|
invoke-virtual {v2, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
return v0
|
|
|
|
:cond_0
|
|
add-int/lit8 v0, v0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
new-instance v2, Ljava/lang/IllegalArgumentException;
|
|
|
|
new-instance v3, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v4, "Unable to find non-private field: "
|
|
|
|
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-virtual {v3, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-direct {v2, v3}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v2
|
|
.end method
|
|
|
|
.method public abstract getInt(Ljava/lang/Object;I)I
|
|
.end method
|
|
|
|
.method public abstract getLong(Ljava/lang/Object;I)J
|
|
.end method
|
|
|
|
.method public abstract getShort(Ljava/lang/Object;I)S
|
|
.end method
|
|
|
|
.method public abstract getString(Ljava/lang/Object;I)Ljava/lang/String;
|
|
.end method
|
|
|
|
.method public abstract set(Ljava/lang/Object;ILjava/lang/Object;)V
|
|
.end method
|
|
|
|
.method public set(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;)V
|
|
.locals 1
|
|
.param p1, "instance" # Ljava/lang/Object;
|
|
.param p2, "fieldName" # Ljava/lang/String;
|
|
.param p3, "value" # Ljava/lang/Object;
|
|
|
|
.prologue
|
|
invoke-virtual {p0, p2}, Lcom/esotericsoftware/reflectasm/FieldAccess;->getIndex(Ljava/lang/String;)I
|
|
|
|
move-result v0
|
|
|
|
invoke-virtual {p0, p1, v0, p3}, Lcom/esotericsoftware/reflectasm/FieldAccess;->set(Ljava/lang/Object;ILjava/lang/Object;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public abstract setBoolean(Ljava/lang/Object;IZ)V
|
|
.end method
|
|
|
|
.method public abstract setByte(Ljava/lang/Object;IB)V
|
|
.end method
|
|
|
|
.method public abstract setChar(Ljava/lang/Object;IC)V
|
|
.end method
|
|
|
|
.method public abstract setDouble(Ljava/lang/Object;ID)V
|
|
.end method
|
|
|
|
.method public abstract setFloat(Ljava/lang/Object;IF)V
|
|
.end method
|
|
|
|
.method public abstract setInt(Ljava/lang/Object;II)V
|
|
.end method
|
|
|
|
.method public abstract setLong(Ljava/lang/Object;IJ)V
|
|
.end method
|
|
|
|
.method public abstract setShort(Ljava/lang/Object;IS)V
|
|
.end method
|