导航菜单

页面标题

页面副标题

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

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

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


package com.showself.ui;

import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.text.Editable;
import android.text.SpannableStringBuilder;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.text.style.ForegroundColorSpan;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.meizu.cloud.pushsdk.notification.model.NotifyType;
import com.mifeng.ui.R;
import com.showself.domain.CountryAreaInfo;
import com.showself.domain.LoginResultInfo;
import com.showself.utils.Utils;
import com.showself.utils.r0;
import com.showself.utils.u0;
import com.showself.view.ImmersiveStatusBar;
import com.showself.view.q;
import com.sina.weibo.sdk.auth.Oauth2AccessToken;
import com.tencent.open.SocialConstants;
import com.xiaomi.mipush.sdk.Constants;
import java.io.Serializable;
import java.util.HashMap;
import org.json.JSONObject;

public class RemoveAccountActivity extends com.showself.ui.c implements View.OnClickListener {
    private RelativeLayout a;
    private Button b;
    private TextView c;
    private View d;

    private LinearLayout f2824e;

    private boolean f2825f;

    private boolean f2826g;

    private EditText f2827h;

    private EditText f2828i;

    private TextView f2829j;

    private TextView f2830k;
    private e l;
    private q m;
    private LoginResultInfo n;
    private ImmersiveStatusBar o;
    private RelativeLayout p;
    private TextView q;
    private CountryAreaInfo r;
    private TextWatcher s = new d();

    class a implements com.r.c.d {
        a() {
        }

        @Override
        public void onRequestFinish(com.r.c.c cVar, Object obj) {
            RemoveAccountActivity.this.f2826g = false;
            HashMap hashMap = (HashMap) obj;
            if (hashMap != null) {
                int intValue = ((Integer) hashMap.get(com.showself.net.e.n1)).intValue();
                String str = (String) hashMap.get(com.showself.net.e.o1);
                if (intValue != 0) {
                    Utils.a1(str);
                    return;
                }
                RemoveAccountActivity.this.f2829j.setBackgroundResource(R.drawable.remove_account_verify_code_negative_bg);
                RemoveAccountActivity.this.f2829j.setText("60s");
                RemoveAccountActivity.this.f2829j.setEnabled(false);
                RemoveAccountActivity.this.f2829j.setTextColor(Color.parseColor("#888888"));
                if (RemoveAccountActivity.this.l == null) {
                    RemoveAccountActivity.this.l = RemoveAccountActivity.this.new e(60000L, 1000L);
                }
                RemoveAccountActivity.this.l.start();
                Utils.a1("验证码已发送");
            }
        }
    }

    class b implements com.r.c.d {
        b() {
        }

        @Override
        public void onRequestFinish(com.r.c.c cVar, Object obj) {
            RemoveAccountActivity.this.f2826g = false;
            JSONObject jSONObject = (JSONObject) obj;
            if (jSONObject != null) {
                int optInt = jSONObject.optInt(com.showself.net.e.n1);
                String optString = jSONObject.optString(com.showself.net.e.o1);
                if (optInt != 0) {
                    Utils.a1(optString);
                    return;
                }
                JSONObject optJSONObject = jSONObject.optJSONObject("data");
                if (optJSONObject != null) {
                    RemoveAccountActivity.this.I(optJSONObject.optInt("wealth"));
                }
            }
        }
    }

    class c implements com.r.c.d {
        c() {
        }

        @Override
        public void onRequestFinish(com.r.c.c cVar, Object obj) {
            RemoveAccountActivity.this.f2826g = false;
            JSONObject jSONObject = (JSONObject) obj;
            if (jSONObject != null) {
                int optInt = jSONObject.optInt(com.showself.net.e.n1);
                String optString = jSONObject.optString(com.showself.net.e.o1);
                if (optInt != 0) {
                    Utils.a1(optString);
                    return;
                }
                com.showself.provider.f.h().d();
                Intent intent = new Intent();
                intent.setAction("SHOWSELF_SESSION_EXPIRED_ACTION");
                intent.setPackage(Utils.P());
                intent.putExtra("skip_to_page", 1);
                RemoveAccountActivity.this.sendBroadcast(intent);
                RemoveAccountActivity.this.finish();
                Utils.a1("账号已注销,您已退出!");
            }
        }
    }

    class d implements TextWatcher {
        d() {
        }

        @Override
        public void afterTextChanged(Editable editable) {
            RemoveAccountActivity.this.J();
        }

        @Override
        public void beforeTextChanged(CharSequence charSequence, int i2, int i3, int i4) {
        }

        @Override
        public void onTextChanged(CharSequence charSequence, int i2, int i3, int i4) {
        }
    }

    private class e extends CountDownTimer {
        private long a;

        public e(long j2, long j3) {
            super(j2, j3);
            this.a = j3;
        }

        @Override
        public void onFinish() {
            RemoveAccountActivity.this.l = null;
            RemoveAccountActivity.this.f2829j.setBackgroundResource(R.drawable.remove_account_verify_code_positive_bg);
            RemoveAccountActivity.this.f2829j.setTextColor(-1);
            RemoveAccountActivity.this.f2829j.setText(R.string.remove_account_get_verify_code);
            RemoveAccountActivity.this.f2829j.setEnabled(true);
        }

        @Override
        public void onTick(long j2) {
            long j3 = j2 / this.a;
            if (j3 >= 0) {
                RemoveAccountActivity.this.f2829j.setText(j3 + NotifyType.SOUND);
            }
        }
    }

    private void F() {
        if (!this.f2825f) {
            Utils.X0(R.string.remove_account_read_prompt);
            return;
        }
        String trim = this.f2827h.getText().toString().trim();
        String trim2 = this.f2828i.getText().toString().trim();
        if (TextUtils.isEmpty(trim)) {
            Utils.X0(R.string.remove_account_phone_type_in);
            return;
        }
        if (TextUtils.isEmpty(trim2)) {
            Utils.X0(R.string.remove_account_verify_code_type_in);
        } else if (!Utils.i(trim2)) {
            Utils.X0(R.string.remove_account_verify_code_format_error);
        } else {
            if (this.f2826g) {
                return;
            }
            new com.r.c.c(com.r.c.c.k(String.format(com.showself.net.e.L1, Integer.valueOf(this.n.getUserId())), 1), new com.r.c.a(), new com.r.c.b(1), this).v(new b());
        }
    }

    private void G() {
        if (!this.f2825f) {
            Utils.X0(R.string.remove_account_read_prompt);
            return;
        }
        String trim = this.f2827h.getText().toString().trim();
        if (TextUtils.isEmpty(trim)) {
            Utils.X0(R.string.remove_account_phone_type_in);
            return;
        }
        if (this.f2826g) {
            return;
        }
        String k2 = com.r.c.c.k(com.showself.net.e.K1, 1);
        com.r.c.a aVar = new com.r.c.a();
        CountryAreaInfo countryAreaInfo = this.r;
        if (countryAreaInfo == null || countryAreaInfo.getArea() == 86) {
            aVar.e("phone", trim);
        } else {
            aVar.e("phone", this.r.getArea() + Constants.ACCEPT_TIME_SEPARATOR_SERVER + trim);
        }
        aVar.b(SocialConstants.PARAM_SOURCE, 1);
        aVar.b("type", 3);
        aVar.b(Oauth2AccessToken.KEY_UID, this.n.getUserId());
        new com.r.c.c(k2, aVar, new com.r.c.b(2), this).y(new a());
    }

    private void H() {
        if (this.f2826g) {
            return;
        }
        String trim = this.f2827h.getText().toString().trim();
        String trim2 = this.f2828i.getText().toString().trim();
        String k2 = com.r.c.c.k(String.format(com.showself.net.e.M1, Integer.valueOf(this.n.getUserId())), 1);
        com.r.c.a aVar = new com.r.c.a();
        CountryAreaInfo countryAreaInfo = this.r;
        if (countryAreaInfo == null || countryAreaInfo.getArea() == 86) {
            aVar.e("phone", trim);
        } else {
            aVar.e("phone", this.r.getArea() + Constants.ACCEPT_TIME_SEPARATOR_SERVER + trim);
        }
        aVar.e("code", trim2);
        new com.r.c.c(k2, aVar, new com.r.c.b(1), this).y(new c());
    }

    public void I(int i2) {
        this.m = new q();
        View inflate = View.inflate(this, R.layout.remove_account_dialog_layout, null);
        SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder();
        spannableStringBuilder.append((CharSequence) Utils.a0(R.string.remove_account_current_assets));
        int length = spannableStringBuilder.length();
        spannableStringBuilder.append((CharSequence) Integer.toString(i2));
        spannableStringBuilder.setSpan(new ForegroundColorSpan(Color.parseColor("#df60ff")), length, spannableStringBuilder.length(), 33);
        ((TextView) inflate.findViewById(R.id.tv_assets)).setText(spannableStringBuilder);
        inflate.findViewById(R.id.tv_abandon).setOnClickListener(this);
        inflate.findViewById(R.id.tv_continue).setOnClickListener(this);
        this.m.l(this, inflate, 1.0f, 17, -2, -2, R.style.anim_sclae_inout_style, 2131755755);
    }

    public void J() {
        if (this.f2830k != null) {
            if (this.f2825f && !TextUtils.isEmpty(this.f2827h.getText().toString().trim()) && Utils.i(this.f2828i.getText().toString().trim())) {
                this.f2830k.setBackgroundResource(R.drawable.remove_account_positive_bg);
                this.f2830k.setTextColor(-1);
            } else {
                this.f2830k.setBackgroundResource(R.drawable.remove_account_negative_bg);
                this.f2830k.setTextColor(Color.parseColor("#b0b0b0"));
            }
        }
    }

    @Override
    public void init() {
        RelativeLayout relativeLayout = (RelativeLayout) findViewById(R.id.btn_title_relative);
        this.a = relativeLayout;
        relativeLayout.setBackgroundColor(-1);
        Button button = (Button) findViewById(R.id.btn_nav_left);
        this.b = button;
        button.setBackgroundResource(R.drawable.juvenile_left_icon_black);
        this.b.setOnClickListener(this);
        this.o = (ImmersiveStatusBar) findViewById(2131298726);
        TextView textView = (TextView) findViewById(R.id.tv_nav_title);
        this.c = textView;
        textView.setText(R.string.remove_account);
        LinearLayout linearLayout = (LinearLayout) findViewById(R.id.ll_read_state);
        this.f2824e = linearLayout;
        linearLayout.setOnClickListener(this);
        this.d = findViewById(R.id.view_read_state);
        EditText editText = (EditText) findViewById(R.id.et_phone_number);
        this.f2827h = editText;
        editText.addTextChangedListener(this.s);
        this.f2827h.setOnClickListener(this);
        EditText editText2 = (EditText) findViewById(R.id.et_verify_code);
        this.f2828i = editText2;
        editText2.addTextChangedListener(this.s);
        this.f2828i.setOnClickListener(this);
        TextView textView2 = (TextView) findViewById(R.id.tv_get_verify_code);
        this.f2829j = textView2;
        textView2.setOnClickListener(this);
        this.q = (TextView) findViewById(R.id.tv_reg_phone_tag);
        RelativeLayout relativeLayout2 = (RelativeLayout) findViewById(R.id.rl_reg_phone_tag);
        this.p = relativeLayout2;
        relativeLayout2.setOnClickListener(this);
        LoginResultInfo y = r0.y(this);
        this.n = y;
        if (y.getMobilestatus() == 1) {
            this.f2827h.setText(this.n.getMobile());
            this.f2827h.setEnabled(false);
            this.p.setVisibility(8);
        }
        TextView textView3 = (TextView) findViewById(R.id.tv_remove_account);
        this.f2830k = textView3;
        textView3.setOnClickListener(this);
    }

    @Override
    public void onActivityResult(int i2, int i3, Intent intent) {
        super.onActivityResult(i2, i3, intent);
        if (i2 == com.showself.net.e.Q1 && i3 == com.showself.net.e.R1) {
            Serializable serializableExtra = intent.getSerializableExtra("chooseAreaInfo");
            if (serializableExtra instanceof CountryAreaInfo) {
                this.r = (CountryAreaInfo) serializableExtra;
                this.q.setText("+" + this.r.getArea() + "   " + this.r.getAreaName());
                if (TextUtils.isEmpty(this.f2827h.getText().toString())) {
                    this.f2827h.requestFocus();
                }
            }
        }
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.btn_nav_left:
                finish();
                break;
            case R.id.ll_read_state:
                boolean z = !this.f2825f;
                this.f2825f = z;
                if (z) {
                    this.d.setBackgroundResource(R.drawable.remove_account_has_read);
                } else {
                    this.d.setBackgroundResource(R.drawable.remove_account_not_read);
                }
                J();
                break;
            case R.id.rl_reg_phone_tag:
                startActivityForResult(new Intent((Context) this, (Class<?>) ChooseAreaActivity.class), com.showself.net.e.Q1);
                break;
            case R.id.tv_abandon:
                this.m.b();
                break;
            case R.id.tv_continue:
                H();
                break;
            case R.id.tv_get_verify_code:
                G();
                break;
            case R.id.tv_remove_account:
                F();
                break;
        }
    }

    @Override
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(R.layout.activity_remove_account);
        u0.q(this, null);
        init();
        u0.i(this, this.o, 2131099661, true);
    }

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