CarrotChat v2.8.80.240429版本的 MD5 值为:fdf98761f01e715a89df24b85b0d206e

以下内容为反编译后的 PrivacyDialogActivity.java 源代码,内容仅作参考


package com.mobile.auth.gatewayauth;

import android.app.Activity;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
import android.os.Bundle;
import android.text.SpannableString;
import android.text.TextPaint;
import android.text.style.ClickableSpan;
import android.view.MotionEvent;
import android.view.View;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import com.mobile.auth.gatewayauth.annotations.AuthNumber;
import com.mobile.auth.gatewayauth.annotations.SafeProtector;
import com.mobile.auth.gatewayauth.utils.k;
import com.mobile.auth.gatewayauth.utils.l;
import com.nirvana.tools.core.AppUtils;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;

@AuthNumber
public class PrivacyDialogActivity extends Activity {
    private static final int DP_MODE = 1073741824;
    public static final String EXIST = "exist";
    private static final int MODE_MASK = -1073741824;
    private static final int MODE_SHIFT = 30;
    public static final String STOP_LOADING = "stop_loading";
    private int dailogWidth;
    private TextView mAgreeBtn;
    private RelativeLayout mBodyRL;
    private RelativeLayout mBtnRL;
    private RelativeLayout mMainBackground;
    private RelativeLayout mMainRelativeLayout;
    private com.mobile.auth.q.a mPnsLogger;
    private com.mobile.auth.y.a mProgressDialog;
    private String mProtocol = "";
    private List<com.mobile.auth.gatewayauth.ui.b> mProtocolConfigs = new ArrayList(3);
    private RelativeLayout mProtocolRL;
    private TextView mProtocolTV;
    private RelativeLayout mTitleRL;
    private AuthUIConfig mUIConfig;
    private d mUIManager;
    private int mUIManagerID;
    private String mVendorClick;
    private String mVendorKey;
    private String mVendorProtocol;

    class AnonymousClass1 implements View.OnClickListener {

        final LinkedHashMap f29773a;

        final String f29774b;

        AnonymousClass1(LinkedHashMap linkedHashMap, String str) {
            this.f29773a = linkedHashMap;
            this.f29774b = str;
        }

        @Override
        public void onClick(View view) {
            CustomInterface customInterface;
            try {
                AuthRegisterViewConfig authRegisterViewConfig = (AuthRegisterViewConfig) this.f29773a.get(this.f29774b);
                if (authRegisterViewConfig == null || (customInterface = authRegisterViewConfig.getCustomInterface()) == null) {
                    return;
                }
                customInterface.onClick(PrivacyDialogActivity.this);
            } catch (Throwable th) {
                ExceptionProcessor.processException(th);
            }
        }
    }

    class AnonymousClass2 implements View.OnClickListener {

        final LinkedHashMap f29776a;

        final String f29777b;

        AnonymousClass2(LinkedHashMap linkedHashMap, String str) {
            this.f29776a = linkedHashMap;
            this.f29777b = str;
        }

        @Override
        public void onClick(View view) {
            CustomInterface customInterface;
            try {
                AuthRegisterViewConfig authRegisterViewConfig = (AuthRegisterViewConfig) this.f29776a.get(this.f29777b);
                if (authRegisterViewConfig == null || (customInterface = authRegisterViewConfig.getCustomInterface()) == null) {
                    return;
                }
                customInterface.onClick(PrivacyDialogActivity.this);
            } catch (Throwable th) {
                ExceptionProcessor.processException(th);
            }
        }
    }

    class AnonymousClass3 implements View.OnClickListener {

        final LinkedHashMap f29779a;

        final String f29780b;

        AnonymousClass3(LinkedHashMap linkedHashMap, String str) {
            this.f29779a = linkedHashMap;
            this.f29780b = str;
        }

        @Override
        public void onClick(View view) {
            CustomInterface customInterface;
            try {
                AuthRegisterViewConfig authRegisterViewConfig = (AuthRegisterViewConfig) this.f29779a.get(this.f29780b);
                if (authRegisterViewConfig == null || (customInterface = authRegisterViewConfig.getCustomInterface()) == null) {
                    return;
                }
                customInterface.onClick(PrivacyDialogActivity.this);
            } catch (Throwable th) {
                ExceptionProcessor.processException(th);
            }
        }
    }

    class AnonymousClass4 implements View.OnClickListener {
        AnonymousClass4() {
        }

        @Override
        public void onClick(View view) {
            try {
                PrivacyDialogActivity.access$100(PrivacyDialogActivity.this).e(PrivacyDialogActivity.access$000(PrivacyDialogActivity.this));
                PrivacyDialogActivity.access$100(PrivacyDialogActivity.this).f(PrivacyDialogActivity.access$000(PrivacyDialogActivity.this));
                PrivacyDialogActivity.access$200(PrivacyDialogActivity.this, false, ResultCode.CODE_AUTH_PRIVACY_CLOSE, ResultCode.MSG_AUTH_PRIVACY_CLOSE);
            } catch (Throwable th) {
                ExceptionProcessor.processException(th);
            }
        }
    }

    class AnonymousClass6 implements View.OnTouchListener {
        AnonymousClass6() {
        }

        @Override
        public boolean onTouch(View view, MotionEvent motionEvent) {
            return true;
        }
    }

    class AnonymousClass7 implements View.OnClickListener {
        AnonymousClass7() {
        }

        @Override
        public void onClick(View view) {
            try {
                PrivacyDialogActivity.access$100(PrivacyDialogActivity.this).f(PrivacyDialogActivity.access$000(PrivacyDialogActivity.this));
                PrivacyDialogActivity.access$200(PrivacyDialogActivity.this, true, ResultCode.CODE_AUTH_PRIVACY_CLOSE, ResultCode.MSG_AUTH_PRIVACY_CLOSE);
            } catch (Throwable th) {
                ExceptionProcessor.processException(th);
            }
        }
    }

    class AnonymousClass9 extends ClickableSpan {

        final String f29790a;

        final String f29791b;

        final int f29792c;

        AnonymousClass9(String str, String str2, int i10) {
            this.f29790a = str;
            this.f29791b = str2;
            this.f29792c = i10;
        }

        @Override
        public void onClick(View view) {
            try {
                PrivacyDialogActivity.access$100(PrivacyDialogActivity.this).b(PrivacyDialogActivity.access$000(PrivacyDialogActivity.this), this.f29790a, this.f29791b, false);
                PrivacyDialogActivity.access$100(PrivacyDialogActivity.this).a(this.f29790a, this.f29791b);
            } catch (Throwable th) {
                ExceptionProcessor.processException(th);
            }
        }

        @Override
        public void updateDrawState(TextPaint textPaint) {
            try {
                super.updateDrawState(textPaint);
                textPaint.setColor(this.f29792c);
                if (PrivacyDialogActivity.access$300(PrivacyDialogActivity.this).isPrivacyAlertProtocolNameUseUnderLine()) {
                    textPaint.setUnderlineText(true);
                } else {
                    textPaint.setUnderlineText(false);
                }
                if (PrivacyDialogActivity.access$300(PrivacyDialogActivity.this).getPrivacyAlertProtocolNameTypeface() != null) {
                    textPaint.setTypeface(PrivacyDialogActivity.access$300(PrivacyDialogActivity.this).getPrivacyAlertProtocolNameTypeface());
                }
            } catch (Throwable th) {
                ExceptionProcessor.processException(th);
            }
        }
    }

    static {
        e1.a.SLoad("pns-2.13.2.1-LogOnlineStandardCuumRelease_alijtca_plus");
    }

    static String access$000(PrivacyDialogActivity privacyDialogActivity) {
        try {
            return privacyDialogActivity.mVendorKey;
        } catch (Throwable th) {
            ExceptionProcessor.processException(th);
            return null;
        }
    }

    static d access$100(PrivacyDialogActivity privacyDialogActivity) {
        try {
            return privacyDialogActivity.mUIManager;
        } catch (Throwable th) {
            ExceptionProcessor.processException(th);
            return null;
        }
    }

    static void access$200(PrivacyDialogActivity privacyDialogActivity, boolean z10, String str, String str2) {
        try {
            privacyDialogActivity.finishAuthPage(z10, str, str2);
        } catch (Throwable th) {
            ExceptionProcessor.processException(th);
        }
    }

    static AuthUIConfig access$300(PrivacyDialogActivity privacyDialogActivity) {
        try {
            return privacyDialogActivity.mUIConfig;
        } catch (Throwable th) {
            ExceptionProcessor.processException(th);
            return null;
        }
    }

    private SpannableString dealProtocol(String str, List<com.mobile.auth.gatewayauth.ui.b> list) {
        try {
            SpannableString spannableString = new SpannableString(str);
            ClickableSpan vendorProtocol = getVendorProtocol(this.mVendorProtocol, this.mVendorClick, !l.a(this.mUIConfig.getPrivacyAlertOperatorColor()) ? this.mUIConfig.getPrivacyAlertOperatorColor() : this.mUIConfig.getPrivacyAlertContentColor() != 0 ? this.mUIConfig.getPrivacyAlertContentColor() : this.mUIConfig.getProtocolOneColor());
            for (com.mobile.auth.gatewayauth.ui.b bVar : list) {
                ClickableSpan protocol = getProtocol(bVar.b(), bVar.c(), bVar.d());
                int indexOf = str.indexOf(bVar.b());
                spannableString.setSpan(protocol, indexOf, bVar.b().length() + indexOf, 34);
            }
            spannableString.setSpan(vendorProtocol, str.indexOf(this.mVendorProtocol), str.indexOf(this.mVendorProtocol) + this.mVendorProtocol.length(), 34);
            return spannableString;
        } catch (Throwable th) {
            ExceptionProcessor.processException(th);
            return null;
        }
    }

    private void finishAuthPage(boolean z10, String str, String str2) {
        try {
            Intent intent = getIntent();
            intent.putExtra("HasAgree", !z10);
            intent.putExtra("code", str);
            intent.putExtra("msg", str2);
            setResult(-1, intent);
            this.mUIManager.d(this);
        } catch (Throwable th) {
            ExceptionProcessor.processException(th);
        }
    }

    private native ClickableSpan getProtocol(String str, String str2, int i10);

    private ClickableSpan getVendorProtocol(final String str, final String str2, final int i10) {
        try {
            return new ClickableSpan() {
                @Override
                public void onClick(View view) {
                    try {
                        PrivacyDialogActivity.access$100(PrivacyDialogActivity.this).b(PrivacyDialogActivity.access$000(PrivacyDialogActivity.this), str, str2, true);
                        PrivacyDialogActivity.access$100(PrivacyDialogActivity.this).a(str, str2);
                    } catch (Throwable th) {
                        ExceptionProcessor.processException(th);
                    }
                }

                @Override
                public void updateDrawState(TextPaint textPaint) {
                    try {
                        super.updateDrawState(textPaint);
                        textPaint.setColor(i10);
                        if (PrivacyDialogActivity.access$300(PrivacyDialogActivity.this).isPrivacyAlertProtocolNameUseUnderLine()) {
                            textPaint.setUnderlineText(true);
                        } else {
                            textPaint.setUnderlineText(false);
                        }
                        if (PrivacyDialogActivity.access$300(PrivacyDialogActivity.this).getPrivacyAlertProtocolNameTypeface() != null) {
                            textPaint.setTypeface(PrivacyDialogActivity.access$300(PrivacyDialogActivity.this).getPrivacyAlertProtocolNameTypeface());
                        }
                    } catch (Throwable th) {
                        ExceptionProcessor.processException(th);
                    }
                }
            };
        } catch (Throwable th) {
            ExceptionProcessor.processException(th);
            return null;
        }
    }

    @SafeProtector
    private native void init();

    @SafeProtector
    private native RelativeLayout initBodyView();

    @SafeProtector
    private native void initBtnLayoutDynamicView();

    private View initBtnLayoutView() {
        try {
            this.mBtnRL = new RelativeLayout(this);
            RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(-1, -1);
            if (this.mUIConfig.getPrivacyAlertCornerRadiusArray() == null || this.mUIConfig.getPrivacyAlertCornerRadiusArray().length < 4) {
                this.mBtnRL.setBackgroundColor(this.mUIConfig.getPrivacyAlertBackgroundColor());
            } else {
                GradientDrawable gradientDrawable = new GradientDrawable();
                gradientDrawable.setShape(0);
                gradientDrawable.setCornerRadii(new float[]{0.0f, 0.0f, 0.0f, 0.0f, transferCorner(this.mUIConfig.getPrivacyAlertCornerRadiusArray()[2]), transferCorner(this.mUIConfig.getPrivacyAlertCornerRadiusArray()[2]), transferCorner(this.mUIConfig.getPrivacyAlertCornerRadiusArray()[3]), transferCorner(this.mUIConfig.getPrivacyAlertCornerRadiusArray()[3])});
                gradientDrawable.setColor(this.mUIConfig.getPrivacyAlertBackgroundColor());
                setBackground(this.mBtnRL, gradientDrawable);
            }
            layoutParams.addRule(3, this.mBodyRL.getId());
            this.mBtnRL.setLayoutParams(layoutParams);
            k.a(this.mBtnRL, initBtnView(), 0);
            initBtnLayoutDynamicView();
            return this.mBtnRL;
        } catch (Throwable th) {
            ExceptionProcessor.processException(th);
            return null;
        }
    }

    private native View initBtnView();

    @SafeProtector
    private native void initContentLayoutDynamicView();

    @SafeProtector
    private void initIntentData() {
        try {
            Intent intent = getIntent();
            this.mVendorKey = intent.getStringExtra(Constant.LOGIN_ACTIVITY_VENDOR_KEY);
            this.mUIManagerID = intent.getIntExtra(Constant.LOGIN_ACTIVITY_UI_MANAGER_ID, 0);
        } catch (Throwable th) {
            ExceptionProcessor.processException(th);
        }
    }

    @SafeProtector
    private native RelativeLayout initProtocolView();

    @SafeProtector
    private native void initTitleLayoutDynamicView();

    @SafeProtector
    private native RelativeLayout initTitleView();

    @SafeProtector
    private native void initView();

    @SafeProtector
    private native void initXMLDynamicView();

    private boolean isTouchPointInView(View view, int i10, int i11) {
        if (view == null) {
            return false;
        }
        try {
            int[] iArr = new int[2];
            view.getLocationOnScreen(iArr);
            int i12 = iArr[0];
            int i13 = iArr[1];
            return i11 >= i13 && i11 <= view.getMeasuredHeight() + i13 && i10 >= i12 && i10 <= view.getMeasuredWidth() + i12;
        } catch (Throwable th) {
            ExceptionProcessor.processException(th);
            return false;
        }
    }

    @SafeProtector
    private native void removeDynamicView();

    private native void removeDynamicXmlView();

    private native void restAllChildViews(View view);

    private void setBackground(View view, Drawable drawable) {
        try {
            view.setBackground(drawable);
        } catch (Throwable th) {
            ExceptionProcessor.processException(th);
        }
    }

    private void setDialogBackGroundAlpha(float f10) {
        try {
            getWindow().setDimAmount(f10);
        } catch (Throwable th) {
            ExceptionProcessor.processException(th);
        }
    }

    private float transferCorner(float f10) {
        if (f10 <= 0.0f) {
            return 0.0f;
        }
        try {
            return AppUtils.dp2px(this, f10);
        } catch (Throwable th) {
            ExceptionProcessor.processException(th);
            return -1.0f;
        }
    }

    public native void cancelPrivacyDialog();

    @Override
    public boolean dispatchTouchEvent(MotionEvent motionEvent) {
        try {
            int x10 = (int) motionEvent.getX();
            int y10 = (int) motionEvent.getY();
            if (this.mUIConfig.isTapPrivacyAlertMaskCloseAlert() && motionEvent.getAction() == 1 && !isTouchPointInView(this.mMainRelativeLayout, x10, y10)) {
                this.mUIManager.f(this.mVendorKey);
                finishAuthPage(true, ResultCode.CODE_AUTH_PRIVACY_CLOSE, ResultCode.MSG_AUTH_PRIVACY_CLOSE);
            }
            return super.dispatchTouchEvent(motionEvent);
        } catch (Throwable th) {
            ExceptionProcessor.processException(th);
            return false;
        }
    }

    public int getProtroColor(int i10) {
        try {
            return this.mUIConfig.getPrivacyAlertContentColor() == 0 ? i10 : this.mUIConfig.getPrivacyAlertContentColor();
        } catch (Throwable th) {
            ExceptionProcessor.processException(th);
            return -1;
        }
    }

    public int getUIManagerID() {
        try {
            return this.mUIManagerID;
        } catch (Throwable th) {
            ExceptionProcessor.processException(th);
            return -1;
        }
    }

    public void hideLoadingDialog() {
        com.mobile.auth.y.a aVar;
        try {
            AuthUIConfig authUIConfig = this.mUIConfig;
            if (authUIConfig == null || authUIConfig.isHiddenLoading() || this.mUIManager == null || (aVar = this.mProgressDialog) == null || !aVar.isShowing()) {
                return;
            }
            this.mProgressDialog.dismiss();
        } catch (Throwable th) {
            ExceptionProcessor.processException(th);
        }
    }

    public int makeTextSizeSpec(int i10, int i11) {
        return (i10 & 1073741823) | (i11 & MODE_MASK);
    }

    @Override
    public void onBackPressed() {
        try {
            this.mUIManager.f(this.mVendorKey);
            finishAuthPage(true, ResultCode.CODE_AUTH_PRIVACY_CLOSE, ResultCode.MSG_AUTH_PRIVACY_CLOSE);
        } catch (Throwable th) {
            ExceptionProcessor.processException(th);
        }
    }

    @Override
    protected native void onCreate(Bundle bundle);

    @Override
    protected void onDestroy() {
        try {
            hideLoadingDialog();
            removeDynamicXmlView();
            removeDynamicView();
            d dVar = this.mUIManager;
            if (dVar != null) {
                dVar.c((Activity) null);
            }
            this.mUIManager = null;
            this.mUIConfig = null;
            super.onDestroy();
        } catch (Throwable th) {
            ExceptionProcessor.processException(th);
        }
    }

    @Override
    protected void onRestoreInstanceState(@NonNull Bundle bundle) {
        try {
            super.onRestoreInstanceState(bundle);
        } catch (Throwable th) {
            ExceptionProcessor.processException(th);
        }
    }

    @Override
    protected void onSaveInstanceState(@NonNull Bundle bundle) {
        try {
            bundle.putString(Constant.LOGIN_ACTIVITY_VENDOR_KEY, this.mVendorKey);
            bundle.putInt(Constant.LOGIN_ACTIVITY_UI_MANAGER_ID, this.mUIManagerID);
            super.onSaveInstanceState(bundle);
        } catch (Throwable th) {
            ExceptionProcessor.processException(th);
        }
    }

    @Override
    protected void onStop() {
        try {
            Intent intent = getIntent();
            intent.putExtra(Constant.LOGIN_ACTIVITY_VENDOR_KEY, this.mVendorKey);
            intent.putExtra(Constant.LOGIN_ACTIVITY_UI_MANAGER_ID, this.mUIManagerID);
            super.onStop();
        } catch (Throwable th) {
            ExceptionProcessor.processException(th);
        }
    }

    public int px2dp(float f10) {
        try {
            return (int) ((f10 / getResources().getDisplayMetrics().density) + 0.5f);
        } catch (Exception unused) {
            return (int) f10;
        } catch (Throwable th) {
            ExceptionProcessor.processException(th);
            return -1;
        }
    }

    public void showLoadingDialog() {
        try {
            if (this.mUIConfig.isHiddenLoading()) {
                return;
            }
            this.mPnsLogger.a("PrivacyDialogActivity showLoadingDialog = ", String.valueOf(this.mProgressDialog), "; isShowLoadingDialog = true");
            if (this.mProgressDialog == null) {
                com.mobile.auth.y.a aVar = new com.mobile.auth.y.a(this, this.mUIConfig);
                this.mProgressDialog = aVar;
                aVar.setOnShowListener(new DialogInterface.OnShowListener() {
                    @Override
                    public void onShow(DialogInterface dialogInterface) {
                    }
                });
            }
            this.mProgressDialog.setCancelable(true);
            this.mProgressDialog.show();
        } catch (Throwable th) {
            ExceptionProcessor.processException(th);
        }
    }
}