导航菜单

页面标题

页面副标题

95爱播免登录版 v3.1.9 - ServiceCenterActivity.java 源代码

正在查看: 95爱播免登录版 v3.1.9 应用的 ServiceCenterActivity.java JAVA 源代码文件

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


package com.showself.ui;

import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.telephony.TelephonyManager;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.JavascriptInterface;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.mifeng.ui.R;
import com.showself.utils.Utils;
import com.showself.utils.o;
import com.showself.utils.u0;
import com.showself.view.webview.SJWebView;
import com.tencent.smtt.export.external.interfaces.IX5WebChromeClient;
import com.tencent.smtt.sdk.CookieManager;
import com.tencent.smtt.sdk.CookieSyncManager;
import com.tencent.smtt.sdk.WebChromeClient;
import com.tencent.smtt.sdk.WebView;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import org.apache.log4j.spi.LocationInfo;

public class ServiceCenterActivity extends com.showself.ui.c implements View.OnClickListener {
    private String a;
    private String b;
    private TextView c;
    private SJWebView d;

    private LinearLayout f2859e;

    private Button f2860f;

    private WebChromeClient f2861g = new a();

    class a extends WebChromeClient {
        private View a = null;
        private IX5WebChromeClient.CustomViewCallback b = null;

        a() {
        }

        @Override
        public void onHideCustomView() {
            if (this.a != null) {
                IX5WebChromeClient.CustomViewCallback customViewCallback = this.b;
                if (customViewCallback != null) {
                    customViewCallback.onCustomViewHidden();
                    this.b = null;
                }
                ViewGroup viewGroup = (ViewGroup) this.a.getParent();
                viewGroup.removeView(this.a);
                viewGroup.addView(ServiceCenterActivity.this.d);
                this.a = null;
            }
        }

        @Override
        public void onShowCustomView(View view, IX5WebChromeClient.CustomViewCallback customViewCallback) {
            IX5WebChromeClient.CustomViewCallback customViewCallback2 = this.b;
            if (customViewCallback2 != null) {
                customViewCallback2.onCustomViewHidden();
                this.b = null;
                return;
            }
            ViewGroup viewGroup = (ViewGroup) ServiceCenterActivity.this.d.getParent();
            viewGroup.removeView(ServiceCenterActivity.this.d);
            viewGroup.addView(view);
            this.a = view;
            this.b = customViewCallback;
        }
    }

    public class b {
        private Context a;

        public b(Context context) {
            this.a = context;
        }

        private boolean a() {
            try {
                return 5 == ((TelephonyManager) ServiceCenterActivity.this.getSystemService("phone")).getSimState();
            } catch (Exception e2) {
                e2.printStackTrace();
                return false;
            }
        }

        @JavascriptInterface
        public void startQQ(String str) {
            com.showself.provider.l.a.c().f(ServiceCenterActivity.this, str);
        }

        @JavascriptInterface
        public void startTel(String str) {
            if (str == null || str.trim().length() <= 0) {
                return;
            }
            if (!a()) {
                Toast.makeText(this.a, "SIM卡不可用", 0).show();
                return;
            }
            ServiceCenterActivity.this.startActivity(new Intent("android.intent.action.DIAL", Uri.parse(WebView.SCHEME_TEL + str.trim())));
        }
    }

    public class c extends com.showself.view.webview.a {
        public c(Context context) {
        }

        @Override
        public boolean shouldOverrideUrlLoading(WebView webView, String str) {
            if (str.equalsIgnoreCase("yujia://webview/exit")) {
                ServiceCenterActivity.this.finish();
                return true;
            }
            if (str.contains("yujia://startPerform")) {
                return true;
            }
            if (str.startsWith("showself")) {
                Intent intent = null;
                try {
                    intent = o.e(str, ServiceCenterActivity.this);
                } catch (Exception e2) {
                    e2.printStackTrace();
                }
                if (intent != null) {
                    o.h(ServiceCenterActivity.this, intent);
                }
                return true;
            }
            if (str.startsWith("http:") || str.startsWith("https:")) {
                webView.loadUrl(str);
                return false;
            }
            ServiceCenterActivity.this.startActivity(new Intent("android.intent.action.VIEW", Uri.parse(str)));
            return true;
        }
    }

    @Override
    @SuppressLint({"JavascriptInterface", "SetJavaScriptEnabled"})
    @TargetApi(19)
    public void init() {
        String stringExtra = getIntent().getStringExtra("title");
        this.a = stringExtra;
        try {
            this.a = URLDecoder.decode(stringExtra, "UTF-8");
        } catch (UnsupportedEncodingException e2) {
            e2.printStackTrace();
        }
        String stringExtra2 = getIntent().getStringExtra("url");
        this.b = stringExtra2;
        if (stringExtra2 != null && !stringExtra2.startsWith("http:") && !this.b.startsWith("https:")) {
            try {
                this.b = Utils.f(this.b);
            } catch (Exception unused) {
                this.b = "";
            }
        }
        this.b += (this.b.contains(LocationInfo.NA) ? "&activity=" : "?activity=") + Utils.f0(this);
        TextView textView = (TextView) findViewById(R.id.tv_nav_title);
        this.c = textView;
        textView.setText(this.a);
        this.c.setSelected(true);
        this.d = new SJWebView(this);
        this.d.setWebViewClient(new c(this));
        this.d.setWebChromeClient(this.f2861g);
        this.d.i(new b(this), "mifeng");
        this.d.s(this.b);
        LinearLayout linearLayout = (LinearLayout) findViewById(R.id.setting_help_html);
        this.f2859e = linearLayout;
        linearLayout.addView(this.d);
        Button button = (Button) findViewById(R.id.btn_nav_left);
        this.f2860f = button;
        button.setOnClickListener(this);
        u0.q(this, null);
        View findViewById = findViewById(2131299795);
        findViewById.getLayoutParams().height = u0.d();
        u0.j(this, findViewById, getResources().getDrawable(R.drawable.navigationbar_bg), true);
    }

    @Override
    public void onClick(View view) {
        if (view.getId() != 2131296486) {
            return;
        }
        finish();
    }

    @Override
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(R.layout.htmldisplay);
        init();
    }

    @Override
    protected void onDestroy() {
        this.d.removeAllViews();
        this.f2859e.removeAllViews();
        this.d.n();
        this.d = null;
        super.onDestroy();
        CookieSyncManager.createInstance(getApplicationContext());
        CookieManager.getInstance().removeAllCookie();
    }

    public boolean onKeyDown(int i2, KeyEvent keyEvent) {
        if (i2 != 4 || !this.d.j()) {
            return super/*android.app.Activity*/.onKeyDown(i2, keyEvent);
        }
        this.d.o();
        return true;
    }

    @Override
    protected void onPause() {
        try {
            this.d.getClass().getMethod("onPause", new Class[0]).invoke(this.d, null);
        } catch (Exception e2) {
            e2.printStackTrace();
        }
        super.onPause();
    }

    @Override
    protected void onResume() {
        try {
            this.d.getClass().getMethod("onResume", new Class[0]).invoke(this.d, null);
        } catch (Exception e2) {
            e2.printStackTrace();
        }
        super.onResume();
    }

    @Override
    protected void onStop() {
        super.onStop();
    }

    @Override
    public void refresh(Object... objArr) {
    }
}