.class public Lcom/alipay/sdk/app/H5PayActivity;
.super Landroid/app/Activity;
.source "SourceFile"


# instance fields
.field private client:Landroid/webkit/WebViewClient;

.field private mWebView:Landroid/webkit/WebView;


# direct methods
.method public constructor <init>()V
    .locals 0

    .line 21
    invoke-direct {p0}, Landroid/app/Activity;-><init>()V

    return-void
.end method

.method private setFeature()V
    .locals 1

    const/4 v0, 0x1

    .line 59
    :try_start_0
    invoke-super {p0, v0}, Landroid/app/Activity;->requestWindowFeature(I)Z
    :try_end_0
    .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0

    return-void

    :catch_0
    move-exception v0

    .line 61
    invoke-static {v0}, Lcom/alipay/sdk/util/LogUtils;->printExceptionStackTrace(Ljava/lang/Object;)V

    return-void
.end method


# virtual methods
.method public finish()V
    .locals 0

    .line 83
    invoke-virtual {p0}, Lcom/alipay/sdk/app/H5PayActivity;->notifyCaller()V

    .line 84
    invoke-super {p0}, Landroid/app/Activity;->finish()V

    return-void
.end method

.method public notifyCaller()V
    .locals 2

    .line 88
    sget-object v0, Lcom/alipay/sdk/app/PayTask;->sLock:Ljava/lang/Object;

    .line 89
    monitor-enter v0

    .line 91
    :try_start_0
    invoke-virtual {v0}, Ljava/lang/Object;->notify()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    goto :goto_0

    :catchall_0
    move-exception v1

    goto :goto_1

    .line 94
    :catch_0
    :goto_0
    :try_start_1
    monitor-exit v0

    return-void

    :goto_1
    monitor-exit v0
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    throw v1
.end method

.method public onBackPressed()V
    .locals 3

    .line 67
    iget-object v0, p0, Lcom/alipay/sdk/app/H5PayActivity;->mWebView:Landroid/webkit/WebView;

    invoke-virtual {v0}, Landroid/webkit/WebView;->canGoBack()Z

    move-result v0

    if-eqz v0, :cond_1

    .line 68
    iget-object v0, p0, Lcom/alipay/sdk/app/H5PayActivity;->client:Landroid/webkit/WebViewClient;

    check-cast v0, Lcom/alipay/sdk/app/MyWebViewClient;

    invoke-virtual {v0}, Lcom/alipay/sdk/app/MyWebViewClient;->isInerroPage()Z

    move-result v0

    if-eqz v0, :cond_0

    .line 69
    sget-object v0, Lcom/alipay/sdk/app/ResultStatus;->NETWORK_ERROR:Lcom/alipay/sdk/app/ResultStatus;

    .line 70
    invoke-virtual {v0}, Lcom/alipay/sdk/app/ResultStatus;->getStatus()I

    move-result v0

    invoke-static {v0}, Lcom/alipay/sdk/app/ResultStatus;->getResultState(I)Lcom/alipay/sdk/app/ResultStatus;

    move-result-object v0

    .line 71
    invoke-virtual {v0}, Lcom/alipay/sdk/app/ResultStatus;->getStatus()I

    move-result v1

    invoke-virtual {v0}, Lcom/alipay/sdk/app/ResultStatus;->getMemo()Ljava/lang/String;

    move-result-object v0

    const-string v2, ""

    invoke-static {v1, v0, v2}, Lcom/alipay/sdk/app/Result;->parseResult(ILjava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Lcom/alipay/sdk/app/Result;->setH5Result(Ljava/lang/String;)V

    .line 72
    invoke-virtual {p0}, Lcom/alipay/sdk/app/H5PayActivity;->finish()V

    return-void

    :cond_0
    return-void

    .line 77
    :cond_1
    invoke-static {}, Lcom/alipay/sdk/app/Result;->getCancel()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Lcom/alipay/sdk/app/Result;->setH5Result(Ljava/lang/String;)V

    .line 78
    invoke-virtual {p0}, Lcom/alipay/sdk/app/H5PayActivity;->finish()V

    return-void
.end method

.method public onConfigurationChanged(Landroid/content/res/Configuration;)V
    .locals 0

    .line 99
    invoke-super {p0, p1}, Landroid/app/Activity;->onConfigurationChanged(Landroid/content/res/Configuration;)V

    return-void
.end method

.method protected onCreate(Landroid/os/Bundle;)V
    .locals 2

    .line 29
    invoke-direct {p0}, Lcom/alipay/sdk/app/H5PayActivity;->setFeature()V

    .line 30
    invoke-super {p0, p1}, Landroid/app/Activity;->onCreate(Landroid/os/Bundle;)V

    .line 35
    :try_start_0
    invoke-virtual {p0}, Lcom/alipay/sdk/app/H5PayActivity;->getIntent()Landroid/content/Intent;

    move-result-object p1

    invoke-virtual {p1}, Landroid/content/Intent;->getExtras()Landroid/os/Bundle;

    move-result-object p1

    const-string v0, "url"

    .line 36
    invoke-virtual {p1, v0}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    .line 37
    invoke-static {v0}, Lcom/alipay/sdk/util/Utils;->isVerifyURL(Ljava/lang/String;)Z

    move-result v1

    if-nez v1, :cond_0

    .line 39
    invoke-virtual {p0}, Lcom/alipay/sdk/app/H5PayActivity;->finish()V

    return-void

    :cond_0
    const-string v1, "cookie"

    .line 42
    invoke-virtual {p1, v1}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object p1
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1

    .line 48
    :try_start_1
    invoke-static {p0, v0, p1}, Lcom/alipay/sdk/util/Utils;->generateWebview(Landroid/app/Activity;Ljava/lang/String;Ljava/lang/String;)Landroid/webkit/WebView;

    move-result-object p1

    iput-object p1, p0, Lcom/alipay/sdk/app/H5PayActivity;->mWebView:Landroid/webkit/WebView;

    .line 49
    new-instance p1, Lcom/alipay/sdk/app/MyWebViewClient;

    invoke-direct {p1, p0}, Lcom/alipay/sdk/app/MyWebViewClient;-><init>(Landroid/app/Activity;)V

    iput-object p1, p0, Lcom/alipay/sdk/app/H5PayActivity;->client:Landroid/webkit/WebViewClient;

    .line 50
    iget-object p1, p0, Lcom/alipay/sdk/app/H5PayActivity;->mWebView:Landroid/webkit/WebView;

    iget-object v0, p0, Lcom/alipay/sdk/app/H5PayActivity;->client:Landroid/webkit/WebViewClient;

    invoke-virtual {p1, v0}, Landroid/webkit/WebView;->setWebViewClient(Landroid/webkit/WebViewClient;)V
    :try_end_1
    .catch Ljava/lang/Throwable; {:try_start_1 .. :try_end_1} :catch_0

    return-void

    :catch_0
    move-exception p1

    const-string v0, "biz"

    const-string v1, "GetInstalledAppEx"

    .line 52
    invoke-static {v0, v1, p1}, Lcom/alipay/sdk/app/statistic/StatisticManager;->putError(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V

    .line 53
    invoke-virtual {p0}, Lcom/alipay/sdk/app/H5PayActivity;->finish()V

    return-void

    .line 44
    :catch_1
    invoke-virtual {p0}, Lcom/alipay/sdk/app/H5PayActivity;->finish()V

    return-void
.end method

.method protected onDestroy()V
    .locals 1

    .line 104
    invoke-super {p0}, Landroid/app/Activity;->onDestroy()V

    .line 105
    iget-object v0, p0, Lcom/alipay/sdk/app/H5PayActivity;->mWebView:Landroid/webkit/WebView;

    if-eqz v0, :cond_0

    .line 106
    iget-object v0, p0, Lcom/alipay/sdk/app/H5PayActivity;->mWebView:Landroid/webkit/WebView;

    invoke-virtual {v0}, Landroid/webkit/WebView;->removeAllViews()V

    .line 107
    iget-object v0, p0, Lcom/alipay/sdk/app/H5PayActivity;->mWebView:Landroid/webkit/WebView;

    invoke-virtual {v0}, Landroid/webkit/WebView;->getParent()Landroid/view/ViewParent;

    move-result-object v0

    check-cast v0, Landroid/view/ViewGroup;

    invoke-virtual {v0}, Landroid/view/ViewGroup;->removeAllViews()V

    .line 109
    :try_start_0
    iget-object v0, p0, Lcom/alipay/sdk/app/H5PayActivity;->mWebView:Landroid/webkit/WebView;

    invoke-virtual {v0}, Landroid/webkit/WebView;->destroy()V
    :try_end_0
    .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0

    :catch_0
    const/4 v0, 0x0

    .line 112
    iput-object v0, p0, Lcom/alipay/sdk/app/H5PayActivity;->mWebView:Landroid/webkit/WebView;

    .line 114
    :cond_0
    iget-object v0, p0, Lcom/alipay/sdk/app/H5PayActivity;->client:Landroid/webkit/WebViewClient;

    if-eqz v0, :cond_1

    .line 115
    iget-object v0, p0, Lcom/alipay/sdk/app/H5PayActivity;->client:Landroid/webkit/WebViewClient;

    check-cast v0, Lcom/alipay/sdk/app/MyWebViewClient;

    invoke-virtual {v0}, Lcom/alipay/sdk/app/MyWebViewClient;->dispose()V

    :cond_1
    return-void
.end method
