apkfuckery/com.discord/smali/androidx/versionedparcelable/ParcelUtils.smali

374 lines
11 KiB
Smali
Raw Normal View History

2020-05-17 12:40:10 +00:00
.class public Landroidx/versionedparcelable/ParcelUtils;
.super Ljava/lang/Object;
.source "ParcelUtils.java"
# static fields
.field public static final INNER_BUNDLE_KEY:Ljava/lang/String; = "a"
# direct methods
.method public constructor <init>()V
.locals 0
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
.method public static fromInputStream(Ljava/io/InputStream;)Landroidx/versionedparcelable/VersionedParcelable;
.locals 2
.annotation build Landroidx/annotation/RestrictTo;
value = {
.enum Landroidx/annotation/RestrictTo$Scope;->LIBRARY_GROUP_PREFIX:Landroidx/annotation/RestrictTo$Scope;
}
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"<T::",
"Landroidx/versionedparcelable/VersionedParcelable;",
">(",
"Ljava/io/InputStream;",
")TT;"
}
.end annotation
new-instance v0, Landroidx/versionedparcelable/VersionedParcelStream;
const/4 v1, 0x0
invoke-direct {v0, p0, v1}, Landroidx/versionedparcelable/VersionedParcelStream;-><init>(Ljava/io/InputStream;Ljava/io/OutputStream;)V
invoke-virtual {v0}, Landroidx/versionedparcelable/VersionedParcel;->readVersionedParcelable()Landroidx/versionedparcelable/VersionedParcelable;
move-result-object p0
return-object p0
.end method
.method public static fromParcelable(Landroid/os/Parcelable;)Landroidx/versionedparcelable/VersionedParcelable;
.locals 1
.annotation build Landroidx/annotation/RestrictTo;
value = {
.enum Landroidx/annotation/RestrictTo$Scope;->LIBRARY_GROUP_PREFIX:Landroidx/annotation/RestrictTo$Scope;
}
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"<T::",
"Landroidx/versionedparcelable/VersionedParcelable;",
">(",
"Landroid/os/Parcelable;",
")TT;"
}
.end annotation
instance-of v0, p0, Landroidx/versionedparcelable/ParcelImpl;
if-eqz v0, :cond_0
check-cast p0, Landroidx/versionedparcelable/ParcelImpl;
invoke-virtual {p0}, Landroidx/versionedparcelable/ParcelImpl;->getVersionedParcel()Landroidx/versionedparcelable/VersionedParcelable;
move-result-object p0
return-object p0
:cond_0
new-instance p0, Ljava/lang/IllegalArgumentException;
const-string v0, "Invalid parcel"
invoke-direct {p0, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p0
.end method
.method public static getVersionedParcelable(Landroid/os/Bundle;Ljava/lang/String;)Landroidx/versionedparcelable/VersionedParcelable;
.locals 1
.param p0 # Landroid/os/Bundle;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p1 # Ljava/lang/String;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.annotation build Landroidx/annotation/Nullable;
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"<T::",
"Landroidx/versionedparcelable/VersionedParcelable;",
">(",
"Landroid/os/Bundle;",
"Ljava/lang/String;",
")TT;"
}
.end annotation
const/4 v0, 0x0
:try_start_0
invoke-virtual {p0, p1}, Landroid/os/Bundle;->getParcelable(Ljava/lang/String;)Landroid/os/Parcelable;
move-result-object p0
check-cast p0, Landroid/os/Bundle;
if-nez p0, :cond_0
return-object v0
:cond_0
const-class p1, Landroidx/versionedparcelable/ParcelUtils;
invoke-virtual {p1}, Ljava/lang/Class;->getClassLoader()Ljava/lang/ClassLoader;
move-result-object p1
invoke-virtual {p0, p1}, Landroid/os/Bundle;->setClassLoader(Ljava/lang/ClassLoader;)V
const-string p1, "a"
invoke-virtual {p0, p1}, Landroid/os/Bundle;->getParcelable(Ljava/lang/String;)Landroid/os/Parcelable;
move-result-object p0
invoke-static {p0}, Landroidx/versionedparcelable/ParcelUtils;->fromParcelable(Landroid/os/Parcelable;)Landroidx/versionedparcelable/VersionedParcelable;
move-result-object p0
:try_end_0
.catch Ljava/lang/RuntimeException; {:try_start_0 .. :try_end_0} :catch_0
return-object p0
:catch_0
return-object v0
.end method
.method public static getVersionedParcelableList(Landroid/os/Bundle;Ljava/lang/String;)Ljava/util/List;
.locals 1
.annotation build Landroidx/annotation/Nullable;
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"<T::",
"Landroidx/versionedparcelable/VersionedParcelable;",
">(",
"Landroid/os/Bundle;",
"Ljava/lang/String;",
")",
"Ljava/util/List<",
"TT;>;"
}
.end annotation
new-instance v0, Ljava/util/ArrayList;
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
:try_start_0
invoke-virtual {p0, p1}, Landroid/os/Bundle;->getParcelable(Ljava/lang/String;)Landroid/os/Parcelable;
move-result-object p0
check-cast p0, Landroid/os/Bundle;
const-class p1, Landroidx/versionedparcelable/ParcelUtils;
invoke-virtual {p1}, Ljava/lang/Class;->getClassLoader()Ljava/lang/ClassLoader;
move-result-object p1
invoke-virtual {p0, p1}, Landroid/os/Bundle;->setClassLoader(Ljava/lang/ClassLoader;)V
const-string p1, "a"
invoke-virtual {p0, p1}, Landroid/os/Bundle;->getParcelableArrayList(Ljava/lang/String;)Ljava/util/ArrayList;
move-result-object p0
invoke-virtual {p0}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;
move-result-object p0
:goto_0
invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z
move-result p1
if-eqz p1, :cond_0
invoke-interface {p0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object p1
check-cast p1, Landroid/os/Parcelable;
invoke-static {p1}, Landroidx/versionedparcelable/ParcelUtils;->fromParcelable(Landroid/os/Parcelable;)Landroidx/versionedparcelable/VersionedParcelable;
move-result-object p1
2020-07-08 16:44:49 +00:00
invoke-virtual {v0, p1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
2020-05-17 12:40:10 +00:00
:try_end_0
.catch Ljava/lang/RuntimeException; {:try_start_0 .. :try_end_0} :catch_0
goto :goto_0
:cond_0
return-object v0
:catch_0
const/4 p0, 0x0
return-object p0
.end method
.method public static putVersionedParcelable(Landroid/os/Bundle;Ljava/lang/String;Landroidx/versionedparcelable/VersionedParcelable;)V
.locals 2
.param p0 # Landroid/os/Bundle;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p1 # Ljava/lang/String;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p2 # Landroidx/versionedparcelable/VersionedParcelable;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end param
if-nez p2, :cond_0
return-void
:cond_0
new-instance v0, Landroid/os/Bundle;
invoke-direct {v0}, Landroid/os/Bundle;-><init>()V
invoke-static {p2}, Landroidx/versionedparcelable/ParcelUtils;->toParcelable(Landroidx/versionedparcelable/VersionedParcelable;)Landroid/os/Parcelable;
move-result-object p2
const-string v1, "a"
invoke-virtual {v0, v1, p2}, Landroid/os/Bundle;->putParcelable(Ljava/lang/String;Landroid/os/Parcelable;)V
invoke-virtual {p0, p1, v0}, Landroid/os/Bundle;->putParcelable(Ljava/lang/String;Landroid/os/Parcelable;)V
return-void
.end method
.method public static putVersionedParcelableList(Landroid/os/Bundle;Ljava/lang/String;Ljava/util/List;)V
.locals 3
.param p0 # Landroid/os/Bundle;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p1 # Ljava/lang/String;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p2 # Ljava/util/List;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Landroid/os/Bundle;",
"Ljava/lang/String;",
"Ljava/util/List<",
"+",
"Landroidx/versionedparcelable/VersionedParcelable;",
">;)V"
}
.end annotation
new-instance v0, Landroid/os/Bundle;
invoke-direct {v0}, Landroid/os/Bundle;-><init>()V
new-instance v1, Ljava/util/ArrayList;
invoke-direct {v1}, Ljava/util/ArrayList;-><init>()V
invoke-interface {p2}, Ljava/util/List;->iterator()Ljava/util/Iterator;
move-result-object p2
:goto_0
invoke-interface {p2}, Ljava/util/Iterator;->hasNext()Z
move-result v2
if-eqz v2, :cond_0
invoke-interface {p2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v2
check-cast v2, Landroidx/versionedparcelable/VersionedParcelable;
invoke-static {v2}, Landroidx/versionedparcelable/ParcelUtils;->toParcelable(Landroidx/versionedparcelable/VersionedParcelable;)Landroid/os/Parcelable;
move-result-object v2
invoke-virtual {v1, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
goto :goto_0
:cond_0
const-string p2, "a"
invoke-virtual {v0, p2, v1}, Landroid/os/Bundle;->putParcelableArrayList(Ljava/lang/String;Ljava/util/ArrayList;)V
invoke-virtual {p0, p1, v0}, Landroid/os/Bundle;->putParcelable(Ljava/lang/String;Landroid/os/Parcelable;)V
return-void
.end method
.method public static toOutputStream(Landroidx/versionedparcelable/VersionedParcelable;Ljava/io/OutputStream;)V
.locals 2
.annotation build Landroidx/annotation/RestrictTo;
value = {
.enum Landroidx/annotation/RestrictTo$Scope;->LIBRARY_GROUP_PREFIX:Landroidx/annotation/RestrictTo$Scope;
}
.end annotation
new-instance v0, Landroidx/versionedparcelable/VersionedParcelStream;
const/4 v1, 0x0
invoke-direct {v0, v1, p1}, Landroidx/versionedparcelable/VersionedParcelStream;-><init>(Ljava/io/InputStream;Ljava/io/OutputStream;)V
invoke-virtual {v0, p0}, Landroidx/versionedparcelable/VersionedParcel;->writeVersionedParcelable(Landroidx/versionedparcelable/VersionedParcelable;)V
invoke-virtual {v0}, Landroidx/versionedparcelable/VersionedParcelStream;->closeField()V
return-void
.end method
.method public static toParcelable(Landroidx/versionedparcelable/VersionedParcelable;)Landroid/os/Parcelable;
.locals 1
.annotation build Landroidx/annotation/RestrictTo;
value = {
.enum Landroidx/annotation/RestrictTo$Scope;->LIBRARY_GROUP_PREFIX:Landroidx/annotation/RestrictTo$Scope;
}
.end annotation
new-instance v0, Landroidx/versionedparcelable/ParcelImpl;
invoke-direct {v0, p0}, Landroidx/versionedparcelable/ParcelImpl;-><init>(Landroidx/versionedparcelable/VersionedParcelable;)V
return-object v0
.end method