package com.mobile.auth.gatewayauth; import android.app.Activity; import android.content.DialogInterface; import android.content.Intent; import android.graphics.drawable.Drawable; import android.os.Build; import android.os.Bundle; import android.text.SpannableString; import android.text.TextPaint; import android.text.style.ClickableSpan; import android.view.View; import android.widget.CheckBox; import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.RelativeLayout; import android.widget.TextView; import com.mobile.auth.gatewayauth.ui.b; import com.mobile.auth.gatewayauth.utils.g; import com.mobile.auth.gatewayauth.utils.j; import com.mobile.auth.m.a; import com.nirvana.tools.core.AppUtils; import java.util.ArrayList; import java.util.Iterator; import java.util.List; public class LoginAuthActivity extends Activity { public static final String EXIST = "exist"; public static final String STOP_LOADING = "stop_loading"; private String mAccessCode; private RelativeLayout mBodyDYVRL; private RelativeLayout mBodyRL; private boolean mIsDialog = false; private RelativeLayout mLoginRL; private TextView mLoginTV; private ImageView mLogoIV; private RelativeLayout mMainRelativeLayout; private TextView mMaskNumberTV; private RelativeLayout mNumberDYVRL; private String mNumberPhone; private RelativeLayout mNumberRL; private a mPnsLogger; private com.mobile.auth.u.a mProgressDialog; private String mProtocol; private FrameLayout mProtocolCbContainer; private List<b> mProtocolConfigs = new ArrayList(3); private RelativeLayout mProtocolRL; private CheckBox mProtocolSelectCB; private TextView mProtocolTV; private String mSlogan; private TextView mSloganTV; private TextView mSwitchTV; private RelativeLayout mTitleDYVRL; private RelativeLayout mTitleRL; private AuthUIConfig mUIConfig; private b mUIManager; private int mUIManagerID; private String mVendorClick; private String mVendorKey; private String mVendorProtocol; private long startTime; static { System.loadLibrary("pns-LogOnlineStandardRelease-2.12.4-SNAPSHOT_alijtca_plus"); } static /* synthetic */ RelativeLayout access$000(LoginAuthActivity loginAuthActivity) { try { return loginAuthActivity.mLoginRL; } catch (Throwable th) { ExceptionProcessor.processException(th); return null; } } static /* synthetic */ String access$100(LoginAuthActivity loginAuthActivity) { try { return loginAuthActivity.mVendorKey; } catch (Throwable th) { ExceptionProcessor.processException(th); return null; } } static /* synthetic */ b access$200(LoginAuthActivity loginAuthActivity) { try { return loginAuthActivity.mUIManager; } catch (Throwable th) { ExceptionProcessor.processException(th); return null; } } static /* synthetic */ void access$300(LoginAuthActivity loginAuthActivity, boolean z, String str, String str2) { try { loginAuthActivity.finishAuthPage(z, str, str2); } catch (Throwable th) { ExceptionProcessor.processException(th); } } static /* synthetic */ boolean access$400(LoginAuthActivity loginAuthActivity) { try { return loginAuthActivity.checkAuthPageUILegal(); } catch (Throwable th) { ExceptionProcessor.processException(th); return false; } } static /* synthetic */ AuthUIConfig access$500(LoginAuthActivity loginAuthActivity) { try { return loginAuthActivity.mUIConfig; } catch (Throwable th) { ExceptionProcessor.processException(th); return null; } } static /* synthetic */ CheckBox access$600(LoginAuthActivity loginAuthActivity) { try { return loginAuthActivity.mProtocolSelectCB; } catch (Throwable th) { ExceptionProcessor.processException(th); return null; } } static /* synthetic */ a access$700(LoginAuthActivity loginAuthActivity) { try { return loginAuthActivity.mPnsLogger; } catch (Throwable th) { ExceptionProcessor.processException(th); return null; } } private boolean checkAuthPageUILegal() { TextView textView; TextView textView2; TextView textView3; try { return !j.a(this.mProtocolTV) && !j.a(this.mLoginTV) && !j.a(this.mMaskNumberTV) && (textView = this.mLoginTV) != null && !j.a(textView.getCurrentTextColor()) && (textView2 = this.mProtocolTV) != null && !j.a(textView2.getCurrentTextColor()) && (textView3 = this.mMaskNumberTV) != null && !j.a(textView3.getCurrentTextColor()); } catch (Throwable th) { ExceptionProcessor.processException(th); return false; } } private SpannableString dealProtocol(String str, List<b> list) { try { SpannableString spannableString = new SpannableString(str); ClickableSpan vendorProtocol = getVendorProtocol(this.mVendorProtocol, this.mVendorClick, this.mUIConfig.getProtocolOneColor()); for (b bVar : list) { ClickableSpan protocol = getProtocol(bVar.b(), bVar.c(), bVar.d()); int indexOf = str.indexOf(bVar.b()); spannableString.setSpan(protocol, indexOf, bVar.b().length() + indexOf, 34); } spannableString.setSpan(vendorProtocol, str.indexOf(this.mVendorProtocol), str.indexOf(this.mVendorProtocol) + this.mVendorProtocol.length(), 34); return spannableString; } catch (Throwable th) { ExceptionProcessor.processException(th); return null; } } private void finishAuthPage(boolean z, String str, String str2) { try { b bVar = this.mUIManager; if (bVar != null) { bVar.a(z, str, str2); } else { this.mPnsLogger.e("Exception finish!"); finish(); } if (this.mUIConfig.getAuthPageActOut() != null && this.mUIConfig.getActivityIn() != null) { overridePendingTransition(AppUtils.getAnimResID(this, this.mUIConfig.getAuthPageActOut()), AppUtils.getAnimResID(this, this.mUIConfig.getActivityIn())); } } catch (Throwable th) { ExceptionProcessor.processException(th); } } private native ClickableSpan getProtocol(String str, String str2, int i); private ClickableSpan getVendorProtocol(final String str, final String str2, final int i) { try { return new ClickableSpan() { /* class com.mobile.auth.gatewayauth.LoginAuthActivity.AnonymousClass10 */ public void onClick(View view) { try { LoginAuthActivity.access$200(LoginAuthActivity.this).a(LoginAuthActivity.access$100(LoginAuthActivity.this), str, str2, true); LoginAuthActivity.access$200(LoginAuthActivity.this).a(str, str2); } catch (Throwable th) { ExceptionProcessor.processException(th); } } public void updateDrawState(TextPaint textPaint) { try { super.updateDrawState(textPaint); textPaint.setUnderlineText(false); textPaint.setColor(i); } catch (Throwable th) { ExceptionProcessor.processException(th); } } }; } catch (Throwable th) { ExceptionProcessor.processException(th); return null; } } private native void init(); private native RelativeLayout initBodyView(); private native void initDynamicView(); private void initIntentData() { try { Intent intent = getIntent(); this.mNumberPhone = intent.getStringExtra("number"); this.mVendorKey = intent.getStringExtra("vendor"); this.mAccessCode = intent.getStringExtra(Constant.LOGIN_ACTIVITY_ACCESS_CODE); this.startTime = intent.getLongExtra("startTime", 0); this.mUIManagerID = intent.getIntExtra("ui_manager_id", 0); } catch (Throwable th) { ExceptionProcessor.processException(th); } } private native RelativeLayout initLoginRL(); private native ImageView initLogoView(); private native void initMaskNumberDynamicView(); private native RelativeLayout initNumberView(); private native RelativeLayout initProtocolView(); private native TextView initSloganView(); private native TextView initSwitchView(); private native RelativeLayout initTitleView(); private native void initView(); private native void initXMLDynamicView(); private native void removeDynamicView(); private void removeDynamicXmlView() { ArrayList<AuthRegisterXmlConfig> i; try { b bVar = this.mUIManager; if (bVar != null && (i = bVar.i()) != null) { Iterator<AuthRegisterXmlConfig> it = i.iterator(); while (it.hasNext()) { try { View rootView = it.next().getViewDelegate().getRootView(); rootView.setOnClickListener(null); this.mMainRelativeLayout.removeView(rootView); } catch (Exception e) { g.a(e); } } } } catch (Throwable th) { ExceptionProcessor.processException(th); } } private native void removeNumberView(); private void setBackground(View view, Drawable drawable) { try { if (Build.VERSION.SDK_INT >= 16) { view.setBackground(drawable); } else { view.setBackgroundDrawable(drawable); } } catch (Throwable th) { ExceptionProcessor.processException(th); } } private void setDialogBackGroundAlpha(float f) { try { getWindow().setDimAmount(f); } catch (Throwable th) { ExceptionProcessor.processException(th); } } private void xmlLoadErrorCB() { try { b bVar = this.mUIManager; if (bVar != null) { bVar.f(); } } catch (Throwable th) { ExceptionProcessor.processException(th); } } public int getUIManagerID() { try { return this.mUIManagerID; } catch (Throwable th) { ExceptionProcessor.processException(th); return -1; } } public void hideLoadingDialog() { com.mobile.auth.u.a aVar; try { if (!this.mUIConfig.isHiddenLoading() && (aVar = this.mProgressDialog) != null && aVar.isShowing()) { this.mProgressDialog.dismiss(); } } catch (Throwable th) { ExceptionProcessor.processException(th); } } /* access modifiers changed from: protected */ public native void onActivityResult(int i, int i2, Intent intent); public void onBackPressed() { try { super.onBackPressed(); finishAuthPage(true, "-72931", "用户取消登录"); } catch (Throwable th) { ExceptionProcessor.processException(th); } } /* access modifiers changed from: protected */ public native void onCreate(Bundle bundle); /* access modifiers changed from: protected */ public void onDestroy() { try { hideLoadingDialog(); removeDynamicView(); removeNumberView(); removeDynamicXmlView(); a aVar = this.mPnsLogger; if (aVar != null) { aVar.b(); } this.mUIManager = null; this.mUIConfig = null; super.onDestroy(); } catch (Throwable th) { ExceptionProcessor.processException(th); } } /* access modifiers changed from: protected */ public void onRestoreInstanceState(Bundle bundle) { try { super.onRestoreInstanceState(bundle); this.mUIManager.b(); this.mUIManager.a((Activity) this); } catch (Throwable th) { ExceptionProcessor.processException(th); } } /* access modifiers changed from: protected */ public void onResume() { try { super.onResume(); } catch (Throwable th) { ExceptionProcessor.processException(th); } } public void setProtocolChecked(boolean z) { try { CheckBox checkBox = this.mProtocolSelectCB; if (checkBox != null) { checkBox.setChecked(z); } } catch (Throwable th) { ExceptionProcessor.processException(th); } } public void showLoadingDialog() { try { if (!this.mUIConfig.isHiddenLoading()) { this.mPnsLogger.a("LoginAuthActivity showLoadingDialog = ", String.valueOf(this.mProgressDialog), "; isShowLoadingDialog = true"); if (this.mProgressDialog == null) { com.mobile.auth.u.a aVar = new com.mobile.auth.u.a(this, this.mUIConfig); this.mProgressDialog = aVar; aVar.setOnShowListener(new DialogInterface.OnShowListener() { /* class com.mobile.auth.gatewayauth.LoginAuthActivity.AnonymousClass1 */ public void onShow(DialogInterface dialogInterface) { try { LoginAuthActivity.access$000(LoginAuthActivity.this).setClickable(true); } catch (Throwable th) { ExceptionProcessor.processException(th); } } }); } this.mProgressDialog.setCancelable(true); this.mProgressDialog.show(); } } catch (Throwable th) { ExceptionProcessor.processException(th); } } }