apkfuckery/com.discord/smali/androidx/browser/customtabs/CustomTabsSessionToken.smali
2020-07-23 01:06:17 +00:00

389 lines
9.8 KiB
Smali

.class public Landroidx/browser/customtabs/CustomTabsSessionToken;
.super Ljava/lang/Object;
.source "CustomTabsSessionToken.java"
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Landroidx/browser/customtabs/CustomTabsSessionToken$MockCallback;
}
.end annotation
# static fields
.field public static final TAG:Ljava/lang/String; = "CustomTabsSessionToken"
# instance fields
.field public final mCallback:Landroidx/browser/customtabs/CustomTabsCallback;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end field
.field public final mCallbackBinder:Ld0/a/a/a;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end field
.field public final mSessionId:Landroid/app/PendingIntent;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end field
# direct methods
.method public constructor <init>(Ld0/a/a/a;Landroid/app/PendingIntent;)V
.locals 0
.param p1 # Ld0/a/a/a;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end param
.param p2 # Landroid/app/PendingIntent;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end param
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
if-nez p1, :cond_1
if-eqz p2, :cond_0
goto :goto_0
:cond_0
new-instance p1, Ljava/lang/IllegalStateException;
const-string p2, "CustomTabsSessionToken must have either a session id or a callback (or both)."
invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw p1
:cond_1
:goto_0
iput-object p1, p0, Landroidx/browser/customtabs/CustomTabsSessionToken;->mCallbackBinder:Ld0/a/a/a;
iput-object p2, p0, Landroidx/browser/customtabs/CustomTabsSessionToken;->mSessionId:Landroid/app/PendingIntent;
if-nez p1, :cond_2
const/4 p1, 0x0
goto :goto_1
:cond_2
new-instance p1, Landroidx/browser/customtabs/CustomTabsSessionToken$1;
invoke-direct {p1, p0}, Landroidx/browser/customtabs/CustomTabsSessionToken$1;-><init>(Landroidx/browser/customtabs/CustomTabsSessionToken;)V
:goto_1
iput-object p1, p0, Landroidx/browser/customtabs/CustomTabsSessionToken;->mCallback:Landroidx/browser/customtabs/CustomTabsCallback;
return-void
.end method
.method public static createMockSessionTokenForTesting()Landroidx/browser/customtabs/CustomTabsSessionToken;
.locals 3
.annotation build Landroidx/annotation/NonNull;
.end annotation
new-instance v0, Landroidx/browser/customtabs/CustomTabsSessionToken;
new-instance v1, Landroidx/browser/customtabs/CustomTabsSessionToken$MockCallback;
invoke-direct {v1}, Landroidx/browser/customtabs/CustomTabsSessionToken$MockCallback;-><init>()V
const/4 v2, 0x0
invoke-direct {v0, v1, v2}, Landroidx/browser/customtabs/CustomTabsSessionToken;-><init>(Ld0/a/a/a;Landroid/app/PendingIntent;)V
return-object v0
.end method
.method private getCallbackBinderAssertNotNull()Landroid/os/IBinder;
.locals 2
iget-object v0, p0, Landroidx/browser/customtabs/CustomTabsSessionToken;->mCallbackBinder:Ld0/a/a/a;
if-eqz v0, :cond_0
invoke-interface {v0}, Landroid/os/IInterface;->asBinder()Landroid/os/IBinder;
move-result-object v0
return-object v0
:cond_0
new-instance v0, Ljava/lang/IllegalStateException;
const-string v1, "CustomTabSessionToken must have valid binder or pending session"
invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw v0
.end method
.method public static getSessionTokenFromIntent(Landroid/content/Intent;)Landroidx/browser/customtabs/CustomTabsSessionToken;
.locals 3
.param p0 # Landroid/content/Intent;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.annotation build Landroidx/annotation/Nullable;
.end annotation
invoke-virtual {p0}, Landroid/content/Intent;->getExtras()Landroid/os/Bundle;
move-result-object v0
const/4 v1, 0x0
if-nez v0, :cond_0
return-object v1
:cond_0
const-string v2, "android.support.customtabs.extra.SESSION"
invoke-static {v0, v2}, Landroidx/core/app/BundleCompat;->getBinder(Landroid/os/Bundle;Ljava/lang/String;)Landroid/os/IBinder;
move-result-object v0
const-string v2, "android.support.customtabs.extra.SESSION_ID"
invoke-virtual {p0, v2}, Landroid/content/Intent;->getParcelableExtra(Ljava/lang/String;)Landroid/os/Parcelable;
move-result-object p0
check-cast p0, Landroid/app/PendingIntent;
if-nez v0, :cond_1
if-nez p0, :cond_1
return-object v1
:cond_1
if-nez v0, :cond_2
goto :goto_0
:cond_2
invoke-static {v0}, Ld0/a/a/a$a;->asInterface(Landroid/os/IBinder;)Ld0/a/a/a;
move-result-object v1
:goto_0
new-instance v0, Landroidx/browser/customtabs/CustomTabsSessionToken;
invoke-direct {v0, v1, p0}, Landroidx/browser/customtabs/CustomTabsSessionToken;-><init>(Ld0/a/a/a;Landroid/app/PendingIntent;)V
return-object v0
.end method
# virtual methods
.method public equals(Ljava/lang/Object;)Z
.locals 4
instance-of v0, p1, Landroidx/browser/customtabs/CustomTabsSessionToken;
const/4 v1, 0x0
if-nez v0, :cond_0
return v1
:cond_0
check-cast p1, Landroidx/browser/customtabs/CustomTabsSessionToken;
invoke-virtual {p1}, Landroidx/browser/customtabs/CustomTabsSessionToken;->getId()Landroid/app/PendingIntent;
move-result-object v0
iget-object v2, p0, Landroidx/browser/customtabs/CustomTabsSessionToken;->mSessionId:Landroid/app/PendingIntent;
const/4 v3, 0x1
if-nez v2, :cond_1
const/4 v2, 0x1
goto :goto_0
:cond_1
const/4 v2, 0x0
:goto_0
if-nez v0, :cond_2
goto :goto_1
:cond_2
const/4 v3, 0x0
:goto_1
if-eq v2, v3, :cond_3
return v1
:cond_3
iget-object v1, p0, Landroidx/browser/customtabs/CustomTabsSessionToken;->mSessionId:Landroid/app/PendingIntent;
if-eqz v1, :cond_4
invoke-virtual {v1, v0}, Landroid/app/PendingIntent;->equals(Ljava/lang/Object;)Z
move-result p1
return p1
:cond_4
invoke-direct {p0}, Landroidx/browser/customtabs/CustomTabsSessionToken;->getCallbackBinderAssertNotNull()Landroid/os/IBinder;
move-result-object v0
invoke-direct {p1}, Landroidx/browser/customtabs/CustomTabsSessionToken;->getCallbackBinderAssertNotNull()Landroid/os/IBinder;
move-result-object p1
invoke-virtual {v0, p1}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result p1
return p1
.end method
.method public getCallback()Landroidx/browser/customtabs/CustomTabsCallback;
.locals 1
.annotation build Landroidx/annotation/Nullable;
.end annotation
iget-object v0, p0, Landroidx/browser/customtabs/CustomTabsSessionToken;->mCallback:Landroidx/browser/customtabs/CustomTabsCallback;
return-object v0
.end method
.method public getCallbackBinder()Landroid/os/IBinder;
.locals 1
.annotation build Landroidx/annotation/Nullable;
.end annotation
iget-object v0, p0, Landroidx/browser/customtabs/CustomTabsSessionToken;->mCallbackBinder:Ld0/a/a/a;
if-nez v0, :cond_0
const/4 v0, 0x0
return-object v0
:cond_0
invoke-interface {v0}, Landroid/os/IInterface;->asBinder()Landroid/os/IBinder;
move-result-object v0
return-object v0
.end method
.method public getId()Landroid/app/PendingIntent;
.locals 1
.annotation build Landroidx/annotation/Nullable;
.end annotation
iget-object v0, p0, Landroidx/browser/customtabs/CustomTabsSessionToken;->mSessionId:Landroid/app/PendingIntent;
return-object v0
.end method
.method public hasCallback()Z
.locals 1
.annotation build Landroidx/annotation/RestrictTo;
value = {
.enum Landroidx/annotation/RestrictTo$Scope;->LIBRARY:Landroidx/annotation/RestrictTo$Scope;
}
.end annotation
iget-object v0, p0, Landroidx/browser/customtabs/CustomTabsSessionToken;->mCallbackBinder:Ld0/a/a/a;
if-eqz v0, :cond_0
const/4 v0, 0x1
goto :goto_0
:cond_0
const/4 v0, 0x0
:goto_0
return v0
.end method
.method public hasId()Z
.locals 1
.annotation build Landroidx/annotation/RestrictTo;
value = {
.enum Landroidx/annotation/RestrictTo$Scope;->LIBRARY:Landroidx/annotation/RestrictTo$Scope;
}
.end annotation
iget-object v0, p0, Landroidx/browser/customtabs/CustomTabsSessionToken;->mSessionId:Landroid/app/PendingIntent;
if-eqz v0, :cond_0
const/4 v0, 0x1
goto :goto_0
:cond_0
const/4 v0, 0x0
:goto_0
return v0
.end method
.method public hashCode()I
.locals 1
iget-object v0, p0, Landroidx/browser/customtabs/CustomTabsSessionToken;->mSessionId:Landroid/app/PendingIntent;
if-eqz v0, :cond_0
invoke-virtual {v0}, Landroid/app/PendingIntent;->hashCode()I
move-result v0
return v0
:cond_0
invoke-direct {p0}, Landroidx/browser/customtabs/CustomTabsSessionToken;->getCallbackBinderAssertNotNull()Landroid/os/IBinder;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/Object;->hashCode()I
move-result v0
return v0
.end method
.method public isAssociatedWith(Landroidx/browser/customtabs/CustomTabsSession;)Z
.locals 1
.param p1 # Landroidx/browser/customtabs/CustomTabsSession;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
invoke-virtual {p1}, Landroidx/browser/customtabs/CustomTabsSession;->getBinder()Landroid/os/IBinder;
move-result-object p1
iget-object v0, p0, Landroidx/browser/customtabs/CustomTabsSessionToken;->mCallbackBinder:Ld0/a/a/a;
invoke-virtual {p1, v0}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result p1
return p1
.end method