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

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


package com.excelliance.kxqp.gs.ui.gaccount;

import android.app.Dialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Color;
import android.os.Handler;
import android.os.Message;
import android.text.SpannableStringBuilder;
import android.text.TextUtils;
import android.text.style.ForegroundColorSpan;
import android.view.View;
import android.widget.Button;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import androidx.fragment.app.DialogFragment;
import androidx.work.WorkRequest;
import com.android.spush.util.WebActionRouter;
import com.excean.bytedancebi.bean.BiEventClick;
import com.excean.bytedancebi.bean.BiEventDialogShow;
import com.excean.ggspace.main.R;
import com.excean.view.dialog.ContainerDialog;
import com.excelliance.kxqp.bitmap.ui.imp.RankingListFragment;
import com.excelliance.kxqp.gs.base.BaseLazyFragment;
import com.excelliance.kxqp.gs.bean.PrepayInfoBean;
import com.excelliance.kxqp.gs.thpool.tp;
import com.excelliance.kxqp.gs.ui.VideoPlayerActivity;
import com.excelliance.kxqp.gs.ui.gaccount.k;
import com.excelliance.kxqp.gs.ui.opinion.OpinionActivity;
import com.excelliance.kxqp.gs.ui.question.CommonWebViewActivity;
import com.excelliance.kxqp.gs.util.as;
import com.excelliance.kxqp.gs.util.aw;
import com.excelliance.kxqp.gs.util.bf;
import com.excelliance.kxqp.gs.util.bo;
import com.excelliance.kxqp.gs.util.bx;
import com.excelliance.kxqp.gs.util.by;
import com.excelliance.kxqp.gs.util.cd;
import com.excelliance.kxqp.gs.util.w;
import com.excelliance.kxqp.platforms.ExcellianceAppInfo;
import io.github.prototypez.service.account.request.LoginRequest;
import java.util.ArrayList;
import java.util.List;
import org.apache.http.HttpHost;
import org.apache.http.cookie.ClientCookie;

public class MineAccountFragment extends BaseLazyFragment<l> implements k.a, k.c {

    public String f9239a;
    private ListView m;
    private List<b> n = new ArrayList();
    private Handler o = new Handler() {
        @Override
        public void handleMessage(Message message) {
            if (message.what == 2 && MineAccountFragment.this.q != null && MineAccountFragment.this.q.isShowing()) {
                MineAccountFragment.this.q.dismiss();
            }
        }
    };
    private a p;
    private com.excelliance.kxqp.gs.dialog.h q;
    private View r;
    private Dialog s;
    private View t;
    private View u;

    @Override
    protected void b() {
        View findViewById = this.f.findViewById(R.id.account_list);
        this.r = this.f.findViewById(R.id.btn_login_google);
        this.r.setTag(3);
        this.t = this.f.findViewById(R.id.btn_modify_data);
        this.t.setTag(9);
        this.r.setOnClickListener(this);
        this.t.setOnClickListener(this);
        if (findViewById != null && (findViewById instanceof ListView)) {
            this.m = (ListView) findViewById;
        }
        if (com.excelliance.kxqp.gs.newappstore.b.c.a(this.d)) {
            com.excelliance.kxqp.gs.newappstore.b.c.a(this.r, getResources().getDrawable(R.drawable.bg_login_google_account_new_store));
        }
    }

    @Override
    protected int d() {
        return R.layout.fragment_mygpaccount_content;
    }

    @Override
    public void singleClick(View view) {
        switch (Integer.valueOf(view.getTag().toString()).intValue()) {
            case 1:
                Intent intent = new Intent(getActivity(), (Class<?>) OpinionActivity.class);
                intent.putExtra("complainType", "4");
                startActivity(intent);
                return;
            case 2:
                c(3);
                return;
            case 3:
                if (aw.d(this.d)) {
                    return;
                }
                Intent intent2 = new Intent(this.d.getPackageName() + ".action.main.start.google.gp.app");
                intent2.putExtra("intentUrl", ".action.main.start.google.gp.app");
                this.d.sendBroadcast(intent2);
                return;
            case 4:
                Intent intent3 = new Intent();
                intent3.setClass(this.d, CommonWebViewActivity.class);
                intent3.putExtra("title", getString(R.string.gpaccount_pwd_setting));
                intent3.putExtra("src", 1);
                startActivity(intent3);
                return;
            case 5:
                CommonWebViewActivity.a(this.d, "https://h5.ourplay.com.cn/html/modifyInfo/index.html", getString(R.string.gaccount_modity_gaccount_data));
                return;
            case 6:
            default:
                return;
            case 7:
                CommonWebViewActivity.a(this.d, "https://h5.ourplay.com.cn/html/loginProblem/index.html", getString(R.string.gaccount_login_answer));
                return;
            case 8:
                CommonWebViewActivity.a(this.d, "https://h5.ourplay.com.cn/html/useProblem/index.html", getString(R.string.gaccount_common_answer));
                return;
            case 9:
                startActivity(new Intent(getActivity(), (Class<?>) ChangeAccountActivity.class));
                return;
            case 10:
                bo.a(this.d, "", new Runnable() {
                    @Override
                    public void run() {
                        com.excelliance.kxqp.gs.router.a.a.f8074a.invokeLogin(new LoginRequest.Builder(MineAccountFragment.this.d).setLoginFrom(0).build());
                    }
                });
                return;
        }
    }

    @Override
    public l e() {
        return new l(getActivity(), this, this);
    }

    public void c() {
        if (this.h != 0) {
            ((l) this.h).initData();
        }
    }

    @Override
    public void a(c cVar) {
        if (getActivity() == null || getActivity().isFinishing()) {
            return;
        }
        if (cVar.b() != null) {
            this.n.clear();
            this.n.addAll(cVar.b());
            this.f9239a = cVar.c();
            g();
            b(cVar);
            f();
            this.r.setVisibility(0);
            this.t.setVisibility(0);
            return;
        }
        this.r.setVisibility(8);
        this.t.setVisibility(8);
    }

    @Override
    public void onResume() {
        super.onResume();
        if (this.u != null) {
            f();
        }
    }

    private void f() {
        List<com.excelliance.kxqp.gs.ui.account.c> f = as.f();
        boolean b2 = bx.a().b(this.d);
        if (!b2 && ((com.excelliance.kxqp.gs.util.b.cz(this.d) || com.excelliance.kxqp.gs.util.b.cy(this.d)) && f.size() > 0)) {
            if (this.h != 0) {
                ((l) this.h).b();
            }
        } else if (!b2 && com.excean.ab_builder.c.a.s(this.d) && this.n.size() > 0) {
            this.u.setVisibility(0);
        } else {
            this.u.setVisibility(8);
        }
    }

    @Override
    public void a(final PrepayInfoBean prepayInfoBean) {
        tp.i(new Runnable() {
            @Override
            public void run() {
                if (prepayInfoBean == null || !prepayInfoBean.hasCombination) {
                    MineAccountFragment.this.u.setVisibility(8);
                } else {
                    MineAccountFragment.this.u.setVisibility(0);
                }
            }
        });
    }

    @Override
    public void a(boolean z) {
        Toast.makeText(this.d, getString(z ? R.string.google_account_bind_success : R.string.google_account_bind_failure), 0).show();
        if (this.q == null || !this.q.isShowing()) {
            return;
        }
        this.q.dismiss();
    }

    private void b(c cVar) {
        Boolean b2 = by.a(this.d, ".sp.common.disposable.flag.info").b("sp_key_google_account_bind_need_request", false);
        if (cVar.a() && b2.booleanValue()) {
            if (this.s == null) {
                this.s = new com.excelliance.kxqp.gs.base.f(this.d) {
                    @Override
                    public String b() {
                        return "dialog_google_account_bind";
                    }

                    @Override
                    protected void a(View view) {
                        View findViewById = view.findViewById(R.id.btn_cancel);
                        View findViewById2 = view.findViewById(R.id.btn_confirm);
                        findViewById.setOnClickListener(new com.excelliance.kxqp.bitmap.ui.imp.d() {
                            @Override
                            protected void a(View view2) {
                                dismiss();
                            }
                        });
                        findViewById2.setOnClickListener(new com.excelliance.kxqp.bitmap.ui.imp.d() {
                            @Override
                            protected void a(View view2) {
                                dismiss();
                                if (MineAccountFragment.this.q == null) {
                                    MineAccountFragment.this.q = new com.excelliance.kxqp.gs.dialog.h(AnonymousClass4.this.c);
                                }
                                if (!MineAccountFragment.this.q.isShowing()) {
                                    MineAccountFragment.this.q.a(MineAccountFragment.this.getString(R.string.requesting));
                                }
                                ((l) MineAccountFragment.this.h).a();
                            }
                        });
                    }
                };
                this.s.setOnDismissListener(new DialogInterface.OnDismissListener() {
                    @Override
                    public void onDismiss(DialogInterface dialogInterface) {
                        by.a(MineAccountFragment.this.d, ".sp.common.disposable.flag.info").a("sp_key_google_account_bind_need_request", false);
                    }
                });
            }
            if (this.s.isShowing()) {
                return;
            }
            this.s.show();
        }
    }

    private void g() {
        if (this.n != null) {
            a(this.n);
            if (this.p == null) {
                this.p = new a(getContext(), this.n);
                this.p.a(false);
                if (this.m != null) {
                    this.m.setAdapter((ListAdapter) this.p);
                    View inflate = View.inflate(this.d, R.layout.footer_gaccount_answer, null);
                    this.m.addHeaderView(inflate);
                    a((TextView) inflate.findViewById(R.id.tv_use_tip_msg));
                    TextView textView = (TextView) inflate.findViewById(R.id.tv_common_answer);
                    textView.setTag(8);
                    textView.setOnClickListener(this);
                    TextView textView2 = (TextView) inflate.findViewById(R.id.tv_login_answer);
                    textView2.setTag(7);
                    textView2.setOnClickListener(this);
                    this.u = inflate.findViewById(R.id.to_bind_account_rl);
                    this.u.setVisibility(8);
                    this.u.setTag(10);
                    this.u.setOnClickListener(this);
                    View findViewById = inflate.findViewById(R.id.qq_after_sales_layout);
                    if (by.a(this.d.getApplicationContext(), "sp_total_info").b("sp_key_bought_google_account_down", false).booleanValue()) {
                        findViewById.setVisibility(0);
                        String b2 = by.a(this.d, "sp_total_info").b("google_account_sell_qq", "");
                        final String b3 = by.a(this.d, "sp_total_info").b("google_account_sell_qq_qgk", "");
                        String string = getString(R.string.gaccount_sell_qq_group);
                        TextView textView3 = (TextView) inflate.findViewById(R.id.tv_qq_group);
                        Button button = (Button) inflate.findViewById(R.id.btn_join_qq);
                        if (!TextUtils.isEmpty(b3)) {
                            button.setText(b3.startsWith(HttpHost.DEFAULT_SCHEME_NAME) ? R.string.contact_after_sales : R.string.click_join);
                            string = getString(b3.startsWith(HttpHost.DEFAULT_SCHEME_NAME) ? R.string.gaccount_sell_qq : R.string.gaccount_sell_qq_group);
                        }
                        if (com.excelliance.kxqp.gs.newappstore.b.c.a(this.d)) {
                            button.setTextColor(com.excelliance.kxqp.gs.newappstore.b.c.f7694a);
                        }
                        button.setOnClickListener(new com.excelliance.kxqp.bitmap.ui.imp.d() {
                            @Override
                            protected void a(View view) {
                                new com.excelliance.kxqp.d.d();
                                com.excelliance.kxqp.d.d.a(MineAccountFragment.this.d, b3);
                            }
                        });
                        textView3.setText(cd.a(string, new String[]{b2}));
                    } else {
                        findViewById.setVisibility(8);
                    }
                    if (!TextUtils.isEmpty(this.f9239a)) {
                        RelativeLayout relativeLayout = (RelativeLayout) inflate.findViewById(R.id.notice_info_rl);
                        relativeLayout.setVisibility(0);
                        com.excelliance.kxqp.ui.util.b.a((TextView) relativeLayout.findViewById(R.id.notice_info), this.f9239a, this.d);
                    }
                    inflate.findViewById(R.id.btn_watch_tutorial).setOnClickListener(new View.OnClickListener() {
                        @Override
                        public void onClick(View view) {
                            if (!bf.e(MineAccountFragment.this.d)) {
                                Toast.makeText(MineAccountFragment.this.d, R.string.net_unusable, 0).show();
                            }
                            VideoPlayerActivity.a(MineAccountFragment.this.d, "https://cdn.ourplay.com.cn/89a34f120895644ed334d2e42bc949eb.mp4", 1);
                        }
                    });
                    return;
                }
                return;
            }
            this.p.a(this.n);
        }
    }

    private void a(TextView textView) {
        String string = this.d.getString(R.string.google_account_usage_notice_new);
        String string2 = this.d.getString(R.string.google_account_usage_notice_child_new);
        SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(string);
        spannableStringBuilder.setSpan(new ForegroundColorSpan(Color.parseColor("#ff583d")), string.indexOf(string2), string.indexOf(string2) + string2.length(), 33);
        textView.setText(spannableStringBuilder);
    }

    private void a(List<b> list) {
        if (list == null || list.size() <= 0 || by.a(getContext(), "sp_total_info").b("SP_SHOW_GP_ACCOUNT_LOGIN_ALERT", false).booleanValue()) {
            return;
        }
        final int[] iArr = {1};
        new ContainerDialog.a().a(w.e(getActivity(), "purchase_successful")).c(w.e(getActivity(), "google_account_alert_v2")).e(w.e(getActivity(), "agree_and_continue")).a(true).b(new ContainerDialog.b() {
            @Override
            public void a(DialogFragment dialogFragment) {
                by.a(MineAccountFragment.this.getContext(), "sp_total_info").a("SP_SHOW_GP_ACCOUNT_LOGIN_ALERT", true);
                iArr[0] = 0;
                dialogFragment.dismiss();
            }
        }).a(new DialogInterface.OnDismissListener() {
            @Override
            public void onDismiss(DialogInterface dialogInterface) {
                BiEventClick biEventClick = new BiEventClick();
                biEventClick.current_page = "谷歌账号购买须知页";
                biEventClick.dialog_name = "查看谷歌账号提醒弹窗";
                if (iArr[0] == 0) {
                    biEventClick.button_name = "弹窗确定(进入下一步)";
                } else {
                    biEventClick.button_name = "点弹窗周边";
                }
                com.excean.bytedancebi.c.a.a().a(biEventClick);
            }
        }).a().show(getActivity().getSupportFragmentManager(), "MineAccountFragment");
        BiEventDialogShow biEventDialogShow = new BiEventDialogShow();
        biEventDialogShow.current_page = "谷歌账号购买须知页";
        biEventDialogShow.dialog_type = "查看谷歌账号提醒弹窗";
        biEventDialogShow.dialog_name = "弹窗";
        com.excean.bytedancebi.c.a.a().a(biEventDialogShow);
    }

    private void c(int i) {
        com.excelliance.kxqp.gs.ui.home.f.a(this.d);
        List<ExcellianceAppInfo> n = as.n(this.d);
        if (n == null || n.size() <= 0) {
            return;
        }
        for (ExcellianceAppInfo excellianceAppInfo : n) {
            if (TextUtils.equals(excellianceAppInfo.getAppPackageName(), "com.exce.wv")) {
                Intent intent = new Intent(this.d.getPackageName() + RankingListFragment.OPERATE_TOURIST_GAME);
                intent.putExtra("act", 1);
                intent.putExtra(WebActionRouter.KEY_PKG, excellianceAppInfo.getAppPackageName());
                intent.putExtra(ClientCookie.PATH_ATTR, excellianceAppInfo.getPath());
                intent.putExtra("accountAffinity", i);
                this.d.sendBroadcast(intent);
                a(getString(R.string.google_account_setting));
            }
        }
    }

    private void a(String str) {
        this.q = new com.excelliance.kxqp.gs.dialog.h(this.d);
        if (!this.q.isShowing()) {
            this.q.a(str);
            this.o.removeMessages(2);
            this.o.sendEmptyMessageDelayed(2, WorkRequest.MIN_BACKOFF_MILLIS);
            return;
        }
        this.q.dismiss();
    }
}