导航菜单

页面标题

页面副标题

小柿子 v1.3.8 - SjmDspPageActivity.java 源代码

正在查看: 小柿子 v1.3.8 应用的 SjmDspPageActivity.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.sjm.sjmdsp;

import android.os.Bundle;
import android.view.KeyEvent;
import android.view.MenuItem;
import android.view.ViewGroup;
import android.webkit.CookieManager;
import android.webkit.WebView;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import com.sigmob.sdk.base.h;
import com.sjm.sjmdaly.R$id;
import com.sjm.sjmdaly.R$layout;
import com.sjm.sjmdsp.adCore.model.SjmDspAdItemData;
import java.util.HashMap;
import t1.a;

public class SjmDspPageActivity extends AppCompatActivity {
    private static final String TAG = "SjmDspPageActivity";
    private ActionBar actionBar;
    public SjmDspAdItemData itemData;
    private WebView webView;
    public boolean isGoBack = false;
    private long resumeTime = 0;

    private void pageClose(Boolean bool) {
        if (bool.booleanValue()) {
            return;
        }
        SjmDspAdItemData sjmDspAdItemData = this.itemData;
        if (sjmDspAdItemData != null) {
            a.b(sjmDspAdItemData, "EVENT_PAGE_CLOSE", sjmDspAdItemData.adAction.page);
        }
        finish();
    }

    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(R$layout.activity_sjm_dsp_page);
        ActionBar supportActionBar = getSupportActionBar();
        this.actionBar = supportActionBar;
        if (supportActionBar != null) {
            supportActionBar.setHomeButtonEnabled(true);
            this.actionBar.setDisplayHomeAsUpEnabled(true);
        }
        setTitle("");
        this.webView = (WebView) findViewById(R$id.sjm_webView_dsp_ad_page);
        new a2.a().a(this, this.webView);
        this.itemData = (SjmDspAdItemData) getIntent().getExtras().get("adData");
        CookieManager.getInstance().removeAllCookie();
        if (this.itemData != null) {
            HashMap hashMap = new HashMap();
            hashMap.put(h.b, this.itemData.adAction.page);
            hashMap.put("X-Requested-With", "");
            this.webView.loadUrl(this.itemData.adAction.page, hashMap);
            SjmDspAdItemData sjmDspAdItemData = this.itemData;
            a.b(sjmDspAdItemData, "EVENT_PAGE_OPEN", sjmDspAdItemData.adAction.page);
        }
    }

    public void onDestroy() {
        WebView webView = this.webView;
        if (webView != null) {
            webView.loadDataWithBaseURL(null, "", "text/html", "utf-8", null);
            ((ViewGroup) this.webView.getParent()).removeView(this.webView);
            this.webView.destroy();
            this.webView = null;
        }
        super.onDestroy();
    }

    public boolean onKeyDown(int i, KeyEvent keyEvent) {
        if (i != 4 || !this.webView.canGoBack()) {
            pageClose(Boolean.TRUE);
            return super.onKeyDown(i, keyEvent);
        }
        this.isGoBack = true;
        this.resumeTime = System.currentTimeMillis();
        this.webView.goBack();
        return true;
    }

    public boolean onOptionsItemSelected(MenuItem menuItem) {
        if (menuItem.getItemId() != 16908332) {
            return super/*android.app.Activity*/.onOptionsItemSelected(menuItem);
        }
        if (!this.webView.canGoBack()) {
            pageClose(Boolean.FALSE);
            return true;
        }
        this.isGoBack = true;
        this.webView.goBack();
        return true;
    }
}