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

551 lines
16 KiB
Smali
Raw Normal View History

2020-05-17 12:40:10 +00:00
.class public final Landroidx/browser/customtabs/CustomTabsSession;
.super Ljava/lang/Object;
.source "CustomTabsSession.java"
2020-07-08 16:44:49 +00:00
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Landroidx/browser/customtabs/CustomTabsSession$MockSession;,
Landroidx/browser/customtabs/CustomTabsSession$PendingSession;
}
.end annotation
2020-05-17 12:40:10 +00:00
# static fields
.field public static final TAG:Ljava/lang/String; = "CustomTabsSession"
# instance fields
2020-09-02 04:07:20 +00:00
.field public final mCallback:Le0/a/a/a;
2020-05-17 12:40:10 +00:00
.field public final mComponentName:Landroid/content/ComponentName;
2020-07-08 16:44:49 +00:00
.field public final mId:Landroid/app/PendingIntent;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end field
2020-05-17 12:40:10 +00:00
.field public final mLock:Ljava/lang/Object;
2020-09-02 04:07:20 +00:00
.field public final mService:Le0/a/a/b;
2020-05-17 12:40:10 +00:00
# direct methods
2020-09-02 04:07:20 +00:00
.method public constructor <init>(Le0/a/a/b;Le0/a/a/a;Landroid/content/ComponentName;Landroid/app/PendingIntent;)V
2020-05-17 12:40:10 +00:00
.locals 1
2020-07-08 16:44:49 +00:00
.param p4 # 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
new-instance v0, Ljava/lang/Object;
invoke-direct {v0}, Ljava/lang/Object;-><init>()V
iput-object v0, p0, Landroidx/browser/customtabs/CustomTabsSession;->mLock:Ljava/lang/Object;
2020-09-02 04:07:20 +00:00
iput-object p1, p0, Landroidx/browser/customtabs/CustomTabsSession;->mService:Le0/a/a/b;
2020-05-17 12:40:10 +00:00
2020-09-02 04:07:20 +00:00
iput-object p2, p0, Landroidx/browser/customtabs/CustomTabsSession;->mCallback:Le0/a/a/a;
2020-05-17 12:40:10 +00:00
iput-object p3, p0, Landroidx/browser/customtabs/CustomTabsSession;->mComponentName:Landroid/content/ComponentName;
2020-07-08 16:44:49 +00:00
iput-object p4, p0, Landroidx/browser/customtabs/CustomTabsSession;->mId:Landroid/app/PendingIntent;
2020-05-17 12:40:10 +00:00
return-void
.end method
2020-07-08 16:44:49 +00:00
.method private addIdToBundle(Landroid/os/Bundle;)V
.locals 2
iget-object v0, p0, Landroidx/browser/customtabs/CustomTabsSession;->mId:Landroid/app/PendingIntent;
if-eqz v0, :cond_0
const-string v1, "android.support.customtabs.extra.SESSION_ID"
invoke-virtual {p1, v1, v0}, Landroid/os/Bundle;->putParcelable(Ljava/lang/String;Landroid/os/Parcelable;)V
:cond_0
return-void
.end method
.method private createBundleWithId(Landroid/os/Bundle;)Landroid/os/Bundle;
.locals 1
.param p1 # Landroid/os/Bundle;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end param
new-instance v0, Landroid/os/Bundle;
invoke-direct {v0}, Landroid/os/Bundle;-><init>()V
if-eqz p1, :cond_0
invoke-virtual {v0, p1}, Landroid/os/Bundle;->putAll(Landroid/os/Bundle;)V
:cond_0
invoke-direct {p0, v0}, Landroidx/browser/customtabs/CustomTabsSession;->addIdToBundle(Landroid/os/Bundle;)V
return-object v0
.end method
2020-05-17 12:40:10 +00:00
.method public static createMockSessionForTesting(Landroid/content/ComponentName;)Landroidx/browser/customtabs/CustomTabsSession;
2020-07-08 16:44:49 +00:00
.locals 4
2020-05-17 12:40:10 +00:00
.param p0 # Landroid/content/ComponentName;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.annotation build Landroidx/annotation/NonNull;
.end annotation
.annotation build Landroidx/annotation/VisibleForTesting;
.end annotation
new-instance v0, Landroidx/browser/customtabs/CustomTabsSession;
2020-07-08 16:44:49 +00:00
new-instance v1, Landroidx/browser/customtabs/CustomTabsSession$MockSession;
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
invoke-direct {v1}, Landroidx/browser/customtabs/CustomTabsSession$MockSession;-><init>()V
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
new-instance v2, Landroidx/browser/customtabs/CustomTabsSessionToken$MockCallback;
invoke-direct {v2}, Landroidx/browser/customtabs/CustomTabsSessionToken$MockCallback;-><init>()V
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
const/4 v3, 0x0
2020-09-02 04:07:20 +00:00
invoke-direct {v0, v1, v2, p0, v3}, Landroidx/browser/customtabs/CustomTabsSession;-><init>(Le0/a/a/b;Le0/a/a/a;Landroid/content/ComponentName;Landroid/app/PendingIntent;)V
2020-05-17 12:40:10 +00:00
return-object v0
.end method
# virtual methods
.method public getBinder()Landroid/os/IBinder;
.locals 1
2020-09-02 04:07:20 +00:00
iget-object v0, p0, Landroidx/browser/customtabs/CustomTabsSession;->mCallback:Le0/a/a/a;
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
.method public getComponentName()Landroid/content/ComponentName;
.locals 1
iget-object v0, p0, Landroidx/browser/customtabs/CustomTabsSession;->mComponentName:Landroid/content/ComponentName;
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/CustomTabsSession;->mId:Landroid/app/PendingIntent;
return-object v0
.end method
2020-05-17 12:40:10 +00:00
.method public mayLaunchUrl(Landroid/net/Uri;Landroid/os/Bundle;Ljava/util/List;)Z
.locals 2
2020-07-08 16:44:49 +00:00
.param p1 # Landroid/net/Uri;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p2 # Landroid/os/Bundle;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end param
.param p3 # Ljava/util/List;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end param
2020-05-17 12:40:10 +00:00
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Landroid/net/Uri;",
"Landroid/os/Bundle;",
"Ljava/util/List<",
"Landroid/os/Bundle;",
">;)Z"
}
.end annotation
2020-07-08 16:44:49 +00:00
invoke-direct {p0, p2}, Landroidx/browser/customtabs/CustomTabsSession;->createBundleWithId(Landroid/os/Bundle;)Landroid/os/Bundle;
move-result-object p2
2020-05-17 12:40:10 +00:00
:try_start_0
2020-09-02 04:07:20 +00:00
iget-object v0, p0, Landroidx/browser/customtabs/CustomTabsSession;->mService:Le0/a/a/b;
2020-05-17 12:40:10 +00:00
2020-09-02 04:07:20 +00:00
iget-object v1, p0, Landroidx/browser/customtabs/CustomTabsSession;->mCallback:Le0/a/a/a;
2020-05-17 12:40:10 +00:00
2020-09-02 04:07:20 +00:00
invoke-interface {v0, v1, p1, p2, p3}, Le0/a/a/b;->mayLaunchUrl(Le0/a/a/a;Landroid/net/Uri;Landroid/os/Bundle;Ljava/util/List;)Z
2020-05-17 12:40:10 +00:00
move-result p1
:try_end_0
.catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0
return p1
:catch_0
const/4 p1, 0x0
return p1
.end method
.method public postMessage(Ljava/lang/String;Landroid/os/Bundle;)I
.locals 3
2020-07-08 16:44:49 +00:00
.param p1 # Ljava/lang/String;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p2 # Landroid/os/Bundle;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end param
invoke-direct {p0, p2}, Landroidx/browser/customtabs/CustomTabsSession;->createBundleWithId(Landroid/os/Bundle;)Landroid/os/Bundle;
move-result-object p2
2020-05-17 12:40:10 +00:00
iget-object v0, p0, Landroidx/browser/customtabs/CustomTabsSession;->mLock:Ljava/lang/Object;
monitor-enter v0
:try_start_0
2020-09-02 04:07:20 +00:00
iget-object v1, p0, Landroidx/browser/customtabs/CustomTabsSession;->mService:Le0/a/a/b;
2020-05-17 12:40:10 +00:00
2020-09-02 04:07:20 +00:00
iget-object v2, p0, Landroidx/browser/customtabs/CustomTabsSession;->mCallback:Le0/a/a/a;
2020-05-17 12:40:10 +00:00
2020-09-02 04:07:20 +00:00
invoke-interface {v1, v2, p1, p2}, Le0/a/a/b;->postMessage(Le0/a/a/a;Ljava/lang/String;Landroid/os/Bundle;)I
2020-05-17 12:40:10 +00:00
move-result p1
:try_end_0
.catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
:try_start_1
monitor-exit v0
return p1
:catchall_0
move-exception p1
goto :goto_0
:catch_0
const/4 p1, -0x2
monitor-exit v0
return p1
:goto_0
monitor-exit v0
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
throw p1
.end method
2020-07-08 16:44:49 +00:00
.method public receiveFile(Landroid/net/Uri;ILandroid/os/Bundle;)Z
2020-05-17 12:40:10 +00:00
.locals 2
2020-07-08 16:44:49 +00:00
.param p1 # Landroid/net/Uri;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p3 # Landroid/os/Bundle;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end param
invoke-direct {p0, p3}, Landroidx/browser/customtabs/CustomTabsSession;->createBundleWithId(Landroid/os/Bundle;)Landroid/os/Bundle;
move-result-object p3
2020-05-17 12:40:10 +00:00
:try_start_0
2020-09-02 04:07:20 +00:00
iget-object v0, p0, Landroidx/browser/customtabs/CustomTabsSession;->mService:Le0/a/a/b;
2020-05-17 12:40:10 +00:00
2020-09-02 04:07:20 +00:00
iget-object v1, p0, Landroidx/browser/customtabs/CustomTabsSession;->mCallback:Le0/a/a/a;
2020-05-17 12:40:10 +00:00
2020-09-02 04:07:20 +00:00
invoke-interface {v0, v1, p1, p2, p3}, Le0/a/a/b;->receiveFile(Le0/a/a/a;Landroid/net/Uri;ILandroid/os/Bundle;)Z
2020-07-08 16:44:49 +00:00
move-result p1
:try_end_0
.catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0
return p1
:catch_0
const/4 p1, 0x0
return p1
.end method
.method public requestPostMessageChannel(Landroid/net/Uri;)Z
.locals 3
.param p1 # Landroid/net/Uri;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
:try_start_0
iget-object v0, p0, Landroidx/browser/customtabs/CustomTabsSession;->mId:Landroid/app/PendingIntent;
if-eqz v0, :cond_0
2020-09-02 04:07:20 +00:00
iget-object v0, p0, Landroidx/browser/customtabs/CustomTabsSession;->mService:Le0/a/a/b;
2020-07-08 16:44:49 +00:00
2020-09-02 04:07:20 +00:00
iget-object v1, p0, Landroidx/browser/customtabs/CustomTabsSession;->mCallback:Le0/a/a/a;
2020-07-08 16:44:49 +00:00
const/4 v2, 0x0
invoke-direct {p0, v2}, Landroidx/browser/customtabs/CustomTabsSession;->createBundleWithId(Landroid/os/Bundle;)Landroid/os/Bundle;
move-result-object v2
2020-09-02 04:07:20 +00:00
invoke-interface {v0, v1, p1, v2}, Le0/a/a/b;->requestPostMessageChannelWithExtras(Le0/a/a/a;Landroid/net/Uri;Landroid/os/Bundle;)Z
2020-07-08 16:44:49 +00:00
move-result p1
return p1
:cond_0
2020-09-02 04:07:20 +00:00
iget-object v0, p0, Landroidx/browser/customtabs/CustomTabsSession;->mService:Le0/a/a/b;
2020-07-08 16:44:49 +00:00
2020-09-02 04:07:20 +00:00
iget-object v1, p0, Landroidx/browser/customtabs/CustomTabsSession;->mCallback:Le0/a/a/a;
2020-07-08 16:44:49 +00:00
2020-09-02 04:07:20 +00:00
invoke-interface {v0, v1, p1}, Le0/a/a/b;->requestPostMessageChannel(Le0/a/a/a;Landroid/net/Uri;)Z
2020-05-17 12:40:10 +00:00
move-result p1
:try_end_0
.catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0
return p1
:catch_0
const/4 p1, 0x0
return p1
.end method
.method public setActionButton(Landroid/graphics/Bitmap;Ljava/lang/String;)Z
.locals 2
.param p1 # Landroid/graphics/Bitmap;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p2 # Ljava/lang/String;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
new-instance v0, Landroid/os/Bundle;
invoke-direct {v0}, Landroid/os/Bundle;-><init>()V
const-string v1, "android.support.customtabs.customaction.ICON"
invoke-virtual {v0, v1, p1}, Landroid/os/Bundle;->putParcelable(Ljava/lang/String;Landroid/os/Parcelable;)V
const-string p1, "android.support.customtabs.customaction.DESCRIPTION"
invoke-virtual {v0, p1, p2}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V
new-instance p1, Landroid/os/Bundle;
invoke-direct {p1}, Landroid/os/Bundle;-><init>()V
const-string p2, "android.support.customtabs.extra.ACTION_BUTTON_BUNDLE"
invoke-virtual {p1, p2, v0}, Landroid/os/Bundle;->putBundle(Ljava/lang/String;Landroid/os/Bundle;)V
2020-07-08 16:44:49 +00:00
invoke-direct {p0, v0}, Landroidx/browser/customtabs/CustomTabsSession;->addIdToBundle(Landroid/os/Bundle;)V
2020-05-17 12:40:10 +00:00
:try_start_0
2020-09-02 04:07:20 +00:00
iget-object p2, p0, Landroidx/browser/customtabs/CustomTabsSession;->mService:Le0/a/a/b;
2020-05-17 12:40:10 +00:00
2020-09-02 04:07:20 +00:00
iget-object v0, p0, Landroidx/browser/customtabs/CustomTabsSession;->mCallback:Le0/a/a/a;
2020-05-17 12:40:10 +00:00
2020-09-02 04:07:20 +00:00
invoke-interface {p2, v0, p1}, Le0/a/a/b;->updateVisuals(Le0/a/a/a;Landroid/os/Bundle;)Z
2020-05-17 12:40:10 +00:00
move-result p1
:try_end_0
.catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0
return p1
:catch_0
const/4 p1, 0x0
return p1
.end method
.method public setSecondaryToolbarViews(Landroid/widget/RemoteViews;[ILandroid/app/PendingIntent;)Z
.locals 2
.param p1 # Landroid/widget/RemoteViews;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end param
.param p2 # [I
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end param
.param p3 # Landroid/app/PendingIntent;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end param
new-instance v0, Landroid/os/Bundle;
invoke-direct {v0}, Landroid/os/Bundle;-><init>()V
const-string v1, "android.support.customtabs.extra.EXTRA_REMOTEVIEWS"
invoke-virtual {v0, v1, p1}, Landroid/os/Bundle;->putParcelable(Ljava/lang/String;Landroid/os/Parcelable;)V
const-string p1, "android.support.customtabs.extra.EXTRA_REMOTEVIEWS_VIEW_IDS"
invoke-virtual {v0, p1, p2}, Landroid/os/Bundle;->putIntArray(Ljava/lang/String;[I)V
const-string p1, "android.support.customtabs.extra.EXTRA_REMOTEVIEWS_PENDINGINTENT"
invoke-virtual {v0, p1, p3}, Landroid/os/Bundle;->putParcelable(Ljava/lang/String;Landroid/os/Parcelable;)V
2020-07-08 16:44:49 +00:00
invoke-direct {p0, v0}, Landroidx/browser/customtabs/CustomTabsSession;->addIdToBundle(Landroid/os/Bundle;)V
2020-05-17 12:40:10 +00:00
:try_start_0
2020-09-02 04:07:20 +00:00
iget-object p1, p0, Landroidx/browser/customtabs/CustomTabsSession;->mService:Le0/a/a/b;
2020-05-17 12:40:10 +00:00
2020-09-02 04:07:20 +00:00
iget-object p2, p0, Landroidx/browser/customtabs/CustomTabsSession;->mCallback:Le0/a/a/a;
2020-05-17 12:40:10 +00:00
2020-09-02 04:07:20 +00:00
invoke-interface {p1, p2, v0}, Le0/a/a/b;->updateVisuals(Le0/a/a/a;Landroid/os/Bundle;)Z
2020-05-17 12:40:10 +00:00
move-result p1
:try_end_0
.catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0
return p1
:catch_0
const/4 p1, 0x0
return p1
.end method
.method public setToolbarItem(ILandroid/graphics/Bitmap;Ljava/lang/String;)Z
.locals 2
.param p2 # Landroid/graphics/Bitmap;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p3 # Ljava/lang/String;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.annotation runtime Ljava/lang/Deprecated;
.end annotation
new-instance v0, Landroid/os/Bundle;
invoke-direct {v0}, Landroid/os/Bundle;-><init>()V
const-string v1, "android.support.customtabs.customaction.ID"
invoke-virtual {v0, v1, p1}, Landroid/os/Bundle;->putInt(Ljava/lang/String;I)V
const-string p1, "android.support.customtabs.customaction.ICON"
invoke-virtual {v0, p1, p2}, Landroid/os/Bundle;->putParcelable(Ljava/lang/String;Landroid/os/Parcelable;)V
const-string p1, "android.support.customtabs.customaction.DESCRIPTION"
invoke-virtual {v0, p1, p3}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V
new-instance p1, Landroid/os/Bundle;
invoke-direct {p1}, Landroid/os/Bundle;-><init>()V
const-string p2, "android.support.customtabs.extra.ACTION_BUTTON_BUNDLE"
invoke-virtual {p1, p2, v0}, Landroid/os/Bundle;->putBundle(Ljava/lang/String;Landroid/os/Bundle;)V
2020-07-08 16:44:49 +00:00
invoke-direct {p0, p1}, Landroidx/browser/customtabs/CustomTabsSession;->addIdToBundle(Landroid/os/Bundle;)V
2020-05-17 12:40:10 +00:00
:try_start_0
2020-09-02 04:07:20 +00:00
iget-object p2, p0, Landroidx/browser/customtabs/CustomTabsSession;->mService:Le0/a/a/b;
2020-05-17 12:40:10 +00:00
2020-09-02 04:07:20 +00:00
iget-object p3, p0, Landroidx/browser/customtabs/CustomTabsSession;->mCallback:Le0/a/a/a;
2020-05-17 12:40:10 +00:00
2020-09-02 04:07:20 +00:00
invoke-interface {p2, p3, p1}, Le0/a/a/b;->updateVisuals(Le0/a/a/a;Landroid/os/Bundle;)Z
2020-05-17 12:40:10 +00:00
move-result p1
:try_end_0
.catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0
return p1
:catch_0
const/4 p1, 0x0
return p1
.end method
.method public validateRelationship(ILandroid/net/Uri;Landroid/os/Bundle;)Z
.locals 3
.param p2 # Landroid/net/Uri;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p3 # Landroid/os/Bundle;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end param
const/4 v0, 0x0
const/4 v1, 0x1
if-lt p1, v1, :cond_1
const/4 v1, 0x2
if-le p1, v1, :cond_0
goto :goto_0
:cond_0
2020-07-08 16:44:49 +00:00
invoke-direct {p0, p3}, Landroidx/browser/customtabs/CustomTabsSession;->createBundleWithId(Landroid/os/Bundle;)Landroid/os/Bundle;
move-result-object p3
2020-05-17 12:40:10 +00:00
:try_start_0
2020-09-02 04:07:20 +00:00
iget-object v1, p0, Landroidx/browser/customtabs/CustomTabsSession;->mService:Le0/a/a/b;
2020-05-17 12:40:10 +00:00
2020-09-02 04:07:20 +00:00
iget-object v2, p0, Landroidx/browser/customtabs/CustomTabsSession;->mCallback:Le0/a/a/a;
2020-05-17 12:40:10 +00:00
2020-09-02 04:07:20 +00:00
invoke-interface {v1, v2, p1, p2, p3}, Le0/a/a/b;->validateRelationship(Le0/a/a/a;ILandroid/net/Uri;Landroid/os/Bundle;)Z
2020-05-17 12:40:10 +00:00
move-result p1
:try_end_0
.catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0
return p1
:catch_0
:cond_1
:goto_0
return v0
.end method