Files
rr3-apk/smali/androidx/browser/customtabs/PostMessageServiceConnection.smali
Daniel Elliott f3960ee359 Add Discord APKTool decompilation (Smali source for modding)
- Imported from https://github.com/supermegamestre/Project-Real-Resurrection-3
- APKTool decompilation (Smali bytecode) for modding and rebuilding APK
- Supports both 32-bit (armeabi-v7a) and 64-bit (arm64-v8a) architectures
- Includes full Smali source, resources, and native libraries
- Ready to rebuild APK after modifications with apktool b command
- Added comprehensive README-apktool.md with modding guide

This branch complements the JADX branches:
- Use JADX (main/discord-community) to UNDERSTAND code (readable Java)
- Use APKTool (this branch) to MODIFY and REBUILD APK (editable Smali)

Total: 44,417 files, 538.51 MB Smali source code
2026-02-18 16:13:44 -08:00

510 lines
14 KiB
Smali

.class public abstract Landroidx/browser/customtabs/PostMessageServiceConnection;
.super Ljava/lang/Object;
.source "SourceFile"
# interfaces
.implements Landroidx/browser/customtabs/PostMessageBackend;
.implements Landroid/content/ServiceConnection;
# static fields
.field private static final TAG:Ljava/lang/String; = "PostMessageServConn"
# instance fields
.field private final mLock:Ljava/lang/Object;
.field private mMessageChannelCreated:Z
.field private mPackageName:Ljava/lang/String;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end field
.field private mService:Landroid/support/customtabs/IPostMessageService;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end field
.field private final mSessionBinder:Landroid/support/customtabs/ICustomTabsCallback;
# direct methods
.method public constructor <init>(Landroidx/browser/customtabs/CustomTabsSessionToken;)V
.locals 1
.param p1 # Landroidx/browser/customtabs/CustomTabsSessionToken;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.line 53
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 45
new-instance v0, Ljava/lang/Object;
invoke-direct {v0}, Ljava/lang/Object;-><init>()V
iput-object v0, p0, Landroidx/browser/customtabs/PostMessageServiceConnection;->mLock:Ljava/lang/Object;
.line 54
invoke-virtual {p1}, Landroidx/browser/customtabs/CustomTabsSessionToken;->getCallbackBinder()Landroid/os/IBinder;
move-result-object p1
if-eqz p1, :cond_0
.line 58
invoke-static {p1}, Landroid/support/customtabs/ICustomTabsCallback$Stub;->asInterface(Landroid/os/IBinder;)Landroid/support/customtabs/ICustomTabsCallback;
move-result-object p1
iput-object p1, p0, Landroidx/browser/customtabs/PostMessageServiceConnection;->mSessionBinder:Landroid/support/customtabs/ICustomTabsCallback;
return-void
.line 56
:cond_0
new-instance p1, Ljava/lang/IllegalArgumentException;
const-string v0, "Provided session must have binder."
invoke-direct {p1, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p1
.end method
.method private isBoundToService()Z
.locals 1
iget-object v0, p0, Landroidx/browser/customtabs/PostMessageServiceConnection;->mService:Landroid/support/customtabs/IPostMessageService;
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 private notifyMessageChannelReadyInternal(Landroid/os/Bundle;)Z
.locals 4
.param p1 # Landroid/os/Bundle;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end param
iget-object v0, p0, Landroidx/browser/customtabs/PostMessageServiceConnection;->mService:Landroid/support/customtabs/IPostMessageService;
const/4 v1, 0x0
if-nez v0, :cond_0
return v1
:cond_0
iget-object v0, p0, Landroidx/browser/customtabs/PostMessageServiceConnection;->mLock:Ljava/lang/Object;
.line 165
monitor-enter v0
:try_start_0
iget-object v2, p0, Landroidx/browser/customtabs/PostMessageServiceConnection;->mService:Landroid/support/customtabs/IPostMessageService;
iget-object v3, p0, Landroidx/browser/customtabs/PostMessageServiceConnection;->mSessionBinder:Landroid/support/customtabs/ICustomTabsCallback;
.line 167
invoke-interface {v2, v3, p1}, Landroid/support/customtabs/IPostMessageService;->onMessageChannelReady(Landroid/support/customtabs/ICustomTabsCallback;Landroid/os/Bundle;)V
:try_end_0
.catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
.line 171
:try_start_1
monitor-exit v0
const/4 p1, 0x1
return p1
:catchall_0
move-exception p1
goto :goto_0
.line 169
:catch_0
monitor-exit v0
return v1
.line 171
:goto_0
monitor-exit v0
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
throw p1
.end method
# virtual methods
.method public bindSessionToPostMessageService(Landroid/content/Context;)Z
.locals 1
.param p1 # Landroid/content/Context;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.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/PostMessageServiceConnection;->mPackageName:Ljava/lang/String;
if-eqz v0, :cond_0
.line 102
invoke-virtual {p0, p1, v0}, Landroidx/browser/customtabs/PostMessageServiceConnection;->bindSessionToPostMessageService(Landroid/content/Context;Ljava/lang/String;)Z
move-result p1
return p1
.line 99
:cond_0
new-instance p1, Ljava/lang/IllegalStateException;
const-string v0, "setPackageName must be called before bindSessionToPostMessageService."
invoke-direct {p1, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw p1
.end method
.method public bindSessionToPostMessageService(Landroid/content/Context;Ljava/lang/String;)Z
.locals 2
.param p1 # Landroid/content/Context;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p2 # Ljava/lang/String;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.line 81
new-instance v0, Landroid/content/Intent;
invoke-direct {v0}, Landroid/content/Intent;-><init>()V
const-class v1, Landroidx/browser/customtabs/PostMessageService;
.line 82
invoke-virtual {v1}, Ljava/lang/Class;->getName()Ljava/lang/String;
move-result-object v1
invoke-virtual {v0, p2, v1}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
const/4 p2, 0x1
.line 83
invoke-virtual {p1, v0, p0, p2}, Landroid/content/Context;->bindService(Landroid/content/Intent;Landroid/content/ServiceConnection;I)Z
move-result p1
if-nez p1, :cond_0
const-string p2, "PostMessageServConn"
const-string v0, "Could not bind to PostMessageService in client."
.line 85
invoke-static {p2, v0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
:cond_0
return p1
.end method
.method public cleanup(Landroid/content/Context;)V
.locals 1
.param p1 # Landroid/content/Context;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.annotation build Landroidx/annotation/RestrictTo;
value = {
.enum Landroidx/annotation/RestrictTo$Scope;->LIBRARY:Landroidx/annotation/RestrictTo$Scope;
}
.end annotation
.line 232
invoke-direct {p0}, Landroidx/browser/customtabs/PostMessageServiceConnection;->isBoundToService()Z
move-result v0
if-eqz v0, :cond_0
invoke-virtual {p0, p1}, Landroidx/browser/customtabs/PostMessageServiceConnection;->unbindFromContext(Landroid/content/Context;)V
:cond_0
return-void
.end method
.method public final notifyMessageChannelReady(Landroid/os/Bundle;)Z
.locals 1
.param p1 # Landroid/os/Bundle;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end param
const/4 v0, 0x1
iput-boolean v0, p0, Landroidx/browser/customtabs/PostMessageServiceConnection;->mMessageChannelCreated:Z
.line 149
invoke-direct {p0, p1}, Landroidx/browser/customtabs/PostMessageServiceConnection;->notifyMessageChannelReadyInternal(Landroid/os/Bundle;)Z
move-result p1
return p1
.end method
.method public onDisconnectChannel(Landroid/content/Context;)V
.locals 0
.param p1 # Landroid/content/Context;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.annotation build Landroidx/annotation/RestrictTo;
value = {
.enum Landroidx/annotation/RestrictTo$Scope;->LIBRARY:Landroidx/annotation/RestrictTo$Scope;
}
.end annotation
.line 210
invoke-virtual {p0, p1}, Landroidx/browser/customtabs/PostMessageServiceConnection;->unbindFromContext(Landroid/content/Context;)V
return-void
.end method
.method public final onNotifyMessageChannelReady(Landroid/os/Bundle;)Z
.locals 0
.param p1 # Landroid/os/Bundle;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end param
.annotation build Landroidx/annotation/RestrictTo;
value = {
.enum Landroidx/annotation/RestrictTo$Scope;->LIBRARY:Landroidx/annotation/RestrictTo$Scope;
}
.end annotation
.line 137
invoke-virtual {p0, p1}, Landroidx/browser/customtabs/PostMessageServiceConnection;->notifyMessageChannelReady(Landroid/os/Bundle;)Z
move-result p1
return p1
.end method
.method public final onPostMessage(Ljava/lang/String;Landroid/os/Bundle;)Z
.locals 0
.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
.annotation build Landroidx/annotation/RestrictTo;
value = {
.enum Landroidx/annotation/RestrictTo$Scope;->LIBRARY:Landroidx/annotation/RestrictTo$Scope;
}
.end annotation
.line 180
invoke-virtual {p0, p1, p2}, Landroidx/browser/customtabs/PostMessageServiceConnection;->postMessage(Ljava/lang/String;Landroid/os/Bundle;)Z
move-result p1
return p1
.end method
.method public onPostMessageServiceConnected()V
.locals 1
iget-boolean v0, p0, Landroidx/browser/customtabs/PostMessageServiceConnection;->mMessageChannelCreated:Z
if-eqz v0, :cond_0
const/4 v0, 0x0
.line 217
invoke-direct {p0, v0}, Landroidx/browser/customtabs/PostMessageServiceConnection;->notifyMessageChannelReadyInternal(Landroid/os/Bundle;)Z
:cond_0
return-void
.end method
.method public onPostMessageServiceDisconnected()V
.locals 0
return-void
.end method
.method public final onServiceConnected(Landroid/content/ComponentName;Landroid/os/IBinder;)V
.locals 0
.param p1 # Landroid/content/ComponentName;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p2 # Landroid/os/IBinder;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.line 122
invoke-static {p2}, Landroid/support/customtabs/IPostMessageService$Stub;->asInterface(Landroid/os/IBinder;)Landroid/support/customtabs/IPostMessageService;
move-result-object p1
iput-object p1, p0, Landroidx/browser/customtabs/PostMessageServiceConnection;->mService:Landroid/support/customtabs/IPostMessageService;
.line 123
invoke-virtual {p0}, Landroidx/browser/customtabs/PostMessageServiceConnection;->onPostMessageServiceConnected()V
return-void
.end method
.method public final onServiceDisconnected(Landroid/content/ComponentName;)V
.locals 0
.param p1 # Landroid/content/ComponentName;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
const/4 p1, 0x0
iput-object p1, p0, Landroidx/browser/customtabs/PostMessageServiceConnection;->mService:Landroid/support/customtabs/IPostMessageService;
.line 129
invoke-virtual {p0}, Landroidx/browser/customtabs/PostMessageServiceConnection;->onPostMessageServiceDisconnected()V
return-void
.end method
.method public final postMessage(Ljava/lang/String;Landroid/os/Bundle;)Z
.locals 4
.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
iget-object v0, p0, Landroidx/browser/customtabs/PostMessageServiceConnection;->mService:Landroid/support/customtabs/IPostMessageService;
const/4 v1, 0x0
if-nez v0, :cond_0
return v1
:cond_0
iget-object v0, p0, Landroidx/browser/customtabs/PostMessageServiceConnection;->mLock:Ljava/lang/Object;
.line 195
monitor-enter v0
:try_start_0
iget-object v2, p0, Landroidx/browser/customtabs/PostMessageServiceConnection;->mService:Landroid/support/customtabs/IPostMessageService;
iget-object v3, p0, Landroidx/browser/customtabs/PostMessageServiceConnection;->mSessionBinder:Landroid/support/customtabs/ICustomTabsCallback;
.line 197
invoke-interface {v2, v3, p1, p2}, Landroid/support/customtabs/IPostMessageService;->onPostMessage(Landroid/support/customtabs/ICustomTabsCallback;Ljava/lang/String;Landroid/os/Bundle;)V
:try_end_0
.catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
.line 201
:try_start_1
monitor-exit v0
const/4 p1, 0x1
return p1
:catchall_0
move-exception p1
goto :goto_0
.line 199
:catch_0
monitor-exit v0
return v1
.line 201
:goto_0
monitor-exit v0
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
throw p1
.end method
.method public setPackageName(Ljava/lang/String;)V
.locals 0
.param p1 # Ljava/lang/String;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.annotation build Landroidx/annotation/RestrictTo;
value = {
.enum Landroidx/annotation/RestrictTo$Scope;->LIBRARY:Landroidx/annotation/RestrictTo$Scope;
}
.end annotation
iput-object p1, p0, Landroidx/browser/customtabs/PostMessageServiceConnection;->mPackageName:Ljava/lang/String;
return-void
.end method
.method public unbindFromContext(Landroid/content/Context;)V
.locals 1
.param p1 # Landroid/content/Context;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.line 114
invoke-direct {p0}, Landroidx/browser/customtabs/PostMessageServiceConnection;->isBoundToService()Z
move-result v0
if-eqz v0, :cond_0
.line 115
invoke-virtual {p1, p0}, Landroid/content/Context;->unbindService(Landroid/content/ServiceConnection;)V
const/4 p1, 0x0
iput-object p1, p0, Landroidx/browser/customtabs/PostMessageServiceConnection;->mService:Landroid/support/customtabs/IPostMessageService;
:cond_0
return-void
.end method