热汗舞蹈 v1.24.1.0版本的 MD5 值为:f1dc6ef07903515a73f51f41f372123e

以下内容为反编译后的 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.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.gen.sdk.auth.GenAuthnHelper;
import com.cmic.gen.sdk.auth.GenTokenListener;
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 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 f6878a = GenLoginAuthActivity.class.getSimpleName();
    private GenAuthThemeConfig A;
    private int B;
    private int C;
    private boolean D;
    private Dialog E;
    private Handler f6879b;
    private Context f6880c;
    private RelativeLayout f6881d;
    private d f6882e;
    private d f6883f;
    private d f6884g;
    private d f6885h;
    private d f6886i;
    private ArrayList<d> f6887j;
    private ArrayList<String> f6888k;
    private String[] f6889l;
    private com.cmic.gen.sdk.a f6890m;
    private com.cmic.gen.sdk.auth.a f6891n;
    private CheckBox f6893p;
    private RelativeLayout f6894q;
    private RelativeLayout f6895r;
    private GenTokenListener f6899v;
    private RelativeLayout f6901x;
    private String f6902y;
    private String f6903z;
    private String f6892o = "";
    private long f6896s = 0;
    private int f6897t = 0;
    private a f6898u = null;
    private boolean f6900w = true;

    public static class a extends Handler {
        public WeakReference<GenLoginAuthActivity> f6912a;

        public a(GenLoginAuthActivity genLoginAuthActivity) {
            this.f6912a = new WeakReference<>(genLoginAuthActivity);
        }

        private void a(Message message) {
            GenLoginAuthActivity genLoginAuthActivity = this.f6912a.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.gen.sdk.d.c.f6772b.add(e10);
                e10.printStackTrace();
            }
        }
    }

    public static class b extends n.a {
        public WeakReference<GenLoginAuthActivity> f6913a;
        public WeakReference<c> f6914b;

        public b(GenLoginAuthActivity genLoginAuthActivity, c cVar) {
            this.f6913a = new WeakReference<>(genLoginAuthActivity);
            this.f6914b = new WeakReference<>(cVar);
        }

        public boolean b() {
            c cVar = this.f6914b.get();
            if (this.f6913a.get() == null || cVar == null) {
                return false;
            }
            return cVar.a(false);
        }

        @Override
        public void a() {
            final GenLoginAuthActivity genLoginAuthActivity = this.f6913a.get();
            genLoginAuthActivity.f6890m.a("logintype", 1);
            h.a(true, false);
            genLoginAuthActivity.f6891n.b(genLoginAuthActivity.f6890m, new com.cmic.gen.sdk.auth.b() {
                @Override
                public void a(String str, String str2, com.cmic.gen.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.f6900w = false;
                            com.cmic.gen.sdk.d.a.a("authClickFailed");
                        } else {
                            com.cmic.gen.sdk.d.a.a("authClickSuccess");
                            genLoginAuthActivity.f6900w = true;
                        }
                        genLoginAuthActivity.a(str, str2, aVar, jSONObject);
                        try {
                            Thread.sleep(1000L);
                        } catch (InterruptedException e10) {
                            e10.printStackTrace();
                        }
                        genLoginAuthActivity.f6898u.sendEmptyMessage(1);
                    }
                }
            });
        }
    }

    public class c implements Runnable {
        private com.cmic.gen.sdk.a f6918b;
        private boolean f6919c;

        public c(com.cmic.gen.sdk.a aVar) {
            this.f6918b = aVar;
        }

        public synchronized boolean a(boolean z10) {
            boolean z11;
            z11 = this.f6919c;
            this.f6919c = 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.f6900w = false;
                com.cmic.gen.sdk.d.a.a("authClickFailed");
                GenLoginAuthActivity.this.f6898u.sendEmptyMessage(1);
                long b10 = this.f6918b.b("loginTime", 0L);
                if (b10 != 0) {
                    this.f6918b.a("loginTime", System.currentTimeMillis() - b10);
                }
                GenLoginAuthActivity.this.a("102507", "请求超时", this.f6918b, jSONObject);
            }
        }
    }

    public void a(String str, String str2, com.cmic.gen.sdk.a aVar, JSONObject jSONObject) {
        GenAuthnHelper genAuthnHelper;
        try {
            if (this.f6879b == null) {
                this.f6879b = new Handler(getMainLooper());
                this.f6898u = new a(this);
            }
            this.f6879b.removeCallbacksAndMessages(null);
            if ("103000".equals(str)) {
                if (GenAuthnHelper.getInstance((Context) this) == null || com.cmic.gen.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.gen.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.gen.sdk.e.c.a(f6878a, "CallbackResult:未知错误");
            e10.printStackTrace();
        }
    }

    public void a(boolean z10) {
        try {
            com.cmic.gen.sdk.d.a.a("authPageOut");
            a("200020", "登录页面关闭", this.f6890m, null);
        } catch (Exception e10) {
            com.cmic.gen.sdk.d.c.f6772b.add(e10);
            e10.printStackTrace();
        }
    }

    private void d() {
        String str;
        com.cmic.gen.sdk.a d10 = com.cmic.gen.sdk.e.e.d(getIntent().getStringExtra("traceId"));
        this.f6890m = d10;
        if (d10 == null) {
            this.f6890m = new com.cmic.gen.sdk.a(0);
        }
        this.f6899v = com.cmic.gen.sdk.e.e.c(this.f6890m.b("traceId", ""));
        getWindowManager().getDefaultDisplay().getMetrics(new DisplayMetrics());
        this.f6879b = new Handler(getMainLooper());
        this.f6898u = new a(this);
        this.f6892o = this.f6890m.b("securityphone");
        String str2 = f6878a;
        com.cmic.gen.sdk.e.c.b(str2, "mSecurityPhone value is " + this.f6892o);
        String b10 = this.f6890m.b("operatortype", "");
        com.cmic.gen.sdk.e.c.b(str2, "operator value is " + b10);
        if (this.A.getAppLanguageType() == 1) {
            this.f6889l = com.cmic.gen.sdk.c.f6644b;
        } else if (this.A.getAppLanguageType() == 2) {
            this.f6889l = com.cmic.gen.sdk.c.f6645c;
        } else {
            this.f6889l = com.cmic.gen.sdk.c.f6643a;
        }
        if (b10.equals("1")) {
            this.f6902y = this.f6889l[0];
            str = "https://wap.cmpassport.com/resources/html/contract.html";
        } else if (b10.equals(ExifInterface.GPS_MEASUREMENT_3D)) {
            this.f6902y = this.f6889l[1];
            str = "https://e.189.cn/sdk/agreement/detail.do?hidetop=true";
        } else {
            this.f6902y = this.f6889l[2];
            str = "https://opencloud.wostore.cn/authz/resource/html/disclaimer.html?fromsdk=true";
        }
        d dVar = new d(this.f6880c, 16973840, this.f6902y, str);
        this.f6882e = 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.f6882e.b();
                }
                return true;
            }
        });
        this.f6887j = new ArrayList<>();
        this.f6888k = new ArrayList<>();
        if (!TextUtils.isEmpty(this.A.getClauseUrl())) {
            d dVar2 = new d(this.f6880c, 16973840, this.A.getClauseName(), this.A.getClauseUrl());
            this.f6883f = 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.f6883f.b();
                    }
                    return true;
                }
            });
            this.f6887j.add(this.f6883f);
            this.f6888k.add(this.A.getClauseName());
        }
        if (!TextUtils.isEmpty(this.A.getClauseUrl2())) {
            d dVar3 = new d(this.f6880c, 16973840, this.A.getClauseName2(), this.A.getClauseUrl2());
            this.f6884g = 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.f6884g.b();
                    }
                    return true;
                }
            });
            this.f6887j.add(this.f6884g);
            this.f6888k.add(this.A.getClauseName2());
        }
        if (!TextUtils.isEmpty(this.A.getClauseUrl3())) {
            d dVar4 = new d(this.f6880c, 16973840, this.A.getClauseName3(), this.A.getClauseUrl3());
            this.f6885h = 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.f6885h.b();
                    }
                    return true;
                }
            });
            this.f6887j.add(this.f6885h);
            this.f6888k.add(this.A.getClauseName3());
        }
        if (!TextUtils.isEmpty(this.A.getClauseUrl4())) {
            d dVar5 = new d(this.f6880c, 16973840, this.A.getClauseName4(), this.A.getClauseUrl4());
            this.f6886i = 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.f6886i.b();
                    }
                    return true;
                }
            });
            this.f6887j.add(this.f6886i);
            this.f6888k.add(this.A.getClauseName4());
        }
        j();
        if (this.A.isPrivacyBookSymbol()) {
            for (int i10 = 0; i10 < this.f6888k.size(); i10++) {
                String format = String.format("《%s》", this.f6888k.get(i10));
                this.f6903z = this.f6903z.replaceFirst(this.f6888k.get(i10), format);
                this.f6888k.set(i10, format);
            }
        }
        com.cmic.gen.sdk.view.b.a().a(new b.a() {
            @Override
            public void a() {
                GenLoginAuthActivity.this.f6879b.removeCallbacksAndMessages(null);
                if (GenLoginAuthActivity.this.f6882e != null && GenLoginAuthActivity.this.f6882e.isShowing()) {
                    GenLoginAuthActivity.this.f6882e.dismiss();
                }
                if (GenLoginAuthActivity.this.f6883f != null && GenLoginAuthActivity.this.f6883f.isShowing()) {
                    GenLoginAuthActivity.this.f6883f.dismiss();
                }
                GenLoginAuthActivity.this.a(true);
            }
        });
    }

    private void e() {
        RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) this.f6895r.getLayoutParams();
        if (this.A.getNumFieldOffsetY() > 0 || this.A.getNumFieldOffsetY_B() < 0) {
            int makeMeasureSpec = View.MeasureSpec.makeMeasureSpec(0, 0);
            this.f6895r.measure(makeMeasureSpec, makeMeasureSpec);
            String str = f6878a;
            com.cmic.gen.sdk.e.c.b(str, "mPhoneLayout.getMeasuredHeight()=" + this.f6895r.getMeasuredHeight());
            if (this.A.getNumFieldOffsetY() <= 0 || (this.B - this.f6895r.getMeasuredHeight()) - e.a(this.f6880c, this.A.getNumFieldOffsetY()) <= 0) {
                layoutParams.addRule(12, -1);
            } else {
                com.cmic.gen.sdk.e.c.b(str, "numberField_top");
                layoutParams.addRule(10, -1);
                layoutParams.setMargins(0, e.a(this.f6880c, this.A.getNumFieldOffsetY()), 0, 0);
            }
        } else if (this.A.getNumFieldOffsetY_B() <= 0 || (this.B - this.f6895r.getMeasuredHeight()) - e.a(this.f6880c, this.A.getNumFieldOffsetY_B()) <= 0) {
            layoutParams.addRule(10, -1);
        } else {
            com.cmic.gen.sdk.e.c.b(f6878a, "numberField_bottom");
            layoutParams.addRule(12, -1);
            layoutParams.setMargins(0, 0, 0, e.a(this.f6880c, this.A.getNumFieldOffsetY_B()));
        }
        this.f6895r.setLayoutParams(layoutParams);
        RelativeLayout.LayoutParams layoutParams2 = (RelativeLayout.LayoutParams) this.f6881d.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.f6880c, this.A.getLogBtnHeight() + this.A.getLogBtnOffsetY()) <= 0) {
                layoutParams2.addRule(12, -1);
                layoutParams2.setMargins(e.a(this.f6880c, max), 0, e.a(this.f6880c, max2), 0);
            } else {
                com.cmic.gen.sdk.e.c.b(f6878a, "logBtn_top");
                layoutParams2.addRule(10, -1);
                layoutParams2.setMargins(e.a(this.f6880c, max), e.a(this.f6880c, this.A.getLogBtnOffsetY()), e.a(this.f6880c, max2), 0);
            }
        } else if (this.A.getLogBtnOffsetY_B() <= 0 || this.B - e.a(this.f6880c, this.A.getLogBtnHeight() + this.A.getLogBtnOffsetY_B()) <= 0) {
            layoutParams2.addRule(10, -1);
            layoutParams2.setMargins(e.a(this.f6880c, max), 0, e.a(this.f6880c, max2), 0);
        } else {
            com.cmic.gen.sdk.e.c.b(f6878a, "logBtn_bottom");
            layoutParams2.addRule(12, -1);
            layoutParams2.setMargins(e.a(this.f6880c, max), 0, e.a(this.f6880c, max2), e.a(this.f6880c, this.A.getLogBtnOffsetY_B()));
        }
        this.f6881d.setLayoutParams(layoutParams2);
        RelativeLayout.LayoutParams layoutParams3 = (RelativeLayout.LayoutParams) this.f6894q.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.f6894q.measure(makeMeasureSpec2, makeMeasureSpec2);
        if (this.A.getPrivacyOffsetY() > 0 || this.A.getPrivacyOffsetY_B() < 0) {
            if (this.A.getPrivacyOffsetY() <= 0 || (this.B - this.f6894q.getMeasuredHeight()) - e.a(this.f6880c, this.A.getPrivacyOffsetY()) <= 0) {
                String str2 = f6878a;
                com.cmic.gen.sdk.e.c.b(str2, "privacy_bottom=" + privacyMarginLeft);
                layoutParams3.addRule(12, -1);
                layoutParams3.setMargins(e.a(this.f6880c, (float) privacyMarginLeft), 0, e.a(this.f6880c, (float) max3), 0);
            } else {
                String str3 = f6878a;
                com.cmic.gen.sdk.e.c.b(str3, "privacy_top = " + this.f6894q.getMeasuredHeight());
                layoutParams3.addRule(10, -1);
                layoutParams3.setMargins(e.a(this.f6880c, (float) privacyMarginLeft), e.a(this.f6880c, (float) this.A.getPrivacyOffsetY()), e.a(this.f6880c, (float) max3), 0);
            }
        } else if (this.A.getPrivacyOffsetY_B() <= 0 || (this.B - this.f6894q.getMeasuredHeight()) - e.a(this.f6880c, this.A.getPrivacyOffsetY_B()) <= 0) {
            layoutParams3.addRule(10, -1);
            layoutParams3.setMargins(e.a(this.f6880c, privacyMarginLeft), 0, e.a(this.f6880c, max3), 0);
            com.cmic.gen.sdk.e.c.b(f6878a, "privacy_top");
        } else {
            String str4 = f6878a;
            com.cmic.gen.sdk.e.c.b(str4, "privacy_bottom=" + this.f6894q.getMeasuredHeight());
            layoutParams3.addRule(12, -1);
            layoutParams3.setMargins(e.a(this.f6880c, (float) privacyMarginLeft), 0, e.a(this.f6880c, (float) max3), e.a(this.f6880c, (float) this.A.getPrivacyOffsetY_B()));
        }
        this.f6894q.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.f6880c);
        int a10 = e.a(this.f6880c);
        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 = f6878a;
        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.f6880c, this.A.getWindowWidth());
            int a11 = e.a(this.f6880c, this.A.getWindowHeight());
            attributes.height = a11;
            this.C = attributes.width;
            this.B = a11;
            attributes.x = e.a(this.f6880c, this.A.getWindowX());
            if (this.A.getWindowBottom() == 1) {
                getWindow().setGravity(80);
            } else {
                attributes.y = e.a(this.f6880c, this.A.getWindowY());
            }
            getWindow().setAttributes(attributes);
        }
        relativeLayout.setFitsSystemWindows(this.A.isFitsSystemWindows());
        relativeLayout.setClipToPadding(true);
        try {
            g();
            relativeLayout.addView(this.f6895r);
            relativeLayout.addView(h());
            relativeLayout.addView(i());
            e();
            this.f6881d.setOnClickListener(this);
            this.f6901x.setOnClickListener(this);
            this.f6893p.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.f6881d.setEnabled(true);
                        try {
                            CheckBox checkBox2 = GenLoginAuthActivity.this.f6893p;
                            GenLoginAuthActivity genLoginAuthActivity2 = GenLoginAuthActivity.this;
                            checkBox2.setBackgroundResource(com.cmic.gen.sdk.view.c.b(genLoginAuthActivity2, genLoginAuthActivity2.A.getCheckedImgPath()));
                        } catch (Exception unused) {
                            checkBox = GenLoginAuthActivity.this.f6893p;
                            genLoginAuthActivity = GenLoginAuthActivity.this;
                            str2 = "umcsdk_check_image";
                            checkBox.setBackgroundResource(com.cmic.gen.sdk.view.c.b(genLoginAuthActivity, str2));
                            SensorsDataAutoTrackHelper.trackViewOnClick(compoundButton);
                        }
                    } else {
                        RelativeLayout relativeLayout2 = GenLoginAuthActivity.this.f6881d;
                        if (GenLoginAuthActivity.this.A.getGenCheckBoxListener() == null && TextUtils.isEmpty(GenLoginAuthActivity.this.A.getCheckTipText())) {
                            z12 = false;
                        }
                        relativeLayout2.setEnabled(z12);
                        try {
                            CheckBox checkBox3 = GenLoginAuthActivity.this.f6893p;
                            GenLoginAuthActivity genLoginAuthActivity3 = GenLoginAuthActivity.this;
                            checkBox3.setBackgroundResource(com.cmic.gen.sdk.view.c.b(genLoginAuthActivity3, genLoginAuthActivity3.A.getUncheckedImgPath()));
                        } catch (Exception unused2) {
                            checkBox = GenLoginAuthActivity.this.f6893p;
                            genLoginAuthActivity = GenLoginAuthActivity.this;
                            str2 = "umcsdk_uncheck_image";
                            checkBox.setBackgroundResource(com.cmic.gen.sdk.view.c.b(genLoginAuthActivity, str2));
                            SensorsDataAutoTrackHelper.trackViewOnClick(compoundButton);
                        }
                    }
                    SensorsDataAutoTrackHelper.trackViewOnClick(compoundButton);
                }
            });
            k();
            try {
                if (this.A.isPrivacyState()) {
                    this.f6893p.setChecked(true);
                    this.f6893p.setBackgroundResource(com.cmic.gen.sdk.view.c.b(this, this.A.getCheckedImgPath()));
                    this.f6881d.setEnabled(true);
                    return;
                }
                this.f6893p.setChecked(false);
                RelativeLayout relativeLayout2 = this.f6881d;
                if (this.A.getGenCheckBoxListener() == null && TextUtils.isEmpty(this.A.getCheckTipText())) {
                    z10 = false;
                }
                relativeLayout2.setEnabled(z10);
                this.f6893p.setBackgroundResource(com.cmic.gen.sdk.view.c.b(this, this.A.getUncheckedImgPath()));
            } catch (Exception unused) {
                this.f6893p.setChecked(false);
            }
        } catch (Exception e10) {
            com.cmic.gen.sdk.d.c.f6772b.add(e10);
            e10.printStackTrace();
            com.cmic.gen.sdk.e.c.a(f6878a, e10.toString());
            a("200040", "UI资源加载异常", this.f6890m, null);
        }
    }

    private void g() {
        int i10;
        RelativeLayout relativeLayout = new RelativeLayout(this);
        this.f6895r = relativeLayout;
        relativeLayout.setId(13107);
        this.f6895r.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.f6880c, f10) > 0) {
                    layoutParams.setMargins(e.a(this.f6880c, f10), 0, 0, 0);
                } else {
                    com.cmic.gen.sdk.e.c.b(f6878a, "RelativeLayout.ALIGN_PARENT_RIGHT");
                    i10 = 11;
                }
            }
            textView.setTextSize(2, this.A.getNumberSize());
            textView.setText(this.f6892o);
            if (this.A.isNumberBold()) {
                textView.setTypeface(Typeface.DEFAULT_BOLD);
            }
            textView.setId(30583);
            this.f6895r.addView(textView, layoutParams);
            textView.setTextColor(this.A.getNumberColor());
            int makeMeasureSpec = View.MeasureSpec.makeMeasureSpec(0, 0);
            this.f6895r.measure(makeMeasureSpec, makeMeasureSpec);
            com.cmic.gen.sdk.e.c.b(f6878a, "mPhoneLayout.getMeasuredHeight()=" + this.f6895r.getMeasuredHeight());
        }
        i10 = 13;
        layoutParams.addRule(i10);
        textView.setTextSize(2, this.A.getNumberSize());
        textView.setText(this.f6892o);
        if (this.A.isNumberBold()) {
        }
        textView.setId(30583);
        this.f6895r.addView(textView, layoutParams);
        textView.setTextColor(this.A.getNumberColor());
        int makeMeasureSpec2 = View.MeasureSpec.makeMeasureSpec(0, 0);
        this.f6895r.measure(makeMeasureSpec2, makeMeasureSpec2);
        com.cmic.gen.sdk.e.c.b(f6878a, "mPhoneLayout.getMeasuredHeight()=" + this.f6895r.getMeasuredHeight());
    }

    private RelativeLayout h() {
        RelativeLayout relativeLayout = new RelativeLayout(this);
        this.f6881d = relativeLayout;
        relativeLayout.setId(17476);
        this.f6881d.setLayoutParams(new RelativeLayout.LayoutParams(e.a(this.f6880c, this.A.getLogBtnWidth()), e.a(this.f6880c, 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.f6881d.addView(textView);
        textView.setText(this.A.getLogBtnText());
        try {
            textView.setTextColor(this.A.getLogBtnTextColor());
        } catch (Exception unused) {
            textView.setTextColor(-1);
        }
        try {
            this.f6881d.setBackgroundResource(com.cmic.gen.sdk.view.c.b(this.f6880c, this.A.getLogBtnBackgroundPath()));
        } catch (Exception e10) {
            e10.printStackTrace();
            this.f6881d.setBackgroundResource(com.cmic.gen.sdk.view.c.b(this.f6880c, "umcsdk_login_btn_bg"));
        }
        return this.f6881d;
    }

    private RelativeLayout i() {
        RelativeLayout relativeLayout = new RelativeLayout(this);
        this.f6894q = relativeLayout;
        relativeLayout.setHorizontalGravity(1);
        this.f6894q.setLayoutParams(new RelativeLayout.LayoutParams(-1, -2));
        int checkedImgWidth = this.A.getCheckedImgWidth();
        RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(e.a(this.f6880c, Math.max(checkedImgWidth, 30)), e.a(this.f6880c, Math.max(this.A.getCheckedImgHeight(), 30)));
        if (this.A.getCheckBoxLocation() == 1) {
            layoutParams.addRule(15, -1);
        }
        RelativeLayout relativeLayout2 = new RelativeLayout(this);
        this.f6901x = relativeLayout2;
        relativeLayout2.setId(34952);
        this.f6901x.setLayoutParams(layoutParams);
        CheckBox checkBox = new CheckBox(this);
        this.f6893p = checkBox;
        checkBox.setChecked(false);
        RelativeLayout.LayoutParams layoutParams2 = new RelativeLayout.LayoutParams(e.a(this.f6880c, this.A.getCheckedImgWidth()), e.a(this.f6880c, this.A.getCheckedImgHeight()));
        layoutParams2.setMargins(e.a(this.f6880c, checkedImgWidth > 30 ? 0.0f : 30 - checkedImgWidth), 0, 0, 0);
        layoutParams2.addRule(11, -1);
        if (this.A.getCheckBoxLocation() == 1) {
            layoutParams2.addRule(15, -1);
        }
        this.f6893p.setLayoutParams(layoutParams2);
        this.f6901x.addView(this.f6893p);
        this.f6894q.addView(this.f6901x);
        TextView textView = new TextView(this);
        textView.setTextSize(2, this.A.getPrivacyTextSize());
        RelativeLayout.LayoutParams layoutParams3 = new RelativeLayout.LayoutParams(-2, -2);
        layoutParams3.setMargins(e.a(this.f6880c, 5.0f), 0, 0, e.a(this.f6880c, 5.0f));
        layoutParams3.addRule(1, 34952);
        textView.setLayoutParams(layoutParams3);
        this.f6894q.addView(textView);
        textView.setTextColor(this.A.getClauseBaseColor());
        textView.setText(e.a(this, this.f6903z, this.f6902y, this.f6882e, this.f6887j, this.f6888k));
        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.f6893p.setButtonDrawable(new ColorDrawable());
        try {
            this.f6893p.setBackgroundResource(com.cmic.gen.sdk.view.c.b(this, this.A.getUncheckedImgPath()));
        } catch (Exception unused) {
            this.f6893p.setBackgroundResource(com.cmic.gen.sdk.view.c.b(this, "umcsdk_uncheck_image"));
        }
        return this.f6894q;
    }

    private String j() {
        this.f6903z = this.A.getPrivacy();
        if (this.A.isPrivacyBookSymbol()) {
            this.f6902y = String.format("《%s》", this.f6902y);
        }
        if (this.f6903z.contains("$$运营商条款$$")) {
            this.f6903z = this.f6903z.replace("$$运营商条款$$", this.f6902y);
        }
        return this.f6903z;
    }

    public void k() {
        this.f6881d.setClickable(true);
        this.f6893p.setClickable(true);
    }

    private void l() {
        this.f6881d.setClickable(false);
        this.f6893p.setClickable(false);
    }

    private void m() {
        try {
            if (this.f6897t >= 5) {
                Toast.makeText(this.f6880c, "网络不稳定,请返回重试其他登录方式", 1).show();
                this.f6881d.setClickable(true);
                return;
            }
            StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
            StringBuilder sb2 = 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") && !sb2.toString().contains(className)) {
                    sb2.append(className);
                    sb2.append(";");
                }
            }
            this.f6890m.a("loginTime", System.currentTimeMillis());
            String b10 = this.f6890m.b("traceId", "");
            if (!TextUtils.isEmpty(b10) && com.cmic.gen.sdk.e.e.a(b10)) {
                String c10 = q.c();
                this.f6890m.a("traceId", c10);
                com.cmic.gen.sdk.e.e.a(c10, this.f6899v);
            }
            b();
            l();
            c cVar = new c(this.f6890m);
            this.f6879b.postDelayed(cVar, GenAuthnHelper.getInstance((Context) this).getOverTime());
            n.a(new b(this, cVar));
        } catch (Exception e10) {
            e10.printStackTrace();
        }
    }

    public void a() {
        this.f6879b.removeCallbacksAndMessages(null);
        d dVar = this.f6882e;
        if (dVar != null && dVar.isShowing()) {
            this.f6882e.dismiss();
        }
        d dVar2 = this.f6883f;
        if (dVar2 != null && dVar2.isShowing()) {
            this.f6883f.dismiss();
        }
        c();
        this.E = null;
        RelativeLayout relativeLayout = this.f6894q;
        if (relativeLayout != null) {
            relativeLayout.clearAnimation();
        }
        finish();
        if (this.A.getAuthPageActOut() == null || this.A.getActivityIn() == null) {
            return;
        }
        overridePendingTransition(com.cmic.gen.sdk.view.c.c(this, this.A.getActivityIn()), com.cmic.gen.sdk.view.c.c(this, this.A.getAuthPageActOut()));
    }

    public void b() {
        com.cmic.gen.sdk.e.c.a(f6878a, "loginClickStart");
        try {
            this.D = true;
            if (this.A.getGenLoginClickListener() != null) {
                this.A.getGenLoginClickListener().onLoginClickStart(this.f6880c, 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.gen.sdk.view.c.b(this.f6880c, "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.gen.sdk.e.c.a(f6878a, "loginClickStart");
    }

    public void c() {
        try {
            com.cmic.gen.sdk.e.c.a(f6878a, "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.f6880c, null);
            }
        } catch (Exception e10) {
            e10.printStackTrace();
        }
    }

    @Override
    @SensorsDataInstrumented
    public void onClick(View view) {
        try {
            int id2 = view.getId();
            if (id2 == 17476) {
                if (!this.f6893p.isChecked()) {
                    if (this.A.getPrivacyAnimation() != null) {
                        Context context = this.f6880c;
                        this.f6894q.startAnimation(AnimationUtils.loadAnimation(context, com.cmic.gen.sdk.view.c.c(context, this.A.getPrivacyAnimation())));
                    }
                    if (this.A.getGenCheckBoxListener() != null) {
                        this.A.getGenCheckBoxListener().onLoginClick(this.f6880c, null);
                        SensorsDataAutoTrackHelper.trackViewOnClick(view);
                        return;
                    } else if (!TextUtils.isEmpty(this.A.getCheckTipText())) {
                        Toast.makeText(this.f6880c, this.A.getCheckTipText(), 1).show();
                        SensorsDataAutoTrackHelper.trackViewOnClick(view);
                        return;
                    }
                }
                this.f6897t++;
                m();
            } else if (id2 == 26214) {
                a(false);
            } else if (id2 == 34952) {
                if (this.f6893p.isChecked()) {
                    this.f6893p.setChecked(false);
                } else {
                    this.f6893p.setChecked(true);
                }
            }
        } catch (Exception e10) {
            com.cmic.gen.sdk.d.c.f6772b.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.f6890m == null) {
                    this.f6890m = new com.cmic.gen.sdk.a(0);
                }
                this.f6890m.a().f6746a.add(e10);
                com.cmic.gen.sdk.e.c.a(f6878a, e10.toString());
                e10.printStackTrace();
                a("200025", "发生未知错误", this.f6890m, null);
                return;
            }
        }
        this.f6880c = 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.gen.sdk.view.c.c(this, this.A.getAuthPageActIn()), com.cmic.gen.sdk.view.c.c(this, this.A.getActivityOut()));
            }
        }
        com.cmic.gen.sdk.d.a.a("authPageIn");
        this.f6896s = System.currentTimeMillis();
        this.f6891n = com.cmic.gen.sdk.auth.a.a(this);
        d();
        f();
    }

    @Override
    public void onDestroy() {
        try {
            this.f6879b.removeCallbacksAndMessages(null);
            com.cmic.gen.sdk.d.a.a("timeOnAuthPage", (System.currentTimeMillis() - this.f6896s) + "");
            com.cmic.gen.sdk.d.a.a("authPrivacyState", this.f6893p.isChecked() ? "1" : TPReportParams.ERROR_CODE_NO_ERROR);
            com.cmic.gen.sdk.d.a.a(this.f6880c.getApplicationContext(), this.f6890m);
            com.cmic.gen.sdk.d.a.a();
            this.E = null;
            com.cmic.gen.sdk.view.b.a().c();
            this.f6898u.removeCallbacksAndMessages(null);
        } catch (Exception e10) {
            com.cmic.gen.sdk.e.c.a(f6878a, "GenLoginAuthActivity clear failed");
            com.cmic.gen.sdk.d.c.f6772b.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.gen.sdk.a aVar = this.f6890m;
            if (aVar != null) {
                aVar.a("loginMethod", "loginAuth");
            }
            GenAuthnHelper.getInstance((Context) this).loginPageInCallBack("200087", null);
        } catch (Exception e10) {
            this.f6890m.a().f6746a.add(e10);
            a("200025", "发生未知错误", this.f6890m, null);
        }
    }
}