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

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


package com.vmos.pro.activities.login;

import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.text.Editable;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.PopupWindow;
import android.widget.TextView;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.blankj.utilcode.util.ToastUtils;
import com.tencent.mars.xlog.Log;
import com.vmos.commonuilibrary.View$OnClickListenerC1406;
import com.vmos.core.utils.ScreenUtil;
import com.vmos.mvplibrary.BaseAct;
import com.vmos.pro.R;
import com.vmos.pro.account.AccountHelper;
import com.vmos.pro.activities.login.adapter.UserinfoAdapter;
import com.vmos.pro.activities.login.contract.LoginContract;
import com.vmos.pro.activities.login.entity.LoginEntranceArg;
import com.vmos.pro.activities.login.presenter.LoginPresenter;
import com.vmos.pro.activities.register.RegisterActivity;
import com.vmos.pro.activities.updatepwd.UpdatePwdActivity;
import com.vmos.pro.bean.UserBean;
import com.vmos.pro.bean.UserPwdBean;
import com.vmos.pro.modules.bindphone.BindPhoneInputActivity;
import com.vmos.pro.ui.protocol.WebViewActivity;
import com.vmos.pro.utils.TrackUtils;
import java.util.ArrayList;
import java.util.List;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
public class LoginActivity extends BaseAct<LoginContract.Presenter> implements View.OnClickListener, LoginContract.View {
    public static final String EXTRA = "EXTRA";
    public static final String POSITION = "POSITION";
    private static final String TAG = "LoginActivity";
    private CheckBox cbAgree;
    public EditText editPhone;
    public EditText editPwd;
    public ImageView ivClear;
    public ImageView ivClearpwd;
    public ImageView ivDown;
    public ImageView ivShowpwd;
    private ImageView ivWeChatLogin;
    private LinearLayout llActionBar;
    private LinearLayout ll_close;
    private LinearLayout ll_login;
    private UserinfoAdapter mAdapter;
    private String mExtra;
    public PopupWindow mPopup;
    private String pwd;
    public boolean requestedWxLogin;
    public TextView tvNotips;
    public TextView tvPwdtips;
    private TextView tv_forgetpwd;
    private TextView tv_login_reigster_privacy_policy;
    private TextView tv_ok;
    private TextView tv_register;
    private TextView tv_terms_of_service;
    private String username;
    public List<UserPwdBean> userList = new ArrayList();
    private boolean secretPwd = true;
    private boolean chooseFlag = false;

    private LoginEntranceArg getLoginEntranceArgFromIntent() {
        if (getIntent().getSerializableExtra(LoginConstants.LOGIN_ENTRANCE_ARG_KEY) instanceof LoginEntranceArg) {
            return (LoginEntranceArg) getIntent().getSerializableExtra(LoginConstants.LOGIN_ENTRANCE_ARG_KEY);
        }
        return null;
    }

    private void initPopup() {
        this.mAdapter = new UserinfoAdapter(this.userList);
        View inflate = LayoutInflater.from(this).inflate(R.layout.popwindow_layout, (ViewGroup) null);
        int width = this.editPhone.getWidth();
        RecyclerView recyclerView = (RecyclerView) inflate.findViewById(R.id.rv);
        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
        linearLayoutManager.setOrientation(1);
        recyclerView.setLayoutManager(linearLayoutManager);
        recyclerView.setAdapter(this.mAdapter);
        PopupWindow popupWindow = new PopupWindow(inflate, width, -2, true);
        this.mPopup = popupWindow;
        popupWindow.setOutsideTouchable(true);
        this.mPopup.setOnDismissListener(new PopupWindow.OnDismissListener() {
            @Override
            public void onDismiss() {
                LoginActivity.this.mPopup.dismiss();
            }
        });
    }

    private void jumpToRegisterPage() {
        Intent intent = getIntent();
        intent.setClass(this, RegisterActivity.class);
        startActivityForResult(intent, 101);
    }

    private void jumpToUpdatePwdPage() {
        Intent intent = getIntent();
        intent.setClass(this, UpdatePwdActivity.class);
        startActivity(intent);
    }

    private void postLoginSuccessEventAction() {
        f51 f51Var = new f51(LoginConstants.LOGIN_SUCCESS_ACTION);
        f51Var.m20109(LoginConstants.LOGIN_ENTRANCE_ARG_KEY, getLoginEntranceArgFromIntent());
        lo1.m30077().m55896().m4620(f51Var);
    }

    private void reportUmengEvent(String str) {
        LoginEntranceArg loginEntranceArgFromIntent = getLoginEntranceArgFromIntent();
        q56.m37308(str, loginEntranceArgFromIntent != null ? loginEntranceArgFromIntent.getLoginCause() : "empty");
    }

    private boolean showPleaseCheckProtocolToast() {
        boolean isChecked = this.cbAgree.isChecked();
        if (!isChecked) {
            ts5.f35593.m43617(getString(R.string.login18));
        }
        return !isChecked;
    }

    public void showWxHintPop(View view) {
        PopupWindow popupWindow = new PopupWindow(LayoutInflater.from(this).inflate(R.layout.pop_wx_login, (ViewGroup) null), -2, -2);
        popupWindow.setOutsideTouchable(true);
        popupWindow.showAsDropDown(view, -ey4.m19869(77), (-view.getHeight()) - ey4.m19869(45));
    }

    public static void startLoginActivity(Context context, LoginEntranceArg loginEntranceArg) {
        Intent intent = new Intent(context, LoginActivity.class);
        intent.putExtra(LoginConstants.LOGIN_ENTRANCE_ARG_KEY, loginEntranceArg);
        C7580.m56052(context, intent);
    }

    public void stopProgress() {
        dismissCommonLoadingDialog();
    }

    @Subscribe(sticky = true, threadMode = ThreadMode.MAIN)
    public void chooseUserEvent(fq fqVar) {
        if (fqVar == null || fqVar.m20909() == null) {
            return;
        }
        EditText editText = this.editPhone;
        if (editText != null) {
            editText.setText(fqVar.m20909().m11318());
            this.username = fqVar.m20909().m11318();
        }
        EditText editText2 = this.editPwd;
        if (editText2 != null) {
            editText2.setText(fqVar.m20909().m11314());
            this.pwd = fqVar.m20909().m11314();
        }
        PopupWindow popupWindow = this.mPopup;
        if (popupWindow != null) {
            popupWindow.dismiss();
        }
        this.chooseFlag = true;
    }

    @Subscribe(sticky = true, threadMode = ThreadMode.MAIN)
    public void delUserEvent(ek0 ek0Var) {
        UserinfoAdapter userinfoAdapter;
        if (ek0Var == null || (userinfoAdapter = this.mAdapter) == null || userinfoAdapter.getList() == null || this.mAdapter.getList().size() != 0) {
            return;
        }
        this.ivDown.setVisibility(8);
        this.mPopup.dismiss();
    }

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

    @Override
    public void loginFail(String str) {
        stopProgress();
        if (getString(R.string.login16).equals(str)) {
            this.tvNotips.setText(str);
        } else {
            oz5.m35335(this, str);
        }
        this.tv_ok.setClickable(true);
    }

    @Override
    public void loginFiveFail() {
        stopProgress();
        View$OnClickListenerC1406.m8743(this.ll_login).m8756(R.mipmap.img_common_dialog_vm).m8761(getString(R.string.login12)).m8746(getString(R.string.login13), getString(R.string.login14), new View$OnClickListenerC1406.AbstractC1408() {
            @Override
            public void onNegativeBtnClick(View$OnClickListenerC1406 view$OnClickListenerC1406) {
                view$OnClickListenerC1406.m8768();
            }

            @Override
            public void onPositiveBtnClick(View$OnClickListenerC1406 view$OnClickListenerC1406) {
                LoginActivity.this.startActivity(new Intent(LoginActivity.this, UpdatePwdActivity.class));
                view$OnClickListenerC1406.m8768();
            }
        }).m8757();
        this.tv_ok.setClickable(true);
    }

    @Override
    public void loginSuccess(UserBean userBean) {
        stopProgress();
        reportUmengEvent(xy.f41630);
        TrackUtils.m14949(uj4.f36654);
        t86.m42946(this, userBean.getMobilePhone(), this.editPwd.getText().toString().trim());
        C7666.m56585();
        setResult(-1);
        finish();
        dc6.f13598.m16936().encode(w14.f38950, false);
        postLoginSuccessEventAction();
    }

    @Override
    public void loginUserNoFail(String str) {
        stopProgress();
        this.tv_ok.setClickable(true);
        this.tvNotips.setText(str);
    }

    @Override
    public void loginUserPwdFail(String str) {
        stopProgress();
        this.tvPwdtips.setText(str);
        this.tv_ok.setClickable(true);
    }

    @Override
    public void moredeviceLogin(String str) {
        stopProgress();
        View$OnClickListenerC1406.m8743(this.ll_login).m8756(R.mipmap.img_common_dialog_vm).m8761(str).m8752(getString(R.string.login15), new View$OnClickListenerC1406.InterfaceC1410() {
            @Override
            public void onPositiveBtnClick(View$OnClickListenerC1406 view$OnClickListenerC1406) {
                view$OnClickListenerC1406.m8768();
            }
        }).m8757();
        this.tv_ok.setClickable(true);
    }

    @Override
    public void onActivityResult(int i, int i2, @Nullable Intent intent) {
        super.onActivityResult(i, i2, intent);
        if (i == 101 && i2 == -1) {
            Intent intent2 = new Intent();
            intent2.putExtra(EXTRA, this.mExtra);
            setResult(-1, intent2);
            finish();
        }
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.iv_clear:
                this.editPhone.setText("");
                this.tvNotips.setText("");
                return;
            case R.id.iv_clearpwd:
                this.editPwd.setText("");
                this.tvPwdtips.setText("");
                return;
            case R.id.iv_down:
                initPopup();
                int[] iArr = new int[2];
                this.editPhone.getLocationOnScreen(iArr);
                this.mPopup.showAtLocation(view, 0, iArr[0], iArr[1] + this.editPhone.getHeight() + ey4.m19869(2));
                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;
                } else if (this.chooseFlag) {
                    this.editPwd.setText("");
                    return;
                } else {
                    this.ivShowpwd.setBackgroundResource(R.mipmap.secret_pwd);
                    this.secretPwd = false;
                    this.editPwd.setInputType(144);
                    return;
                }
            case R.id.iv_wechat_login:
                if (showPleaseCheckProtocolToast()) {
                    return;
                }
                reportUmengEvent(xy.f41631);
                TrackUtils.m14949("104-3-1");
                ((LoginContract.Presenter) this.mPresenter).loginWithWeChat();
                return;
            case R.id.ll_close:
                setResult(0);
                finish();
                return;
            case R.id.tv_forgetpwd:
                this.tv_forgetpwd.setClickable(false);
                jumpToUpdatePwdPage();
                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_ok:
                if (showPleaseCheckProtocolToast()) {
                    return;
                }
                EditText editText = this.editPhone;
                if (editText != null && !TextUtils.isEmpty(editText.getText().toString()) && this.editPhone.getText().toString().trim().length() != 11) {
                    this.tvNotips.setText(getString(R.string.login9));
                    return;
                }
                EditText editText2 = this.editPwd;
                if (editText2 != null && editText2.getText().toString().trim().length() < 6) {
                    this.tvPwdtips.setText(getString(R.string.login19));
                    return;
                }
                EditText editText3 = this.editPwd;
                if (editText3 != null && !TextUtils.isEmpty(editText3.getText().toString()) && !av3.m2269(this.editPwd.getText().toString().trim())) {
                    this.tvPwdtips.setText(getString(R.string.login11));
                    return;
                } else if (!xb3.m49950(r83.f32021)) {
                    oz5.m35335(this, getString(R.string.network_error_hint));
                    return;
                } else {
                    this.tv_ok.setClickable(false);
                    if (this.mPresenter != 0) {
                        UserBean userBean = new UserBean();
                        userBean.setMobilePhone(this.editPhone.getText().toString().trim());
                        userBean.setPassword(this.editPwd.getText().toString().trim());
                        userBean.setPhoneBrand(Build.BRAND);
                        userBean.setPhoneModel(Build.MODEL);
                        userBean.setSystemVersion(Build.VERSION.RELEASE);
                        startProgress();
                        reportUmengEvent(xy.f41629);
                        TrackUtils.m14949(uj4.f36751);
                        ((LoginContract.Presenter) this.mPresenter).loginUser(userBean);
                        return;
                    }
                    return;
                }
            case R.id.tv_register:
                this.tv_register.setClickable(false);
                jumpToRegisterPage();
                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) {
        m41.m30681().m30687(this);
        super.onCreate(bundle);
        reportUmengEvent(xy.f41628);
        TrackUtils.m14949(uj4.f36740);
        fq fqVar = (fq) m41.m30681().m30684(fq.class);
        if (fqVar != null) {
            m41.m30681().m30690(fqVar);
        }
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        m41.m30681().m30692(this);
    }

    @Override
    public void onResume() {
        super.onResume();
        this.tv_ok.setClickable(true);
        this.tv_register.setClickable(true);
        this.tv_forgetpwd.setClickable(true);
        if (this.requestedWxLogin) {
            stopProgress();
        }
    }

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

    @Override
    public void requestedWxLogin() {
        this.requestedWxLogin = true;
    }

    @Override
    public void setUp() {
        Log.e(TAG, "loginactivity setUp");
        ey4.m19871(getWindow(), true, false);
        this.mExtra = getIntent().getStringExtra(EXTRA);
        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);
        this.tv_forgetpwd = (TextView) findViewById(R.id.tv_forgetpwd);
        TextView textView = (TextView) findViewById(R.id.tv_register);
        this.tv_register = textView;
        textView.setOnClickListener(this);
        this.tv_forgetpwd.setOnClickListener(this);
        this.tv_ok = (TextView) findViewById(R.id.tv_ok);
        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.ll_login = (LinearLayout) findViewById(R.id.ll_login);
        this.tv_terms_of_service = (TextView) findViewById(R.id.tv_terms_of_service);
        this.cbAgree = (CheckBox) findViewById(R.id.cb_agree);
        this.tv_login_reigster_privacy_policy = (TextView) findViewById(R.id.tv_login_reigster_privacy_policy);
        this.editPhone.requestFocus();
        this.tv_ok.setClickable(false);
        this.editPhone.addTextChangedListener(new j40() {
            @Override
            public void afterTextChanged(Editable editable) {
                EditText editText;
                if (editable != null && !TextUtils.isEmpty(editable.toString())) {
                    LoginActivity.this.ivClear.setVisibility(0);
                } else {
                    LoginActivity.this.ivClear.setVisibility(8);
                    LoginActivity.this.tvNotips.setText("");
                }
                if (editable == null || TextUtils.isEmpty(editable.toString()) || (editText = LoginActivity.this.editPwd) == null || TextUtils.isEmpty(editText.getText().toString()) || editable.toString().trim().length() != 11) {
                    LoginActivity.this.tv_ok.setClickable(false);
                    LoginActivity.this.tv_ok.setBackgroundResource(R.drawable.btn_operator_normal);
                } else {
                    LoginActivity.this.tv_ok.setClickable(true);
                    LoginActivity.this.tv_ok.setBackgroundResource(R.drawable.btn_select_bg);
                }
                LoginActivity.this.tvNotips.setText("");
                if (TextUtils.isEmpty(LoginActivity.this.username) || LoginActivity.this.username.equals(LoginActivity.this.editPhone.getText().toString().trim())) {
                    return;
                }
                LoginActivity.this.editPwd.setText("");
            }
        });
        this.editPwd.addTextChangedListener(new j40() {
            @Override
            public void afterTextChanged(Editable editable) {
                EditText editText;
                if (editable != null && !TextUtils.isEmpty(editable.toString())) {
                    LoginActivity.this.ivClearpwd.setVisibility(0);
                    LoginActivity.this.ivShowpwd.setVisibility(0);
                } else {
                    LoginActivity.this.ivClearpwd.setVisibility(8);
                    LoginActivity.this.ivShowpwd.setVisibility(8);
                }
                if (editable == null || TextUtils.isEmpty(editable.toString()) || (editText = LoginActivity.this.editPhone) == null || TextUtils.isEmpty(editText.getText().toString()) || LoginActivity.this.editPhone.getText().toString().trim().length() != 11) {
                    LoginActivity.this.tv_ok.setClickable(false);
                    LoginActivity.this.tv_ok.setBackgroundResource(R.drawable.btn_operator_normal);
                } else {
                    LoginActivity.this.tv_ok.setClickable(true);
                    LoginActivity.this.tv_ok.setBackgroundResource(R.drawable.btn_select_bg);
                }
                LoginActivity.this.tvPwdtips.setText("");
                if (TextUtils.isEmpty(LoginActivity.this.pwd) || LoginActivity.this.pwd.equals(LoginActivity.this.editPwd.getText().toString().trim())) {
                    return;
                }
                LoginActivity.this.chooseFlag = false;
            }
        });
        this.tv_ok.setOnClickListener(this);
        this.ivClear.setOnClickListener(this);
        this.ivClearpwd.setOnClickListener(this);
        this.ivShowpwd.setOnClickListener(this);
        this.ivDown.setOnClickListener(this);
        this.tv_terms_of_service.setOnClickListener(this);
        this.tv_login_reigster_privacy_policy.setOnClickListener(this);
        List<UserPwdBean> m42941 = t86.m42941(this);
        this.userList = m42941;
        if (m42941 != null && m42941.size() > 0) {
            this.ivDown.setVisibility(0);
        } else {
            this.ivDown.setVisibility(8);
        }
        ImageView imageView = (ImageView) findViewById(R.id.iv_wechat_login);
        this.ivWeChatLogin = imageView;
        imageView.setOnClickListener(this);
        ((LoginContract.Presenter) this.mPresenter).regToWx();
        List<UserPwdBean> list = this.userList;
        if (list != null && list.size() > 0 && !dc6.f13598.m16936().decodeBool(w14.f38950, false)) {
            m41.m30681().m30683(new fq(this.userList.get(0)));
        }
        if (dc6.f13598.m16936().decodeBool(w14.f38950, false)) {
            new Handler().postDelayed(new Runnable() {
                @Override
                public void run() {
                    try {
                        LoginActivity loginActivity = LoginActivity.this;
                        loginActivity.showWxHintPop(loginActivity.ivWeChatLogin);
                    } catch (Exception unused) {
                    }
                }
            }, 1000L);
        }
    }

    @Override
    public void startProgress() {
        showCommonLoadingDialog(getString(R.string.please_later));
    }

    @Override
    public void wxLoginFailure(String str) {
        ToastUtils.m6434(getString(R.string.login17) + str);
        C7305.m55293().m55299().post(new Runnable() {
            @Override
            public void run() {
                LoginActivity.this.stopProgress();
            }
        });
    }

    @Override
    public void wxLoginSuccess() {
        reportUmengEvent(xy.f41633);
        TrackUtils.m14949("104-3-2");
        C7666.m56585();
        stopProgress();
        if (jp5.m27402(AccountHelper.get().getUserConf().getMobilePhone())) {
            Intent intent = new Intent(this, BindPhoneInputActivity.class);
            intent.putExtra("action.type", 3);
            startActivity(intent);
        }
        setResult(-1);
        finish();
        dc6.f13598.m16936().encode(w14.f38950, true);
        postLoginSuccessEventAction();
    }

    @Override
    public LoginContract.Presenter createPresenter() {
        return new LoginPresenter();
    }
}