OurPlay v5.5.9版本的 MD5 值为:d4e139798f4c2243a1145c8af5e21046

以下内容为反编译后的 AboutActivity.java 源代码,内容仅作参考


package com.excelliance.kxqp.ui;

import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.PackageInfo;
import android.content.res.Resources;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.view.animation.AnimationUtils;
import android.view.inputmethod.InputMethodManager;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import androidx.fragment.app.FragmentManager;
import com.android.spush.FakeServiceHelper;
import com.bytedance.sdk.open.aweme.common.constants.ParamKeyConstants;
import com.excelliance.kxqp.GameUtil;
import com.excelliance.kxqp.Versioning;
import com.excelliance.kxqp.bitmap.bean.RankingItem;
import com.excelliance.kxqp.swipe.SwipeView;
import com.excelliance.kxqp.util.ApkDownloadCompleteReceiver;
import com.excelliance.kxqp.util.Reflecting;
import com.excelliance.kxqp.util.ToastUtil;
import com.excelliance.kxqp.util.ak;
import com.excelliance.kxqp.util.aq;
import com.excelliance.kxqp.util.k;
import java.net.HttpURLConnection;
import java.net.URL;

public class AboutActivity extends BaseFragmentActivity {
    private String d;
    private String e;
    private HttpURLConnection f;
    private String g;
    private int h;
    private Context i;
    private ApkDownloadCompleteReceiver k;
    private String l;
    private ImageView m;
    private TextView n;
    private boolean o;
    private ImageView p;

    int f13678a = -1;

    int f13679b = -1;
    long[] c = new long[5];
    private String j = "AboutActivity";
    private Dialog q = null;
    private String[] r = {"upgrade", "faq"};
    private String[] s = {"upgrade"};
    private Dialog t = null;
    private Handler u = new Handler() {
        @Override
        public void handleMessage(Message message) {
            switch (message.what) {
                case 0:
                    Toast.makeText(AboutActivity.this.i, AboutActivity.this.e, 0).show();
                    return;
                case 1:
                    if (AboutActivity.this.t != null && AboutActivity.this.t.isShowing()) {
                        AboutActivity.this.t.dismiss();
                    }
                    Bundle data = message.getData();
                    String str = (String) data.get("serverVersionCode");
                    if (!k.a(str)) {
                        Boolean a2 = com.excelliance.kxqp.util.f.a(AboutActivity.this.i).a(com.excelliance.kxqp.util.f.a(AboutActivity.this.i).a(), Integer.parseInt(str));
                        ak.a(AboutActivity.this.i).a("isNewVersion", a2.booleanValue());
                        if (!a2.booleanValue()) {
                            Toast.makeText(AboutActivity.this.i, AboutActivity.this.d, 0).show();
                            return;
                        }
                        AboutActivity.this.a(data.getFloat(RankingItem.KEY_SIZE, 0.0f));
                        AboutActivity.this.a(0);
                        Intent intent = new Intent();
                        intent.setAction("HaveNewVersion");
                        intent.putExtra("msg", "msg");
                        intent.putExtra(ParamKeyConstants.WebViewConstants.QUERY_FROM, "about");
                        AboutActivity.this.i.sendBroadcast(intent);
                        return;
                    }
                    Toast.makeText(AboutActivity.this.i, AboutActivity.this.d, 0).show();
                    return;
                default:
                    return;
            }
        }
    };

    public static void a(Context context) {
        try {
            context.startActivity(new Intent("android.intent.action.VIEW", Uri.parse("http://www.multiopen.cn/")));
        } catch (Exception unused) {
            Resources resources = context.getResources();
            int identifier = resources.getIdentifier("no_browser", "string", context.getPackageName());
            if (identifier != 0) {
                Toast.makeText(context, resources.getString(identifier), 0).show();
            }
        }
    }

    @Override
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        requestWindowFeature(1);
        this.i = this;
        this.f13678a = com.excelliance.kxqp.swipe.h.e(this.i);
        this.f13679b = com.excelliance.kxqp.swipe.h.f(this.i);
        if (Reflecting.mClassLoader == null) {
            Reflecting.mClassLoader = this.i.getApplicationContext().getClassLoader();
        }
        if (Reflecting.getObj(Context.class, this.i, "com.excelliance.kxqp.share.exec.ShareExcute") == null) {
            InitialData.a(this).c();
        }
        this.h = getResources().getIdentifier("lyl_about_new", "layout", getPackageName());
        if (com.excelliance.kxqp.swipe.h.c(this.i.getApplicationContext())) {
            int identifier = getResources().getIdentifier("lyl_about_new_blue", "layout", getPackageName());
            if (identifier != 0) {
                this.h = identifier;
            }
        }
        if (this.h > 0) {
            setContentView(this.h);
            this.h = this.i.getResources().getIdentifier("iv_back", "id", this.i.getPackageName());
            if (this.h > 0) {
                ImageButton imageButton = (ImageButton) findViewById(this.h);
                this.h = getResources().getIdentifier("button_back", "drawable", getPackageName());
                if (this.h > 0) {
                    imageButton.setImageDrawable(getResources().getDrawable(this.h));
                }
                imageButton.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        AboutActivity.this.e();
                        InputMethodManager inputMethodManager = (InputMethodManager) AboutActivity.this.getSystemService("input_method");
                        if (Build.VERSION.SDK_INT >= 3) {
                            inputMethodManager.hideSoftInputFromWindow(view.getWindowToken(), 0);
                        }
                    }
                });
            }
            this.h = this.i.getResources().getIdentifier("tv_version", "id", this.i.getPackageName());
            if (this.h > 0) {
                TextView textView = (TextView) findViewById(this.h);
                try {
                    PackageInfo packageInfo = this.i.getPackageManager().getPackageInfo(this.i.getPackageName(), 0);
                    if (packageInfo != null) {
                        textView.setText("V " + packageInfo.versionName);
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
            this.h = this.i.getResources().getIdentifier("tv_contact", "id", this.i.getPackageName());
            if (this.h > 0) {
                ((TextView) findViewById(this.h)).setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        Intent intent = new Intent();
                        intent.setClass(AboutActivity.this.i, ContactActivity.class);
                        intent.setPackage(AboutActivity.this.i.getPackageName());
                        intent.setFlags(268435456);
                        AboutActivity.this.startActivity(intent);
                    }
                });
            }
            this.h = this.i.getResources().getIdentifier("tv_update", "id", this.i.getPackageName());
            this.h = this.i.getResources().getIdentifier("rl_update", "id", getPackageName());
            if (this.h > 0) {
                ((RelativeLayout) findViewById(this.h)).setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        AboutActivity.this.b();
                    }
                });
            }
            this.h = this.i.getResources().getIdentifier("tv_offical", "id", this.i.getPackageName());
            if (this.h > 0) {
                ((TextView) findViewById(this.h)).setOnClickListener(new View.OnClickListener() {

                    boolean f13687a = false;

                    @Override
                    public void onClick(View view) {
                        if (this.f13687a) {
                            return;
                        }
                        this.f13687a = true;
                        if (com.excelliance.kxqp.swipe.a.a.getIdOfDrawable(AboutActivity.this.i, "download_qrcode") != 0) {
                            FragmentManager supportFragmentManager = AboutActivity.this.getSupportFragmentManager();
                            QRCodeDialog qRCodeDialog = (QRCodeDialog) supportFragmentManager.findFragmentByTag("download_qrcode");
                            if (qRCodeDialog == null) {
                                qRCodeDialog = new QRCodeDialog();
                            }
                            try {
                                if (!qRCodeDialog.isAdded()) {
                                    qRCodeDialog.show(supportFragmentManager, "download_qrcode");
                                }
                            } catch (Exception e2) {
                                e2.printStackTrace();
                                Log.e("AboutActivity", "e:" + e2.getLocalizedMessage());
                            }
                        } else {
                            AboutActivity.a(view.getContext());
                        }
                        this.f13687a = false;
                    }
                });
            }
            this.h = getResources().getIdentifier("new_versioncode", "id", getPackageName());
            this.n = (TextView) findViewById(this.h);
            this.h = getResources().getIdentifier("notification_img", "id", getPackageName());
            this.m = (ImageView) findViewById(this.h);
            boolean booleanValue = ak.a(this.i).b("isNewVersion", false).booleanValue();
            Boolean b2 = ak.a(this.i).b("isSeeAbout", false);
            this.o = false;
            if (booleanValue && !b2.booleanValue()) {
                this.n.setText("(V " + ak.a(this.i).b("mVerName", (String) null) + ")");
                this.n.setVisibility(0);
                this.h = getResources().getIdentifier("notifice_point", "drawable", getPackageName());
                Versioning.setBackgroundDrawable(this.h, this.m, this.i);
                this.m.setVisibility(0);
            }
            int id = com.excelliance.kxqp.swipe.a.a.getId(this.i, "iv_logo");
            if (id != 0) {
                this.p = (ImageView) findViewById(id);
            }
            if (this.p != null) {
                this.p.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        System.arraycopy(AboutActivity.this.c, 1, AboutActivity.this.c, 0, AboutActivity.this.c.length - 1);
                        AboutActivity.this.c[AboutActivity.this.c.length - 1] = System.currentTimeMillis();
                        if (System.currentTimeMillis() - AboutActivity.this.c[0] < 1500) {
                            int b3 = GameUtil.b(AboutActivity.this.i);
                            int c = GameUtil.c(AboutActivity.this.i);
                            ToastUtil.showToast(AboutActivity.this.i, b3 + "-" + c);
                        }
                    }
                });
            }
        }
        this.d = (String) getResources().getText(this.i.getResources().getIdentifier("now_is_new_version", "string", this.i.getPackageName()));
        this.e = (String) getResources().getText(this.i.getResources().getIdentifier("network_error_retry", "string", this.i.getPackageName()));
        this.h = getResources().getIdentifier("status_bg_blue", "color", getPackageName());
        if (!com.excelliance.kxqp.swipe.h.c(this.i.getApplicationContext()) || this.h == 0) {
            return;
        }
        a((Context) this, this.h);
    }

    @Override
    public boolean onKeyDown(int i, KeyEvent keyEvent) {
        if (i == 4) {
            keyEvent.getRepeatCount();
        }
        return super.onKeyDown(i, keyEvent);
    }

    public void a(int i) {
        this.o = true;
        if (this.n != null) {
            this.n.setText("(V " + ak.a(this.i).b("mVerName", (String) null) + ")");
            this.n.setVisibility(i);
        }
        if (this.m != null) {
            this.h = getResources().getIdentifier("notifice_point", "drawable", getPackageName());
            Versioning.setBackgroundDrawable(this.h, this.m, this.i);
            this.m.setVisibility(i);
        }
    }

    public void a(float f) {
        NetworkInfo networkInfo = ((ConnectivityManager) getSystemService(FakeServiceHelper.CONNECTIVITY_SERVICE)).getNetworkInfo(1);
        if (this.q == null) {
            ViewGroup viewGroup = (ViewGroup) com.excelliance.kxqp.swipe.a.a.getLayout(this.i, "dialog_update_version");
            View findViewById = viewGroup.findViewById(this.i.getResources().getIdentifier("ll_UpdateVersion", "id", this.i.getPackageName()));
            int identifier = this.i.getResources().getIdentifier("dr_border_dialog", "drawable", this.i.getPackageName());
            if (identifier != 0) {
                Versioning.setBackgroundDrawable(identifier, findViewById, this.i.getResources());
            }
            int id = com.excelliance.kxqp.swipe.a.a.getId(this.i, "tv_about_updateContent");
            if (id != 0) {
                TextView textView = (TextView) viewGroup.findViewById(id);
                if (networkInfo.isConnected()) {
                    int identifier2 = this.i.getResources().getIdentifier("new_version_update", "string", this.i.getPackageName());
                    if (identifier2 != 0) {
                        textView.setText(identifier2);
                    }
                } else {
                    int identifier3 = this.i.getResources().getIdentifier("new_no_wifi_version_update0", "string", this.i.getPackageName());
                    if (identifier3 != 0) {
                        textView.setText(identifier3);
                    }
                }
            }
            int id2 = com.excelliance.kxqp.swipe.a.a.getId(this.i, "tv_about_updateVersionCode");
            if (id2 != 0) {
                TextView textView2 = (TextView) viewGroup.findViewById(id2);
                StringBuilder sb = new StringBuilder();
                sb.append("V");
                sb.append(this.g);
                if (f > 0.0f) {
                    float f2 = f < 102.4f ? 0.1f : f / 1048576.0f;
                    int identifier4 = this.i.getResources().getIdentifier("new_version_size", "string", this.i.getPackageName());
                    if (identifier4 != 0) {
                        sb.append("(");
                        sb.append(String.format(this.i.getResources().getString(identifier4), Float.valueOf(f2)));
                        sb.append(")");
                    } else {
                        sb.append("(");
                        sb.append(String.format("%.1f", Float.valueOf(f2)));
                        sb.append(")");
                    }
                }
                textView2.setText(sb.toString());
            }
            int id3 = com.excelliance.kxqp.swipe.a.a.getId(this.i, "btn_about_noUpdate");
            if (id3 != 0) {
                viewGroup.findViewById(id3).setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        if (AboutActivity.this.q == null || !AboutActivity.this.q.isShowing()) {
                            return;
                        }
                        AboutActivity.this.q.dismiss();
                        AboutActivity.this.q = null;
                    }
                });
            }
            int id4 = com.excelliance.kxqp.swipe.a.a.getId(this.i, "btn_about_yesUpdate");
            if (id4 != 0) {
                viewGroup.findViewById(id4).setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        if (AboutActivity.this.q == null || !AboutActivity.this.q.isShowing()) {
                            return;
                        }
                        AboutActivity.this.q.dismiss();
                        AboutActivity.this.q = null;
                        AboutActivity.this.a();
                    }
                });
            }
            viewGroup.setBackgroundColor(this.i.getResources().getColor(this.i.getResources().getIdentifier("transparent", "color", this.i.getPackageName())));
            this.q = new Dialog(this.i, this.i.getResources().getIdentifier("pay_custom_dialog_theme", "style", this.i.getPackageName()));
            this.q.setContentView(viewGroup);
            Window window = this.q.getWindow();
            window.setGravity(17);
            WindowManager.LayoutParams attributes = window.getAttributes();
            WindowManager windowManager = (WindowManager) viewGroup.getContext().getSystemService("window");
            int width = windowManager.getDefaultDisplay().getWidth();
            int height = windowManager.getDefaultDisplay().getHeight();
            attributes.width = width;
            attributes.height = height;
            window.setAttributes(attributes);
        }
        if (this.q == null || this.q.isShowing() || !(this.i instanceof Activity) || ((Activity) this.i).isFinishing()) {
            return;
        }
        this.q.show();
    }

    protected void a() {
        String str;
        IntentFilter intentFilter = new IntentFilter();
        intentFilter.addAction("android.intent.action.DOWNLOAD_COMPLETE");
        intentFilter.addAction("android.intent.action.DOWNLOAD_NOTIFICATION_CLICKED");
        this.k = new ApkDownloadCompleteReceiver();
        registerReceiver(this.k, intentFilter);
        if (k.a(this.l) || (str = this.l) == null) {
            return;
        }
        com.excelliance.kxqp.util.e.a(this, str);
    }

    @Override
    public void onResume() {
        super.onResume();
        SwipeView.a((Context) this, false);
        try {
            if (Integer.parseInt(ak.a(this.i).b("mVerCose", "0")) <= d()) {
                this.n.setVisibility(8);
                this.m.setVisibility(8);
            }
        } catch (Exception unused) {
        }
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        if (this.k != null) {
            unregisterReceiver(this.k);
            this.k = null;
        }
        SwipeView.setSwipeView(true);
    }

    private int d() {
        try {
            return getPackageManager().getPackageInfo(getPackageName(), 0).versionCode;
        } catch (Exception unused) {
            return 0;
        }
    }

    public void b() {
        c();
        new Thread(new Runnable() {
            @Override
            public void run() {
                aq a2;
                try {
                    try {
                        AboutActivity.this.f = (HttpURLConnection) new URL(com.excelliance.kxqp.util.f.a(AboutActivity.this.i).g()).openConnection();
                        AboutActivity.this.f.setConnectTimeout(5000);
                        AboutActivity.this.f.setReadTimeout(5000);
                        AboutActivity.this.f.setRequestMethod("GET");
                        AboutActivity.this.f.connect();
                        a2 = com.excelliance.kxqp.util.g.a().a(AboutActivity.this.f.getInputStream());
                    } catch (Exception e) {
                        e.printStackTrace();
                        if (AboutActivity.this.t != null && AboutActivity.this.t.isShowing()) {
                            AboutActivity.this.t.dismiss();
                            Message message = new Message();
                            message.what = 0;
                            AboutActivity.this.u.sendMessage(message);
                        }
                    }
                    if (a2 == null) {
                        return;
                    }
                    String d = a2.d();
                    AboutActivity.this.l = a2.e();
                    AboutActivity.this.g = a2.a();
                    ak.a(AboutActivity.this.i).a("MD5", a2.c());
                    Message message2 = new Message();
                    Bundle bundle = new Bundle();
                    bundle.putString("serverVersionCode", d);
                    String b2 = a2.b();
                    if (b2 != null && b2.length() > 0) {
                        try {
                            bundle.putFloat(RankingItem.KEY_SIZE, Integer.parseInt(b2));
                        } catch (Exception e2) {
                            e2.printStackTrace();
                        }
                    }
                    ak.a(AboutActivity.this.i).a("mVerName", AboutActivity.this.g);
                    ak.a(AboutActivity.this.i).a("mVerCose", d);
                    message2.setData(bundle);
                    message2.what = 1;
                    AboutActivity.this.u.sendMessage(message2);
                } finally {
                    AboutActivity.this.f.disconnect();
                }
            }
        }).start();
    }

    public void c() {
        if (this.t != null) {
            this.t = null;
        }
        if (this.t == null) {
            View inflate = LayoutInflater.from(this).inflate(getResources().getIdentifier("custom_progress_dialog", "layout", getPackageName()), (ViewGroup) null, false);
            ImageView imageView = (ImageView) inflate.findViewById(getResources().getIdentifier("custom_progress_dialog_img", "id", getPackageName()));
            imageView.setImageDrawable(getResources().getDrawable(getResources().getIdentifier("spinner", "drawable", getPackageName())));
            imageView.startAnimation(AnimationUtils.loadAnimation(this, getResources().getIdentifier("progress_animator", "anim", getPackageName())));
            ((TextView) inflate.findViewById(getResources().getIdentifier("progress_note", "id", getPackageName()))).setText(getResources().getIdentifier("now_check", "string", getPackageName()));
            this.t = new Dialog(this, getResources().getIdentifier("custom_dialog_theme", "style", getPackageName()));
            this.t.getWindow().setBackgroundDrawable(getResources().getDrawable(getResources().getIdentifier("dialog_transparent_bg", "drawable", getPackageName())));
            this.t.setContentView(inflate);
            this.t.setCanceledOnTouchOutside(false);
            this.t.setOnKeyListener(new DialogInterface.OnKeyListener() {
                @Override
                public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) {
                    if (i != 4) {
                        return false;
                    }
                    if (AboutActivity.this.t == null || !AboutActivity.this.t.isShowing()) {
                        return true;
                    }
                    AboutActivity.this.t.dismiss();
                    AboutActivity.this.t = null;
                    return true;
                }
            });
        }
        if (this.t.isShowing() || isFinishing()) {
            return;
        }
        this.t.show();
    }

    @Override
    public void onBackPressed() {
        super.onBackPressed();
        e();
    }

    public void e() {
        finish();
        g();
        overridePendingTransition(0, getResources().getIdentifier("slide_right_out", "anim", getPackageName()));
    }

    private void g() {
        if (this.o) {
            ak.a(this.i).a("isSeeAbout");
            ak.a(this.i).a("seeVn");
            return;
        }
        ak.a(this.i).a("isSeeAbout", true);
        Log.d("AboutActivity", "isSeeAbout = " + ak.a(this.i).b("isSeeAbout", false));
        ak.a(this.i).a("seeVn", ak.a(this.i).b("mVerName", ""));
    }
}