2020-05-17 12:40:10 +00:00
|
|
|
.class public Lcom/esotericsoftware/kryo/Kryo$DefaultInstantiatorStrategy;
|
|
|
|
.super Ljava/lang/Object;
|
|
|
|
.source "Kryo.java"
|
|
|
|
|
|
|
|
# interfaces
|
2020-09-02 04:07:20 +00:00
|
|
|
.implements Lq0/b/b/a;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
|
|
|
|
# annotations
|
|
|
|
.annotation system Ldalvik/annotation/EnclosingClass;
|
|
|
|
value = Lcom/esotericsoftware/kryo/Kryo;
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
.annotation system Ldalvik/annotation/InnerClass;
|
|
|
|
accessFlags = 0x9
|
|
|
|
name = "DefaultInstantiatorStrategy"
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
|
|
|
|
# instance fields
|
2020-09-02 04:07:20 +00:00
|
|
|
.field public fallbackStrategy:Lq0/b/b/a;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
|
|
|
|
# direct methods
|
|
|
|
.method public constructor <init>()V
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
2020-09-02 04:07:20 +00:00
|
|
|
.method public constructor <init>(Lq0/b/b/a;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
.locals 0
|
|
|
|
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
|
2020-09-02 04:07:20 +00:00
|
|
|
iput-object p1, p0, Lcom/esotericsoftware/kryo/Kryo$DefaultInstantiatorStrategy;->fallbackStrategy:Lq0/b/b/a;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
|
|
|
|
# virtual methods
|
2020-09-02 04:07:20 +00:00
|
|
|
.method public getFallbackInstantiatorStrategy()Lq0/b/b/a;
|
2020-05-17 12:40:10 +00:00
|
|
|
.locals 1
|
|
|
|
|
2020-09-02 04:07:20 +00:00
|
|
|
iget-object v0, p0, Lcom/esotericsoftware/kryo/Kryo$DefaultInstantiatorStrategy;->fallbackStrategy:Lq0/b/b/a;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
return-object v0
|
|
|
|
.end method
|
|
|
|
|
2020-09-02 04:07:20 +00:00
|
|
|
.method public newInstantiatorOf(Ljava/lang/Class;)Lq0/b/a/a;
|
2020-07-23 01:06:17 +00:00
|
|
|
.locals 4
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
sget-boolean v0, Lcom/esotericsoftware/kryo/util/Util;->IS_ANDROID:Z
|
|
|
|
|
|
|
|
const/4 v1, 0x1
|
|
|
|
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Ljava/lang/Class;->getEnclosingClass()Ljava/lang/Class;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Ljava/lang/Class;->isMemberClass()Z
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Ljava/lang/Class;->getModifiers()I
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
invoke-static {v0}, Ljava/lang/reflect/Modifier;->isStatic(I)Z
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
|
|
|
|
const/4 v0, 0x1
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
|
|
|
:goto_0
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
|
|
|
|
:try_start_0
|
2020-07-23 01:06:17 +00:00
|
|
|
invoke-static {p1}, Lf/f/b/b;->a(Ljava/lang/Class;)Lf/f/b/b;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
new-instance v2, Lcom/esotericsoftware/kryo/Kryo$DefaultInstantiatorStrategy$1;
|
|
|
|
|
2020-07-23 01:06:17 +00:00
|
|
|
invoke-direct {v2, p0, v0, p1}, Lcom/esotericsoftware/kryo/Kryo$DefaultInstantiatorStrategy$1;-><init>(Lcom/esotericsoftware/kryo/Kryo$DefaultInstantiatorStrategy;Lf/f/b/b;Ljava/lang/Class;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
:try_end_0
|
|
|
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
|
|
|
|
return-object v2
|
|
|
|
|
|
|
|
:catch_0
|
|
|
|
:cond_1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
|
|
|
:try_start_1
|
|
|
|
invoke-virtual {p1, v0}, Ljava/lang/Class;->getConstructor([Ljava/lang/Class;)Ljava/lang/reflect/Constructor;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
:try_end_1
|
|
|
|
.catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_1
|
|
|
|
|
|
|
|
goto :goto_1
|
|
|
|
|
|
|
|
:catch_1
|
|
|
|
:try_start_2
|
|
|
|
invoke-virtual {p1, v0}, Ljava/lang/Class;->getDeclaredConstructor([Ljava/lang/Class;)Ljava/lang/reflect/Constructor;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/reflect/Constructor;->setAccessible(Z)V
|
|
|
|
|
|
|
|
:goto_1
|
|
|
|
new-instance v1, Lcom/esotericsoftware/kryo/Kryo$DefaultInstantiatorStrategy$2;
|
|
|
|
|
|
|
|
invoke-direct {v1, p0, v0, p1}, Lcom/esotericsoftware/kryo/Kryo$DefaultInstantiatorStrategy$2;-><init>(Lcom/esotericsoftware/kryo/Kryo$DefaultInstantiatorStrategy;Ljava/lang/reflect/Constructor;Ljava/lang/Class;)V
|
|
|
|
:try_end_2
|
|
|
|
.catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_2
|
|
|
|
|
|
|
|
return-object v1
|
|
|
|
|
|
|
|
:catch_2
|
|
|
|
nop
|
|
|
|
|
2020-09-02 04:07:20 +00:00
|
|
|
iget-object v0, p0, Lcom/esotericsoftware/kryo/Kryo$DefaultInstantiatorStrategy;->fallbackStrategy:Lq0/b/b/a;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
if-nez v0, :cond_5
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Ljava/lang/Class;->isMemberClass()Z
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
if-eqz v0, :cond_3
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Ljava/lang/Class;->getModifiers()I
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
invoke-static {v0}, Ljava/lang/reflect/Modifier;->isStatic(I)Z
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
|
|
|
|
goto :goto_2
|
|
|
|
|
|
|
|
:cond_2
|
|
|
|
new-instance v0, Lcom/esotericsoftware/kryo/KryoException;
|
|
|
|
|
|
|
|
const-string v1, "Class cannot be created (non-static member class): "
|
|
|
|
|
2020-09-09 19:21:20 +00:00
|
|
|
invoke-static {v1}, Lf/e/b/a/a;->E(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
invoke-static {p1}, Lcom/esotericsoftware/kryo/util/Util;->className(Ljava/lang/Class;)Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
invoke-direct {v0, p1}, Lcom/esotericsoftware/kryo/KryoException;-><init>(Ljava/lang/String;)V
|
|
|
|
|
|
|
|
throw v0
|
|
|
|
|
|
|
|
:cond_3
|
|
|
|
:goto_2
|
|
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
const-string v1, "Class cannot be created (missing no-arg constructor): "
|
|
|
|
|
2020-09-09 19:21:20 +00:00
|
|
|
invoke-static {v1}, Lf/e/b/a/a;->E(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
invoke-static {p1}, Lcom/esotericsoftware/kryo/util/Util;->className(Ljava/lang/Class;)Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object v2
|
|
|
|
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Ljava/lang/Class;->getSimpleName()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
const-string v1, ""
|
|
|
|
|
|
|
|
invoke-virtual {p1, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
|
|
|
|
move-result p1
|
|
|
|
|
|
|
|
if-eqz p1, :cond_4
|
|
|
|
|
|
|
|
const-string p1, "\n\tThis is an anonymous class, which is not serializable by default in Kryo. Possible solutions: "
|
|
|
|
|
2020-07-23 01:06:17 +00:00
|
|
|
const-string v1, "1. Remove uses of anonymous classes, including double brace initialization, from the containing "
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-23 01:06:17 +00:00
|
|
|
const-string v2, "class. This is the safest solution, as anonymous classes don\'t have predictable names for serialization."
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-23 01:06:17 +00:00
|
|
|
const-string v3, "\n\t2. Register a FieldSerializer for the containing class and call "
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-09-09 19:21:20 +00:00
|
|
|
invoke-static {v0, p1, v1, v2, v3}, Lf/e/b/a/a;->W(Ljava/lang/StringBuilder;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
const-string p1, "FieldSerializer#setIgnoreSyntheticFields(false) on it. This is not safe but may be sufficient temporarily. "
|
|
|
|
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
const-string p1, "Use at your own risk."
|
|
|
|
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
:cond_4
|
|
|
|
new-instance p1, Lcom/esotericsoftware/kryo/KryoException;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
invoke-direct {p1, v0}, Lcom/esotericsoftware/kryo/KryoException;-><init>(Ljava/lang/String;)V
|
|
|
|
|
|
|
|
throw p1
|
|
|
|
|
|
|
|
:cond_5
|
2020-09-02 04:07:20 +00:00
|
|
|
invoke-interface {v0, p1}, Lq0/b/b/a;->newInstantiatorOf(Ljava/lang/Class;)Lq0/b/a/a;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
return-object p1
|
|
|
|
.end method
|
|
|
|
|
2020-09-02 04:07:20 +00:00
|
|
|
.method public setFallbackInstantiatorStrategy(Lq0/b/b/a;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
.locals 0
|
|
|
|
|
2020-09-02 04:07:20 +00:00
|
|
|
iput-object p1, p0, Lcom/esotericsoftware/kryo/Kryo$DefaultInstantiatorStrategy;->fallbackStrategy:Lq0/b/b/a;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|