apkfuckery/com.discord/smali/androidx/work/ArrayCreatingInputMerger.smali

320 lines
7.8 KiB
Smali
Raw Normal View History

2019-07-24 11:27:29 +00:00
.class public final Landroidx/work/ArrayCreatingInputMerger;
.super Landroidx/work/InputMerger;
.source "ArrayCreatingInputMerger.java"
# direct methods
.method public constructor <init>()V
.locals 0
invoke-direct {p0}, Landroidx/work/InputMerger;-><init>()V
return-void
.end method
.method private concatenateArrayAndNonArray(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.locals 3
invoke-static {p1}, Ljava/lang/reflect/Array;->getLength(Ljava/lang/Object;)I
move-result v0
invoke-virtual {p2}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
move-result-object v1
add-int/lit8 v2, v0, 0x1
invoke-static {v1, v2}, Ljava/lang/reflect/Array;->newInstance(Ljava/lang/Class;I)Ljava/lang/Object;
move-result-object v1
const/4 v2, 0x0
invoke-static {p1, v2, v1, v2, v0}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V
invoke-static {v1, v0, p2}, Ljava/lang/reflect/Array;->set(Ljava/lang/Object;ILjava/lang/Object;)V
return-object v1
.end method
.method private concatenateArrays(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.locals 4
invoke-static {p1}, Ljava/lang/reflect/Array;->getLength(Ljava/lang/Object;)I
move-result v0
invoke-static {p2}, Ljava/lang/reflect/Array;->getLength(Ljava/lang/Object;)I
move-result v1
invoke-virtual {p1}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
move-result-object v2
invoke-virtual {v2}, Ljava/lang/Class;->getComponentType()Ljava/lang/Class;
move-result-object v2
add-int v3, v0, v1
invoke-static {v2, v3}, Ljava/lang/reflect/Array;->newInstance(Ljava/lang/Class;I)Ljava/lang/Object;
move-result-object v2
const/4 v3, 0x0
invoke-static {p1, v3, v2, v3, v0}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V
invoke-static {p2, v3, v2, v0, v1}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V
return-object v2
.end method
.method private concatenateNonArrays(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.locals 2
invoke-virtual {p1}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
move-result-object v0
const/4 v1, 0x2
invoke-static {v0, v1}, Ljava/lang/reflect/Array;->newInstance(Ljava/lang/Class;I)Ljava/lang/Object;
move-result-object v0
const/4 v1, 0x0
invoke-static {v0, v1, p1}, Ljava/lang/reflect/Array;->set(Ljava/lang/Object;ILjava/lang/Object;)V
const/4 p1, 0x1
invoke-static {v0, p1, p2}, Ljava/lang/reflect/Array;->set(Ljava/lang/Object;ILjava/lang/Object;)V
return-object v0
.end method
.method private createArrayFor(Ljava/lang/Object;)Ljava/lang/Object;
.locals 2
invoke-virtual {p1}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
move-result-object v0
const/4 v1, 0x1
invoke-static {v0, v1}, Ljava/lang/reflect/Array;->newInstance(Ljava/lang/Class;I)Ljava/lang/Object;
move-result-object v0
const/4 v1, 0x0
invoke-static {v0, v1, p1}, Ljava/lang/reflect/Array;->set(Ljava/lang/Object;ILjava/lang/Object;)V
return-object v0
.end method
# virtual methods
.method public final merge(Ljava/util/List;)Landroidx/work/Data;
.locals 9
.param p1 # Ljava/util/List;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.annotation build Landroidx/annotation/NonNull;
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/util/List<",
"Landroidx/work/Data;",
">;)",
"Landroidx/work/Data;"
}
.end annotation
new-instance v0, Landroidx/work/Data$Builder;
invoke-direct {v0}, Landroidx/work/Data$Builder;-><init>()V
new-instance v1, Ljava/util/HashMap;
invoke-direct {v1}, Ljava/util/HashMap;-><init>()V
invoke-interface {p1}, Ljava/util/List;->iterator()Ljava/util/Iterator;
move-result-object p1
:cond_0
invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z
move-result v2
if-eqz v2, :cond_7
invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v2
check-cast v2, Landroidx/work/Data;
invoke-virtual {v2}, Landroidx/work/Data;->getKeyValueMap()Ljava/util/Map;
move-result-object v2
invoke-interface {v2}, Ljava/util/Map;->entrySet()Ljava/util/Set;
move-result-object v2
invoke-interface {v2}, Ljava/util/Set;->iterator()Ljava/util/Iterator;
move-result-object v2
:goto_0
invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z
move-result v3
if-eqz v3, :cond_0
invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v3
check-cast v3, Ljava/util/Map$Entry;
invoke-interface {v3}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;
move-result-object v4
check-cast v4, Ljava/lang/String;
invoke-interface {v3}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;
move-result-object v3
invoke-virtual {v3}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
move-result-object v5
invoke-interface {v1, v4}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v6
if-nez v6, :cond_2
invoke-virtual {v5}, Ljava/lang/Class;->isArray()Z
move-result v5
if-eqz v5, :cond_1
goto :goto_1
:cond_1
invoke-direct {p0, v3}, Landroidx/work/ArrayCreatingInputMerger;->createArrayFor(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v3
goto :goto_1
:cond_2
invoke-virtual {v6}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
move-result-object v7
invoke-virtual {v7, v5}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v8
if-eqz v8, :cond_4
invoke-virtual {v7}, Ljava/lang/Class;->isArray()Z
move-result v5
if-eqz v5, :cond_3
invoke-direct {p0, v6, v3}, Landroidx/work/ArrayCreatingInputMerger;->concatenateArrays(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v3
goto :goto_1
:cond_3
invoke-direct {p0, v6, v3}, Landroidx/work/ArrayCreatingInputMerger;->concatenateNonArrays(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v3
goto :goto_1
:cond_4
invoke-virtual {v7}, Ljava/lang/Class;->isArray()Z
move-result v8
if-eqz v8, :cond_5
invoke-virtual {v7}, Ljava/lang/Class;->getComponentType()Ljava/lang/Class;
move-result-object v8
invoke-virtual {v8, v5}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v8
if-eqz v8, :cond_5
invoke-direct {p0, v6, v3}, Landroidx/work/ArrayCreatingInputMerger;->concatenateArrayAndNonArray(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v3
goto :goto_1
:cond_5
invoke-virtual {v5}, Ljava/lang/Class;->isArray()Z
move-result v8
if-eqz v8, :cond_6
invoke-virtual {v5}, Ljava/lang/Class;->getComponentType()Ljava/lang/Class;
move-result-object v5
invoke-virtual {v5, v7}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v5
if-eqz v5, :cond_6
invoke-direct {p0, v3, v6}, Landroidx/work/ArrayCreatingInputMerger;->concatenateArrayAndNonArray(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v3
:goto_1
invoke-interface {v1, v4, v3}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
goto :goto_0
:cond_6
new-instance p1, Ljava/lang/IllegalArgumentException;
invoke-direct {p1}, Ljava/lang/IllegalArgumentException;-><init>()V
throw p1
:cond_7
invoke-virtual {v0, v1}, Landroidx/work/Data$Builder;->putAll(Ljava/util/Map;)Landroidx/work/Data$Builder;
invoke-virtual {v0}, Landroidx/work/Data$Builder;->build()Landroidx/work/Data;
move-result-object p1
return-object p1
.end method