热汗舞蹈 v1.24.1.0版本的 MD5 值为:f1dc6ef07903515a73f51f41f372123e
以下内容为反编译后的 GenLoginAuthActivity.java 源代码,内容仅作参考
package com.cmic.geo.sdk.view;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Point;
import android.graphics.Typeface;
import android.graphics.drawable.ColorDrawable;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.TextUtils;
import android.text.method.LinkMovementMethod;
import android.util.DisplayMetrics;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.view.WindowManager;
import android.view.animation.AnimationUtils;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import androidx.exifinterface.media.ExifInterface;
import com.cmic.geo.sdk.auth.GenAuthnHelper;
import com.cmic.geo.sdk.auth.GenTokenListener;
import com.cmic.geo.sdk.e.h;
import com.cmic.geo.sdk.e.n;
import com.cmic.geo.sdk.e.q;
import com.cmic.geo.sdk.view.b;
import com.sensorsdata.analytics.android.autotrack.aop.SensorsDataAutoTrackHelper;
import com.sensorsdata.analytics.android.sdk.SensorsDataInstrumented;
import com.sensorsdata.analytics.android.sdk.aop.push.PushAutoTrackHelper;
import com.tencent.thumbplayer.tplayer.plugins.report.TPReportParams;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import org.json.JSONException;
import org.json.JSONObject;
public class GenLoginAuthActivity extends Activity implements View.OnClickListener {
public static final String f7277a = GenLoginAuthActivity.class.getSimpleName();
private GenAuthThemeConfig A;
private int B;
private int C;
private boolean D;
private Dialog E;
private Handler f7278b;
private Context f7279c;
private RelativeLayout f7280d;
private d f7281e;
private d f7282f;
private d f7283g;
private d f7284h;
private d f7285i;
private ArrayList<d> f7286j;
private ArrayList<String> f7287k;
private String[] f7288l;
private com.cmic.geo.sdk.a f7289m;
private com.cmic.geo.sdk.auth.a f7290n;
private CheckBox f7292p;
private RelativeLayout f7293q;
private RelativeLayout f7294r;
private GenTokenListener f7298v;
private RelativeLayout f7300x;
private String f7301y;
private String f7302z;
private String f7291o = "";
private long f7295s = 0;
private int f7296t = 0;
private a f7297u = null;
private boolean f7299w = true;
public static class a extends Handler {
public WeakReference<GenLoginAuthActivity> f7311a;
public a(GenLoginAuthActivity genLoginAuthActivity) {
this.f7311a = new WeakReference<>(genLoginAuthActivity);
}
private void a(Message message) {
GenLoginAuthActivity genLoginAuthActivity = this.f7311a.get();
if (genLoginAuthActivity == null || message.what != 1) {
return;
}
genLoginAuthActivity.c();
genLoginAuthActivity.k();
}
@Override
public void handleMessage(Message message) {
try {
a(message);
} catch (Exception e10) {
com.cmic.geo.sdk.d.c.f7171b.add(e10);
e10.printStackTrace();
}
}
}
public static class b extends n.a {
public WeakReference<GenLoginAuthActivity> f7312a;
public WeakReference<c> f7313b;
public b(GenLoginAuthActivity genLoginAuthActivity, c cVar) {
this.f7312a = new WeakReference<>(genLoginAuthActivity);
this.f7313b = new WeakReference<>(cVar);
}
public boolean b() {
c cVar = this.f7313b.get();
if (this.f7312a.get() == null || cVar == null) {
return false;
}
return cVar.a(false);
}
@Override
public void a() {
final GenLoginAuthActivity genLoginAuthActivity = this.f7312a.get();
genLoginAuthActivity.f7289m.a("logintype", 1);
h.a(true, false);
genLoginAuthActivity.f7290n.b(genLoginAuthActivity.f7289m, new com.cmic.geo.sdk.auth.b() {
@Override
public void a(String str, String str2, com.cmic.geo.sdk.a aVar, JSONObject jSONObject) {
if (b.this.b()) {
long b10 = aVar.b("loginTime", 0L);
String b11 = aVar.b("phonescrip");
if (b10 != 0) {
aVar.a("loginTime", System.currentTimeMillis() - b10);
}
if (!"103000".equals(str) || TextUtils.isEmpty(b11)) {
genLoginAuthActivity.f7299w = false;
com.cmic.geo.sdk.d.a.a("authClickFailed");
} else {
com.cmic.geo.sdk.d.a.a("authClickSuccess");
genLoginAuthActivity.f7299w = true;
}
genLoginAuthActivity.a(str, str2, aVar, jSONObject);
try {
Thread.sleep(1000L);
} catch (InterruptedException e10) {
e10.printStackTrace();
}
genLoginAuthActivity.f7297u.sendEmptyMessage(1);
}
}
});
}
}
public class c implements Runnable {
private com.cmic.geo.sdk.a f7317b;
private boolean f7318c;
public c(com.cmic.geo.sdk.a aVar) {
this.f7317b = aVar;
}
public synchronized boolean a(boolean z10) {
boolean z11;
z11 = this.f7318c;
this.f7318c = z10;
return !z11;
}
@Override
public void run() {
if (a(true)) {
JSONObject jSONObject = new JSONObject();
try {
jSONObject.put("resultCode", "102507");
jSONObject.put("resultString", "请求超时");
} catch (JSONException e10) {
e10.printStackTrace();
}
GenLoginAuthActivity.this.f7299w = false;
com.cmic.geo.sdk.d.a.a("authClickFailed");
GenLoginAuthActivity.this.f7297u.sendEmptyMessage(1);
long b10 = this.f7317b.b("loginTime", 0L);
if (b10 != 0) {
this.f7317b.a("loginTime", System.currentTimeMillis() - b10);
}
GenLoginAuthActivity.this.a("102507", "请求超时", this.f7317b, jSONObject);
}
}
}
public void a(String str, String str2, com.cmic.geo.sdk.a aVar, JSONObject jSONObject) {
GenAuthnHelper genAuthnHelper;
try {
if (this.f7278b == null) {
this.f7278b = new Handler(getMainLooper());
this.f7297u = new a(this);
}
this.f7278b.removeCallbacksAndMessages(null);
if ("103000".equals(str)) {
if (GenAuthnHelper.getInstance((Context) this) == null || com.cmic.geo.sdk.e.e.c(aVar.b("traceId")) == null) {
return;
}
aVar.a("keepListener", true);
genAuthnHelper = GenAuthnHelper.getInstance((Context) this);
} else if ("200020".equals(str)) {
if (GenAuthnHelper.getInstance((Context) this) != null) {
if (com.cmic.geo.sdk.e.e.c(aVar.b("traceId")) != null) {
GenAuthnHelper.getInstance((Context) this).callBackResult(str, str2, aVar, jSONObject);
}
a();
return;
}
return;
} else {
aVar.a("keepListener", true);
genAuthnHelper = GenAuthnHelper.getInstance((Context) this);
}
genAuthnHelper.callBackResult(str, str2, aVar, jSONObject);
} catch (Exception e10) {
com.cmic.geo.sdk.e.c.a(f7277a, "CallbackResult:未知错误");
e10.printStackTrace();
}
}
public void a(boolean z10) {
try {
com.cmic.geo.sdk.d.a.a("authPageOut");
a("200020", "登录页面关闭", this.f7289m, null);
} catch (Exception e10) {
com.cmic.geo.sdk.d.c.f7171b.add(e10);
e10.printStackTrace();
}
}
private void d() {
String str;
com.cmic.geo.sdk.a d10 = com.cmic.geo.sdk.e.e.d(getIntent().getStringExtra("traceId"));
this.f7289m = d10;
if (d10 == null) {
this.f7289m = new com.cmic.geo.sdk.a(0);
}
this.f7298v = com.cmic.geo.sdk.e.e.c(this.f7289m.b("traceId", ""));
getWindowManager().getDefaultDisplay().getMetrics(new DisplayMetrics());
this.f7278b = new Handler(getMainLooper());
this.f7297u = new a(this);
this.f7291o = this.f7289m.b("securityphone");
String str2 = f7277a;
com.cmic.geo.sdk.e.c.b(str2, "mSecurityPhone value is " + this.f7291o);
String b10 = this.f7289m.b("operatortype", "");
com.cmic.geo.sdk.e.c.b(str2, "operator value is " + b10);
if (this.A.getAppLanguageType() == 1) {
this.f7288l = com.cmic.geo.sdk.c.f7043b;
} else if (this.A.getAppLanguageType() == 2) {
this.f7288l = com.cmic.geo.sdk.c.f7044c;
} else {
this.f7288l = com.cmic.geo.sdk.c.f7042a;
}
if (b10.equals("1")) {
this.f7301y = this.f7288l[0];
str = "https://wap.cmpassport.com/resources/html/contract.html";
} else if (b10.equals(ExifInterface.GPS_MEASUREMENT_3D)) {
this.f7301y = this.f7288l[1];
str = "https://e.189.cn/sdk/agreement/detail.do?hidetop=true";
} else {
this.f7301y = this.f7288l[2];
str = "https://opencloud.wostore.cn/authz/resource/html/disclaimer.html?fromsdk=true";
}
d dVar = new d(this.f7279c, 16973840, this.f7301y, str);
this.f7281e = dVar;
dVar.setOnKeyListener(new DialogInterface.OnKeyListener() {
@Override
public boolean onKey(DialogInterface dialogInterface, int i10, KeyEvent keyEvent) {
if (i10 == 4 && keyEvent.getAction() == 1 && keyEvent.getRepeatCount() == 0) {
GenLoginAuthActivity.this.f7281e.b();
}
return true;
}
});
this.f7286j = new ArrayList<>();
this.f7287k = new ArrayList<>();
if (!TextUtils.isEmpty(this.A.getClauseUrl())) {
d dVar2 = new d(this.f7279c, 16973840, this.A.getClauseName(), this.A.getClauseUrl());
this.f7282f = dVar2;
dVar2.setOnKeyListener(new DialogInterface.OnKeyListener() {
@Override
public boolean onKey(DialogInterface dialogInterface, int i10, KeyEvent keyEvent) {
if (i10 == 4 && keyEvent.getAction() == 1 && keyEvent.getRepeatCount() == 0) {
GenLoginAuthActivity.this.f7282f.b();
}
return true;
}
});
this.f7286j.add(this.f7282f);
this.f7287k.add(this.A.getClauseName());
}
if (!TextUtils.isEmpty(this.A.getClauseUrl2())) {
d dVar3 = new d(this.f7279c, 16973840, this.A.getClauseName2(), this.A.getClauseUrl2());
this.f7283g = dVar3;
dVar3.setOnKeyListener(new DialogInterface.OnKeyListener() {
@Override
public boolean onKey(DialogInterface dialogInterface, int i10, KeyEvent keyEvent) {
if (i10 == 4 && keyEvent.getAction() == 1 && keyEvent.getRepeatCount() == 0) {
GenLoginAuthActivity.this.f7283g.b();
}
return true;
}
});
this.f7286j.add(this.f7283g);
this.f7287k.add(this.A.getClauseName2());
}
if (!TextUtils.isEmpty(this.A.getClauseUrl3())) {
d dVar4 = new d(this.f7279c, 16973840, this.A.getClauseName3(), this.A.getClauseUrl3());
this.f7284h = dVar4;
dVar4.setOnKeyListener(new DialogInterface.OnKeyListener() {
@Override
public boolean onKey(DialogInterface dialogInterface, int i10, KeyEvent keyEvent) {
if (i10 == 4 && keyEvent.getAction() == 1 && keyEvent.getRepeatCount() == 0) {
GenLoginAuthActivity.this.f7284h.b();
}
return true;
}
});
this.f7286j.add(this.f7284h);
this.f7287k.add(this.A.getClauseName3());
}
if (!TextUtils.isEmpty(this.A.getClauseUrl4())) {
d dVar5 = new d(this.f7279c, 16973840, this.A.getClauseName4(), this.A.getClauseUrl4());
this.f7285i = dVar5;
dVar5.setOnKeyListener(new DialogInterface.OnKeyListener() {
@Override
public boolean onKey(DialogInterface dialogInterface, int i10, KeyEvent keyEvent) {
if (i10 == 4 && keyEvent.getAction() == 1 && keyEvent.getRepeatCount() == 0) {
GenLoginAuthActivity.this.f7285i.b();
}
return true;
}
});
this.f7286j.add(this.f7285i);
this.f7287k.add(this.A.getClauseName4());
}
j();
if (this.A.isPrivacyBookSymbol()) {
for (int i10 = 0; i10 < this.f7287k.size(); i10++) {
String format = String.format("《%s》", this.f7287k.get(i10));
this.f7302z = this.f7302z.replaceFirst(this.f7287k.get(i10), format);
this.f7287k.set(i10, format);
}
}
com.cmic.geo.sdk.view.b.a().a(new b.a() {
@Override
public void a() {
GenLoginAuthActivity.this.f7278b.removeCallbacksAndMessages(null);
if (GenLoginAuthActivity.this.f7281e != null && GenLoginAuthActivity.this.f7281e.isShowing()) {
GenLoginAuthActivity.this.f7281e.dismiss();
}
if (GenLoginAuthActivity.this.f7282f != null && GenLoginAuthActivity.this.f7282f.isShowing()) {
GenLoginAuthActivity.this.f7282f.dismiss();
}
GenLoginAuthActivity.this.a(true);
}
});
}
private void e() {
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) this.f7294r.getLayoutParams();
if (this.A.getNumFieldOffsetY() > 0 || this.A.getNumFieldOffsetY_B() < 0) {
int makeMeasureSpec = View.MeasureSpec.makeMeasureSpec(0, 0);
this.f7294r.measure(makeMeasureSpec, makeMeasureSpec);
String str = f7277a;
com.cmic.geo.sdk.e.c.b(str, "mPhoneLayout.getMeasuredHeight()=" + this.f7294r.getMeasuredHeight());
if (this.A.getNumFieldOffsetY() <= 0 || (this.B - this.f7294r.getMeasuredHeight()) - e.a(this.f7279c, this.A.getNumFieldOffsetY()) <= 0) {
layoutParams.addRule(12, -1);
} else {
com.cmic.geo.sdk.e.c.b(str, "numberField_top");
layoutParams.addRule(10, -1);
layoutParams.setMargins(0, e.a(this.f7279c, this.A.getNumFieldOffsetY()), 0, 0);
}
} else if (this.A.getNumFieldOffsetY_B() <= 0 || (this.B - this.f7294r.getMeasuredHeight()) - e.a(this.f7279c, this.A.getNumFieldOffsetY_B()) <= 0) {
layoutParams.addRule(10, -1);
} else {
com.cmic.geo.sdk.e.c.b(f7277a, "numberField_bottom");
layoutParams.addRule(12, -1);
layoutParams.setMargins(0, 0, 0, e.a(this.f7279c, this.A.getNumFieldOffsetY_B()));
}
this.f7294r.setLayoutParams(layoutParams);
RelativeLayout.LayoutParams layoutParams2 = (RelativeLayout.LayoutParams) this.f7280d.getLayoutParams();
int max = Math.max(this.A.getLogBtnMarginLeft(), 0);
int max2 = Math.max(this.A.getLogBtnMarginRight(), 0);
if (this.A.getLogBtnOffsetY() > 0 || this.A.getLogBtnOffsetY_B() < 0) {
if (this.A.getLogBtnOffsetY() <= 0 || this.B - e.a(this.f7279c, this.A.getLogBtnHeight() + this.A.getLogBtnOffsetY()) <= 0) {
layoutParams2.addRule(12, -1);
layoutParams2.setMargins(e.a(this.f7279c, max), 0, e.a(this.f7279c, max2), 0);
} else {
com.cmic.geo.sdk.e.c.b(f7277a, "logBtn_top");
layoutParams2.addRule(10, -1);
layoutParams2.setMargins(e.a(this.f7279c, max), e.a(this.f7279c, this.A.getLogBtnOffsetY()), e.a(this.f7279c, max2), 0);
}
} else if (this.A.getLogBtnOffsetY_B() <= 0 || this.B - e.a(this.f7279c, this.A.getLogBtnHeight() + this.A.getLogBtnOffsetY_B()) <= 0) {
layoutParams2.addRule(10, -1);
layoutParams2.setMargins(e.a(this.f7279c, max), 0, e.a(this.f7279c, max2), 0);
} else {
com.cmic.geo.sdk.e.c.b(f7277a, "logBtn_bottom");
layoutParams2.addRule(12, -1);
layoutParams2.setMargins(e.a(this.f7279c, max), 0, e.a(this.f7279c, max2), e.a(this.f7279c, this.A.getLogBtnOffsetY_B()));
}
this.f7280d.setLayoutParams(layoutParams2);
RelativeLayout.LayoutParams layoutParams3 = (RelativeLayout.LayoutParams) this.f7293q.getLayoutParams();
int privacyMarginLeft = this.A.getPrivacyMarginLeft() >= 0 ? this.A.getCheckedImgWidth() > 30 ? this.A.getPrivacyMarginLeft() : this.A.getPrivacyMarginLeft() - (30 - this.A.getCheckedImgWidth()) : this.A.getCheckedImgWidth() > 30 ? 0 : -(30 - this.A.getCheckedImgWidth());
int max3 = Math.max(this.A.getPrivacyMarginRight(), 0);
int makeMeasureSpec2 = View.MeasureSpec.makeMeasureSpec(0, 0);
this.f7293q.measure(makeMeasureSpec2, makeMeasureSpec2);
if (this.A.getPrivacyOffsetY() > 0 || this.A.getPrivacyOffsetY_B() < 0) {
if (this.A.getPrivacyOffsetY() <= 0 || (this.B - this.f7293q.getMeasuredHeight()) - e.a(this.f7279c, this.A.getPrivacyOffsetY()) <= 0) {
String str2 = f7277a;
com.cmic.geo.sdk.e.c.b(str2, "privacy_bottom=" + privacyMarginLeft);
layoutParams3.addRule(12, -1);
layoutParams3.setMargins(e.a(this.f7279c, (float) privacyMarginLeft), 0, e.a(this.f7279c, (float) max3), 0);
} else {
String str3 = f7277a;
com.cmic.geo.sdk.e.c.b(str3, "privacy_top = " + this.f7293q.getMeasuredHeight());
layoutParams3.addRule(10, -1);
layoutParams3.setMargins(e.a(this.f7279c, (float) privacyMarginLeft), e.a(this.f7279c, (float) this.A.getPrivacyOffsetY()), e.a(this.f7279c, (float) max3), 0);
}
} else if (this.A.getPrivacyOffsetY_B() <= 0 || (this.B - this.f7293q.getMeasuredHeight()) - e.a(this.f7279c, this.A.getPrivacyOffsetY_B()) <= 0) {
layoutParams3.addRule(10, -1);
layoutParams3.setMargins(e.a(this.f7279c, privacyMarginLeft), 0, e.a(this.f7279c, max3), 0);
com.cmic.geo.sdk.e.c.b(f7277a, "privacy_top");
} else {
String str4 = f7277a;
com.cmic.geo.sdk.e.c.b(str4, "privacy_bottom=" + this.f7293q.getMeasuredHeight());
layoutParams3.addRule(12, -1);
layoutParams3.setMargins(e.a(this.f7279c, (float) privacyMarginLeft), 0, e.a(this.f7279c, (float) max3), e.a(this.f7279c, (float) this.A.getPrivacyOffsetY_B()));
}
this.f7293q.setLayoutParams(layoutParams3);
}
private void f() {
int i10 = Build.VERSION.SDK_INT;
getWindow().addFlags(67108864);
getWindow().addFlags(134217728);
if (this.A.getStatusBarColor() != 0) {
getWindow().addFlags(Integer.MIN_VALUE);
getWindow().clearFlags(67108864);
getWindow().setStatusBarColor(this.A.getStatusBarColor());
getWindow().setNavigationBarColor(this.A.getStatusBarColor());
}
if (i10 >= 23) {
if (this.A.isLightColor()) {
getWindow().getDecorView().setSystemUiVisibility(8192);
} else {
getWindow().getDecorView().setSystemUiVisibility(0);
}
}
RelativeLayout relativeLayout = new RelativeLayout(this);
relativeLayout.setLayoutParams(new RelativeLayout.LayoutParams(-1, -1));
View contentView = this.A.getContentView();
if (contentView != null) {
ViewParent parent = contentView.getParent();
if (parent != null) {
((ViewGroup) parent).removeView(contentView);
}
relativeLayout.addView(contentView);
} else if (this.A.getLayoutResID() != -1) {
getLayoutInflater().inflate(this.A.getLayoutResID(), relativeLayout);
}
setContentView(relativeLayout);
int requestedOrientation = getRequestedOrientation();
this.B = e.b(this.f7279c);
int a10 = e.a(this.f7279c);
this.C = a10;
boolean z10 = true;
if ((requestedOrientation == 1 && a10 > this.B) || (requestedOrientation == 0 && a10 < this.B)) {
this.C = this.B;
this.B = a10;
}
String str = f7277a;
com.cmic.geo.sdk.e.c.b(str, "orientation = " + requestedOrientation + "--screenWidth = " + this.C + "--screenHeight = " + this.B);
WindowManager.LayoutParams attributes = getWindow().getAttributes();
if (this.A.getWindowWidth() != 0) {
getWindow().getWindowManager().getDefaultDisplay().getMetrics(new DisplayMetrics());
getWindowManager().getDefaultDisplay().getSize(new Point());
attributes.width = e.a(this.f7279c, this.A.getWindowWidth());
int a11 = e.a(this.f7279c, this.A.getWindowHeight());
attributes.height = a11;
this.C = attributes.width;
this.B = a11;
attributes.x = e.a(this.f7279c, this.A.getWindowX());
if (this.A.getWindowBottom() == 1) {
getWindow().setGravity(80);
} else {
attributes.y = e.a(this.f7279c, this.A.getWindowY());
}
getWindow().setAttributes(attributes);
}
relativeLayout.setFitsSystemWindows(this.A.isFitsSystemWindows());
relativeLayout.setClipToPadding(true);
try {
g();
relativeLayout.addView(this.f7294r);
relativeLayout.addView(h());
relativeLayout.addView(i());
e();
this.f7280d.setOnClickListener(this);
this.f7300x.setOnClickListener(this);
this.f7292p.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
@SensorsDataInstrumented
public void onCheckedChanged(CompoundButton compoundButton, boolean z11) {
CheckBox checkBox;
GenLoginAuthActivity genLoginAuthActivity;
String str2;
if (GenLoginAuthActivity.this.A.getGenCheckedChangeListener() != null) {
GenLoginAuthActivity.this.A.getGenCheckedChangeListener().onCheckedChanged(z11);
}
boolean z12 = true;
if (z11) {
GenLoginAuthActivity.this.f7280d.setEnabled(true);
try {
CheckBox checkBox2 = GenLoginAuthActivity.this.f7292p;
GenLoginAuthActivity genLoginAuthActivity2 = GenLoginAuthActivity.this;
checkBox2.setBackgroundResource(com.cmic.geo.sdk.view.c.b(genLoginAuthActivity2, genLoginAuthActivity2.A.getCheckedImgPath()));
} catch (Exception unused) {
checkBox = GenLoginAuthActivity.this.f7292p;
genLoginAuthActivity = GenLoginAuthActivity.this;
str2 = "umcsdk_check_image";
checkBox.setBackgroundResource(com.cmic.geo.sdk.view.c.b(genLoginAuthActivity, str2));
SensorsDataAutoTrackHelper.trackViewOnClick(compoundButton);
}
} else {
RelativeLayout relativeLayout2 = GenLoginAuthActivity.this.f7280d;
if (GenLoginAuthActivity.this.A.getGenCheckBoxListener() == null && TextUtils.isEmpty(GenLoginAuthActivity.this.A.getCheckTipText())) {
z12 = false;
}
relativeLayout2.setEnabled(z12);
try {
CheckBox checkBox3 = GenLoginAuthActivity.this.f7292p;
GenLoginAuthActivity genLoginAuthActivity3 = GenLoginAuthActivity.this;
checkBox3.setBackgroundResource(com.cmic.geo.sdk.view.c.b(genLoginAuthActivity3, genLoginAuthActivity3.A.getUncheckedImgPath()));
} catch (Exception unused2) {
checkBox = GenLoginAuthActivity.this.f7292p;
genLoginAuthActivity = GenLoginAuthActivity.this;
str2 = "umcsdk_uncheck_image";
checkBox.setBackgroundResource(com.cmic.geo.sdk.view.c.b(genLoginAuthActivity, str2));
SensorsDataAutoTrackHelper.trackViewOnClick(compoundButton);
}
}
SensorsDataAutoTrackHelper.trackViewOnClick(compoundButton);
}
});
k();
try {
if (this.A.isPrivacyState()) {
this.f7292p.setChecked(true);
this.f7292p.setBackgroundResource(com.cmic.geo.sdk.view.c.b(this, this.A.getCheckedImgPath()));
this.f7280d.setEnabled(true);
return;
}
this.f7292p.setChecked(false);
RelativeLayout relativeLayout2 = this.f7280d;
if (this.A.getGenCheckBoxListener() == null && TextUtils.isEmpty(this.A.getCheckTipText())) {
z10 = false;
}
relativeLayout2.setEnabled(z10);
this.f7292p.setBackgroundResource(com.cmic.geo.sdk.view.c.b(this, this.A.getUncheckedImgPath()));
} catch (Exception unused) {
this.f7292p.setChecked(false);
}
} catch (Exception e10) {
com.cmic.geo.sdk.d.c.f7171b.add(e10);
e10.printStackTrace();
com.cmic.geo.sdk.e.c.a(f7277a, e10.toString());
a("200040", "UI资源加载异常", this.f7289m, null);
}
}
private void g() {
int i10;
RelativeLayout relativeLayout = new RelativeLayout(this);
this.f7294r = relativeLayout;
relativeLayout.setId(13107);
this.f7294r.setLayoutParams(new RelativeLayout.LayoutParams(-1, -2));
TextView textView = new TextView(this);
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(-2, -2);
textView.setGravity(15);
int numberOffsetX = this.A.getNumberOffsetX();
if (numberOffsetX != 0) {
if (numberOffsetX > 0) {
float f10 = numberOffsetX;
if ((this.C - textView.getWidth()) - e.a(this.f7279c, f10) > 0) {
layoutParams.setMargins(e.a(this.f7279c, f10), 0, 0, 0);
} else {
com.cmic.geo.sdk.e.c.b(f7277a, "RelativeLayout.ALIGN_PARENT_RIGHT");
i10 = 11;
}
}
textView.setTextSize(2, this.A.getNumberSize());
textView.setText(this.f7291o);
if (this.A.isNumberBold()) {
textView.setTypeface(Typeface.DEFAULT_BOLD);
}
textView.setId(30583);
this.f7294r.addView(textView, layoutParams);
textView.setTextColor(this.A.getNumberColor());
int makeMeasureSpec = View.MeasureSpec.makeMeasureSpec(0, 0);
this.f7294r.measure(makeMeasureSpec, makeMeasureSpec);
com.cmic.geo.sdk.e.c.b(f7277a, "mPhoneLayout.getMeasuredHeight()=" + this.f7294r.getMeasuredHeight());
}
i10 = 13;
layoutParams.addRule(i10);
textView.setTextSize(2, this.A.getNumberSize());
textView.setText(this.f7291o);
if (this.A.isNumberBold()) {
}
textView.setId(30583);
this.f7294r.addView(textView, layoutParams);
textView.setTextColor(this.A.getNumberColor());
int makeMeasureSpec2 = View.MeasureSpec.makeMeasureSpec(0, 0);
this.f7294r.measure(makeMeasureSpec2, makeMeasureSpec2);
com.cmic.geo.sdk.e.c.b(f7277a, "mPhoneLayout.getMeasuredHeight()=" + this.f7294r.getMeasuredHeight());
}
private RelativeLayout h() {
RelativeLayout relativeLayout = new RelativeLayout(this);
this.f7280d = relativeLayout;
relativeLayout.setId(17476);
this.f7280d.setLayoutParams(new RelativeLayout.LayoutParams(e.a(this.f7279c, this.A.getLogBtnWidth()), e.a(this.f7279c, this.A.getLogBtnHeight())));
TextView textView = new TextView(this);
textView.setTextSize(2, this.A.getLogBtnTextSize());
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(-2, -2);
layoutParams.addRule(13);
textView.setLayoutParams(layoutParams);
if (this.A.isLogBtnTextBold()) {
textView.setTypeface(Typeface.DEFAULT_BOLD);
}
this.f7280d.addView(textView);
textView.setText(this.A.getLogBtnText());
try {
textView.setTextColor(this.A.getLogBtnTextColor());
} catch (Exception unused) {
textView.setTextColor(-1);
}
try {
this.f7280d.setBackgroundResource(com.cmic.geo.sdk.view.c.b(this.f7279c, this.A.getLogBtnBackgroundPath()));
} catch (Exception e10) {
e10.printStackTrace();
this.f7280d.setBackgroundResource(com.cmic.geo.sdk.view.c.b(this.f7279c, "umcsdk_login_btn_bg"));
}
return this.f7280d;
}
private RelativeLayout i() {
RelativeLayout relativeLayout = new RelativeLayout(this);
this.f7293q = relativeLayout;
relativeLayout.setHorizontalGravity(1);
this.f7293q.setLayoutParams(new RelativeLayout.LayoutParams(-1, -2));
int checkedImgWidth = this.A.getCheckedImgWidth();
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(e.a(this.f7279c, Math.max(checkedImgWidth, 30)), e.a(this.f7279c, Math.max(this.A.getCheckedImgHeight(), 30)));
if (this.A.getCheckBoxLocation() == 1) {
layoutParams.addRule(15, -1);
}
RelativeLayout relativeLayout2 = new RelativeLayout(this);
this.f7300x = relativeLayout2;
relativeLayout2.setId(34952);
this.f7300x.setLayoutParams(layoutParams);
CheckBox checkBox = new CheckBox(this);
this.f7292p = checkBox;
checkBox.setChecked(false);
RelativeLayout.LayoutParams layoutParams2 = new RelativeLayout.LayoutParams(e.a(this.f7279c, this.A.getCheckedImgWidth()), e.a(this.f7279c, this.A.getCheckedImgHeight()));
layoutParams2.setMargins(e.a(this.f7279c, checkedImgWidth > 30 ? 0.0f : 30 - checkedImgWidth), 0, 0, 0);
layoutParams2.addRule(11, -1);
if (this.A.getCheckBoxLocation() == 1) {
layoutParams2.addRule(15, -1);
}
this.f7292p.setLayoutParams(layoutParams2);
this.f7300x.addView(this.f7292p);
this.f7293q.addView(this.f7300x);
TextView textView = new TextView(this);
textView.setTextSize(2, this.A.getPrivacyTextSize());
RelativeLayout.LayoutParams layoutParams3 = new RelativeLayout.LayoutParams(-2, -2);
layoutParams3.setMargins(e.a(this.f7279c, 5.0f), 0, 0, e.a(this.f7279c, 5.0f));
layoutParams3.addRule(1, 34952);
textView.setLayoutParams(layoutParams3);
this.f7293q.addView(textView);
textView.setTextColor(this.A.getClauseBaseColor());
textView.setText(e.a(this, this.f7302z, this.f7301y, this.f7281e, this.f7286j, this.f7287k));
textView.setLineSpacing(8.0f, 1.0f);
textView.setIncludeFontPadding(false);
if (this.A.isPrivacyTextBold()) {
textView.setTypeface(Typeface.DEFAULT_BOLD);
}
if (this.A.isPrivacyTextGravityCenter()) {
textView.setGravity(17);
}
textView.setHighlightColor(getResources().getColor(17170445));
textView.setMovementMethod(LinkMovementMethod.getInstance());
this.f7292p.setButtonDrawable(new ColorDrawable());
try {
this.f7292p.setBackgroundResource(com.cmic.geo.sdk.view.c.b(this, this.A.getUncheckedImgPath()));
} catch (Exception unused) {
this.f7292p.setBackgroundResource(com.cmic.geo.sdk.view.c.b(this, "umcsdk_uncheck_image"));
}
return this.f7293q;
}
private String j() {
this.f7302z = this.A.getPrivacy();
if (this.A.isPrivacyBookSymbol()) {
this.f7301y = String.format("《%s》", this.f7301y);
}
if (this.f7302z.contains("$$运营商条款$$")) {
this.f7302z = this.f7302z.replace("$$运营商条款$$", this.f7301y);
}
return this.f7302z;
}
public void k() {
this.f7280d.setClickable(true);
this.f7292p.setClickable(true);
}
private void l() {
this.f7280d.setClickable(false);
this.f7292p.setClickable(false);
}
private void m() {
try {
if (this.f7296t >= 5) {
Toast.makeText(this.f7279c, "网络不稳定,请返回重试其他登录方式", 1).show();
this.f7280d.setClickable(true);
return;
}
StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
StringBuilder sb2 = new StringBuilder();
for (StackTraceElement stackTraceElement : stackTrace) {
com.cmic.geo.sdk.e.c.a("stack", stackTraceElement.getClassName());
String className = stackTraceElement.getClassName();
if (!TextUtils.isEmpty(className) && className.contains("com.cmic.geo.sdk.activity") && !sb2.toString().contains(className)) {
sb2.append(className);
sb2.append(";");
}
}
this.f7289m.a("loginTime", System.currentTimeMillis());
String b10 = this.f7289m.b("traceId", "");
if (!TextUtils.isEmpty(b10) && com.cmic.geo.sdk.e.e.a(b10)) {
String c10 = q.c();
this.f7289m.a("traceId", c10);
com.cmic.geo.sdk.e.e.a(c10, this.f7298v);
}
b();
l();
c cVar = new c(this.f7289m);
this.f7278b.postDelayed(cVar, GenAuthnHelper.getInstance((Context) this).getOverTime());
n.a(new b(this, cVar));
} catch (Exception e10) {
e10.printStackTrace();
}
}
public void a() {
this.f7278b.removeCallbacksAndMessages(null);
d dVar = this.f7281e;
if (dVar != null && dVar.isShowing()) {
this.f7281e.dismiss();
}
d dVar2 = this.f7282f;
if (dVar2 != null && dVar2.isShowing()) {
this.f7282f.dismiss();
}
c();
this.E = null;
RelativeLayout relativeLayout = this.f7293q;
if (relativeLayout != null) {
relativeLayout.clearAnimation();
}
finish();
if (this.A.getAuthPageActOut() == null || this.A.getActivityIn() == null) {
return;
}
overridePendingTransition(com.cmic.geo.sdk.view.c.c(this, this.A.getActivityIn()), com.cmic.geo.sdk.view.c.c(this, this.A.getAuthPageActOut()));
}
public void b() {
com.cmic.geo.sdk.e.c.a(f7277a, "loginClickStart");
try {
this.D = true;
if (this.A.getGenLoginClickListener() != null) {
this.A.getGenLoginClickListener().onLoginClickStart(this.f7279c, null);
} else {
Dialog dialog = this.E;
if (dialog != null) {
dialog.show();
return;
}
AlertDialog create = new AlertDialog.Builder(this).create();
this.E = create;
create.setCancelable(false);
this.E.setCanceledOnTouchOutside(false);
this.E.setOnKeyListener(new DialogInterface.OnKeyListener() {
@Override
public boolean onKey(DialogInterface dialogInterface, int i10, KeyEvent keyEvent) {
return i10 == 4;
}
});
RelativeLayout relativeLayout = new RelativeLayout(this.E.getContext());
relativeLayout.setLayoutParams(new RelativeLayout.LayoutParams(-1, -2));
ImageView imageView = new ImageView(this.E.getContext());
imageView.setImageResource(com.cmic.geo.sdk.view.c.b(this.f7279c, "dialog_loading"));
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(80, 80);
layoutParams.addRule(13, -1);
relativeLayout.addView(imageView, layoutParams);
if (this.E.getWindow() != null) {
this.E.getWindow().setDimAmount(0.0f);
}
this.E.show();
this.E.setContentView(relativeLayout);
}
} catch (Exception e10) {
e10.printStackTrace();
}
com.cmic.geo.sdk.e.c.a(f7277a, "loginClickStart");
}
public void c() {
try {
com.cmic.geo.sdk.e.c.a(f7277a, "loginClickComplete");
if (this.A.getGenLoginClickListener() == null || !this.D) {
Dialog dialog = this.E;
if (dialog != null && dialog.isShowing()) {
this.E.dismiss();
}
} else {
this.D = false;
this.A.getGenLoginClickListener().onLoginClickComplete(this.f7279c, null);
}
} catch (Exception e10) {
e10.printStackTrace();
}
}
@Override
@SensorsDataInstrumented
public void onClick(View view) {
try {
int id2 = view.getId();
if (id2 == 17476) {
if (!this.f7292p.isChecked()) {
if (this.A.getPrivacyAnimation() != null) {
Context context = this.f7279c;
this.f7293q.startAnimation(AnimationUtils.loadAnimation(context, com.cmic.geo.sdk.view.c.c(context, this.A.getPrivacyAnimation())));
}
if (this.A.getGenCheckBoxListener() != null) {
this.A.getGenCheckBoxListener().onLoginClick(this.f7279c, null);
SensorsDataAutoTrackHelper.trackViewOnClick(view);
return;
} else if (!TextUtils.isEmpty(this.A.getCheckTipText())) {
Toast.makeText(this.f7279c, this.A.getCheckTipText(), 1).show();
SensorsDataAutoTrackHelper.trackViewOnClick(view);
return;
}
}
this.f7296t++;
m();
} else if (id2 == 26214) {
a(false);
} else if (id2 == 34952) {
if (this.f7292p.isChecked()) {
this.f7292p.setChecked(false);
} else {
this.f7292p.setChecked(true);
}
}
} catch (Exception e10) {
com.cmic.geo.sdk.d.c.f7171b.add(e10);
e10.printStackTrace();
}
SensorsDataAutoTrackHelper.trackViewOnClick(view);
}
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
if (bundle != null) {
try {
finish();
} catch (Exception e10) {
if (this.f7289m == null) {
this.f7289m = new com.cmic.geo.sdk.a(0);
}
this.f7289m.a().f7145a.add(e10);
com.cmic.geo.sdk.e.c.a(f7277a, e10.toString());
e10.printStackTrace();
a("200025", "发生未知错误", this.f7289m, null);
return;
}
}
this.f7279c = this;
GenAuthThemeConfig authThemeConfig = GenAuthnHelper.getInstance((Context) this).getAuthThemeConfig();
this.A = authThemeConfig;
if (authThemeConfig != null) {
if (authThemeConfig.getThemeId() != -1) {
setTheme(this.A.getThemeId());
}
if (this.A.getAuthPageActIn() != null && this.A.getActivityOut() != null) {
overridePendingTransition(com.cmic.geo.sdk.view.c.c(this, this.A.getAuthPageActIn()), com.cmic.geo.sdk.view.c.c(this, this.A.getActivityOut()));
}
}
com.cmic.geo.sdk.d.a.a("authPageIn");
this.f7295s = System.currentTimeMillis();
this.f7290n = com.cmic.geo.sdk.auth.a.a(this);
d();
f();
}
@Override
public void onDestroy() {
try {
this.f7278b.removeCallbacksAndMessages(null);
com.cmic.geo.sdk.d.a.a("timeOnAuthPage", (System.currentTimeMillis() - this.f7295s) + "");
com.cmic.geo.sdk.d.a.a("authPrivacyState", this.f7292p.isChecked() ? "1" : TPReportParams.ERROR_CODE_NO_ERROR);
com.cmic.geo.sdk.d.a.a(this.f7279c.getApplicationContext(), this.f7289m);
com.cmic.geo.sdk.d.a.a();
this.E = null;
com.cmic.geo.sdk.view.b.a().c();
this.f7297u.removeCallbacksAndMessages(null);
} catch (Exception e10) {
com.cmic.geo.sdk.e.c.a(f7277a, "GenLoginAuthActivity clear failed");
com.cmic.geo.sdk.d.c.f7171b.add(e10);
e10.printStackTrace();
}
super.onDestroy();
}
@Override
public boolean onKeyUp(int i10, KeyEvent keyEvent) {
if (i10 == 4 && !keyEvent.isCanceled() && keyEvent.getRepeatCount() == 0) {
if (this.A.getGenBackPressedListener() != null) {
this.A.getGenBackPressedListener().onBackPressed();
}
if (this.A.getWindowWidth() == 0 || this.A.isBackButton()) {
a(false);
return true;
}
return true;
}
return true;
}
@Override
@SensorsDataInstrumented
public void onNewIntent(Intent intent) {
super.onNewIntent(intent);
PushAutoTrackHelper.onNewIntent(this, intent);
}
@Override
public void onResume() {
super.onResume();
try {
com.cmic.geo.sdk.a aVar = this.f7289m;
if (aVar != null) {
aVar.a("loginMethod", "loginAuth");
}
GenAuthnHelper.getInstance((Context) this).loginPageInCallBack("200087", null);
} catch (Exception e10) {
this.f7289m.a().f7145a.add(e10);
a("200025", "发生未知错误", this.f7289m, null);
}
}
}