apkfuckery/com.discord/smali/androidx/browser/customtabs/CustomTabsSessionToken.smali

390 lines
9.8 KiB
Smali
Raw Normal View History

2020-05-17 12:40:10 +00:00
.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;
2020-07-08 16:44:49 +00:00
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end field
2020-05-17 12:40:10 +00:00
2020-07-16 19:51:49 +00:00
.field public final mCallbackBinder:Ld0/a/a/a;
2020-07-08 16:44:49 +00:00
.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
2020-05-17 12:40:10 +00:00
# direct methods
2020-07-16 19:51:49 +00:00
.method public constructor <init>(Ld0/a/a/a;Landroid/app/PendingIntent;)V
2020-05-17 12:40:10 +00:00
.locals 0
2020-07-16 19:51:49 +00:00
.param p1 # Ld0/a/a/a;
2020-07-08 16:44:49 +00:00
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end param
.param p2 # Landroid/app/PendingIntent;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end param
2020-05-17 12:40:10 +00:00
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
2020-07-08 16:44:49 +00:00
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
2020-07-16 19:51:49 +00:00
iput-object p1, p0, Landroidx/browser/customtabs/CustomTabsSessionToken;->mCallbackBinder:Ld0/a/a/a;
2020-07-08 16:44:49 +00:00
iput-object p2, p0, Landroidx/browser/customtabs/CustomTabsSessionToken;->mSessionId:Landroid/app/PendingIntent;
if-nez p1, :cond_2
const/4 p1, 0x0
goto :goto_1
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
:cond_2
2020-05-17 12:40:10 +00:00
new-instance p1, Landroidx/browser/customtabs/CustomTabsSessionToken$1;
invoke-direct {p1, p0}, Landroidx/browser/customtabs/CustomTabsSessionToken$1;-><init>(Landroidx/browser/customtabs/CustomTabsSessionToken;)V
2020-07-08 16:44:49 +00:00
:goto_1
2020-05-17 12:40:10 +00:00
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;
2020-07-08 16:44:49 +00:00
.locals 3
2020-05-17 12:40:10 +00:00
.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
2020-07-08 16:44:49 +00:00
const/4 v2, 0x0
2020-07-16 19:51:49 +00:00
invoke-direct {v0, v1, v2}, Landroidx/browser/customtabs/CustomTabsSessionToken;-><init>(Ld0/a/a/a;Landroid/app/PendingIntent;)V
2020-07-08 16:44:49 +00:00
return-object v0
.end method
.method private getCallbackBinderAssertNotNull()Landroid/os/IBinder;
.locals 2
2020-07-16 19:51:49 +00:00
iget-object v0, p0, Landroidx/browser/customtabs/CustomTabsSessionToken;->mCallbackBinder:Ld0/a/a/a;
2020-07-08 16:44:49 +00:00
if-eqz v0, :cond_0
invoke-interface {v0}, Landroid/os/IInterface;->asBinder()Landroid/os/IBinder;
move-result-object v0
2020-05-17 12:40:10 +00:00
return-object v0
2020-07-08 16:44:49 +00:00
: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
2020-05-17 12:40:10 +00:00
.end method
.method public static getSessionTokenFromIntent(Landroid/content/Intent;)Landroidx/browser/customtabs/CustomTabsSessionToken;
2020-07-08 16:44:49 +00:00
.locals 3
.param p0 # Landroid/content/Intent;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.annotation build Landroidx/annotation/Nullable;
.end annotation
2020-05-17 12:40:10 +00:00
invoke-virtual {p0}, Landroid/content/Intent;->getExtras()Landroid/os/Bundle;
2020-07-08 16:44:49 +00:00
move-result-object v0
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
const/4 v1, 0x0
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
if-nez v0, :cond_0
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
return-object v1
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
:cond_0
const-string v2, "android.support.customtabs.extra.SESSION"
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
invoke-static {v0, v2}, Landroidx/core/app/BundleCompat;->getBinder(Landroid/os/Bundle;Ljava/lang/String;)Landroid/os/IBinder;
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
move-result-object v0
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
const-string v2, "android.support.customtabs.extra.SESSION_ID"
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
invoke-virtual {p0, v2}, Landroid/content/Intent;->getParcelableExtra(Ljava/lang/String;)Landroid/os/Parcelable;
2020-05-17 12:40:10 +00:00
move-result-object p0
2020-07-08 16:44:49 +00:00
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
2020-07-16 19:51:49 +00:00
invoke-static {v0}, Ld0/a/a/a$a;->asInterface(Landroid/os/IBinder;)Ld0/a/a/a;
2020-07-08 16:44:49 +00:00
move-result-object v1
:goto_0
new-instance v0, Landroidx/browser/customtabs/CustomTabsSessionToken;
2020-07-16 19:51:49 +00:00
invoke-direct {v0, v1, p0}, Landroidx/browser/customtabs/CustomTabsSessionToken;-><init>(Ld0/a/a/a;Landroid/app/PendingIntent;)V
2020-05-17 12:40:10 +00:00
return-object v0
.end method
# virtual methods
.method public equals(Ljava/lang/Object;)Z
2020-07-08 16:44:49 +00:00
.locals 4
2020-05-17 12:40:10 +00:00
instance-of v0, p1, Landroidx/browser/customtabs/CustomTabsSessionToken;
2020-07-08 16:44:49 +00:00
const/4 v1, 0x0
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
if-nez v0, :cond_0
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
return v1
2020-05-17 12:40:10 +00:00
:cond_0
check-cast p1, Landroidx/browser/customtabs/CustomTabsSessionToken;
2020-07-08 16:44:49 +00:00
invoke-virtual {p1}, Landroidx/browser/customtabs/CustomTabsSessionToken;->getId()Landroid/app/PendingIntent;
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
move-result-object v0
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
iget-object v2, p0, Landroidx/browser/customtabs/CustomTabsSessionToken;->mSessionId:Landroid/app/PendingIntent;
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
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;
2020-05-17 12:40:10 +00:00
move-result-object v0
2020-07-08 16:44:49 +00:00
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
2020-05-17 12:40:10 +00:00
move-result p1
return p1
.end method
.method public getCallback()Landroidx/browser/customtabs/CustomTabsCallback;
.locals 1
2020-07-08 16:44:49 +00:00
.annotation build Landroidx/annotation/Nullable;
.end annotation
2020-05-17 12:40:10 +00:00
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
2020-07-08 16:44:49 +00:00
.annotation build Landroidx/annotation/Nullable;
.end annotation
2020-07-16 19:51:49 +00:00
iget-object v0, p0, Landroidx/browser/customtabs/CustomTabsSessionToken;->mCallbackBinder:Ld0/a/a/a;
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
if-nez v0, :cond_0
const/4 v0, 0x0
return-object v0
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
:cond_0
2020-05-17 12:40:10 +00:00
invoke-interface {v0}, Landroid/os/IInterface;->asBinder()Landroid/os/IBinder;
move-result-object v0
return-object v0
.end method
2020-07-08 16:44:49 +00:00
.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
2020-07-16 19:51:49 +00:00
iget-object v0, p0, Landroidx/browser/customtabs/CustomTabsSessionToken;->mCallbackBinder:Ld0/a/a/a;
2020-07-08 16:44:49 +00:00
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
2020-05-17 12:40:10 +00:00
.method public hashCode()I
.locals 1
2020-07-08 16:44:49 +00:00
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;
2020-05-17 12:40:10 +00:00
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
2020-07-08 16:44:49 +00:00
.param p1 # Landroidx/browser/customtabs/CustomTabsSession;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
2020-05-17 12:40:10 +00:00
invoke-virtual {p1}, Landroidx/browser/customtabs/CustomTabsSession;->getBinder()Landroid/os/IBinder;
move-result-object p1
2020-07-16 19:51:49 +00:00
iget-object v0, p0, Landroidx/browser/customtabs/CustomTabsSessionToken;->mCallbackBinder:Ld0/a/a/a;
2020-05-17 12:40:10 +00:00
invoke-virtual {p1, v0}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result p1
return p1
.end method