小红书.apk(点击下载) / GenLoginAuthActivity.java
package com.cmic.gen.sdk.view;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
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 com.alibaba.alibclinkpartner.linkpartner.constants.ALPParamConstant;
import com.alipay.sdk.util.f;
import com.cmic.gen.sdk.auth.GenAuthnHelper;
import com.cmic.gen.sdk.auth.GenTokenListener;
import com.cmic.gen.sdk.e.e;
import com.cmic.gen.sdk.e.h;
import com.cmic.gen.sdk.e.n;
import com.cmic.gen.sdk.e.q;
import com.cmic.gen.sdk.view.b;
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 {
/* renamed from: a reason: collision with root package name */
public static final String f21407a = GenLoginAuthActivity.class.getSimpleName();
private GenAuthThemeConfig A;
private int B;
private int C;
private boolean D;
private Dialog E;
/* renamed from: b reason: collision with root package name */
private Handler f21408b;
/* renamed from: c reason: collision with root package name */
private Context f21409c;
/* renamed from: d reason: collision with root package name */
private RelativeLayout f21410d;
/* renamed from: e reason: collision with root package name */
private d f21411e;
/* renamed from: f reason: collision with root package name */
private d f21412f;
/* renamed from: g reason: collision with root package name */
private d f21413g;
/* renamed from: h reason: collision with root package name */
private d f21414h;
/* renamed from: i reason: collision with root package name */
private d f21415i;
/* renamed from: j reason: collision with root package name */
private ArrayList<d> f21416j;
/* renamed from: k reason: collision with root package name */
private ArrayList<String> f21417k;
/* renamed from: l reason: collision with root package name */
private String[] f21418l;
/* renamed from: m reason: collision with root package name */
private com.cmic.gen.sdk.a f21419m;
/* renamed from: n reason: collision with root package name */
private com.cmic.gen.sdk.auth.a f21420n;
/* renamed from: o reason: collision with root package name */
private String f21421o = "";
/* renamed from: p reason: collision with root package name */
private CheckBox f21422p;
/* renamed from: q reason: collision with root package name */
private RelativeLayout f21423q;
/* renamed from: r reason: collision with root package name */
private RelativeLayout f21424r;
/* renamed from: s reason: collision with root package name */
private long f21425s = 0;
/* renamed from: t reason: collision with root package name */
private int f21426t = 0;
/* renamed from: u reason: collision with root package name */
private a f21427u = null;
/* renamed from: v reason: collision with root package name */
private GenTokenListener f21428v;
/* renamed from: w reason: collision with root package name */
private boolean f21429w = true;
/* renamed from: x reason: collision with root package name */
private RelativeLayout f21430x;
/* renamed from: y reason: collision with root package name */
private String f21431y;
/* renamed from: z reason: collision with root package name */
private String f21432z;
public static class a extends Handler {
/* renamed from: a reason: collision with root package name */
public WeakReference<GenLoginAuthActivity> f21441a;
public a(GenLoginAuthActivity genLoginAuthActivity) {
this.f21441a = new WeakReference<>(genLoginAuthActivity);
}
private void a(Message message) {
GenLoginAuthActivity genLoginAuthActivity = this.f21441a.get();
if (genLoginAuthActivity != null && message.what == 1) {
genLoginAuthActivity.c();
genLoginAuthActivity.k();
}
}
public void handleMessage(Message message) {
try {
a(message);
} catch (Exception e14) {
com.cmic.gen.sdk.d.c.f21259b.add(e14);
e14.printStackTrace();
}
}
}
public static class b extends n.a {
/* renamed from: a reason: collision with root package name */
public WeakReference<GenLoginAuthActivity> f21442a;
/* renamed from: b reason: collision with root package name */
public WeakReference<c> f21443b;
public b(GenLoginAuthActivity genLoginAuthActivity, c cVar) {
this.f21442a = new WeakReference<>(genLoginAuthActivity);
this.f21443b = new WeakReference<>(cVar);
}
/* access modifiers changed from: private */
/* access modifiers changed from: public */
private boolean b() {
c cVar = this.f21443b.get();
if (this.f21442a.get() == null || cVar == null) {
return false;
}
return cVar.a(false);
}
@Override // com.cmic.gen.sdk.e.n.a
public void a() {
final GenLoginAuthActivity genLoginAuthActivity = this.f21442a.get();
genLoginAuthActivity.f21419m.a("logintype", 1);
h.a(true, false);
genLoginAuthActivity.f21420n.b(genLoginAuthActivity.f21419m, new com.cmic.gen.sdk.auth.b() {
/* class com.cmic.gen.sdk.view.GenLoginAuthActivity.b.AnonymousClass1 */
@Override // com.cmic.gen.sdk.auth.b
public void a(String str, String str2, com.cmic.gen.sdk.a aVar, JSONObject jSONObject) {
if (b.this.b()) {
long b14 = aVar.b("loginTime", 0L);
String b15 = aVar.b("phonescrip");
if (b14 != 0) {
aVar.a("loginTime", System.currentTimeMillis() - b14);
}
if (!"103000".equals(str) || TextUtils.isEmpty(b15)) {
genLoginAuthActivity.f21429w = false;
com.cmic.gen.sdk.d.a.a("authClickFailed");
} else {
com.cmic.gen.sdk.d.a.a("authClickSuccess");
genLoginAuthActivity.f21429w = true;
}
genLoginAuthActivity.a(str, str2, aVar, jSONObject);
try {
Thread.sleep(1000);
} catch (InterruptedException e14) {
e14.printStackTrace();
}
genLoginAuthActivity.f21427u.sendEmptyMessage(1);
}
}
});
}
}
public class c implements Runnable {
/* renamed from: b reason: collision with root package name */
private com.cmic.gen.sdk.a f21447b;
/* renamed from: c reason: collision with root package name */
private boolean f21448c;
public c(com.cmic.gen.sdk.a aVar) {
this.f21447b = aVar;
}
/* access modifiers changed from: private */
/* access modifiers changed from: public */
private synchronized boolean a(boolean z14) {
boolean z15;
z15 = this.f21448c;
this.f21448c = z14;
return !z15;
}
public void run() {
if (a(true)) {
JSONObject jSONObject = new JSONObject();
try {
jSONObject.put(ALPParamConstant.RESULT_CODE, "102507");
jSONObject.put("resultString", "请求超时");
} catch (JSONException e14) {
e14.printStackTrace();
}
GenLoginAuthActivity.this.f21429w = false;
com.cmic.gen.sdk.d.a.a("authClickFailed");
GenLoginAuthActivity.this.f21427u.sendEmptyMessage(1);
long b14 = this.f21447b.b("loginTime", 0L);
if (b14 != 0) {
this.f21447b.a("loginTime", System.currentTimeMillis() - b14);
}
GenLoginAuthActivity.this.a("102507", "请求超时", this.f21447b, jSONObject);
}
}
}
/* access modifiers changed from: private */
/* access modifiers changed from: public */
private void a(String str, String str2, com.cmic.gen.sdk.a aVar, JSONObject jSONObject) {
GenAuthnHelper instance;
try {
if (this.f21408b == null) {
this.f21408b = new Handler(getMainLooper());
this.f21427u = new a(this);
}
this.f21408b.removeCallbacksAndMessages(null);
if ("103000".equals(str)) {
if (GenAuthnHelper.getInstance((Context) this) != null && e.c(aVar.b("traceId")) != null) {
aVar.a("keepListener", true);
instance = GenAuthnHelper.getInstance((Context) this);
} else {
return;
}
} else if (!"200020".equals(str)) {
aVar.a("keepListener", true);
instance = GenAuthnHelper.getInstance((Context) this);
} else if (GenAuthnHelper.getInstance((Context) this) != null) {
if (e.c(aVar.b("traceId")) != null) {
GenAuthnHelper.getInstance((Context) this).callBackResult(str, str2, aVar, jSONObject);
}
a();
return;
} else {
return;
}
instance.callBackResult(str, str2, aVar, jSONObject);
} catch (Exception e14) {
com.cmic.gen.sdk.e.c.a(f21407a, "CallbackResult:未知错误");
e14.printStackTrace();
}
}
/* access modifiers changed from: private */
/* access modifiers changed from: public */
private void a(boolean z14) {
try {
com.cmic.gen.sdk.d.a.a("authPageOut");
a("200020", "登录页面关闭", this.f21419m, null);
} catch (Exception e14) {
com.cmic.gen.sdk.d.c.f21259b.add(e14);
e14.printStackTrace();
}
}
private void d() {
String str;
com.cmic.gen.sdk.a d14 = e.d(getIntent().getStringExtra("traceId"));
this.f21419m = d14;
if (d14 == null) {
this.f21419m = new com.cmic.gen.sdk.a(0);
}
this.f21428v = e.c(this.f21419m.b("traceId", ""));
getWindowManager().getDefaultDisplay().getMetrics(new DisplayMetrics());
this.f21408b = new Handler(getMainLooper());
this.f21427u = new a(this);
this.f21421o = this.f21419m.b("securityphone");
String str2 = f21407a;
com.cmic.gen.sdk.e.c.b(str2, "mSecurityPhone value is " + this.f21421o);
String b14 = this.f21419m.b("operatortype", "");
com.cmic.gen.sdk.e.c.b(str2, "operator value is " + b14);
if (this.A.getAppLanguageType() == 1) {
this.f21418l = com.cmic.gen.sdk.c.f21131b;
} else if (this.A.getAppLanguageType() == 2) {
this.f21418l = com.cmic.gen.sdk.c.f21132c;
} else {
this.f21418l = com.cmic.gen.sdk.c.f21130a;
}
if (b14.equals("1")) {
this.f21431y = this.f21418l[0];
str = "https://wap.cmpassport.com/resources/html/contract.html";
} else if (b14.equals("3")) {
this.f21431y = this.f21418l[1];
str = "https://e.189.cn/sdk/agreement/detail.do?hidetop=true";
} else {
this.f21431y = this.f21418l[2];
str = "https://opencloud.wostore.cn/authz/resource/html/disclaimer.html?fromsdk=true";
}
d dVar = new d(this.f21409c, 16973840, this.f21431y, str);
this.f21411e = dVar;
dVar.setOnKeyListener(new DialogInterface.OnKeyListener() {
/* class com.cmic.gen.sdk.view.GenLoginAuthActivity.AnonymousClass1 */
public boolean onKey(DialogInterface dialogInterface, int i10, KeyEvent keyEvent) {
if (i10 == 4 && keyEvent.getAction() == 1 && keyEvent.getRepeatCount() == 0) {
GenLoginAuthActivity.this.f21411e.b();
}
return true;
}
});
this.f21416j = new ArrayList<>();
this.f21417k = new ArrayList<>();
if (!TextUtils.isEmpty(this.A.getClauseUrl())) {
d dVar2 = new d(this.f21409c, 16973840, this.A.getClauseName(), this.A.getClauseUrl());
this.f21412f = dVar2;
dVar2.setOnKeyListener(new DialogInterface.OnKeyListener() {
/* class com.cmic.gen.sdk.view.GenLoginAuthActivity.AnonymousClass2 */
public boolean onKey(DialogInterface dialogInterface, int i10, KeyEvent keyEvent) {
if (i10 == 4 && keyEvent.getAction() == 1 && keyEvent.getRepeatCount() == 0) {
GenLoginAuthActivity.this.f21412f.b();
}
return true;
}
});
this.f21416j.add(this.f21412f);
this.f21417k.add(this.A.getClauseName());
}
if (!TextUtils.isEmpty(this.A.getClauseUrl2())) {
d dVar3 = new d(this.f21409c, 16973840, this.A.getClauseName2(), this.A.getClauseUrl2());
this.f21413g = dVar3;
dVar3.setOnKeyListener(new DialogInterface.OnKeyListener() {
/* class com.cmic.gen.sdk.view.GenLoginAuthActivity.AnonymousClass3 */
public boolean onKey(DialogInterface dialogInterface, int i10, KeyEvent keyEvent) {
if (i10 == 4 && keyEvent.getAction() == 1 && keyEvent.getRepeatCount() == 0) {
GenLoginAuthActivity.this.f21413g.b();
}
return true;
}
});
this.f21416j.add(this.f21413g);
this.f21417k.add(this.A.getClauseName2());
}
if (!TextUtils.isEmpty(this.A.getClauseUrl3())) {
d dVar4 = new d(this.f21409c, 16973840, this.A.getClauseName3(), this.A.getClauseUrl3());
this.f21414h = dVar4;
dVar4.setOnKeyListener(new DialogInterface.OnKeyListener() {
/* class com.cmic.gen.sdk.view.GenLoginAuthActivity.AnonymousClass4 */
public boolean onKey(DialogInterface dialogInterface, int i10, KeyEvent keyEvent) {
if (i10 == 4 && keyEvent.getAction() == 1 && keyEvent.getRepeatCount() == 0) {
GenLoginAuthActivity.this.f21414h.b();
}
return true;
}
});
this.f21416j.add(this.f21414h);
this.f21417k.add(this.A.getClauseName3());
}
if (!TextUtils.isEmpty(this.A.getClauseUrl4())) {
d dVar5 = new d(this.f21409c, 16973840, this.A.getClauseName4(), this.A.getClauseUrl4());
this.f21415i = dVar5;
dVar5.setOnKeyListener(new DialogInterface.OnKeyListener() {
/* class com.cmic.gen.sdk.view.GenLoginAuthActivity.AnonymousClass5 */
public boolean onKey(DialogInterface dialogInterface, int i10, KeyEvent keyEvent) {
if (i10 == 4 && keyEvent.getAction() == 1 && keyEvent.getRepeatCount() == 0) {
GenLoginAuthActivity.this.f21415i.b();
}
return true;
}
});
this.f21416j.add(this.f21415i);
this.f21417k.add(this.A.getClauseName4());
}
j();
if (this.A.isPrivacyBookSymbol()) {
for (int i10 = 0; i10 < this.f21417k.size(); i10++) {
String format = String.format("《%s》", this.f21417k.get(i10));
this.f21432z = this.f21432z.replaceFirst(this.f21417k.get(i10), format);
this.f21417k.set(i10, format);
}
}
b.a().a(new b.a() {
/* class com.cmic.gen.sdk.view.GenLoginAuthActivity.AnonymousClass6 */
@Override // com.cmic.gen.sdk.view.b.a
public void a() {
GenLoginAuthActivity.this.f21408b.removeCallbacksAndMessages(null);
if (GenLoginAuthActivity.this.f21411e != null && GenLoginAuthActivity.this.f21411e.isShowing()) {
GenLoginAuthActivity.this.f21411e.dismiss();
}
if (GenLoginAuthActivity.this.f21412f != null && GenLoginAuthActivity.this.f21412f.isShowing()) {
GenLoginAuthActivity.this.f21412f.dismiss();
}
GenLoginAuthActivity.this.a((GenLoginAuthActivity) true);
}
});
}
/* JADX WARNING: Removed duplicated region for block: B:35:0x01b6 */
/* JADX WARNING: Removed duplicated region for block: B:39:0x01d4 */
/* JADX WARNING: Removed duplicated region for block: B:45:0x0203 */
/* JADX WARNING: Removed duplicated region for block: B:55:0x0290 */
private void e() {
RelativeLayout.LayoutParams layoutParams;
int privacyMarginLeft;
int max;
RelativeLayout.LayoutParams layoutParams2 = (RelativeLayout.LayoutParams) this.f21424r.getLayoutParams();
if (this.A.getNumFieldOffsetY() > 0 || this.A.getNumFieldOffsetY_B() < 0) {
int makeMeasureSpec = View.MeasureSpec.makeMeasureSpec(0, 0);
this.f21424r.measure(makeMeasureSpec, makeMeasureSpec);
String str = f21407a;
com.cmic.gen.sdk.e.c.b(str, "mPhoneLayout.getMeasuredHeight()=" + this.f21424r.getMeasuredHeight());
if (this.A.getNumFieldOffsetY() <= 0 || (this.B - this.f21424r.getMeasuredHeight()) - e.a(this.f21409c, (float) this.A.getNumFieldOffsetY()) <= 0) {
layoutParams2.addRule(12, -1);
} else {
com.cmic.gen.sdk.e.c.b(str, "numberField_top");
layoutParams2.addRule(10, -1);
layoutParams2.setMargins(0, e.a(this.f21409c, (float) this.A.getNumFieldOffsetY()), 0, 0);
}
} else if (this.A.getNumFieldOffsetY_B() <= 0 || (this.B - this.f21424r.getMeasuredHeight()) - e.a(this.f21409c, (float) this.A.getNumFieldOffsetY_B()) <= 0) {
layoutParams2.addRule(10, -1);
} else {
com.cmic.gen.sdk.e.c.b(f21407a, "numberField_bottom");
layoutParams2.addRule(12, -1);
layoutParams2.setMargins(0, 0, 0, e.a(this.f21409c, (float) this.A.getNumFieldOffsetY_B()));
}
this.f21424r.setLayoutParams(layoutParams2);
RelativeLayout.LayoutParams layoutParams3 = (RelativeLayout.LayoutParams) this.f21410d.getLayoutParams();
int max2 = Math.max(this.A.getLogBtnMarginLeft(), 0);
int max3 = 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.f21409c, (float) (this.A.getLogBtnHeight() + this.A.getLogBtnOffsetY())) <= 0) {
layoutParams3.addRule(12, -1);
} else {
com.cmic.gen.sdk.e.c.b(f21407a, "logBtn_top");
layoutParams3.addRule(10, -1);
layoutParams3.setMargins(e.a(this.f21409c, (float) max2), e.a(this.f21409c, (float) this.A.getLogBtnOffsetY()), e.a(this.f21409c, (float) max3), 0);
this.f21410d.setLayoutParams(layoutParams3);
layoutParams = (RelativeLayout.LayoutParams) this.f21423q.getLayoutParams();
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());
max = Math.max(this.A.getPrivacyMarginRight(), 0);
int makeMeasureSpec2 = View.MeasureSpec.makeMeasureSpec(0, 0);
this.f21423q.measure(makeMeasureSpec2, makeMeasureSpec2);
if (this.A.getPrivacyOffsetY() <= 0 || this.A.getPrivacyOffsetY_B() < 0) {
if (this.A.getPrivacyOffsetY() > 0 || (this.B - this.f21423q.getMeasuredHeight()) - e.a(this.f21409c, (float) this.A.getPrivacyOffsetY()) <= 0) {
String str2 = f21407a;
com.cmic.gen.sdk.e.c.b(str2, "privacy_bottom=" + privacyMarginLeft);
layoutParams.addRule(12, -1);
layoutParams.setMargins(e.a(this.f21409c, (float) privacyMarginLeft), 0, e.a(this.f21409c, (float) max), 0);
} else {
String str3 = f21407a;
com.cmic.gen.sdk.e.c.b(str3, "privacy_top = " + this.f21423q.getMeasuredHeight());
layoutParams.addRule(10, -1);
layoutParams.setMargins(e.a(this.f21409c, (float) privacyMarginLeft), e.a(this.f21409c, (float) this.A.getPrivacyOffsetY()), e.a(this.f21409c, (float) max), 0);
}
} else if (this.A.getPrivacyOffsetY_B() <= 0 || (this.B - this.f21423q.getMeasuredHeight()) - e.a(this.f21409c, (float) this.A.getPrivacyOffsetY_B()) <= 0) {
layoutParams.addRule(10, -1);
layoutParams.setMargins(e.a(this.f21409c, (float) privacyMarginLeft), 0, e.a(this.f21409c, (float) max), 0);
com.cmic.gen.sdk.e.c.b(f21407a, "privacy_top");
} else {
String str4 = f21407a;
com.cmic.gen.sdk.e.c.b(str4, "privacy_bottom=" + this.f21423q.getMeasuredHeight());
layoutParams.addRule(12, -1);
layoutParams.setMargins(e.a(this.f21409c, (float) privacyMarginLeft), 0, e.a(this.f21409c, (float) max), e.a(this.f21409c, (float) this.A.getPrivacyOffsetY_B()));
}
this.f21423q.setLayoutParams(layoutParams);
}
} else if (this.A.getLogBtnOffsetY_B() <= 0 || this.B - e.a(this.f21409c, (float) (this.A.getLogBtnHeight() + this.A.getLogBtnOffsetY_B())) <= 0) {
layoutParams3.addRule(10, -1);
} else {
com.cmic.gen.sdk.e.c.b(f21407a, "logBtn_bottom");
layoutParams3.addRule(12, -1);
layoutParams3.setMargins(e.a(this.f21409c, (float) max2), 0, e.a(this.f21409c, (float) max3), e.a(this.f21409c, (float) this.A.getLogBtnOffsetY_B()));
this.f21410d.setLayoutParams(layoutParams3);
layoutParams = (RelativeLayout.LayoutParams) this.f21423q.getLayoutParams();
if (this.A.getPrivacyMarginLeft() >= 0) {
}
max = Math.max(this.A.getPrivacyMarginRight(), 0);
int makeMeasureSpec22 = View.MeasureSpec.makeMeasureSpec(0, 0);
this.f21423q.measure(makeMeasureSpec22, makeMeasureSpec22);
if (this.A.getPrivacyOffsetY() <= 0) {
}
if (this.A.getPrivacyOffsetY() > 0) {
}
String str22 = f21407a;
com.cmic.gen.sdk.e.c.b(str22, "privacy_bottom=" + privacyMarginLeft);
layoutParams.addRule(12, -1);
layoutParams.setMargins(e.a(this.f21409c, (float) privacyMarginLeft), 0, e.a(this.f21409c, (float) max), 0);
this.f21423q.setLayoutParams(layoutParams);
}
layoutParams3.setMargins(e.a(this.f21409c, (float) max2), 0, e.a(this.f21409c, (float) max3), 0);
this.f21410d.setLayoutParams(layoutParams3);
layoutParams = (RelativeLayout.LayoutParams) this.f21423q.getLayoutParams();
if (this.A.getPrivacyMarginLeft() >= 0) {
}
max = Math.max(this.A.getPrivacyMarginRight(), 0);
int makeMeasureSpec222 = View.MeasureSpec.makeMeasureSpec(0, 0);
this.f21423q.measure(makeMeasureSpec222, makeMeasureSpec222);
if (this.A.getPrivacyOffsetY() <= 0) {
}
if (this.A.getPrivacyOffsetY() > 0) {
}
String str222 = f21407a;
com.cmic.gen.sdk.e.c.b(str222, "privacy_bottom=" + privacyMarginLeft);
layoutParams.addRule(12, -1);
layoutParams.setMargins(e.a(this.f21409c, (float) privacyMarginLeft), 0, e.a(this.f21409c, (float) max), 0);
this.f21423q.setLayoutParams(layoutParams);
}
private void f() {
int i10 = Build.VERSION.SDK_INT;
if (i10 >= 21) {
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.f21409c);
int a14 = e.a(this.f21409c);
this.C = a14;
boolean z14 = true;
if ((requestedOrientation == 1 && a14 > this.B) || (requestedOrientation == 0 && a14 < this.B)) {
this.C = this.B;
this.B = a14;
}
String str = f21407a;
com.cmic.gen.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.f21409c, (float) this.A.getWindowWidth());
int a15 = e.a(this.f21409c, (float) this.A.getWindowHeight());
attributes.height = a15;
this.C = attributes.width;
this.B = a15;
attributes.x = e.a(this.f21409c, (float) this.A.getWindowX());
if (this.A.getWindowBottom() == 1) {
getWindow().setGravity(80);
} else {
attributes.y = e.a(this.f21409c, (float) this.A.getWindowY());
}
getWindow().setAttributes(attributes);
}
relativeLayout.setFitsSystemWindows(this.A.isFitsSystemWindows());
relativeLayout.setClipToPadding(true);
try {
g();
relativeLayout.addView(this.f21424r);
relativeLayout.addView(h());
relativeLayout.addView(i());
e();
this.f21410d.setOnClickListener(this);
this.f21430x.setOnClickListener(this);
this.f21422p.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
/* class com.cmic.gen.sdk.view.GenLoginAuthActivity.AnonymousClass7 */
public void onCheckedChanged(CompoundButton compoundButton, boolean z14) {
CheckBox checkBox;
GenLoginAuthActivity genLoginAuthActivity;
String str;
if (GenLoginAuthActivity.this.A.getGenCheckedChangeListener() != null) {
GenLoginAuthActivity.this.A.getGenCheckedChangeListener().onCheckedChanged(z14);
}
boolean z15 = true;
if (z14) {
GenLoginAuthActivity.this.f21410d.setEnabled(true);
try {
CheckBox checkBox2 = GenLoginAuthActivity.this.f21422p;
GenLoginAuthActivity genLoginAuthActivity2 = GenLoginAuthActivity.this;
checkBox2.setBackgroundResource(c.b(genLoginAuthActivity2, genLoginAuthActivity2.A.getCheckedImgPath()));
return;
} catch (Exception unused) {
checkBox = GenLoginAuthActivity.this.f21422p;
genLoginAuthActivity = GenLoginAuthActivity.this;
str = "umcsdk_check_image";
}
} else {
RelativeLayout relativeLayout = GenLoginAuthActivity.this.f21410d;
if (GenLoginAuthActivity.this.A.getGenCheckBoxListener() == null && TextUtils.isEmpty(GenLoginAuthActivity.this.A.getCheckTipText())) {
z15 = false;
}
relativeLayout.setEnabled(z15);
try {
CheckBox checkBox3 = GenLoginAuthActivity.this.f21422p;
GenLoginAuthActivity genLoginAuthActivity3 = GenLoginAuthActivity.this;
checkBox3.setBackgroundResource(c.b(genLoginAuthActivity3, genLoginAuthActivity3.A.getUncheckedImgPath()));
return;
} catch (Exception unused2) {
checkBox = GenLoginAuthActivity.this.f21422p;
genLoginAuthActivity = GenLoginAuthActivity.this;
str = "umcsdk_uncheck_image";
}
}
checkBox.setBackgroundResource(c.b(genLoginAuthActivity, str));
}
});
k();
try {
if (this.A.isPrivacyState()) {
this.f21422p.setChecked(true);
this.f21422p.setBackgroundResource(c.b(this, this.A.getCheckedImgPath()));
this.f21410d.setEnabled(true);
return;
}
this.f21422p.setChecked(false);
RelativeLayout relativeLayout2 = this.f21410d;
if (this.A.getGenCheckBoxListener() == null) {
if (TextUtils.isEmpty(this.A.getCheckTipText())) {
z14 = false;
}
}
relativeLayout2.setEnabled(z14);
this.f21422p.setBackgroundResource(c.b(this, this.A.getUncheckedImgPath()));
} catch (Exception unused) {
this.f21422p.setChecked(false);
}
} catch (Exception e14) {
com.cmic.gen.sdk.d.c.f21259b.add(e14);
e14.printStackTrace();
com.cmic.gen.sdk.e.c.a(f21407a, e14.toString());
a("200040", "UI资源加载异常", this.f21419m, null);
}
}
/* JADX WARNING: Removed duplicated region for block: B:16:0x007b */
private void g() {
int i10;
RelativeLayout relativeLayout = new RelativeLayout(this);
this.f21424r = relativeLayout;
relativeLayout.setId(13107);
this.f21424r.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) {
i10 = 13;
} else {
if (numberOffsetX > 0) {
float f14 = (float) numberOffsetX;
if ((this.C - textView.getWidth()) - e.a(this.f21409c, f14) > 0) {
layoutParams.setMargins(e.a(this.f21409c, f14), 0, 0, 0);
} else {
com.cmic.gen.sdk.e.c.b(f21407a, "RelativeLayout.ALIGN_PARENT_RIGHT");
i10 = 11;
}
}
textView.setTextSize(2, (float) this.A.getNumberSize());
textView.setText(this.f21421o);
if (this.A.isNumberBold()) {
textView.setTypeface(Typeface.DEFAULT_BOLD);
}
textView.setId(30583);
this.f21424r.addView(textView, layoutParams);
textView.setTextColor(this.A.getNumberColor());
int makeMeasureSpec = View.MeasureSpec.makeMeasureSpec(0, 0);
this.f21424r.measure(makeMeasureSpec, makeMeasureSpec);
String str = f21407a;
com.cmic.gen.sdk.e.c.b(str, "mPhoneLayout.getMeasuredHeight()=" + this.f21424r.getMeasuredHeight());
}
layoutParams.addRule(i10);
try {
textView.setTextSize(2, (float) this.A.getNumberSize());
} catch (Exception unused) {
textView.setTextSize(2, 18.0f);
}
textView.setText(this.f21421o);
if (this.A.isNumberBold()) {
}
textView.setId(30583);
this.f21424r.addView(textView, layoutParams);
try {
textView.setTextColor(this.A.getNumberColor());
} catch (Exception unused2) {
textView.setTextColor(-13421773);
}
int makeMeasureSpec2 = View.MeasureSpec.makeMeasureSpec(0, 0);
this.f21424r.measure(makeMeasureSpec2, makeMeasureSpec2);
String str2 = f21407a;
com.cmic.gen.sdk.e.c.b(str2, "mPhoneLayout.getMeasuredHeight()=" + this.f21424r.getMeasuredHeight());
}
private RelativeLayout h() {
RelativeLayout relativeLayout = new RelativeLayout(this);
this.f21410d = relativeLayout;
relativeLayout.setId(17476);
this.f21410d.setLayoutParams(new RelativeLayout.LayoutParams(e.a(this.f21409c, (float) this.A.getLogBtnWidth()), e.a(this.f21409c, (float) this.A.getLogBtnHeight())));
TextView textView = new TextView(this);
textView.setTextSize(2, (float) 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.f21410d.addView(textView);
textView.setText(this.A.getLogBtnText());
try {
textView.setTextColor(this.A.getLogBtnTextColor());
} catch (Exception unused) {
textView.setTextColor(-1);
}
try {
this.f21410d.setBackgroundResource(c.b(this.f21409c, this.A.getLogBtnBackgroundPath()));
} catch (Exception e14) {
e14.printStackTrace();
this.f21410d.setBackgroundResource(c.b(this.f21409c, "umcsdk_login_btn_bg"));
}
return this.f21410d;
}
private RelativeLayout i() {
RelativeLayout relativeLayout = new RelativeLayout(this);
this.f21423q = relativeLayout;
relativeLayout.setHorizontalGravity(1);
this.f21423q.setLayoutParams(new RelativeLayout.LayoutParams(-1, -2));
int checkedImgWidth = this.A.getCheckedImgWidth();
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(e.a(this.f21409c, (float) Math.max(checkedImgWidth, 30)), e.a(this.f21409c, (float) Math.max(this.A.getCheckedImgHeight(), 30)));
if (this.A.getCheckBoxLocation() == 1) {
layoutParams.addRule(15, -1);
}
RelativeLayout relativeLayout2 = new RelativeLayout(this);
this.f21430x = relativeLayout2;
relativeLayout2.setId(34952);
this.f21430x.setLayoutParams(layoutParams);
CheckBox checkBox = new CheckBox(this);
this.f21422p = checkBox;
checkBox.setChecked(false);
RelativeLayout.LayoutParams layoutParams2 = new RelativeLayout.LayoutParams(e.a(this.f21409c, (float) this.A.getCheckedImgWidth()), e.a(this.f21409c, (float) this.A.getCheckedImgHeight()));
layoutParams2.setMargins(e.a(this.f21409c, checkedImgWidth > 30 ? 0.0f : (float) (30 - checkedImgWidth)), 0, 0, 0);
layoutParams2.addRule(11, -1);
if (this.A.getCheckBoxLocation() == 1) {
layoutParams2.addRule(15, -1);
}
this.f21422p.setLayoutParams(layoutParams2);
this.f21430x.addView(this.f21422p);
this.f21423q.addView(this.f21430x);
TextView textView = new TextView(this);
textView.setTextSize(2, (float) this.A.getPrivacyTextSize());
RelativeLayout.LayoutParams layoutParams3 = new RelativeLayout.LayoutParams(-2, -2);
layoutParams3.setMargins(e.a(this.f21409c, 5.0f), 0, 0, e.a(this.f21409c, 5.0f));
layoutParams3.addRule(1, 34952);
textView.setLayoutParams(layoutParams3);
this.f21423q.addView(textView);
textView.setTextColor(this.A.getClauseBaseColor());
textView.setText(e.a(this, this.f21432z, this.f21431y, this.f21411e, this.f21416j, this.f21417k));
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.f21422p.setButtonDrawable(new ColorDrawable());
try {
this.f21422p.setBackgroundResource(c.b(this, this.A.getUncheckedImgPath()));
} catch (Exception unused) {
this.f21422p.setBackgroundResource(c.b(this, "umcsdk_uncheck_image"));
}
return this.f21423q;
}
private String j() {
this.f21432z = this.A.getPrivacy();
if (this.A.isPrivacyBookSymbol()) {
this.f21431y = String.format("《%s》", this.f21431y);
}
if (this.f21432z.contains(GenAuthThemeConfig.PLACEHOLDER)) {
this.f21432z = this.f21432z.replace(GenAuthThemeConfig.PLACEHOLDER, this.f21431y);
}
return this.f21432z;
}
/* access modifiers changed from: private */
/* access modifiers changed from: public */
private void k() {
this.f21410d.setClickable(true);
this.f21422p.setClickable(true);
}
private void l() {
this.f21410d.setClickable(false);
this.f21422p.setClickable(false);
}
private void m() {
try {
if (this.f21426t >= 5) {
Toast.makeText(this.f21409c, "网络不稳定,请返回重试其他登录方式", 1).show();
this.f21410d.setClickable(true);
return;
}
StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
StringBuilder sb3 = new StringBuilder();
for (StackTraceElement stackTraceElement : stackTrace) {
com.cmic.gen.sdk.e.c.a("stack", stackTraceElement.getClassName());
String className = stackTraceElement.getClassName();
if (!TextUtils.isEmpty(className) && className.contains("com.cmic.gen.sdk.activity") && !sb3.toString().contains(className)) {
sb3.append(className);
sb3.append(f.f18324b);
}
}
this.f21419m.a("loginTime", System.currentTimeMillis());
String b14 = this.f21419m.b("traceId", "");
if (!TextUtils.isEmpty(b14) && e.a(b14)) {
String c14 = q.c();
this.f21419m.a("traceId", c14);
e.a(c14, this.f21428v);
}
b();
l();
c cVar = new c(this.f21419m);
this.f21408b.postDelayed(cVar, GenAuthnHelper.getInstance((Context) this).getOverTime());
n.a(new b(this, cVar));
} catch (Exception e14) {
e14.printStackTrace();
}
}
public void a() {
this.f21408b.removeCallbacksAndMessages(null);
d dVar = this.f21411e;
if (dVar != null && dVar.isShowing()) {
this.f21411e.dismiss();
}
d dVar2 = this.f21412f;
if (dVar2 != null && dVar2.isShowing()) {
this.f21412f.dismiss();
}
c();
this.E = null;
RelativeLayout relativeLayout = this.f21423q;
if (relativeLayout != null) {
relativeLayout.clearAnimation();
}
finish();
if (this.A.getAuthPageActOut() != null && this.A.getActivityIn() != null) {
overridePendingTransition(c.c(this, this.A.getActivityIn()), c.c(this, this.A.getAuthPageActOut()));
}
}
public void b() {
com.cmic.gen.sdk.e.c.a(f21407a, "loginClickStart");
try {
this.D = true;
if (this.A.getGenLoginClickListener() != null) {
this.A.getGenLoginClickListener().onLoginClickStart(this.f21409c, 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() {
/* class com.cmic.gen.sdk.view.GenLoginAuthActivity.AnonymousClass8 */
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(c.b(this.f21409c, "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 e14) {
e14.printStackTrace();
}
com.cmic.gen.sdk.e.c.a(f21407a, "loginClickStart");
}
public void c() {
try {
com.cmic.gen.sdk.e.c.a(f21407a, "loginClickComplete");
if (this.A.getGenLoginClickListener() == null || !this.D) {
Dialog dialog = this.E;
if (dialog != null && dialog.isShowing()) {
this.E.dismiss();
return;
}
return;
}
this.D = false;
this.A.getGenLoginClickListener().onLoginClickComplete(this.f21409c, null);
} catch (Exception e14) {
e14.printStackTrace();
}
}
public void onClick(View view) {
try {
int id3 = view.getId();
if (id3 == 17476) {
if (!this.f21422p.isChecked()) {
if (this.A.getPrivacyAnimation() != null) {
Context context = this.f21409c;
this.f21423q.startAnimation(AnimationUtils.loadAnimation(context, c.c(context, this.A.getPrivacyAnimation())));
}
if (this.A.getGenCheckBoxListener() != null) {
this.A.getGenCheckBoxListener().onLoginClick(this.f21409c, null);
return;
} else if (!TextUtils.isEmpty(this.A.getCheckTipText())) {
Toast.makeText(this.f21409c, this.A.getCheckTipText(), 1).show();
return;
}
}
this.f21426t++;
m();
} else if (id3 == 26214) {
a(false);
} else if (id3 == 34952) {
if (this.f21422p.isChecked()) {
this.f21422p.setChecked(false);
} else {
this.f21422p.setChecked(true);
}
}
} catch (Exception e14) {
com.cmic.gen.sdk.d.c.f21259b.add(e14);
e14.printStackTrace();
}
}
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
if (bundle != null) {
try {
finish();
} catch (Exception e14) {
if (this.f21419m == null) {
this.f21419m = new com.cmic.gen.sdk.a(0);
}
this.f21419m.a().f21233a.add(e14);
com.cmic.gen.sdk.e.c.a(f21407a, e14.toString());
e14.printStackTrace();
a("200025", "发生未知错误", this.f21419m, null);
return;
}
}
this.f21409c = 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(c.c(this, this.A.getAuthPageActIn()), c.c(this, this.A.getActivityOut()));
}
}
com.cmic.gen.sdk.d.a.a("authPageIn");
this.f21425s = System.currentTimeMillis();
this.f21420n = com.cmic.gen.sdk.auth.a.a(this);
d();
f();
}
public void onDestroy() {
try {
this.f21408b.removeCallbacksAndMessages(null);
com.cmic.gen.sdk.d.a.a("timeOnAuthPage", (System.currentTimeMillis() - this.f21425s) + "");
com.cmic.gen.sdk.d.a.a("authPrivacyState", this.f21422p.isChecked() ? "1" : "0");
com.cmic.gen.sdk.d.a.a(this.f21409c.getApplicationContext(), this.f21419m);
com.cmic.gen.sdk.d.a.a();
this.E = null;
b.a().c();
this.f21427u.removeCallbacksAndMessages(null);
} catch (Exception e14) {
com.cmic.gen.sdk.e.c.a(f21407a, "GenLoginAuthActivity clear failed");
com.cmic.gen.sdk.d.c.f21259b.add(e14);
e14.printStackTrace();
}
super.onDestroy();
}
public boolean onKeyUp(int i10, KeyEvent keyEvent) {
if (i10 != 4 || keyEvent.isCanceled() || keyEvent.getRepeatCount() != 0) {
return true;
}
if (this.A.getGenBackPressedListener() != null) {
this.A.getGenBackPressedListener().onBackPressed();
}
if (this.A.getWindowWidth() != 0 && !this.A.isBackButton()) {
return true;
}
a(false);
return true;
}
public void onResume() {
super.onResume();
try {
com.cmic.gen.sdk.a aVar = this.f21419m;
if (aVar != null) {
aVar.a("loginMethod", "loginAuth");
}
GenAuthnHelper.getInstance((Context) this).loginPageInCallBack("200087", null);
} catch (Exception e14) {
this.f21419m.a().f21233a.add(e14);
a("200025", "发生未知错误", this.f21419m, null);
}
}
}