VMOS Pro v2.9.9版本的 MD5 值为:42f292af86d02c1a08555cf2d3982a52

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


package com.vmos.pro.activities.register;

import android.content.Intent;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextUtils;
import android.view.View;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.Nullable;
import com.tencent.mars.xlog.Log;
import com.vmos.core.utils.ScreenUtil;
import com.vmos.mvplibrary.BaseAct;
import com.vmos.pro.R;
import com.vmos.pro.activities.register.contract.RegisterContract;
import com.vmos.pro.activities.register.presenter.RegisterPresenter;
import com.vmos.pro.bean.UserBean;
import com.vmos.pro.ui.protocol.WebViewActivity;
import com.vmos.pro.utils.TrackUtils;
public class RegisterActivity extends BaseAct<RegisterContract.Presenter> implements View.OnClickListener, RegisterContract.View {
    private static final String TAG = "RegisterActivity";
    private CheckBox cbAgree;
    public EditText editPhone;
    public EditText editPwd;
    private FrameLayout fl_upload;
    public ImageView ivClear;
    public ImageView ivClearpwd;
    public ImageView ivDown;
    public ImageView ivShowpwd;
    private LinearLayout llActionBar;
    private LinearLayout ll_close;
    public TextView tvNotips;
    public TextView tvPwdtips;
    private TextView tv_login_reigster_privacy_policy;
    private TextView tv_next;
    private TextView tv_terms_of_service;
    private boolean secretPwd = true;
    private boolean hasRegister = false;

    private void initViews() {
        this.cbAgree = (CheckBox) findViewById(R.id.cb_agree);
        LinearLayout linearLayout = (LinearLayout) findViewById(R.id.ll_close);
        this.ll_close = linearLayout;
        linearLayout.setOnClickListener(this);
        this.editPhone = (EditText) findViewById(R.id.edit_phone);
        this.ivClear = (ImageView) findViewById(R.id.iv_clear);
        this.ivDown = (ImageView) findViewById(R.id.iv_down);
        this.tvNotips = (TextView) findViewById(R.id.tv_notips);
        this.editPwd = (EditText) findViewById(R.id.edit_pwd);
        this.ivShowpwd = (ImageView) findViewById(R.id.iv_showpwd);
        this.ivClearpwd = (ImageView) findViewById(R.id.iv_clearpwd);
        this.tvPwdtips = (TextView) findViewById(R.id.tv_pwdtips);
        this.tv_next = (TextView) findViewById(R.id.tv_next);
        this.tv_terms_of_service = (TextView) findViewById(R.id.tv_terms_of_service);
        this.tv_login_reigster_privacy_policy = (TextView) findViewById(R.id.tv_login_reigster_privacy_policy);
        this.ivClear.setOnClickListener(this);
        this.ivShowpwd.setOnClickListener(this);
        this.ivClearpwd.setOnClickListener(this);
        this.tv_next.setOnClickListener(this);
        this.tv_terms_of_service.setOnClickListener(this);
        this.tv_login_reigster_privacy_policy.setOnClickListener(this);
        this.tv_next.setClickable(false);
        this.editPhone.addTextChangedListener(new j40() {
            @Override
            public void afterTextChanged(Editable editable) {
                EditText editText;
                if (editable != null && !TextUtils.isEmpty(editable.toString())) {
                    RegisterActivity.this.ivClear.setVisibility(0);
                } else {
                    RegisterActivity.this.ivClear.setVisibility(8);
                }
                if (editable == null || TextUtils.isEmpty(editable.toString()) || (editText = RegisterActivity.this.editPwd) == null || TextUtils.isEmpty(editText.getText().toString()) || editable.toString().trim().length() != 11) {
                    RegisterActivity.this.tv_next.setClickable(false);
                    RegisterActivity.this.tv_next.setBackgroundResource(R.drawable.btn_operator_normal);
                } else {
                    RegisterActivity.this.tv_next.setClickable(true);
                    RegisterActivity.this.tv_next.setBackgroundResource(R.drawable.btn_select_bg);
                }
                if (RegisterActivity.this.hasRegister) {
                    RegisterActivity.this.hasRegister = false;
                }
                RegisterActivity.this.tvNotips.setText("");
            }
        });
        this.editPwd.addTextChangedListener(new j40() {
            @Override
            public void afterTextChanged(Editable editable) {
                EditText editText;
                if (editable != null && !TextUtils.isEmpty(editable.toString())) {
                    RegisterActivity.this.ivClearpwd.setVisibility(0);
                    RegisterActivity.this.ivShowpwd.setVisibility(0);
                } else {
                    RegisterActivity.this.ivClearpwd.setVisibility(8);
                    RegisterActivity.this.ivShowpwd.setVisibility(8);
                }
                if (editable == null || TextUtils.isEmpty(editable.toString()) || (editText = RegisterActivity.this.editPhone) == null || TextUtils.isEmpty(editText.getText().toString()) || RegisterActivity.this.editPhone.getText().toString().trim().length() != 11) {
                    RegisterActivity.this.tv_next.setClickable(false);
                    RegisterActivity.this.tv_next.setBackgroundResource(R.drawable.btn_operator_normal);
                } else {
                    RegisterActivity.this.tv_next.setClickable(true);
                    RegisterActivity.this.tv_next.setBackgroundResource(R.drawable.btn_select_bg);
                }
                RegisterActivity.this.tvPwdtips.setText("");
            }
        });
        this.editPhone.setOnFocusChangeListener(new View.OnFocusChangeListener() {
            @Override
            public void onFocusChange(View view, boolean z) {
                if (z) {
                    return;
                }
                EditText editText = RegisterActivity.this.editPhone;
                if (editText != null && !TextUtils.isEmpty(editText.getText().toString()) && RegisterActivity.this.editPhone.getText().toString().trim().length() != 11) {
                    RegisterActivity registerActivity = RegisterActivity.this;
                    registerActivity.tvNotips.setText(registerActivity.getString(R.string.register_1));
                    return;
                }
                RegisterActivity.this.tvNotips.setText("");
            }
        });
    }

    private void jumToInputCodeCompleteRegisterPage(UserBean userBean) {
        Intent intent = getIntent();
        intent.setClass(this, InputCodeActivity.class);
        intent.putExtra("user", userBean);
        startActivityForResult(intent, 102);
    }

    private void startProgress() {
        showCommonLoadingDialog(getString(R.string.please_later));
    }

    private void stopProgress() {
        dismissCommonLoadingDialog();
    }

    @Override
    public void checkPhoneRegisterFail(String str) {
        stopProgress();
        this.hasRegister = true;
        this.tvNotips.setText(str);
        this.tv_next.setClickable(true);
    }

    @Override
    public void getCodeFail(String str) {
        stopProgress();
        this.hasRegister = false;
        this.tvPwdtips.setText(str);
        this.tv_next.setClickable(true);
    }

    @Override
    public void getCodeSuccess() {
        stopProgress();
        this.hasRegister = false;
        UserBean userBean = new UserBean();
        userBean.setPassword(this.editPwd.getText().toString().trim());
        userBean.setMobilePhone(this.editPhone.getText().toString().trim());
        jumToInputCodeCompleteRegisterPage(userBean);
    }

    @Override
    public int getLayoutId() {
        return R.layout.activity_register;
    }

    @Override
    public void onActivityResult(int i, int i2, @Nullable Intent intent) {
        super.onActivityResult(i, i2, intent);
        if (i == 102 && i2 == -1) {
            setResult(-1);
            finish();
        }
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.iv_clear:
                this.editPhone.setText("");
                return;
            case R.id.iv_clearpwd:
                this.editPwd.setText("");
                return;
            case R.id.iv_showpwd:
                if (!this.secretPwd) {
                    this.secretPwd = true;
                    this.ivShowpwd.setBackgroundResource(R.mipmap.show_pwd);
                    this.editPwd.setInputType(od1.f27963);
                    return;
                }
                this.ivShowpwd.setBackgroundResource(R.mipmap.secret_pwd);
                this.secretPwd = false;
                this.editPwd.setInputType(144);
                return;
            case R.id.ll_close:
                finish();
                return;
            case R.id.tv_login_reigster_privacy_policy:
                startActivity(new Intent(this, WebViewActivity.class).putExtra("title", bm4.m3636(R.string.splash_4)).putExtra("url", "http://www.vmos.cn/news/202006121526.htm"));
                return;
            case R.id.tv_next:
                if (!this.cbAgree.isChecked()) {
                    ts5.f35593.m43618(Integer.valueOf((int) R.string.login18));
                    return;
                }
                Log.e(TAG, "hasRegister=" + this.hasRegister);
                if (this.hasRegister) {
                    return;
                }
                EditText editText = this.editPwd;
                if ((editText != null && !TextUtils.isEmpty(editText.getText().toString()) && this.editPwd.getText().toString().trim().length() < 6) || this.editPwd.getText().toString().trim().length() > 20) {
                    this.tvPwdtips.setText(getString(R.string.register_2));
                    return;
                }
                EditText editText2 = this.editPwd;
                if (editText2 != null && !TextUtils.isEmpty(editText2.getText().toString()) && !av3.m2269(this.editPwd.getText().toString().trim())) {
                    this.tvPwdtips.setText(getString(R.string.register_3));
                    return;
                } else if (this.mPresenter != 0) {
                    if (!xb3.m49950(r83.f32021)) {
                        oz5.m35335(this, getString(R.string.network_error_hint));
                        return;
                    }
                    this.tv_next.setClickable(false);
                    startProgress();
                    ((RegisterContract.Presenter) this.mPresenter).checkPhoneRegister(this.editPhone.getText().toString().trim());
                    return;
                } else {
                    return;
                }
            case R.id.tv_terms_of_service:
                startActivity(new Intent(this, WebViewActivity.class).putExtra("title", bm4.m3636(R.string.splash_3)).putExtra("url", "http://www.vmos.cn/news/202006031545.htm"));
                return;
            default:
                return;
        }
    }

    @Override
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        q56.m37309(xy.f41511);
        TrackUtils.m14949(uj4.f36633);
    }

    @Override
    public void onWindowFocusChanged(boolean z) {
        super.onWindowFocusChanged(z);
        if (z) {
            ey4.m19871(getWindow(), true, false);
        }
    }

    @Override
    public void setUp() {
        ey4.m19871(getWindow(), true, false);
        LinearLayout linearLayout = (LinearLayout) findViewById(R.id.ll_close);
        this.ll_close = linearLayout;
        linearLayout.setOnClickListener(this);
        LinearLayout linearLayout2 = (LinearLayout) findViewById(R.id.cl_action_bar);
        this.llActionBar = linearLayout2;
        ((LinearLayout.LayoutParams) linearLayout2.getLayoutParams()).setMargins(0, ScreenUtil.getStatusBarHeight(this), 0, 0);
        initViews();
    }

    @Override
    public void smsFail(String str) {
        stopProgress();
        oz5.m35335(this, str);
        this.tv_next.setClickable(true);
    }

    @Override
    public RegisterContract.Presenter createPresenter() {
        return new RegisterPresenter();
    }
}