工作空间 v3.6.5.2版本的 MD5 值为:58e65af156c65a63bf64ed2e64960853
以下内容为反编译后的 LoginFragment.java 源代码,内容仅作参考
package com.uusafe.login.ui.fragment.login;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.NotificationManager;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.annotation.CallSuper;
import androidx.annotation.MainThread;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.lifecycle.Lifecycle;
import com.uusafe.base.modulesdk.module.ApnModule;
import com.uusafe.base.modulesdk.module.BindTelEvent;
import com.uusafe.base.modulesdk.module.GeetestModule;
import com.uusafe.base.modulesdk.module.ZhugeModule;
import com.uusafe.base.modulesdk.module.activity.ActivityLifeController;
import com.uusafe.base.modulesdk.module.bean.BaseBundleInfo;
import com.uusafe.base.modulesdk.module.bean.GoVPNLoginParams;
import com.uusafe.base.modulesdk.module.bean.LanguageSettingModuleInfo;
import com.uusafe.base.modulesdk.module.bean.LoginBean;
import com.uusafe.base.modulesdk.module.bean.LoginResponseBean;
import com.uusafe.base.modulesdk.module.bean.ScanSettingInfo;
import com.uusafe.base.modulesdk.module.bean.UserInfo;
import com.uusafe.base.modulesdk.module.event.DecodeResultType;
import com.uusafe.base.modulesdk.module.event.ForgetPwdFinishEvent;
import com.uusafe.base.modulesdk.module.event.ScanDecodeEvent;
import com.uusafe.base.modulesdk.module.event.VpnLoginResourceRequestEvent;
import com.uusafe.base.modulesdk.module.global.CommGlobal;
import com.uusafe.base.modulesdk.module.listener.GeetestListener;
import com.uusafe.base.modulesdk.module.listener.SyncServerListener;
import com.uusafe.base.modulesdk.module.manager.BaseModuleManager;
import com.uusafe.base.modulesdk.module.manager.LoginInternalPluginModuleManager;
import com.uusafe.base.modulesdk.module.netapi.BaseApis;
import com.uusafe.base.modulesdk.module.router.ARouterConfig;
import com.uusafe.base.modulesdk.module.utils.NetworkUtils;
import com.uusafe.commbase.bundleinfo.ForgetPwdModuleInfo;
import com.uusafe.commbase.global.BaseGlobal;
import com.uusafe.countrycode.bean.Country;
import com.uusafe.countrycode.ui.activity.SelectCountryCodeActivity;
import com.uusafe.data.module.event.EventFactory;
import com.uusafe.data.module.presenter.login.bean.getVerifyCodeBean;
import com.uusafe.emm.policy.PolicyProtocol;
import com.uusafe.h5app.library.internal.res.H5Lan;
import com.uusafe.jsbridge.module.ModuleManager;
import com.uusafe.login.impl.login.LoginPresenterImpl;
import com.uusafe.login.plugin.api.bean.LoginInternalPluginEvent;
import com.uusafe.login.plugin.api.bean.LoginParams;
import com.uusafe.login.receiver.MagReceiver;
import com.uusafe.login.ui.fragment.login.helper.MbsLoginBottomHelper;
import com.uusafe.login.ui.fragment.login.helper.MbsLoginCheckCodeHelper;
import com.uusafe.login.ui.fragment.login.helper.MbsLoginCompanyHelper;
import com.uusafe.login.ui.fragment.login.helper.MbsLoginPassWordHelper;
import com.uusafe.login.ui.fragment.login.helper.MbsLoginSmsCodeHelper;
import com.uusafe.login.ui.fragment.login.helper.MbsLoginTelHelper;
import com.uusafe.login.ui.fragment.login.helper.MbsLoginUserHelper;
import com.uusafe.login.ui.fragment.login.helper.MbsSmsLoginCheckCodeHelper;
import com.uusafe.mbs.mbslogin.R;
import com.uusafe.net.NetApp;
import com.uusafe.net.NetClient;
import com.uusafe.net.https.SSLHelper;
import com.uusafe.net.reqmanager.BaseResponseMsg;
import com.uusafe.net.reqmanager.bean.BaseResponseInfo;
import com.uusafe.permission.AfterPermissionGranted;
import com.uusafe.plugin.justice.IJusticePlugin;
import com.uusafe.uibase.dialog.CommonDialog;
import com.uusafe.uibase.event.StartFragmentEvent;
import com.uusafe.uibase.fragment.mvp.BaseMvpFragment;
import com.uusafe.uibase.listener.CustomClickListener;
import com.uusafe.uibase.manager.OpenWinManager;
import com.uusafe.uibase.utils.ApnUtils;
import com.uusafe.uibase.view.LicenseItemLayout;
import com.uusafe.uibase.view.SecureEditText;
import com.uusafe.utils.common.DeviceUtils;
import com.uusafe.utils.common.FastDoubleClickUtil;
import com.uusafe.utils.common.JsonUtil;
import com.uusafe.utils.common.NativeUtil;
import com.uusafe.utils.common.PreferenceUtils;
import com.uusafe.utils.common.RegexUtil;
import com.uusafe.utils.common.StringUtils;
import com.uusafe.utils.common.UUSafeMbsUtil;
import com.uusafe.utils.common.UiUtils;
import com.uusafe.utils.common.ZZLog;
import com.zhizhangyi.mbs.settingplugin.api.EdnConfig;
import com.zhizhangyi.platform.common.thread.Scheduler;
import com.zhizhangyi.platform.mbsframe.MbsContext;
import org.greenrobot.eventbus.ThreadMode;
import org.greenrobot.eventbus.e;
import org.greenrobot.eventbus.n;
import org.json.JSONObject;
public class LoginFragment extends BaseMvpFragment implements ILoginView, TextWatcher {
public static final String TAG = "LoginFragment";
private TextView apnButton;
private ImageView backImageView;
private int codeErrorCount;
private TextView customHintButton;
FrameLayout frameLayout;
private TextView languageButton;
String loginModel;
private ImageView logoIv;
private String mCheckCode;
public LoginPresenterImpl mLoginPresenterImpl;
private String mPwdStr;
private String mUserNameStr;
private TextView registerButton;
private int retryTimes;
private RelativeLayout rootRelativeLayout;
private String smsCode;
private String telNumber;
private LinearLayout userItemLinearLayout;
public int loginType = 0;
private boolean scanLogin = false;
private String mdmType = String.valueOf(0);
private String qrCode = "";
private String countryCode = "+86";
private boolean showCheckCode = false;
CustomClickListener goRegisterListener = new CustomClickListener() {
@Override
protected void onFastClick() {
}
@Override
protected void onSingleClick() {
LoginFragment.this.goRegister();
}
};
CommonDialog mDialog = null;
static int access$308(LoginFragment loginFragment) {
int i = loginFragment.retryTimes;
loginFragment.retryTimes = i + 1;
return i;
}
private boolean checkCode() {
if (this.showCheckCode) {
return StringUtils.areNotEmpty(this.mCheckCode) && this.showCheckCode;
}
return true;
}
private void getVerifyCodeBySmsLogin() {
EdnConfig.Lfcb lfcb;
if (this.loginType == 1 && CommGlobal.loginwithcaptcha) {
this.mLoginPresenterImpl.getVerifyCodeBySmsLogin(this.mActivity);
return;
}
EdnConfig.Project project = CommGlobal.ednConfig.project;
if (project == null || (lfcb = project.lfcb) == null || !lfcb.enable) {
return;
}
this.mLoginPresenterImpl.getVerifyCodeBySmsLogin(this.mActivity);
}
private void goForgetPwd(int i) {
ForgetPwdModuleInfo forgetPwdModuleInfo = new ForgetPwdModuleInfo();
forgetPwdModuleInfo.setmType(i);
forgetPwdModuleInfo.setCompanyCode(MbsLoginCompanyHelper.getInstance().getCompanyCodeStr());
OpenWinManager.startActivityRouterPath(this.mActivity, ARouterConfig.RouterPath.UUSAFE_FEATURE_MBSLOGIN_FORGETPWD_ACTIVITY, forgetPwdModuleInfo, ARouterConfig.OpenTarget._BLANK, -1);
}
public void goRegister() {
if (!TextUtils.isEmpty(PreferenceUtils.getServerUrl(this.mActivity, BaseGlobal.getMosKey())) && !TextUtils.isEmpty(PreferenceUtils.getCompanyCode(this.mActivity, BaseGlobal.getMosKey()))) {
ModuleManager.getInstance();
BaseBundleInfo baseBundleInfo = new BaseBundleInfo();
JSONObject jSONObject = new JSONObject();
JsonUtil.putInt(jSONObject, "hiddentitlebutton", 1);
JsonUtil.putString(jSONObject, "url", CommGlobal.registerUrl);
baseBundleInfo.param = jSONObject.toString();
OpenWinManager.startActivityRouterPath(this.mActivity, ARouterConfig.RouterPath.UUSAFE_BIZ_H5_WEB_ACTIVITY, baseBundleInfo, ARouterConfig.OpenTarget._BLANK, -1);
return;
}
showToast(R.string.uu_base_msg_no_config);
}
private void goScanApnLogin() {
String companyCode = PreferenceUtils.getCompanyCode(this.mActivity, BaseGlobal.getMosKey());
LoginParams loginParams = new LoginParams();
loginParams.setLoginName("");
loginParams.setLoginPass("");
loginParams.setOrgCode(companyCode);
loginParams.setLoginType(4);
loginParams.setMdmType("1");
loginParams.setIdentifyCode("");
loginParams.setAutoLogin(true);
loginParams.setSDK(false);
loginParams.setErrTips(false);
loginParams.setSingleRequest(true);
loginParams.setErrTips(this.retryTimes == 5);
this.mLoginPresenterImpl.loginReq(this.mActivity, loginParams);
}
private void goToSelectCountryCode() {
startActivityForResult(new Intent(this.mActivity, SelectCountryCodeActivity.class), 1003);
}
private void goTwoFactorLogin(Context context, String str, int i, String str2, String str3, boolean z, String str4, String str5) {
String encodeMbsData;
this.scanLogin = false;
if (StringUtils.areNotEmpty(str5)) {
encodeMbsData = UUSafeMbsUtil.encodeMbsData(str5, NetClient.MBSKEY, NetClient.MBSIV);
} else {
encodeMbsData = UUSafeMbsUtil.encodeMbsData(this.mPwdStr, NetClient.MBSKEY, NetClient.MBSIV);
}
LoginParams loginParams = new LoginParams();
loginParams.setLoginName(str2);
loginParams.setLoginPass(encodeMbsData);
loginParams.setOrgCode(MbsLoginCompanyHelper.getInstance().getCompanyCodeStr());
loginParams.setLoginType(i);
loginParams.setMdmType(this.mdmType);
loginParams.setCountryPhoneCode(str4);
if (StringUtils.areNotEmpty(str3)) {
loginParams.setUid(str3);
}
loginParams.setFirstLogin(z);
loginParams.setIdentifyCode(str);
loginParams.setAutoLogin(false);
loginParams.setSDK(false);
loginParams.setVerifyCode(this.mCheckCode);
loginRequest(context, loginParams);
}
public void justiceLogin(boolean z) {
IJusticePlugin iJusticePlugin = (IJusticePlugin) MbsContext.getGlobalMbsContext().getPlugin(IJusticePlugin.class);
if (iJusticePlugin == null || !iJusticePlugin.isPMOS()) {
return;
}
if (z) {
if (iJusticePlugin.setCurrentAPN(BaseModuleManager.getInstance().getLoginModule().getApnMap())) {
goScanApnLogin();
return;
} else {
showToast(R.string.uu_login_check_apn);
return;
}
}
goScanApnLogin();
}
public static LoginFragment newInstance() {
Bundle bundle = new Bundle();
LoginFragment loginFragment = new LoginFragment();
loginFragment.setArguments(bundle);
return loginFragment;
}
private void refreshVerifyCodeImage(final String str) {
this.mActivity.runOnUiThread(new Runnable() {
@Override
public void run() {
if (LoginFragment.this.loginType != 1 || !CommGlobal.loginwithcaptcha) {
LoginFragment.this.showCheckCode = true;
MbsLoginCheckCodeHelper.getInstance().restoreView("");
MbsLoginCheckCodeHelper.getInstance().showCheckCode(LoginFragment.this);
MbsLoginCheckCodeHelper.getInstance().setVerifyCodeImg(str);
} else {
MbsSmsLoginCheckCodeHelper.getInstance().restoreView("");
MbsSmsLoginCheckCodeHelper.getInstance().showCheckCode(LoginFragment.this);
MbsSmsLoginCheckCodeHelper.getInstance().setVerifyCodeImg(str);
}
LoginFragment.this.setLoginButtonEnable();
}
});
}
private void releaseCamera() {
if (BaseModuleManager.getInstance().getEmmModule() != null) {
BaseModuleManager.getInstance().getEmmModule().releaseCamera();
}
}
private void setEditTextFocus() {
MbsLoginUserHelper.getInstance().setEditTextFocus(this.loginType, this.mUserNameStr);
MbsLoginPassWordHelper.getInstance().setEditTextFocus(this.loginType, this.mPwdStr);
MbsLoginSmsCodeHelper.getInstance().setEditTextFocus(this.loginType, this.telNumber);
MbsLoginTelHelper.getInstance().setEditTextFocus(this.loginType, this.telNumber);
}
public void setLoginButtonEnable() {
MbsLoginBottomHelper.getInstance().setLoginButtonEnable(this);
}
private void smsLogin(UserInfo userInfo) {
if (!RegexUtil.checkCellPhone(this.telNumber)) {
showToast(R.string.uu_mos_msg_mobile_err);
return;
}
String encodeMbsData = UUSafeMbsUtil.encodeMbsData(this.smsCode, NetClient.MBSKEY, NetClient.MBSIV);
LoginParams loginParams = new LoginParams();
loginParams.setLoginName(this.telNumber);
loginParams.setLoginPass(encodeMbsData);
loginParams.setOrgCode(MbsLoginCompanyHelper.getInstance().getCompanyCodeStr());
loginParams.setLoginType(this.loginType);
loginParams.setMdmType(this.mdmType);
loginParams.setIdentifyCode("");
loginParams.setAutoLogin(false);
if (userInfo != null) {
loginParams.setUid(String.valueOf(userInfo.getUserId()));
}
loginParams.setSDK(false);
if (StringUtils.areNotEmpty(this.countryCode)) {
loginParams.setCountryPhoneCode(this.countryCode);
}
loginParams.setVerifyCode(this.mCheckCode);
loginRequest(this.mActivity, loginParams);
}
private void startGeetest() {
ZZLog.f(TAG, "geetest enabled", new Object[0]);
GeetestModule geetestModule = BaseModuleManager.getInstance().getGeetestModule();
if (geetestModule != null) {
ZZLog.f(TAG, "geetestModule initCaptcha", new Object[0]);
geetestModule.initCaptcha(this.mActivity);
int userLanguage = PreferenceUtils.getUserLanguage(this.mActivity);
String str = userLanguage == 0 ? "zh" : userLanguage == 1 ? H5Lan.H5_ENGLISH : userLanguage == 2 ? "zh-tw" : null;
ZZLog.f(TAG, "geetestModule startGeetest", new Object[0]);
geetestModule.startGeetest(this.mActivity, str, new GeetestListener() {
@Override
public void onFailure(int i, String str2) {
ZZLog.f(LoginFragment.TAG, "geetestModule startGeetest onFailure", new Object[0]);
LoginResponseBean loginResponseBean = new LoginResponseBean();
loginResponseBean.setResultCode(i);
loginResponseBean.setMessage(str2);
LoginFragment.this.onLoginError(loginResponseBean);
}
@Override
public void onSuccess(Object obj) {
ZZLog.f(LoginFragment.TAG, "geetestModule startGeetest onSuccess", new Object[0]);
LoginResponseBean loginResponseBean = new LoginResponseBean();
BaseResponseMsg baseResponseMsg = new BaseResponseMsg();
baseResponseMsg.responseInfo = obj;
loginResponseBean.setResponseMsg(baseResponseMsg);
LoginFragment.this.onLoginSuccess(loginResponseBean);
}
});
}
}
private void zhugeIdentify() {
long userId = PreferenceUtils.getUserId(this.mActivity);
JSONObject jSONObject = new JSONObject();
JsonUtil.putString(jSONObject, "name", PreferenceUtils.getLoginName(this.mActivity, BaseGlobal.getMosKey()));
ZhugeModule zhugeModule = BaseModuleManager.getInstance().getZhugeModule();
if (zhugeModule != null) {
AppCompatActivity appCompatActivity = this.mActivity;
zhugeModule.identify(appCompatActivity, userId + "", jSONObject);
}
}
private void zhugeTrack() {
JSONObject jSONObject = new JSONObject();
JsonUtil.putLong(jSONObject, "userId", PreferenceUtils.getUserId(this.mActivity));
JsonUtil.putString(jSONObject, PolicyProtocol.VPN_USERNAME, PreferenceUtils.getLoginName(this.mActivity, BaseGlobal.getMosKey()));
JsonUtil.putString(jSONObject, "deviceId", DeviceUtils.getDeviceId());
JsonUtil.putString(jSONObject, "deviceModel", DeviceUtils.getDeviceModel());
JsonUtil.putString(jSONObject, "os", DeviceUtils.getDevicePlatform());
JsonUtil.putString(jSONObject, "versionName", "3.6.5.2");
ZhugeModule zhugeModule = BaseModuleManager.getInstance().getZhugeModule();
if (zhugeModule != null) {
zhugeModule.track(this.mActivity, "login", jSONObject);
}
}
@Override
public void afterTextChanged(Editable editable) {
}
@Override
public int attachLayoutRes() {
return R.layout.feature_login_activity_login;
}
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
}
public boolean checkInput() {
EdnConfig.Lfcb lfcb;
MbsLoginCompanyHelper.getInstance().checkInput(this.mActivity);
this.mCheckCode = MbsLoginCheckCodeHelper.getInstance().checkInput();
EdnConfig.Project project = CommGlobal.ednConfig.project;
if (project != null && (lfcb = project.lfcb) != null && lfcb.enable) {
this.mUserNameStr = MbsLoginUserHelper.getInstance().checkInput(this.loginType);
this.mPwdStr = MbsLoginPassWordHelper.getInstance().checkInput(this.loginType);
return (TextUtils.isEmpty(MbsLoginCompanyHelper.getInstance().getCompanyCodeStr()) || TextUtils.isEmpty(this.mUserNameStr) || TextUtils.isEmpty(this.mPwdStr) || !checkCode()) ? false : true;
}
int i = this.loginType;
if (i == 0) {
this.mUserNameStr = MbsLoginUserHelper.getInstance().checkInput(this.loginType);
this.mPwdStr = MbsLoginPassWordHelper.getInstance().checkInput(this.loginType);
return (TextUtils.isEmpty(MbsLoginCompanyHelper.getInstance().getCompanyCodeStr()) || TextUtils.isEmpty(this.mUserNameStr) || TextUtils.isEmpty(this.mPwdStr) || !checkCode()) ? false : true;
} else if (i == 1) {
this.telNumber = MbsLoginTelHelper.getInstance().checkInput(this.loginType);
this.smsCode = MbsLoginSmsCodeHelper.getInstance().checkInput(this.loginType);
if (!CommGlobal.loginwithcaptcha) {
return (TextUtils.isEmpty(MbsLoginCompanyHelper.getInstance().getCompanyCodeStr()) || TextUtils.isEmpty(this.telNumber) || TextUtils.isEmpty(this.smsCode)) ? false : true;
}
this.mCheckCode = MbsSmsLoginCheckCodeHelper.getInstance().checkInput();
return (TextUtils.isEmpty(MbsLoginCompanyHelper.getInstance().getCompanyCodeStr()) || TextUtils.isEmpty(this.telNumber) || TextUtils.isEmpty(this.smsCode) || TextUtils.isEmpty(this.mCheckCode)) ? false : true;
} else if (i != 2 && i != 6 && i != 9) {
this.mUserNameStr = MbsLoginUserHelper.getInstance().checkInput(this.loginType);
this.mPwdStr = MbsLoginPassWordHelper.getInstance().checkInput(this.loginType);
this.telNumber = MbsLoginTelHelper.getInstance().checkInput(this.loginType);
this.smsCode = MbsLoginSmsCodeHelper.getInstance().checkInput(this.loginType);
if (!TextUtils.isEmpty(MbsLoginCompanyHelper.getInstance().getCompanyCodeStr()) && !TextUtils.isEmpty(this.mUserNameStr) && !TextUtils.isEmpty(this.mPwdStr)) {
this.loginType = 0;
return true;
} else if (TextUtils.isEmpty(MbsLoginCompanyHelper.getInstance().getCompanyCodeStr()) || TextUtils.isEmpty(this.telNumber) || TextUtils.isEmpty(this.smsCode)) {
return false;
} else {
this.loginType = 1;
return true;
}
} else {
this.mUserNameStr = MbsLoginUserHelper.getInstance().checkInput(this.loginType);
this.mPwdStr = MbsLoginPassWordHelper.getInstance().checkInput(this.loginType);
return (TextUtils.isEmpty(MbsLoginCompanyHelper.getInstance().getCompanyCodeStr()) || TextUtils.isEmpty(this.mUserNameStr) || TextUtils.isEmpty(this.mPwdStr) || !checkCode()) ? false : true;
}
}
void checkRootCert(final Context context) {
if (!NetApp.checkrootcertenable || SSLHelper.checkRootCertInstalled(context, "rootCert")) {
return;
}
CommonDialog.Builder builder = new CommonDialog.Builder(this.mActivity);
builder.setTitleShow(false);
builder.setCancelable(false);
builder.setMessage(getString(R.string.uu_mbs_root_norootcert));
builder.setPositiveListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
try {
NativeUtil.browser(context, NetApp.checkrootcertdownloadcerturl);
} catch (Exception e2) {
e2.printStackTrace();
}
LoginFragment.this.mDialog.dismiss();
}
});
builder.setNegativeListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
LoginFragment.this.mDialog.dismiss();
}
});
this.mDialog = builder.create();
this.mDialog.show();
}
@Override
public void closeWindow() {
if (StringUtils.areNotEmpty(this.loginModel) && this.loginModel.equals(CommGlobal.LoginModel.MODEL_USERNAME_LOGIN.getLoginModel())) {
OpenWinManager.startActivityRouterPath(this.mActivity, ARouterConfig.RouterPath.UUSAFE_FEATURE_MBSLOGIN_SELECT_LOGINMODULE_ACTIVITY, null, ARouterConfig.OpenTarget._SELF, -1);
} else {
this.mActivity.finish();
}
}
public void completedParseScanMessage(ScanSettingInfo scanSettingInfo) {
MbsLoginCompanyHelper.getInstance().onMessageEventMainThread(this);
String userMdmType = PreferenceUtils.getUserMdmType(this.mActivity, BaseGlobal.getMosKey());
if (StringUtils.areNotEmpty(userMdmType)) {
this.mdmType = userMdmType;
}
String qRCode = PreferenceUtils.getQRCode(this.mActivity, BaseGlobal.getMosKey());
setLoginButtonEnable();
if (StringUtils.areNotEmpty(qRCode)) {
if (scanSettingInfo != null) {
String loginName = scanSettingInfo.getLoginName();
ZZLog.d(TAG, "completedParseScanMessage loginName =" + loginName, new Object[0]);
if (StringUtils.areNotEmpty(loginName)) {
this.mUserNameStr = loginName;
MbsLoginUserHelper.getInstance().restoreView(this.mUserNameStr);
} else {
this.mUserNameStr = "";
}
}
this.loginType = 3;
goLogin(qRCode);
} else if (BaseModuleManager.getInstance().getLoginModule().getApnMap() == null || BaseModuleManager.getInstance().getLoginModule().getApnMap().size() <= 0) {
} else {
this.retryTimes = 0;
justiceLogin(true);
}
}
@Override
protected String getPageName() {
return getString(R.string.uu_mbs_uaa_page_login);
}
public void goLogin(String str) {
releaseCamera();
if (CommGlobal.sangforVpnOption == CommGlobal.SangforVpnOption.MODEL_LADP) {
GoVPNLoginParams goVPNLoginParams = new GoVPNLoginParams();
goVPNLoginParams.setLoginSuccess(false);
goVPNLoginParams.setFromType(1);
goVPNLoginParams.setUserName(this.mUserNameStr);
goVPNLoginParams.setUserPassword(this.mPwdStr);
goVPNLoginParams.setSangforvpnUrl(CommGlobal.sangforvpn_url);
BaseModuleManager.getInstance().getSangforVpnModule().goVPNLogin(this.mActivity, goVPNLoginParams);
return;
}
startLogin(str);
}
@AfterPermissionGranted(123)
public void goScan() {
if (BaseModuleManager.getInstance().getEmmModule() != null) {
BaseModuleManager.getInstance().getEmmModule().acquireCamera();
}
BaseBundleInfo baseBundleInfo = new BaseBundleInfo();
baseBundleInfo.param = "loginScan";
OpenWinManager.startActivityRouterPath(this.mActivity, ARouterConfig.RouterPath.UUSAFE_BASE_QRCODE_SCAN_ACTIVITY, baseBundleInfo, ARouterConfig.OpenTarget._BLANK, -1);
}
@Override
public void goToLoginPage() {
super.goToLoginPage();
}
@Override
public void hideProgressBar() {
super.hideProgressBar();
}
@Override
public void initData() {
ZZLog.f(TAG, "initData ===", new Object[0]);
CommGlobal.isInitLoginCallBack = false;
CommGlobal.saveServerUrlAndOrgCode(this.mActivity);
this.loginType = PreferenceUtils.getLoginReqType(this.mActivity);
if (CommGlobal.loginOption == CommGlobal.LoginOption.MODEL_TWO_FACTOR_LOGIN) {
this.loginType = 2;
} else if (CommGlobal.loginOption == CommGlobal.LoginOption.MODEL_SMS_LOGIN) {
this.loginType = 1;
} else if (CommGlobal.enable360SecIdVpn) {
this.loginType = 9;
} else {
int i = this.loginType;
if (i == 3 || i == 4) {
this.loginType = 0;
}
}
PreferenceUtils.setLoginReqType(this.loginType, this.mActivity);
MbsLoginBottomHelper.getInstance().initData();
setLoginButtonEnable();
BaseGlobal.getInstance().finishAppLock();
PreferenceUtils.setLoginStatus("", this.mActivity, BaseGlobal.getMosKey());
MbsLoginCompanyHelper.getInstance().setDefaultValue(this);
this.mUserNameStr = PreferenceUtils.getLoginInputName(this.mActivity, BaseGlobal.getMosKey());
if (StringUtils.isEmpty(this.mUserNameStr)) {
this.mUserNameStr = PreferenceUtils.getLoginName(this.mActivity, BaseGlobal.getMosKey());
}
MbsLoginUserHelper.getInstance().initData(this.mUserNameStr);
this.telNumber = PreferenceUtils.getForgetPwdTelNumber(this.mActivity, BaseGlobal.getMosKey());
MbsLoginTelHelper.getInstance().initData(this.telNumber);
MbsLoginPassWordHelper.getInstance().initData("");
MbsLoginSmsCodeHelper.getInstance().initData(this);
setLoginType();
this.codeErrorCount = PreferenceUtils.getForgetPwdCodeErrorCount(this.mActivity);
ZZLog.i(TAG, "in LoginFragment", new Object[0]);
checkRootCert(getContext());
BaseModuleManager.getInstance().getLoginModule().loadScanSettingInfo(this.mActivity);
if (CommGlobal.userLicenseType == CommGlobal.UserLicenseType.TYPE_LOGIN && "licenseagreement_dynamic".equals(CommGlobal.userAgreementType)) {
MbsLoginBottomHelper.getInstance().requestDynamicUserAgreement();
}
LoginInternalPluginModuleManager.getInstance().initData(new LoginInternalPluginEvent());
}
@Override
protected void initInjector() {
this.mLoginPresenterImpl = new LoginPresenterImpl();
this.mPresenterImpl = this.mLoginPresenterImpl;
}
@Override
@CallSuper
@MainThread
public void initLifecycleObserver(Lifecycle lifecycle) {
this.mLoginPresenterImpl.getPresenter().setLifecycleOwner(this);
lifecycle.addObserver(this.mLoginPresenterImpl.getPresenter());
}
@Override
public void initView(Bundle bundle) {
ApnModule apnModule;
EdnConfig.Lfcb lfcb;
Object obj;
BaseBundleInfo baseBundleInfo = this.mNSBaseBundleInfo;
if (baseBundleInfo != null && (obj = baseBundleInfo.dataObj) != null && (obj instanceof String)) {
this.loginModel = (String) obj;
}
EdnConfig.Project project = CommGlobal.ednConfig.project;
if (project != null && (lfcb = project.lfcb) != null && lfcb.enable) {
this.showCheckCode = true;
}
this.logoIv = (ImageView) findViewById(R.id.uu_mos_imageView);
this.logoIv.setMaxWidth(UiUtils.getRealScreenWidth(this.mActivity));
this.apnButton = (TextView) findViewById(R.id.tv_apn);
if (CommGlobal.apnEnable) {
this.apnButton.setVisibility(0);
if ((NetworkUtils.isApnEnabled(this.mActivity) || NetworkUtils.isWifi(this.mActivity)) && (apnModule = com.uusafe.commbase.module.manager.ModuleManager.getInstance().getApnModule()) != null) {
apnModule.showApnDialog();
}
} else {
this.apnButton.setVisibility(8);
}
this.languageButton = (TextView) findViewById(R.id.uu_mos_tv_language);
if (BaseModuleManager.getInstance().getEmmModule() != null) {
this.languageButton.setText(R.string.uu_mos_appsetting_main_title);
}
this.registerButton = (TextView) findViewById(R.id.uu_mos_login_registration);
this.customHintButton = (TextView) findViewById(R.id.uu_mos_login_custom_hint);
this.backImageView = (ImageView) findViewById(R.id.uu_base_img_back);
this.frameLayout = (FrameLayout) findViewById(R.id.uu_mos_login_first_layout_bg);
if (StringUtils.areNotEmpty(this.loginModel) && this.loginModel.equals(CommGlobal.LoginModel.MODEL_USERNAME_LOGIN.getLoginModel())) {
this.backImageView.setVisibility(0);
} else {
this.backImageView.setVisibility(8);
}
if (StringUtils.areNotEmpty(CommGlobal.registerUrl)) {
this.registerButton.setVisibility(0);
} else {
this.registerButton.setVisibility(8);
}
if (CommGlobal.loginviewbottomtip && StringUtils.areNotEmpty(CommGlobal.loginviewbottomtipstring)) {
this.customHintButton.setVisibility(0);
this.customHintButton.setText(CommGlobal.loginviewbottomtipstring);
} else {
this.customHintButton.setVisibility(8);
}
this.rootRelativeLayout = (RelativeLayout) findViewById(R.id.uu_mos_rl_main);
this.userItemLinearLayout = (LinearLayout) findViewById(R.id.uu_mbs_login_useritem_linearlayout);
MbsLoginCompanyHelper.getInstance().initView(this.mRootView, this, this.userItemLinearLayout, this.mInflater);
MbsLoginBottomHelper.getInstance().initView(this.mRootView, this.mInflater, this.rootRelativeLayout, this, R.id.uu_mbs_login_useritem_linearlayout, false);
MbsLoginUserHelper.getInstance().initView(this.mRootView, this, this.userItemLinearLayout);
MbsLoginTelHelper.getInstance().initView(this.mRootView, this, this.userItemLinearLayout);
if (CommGlobal.loginwithcaptcha) {
MbsSmsLoginCheckCodeHelper.getInstance().initView(this.mRootView, this, this.userItemLinearLayout);
}
MbsLoginPassWordHelper.getInstance().initView(this.mRootView, this, this.userItemLinearLayout);
MbsLoginSmsCodeHelper.getInstance().initView(this.mRootView, this, this.userItemLinearLayout);
MbsLoginCheckCodeHelper.getInstance().initView(this.mRootView, this, this.userItemLinearLayout, this.showCheckCode);
MbsLoginBottomHelper.getInstance().setOnCheckedChangeListener(new LicenseItemLayout.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(boolean z) {
LoginFragment.this.setLoginButtonEnable();
}
});
e.a().e(this);
zhugeTrack();
LoginInternalPluginModuleManager.getInstance().initView(new LoginInternalPluginEvent());
}
public void loginRequest(Context context, LoginParams loginParams) {
LoginPresenterImpl loginPresenterImpl = this.mLoginPresenterImpl;
if (loginPresenterImpl != null) {
loginPresenterImpl.loginReq(context, loginParams);
}
}
@Override
public void onActivityCreated(@Nullable Bundle bundle) {
super.onActivityCreated(bundle);
}
@Override
public void onActivityResult(int i, int i2, @Nullable Intent intent) {
Country fromJson;
if (i2 != -1) {
return;
}
if (i == 1003 && intent != null && (fromJson = Country.fromJson(intent.getStringExtra("country"))) != null) {
this.countryCode = "+" + fromJson.code;
MbsLoginTelHelper.getInstance().setCountryCodeData(this.mActivity, this.countryCode);
}
super.onActivityResult(i, i2, intent);
}
@Override
public void onAppBackground() {
super.onAppBackground();
FrameLayout frameLayout = this.frameLayout;
if (frameLayout != null) {
frameLayout.setVisibility(0);
}
MbsLoginPassWordHelper.getInstance().restoreView("");
}
@Override
public void onAppForeground() {
super.onAppForeground();
FrameLayout frameLayout = this.frameLayout;
if (frameLayout != null) {
frameLayout.setVisibility(8);
}
}
@Override
public void onAttach(Context context) {
super.onAttach(context);
}
@Override
public boolean onBackPressedSupport() {
return super.onBackPressedSupport();
}
@Override
public void onCheckOrgError(String str) {
if (StringUtils.isEmpty(str)) {
str = this.mActivity.getResources().getString(R.string.uu_mos_checkorg_tips);
}
showToast(str);
}
@Override
public void onCheckOrgSuccess(BaseResponseMsg baseResponseMsg) {
}
@Override
public void onClick(View view) {
EdnConfig.Lfcb lfcb;
int id = view.getId();
int i = R.id.uu_mos_id_bt_login;
if (id == i) {
if (FastDoubleClickUtil.isFastDoubleClick(i, 1000L)) {
return;
}
((NotificationManager) CommGlobal.getContext().getSystemService("notification")).cancelAll();
if (CommGlobal.pacasenable) {
startGeetest();
} else {
goLogin("");
}
} else if (view.getId() == R.id.tv_apn) {
ApnUtils.showApnDialog(this.mActivity);
} else if (view.getId() == R.id.uu_mos_tv_language) {
if (BaseModuleManager.getInstance().getEmmModule() != null) {
BaseBundleInfo baseBundleInfo = new BaseBundleInfo();
baseBundleInfo.param = "Login";
BaseModuleManager.getInstance().getMainProcessModule().startActivityRouterPath(this.mActivity, "/feature_appsetting/activity/setting", baseBundleInfo, ARouterConfig.OpenTarget._BLANK, -1);
return;
}
LanguageSettingModuleInfo languageSettingModuleInfo = new LanguageSettingModuleInfo();
languageSettingModuleInfo.setFromType(LanguageSettingModuleInfo.FromType.LOGIN);
OpenWinManager.startActivityRouterPath(this.mActivity, ARouterConfig.RouterPath.UUSAFE_FEATURE_APPSETTING_LANGUAGESETTING_ACTIVITY, languageSettingModuleInfo, ARouterConfig.OpenTarget._BLANK, -1);
} else {
if (R.id.uu_mos_tv_login_forget_pwd == view.getId()) {
if (CommGlobal.passwordOption == CommGlobal.PasswordOption.MODEL_SMS) {
MbsLoginPassWordHelper.getInstance().onClick(view);
String baseUrl = BaseApis.getBaseUrl();
String companyCode = PreferenceUtils.getCompanyCode(this.mActivity, BaseGlobal.getMosKey());
if (StringUtils.areNotEmpty(baseUrl) && StringUtils.areNotEmpty(companyCode)) {
goForgetPwd(1);
} else {
showToast(R.string.uu_mos_forgetpwd_click_tips);
}
} else if (CommGlobal.passwordOption == CommGlobal.PasswordOption.MODEL_THIRD_PARTY_LINK && StringUtils.areNotEmpty(CommGlobal.thirdPartyLinkUrl)) {
BaseBundleInfo baseBundleInfo2 = new BaseBundleInfo();
JSONObject jSONObject = new JSONObject();
JsonUtil.putString(jSONObject, "url", CommGlobal.thirdPartyLinkUrl);
baseBundleInfo2.param = jSONObject.toString();
OpenWinManager.startActivityRouterPath(this.mActivity, ARouterConfig.RouterPath.UUSAFE_BIZ_H5_WEB_ACTIVITY, baseBundleInfo2, ARouterConfig.OpenTarget._BLANK, -1);
} else if (CommGlobal.passwordOption == CommGlobal.PasswordOption.MODEL_POPUP && StringUtils.areNotEmpty(CommGlobal.popupContent)) {
showToast(CommGlobal.popupContent);
}
} else if (R.id.uu_mos_tv_login_type == view.getId()) {
MbsLoginPassWordHelper.getInstance().onClick(view);
this.loginType = this.loginType == 0 ? 1 : 0;
PreferenceUtils.setLoginReqType(this.loginType, this.mActivity);
setLoginType();
setLoginButtonEnable();
} else if (R.id.uu_base_img_back == view.getId()) {
closeWindow();
} else if (CommGlobal.developeroptions && R.id.uu_mos_imageView == view.getId()) {
logoClick();
} else if (R.id.uu_mos_login_registration == view.getId()) {
this.goRegisterListener.onClick(view);
} else if (R.id.uu_mbs_login_tv_countrycode == view.getId()) {
goToSelectCountryCode();
} else if (R.id.uu_mbs_login_useritem_right_code_imageview == view.getId()) {
if (CommGlobal.loginwithcaptcha && this.loginType == 1) {
this.mLoginPresenterImpl.getVerifyCodeBySmsLogin(this.mActivity);
return;
}
EdnConfig.Project project = CommGlobal.ednConfig.project;
if (project != null && (lfcb = project.lfcb) != null && lfcb.enable) {
this.mLoginPresenterImpl.getVerifyCodeBySmsLogin(this.mActivity);
} else {
this.mLoginPresenterImpl.getVerifyCode(this.mActivity);
}
}
}
}
@Override
public void onConfigurationChanged(Configuration configuration) {
super.onConfigurationChanged(configuration);
int i = configuration.orientation;
if (i == 1 || i == 2) {
View currentFocus = this.mActivity.getCurrentFocus();
if (currentFocus instanceof SecureEditText) {
SecureEditText secureEditText = (SecureEditText) currentFocus;
secureEditText.hideSecureKeyboard();
secureEditText.showSecureKeyboard();
Editable text = secureEditText.getText();
if (text != null && text.length() > 0) {
secureEditText.setSelection(text.length());
}
}
if (configuration.orientation == 1) {
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) this.logoIv.getLayoutParams();
layoutParams.topMargin = UiUtils.dp2px(this.mActivity, 110.0f);
layoutParams.bottomMargin = UiUtils.dp2px(this.mActivity, 50.0f);
this.logoIv.setLayoutParams(layoutParams);
RelativeLayout.LayoutParams layoutParams2 = (RelativeLayout.LayoutParams) this.apnButton.getLayoutParams();
layoutParams2.topMargin = UiUtils.dp2px(this.mActivity, 50.0f);
this.apnButton.setLayoutParams(layoutParams2);
RelativeLayout.LayoutParams layoutParams3 = (RelativeLayout.LayoutParams) this.languageButton.getLayoutParams();
layoutParams3.topMargin = UiUtils.dp2px(this.mActivity, 50.0f);
this.languageButton.setLayoutParams(layoutParams3);
}
if (configuration.orientation == 2) {
RelativeLayout.LayoutParams layoutParams4 = (RelativeLayout.LayoutParams) this.logoIv.getLayoutParams();
layoutParams4.topMargin = UiUtils.dp2px(this.mActivity, 70.0f);
layoutParams4.bottomMargin = UiUtils.dp2px(this.mActivity, 20.0f);
this.logoIv.setLayoutParams(layoutParams4);
RelativeLayout.LayoutParams layoutParams5 = (RelativeLayout.LayoutParams) this.apnButton.getLayoutParams();
layoutParams5.topMargin = UiUtils.dp2px(this.mActivity, 30.0f);
this.apnButton.setLayoutParams(layoutParams5);
RelativeLayout.LayoutParams layoutParams6 = (RelativeLayout.LayoutParams) this.languageButton.getLayoutParams();
layoutParams6.topMargin = UiUtils.dp2px(this.mActivity, 30.0f);
this.languageButton.setLayoutParams(layoutParams6);
}
}
}
@Override
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
this.swipeBack = false;
LoginInternalPluginModuleManager.getInstance().onCreateView(new LoginInternalPluginEvent());
return super.onCreateView(layoutInflater, viewGroup, bundle);
}
@Override
public void onDestroy() {
super.onDestroy();
e.a().g(this);
LoginPresenterImpl loginPresenterImpl = this.mLoginPresenterImpl;
if (loginPresenterImpl != null && loginPresenterImpl.getPresenter() != null) {
this.mLoginPresenterImpl.getPresenter().dispose();
}
MagReceiver.unregisterReceiver(this.mActivity);
LoginInternalPluginModuleManager.getInstance().onDestroy(new LoginInternalPluginEvent());
}
@Override
public void onDestroyView() {
super.onDestroyView();
}
@Override
public void onDetach() {
super.onDetach();
}
@n(threadMode = ThreadMode.MAIN)
public void onForgetPwdFinishEvent(ForgetPwdFinishEvent forgetPwdFinishEvent) {
MbsLoginPassWordHelper.getInstance().restoreView("");
}
@Override
public void onGetVerifyCodeError(final String str) {
this.mActivity.runOnUiThread(new Runnable() {
@Override
public void run() {
if (LoginFragment.this.loginType == 1 && CommGlobal.loginwithcaptcha) {
MbsSmsLoginCheckCodeHelper.getInstance().onLoginError(-1, str);
}
}
});
}
@Override
public void onGetVerifyCodeSuccess(BaseResponseInfo baseResponseInfo) {
if (baseResponseInfo != null) {
getVerifyCodeBean getverifycodebean = (getVerifyCodeBean) baseResponseInfo;
if (StringUtils.areNotEmpty(getverifycodebean.getVerifyCodeImg())) {
refreshVerifyCodeImage(getverifycodebean.getVerifyCodeImg());
}
}
}
@Override
public void onHiddenChanged(boolean z) {
super.onHiddenChanged(z);
}
@Override
public void onLoginError(LoginResponseBean loginResponseBean) {
int resultCode = loginResponseBean.getResultCode();
String message = loginResponseBean.getMessage();
if (resultCode == 102 || resultCode == 100) {
MbsLoginPassWordHelper.getInstance().onLoginError(resultCode, message);
}
if (loginResponseBean != null && loginResponseBean.getResponseMsg() != null && loginResponseBean.getResponseMsg().responseInfo != null) {
LoginBean loginBean = (LoginBean) loginResponseBean.getResponseMsg().responseInfo;
if (StringUtils.areNotEmpty(loginBean.getVerifyCodeImg())) {
refreshVerifyCodeImage(loginBean.getVerifyCodeImg());
return;
}
}
if (resultCode == 1001) {
MbsLoginCompanyHelper.getInstance().setDefaultValue(this);
MbsLoginCompanyHelper.getInstance().onLoginError(resultCode, message);
MbsLoginTelHelper.getInstance().onLoginError(resultCode, message);
MbsLoginSmsCodeHelper.getInstance().onLoginError(resultCode, message);
MbsLoginUserHelper.getInstance().onLoginError(resultCode, message);
MbsLoginPassWordHelper.getInstance().onLoginError(resultCode, message);
setLoginButtonEnable();
} else if (resultCode != 1002) {
}
if (this.loginType == 3 || StringUtils.areNotEmpty(this.qrCode)) {
this.loginType = 0;
this.qrCode = "";
this.mdmType = String.valueOf(0);
PreferenceUtils.setUserMdmType(this.mdmType, this.mActivity, BaseGlobal.getMosKey());
PreferenceUtils.setQRCode(this.qrCode, this.mActivity, BaseGlobal.getMosKey());
PreferenceUtils.setLoginReqType(this.loginType, this.mActivity);
}
if (resultCode == -1 && BaseModuleManager.getInstance().getLoginModule().getApnMap() != null && BaseModuleManager.getInstance().getLoginModule().getApnMap().size() > 0) {
if (this.retryTimes >= 5) {
showToast(R.string.uu_mbs_check_server_info);
return;
}
Scheduler.dispatchUI(new Runnable() {
@Override
public void run() {
LoginFragment.access$308(LoginFragment.this);
LoginFragment.this.justiceLogin(false);
}
}, 3000L);
}
getVerifyCodeBySmsLogin();
}
@Override
@SuppressLint({"CheckResult"})
public void onLoginSuccess(LoginResponseBean loginResponseBean) {
Object obj = loginResponseBean.getResponseMsg().responseInfo;
if (obj != null) {
LoginBean loginBean = (LoginBean) obj;
if (StringUtils.areNotEmpty(loginBean.getVerifyCodeImg())) {
refreshVerifyCodeImage(loginBean.getVerifyCodeImg());
return;
}
if (loginBean.getLoginType() == 1) {
this.codeErrorCount = 0;
if (loginBean.getSelectUser() != null) {
smsLogin(loginBean.getSelectUser());
}
}
zhugeIdentify();
}
MbsLoginPassWordHelper.getInstance().clearFocus();
MbsLoginUserHelper.getInstance().clearFocus();
MbsLoginTelHelper.getInstance().clearFocus();
MbsLoginBottomHelper.getInstance().requestFocus();
MbsLoginBottomHelper.getInstance().reset();
}
@n(threadMode = ThreadMode.MAIN)
public void onMessageEventMainThread(VpnLoginResourceRequestEvent vpnLoginResourceRequestEvent) {
if (vpnLoginResourceRequestEvent == null || vpnLoginResourceRequestEvent.getRes() != 0 || CommGlobal.sangforVpnOption == CommGlobal.SangforVpnOption.MODEL_PUBLIC || CommGlobal.sangforVpnOption == CommGlobal.SangforVpnOption.MODEL_PRIVATE || CommGlobal.sangforVpnOption != CommGlobal.SangforVpnOption.MODEL_LADP) {
return;
}
PreferenceUtils.setLoginInputName(this.mUserNameStr, this.mActivity, BaseGlobal.getMosKey());
PreferenceUtils.setLoginInputPwd(this.mPwdStr, this.mActivity, BaseGlobal.getMosKey());
startLogin("");
}
@Override
public void onResume() {
super.onResume();
LoginInternalPluginModuleManager.getInstance().onResume(new LoginInternalPluginEvent());
}
@Override
public void onSendSmsError(String str) {
getVerifyCodeBySmsLogin();
}
@Override
public void onSendSmsSuccess() {
MbsLoginSmsCodeHelper.getInstance().startCountTimer(this);
MbsLoginSmsCodeHelper.getInstance().setEditTextFocus();
this.codeErrorCount = 0;
PreferenceUtils.setForgetPwdCodeErrorCount(0, this.mActivity);
PreferenceUtils.setForgetPwdTelNumber(this.telNumber, this.mActivity, BaseGlobal.getMosKey());
PreferenceUtils.setForgetPwdLastTime(System.currentTimeMillis(), this.mActivity);
}
@Override
public void onSupportInvisible() {
super.onSupportInvisible();
hideSoftInput();
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
setLoginButtonEnable();
MbsLoginPassWordHelper.getInstance().onTextChanged(charSequence, i, i2, i3);
}
public void processBindEvent(BindTelEvent bindTelEvent) {
LoginPresenterImpl loginPresenterImpl;
if (bindTelEvent == null || bindTelEvent.isSign()) {
return;
}
if (bindTelEvent.isTwoFactorLogin()) {
goTwoFactorLogin(ActivityLifeController.currentActivity(), bindTelEvent.getIdentifyCode(), 6, bindTelEvent.getTelNumber(), bindTelEvent.getUserId(), false, bindTelEvent.getCountryPhoneCode(), "");
} else if (!bindTelEvent.isOk() || (loginPresenterImpl = this.mLoginPresenterImpl) == null || loginPresenterImpl.getPresenter() == null) {
} else {
PreferenceUtils.setLoginBindType(0, this.mActivity);
this.mLoginPresenterImpl.getPresenter().startMainActivity(this.mActivity, true, false, new SyncServerListener() {
@Override
public void hideProgressBar() {
LoginFragment.this.hideProgressBar();
}
@Override
public void onFail(int i, String str) {
}
@Override
public void onProgress(int i) {
}
@Override
public void onSuccess(int i) {
}
@Override
public void showProgressBar() {
LoginFragment.this.showProgressBar();
}
}, true);
}
}
@Override
protected void restoreView() {
try {
MbsLoginCompanyHelper.getInstance().restoreView();
MbsLoginTelHelper.getInstance().restoreView(this.telNumber);
MbsLoginSmsCodeHelper.getInstance().restoreView(this.smsCode);
MbsLoginUserHelper.getInstance().restoreView(this.mUserNameStr);
MbsLoginPassWordHelper.getInstance().restoreView(this.mPwdStr);
MbsLoginCheckCodeHelper.getInstance().restoreView("");
if (CommGlobal.loginwithcaptcha) {
MbsSmsLoginCheckCodeHelper.getInstance().restoreView("");
}
setLoginType();
setLoginButtonEnable();
} catch (Throwable th) {
th.printStackTrace();
}
}
public void sendSmsRequest() {
int i;
if (TextUtils.isEmpty(MbsLoginCompanyHelper.getInstance().getCompanyCodeStr())) {
showToast(R.string.uu_base_login_company_code_required);
} else if (TextUtils.isEmpty(this.telNumber)) {
showToast(R.string.uu_base_login_tel_required);
} else if (!RegexUtil.checkCellPhone(this.telNumber)) {
showToast(R.string.uu_base_msg_mobile_err);
} else {
if (CommGlobal.loginwithcaptcha) {
this.mCheckCode = MbsSmsLoginCheckCodeHelper.getInstance().checkInput();
if (TextUtils.isEmpty(this.mCheckCode)) {
showToast(R.string.uu_base_login_verify_code_err);
return;
}
i = 1;
} else {
i = -1;
}
LoginPresenterImpl loginPresenterImpl = this.mLoginPresenterImpl;
if (loginPresenterImpl != null) {
loginPresenterImpl.sendSms(this.telNumber, 3, EventFactory.RequestFromType.LOGIN, this.countryCode, i, this.mCheckCode, null);
}
}
}
@Override
public void setListener() {
this.apnButton.setOnClickListener(this);
this.languageButton.setOnClickListener(this);
this.registerButton.setOnClickListener(this);
this.backImageView.setOnClickListener(this);
this.logoIv.setOnClickListener(this);
MbsLoginCompanyHelper.getInstance().setListener(this);
MbsLoginBottomHelper.getInstance().setListener(this);
MbsLoginSmsCodeHelper.getInstance().setListener(this);
MbsLoginPassWordHelper.getInstance().setListener(this);
MbsLoginUserHelper.getInstance().setListener(this);
MbsLoginTelHelper.getInstance().setListener(this);
MbsLoginCheckCodeHelper.getInstance().setListener(this);
if (CommGlobal.loginwithcaptcha) {
MbsSmsLoginCheckCodeHelper.getInstance().setListener(this);
}
LoginInternalPluginModuleManager.getInstance().setListener(new LoginInternalPluginEvent());
}
protected void setLoginType() {
EdnConfig.Lfcb lfcb;
MbsLoginBottomHelper.getInstance().setLoginType(this.loginType, this);
MbsLoginUserHelper.getInstance().setLoginType(this.loginType);
MbsLoginPassWordHelper.getInstance().setLoginType(this.loginType);
MbsLoginSmsCodeHelper.getInstance().setLoginType(this.loginType);
MbsLoginTelHelper.getInstance().setLoginType(this.loginType);
MbsLoginCheckCodeHelper.getInstance().setLoginType(this.loginType, this.showCheckCode);
if (CommGlobal.loginwithcaptcha) {
MbsSmsLoginCheckCodeHelper.getInstance().setLoginType(this.loginType);
}
setEditTextFocus();
EdnConfig.Project project = CommGlobal.ednConfig.project;
if (project != null && (lfcb = project.lfcb) != null && lfcb.enable) {
this.showCheckCode = true;
} else {
this.showCheckCode = false;
}
getVerifyCodeBySmsLogin();
}
@Override
public void showProgressBar() {
super.showProgressBar();
}
@n
public void startBrother(StartFragmentEvent startFragmentEvent) {
Activity currentActivity = ActivityLifeController.currentActivity();
if (currentActivity == null || currentActivity == this.mActivity) {
if (startFragmentEvent.target == ARouterConfig.OpenTarget._SELF) {
startWithPop(startFragmentEvent.targetFragment);
} else {
start(startFragmentEvent.targetFragment);
}
}
}
public void startLogin(String str) {
int i = this.loginType;
PreferenceUtils.setLoginInputName(this.mUserNameStr, this.mActivity, BaseGlobal.getMosKey());
if (StringUtils.areNotEmpty(str)) {
this.scanLogin = true;
ZZLog.e(TAG, "goLogin qrCode =" + str, new Object[0]);
String encodeMbsData = UUSafeMbsUtil.encodeMbsData(str, NetClient.MBSKEY, NetClient.MBSIV);
LoginParams loginParams = new LoginParams();
loginParams.setLoginName("");
loginParams.setLoginPass(encodeMbsData);
loginParams.setOrgCode(MbsLoginCompanyHelper.getInstance().getCompanyCodeStr());
loginParams.setLoginType(3);
loginParams.setMdmType(this.mdmType);
loginParams.setIdentifyCode("");
loginParams.setAutoLogin(false);
loginParams.setSDK(false);
loginParams.setVerifyCode(this.mCheckCode);
loginRequest(this.mActivity, loginParams);
return;
}
int i2 = this.loginType;
if (i2 == 1) {
this.scanLogin = false;
if (this.codeErrorCount >= 5) {
hideProgressBar();
MbsLoginSmsCodeHelper.getInstance().resetCountTimer(this);
return;
}
smsLogin(null);
} else if (i2 != 2 && i2 != 9 && i2 != 6) {
this.scanLogin = false;
String str2 = this.mUserNameStr;
String encodeMbsData2 = UUSafeMbsUtil.encodeMbsData(this.mPwdStr, NetClient.MBSKEY, NetClient.MBSIV);
LoginParams loginParams2 = new LoginParams();
loginParams2.setLoginName(str2);
loginParams2.setLoginPass(encodeMbsData2);
loginParams2.setOrgCode(MbsLoginCompanyHelper.getInstance().getCompanyCodeStr());
loginParams2.setLoginType(i);
loginParams2.setMdmType(this.mdmType);
loginParams2.setIdentifyCode("");
loginParams2.setAutoLogin(false);
loginParams2.setSDK(false);
loginParams2.setVerifyCode(this.mCheckCode);
loginRequest(this.mActivity, loginParams2);
} else {
goTwoFactorLogin(this.mActivity, "", this.loginType, this.mUserNameStr, "", true, "", str);
}
}
@n(threadMode = ThreadMode.MAIN)
public void onMessageEventMainThread(ScanDecodeEvent scanDecodeEvent) {
if (scanDecodeEvent != null) {
if (StringUtils.areNotEmpty(scanDecodeEvent.getParam()) && scanDecodeEvent.getParam().equals("startMbsScan")) {
ZZLog.i(TAG, "onMessageEventMainThread Result=" + scanDecodeEvent.getResult(), new Object[0]);
return;
}
ScanSettingInfo parseScanMessage = BaseModuleManager.getInstance().getLoginModule().parseScanMessage(scanDecodeEvent, this.mActivity);
BaseModuleManager.getInstance().getLoginModule().loadScanSettingInfo(this.mActivity);
if (scanDecodeEvent != null) {
scanDecodeEvent.getListioner().onResult(DecodeResultType.DECPDE_SUCESS);
}
completedParseScanMessage(parseScanMessage);
}
}
@n(threadMode = ThreadMode.MAIN)
public void onMessageEventMainThread(BindTelEvent bindTelEvent) {
processBindEvent(bindTelEvent);
}
}