315 lines
8.3 KiB
Smali
315 lines
8.3 KiB
Smali
.class public final Lokhttp3/MediaType$a;
|
|
.super Ljava/lang/Object;
|
|
.source "MediaType.kt"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/EnclosingClass;
|
|
value = Lokhttp3/MediaType;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/InnerClass;
|
|
accessFlags = 0x19
|
|
name = "a"
|
|
.end annotation
|
|
|
|
|
|
# direct methods
|
|
.method public static final a(Ljava/lang/String;)Lokhttp3/MediaType;
|
|
.locals 12
|
|
|
|
const-string v0, "$this$toMediaType"
|
|
|
|
invoke-static {p0, v0}, Lk0/n/c/i;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
sget-object v0, Lokhttp3/MediaType;->e:Ljava/util/regex/Pattern;
|
|
|
|
invoke-virtual {v0, p0}, Ljava/util/regex/Pattern;->matcher(Ljava/lang/CharSequence;)Ljava/util/regex/Matcher;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Ljava/util/regex/Matcher;->lookingAt()Z
|
|
|
|
move-result v1
|
|
|
|
const/16 v2, 0x22
|
|
|
|
if-eqz v1, :cond_6
|
|
|
|
const/4 v1, 0x1
|
|
|
|
invoke-virtual {v0, v1}, Ljava/util/regex/Matcher;->group(I)Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
const-string v4, "typeSubtype.group(1)"
|
|
|
|
invoke-static {v3, v4}, Lk0/n/c/i;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
sget-object v4, Ljava/util/Locale;->US:Ljava/util/Locale;
|
|
|
|
const-string v5, "Locale.US"
|
|
|
|
invoke-static {v4, v5}, Lk0/n/c/i;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v3, v4}, Ljava/lang/String;->toLowerCase(Ljava/util/Locale;)Ljava/lang/String;
|
|
|
|
move-result-object v8
|
|
|
|
const-string v3, "(this as java.lang.String).toLowerCase(locale)"
|
|
|
|
invoke-static {v8, v3}, Lk0/n/c/i;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const/4 v4, 0x2
|
|
|
|
invoke-virtual {v0, v4}, Ljava/util/regex/Matcher;->group(I)Ljava/lang/String;
|
|
|
|
move-result-object v6
|
|
|
|
const-string v7, "typeSubtype.group(2)"
|
|
|
|
invoke-static {v6, v7}, Lk0/n/c/i;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
sget-object v7, Ljava/util/Locale;->US:Ljava/util/Locale;
|
|
|
|
invoke-static {v7, v5}, Lk0/n/c/i;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v6, v7}, Ljava/lang/String;->toLowerCase(Ljava/util/Locale;)Ljava/lang/String;
|
|
|
|
move-result-object v9
|
|
|
|
invoke-static {v9, v3}, Lk0/n/c/i;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
new-instance v3, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v3}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
sget-object v5, Lokhttp3/MediaType;->f:Ljava/util/regex/Pattern;
|
|
|
|
invoke-virtual {v5, p0}, Ljava/util/regex/Pattern;->matcher(Ljava/lang/CharSequence;)Ljava/util/regex/Matcher;
|
|
|
|
move-result-object v5
|
|
|
|
invoke-virtual {v0}, Ljava/util/regex/Matcher;->end()I
|
|
|
|
move-result v0
|
|
|
|
:goto_0
|
|
invoke-virtual {p0}, Ljava/lang/String;->length()I
|
|
|
|
move-result v6
|
|
|
|
const/4 v7, 0x0
|
|
|
|
if-ge v0, v6, :cond_4
|
|
|
|
invoke-virtual {p0}, Ljava/lang/String;->length()I
|
|
|
|
move-result v6
|
|
|
|
invoke-virtual {v5, v0, v6}, Ljava/util/regex/Matcher;->region(II)Ljava/util/regex/Matcher;
|
|
|
|
invoke-virtual {v5}, Ljava/util/regex/Matcher;->lookingAt()Z
|
|
|
|
move-result v6
|
|
|
|
if-eqz v6, :cond_3
|
|
|
|
invoke-virtual {v5, v1}, Ljava/util/regex/Matcher;->group(I)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
invoke-virtual {v5}, Ljava/util/regex/Matcher;->end()I
|
|
|
|
move-result v0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
invoke-virtual {v5, v4}, Ljava/util/regex/Matcher;->group(I)Ljava/lang/String;
|
|
|
|
move-result-object v6
|
|
|
|
if-nez v6, :cond_1
|
|
|
|
const/4 v6, 0x3
|
|
|
|
invoke-virtual {v5, v6}, Ljava/util/regex/Matcher;->group(I)Ljava/lang/String;
|
|
|
|
move-result-object v6
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
const-string v10, "\'"
|
|
|
|
invoke-static {v6, v10, v7, v4}, Lk0/t/k;->startsWith$default(Ljava/lang/String;Ljava/lang/String;ZI)Z
|
|
|
|
move-result v11
|
|
|
|
if-eqz v11, :cond_2
|
|
|
|
invoke-static {v6, v10, v7, v4}, Lk0/t/k;->endsWith$default(Ljava/lang/String;Ljava/lang/String;ZI)Z
|
|
|
|
move-result v7
|
|
|
|
if-eqz v7, :cond_2
|
|
|
|
invoke-virtual {v6}, Ljava/lang/String;->length()I
|
|
|
|
move-result v7
|
|
|
|
if-le v7, v4, :cond_2
|
|
|
|
invoke-virtual {v6}, Ljava/lang/String;->length()I
|
|
|
|
move-result v7
|
|
|
|
sub-int/2addr v7, v1
|
|
|
|
invoke-virtual {v6, v1, v7}, Ljava/lang/String;->substring(II)Ljava/lang/String;
|
|
|
|
move-result-object v6
|
|
|
|
const-string v7, "(this as java.lang.Strin\u2026ing(startIndex, endIndex)"
|
|
|
|
invoke-static {v6, v7}, Lk0/n/c/i;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
:cond_2
|
|
:goto_1
|
|
invoke-interface {v3, v0}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
|
|
|
|
invoke-interface {v3, v6}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
|
|
|
|
invoke-virtual {v5}, Ljava/util/regex/Matcher;->end()I
|
|
|
|
move-result v0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_3
|
|
const-string v1, "Parameter is not formatted correctly: \""
|
|
|
|
invoke-static {v1}, Lf/e/b/a/a;->E(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {p0, v0}, Ljava/lang/String;->substring(I)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v3, "(this as java.lang.String).substring(startIndex)"
|
|
|
|
invoke-static {v0, v3}, Lk0/n/c/i;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v0, "\" for: \""
|
|
|
|
invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
new-instance v0, Ljava/lang/IllegalArgumentException;
|
|
|
|
invoke-virtual {p0}, Ljava/lang/Object;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-direct {v0, p0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_4
|
|
new-array v0, v7, [Ljava/lang/String;
|
|
|
|
invoke-interface {v3, v0}, Ljava/util/Collection;->toArray([Ljava/lang/Object;)[Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_5
|
|
|
|
move-object v10, v0
|
|
|
|
check-cast v10, [Ljava/lang/String;
|
|
|
|
const/4 v11, 0x0
|
|
|
|
new-instance v0, Lokhttp3/MediaType;
|
|
|
|
move-object v6, v0
|
|
|
|
move-object v7, p0
|
|
|
|
invoke-direct/range {v6 .. v11}, Lokhttp3/MediaType;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
|
|
|
|
return-object v0
|
|
|
|
:cond_5
|
|
new-instance p0, Lkotlin/TypeCastException;
|
|
|
|
const-string v0, "null cannot be cast to non-null type kotlin.Array<T>"
|
|
|
|
invoke-direct {p0, v0}, Lkotlin/TypeCastException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p0
|
|
|
|
:cond_6
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v1, "No subtype found for: \""
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
new-instance v0, Ljava/lang/IllegalArgumentException;
|
|
|
|
invoke-virtual {p0}, Ljava/lang/Object;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-direct {v0, p0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public static final b(Ljava/lang/String;)Lokhttp3/MediaType;
|
|
.locals 1
|
|
|
|
const-string v0, "$this$toMediaTypeOrNull"
|
|
|
|
invoke-static {p0, v0}, Lk0/n/c/i;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
:try_start_0
|
|
invoke-static {p0}, Lokhttp3/MediaType$a;->a(Ljava/lang/String;)Lokhttp3/MediaType;
|
|
|
|
move-result-object p0
|
|
:try_end_0
|
|
.catch Ljava/lang/IllegalArgumentException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
goto :goto_0
|
|
|
|
:catch_0
|
|
const/4 p0, 0x0
|
|
|
|
:goto_0
|
|
return-object p0
|
|
.end method
|