RNCWebViewManager$e.smali

.class public final Lcom/reactnativecommunity/webview/RNCWebViewManager$e;
.super Landroid/webkit/WebView;
.source "SourceFile"

# interfaces
.implements Lcom/facebook/react/bridge/LifecycleEventListener;


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/reactnativecommunity/webview/RNCWebViewManager;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x9
    name = "e"
.end annotation

.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/reactnativecommunity/webview/RNCWebViewManager$e$a;,
        Lcom/reactnativecommunity/webview/RNCWebViewManager$e$b;
    }
.end annotation


# instance fields
.field public a:Ljava/lang/String;

.field public b:Ljava/lang/String;

.field public c:Z

.field public d:Ljava/lang/String;

.field public e:Lcom/reactnativecommunity/webview/RNCWebViewManager$f;

.field public f:Lcom/facebook/react/bridge/CatalystInstance;

.field public g:Z

.field public h:Lcom/facebook/react/views/scroll/OnScrollDispatchHelper;

.field public i:Z

.field public j:Lcom/reactnativecommunity/webview/RNCWebViewManager$e$a;

.field public k:Landroid/webkit/WebChromeClient;


# direct methods
.method public constructor <init>(Lcom/facebook/react/uimanager/ThemedReactContext;)V
    .registers 5

    .line 1
    invoke-direct {p0, p1}, Landroid/webkit/WebView;-><init>(Landroid/content/Context;)V

    const/4 p1, 0x0

    .line 2
    iput-boolean p1, p0, Lcom/reactnativecommunity/webview/RNCWebViewManager$e;->c:Z

    .line 3
    iput-boolean p1, p0, Lcom/reactnativecommunity/webview/RNCWebViewManager$e;->g:Z

    .line 4
    iput-boolean p1, p0, Lcom/reactnativecommunity/webview/RNCWebViewManager$e;->i:Z

    .line 5
    :try_start_a
    sget-boolean v0, Landroidx/biometric/e0;->c:Z

    if-eqz v0, :cond_2a

    .line 6
    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "WebViewUsedCollect createCatalystInstance webCollectToggle == "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    new-array p1, p1, [Ljava/lang/Object;

    invoke-static {v0, p1}, Lcom/garena/android/appkit/logging/a;->T(Ljava/lang/String;[Ljava/lang/Object;)V

    .line 7
    sget p1, Lcom/shopee/app/application/lifecycle/listeners/r;->b:I

    add-int/lit8 p1, p1, 0x1

    sput p1, Lcom/shopee/app/application/lifecycle/listeners/r;->b:I

    .line 8
    :cond_2a
    invoke-virtual {p0}, Landroid/view/View;->getContext()Landroid/content/Context;

    move-result-object p1

    check-cast p1, Lcom/facebook/react/bridge/ReactContext;

    if-eqz p1, :cond_48

    .line 9
    invoke-virtual {p1}, Lcom/facebook/react/bridge/ReactContext;->getCatalystInstance()Lcom/facebook/react/bridge/CatalystInstance;

    move-result-object p1

    iput-object p1, p0, Lcom/reactnativecommunity/webview/RNCWebViewManager$e;->f:Lcom/facebook/react/bridge/CatalystInstance;
    :try_end_38
    .catch Ljava/lang/Exception; {:try_start_a .. :try_end_38} :catch_39

    goto :goto_48

    :catch_39
    nop

    .line 10
    invoke-virtual {p0}, Landroid/view/View;->getContext()Landroid/content/Context;

    move-result-object p1

    check-cast p1, Lcom/facebook/react/bridge/ReactContext;

    if-eqz p1, :cond_48

    .line 11
    invoke-virtual {p1}, Lcom/facebook/react/bridge/ReactContext;->getCatalystInstance()Lcom/facebook/react/bridge/CatalystInstance;

    move-result-object p1

    iput-object p1, p0, Lcom/reactnativecommunity/webview/RNCWebViewManager$e;->f:Lcom/facebook/react/bridge/CatalystInstance;

    .line 12
    :cond_48
    :goto_48
    new-instance p1, Lcom/reactnativecommunity/webview/RNCWebViewManager$e$a;

    invoke-direct {p1}, Lcom/reactnativecommunity/webview/RNCWebViewManager$e$a;-><init>()V

    iput-object p1, p0, Lcom/reactnativecommunity/webview/RNCWebViewManager$e;->j:Lcom/reactnativecommunity/webview/RNCWebViewManager$e$a;

    return-void
.end method


# virtual methods
.method public final b(Ljava/lang/String;Lcom/facebook/react/bridge/WritableMap;)V
    .registers 5

    .line 1
    new-instance v0, Lcom/facebook/react/bridge/WritableNativeMap;

    invoke-direct {v0}, Lcom/facebook/react/bridge/WritableNativeMap;-><init>()V

    const-string v1, "nativeEvent"

    .line 2
    invoke-virtual {v0, v1, p2}, Lcom/facebook/react/bridge/WritableNativeMap;->putMap(Ljava/lang/String;Lcom/facebook/react/bridge/ReadableMap;)V

    .line 3
    new-instance p2, Lcom/facebook/react/bridge/WritableNativeArray;

    invoke-direct {p2}, Lcom/facebook/react/bridge/WritableNativeArray;-><init>()V

    .line 4
    invoke-virtual {p2, v0}, Lcom/facebook/react/bridge/WritableNativeArray;->pushMap(Lcom/facebook/react/bridge/ReadableMap;)V

    .line 5
    iget-object v0, p0, Lcom/reactnativecommunity/webview/RNCWebViewManager$e;->f:Lcom/facebook/react/bridge/CatalystInstance;

    iget-object v1, p0, Lcom/reactnativecommunity/webview/RNCWebViewManager$e;->d:Ljava/lang/String;

    invoke-interface {v0, v1, p1, p2}, Lcom/facebook/react/bridge/CatalystInstance;->callFunction(Ljava/lang/String;Ljava/lang/String;Lcom/facebook/react/bridge/NativeArray;)V

    return-void
.end method

.method public final destroy()V
    .registers 4

    .line 1
    iget-object v0, p0, Lcom/reactnativecommunity/webview/RNCWebViewManager$e;->k:Landroid/webkit/WebChromeClient;

    if-eqz v0, :cond_7

    .line 2
    invoke-virtual {v0}, Landroid/webkit/WebChromeClient;->onHideCustomView()V

    .line 3
    :cond_7
    sget-boolean v0, Lcom/reactnativecommunity/webview/RNCWebViewManager;->isWebviewPoolToggleFeatureOpen:Z

    if-eqz v0, :cond_2d

    sget-object v0, Lcom/reactnativecommunity/webview/RNCWebViewManager;->webViewpool:Lcom/reactnativecommunity/webview/c;

    if-eqz v0, :cond_2d

    # getter for: Lcom/reactnativecommunity/webview/RNCWebViewManager;->getWebviewFromPool:I
    invoke-static {}, Lcom/reactnativecommunity/webview/RNCWebViewManager;->access$000()I

    move-result v0

    if-lez v0, :cond_2d

    const/4 v0, 0x0

    new-array v0, v0, [Ljava/lang/Object;

    const-string v1, "webviewpool feature toggle is on onRecycle is run"

    .line 4
    invoke-static {v1, v0}, Landroidx/constraintlayout/widget/h;->E(Ljava/lang/String;[Ljava/lang/Object;)V

    .line 5
    # operator-- for: Lcom/reactnativecommunity/webview/RNCWebViewManager;->getWebviewFromPool:I
    invoke-static {}, Lcom/reactnativecommunity/webview/RNCWebViewManager;->access$010()I

    .line 6
    sget-object v0, Lcom/reactnativecommunity/webview/RNCWebViewManager;->webViewpool:Lcom/reactnativecommunity/webview/c;

    const/4 v1, 0x2

    invoke-virtual {p0}, Landroid/view/View;->getParent()Landroid/view/ViewParent;

    move-result-object v2

    check-cast v2, Landroid/view/ViewGroup;

    invoke-virtual {v0, p0, v1, v2}, Lcom/reactnativecommunity/webview/c;->b(Landroid/webkit/WebView;ILandroid/view/ViewGroup;)V

    goto :goto_30

    .line 7
    :cond_2d
    invoke-super {p0}, Landroid/webkit/WebView;->destroy()V

    :goto_30
    return-void
.end method

.method public getRNCWebViewClient()Lcom/reactnativecommunity/webview/RNCWebViewManager$f;
    .registers 2

    iget-object v0, p0, Lcom/reactnativecommunity/webview/RNCWebViewManager$e;->e:Lcom/reactnativecommunity/webview/RNCWebViewManager$f;

    return-object v0
.end method

.method public final onHostDestroy()V
    .registers 2

    const/4 v0, 0x0

    .line 1
    invoke-virtual {p0, v0}, Lcom/reactnativecommunity/webview/RNCWebViewManager$e;->setWebViewClient(Landroid/webkit/WebViewClient;)V

    .line 2
    invoke-virtual {p0}, Lcom/reactnativecommunity/webview/RNCWebViewManager$e;->destroy()V

    return-void
.end method

.method public final onHostPause()V
    .registers 1

    return-void
.end method

.method public final onHostResume()V
    .registers 1

    return-void
.end method

.method public final onScrollChanged(IIII)V
    .registers 15

    .line 1
    invoke-super {p0, p1, p2, p3, p4}, Landroid/webkit/WebView;->onScrollChanged(IIII)V

    .line 2
    iget-boolean p3, p0, Lcom/reactnativecommunity/webview/RNCWebViewManager$e;->i:Z

    if-nez p3, :cond_8

    return-void

    .line 3
    :cond_8
    iget-object p3, p0, Lcom/reactnativecommunity/webview/RNCWebViewManager$e;->h:Lcom/facebook/react/views/scroll/OnScrollDispatchHelper;

    if-nez p3, :cond_13

    .line 4
    new-instance p3, Lcom/facebook/react/views/scroll/OnScrollDispatchHelper;

    invoke-direct {p3}, Lcom/facebook/react/views/scroll/OnScrollDispatchHelper;-><init>()V

    iput-object p3, p0, Lcom/reactnativecommunity/webview/RNCWebViewManager$e;->h:Lcom/facebook/react/views/scroll/OnScrollDispatchHelper;

    .line 5
    :cond_13
    iget-object p3, p0, Lcom/reactnativecommunity/webview/RNCWebViewManager$e;->h:Lcom/facebook/react/views/scroll/OnScrollDispatchHelper;

    invoke-virtual {p3, p1, p2}, Lcom/facebook/react/views/scroll/OnScrollDispatchHelper;->onScrollChanged(II)Z

    move-result p3

    if-eqz p3, :cond_46

    .line 6
    invoke-virtual {p0}, Landroid/view/View;->getId()I

    move-result v0

    sget-object v1, Lcom/facebook/react/views/scroll/ScrollEventType;->SCROLL:Lcom/facebook/react/views/scroll/ScrollEventType;

    iget-object p3, p0, Lcom/reactnativecommunity/webview/RNCWebViewManager$e;->h:Lcom/facebook/react/views/scroll/OnScrollDispatchHelper;

    .line 7
    invoke-virtual {p3}, Lcom/facebook/react/views/scroll/OnScrollDispatchHelper;->getXFlingVelocity()F

    move-result v4

    iget-object p3, p0, Lcom/reactnativecommunity/webview/RNCWebViewManager$e;->h:Lcom/facebook/react/views/scroll/OnScrollDispatchHelper;

    .line 8
    invoke-virtual {p3}, Lcom/facebook/react/views/scroll/OnScrollDispatchHelper;->getYFlingVelocity()F

    move-result v5

    .line 9
    invoke-virtual {p0}, Landroid/view/View;->computeHorizontalScrollRange()I

    move-result v6

    .line 10
    invoke-virtual {p0}, Landroid/view/View;->computeVerticalScrollRange()I

    move-result v7

    .line 11
    invoke-virtual {p0}, Landroid/view/View;->getWidth()I

    move-result v8

    .line 12
    invoke-virtual {p0}, Landroid/view/View;->getHeight()I

    move-result v9

    move v2, p1

    move v3, p2

    .line 13
    invoke-static/range {v0 .. v9}, Lcom/facebook/react/views/scroll/ScrollEvent;->obtain(ILcom/facebook/react/views/scroll/ScrollEventType;IIFFIIII)Lcom/facebook/react/views/scroll/ScrollEvent;

    move-result-object p1

    .line 14
    invoke-static {p0, p1}, Lcom/reactnativecommunity/webview/RNCWebViewManager;->dispatchEvent(Landroid/webkit/WebView;Lcom/facebook/react/uimanager/events/Event;)V

    :cond_46
    return-void
.end method

.method public final onSizeChanged(IIII)V
    .registers 5

    .line 1
    invoke-super {p0, p1, p2, p3, p4}, Landroid/webkit/WebView;->onSizeChanged(IIII)V

    .line 2
    iget-boolean p3, p0, Lcom/reactnativecommunity/webview/RNCWebViewManager$e;->g:Z

    if-eqz p3, :cond_13

    .line 3
    new-instance p3, Lcom/facebook/react/uimanager/events/ContentSizeChangeEvent;

    .line 4
    invoke-virtual {p0}, Landroid/view/View;->getId()I

    move-result p4

    invoke-direct {p3, p4, p1, p2}, Lcom/facebook/react/uimanager/events/ContentSizeChangeEvent;-><init>(III)V

    .line 5
    invoke-static {p0, p3}, Lcom/reactnativecommunity/webview/RNCWebViewManager;->dispatchEvent(Landroid/webkit/WebView;Lcom/facebook/react/uimanager/events/Event;)V

    :cond_13
    return-void
.end method

.method public setHasScrollEvent(Z)V
    .registers 2

    iput-boolean p1, p0, Lcom/reactnativecommunity/webview/RNCWebViewManager$e;->i:Z

    return-void
.end method

.method public setIgnoreErrFailedForThisURL(Ljava/lang/String;)V
    .registers 3

    .line 1
    iget-object v0, p0, Lcom/reactnativecommunity/webview/RNCWebViewManager$e;->e:Lcom/reactnativecommunity/webview/RNCWebViewManager$f;

    .line 2
    iput-object p1, v0, Lcom/reactnativecommunity/webview/RNCWebViewManager$f;->d:Ljava/lang/String;

    return-void
.end method

.method public setInjectedJavaScript(Ljava/lang/String;)V
    .registers 2

    iput-object p1, p0, Lcom/reactnativecommunity/webview/RNCWebViewManager$e;->a:Ljava/lang/String;

    return-void
.end method

.method public setInjectedJavaScriptBeforeContentLoaded(Ljava/lang/String;)V
    .registers 2

    iput-object p1, p0, Lcom/reactnativecommunity/webview/RNCWebViewManager$e;->b:Ljava/lang/String;

    return-void
.end method

.method public setInjectedJavaScriptBeforeContentLoadedForMainFrameOnly(Z)V
    .registers 2

    return-void
.end method

.method public setInjectedJavaScriptForMainFrameOnly(Z)V
    .registers 2

    return-void
.end method

.method public setMessagingEnabled(Z)V
    .registers 3
    .annotation build Landroid/annotation/SuppressLint;
        value = {
            "AddJavascriptInterface"
        }
    .end annotation

    .line 1
    iget-boolean v0, p0, Lcom/reactnativecommunity/webview/RNCWebViewManager$e;->c:Z

    if-ne v0, p1, :cond_5

    return-void

    .line 2
    :cond_5
    iput-boolean p1, p0, Lcom/reactnativecommunity/webview/RNCWebViewManager$e;->c:Z

    const-string v0, "ReactNativeWebView"

    if-eqz p1, :cond_14

    .line 3
    new-instance p1, Lcom/reactnativecommunity/webview/RNCWebViewManager$e$b;

    invoke-direct {p1, p0}, Lcom/reactnativecommunity/webview/RNCWebViewManager$e$b;-><init>(Lcom/reactnativecommunity/webview/RNCWebViewManager$e;)V

    .line 4
    invoke-virtual {p0, p1, v0}, Landroid/webkit/WebView;->addJavascriptInterface(Ljava/lang/Object;Ljava/lang/String;)V

    goto :goto_17

    .line 5
    :cond_14
    invoke-virtual {p0, v0}, Landroid/webkit/WebView;->removeJavascriptInterface(Ljava/lang/String;)V

    :goto_17
    return-void
.end method

.method public setMessagingModuleName(Ljava/lang/String;)V
    .registers 2

    iput-object p1, p0, Lcom/reactnativecommunity/webview/RNCWebViewManager$e;->d:Ljava/lang/String;

    return-void
.end method

.method public setSendContentSizeChangeEvents(Z)V
    .registers 2

    iput-boolean p1, p0, Lcom/reactnativecommunity/webview/RNCWebViewManager$e;->g:Z

    return-void
.end method

.method public setWebChromeClient(Landroid/webkit/WebChromeClient;)V
    .registers 3

    .line 1
    iput-object p1, p0, Lcom/reactnativecommunity/webview/RNCWebViewManager$e;->k:Landroid/webkit/WebChromeClient;

    .line 2
    invoke-super {p0, p1}, Landroid/webkit/WebView;->setWebChromeClient(Landroid/webkit/WebChromeClient;)V

    .line 3
    instance-of v0, p1, Lcom/reactnativecommunity/webview/RNCWebViewManager$d;

    if-eqz v0, :cond_f

    .line 4
    check-cast p1, Lcom/reactnativecommunity/webview/RNCWebViewManager$d;

    iget-object v0, p0, Lcom/reactnativecommunity/webview/RNCWebViewManager$e;->j:Lcom/reactnativecommunity/webview/RNCWebViewManager$e$a;

    .line 5
    iput-object v0, p1, Lcom/reactnativecommunity/webview/RNCWebViewManager$d;->e:Lcom/reactnativecommunity/webview/RNCWebViewManager$e$a;

    :cond_f
    return-void
.end method

.method public setWebViewClient(Landroid/webkit/WebViewClient;)V
    .registers 3

    .line 1
    invoke-super {p0, p1}, Landroid/webkit/WebView;->setWebViewClient(Landroid/webkit/WebViewClient;)V

    .line 2
    instance-of v0, p1, Lcom/reactnativecommunity/webview/RNCWebViewManager$f;

    if-eqz v0, :cond_f

    .line 3
    check-cast p1, Lcom/reactnativecommunity/webview/RNCWebViewManager$f;

    iput-object p1, p0, Lcom/reactnativecommunity/webview/RNCWebViewManager$e;->e:Lcom/reactnativecommunity/webview/RNCWebViewManager$f;

    .line 4
    iget-object v0, p0, Lcom/reactnativecommunity/webview/RNCWebViewManager$e;->j:Lcom/reactnativecommunity/webview/RNCWebViewManager$e$a;

    .line 5
    iput-object v0, p1, Lcom/reactnativecommunity/webview/RNCWebViewManager$f;->c:Lcom/reactnativecommunity/webview/RNCWebViewManager$e$a;

    :cond_f
    return-void
.end method