沃创云 v1.0.2版本的 MD5 值为:75fd4b81bf3100e28225c876f02b8eb1

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


package com.webank.facelight.tools;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Build;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Base64;
import com.tencent.bugly.webank.crashreport.CrashReport;
import com.tencent.turingcam.TuringFaceDefender;
import com.tencent.ytcommon.util.YTCommonInterface;
import com.webank.facelight.Request.GetCdnGradeInfo;
import com.webank.facelight.Request.LoginRequest;
import com.webank.facelight.Request.Param;
import com.webank.facelight.config.FaceVerifyConfig;
import com.webank.facelight.contants.WbCloudFaceContant;
import com.webank.facelight.contants.WbFaceError;
import com.webank.facelight.listerners.WbCloudFaceVeirfyLoginListner;
import com.webank.facelight.listerners.WbCloudFaceVeirfyResultListener;
import com.webank.facelight.ui.FaceGuideActivity;
import com.webank.facelight.ui.FaceVerifyActivity;
import com.webank.facelight.ui.FaceVerifyStatus;
import com.webank.mbank.wehttp2.WeLog;
import com.webank.mbank.wehttp2.WeOkHttp;
import com.webank.mbank.wehttp2.WeReq;
import com.webank.normal.tools.WLogger;
import com.webank.simple.wbanalytics.WBSimpleAnalyticsConfig;
import com.webank.simple.wbanalytics.WBSimpleAnalyticsService;
import com.webank.simple.wbanalytics.WBSimpleStartParam;
import java.io.IOException;
import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;

public class WbCloudFaceVerifySdk {
    private static WbCloudFaceVerifySdk a;
    private boolean N;
    private int P;
    private int Q;
    private boolean R;
    private boolean S;
    private boolean T;
    private boolean U;
    private boolean V;
    private boolean W;
    private boolean X;
    private boolean Y;
    private int Z;
    private String aa;
    private String ab;
    private String ac;
    private String ad;
    private String ag;
    private boolean ah;
    private boolean ai;
    private boolean aj;
    private boolean ak;
    private boolean al;
    private boolean am;
    private String an;
    private String ao;
    private WbCloudFaceVeirfyResultListener b;
    private WbCloudFaceVeirfyLoginListner c;
    private InputData d;
    private WeOkHttp e;
    private boolean f;
    private boolean g;
    private String h;
    private String i;
    private boolean j;
    private boolean l;
    private boolean m;
    private boolean n;
    private boolean k = true;
    private String o = "150";
    private String p = "0.2";
    private String q = "0.5";
    private String r = "-15";
    private String s = "15";
    private String t = "-15";
    private String u = "15";
    private String v = "-10";
    private String w = "10";
    private String x = "0.5";
    private String y = "0.5";
    private int z = 21;
    private String A = "30000";
    private String B = "5000";
    private String C = "1000";
    private String D = "0";
    private String E = "0";
    private int F = 1;
    private String G = "";
    private String H = "";
    private String I = "";
    private String J = "";
    private String K = "";
    private String L = "";
    private String M = "";
    private String O = "";
    private FaceVerifyStatus.Mode ae = FaceVerifyStatus.Mode.GRADE;
    private String af = "1";

    public static class InputData implements Serializable {
        public final String agreementNo;
        public String faceId;
        public String idNo;
        public String idType;
        public final String keyLicence;
        public final String openApiAppId;
        public final String openApiAppVersion;
        public final String openApiNonce;
        public final String openApiSign;
        public final String openApiUserId;
        public String userName;
        public final FaceVerifyStatus.Mode verifyMode;

        public InputData(String str, String str2, String str3, String str4, String str5, String str6, FaceVerifyStatus.Mode mode, String str7) {
            this.userName = null;
            this.idType = null;
            this.idNo = null;
            this.faceId = null;
            this.agreementNo = str;
            this.openApiAppId = str2;
            this.openApiAppVersion = str3;
            this.openApiNonce = str4;
            this.openApiUserId = str5;
            this.openApiSign = str6;
            this.verifyMode = mode;
            this.keyLicence = str7;
        }

        public InputData(String str, String str2, String str3, String str4, String str5, String str6, String str7, FaceVerifyStatus.Mode mode, String str8) {
            this.userName = null;
            this.idType = null;
            this.idNo = null;
            this.faceId = null;
            this.faceId = str;
            this.agreementNo = str2;
            this.openApiAppId = str3;
            this.openApiAppVersion = str4;
            this.openApiNonce = str5;
            this.openApiUserId = str6;
            this.openApiSign = str7;
            this.verifyMode = mode;
            this.keyLicence = str8;
        }

        @Deprecated
        public InputData(String str, String str2, String str3, String str4, String str5, String str6, String str7, String str8, String str9, FaceVerifyStatus.Mode mode, String str10) {
            this.userName = null;
            this.idType = null;
            this.idNo = null;
            this.faceId = null;
            this.userName = str;
            this.idType = str2;
            this.idNo = str3;
            this.agreementNo = str4;
            this.openApiAppId = str5;
            this.openApiAppVersion = str6;
            this.openApiNonce = str7;
            this.openApiUserId = str8;
            this.openApiSign = str9;
            this.verifyMode = mode;
            this.keyLicence = str10;
        }

        public String toString() {
            return "InputData{userName='" + this.userName + "', idType='" + this.idType + "', idNo='" + this.idNo + "', faceId='" + this.faceId + "', agreementNo='" + this.agreementNo + "', openApiAppId='" + this.openApiAppId + "', openApiAppVersion='" + this.openApiAppVersion + "', openApiNonce='" + this.openApiNonce + "', openApiUserId='" + this.openApiUserId + "', openApiSign='" + this.openApiSign + "', verifyMode=" + this.verifyMode + ", keyLicence='" + this.keyLicence + "'}";
        }
    }

    static {
        System.loadLibrary("YTCommon");
        System.loadLibrary("YTNextCV");
        System.loadLibrary("YTFaceReflect");
    }

    private void a() {
        b();
        c();
    }

    private void a(Context context) {
        this.Q = 0;
        this.P = 0;
        WLogger.d("WbCloudFaceVerifySdk", "initConfig retryCount=" + this.Q + "; controlCount=" + this.P);
        this.h = "black";
        this.o = "150";
        b(context);
    }

    private void a(Context context, Bundle bundle) {
        String str;
        WLogger.d("WbCloudFaceVerifySdk", "checkParams");
        if (bundle == null) {
            WLogger.e("WbCloudFaceVerifySdk", "InputData is null!");
            WBSimpleAnalyticsService.trackCustomKVEvent(context, "faceservice_params_invalid", "InputData", null);
            a(WbFaceError.WBFaceErrorCodeInputParaNull, "传入参数为空", "传入InputData对象为空");
            return;
        }
        WLogger.d("WbCloudFaceVerifySdk", "start read setting");
        InputData inputData = (InputData) bundle.getSerializable(WbCloudFaceContant.INPUT_DATA);
        this.d = inputData;
        if (inputData != null) {
            WLogger.d("WbCloudFaceVerifySdk", "start read param");
            if (TextUtils.isEmpty(this.d.openApiAppId)) {
                WLogger.e("WbCloudFaceVerifySdk", "openApiAppId is null!");
                WBSimpleAnalyticsService.trackCustomKVEvent(context, "faceservice_params_invalid", "openApiAppId", null);
                a(WbFaceError.WBFaceErrorCodeInputParaNull, "传入参数为空", "传入openApiAppId为空");
                return;
            }
            Param.setAppId(this.d.openApiAppId);
            WLogger.d("WbCloudFaceVerifySdk", "Param.setAppId");
            if (this.d.openApiUserId == null || this.d.openApiUserId.length() == 0) {
                WLogger.e("WbCloudFaceVerifySdk", "openApiUserId is null!");
                WBSimpleAnalyticsService.trackCustomKVEvent(context, "faceservice_params_invalid", "openApiUserId", null);
                a(WbFaceError.WBFaceErrorCodeInputParaNull, "传入参数为空", "传入openApiUserId为空");
                return;
            }
            Param.setUserId(this.d.openApiUserId);
            WLogger.e("WbCloudFaceVerifySdk", "Param.setUserId");
            if (TextUtils.isEmpty(this.d.agreementNo)) {
                WLogger.e("WbCloudFaceVerifySdk", "agreementNo is null!");
                WBSimpleAnalyticsService.trackCustomKVEvent(context, "faceservice_params_invalid", "agreementNo", null);
                a(WbFaceError.WBFaceErrorCodeInputParaNull, "传入参数为空", "传入agreementNo为空");
                return;
            }
            Param.setOrderNo(this.d.agreementNo);
            WLogger.d("WbCloudFaceVerifySdk", " Param.setOrderNo");
            WBSimpleAnalyticsService.startStatService(context, new WBSimpleStartParam.Builder("M188386620", Param.getAppId() + Param.getOrderNo(), this.U ? "https://wa.test.webank.com/rcrm-codcs/mob-data-collect" : "https://tracev6.webank.com/rcrm-codcs/mob-data-collect").setSubAppId("standard").setUnionId(this.d.openApiUserId).setEnableWAService(true).setLogEnable(this.W).build());
            WBSimpleAnalyticsService.trackCustomKVEvent(context, "faceservice_sdk_init", null, null);
            if (TextUtils.isEmpty(this.d.openApiAppVersion)) {
                WLogger.e("WbCloudFaceVerifySdk", "openApiAppVersion is null!");
                WBSimpleAnalyticsService.trackCustomKVEvent(context, "faceservice_params_invalid", "openApiAppVersion", null);
                a(WbFaceError.WBFaceErrorCodeInputParaNull, "传入参数为空", "传入openApiAppVersion为空");
                return;
            }
            Param.setVersion(this.d.openApiAppVersion);
            WLogger.d("WbCloudFaceVerifySdk", " Param.setVersion");
            if (TextUtils.isEmpty(this.d.keyLicence)) {
                WLogger.e("WbCloudFaceVerifySdk", "keyLicence is null!");
                WBSimpleAnalyticsService.trackCustomKVEvent(context, "faceservice_params_invalid", "keyLicence", null);
                a(WbFaceError.WBFaceErrorCodeInputParaNull, "传入参数为空", "传入keyLicence为空");
                return;
            }
            int initAuth = YTCommonInterface.initAuth(context, this.d.keyLicence, 1);
            if (initAuth != 0) {
                WLogger.e("WbCloudFaceVerifySdk", "keyLicence is not valid!keyValid=" + initAuth);
                WBSimpleAnalyticsService.trackCustomKVEvent(context, "faceservice_keylicence_invalid", "keyValid=" + initAuth, null);
                a(WbFaceError.WBFaceErrorCodeKeyLicenceError, "传入keyLicence不可用", "传入keyLicence不可用(" + initAuth + ")");
                return;
            }
            WLogger.d("WbCloudFaceVerifySdk", " Param valid keyLicence");
            this.f = bundle.getBoolean(WbCloudFaceContant.SHOW_SUCCESS_PAGE, false);
            this.g = bundle.getBoolean(WbCloudFaceContant.SHOW_FAIL_PAGE, false);
            this.h = bundle.getString(WbCloudFaceContant.COLOR_MODE, "black");
            this.j = bundle.getBoolean(WbCloudFaceContant.VIDEO_CHECK, false);
            this.l = bundle.getBoolean(WbCloudFaceContant.VIDEO_UPLOAD, true);
            this.m = bundle.getBoolean(WbCloudFaceContant.PLAY_VOICE, true);
            this.Y = bundle.getBoolean(WbCloudFaceContant.ENABLE_CLOSE_EYES, false);
            this.M = bundle.getString(WbCloudFaceContant.YT_MODEL_LOC);
            this.ai = bundle.getBoolean(WbCloudFaceContant.SWITCH_CAM, false);
            this.F = bundle.getInt(WbCloudFaceContant.BLINK_SAFETY, 1);
            this.Z = bundle.getInt(WbCloudFaceContant.CUSTOMER_TIPS_LOC, 0);
            this.aa = bundle.getString(WbCloudFaceContant.CUSTOMER_TIPS_LIVE);
            this.ab = bundle.getString(WbCloudFaceContant.CUSTOMER_TIPS_UPLOAD);
            this.ac = bundle.getString(WbCloudFaceContant.CUSTOMER_LONG_TIP);
            if (!TextUtils.isEmpty(this.aa)) {
                this.aa = this.aa.length() > 17 ? this.aa.substring(0, 17) : this.aa;
            }
            if (!TextUtils.isEmpty(this.ab)) {
                this.ab = this.ab.length() > 17 ? this.ab.substring(0, 17) : this.ab;
            }
            if (!TextUtils.isEmpty(this.ac)) {
                this.ac = this.ac.length() > 70 ? this.ac.substring(0, 70) : this.ac;
            }
            if (Build.MODEL.equalsIgnoreCase("vivo Y928") || Build.MODEL.equalsIgnoreCase("HUAWEI MT2-C00") || Build.MODEL.equalsIgnoreCase("Coolpad Y70-C") || Build.MODEL.equalsIgnoreCase("Philips I928") || Build.MODEL.equalsIgnoreCase("TCL S720T") || Build.MODEL.equalsIgnoreCase("HUAWEI G750-T01")) {
                WLogger.e("WbCloudFaceVerifySdk", "not support record video");
                this.l = false;
            }
            WLogger.d("WbCloudFaceVerifySdk", "checkParams check isDeviceCanRecord");
            if (!this.k) {
                this.l = false;
            }
            WLogger.d("WbCloudFaceVerifySdk", "checkParams check isUploadVideo");
            if (!this.l) {
                this.j = false;
            }
            FaceVerifyConfig.getInstance().setSavePreviewData(this.l);
            this.al = bundle.getBoolean(WbCloudFaceContant.IS_SIMPLE_MODE, false);
            WLogger.d("WbCloudFaceVerifySdk", "isSimpleMode=" + this.al);
            this.am = bundle.getBoolean(WbCloudFaceContant.RETURN_VIDEO, false);
            this.an = bundle.getString(WbCloudFaceContant.USER_PUBLIC_KEY);
            this.ao = bundle.getString(WbCloudFaceContant.USER_AES_IV);
            WLogger.d("WbCloudFaceVerifySdk", "finish read setting");
            String string = bundle.getString(WbCloudFaceContant.COMPARE_TYPE, "idCard");
            this.i = string;
            if (!string.equals("none") && !this.al) {
                Param.setCompareMode("grade");
                if (this.ak) {
                    WLogger.d("WbCloudFaceVerifySdk", "isDesensitization");
                    if (TextUtils.isEmpty(this.d.faceId)) {
                        WLogger.e("WbCloudFaceVerifySdk", "faceId is null!");
                        WBSimpleAnalyticsService.trackCustomKVEvent(context, "faceservice_params_invalid", "faceId", null);
                        a(WbFaceError.WBFaceErrorCodeInputParaNull, "传入参数为空", "传入faceId为空");
                        return;
                    }
                    Param.setFaceId(this.d.faceId);
                    str = "Param.setFaceId";
                } else {
                    WLogger.d("WbCloudFaceVerifySdk", "no Desensitization");
                    if (this.i.equals("idCard")) {
                        WLogger.d("WbCloudFaceVerifySdk", "ID_CARD");
                        if (TextUtils.isEmpty(this.d.userName)) {
                            WLogger.e("WbCloudFaceVerifySdk", "userName is null!");
                            WBSimpleAnalyticsService.trackCustomKVEvent(context, "faceservice_params_invalid", "userName", null);
                            a(WbFaceError.WBFaceErrorCodeInputParaNull, "传入参数为空", "传入userName为空");
                            return;
                        }
                        Param.setName(this.d.userName);
                        WLogger.d("WbCloudFaceVerifySdk", "Param.setName");
                        if (TextUtils.isEmpty(this.d.idType)) {
                            WLogger.e("WbCloudFaceVerifySdk", "idType is null!");
                            WBSimpleAnalyticsService.trackCustomKVEvent(context, "faceservice_params_invalid", "idType", null);
                            a(WbFaceError.WBFaceErrorCodeInputParaNull, "传入参数为空", "传入idType为空");
                            return;
                        }
                        Param.setIdType(this.d.idType);
                        WLogger.d("WbCloudFaceVerifySdk", "Param.setIdType");
                        if (TextUtils.isEmpty(this.d.idNo)) {
                            WLogger.e("WbCloudFaceVerifySdk", "idNo is null!");
                            WBSimpleAnalyticsService.trackCustomKVEvent(context, "faceservice_params_invalid", "idNo", null);
                            a(WbFaceError.WBFaceErrorCodeInputParaNull, "传入参数为空", "传入idNo为空");
                            return;
                        }
                        String str2 = this.d.idNo;
                        if (str2.contains("x")) {
                            str2 = str2.replace('x', 'X');
                        }
                        String validate_effective = IdentifyCardValidate.validate_effective(str2);
                        if (!validate_effective.equals(str2)) {
                            WLogger.e("WbCloudFaceVerifySdk", validate_effective);
                            WBSimpleAnalyticsService.trackCustomKVEvent(context, "faceservice_params_invalid", "身份证格式不正确", null);
                            a(WbFaceError.WBFaceErrorCodeUserIdError, "身份证格式不正确", validate_effective);
                            return;
                        }
                        Param.setIdNo(str2);
                        str = "Param.setIdNo";
                    } else {
                        if (!this.i.equals(WbCloudFaceContant.SRC_IMG)) {
                            return;
                        }
                        WLogger.d("WbCloudFaceVerifySdk", "SRC_IMG");
                        this.K = bundle.getString(WbCloudFaceContant.SRC_PHOTO_TYPE);
                        this.L = bundle.getString(WbCloudFaceContant.SRC_PHOTO_STRING);
                        WLogger.d("WbCloudFaceVerifySdk", "start check srcPhotoType");
                        if (TextUtils.isEmpty(this.K)) {
                            WLogger.e("WbCloudFaceVerifySdk", "srcPhotoType is null");
                            WBSimpleAnalyticsService.trackCustomKVEvent(context, "faceservice_params_invalid", "srcPhotoType", null);
                            a(WbFaceError.WBFaceErrorCodeInputParaNull, "传入参数为空", "传入srcPhotoType为空");
                            return;
                        }
                        WLogger.d("WbCloudFaceVerifySdk", "start check srcPhotoString");
                        if (TextUtils.isEmpty(this.L)) {
                            WLogger.e("WbCloudFaceVerifySdk", "srcPhotoString is null");
                            WBSimpleAnalyticsService.trackCustomKVEvent(context, "faceservice_params_invalid", "srcPhotoString", null);
                            a(WbFaceError.WBFaceErrorCodeInputParaNull, "传入参数为空", "未传入比对源图片,传入srcPhotoString为空");
                            return;
                        }
                        WLogger.d("WbCloudFaceVerifySdk", "start check srcPhotoString encode & length");
                        if (!g.b(this.L)) {
                            WLogger.e("WbCloudFaceVerifySdk", "srcPhotoString is not BASE64 encoded!");
                            WBSimpleAnalyticsService.trackCustomKVEvent(context, "faceservice_params_invalid", "srcPhotoString is not BASE64 encoded!", null);
                            a(WbFaceError.WBFaceErrorCodeSrcStrNotBase64, "使用自带对比源,传入参数错误(非base64)", "传入srcPhotoString不是base64 string");
                            return;
                        }
                        if (this.L.length() > 3000000) {
                            WLogger.e("WbCloudFaceVerifySdk", "srcPhotoString is tooLarge,the length is " + this.L.length());
                            WBSimpleAnalyticsService.trackCustomKVEvent(context, "faceservice_params_invalid", "传入srcPhotoString超过3M,太大!", null);
                            a(WbFaceError.WBFaceErrorCodeSrcStrTooBig, "使用自带对比源,传入参数错误(超过3M)", "传入srcPhotoString超过3M,太大!");
                            return;
                        }
                        WLogger.d("WbCloudFaceVerifySdk", "finish check srcPhotoType&srcPhotoString");
                        if (TextUtils.isEmpty(this.d.userName) && TextUtils.isEmpty(this.d.idNo)) {
                            Param.setName("");
                            Param.setIdNo("");
                            WLogger.d("WbCloudFaceVerifySdk", "no sensitive info");
                            this.T = false;
                        } else {
                            WLogger.d("WbCloudFaceVerifySdk", "check img src info");
                            if (TextUtils.isEmpty(this.d.userName)) {
                                WLogger.e("WbCloudFaceVerifySdk", "userName is null!");
                                WBSimpleAnalyticsService.trackCustomKVEvent(context, "faceservice_params_invalid", "userName", null);
                                a(WbFaceError.WBFaceErrorCodeInputParaNull, "传入参数为空", "传入userName为空");
                                return;
                            }
                            Param.setName(this.d.userName);
                            WLogger.d("WbCloudFaceVerifySdk", "img src setName");
                            if (TextUtils.isEmpty(this.d.idType)) {
                                WLogger.e("WbCloudFaceVerifySdk", "idType is null!");
                                WBSimpleAnalyticsService.trackCustomKVEvent(context, "faceservice_params_invalid", "idType", null);
                                a(WbFaceError.WBFaceErrorCodeInputParaNull, "传入参数为空", "传入idType为空");
                                return;
                            }
                            Param.setIdType(this.d.idType);
                            WLogger.d("WbCloudFaceVerifySdk", "img src setIdType");
                            if (TextUtils.isEmpty(this.d.idNo)) {
                                WLogger.e("WbCloudFaceVerifySdk", "idNo is null!");
                                WBSimpleAnalyticsService.trackCustomKVEvent(context, "faceservice_params_invalid", "idNo", null);
                                a(WbFaceError.WBFaceErrorCodeInputParaNull, "传入参数为空", "传入idNo为空");
                                return;
                            } else {
                                String str3 = this.d.idNo;
                                if (str3.contains("x")) {
                                    str3 = str3.replace('x', 'X');
                                }
                                this.T = true;
                                Param.setIdNo(str3);
                                str = "img src setIdNo";
                            }
                        }
                    }
                }
                WLogger.d("WbCloudFaceVerifySdk", str);
            } else if (this.al) {
                WLogger.d("WbCloudFaceVerifySdk", "SIMPLE");
                Param.setCompareMode("grade");
            } else {
                WLogger.d("WbCloudFaceVerifySdk", "NONE");
                Param.setCompareMode("gradelive");
            }
            f(context);
            h(context);
        }
    }

    public void a(String str, String str2) {
        WLogger.w("WbCloudFaceVerifySdk", "LoginFailed!" + str2);
        if (this.c != null) {
            WbFaceError wbFaceError = new WbFaceError();
            wbFaceError.setDomain(WbFaceError.WBFaceErrorDomainLoginServer);
            wbFaceError.setCode(str);
            wbFaceError.setDesc("网络异常");
            wbFaceError.setReason(str2);
            this.c.onLoginFailed(wbFaceError);
        }
    }

    private void a(String str, String str2, String str3) {
        if (this.c != null) {
            WbFaceError wbFaceError = new WbFaceError();
            wbFaceError.setDomain(WbFaceError.WBFaceErrorDomainParams);
            wbFaceError.setCode(str);
            wbFaceError.setDesc(str2);
            wbFaceError.setReason(str3);
            this.c.onLoginFailed(wbFaceError);
        }
    }

    private void b() {
        WLogger.setEnable(this.W, "cloud face");
        if (this.W) {
            WLogger.localLogFileName("WeCloudFaceLog_" + System.currentTimeMillis());
        }
    }

    private void b(final Context context) {
        WLogger.d("WbCloudFaceVerifySdk", "getConfigInfo");
        WLogger.d("WbCloudFaceVerifySdk", "start getConfigInfo request");
        WBSimpleAnalyticsService.trackCustomKVEvent(context, "faceservice_cdn_request", null, null);
        GetCdnGradeInfo.requestExec("https://tctp.webankcdn.net/kyc/WbGradeInfo.json", new WeReq.Callback<GetCdnGradeInfo.GetGradeInfoResponse>() {
            @Override
            public void onFailed(WeReq weReq, WeReq.ErrType errType, int i, String str, IOException iOException) {
                WLogger.e("WbCloudFaceVerifySdk", "cdn拉取设置信息失败,code=" + i + "; msg=" + str);
                WbCloudFaceVerifySdk.this.S = true;
                WBSimpleAnalyticsService.trackCustomKVEvent(context, "faceservice_cdn_response", "onFailed:type=" + errType + "code=" + i + ",msg=" + str, null);
                WbCloudFaceVerifySdk.this.c(context);
            }

            @Override
            public void onFinish() {
            }

            @Override
            public void onStart(WeReq weReq) {
            }

            @Override
            public void onSuccess(WeReq weReq, GetCdnGradeInfo.GetGradeInfoResponse getGradeInfoResponse) {
                String str;
                String str2;
                WLogger.e("WbCloudFaceVerifySdk", "cdn拉取设置信息 onSuccess");
                if (getGradeInfoResponse != null) {
                    String str3 = getGradeInfoResponse.outOfTime;
                    String str4 = getGradeInfoResponse.turingTime;
                    String str5 = getGradeInfoResponse.recordTime;
                    String str6 = getGradeInfoResponse.authType;
                    String str7 = getGradeInfoResponse.androidLightScore;
                    String str8 = getGradeInfoResponse.androidFaceAreaMax;
                    String str9 = getGradeInfoResponse.androidFaceAreaMin;
                    String str10 = getGradeInfoResponse.androidFaceYawMax;
                    String str11 = getGradeInfoResponse.androidFaceYawMin;
                    String str12 = getGradeInfoResponse.androidFacePitchMax;
                    String str13 = getGradeInfoResponse.androidFacePitchMin;
                    String str14 = getGradeInfoResponse.androidFaceRollMax;
                    String str15 = getGradeInfoResponse.androidFaceRollMin;
                    String str16 = getGradeInfoResponse.androidFacePointsVis;
                    String str17 = getGradeInfoResponse.androidFacePointsPercent;
                    if (TextUtils.isEmpty(str3)) {
                        WLogger.e("WbCloudFaceVerifySdk", "cdn拉取的time为空!");
                        str = str17;
                    } else {
                        StringBuilder sb = new StringBuilder();
                        str = str17;
                        sb.append("cdn拉取到的time=");
                        sb.append(str7);
                        WLogger.d("WbCloudFaceVerifySdk", sb.toString());
                        WbCloudFaceVerifySdk.this.A = str3;
                    }
                    if (TextUtils.isEmpty(str4)) {
                        WLogger.e("WbCloudFaceVerifySdk", "cdn拉取的turingSdkTime为空!");
                    } else {
                        WLogger.d("WbCloudFaceVerifySdk", "cdn拉取到的turingSdkTime=" + str4);
                        WbCloudFaceVerifySdk.this.B = str4;
                    }
                    if (TextUtils.isEmpty(str5)) {
                        WLogger.e("WbCloudFaceVerifySdk", "cdn拉取的recordTime为空!");
                    } else {
                        WLogger.d("WbCloudFaceVerifySdk", "cdn拉取到的recordTime=" + str5);
                        WbCloudFaceVerifySdk.this.C = str5;
                    }
                    if (TextUtils.isEmpty(str6)) {
                        WLogger.e("WbCloudFaceVerifySdk", "cdn拉取的authType为空!");
                    } else {
                        WLogger.e("WbCloudFaceVerifySdk", "cdn拉取的authType=" + str6);
                        WbCloudFaceVerifySdk.this.af = str6;
                    }
                    if (TextUtils.isEmpty(str7)) {
                        WLogger.e("WbCloudFaceVerifySdk", "cdn拉取的lightScore为空!");
                    } else {
                        WLogger.d("WbCloudFaceVerifySdk", "cdn拉取到的lightScore=" + str7);
                        WbCloudFaceVerifySdk.this.o = str7;
                    }
                    if (TextUtils.isEmpty(str8)) {
                        WLogger.e("WbCloudFaceVerifySdk", "cdn拉取的faceAreaMax为空!");
                    } else {
                        WLogger.d("WbCloudFaceVerifySdk", "cdn拉取到的faceAreaMax=" + str8);
                        WbCloudFaceVerifySdk.this.q = str8;
                    }
                    if (TextUtils.isEmpty(str9)) {
                        WLogger.e("WbCloudFaceVerifySdk", "cdn拉取的faceAreaMin为空!");
                    } else {
                        WLogger.d("WbCloudFaceVerifySdk", "cdn拉取到的faceAreaMin=" + str9);
                        WbCloudFaceVerifySdk.this.p = str9;
                    }
                    if (TextUtils.isEmpty(str10)) {
                        WLogger.e("WbCloudFaceVerifySdk", "cdn拉取的faceYawMax为空!");
                    } else {
                        WLogger.d("WbCloudFaceVerifySdk", "cdn拉取到的faceYawMax=" + str10);
                        WbCloudFaceVerifySdk.this.s = str10;
                    }
                    if (TextUtils.isEmpty(str11)) {
                        WLogger.e("WbCloudFaceVerifySdk", "cdn拉取的faceYawMin为空!");
                    } else {
                        WLogger.d("WbCloudFaceVerifySdk", "cdn拉取到的faceYawMin=" + str11);
                        WbCloudFaceVerifySdk.this.r = str11;
                    }
                    if (TextUtils.isEmpty(str12)) {
                        WLogger.e("WbCloudFaceVerifySdk", "cdn拉取的facePitchMax为空!");
                    } else {
                        WLogger.d("WbCloudFaceVerifySdk", "cdn拉取到的facePitchMax=" + str12);
                        WbCloudFaceVerifySdk.this.u = str12;
                    }
                    if (TextUtils.isEmpty(str13)) {
                        WLogger.e("WbCloudFaceVerifySdk", "cdn拉取的facePitchMin为空!");
                    } else {
                        WLogger.d("WbCloudFaceVerifySdk", "cdn拉取到的facePitchMin=" + str13);
                        WbCloudFaceVerifySdk.this.t = str13;
                    }
                    if (TextUtils.isEmpty(str14)) {
                        WLogger.e("WbCloudFaceVerifySdk", "cdn拉取的faceRollMax为空!");
                    } else {
                        WLogger.d("WbCloudFaceVerifySdk", "cdn拉取到的faceRollMax=" + str14);
                        WbCloudFaceVerifySdk.this.w = str14;
                    }
                    if (TextUtils.isEmpty(str15)) {
                        WLogger.e("WbCloudFaceVerifySdk", "cdn拉取的faceRollMin为空!");
                    } else {
                        WLogger.d("WbCloudFaceVerifySdk", "cdn拉取到的faceRollMin=" + str15);
                        WbCloudFaceVerifySdk.this.v = str15;
                    }
                    if (TextUtils.isEmpty(str16)) {
                        WLogger.e("WbCloudFaceVerifySdk", "cdn拉取的facePointsVis为空!");
                    } else {
                        WLogger.d("WbCloudFaceVerifySdk", "cdn拉取到的facePointsVis=" + str16);
                        WbCloudFaceVerifySdk.this.y = str16;
                    }
                    if (TextUtils.isEmpty(str)) {
                        WLogger.e("WbCloudFaceVerifySdk", "cdn拉取的facePointsPercent为空!");
                    } else {
                        StringBuilder sb2 = new StringBuilder();
                        sb2.append("cdn拉取到的facePointsPercent=");
                        String str18 = str;
                        sb2.append(str18);
                        WLogger.d("WbCloudFaceVerifySdk", sb2.toString());
                        WbCloudFaceVerifySdk.this.x = str18;
                    }
                    if (getGradeInfoResponse.highPixelAndroidVersionThresgold == 0 || getGradeInfoResponse.highPixelAndroidVersionThresgold <= 13) {
                        WLogger.e("WbCloudFaceVerifySdk", "cdn拉取到的阈值异常:" + getGradeInfoResponse.highPixelAndroidVersionThresgold + "使用默认值thresgold=" + WbCloudFaceVerifySdk.this.z);
                    } else {
                        WLogger.d("WbCloudFaceVerifySdk", "cdn拉取到的highPixelAndroidVersionThresgold=" + getGradeInfoResponse.highPixelAndroidVersionThresgold);
                        WbCloudFaceVerifySdk.this.z = getGradeInfoResponse.highPixelAndroidVersionThresgold;
                    }
                    if (getGradeInfoResponse.androidLightControlList != null) {
                        String replace = getGradeInfoResponse.androidLightControlList.toString().trim().replace(" ", "").replace("[", "[\"").replace(",", "\",\"").replace("]", "\"]");
                        String str19 = Build.MODEL;
                        WLogger.d("WbCloudFaceVerifySdk", "model=" + str19);
                        String str20 = "\"" + str19.replace(" ", "") + "\"";
                        WLogger.d("WbCloudFaceVerifySdk", "after model=" + str20);
                        if (replace.contains(str20)) {
                            WbCloudFaceVerifySdk.this.n = true;
                            WLogger.d("WbCloudFaceVerifySdk", "isInGreyList =" + WbCloudFaceVerifySdk.this.n);
                        }
                    } else {
                        WLogger.e("WbCloudFaceVerifySdk", "cdn cant get greyList");
                    }
                    if (getGradeInfoResponse.specialAppIdSet != null && getGradeInfoResponse.specialAppIdSet.length != 0) {
                        WLogger.d("WbCloudFaceVerifySdk", "need special appId set!");
                        GetCdnGradeInfo.specialSet[] specialsetArr = getGradeInfoResponse.specialAppIdSet;
                        for (int i = 0; i < specialsetArr.length; i++) {
                            List<String> list = specialsetArr[i].appIdSet;
                            if (list == null || list.size() <= 0) {
                                WLogger.e("WbCloudFaceVerifySdk", "no appId SET!");
                            } else {
                                for (int i2 = 0; i2 < list.size(); i2++) {
                                    String str21 = list.get(i2);
                                    if (!TextUtils.isEmpty(str21) && str21.equals(Param.getAppId())) {
                                        WLogger.d("WbCloudFaceVerifySdk", "appId matched!");
                                        if (!TextUtils.isEmpty(specialsetArr[i].outOfTime)) {
                                            WbCloudFaceVerifySdk.this.A = specialsetArr[i].outOfTime;
                                            WLogger.d("WbCloudFaceVerifySdk", "update outOfTime:" + WbCloudFaceVerifySdk.this.A);
                                        }
                                        if (!TextUtils.isEmpty(specialsetArr[i].turingTime)) {
                                            WbCloudFaceVerifySdk.this.B = specialsetArr[i].turingTime;
                                            WLogger.d("WbCloudFaceVerifySdk", "update turingTime:" + WbCloudFaceVerifySdk.this.B);
                                        }
                                        if (!TextUtils.isEmpty(specialsetArr[i].recordTime)) {
                                            WbCloudFaceVerifySdk.this.C = specialsetArr[i].recordTime;
                                            WLogger.d("WbCloudFaceVerifySdk", "update recordTime:" + WbCloudFaceVerifySdk.this.C);
                                        }
                                        if (!TextUtils.isEmpty(specialsetArr[i].authType)) {
                                            WbCloudFaceVerifySdk.this.af = specialsetArr[i].authType;
                                            WLogger.d("WbCloudFaceVerifySdk", "update authType:" + WbCloudFaceVerifySdk.this.af);
                                        }
                                        if (!TextUtils.isEmpty(specialsetArr[i].androidFaceAreaMax)) {
                                            WbCloudFaceVerifySdk.this.q = specialsetArr[i].androidFaceAreaMax;
                                            WLogger.d("WbCloudFaceVerifySdk", "update androidFaceAreaMax:" + WbCloudFaceVerifySdk.this.q);
                                        }
                                        if (!TextUtils.isEmpty(specialsetArr[i].androidFaceAreaMin)) {
                                            WbCloudFaceVerifySdk.this.p = specialsetArr[i].androidFaceAreaMin;
                                            WLogger.d("WbCloudFaceVerifySdk", "update androidFaceAreaMin:" + WbCloudFaceVerifySdk.this.p);
                                        }
                                        if (!TextUtils.isEmpty(specialsetArr[i].androidFaceYawMax)) {
                                            WbCloudFaceVerifySdk.this.s = specialsetArr[i].androidFaceYawMax;
                                            WLogger.d("WbCloudFaceVerifySdk", "update androidFaceYawMax:" + WbCloudFaceVerifySdk.this.s);
                                        }
                                        if (!TextUtils.isEmpty(specialsetArr[i].androidFaceYawMin)) {
                                            WbCloudFaceVerifySdk.this.r = specialsetArr[i].androidFaceYawMin;
                                            WLogger.d("WbCloudFaceVerifySdk", "update androidFaceYawMin:" + WbCloudFaceVerifySdk.this.r);
                                        }
                                        if (!TextUtils.isEmpty(specialsetArr[i].androidFacePitchMax)) {
                                            WbCloudFaceVerifySdk.this.u = specialsetArr[i].androidFacePitchMax;
                                            WLogger.d("WbCloudFaceVerifySdk", "update androidFacePitchMax:" + WbCloudFaceVerifySdk.this.u);
                                        }
                                        if (!TextUtils.isEmpty(specialsetArr[i].androidFacePitchMin)) {
                                            WbCloudFaceVerifySdk.this.t = specialsetArr[i].androidFacePitchMin;
                                            WLogger.d("WbCloudFaceVerifySdk", "update androidFacePitchMin:" + WbCloudFaceVerifySdk.this.t);
                                        }
                                        if (!TextUtils.isEmpty(specialsetArr[i].androidFaceRollMax)) {
                                            WbCloudFaceVerifySdk.this.w = specialsetArr[i].androidFaceRollMax;
                                            WLogger.d("WbCloudFaceVerifySdk", "update androidFaceRollMax:" + WbCloudFaceVerifySdk.this.w);
                                        }
                                        if (!TextUtils.isEmpty(specialsetArr[i].androidFaceRollMin)) {
                                            WbCloudFaceVerifySdk.this.v = specialsetArr[i].androidFaceRollMin;
                                            WLogger.d("WbCloudFaceVerifySdk", "update androidFaceRollMin:" + WbCloudFaceVerifySdk.this.v);
                                        }
                                        if (specialsetArr[i].highPixelAndroidVersionThresgold == 0 || specialsetArr[i].highPixelAndroidVersionThresgold <= 13) {
                                            WLogger.e("WbCloudFaceVerifySdk", "cdn拉取到的specialSet阈值异常:" + specialsetArr[i].highPixelAndroidVersionThresgold + "使用thresgold=" + WbCloudFaceVerifySdk.this.z);
                                        } else {
                                            WbCloudFaceVerifySdk.this.z = specialsetArr[i].highPixelAndroidVersionThresgold;
                                            WLogger.d("WbCloudFaceVerifySdk", "update thresgold:" + WbCloudFaceVerifySdk.this.z);
                                        }
                                    }
                                }
                            }
                        }
                    }
                    if (Boolean.valueOf(getGradeInfoResponse.androidUseHighPixel).booleanValue()) {
                        WLogger.d("WbCloudFaceVerifySdk", "需要判断是否使用720P");
                        int i3 = Build.VERSION.SDK_INT;
                        WLogger.d("WbCloudFaceVerifySdk", "本机androidVer =" + i3 + ";阈值thresgold =" + WbCloudFaceVerifySdk.this.z);
                        if (i3 < WbCloudFaceVerifySdk.this.z || i3 == WbCloudFaceVerifySdk.this.z) {
                            WLogger.d("WbCloudFaceVerifySdk", "this devise use 720p");
                            FaceVerifyConfig.getInstance().enableUse720P();
                        } else {
                            str2 = "this devise dont use 720p";
                        }
                    } else {
                        str2 = "不需要使用720P";
                    }
                    WLogger.d("WbCloudFaceVerifySdk", str2);
                }
                WbCloudFaceVerifySdk.this.S = true;
                WLogger.d("WbCloudFaceVerifySdk", "isGetConfig true");
                WBSimpleAnalyticsService.trackCustomKVEvent(context, "faceservice_cdn_response", "onSuccess", WbCloudFaceVerifySdk.this.f());
                WbCloudFaceVerifySdk.this.c(context);
            }
        });
    }

    private WeOkHttp c() {
        String str = this.V ? "https://idav6.webank.com/" : "https://ida.webank.com/";
        this.e = new WeOkHttp();
        this.e.config().timeout(14L, 14L, 14L).log(new WeLog.Builder().setLevel(this.W ? WeLog.Level.BODY : WeLog.Level.NONE).setPrettyLog(true).setCutLongStr(true).setLogger(new WeLog.Logger() {
            @Override
            public void log(String str2) {
                WLogger.d("WeHttp", str2);
            }
        })).cookieMemory().baseUrl(str);
        return this.e;
    }

    public void c(Context context) {
        WLogger.d("WbCloudFaceVerifySdk", "canStartFaceVerify");
        if (this.R && this.S && this.c != null) {
            WBSimpleAnalyticsService.trackCustomKVEvent(context, "faceservice_login_success", null, e());
            this.c.onLoginSuccess();
            this.R = false;
            this.S = false;
        }
    }

    private void d() {
        WLogger.d("WbCloudFaceVerifySdk", "encryptUserInfo");
        String name = Param.getName();
        String idNo = Param.getIdNo();
        if (TextUtils.isEmpty(name) || TextUtils.isEmpty(idNo)) {
            WLogger.d("WbCloudFaceVerifySdk", "name and id are null,no need encrypt.");
            return;
        }
        String a2 = a.a();
        WLogger.d("WbCloudFaceVerifySdk", "get AESKey");
        String str = null;
        try {
            str = g.a(a2.getBytes("utf8"));
            WLogger.d("WbCloudFaceVerifySdk", "get enAESKey");
            Param.setEncryptedAESKey(str);
        } catch (Exception e) {
            e.printStackTrace();
            WLogger.e("WbCloudFaceVerifySdk", "encryptClientRandomKey failed:" + e.getLocalizedMessage());
        }
        if (str != null) {
            WLogger.d("WbCloudFaceVerifySdk", "start encrypt");
            try {
                String encodeToString = Base64.encodeToString(name.getBytes("utf8"), 0);
                String encodeToString2 = Base64.encodeToString(idNo.getBytes("utf8"), 0);
                String encodeToString3 = Base64.encodeToString(a.a(encodeToString, "utf8", a2.getBytes("utf8")), 0);
                String encodeToString4 = Base64.encodeToString(a.a(encodeToString2, "utf8", a2.getBytes("utf8")), 0);
                WLogger.d("WbCloudFaceVerifySdk", "finish encrypt");
                Param.setName(encodeToString3);
                Param.setIdNo(encodeToString4);
                WLogger.d("WbCloudFaceVerifySdk", "param set encry info");
            } catch (Exception e2) {
                e2.printStackTrace();
                WLogger.e("WbCloudFaceVerifySdk", "encrypt exception:" + e2.getMessage());
            }
        }
    }

    private void d(Context context) {
        TuringFaceDefender.init(context.getApplicationContext());
    }

    public Properties e() {
        Properties properties = new Properties();
        properties.setProperty("isShowSuccessPage", String.valueOf(this.f));
        properties.setProperty("isShowFailPage", String.valueOf(this.g));
        properties.setProperty(WbCloudFaceContant.COLOR_MODE, this.h);
        properties.setProperty("isCheckVideo", String.valueOf(this.j));
        properties.setProperty("isUploadVideo", String.valueOf(this.l));
        properties.setProperty("isPlayVoice", String.valueOf(this.m));
        properties.setProperty("isEnableCloseEyes", String.valueOf(this.Y));
        properties.setProperty(WbCloudFaceContant.IS_IPV6, String.valueOf(this.V));
        properties.setProperty("camSwitch", String.valueOf(this.ai));
        properties.setProperty("blinkSafetyLevel", String.valueOf(this.F));
        return properties;
    }

    private static void e(Context context) {
        final Context applicationContext = context.getApplicationContext();
        CrashReport.setSdkExtraData(applicationContext, "900057692", "v3.5.4");
        CrashReport.UserStrategy userStrategy = new CrashReport.UserStrategy(applicationContext);
        userStrategy.setCrashHandleCallback(new CrashReport.CrashHandleCallback() {
            @Override
            public synchronized Map<String, String> onCrashHandleStart(int i, String str, String str2, String str3) {
                HashMap hashMap;
                hashMap = new HashMap();
                try {
                    Bundle bundle = applicationContext.getPackageManager().getApplicationInfo(applicationContext.getPackageName(), 128).metaData;
                    for (String str4 : bundle.keySet()) {
                        if (str4 != null && str4.startsWith("wb_version_")) {
                            hashMap.put(str4, bundle.getString(str4));
                        }
                    }
                } catch (PackageManager.NameNotFoundException e) {
                    e.printStackTrace();
                }
                return hashMap;
            }
        });
        userStrategy.setAppChannel("pro");
        userStrategy.setAppPackageName(context.getApplicationContext().getPackageName());
        userStrategy.setAppVersion("v3.5.4");
        CrashReport.putUserData(applicationContext, "webank", "pro");
        CrashReport.initCrashReport(applicationContext, "900057692", false, userStrategy);
    }

    public Properties f() {
        Properties properties = new Properties();
        properties.setProperty("lightDiffScore", this.o);
        properties.setProperty("lightFaceAreaMin ", this.p);
        properties.setProperty("lightFaceAreaMax", this.q);
        properties.setProperty("lightFaceYawMin", this.r);
        properties.setProperty("lightFaceYawMax", this.s);
        properties.setProperty("lightFacePitchMin", this.t);
        properties.setProperty("lightFacePitchMax", this.u);
        properties.setProperty("lightFaceRollMin", this.v);
        properties.setProperty("lightFaceRollMax", this.w);
        properties.setProperty("lightPointsPercent", this.x);
        properties.setProperty("lightPointsVis", this.y);
        properties.setProperty("outoftime", this.A);
        properties.setProperty("turingTime", this.B);
        properties.setProperty("thresgold", String.valueOf(this.z));
        properties.setProperty("isDeviceCanRecord", String.valueOf(this.k));
        properties.setProperty("isInGreyList", String.valueOf(this.n));
        return properties;
    }

    private void f(Context context) {
        String b = g.b(context);
        Param.setImei(b);
        String valueOf = String.valueOf(Build.VERSION.SDK_INT);
        String str = Build.MODEL;
        WLogger.d("WbCloudFaceVerifySdk", "deviceModel=" + str);
        Param.setDeviceInfo("di=" + b + ";dt=Android;dv=" + valueOf + ";dm=" + str + ";st=" + g.a(context) + ";wv=v3.5.4;tsv=" + TuringFaceDefender.getSDKVersion());
        StringBuilder sb = new StringBuilder();
        sb.append("deviceInfo:");
        sb.append(Param.getDeviceInfo());
        WLogger.d("WbCloudFaceVerifySdk", sb.toString());
        d();
    }

    private String g(Context context) {
        String str;
        WLogger.d("WbCloudFaceVerifySdk", "initLoginRequest");
        String userId = Param.getUserId();
        if (this.d.openApiNonce == null || this.d.openApiNonce.length() == 0) {
            WLogger.e("WbCloudFaceVerifySdk", "openApiNonce is null!");
            WBSimpleAnalyticsService.trackCustomKVEvent(context, "faceservice_params_invalid", "openApiNonce", null);
            str = "传入openApiNonce为空";
        } else {
            String str2 = this.d.openApiNonce;
            WLogger.d("WbCloudFaceVerifySdk", "nonce ok");
            if (this.d.openApiSign != null && this.d.openApiSign.length() != 0) {
                String str3 = this.d.openApiSign;
                WLogger.d("WbCloudFaceVerifySdk", "sign ok");
                WLogger.d("WbCloudFaceVerifySdk", "return url");
                return "api/idap/v2/ssoLogin?app_id=" + Param.getAppId() + "&version=" + Param.getVersion() + "&nonce=" + str2 + "&user_id=" + userId + "&sign=" + str3;
            }
            WLogger.e("WbCloudFaceVerifySdk", "openApiSign is null!");
            WBSimpleAnalyticsService.trackCustomKVEvent(context, "faceservice_params_invalid", "openApiSign", null);
            str = "传入openApiSign为空";
        }
        a(WbFaceError.WBFaceErrorCodeInputParaNull, "传入参数为空", str);
        return null;
    }

    public static WbCloudFaceVerifySdk getInstance() {
        if (a == null) {
            synchronized (WbCloudFaceVerifySdk.class) {
                if (a == null) {
                    a = new WbCloudFaceVerifySdk();
                }
            }
        }
        return a;
    }

    public void h(final Context context) {
        WLogger.d("WbCloudFaceVerifySdk", "validateAppPermission");
        this.aj = true;
        String g = g(context);
        if (g != null) {
            WLogger.d("WbCloudFaceVerifySdk", "start login request");
            WBSimpleAnalyticsService.trackCustomKVEvent(context, "faceservice_login_start", null, null);
            LoginRequest.requestExec(this.e, g, this.i, this.ak, this.T, new WeReq.Callback<LoginRequest.LoginResponse>() {
                @Override
                public void onFailed(WeReq weReq, WeReq.ErrType errType, int i, String str, IOException iOException) {
                    WLogger.e("WbCloudFaceVerifySdk", "LoginRequest failed! type=" + errType + ",code=" + i + ",msg=" + str);
                    Context context2 = context;
                    StringBuilder sb = new StringBuilder();
                    sb.append(i);
                    sb.append("+");
                    sb.append(str);
                    WBSimpleAnalyticsService.trackCustomKVEvent(context2, "faceservice_login_network_fail", sb.toString(), WbCloudFaceVerifySdk.this.e());
                    if (WbCloudFaceVerifySdk.this.V) {
                        WLogger.w("WbCloudFaceVerifySdk", "try again using ida.webank.com");
                        WbCloudFaceVerifySdk.this.V = false;
                        WbCloudFaceVerifySdk.this.e.config().baseUrl("https://ida.webank.com/");
                        WbCloudFaceVerifySdk.this.h(context);
                        return;
                    }
                    if (WbCloudFaceVerifySdk.this.c != null) {
                        WbFaceError wbFaceError = new WbFaceError();
                        wbFaceError.setDomain(WbFaceError.WBFaceErrorDomainLoginNetwork);
                        wbFaceError.setCode(WbFaceError.WBFaceErrorCodeLoginNetworkError);
                        wbFaceError.setDesc("网络异常");
                        wbFaceError.setReason("登陆时网络异常,onFail! code=" + i + "; msg=" + str);
                        WbCloudFaceVerifySdk.this.c.onLoginFailed(wbFaceError);
                    }
                }

                @Override
                public void onFinish() {
                }

                @Override
                public void onStart(WeReq weReq) {
                }

                @Override
                public void onSuccess(WeReq weReq, LoginRequest.LoginResponse loginResponse) {
                    String str;
                    WbCloudFaceVerifySdk wbCloudFaceVerifySdk;
                    WbCloudFaceVerifySdk wbCloudFaceVerifySdk2;
                    String str2;
                    String str3;
                    WLogger.d("WbCloudFaceVerifySdk", "login onSuccess");
                    String str4 = WbFaceError.WBFaceErrorCodeLoginServerError;
                    if (loginResponse == null) {
                        str = "baseResponse is null!";
                    } else if (TextUtils.isEmpty(loginResponse.code)) {
                        str = "baseResponse.code is null!";
                    } else {
                        if (!loginResponse.code.equals("0")) {
                            WLogger.w("WbCloudFaceVerifySdk", "baseResponse code:" + loginResponse.code + "; Msg: " + loginResponse.msg);
                            WBSimpleAnalyticsService.trackCustomKVEvent(context, "faceservice_login_fail", loginResponse.code + "+" + loginResponse.msg, WbCloudFaceVerifySdk.this.e());
                            wbCloudFaceVerifySdk = WbCloudFaceVerifySdk.this;
                            str4 = loginResponse.code;
                            str = loginResponse.msg;
                            wbCloudFaceVerifySdk.a(str4, str);
                        }
                        LoginRequest.Result result = (LoginRequest.Result) loginResponse.result;
                        if (result != null) {
                            if (result.needLogReport != null) {
                                WbCloudFaceVerifySdk.this.E = result.needLogReport;
                            }
                            if (result.needAuth != null) {
                                WbCloudFaceVerifySdk.this.D = result.needAuth;
                            }
                            if (result.protocolCorpName != null) {
                                WbCloudFaceVerifySdk.this.G = result.protocolCorpName;
                            }
                            if (result.authProtocolVersion != null) {
                                WbCloudFaceVerifySdk.this.H = result.authProtocolVersion;
                            }
                            if (result.testMsg != null) {
                                WbCloudFaceVerifySdk.this.O = result.testMsg;
                            }
                            if (result.activeType != null) {
                                WLogger.i("WbCloudFaceVerifySdk", "loginRequest activeType =" + result.activeType);
                                wbCloudFaceVerifySdk2 = WbCloudFaceVerifySdk.this;
                                str2 = result.activeType;
                            } else {
                                wbCloudFaceVerifySdk2 = WbCloudFaceVerifySdk.this;
                                str2 = null;
                            }
                            wbCloudFaceVerifySdk2.ag = str2;
                            if (result.gradeCompareType != null) {
                                Param.setGradeCompareType(result.gradeCompareType);
                                if (result.optimalGradeType != null) {
                                    WbCloudFaceVerifySdk.this.ad = result.optimalGradeType;
                                } else {
                                    str3 = "optimalGradeType is null!";
                                }
                            } else {
                                str3 = "gradeCompareType is null!";
                            }
                            WLogger.w("WbCloudFaceVerifySdk", str3);
                            WBSimpleAnalyticsService.trackCustomKVEvent(context, "faceservice_login_fail", str3, WbCloudFaceVerifySdk.this.e());
                            WbCloudFaceVerifySdk.this.a(WbFaceError.WBFaceErrorCodeLoginServerError, str3);
                            return;
                        }
                        if (loginResponse.csrfToken != null) {
                            Param.setCsrfToken(loginResponse.csrfToken);
                            WbCloudFaceVerifySdk.this.R = true;
                            WLogger.d("WbCloudFaceVerifySdk", "isLoginOk true");
                            WbCloudFaceVerifySdk.this.c(context);
                            return;
                        }
                        str = "csrfToken is null!";
                    }
                    WLogger.w("WbCloudFaceVerifySdk", str);
                    WBSimpleAnalyticsService.trackCustomKVEvent(context, "faceservice_login_fail", str, WbCloudFaceVerifySdk.this.e());
                    wbCloudFaceVerifySdk = WbCloudFaceVerifySdk.this;
                    wbCloudFaceVerifySdk.a(str4, str);
                }
            });
        }
    }

    public void addControlCount() {
        this.P++;
    }

    public String getActivityTypes() {
        return this.ag;
    }

    public String getAuthType() {
        return this.af;
    }

    public int getBlinkSafetyLevel() {
        return this.F;
    }

    public boolean getCamSwitch() {
        return this.ai;
    }

    public String getColorMode() {
        return this.h;
    }

    public FaceVerifyStatus.Mode getCompareMode() {
        return this.ae;
    }

    public String getCompareType() {
        return this.i;
    }

    public int getControlCount() {
        return this.P;
    }

    public String getCustomerLongTip() {
        return this.ac;
    }

    public String getCustomerTipsLive() {
        return this.aa;
    }

    public String getCustomerTipsUpload() {
        return this.ab;
    }

    public String getLightDiffScore() {
        return this.o;
    }

    public String getLightFaceAreaMax() {
        return this.q;
    }

    public String getLightFaceAreaMin() {
        return this.p;
    }

    public String getLightFacePitchMax() {
        return this.u;
    }

    public String getLightFacePitchMin() {
        return this.t;
    }

    public String getLightFaceRollMax() {
        return this.w;
    }

    public String getLightFaceRollMin() {
        return this.v;
    }

    public String getLightFaceYawMax() {
        return this.s;
    }

    public String getLightFaceYawMin() {
        return this.r;
    }

    public String getLightPointsPercent() {
        return this.x;
    }

    public String getLightPointsVis() {
        return this.y;
    }

    public String getLiveSequences() {
        return this.ad;
    }

    public String getOrderNo() {
        return this.d.agreementNo;
    }

    public String getOutoftime() {
        return this.A;
    }

    public String getPicPath() {
        return this.J;
    }

    public String getProtocolCorpName() {
        return this.G;
    }

    public String getProtocolNo() {
        return this.H;
    }

    public String getRecordTime() {
        return this.C;
    }

    public int getRetryCount() {
        return this.Q;
    }

    public String getSrcPhotoString() {
        return this.L;
    }

    public String getSrcPhotoType() {
        return this.K;
    }

    public String getTestMsg() {
        if (TextUtils.isEmpty(this.O)) {
            return "";
        }
        return "androidiosappIdh5faceId" + this.O;
    }

    public String getTuringTime() {
        return this.B;
    }

    public int getUiType() {
        return this.Z;
    }

    public String getUserAESIv() {
        return this.ao;
    }

    public String getUserPublicKey() {
        return this.an;
    }

    public String getVideoPath() {
        return this.I;
    }

    public WbCloudFaceVeirfyResultListener getWbFaceVerifyResultListener() {
        return this.b;
    }

    public WeOkHttp getWeOkHttp() {
        WeOkHttp weOkHttp = this.e;
        return weOkHttp != null ? weOkHttp : c();
    }

    public String getYtModelLoc() {
        return this.M;
    }

    @Deprecated
    public void init(Context context, Bundle bundle, WbCloudFaceVeirfyLoginListner wbCloudFaceVeirfyLoginListner) {
        this.ak = false;
        this.c = wbCloudFaceVeirfyLoginListner;
        if (context.getApplicationContext() != null) {
            context = context.getApplicationContext();
        }
        if (bundle != null) {
            this.W = bundle.getBoolean(WbCloudFaceContant.IS_ENABLE_LOG, false);
            this.V = bundle.getBoolean(WbCloudFaceContant.IS_IPV6, false);
        }
        d(context);
        e(context);
        a();
        a(context);
        a(context, bundle);
    }

    public void initSdk(Context context, Bundle bundle, WbCloudFaceVeirfyLoginListner wbCloudFaceVeirfyLoginListner) {
        WLogger.d("WbCloudFaceVerifySdk", "initSdk");
        this.ak = true;
        this.c = wbCloudFaceVeirfyLoginListner;
        if (bundle != null) {
            this.W = bundle.getBoolean(WbCloudFaceContant.IS_ENABLE_LOG, false);
            this.V = bundle.getBoolean(WbCloudFaceContant.IS_IPV6, false);
        }
        d(context);
        e(context.getApplicationContext());
        a();
        a(context);
        a(context.getApplicationContext(), bundle);
    }

    public boolean isCheckVideo() {
        return this.j;
    }

    public boolean isDesensitizationMode() {
        return this.ak;
    }

    public boolean isEnableCloseEyes() {
        return this.Y;
    }

    public boolean isEnableLog() {
        return this.W;
    }

    public boolean isFinishedVerify() {
        return this.N;
    }

    public boolean isHasUserInfo() {
        return this.T;
    }

    public boolean isInGreyList() {
        return this.n;
    }

    public boolean isInit() {
        return this.aj;
    }

    public boolean isIpv6() {
        return this.V;
    }

    public boolean isLightSensor() {
        return this.X;
    }

    public boolean isPlayVoice() {
        return this.m;
    }

    public boolean isReset() {
        return this.ah;
    }

    public boolean isReturnVideo() {
        return this.am;
    }

    public boolean isShowFailPage() {
        return this.g;
    }

    public boolean isShowSuccessPage() {
        return this.f;
    }

    public boolean isSimpleMode() {
        return this.al;
    }

    public boolean isSitEnv() {
        return this.U;
    }

    public boolean isUploadVideo() {
        return this.l;
    }

    public void release() {
        WLogger.d("WbCloudFaceVerifySdk", "release");
        if (this.c != null) {
            this.c = null;
        }
        if (this.b != null) {
            this.b = null;
        }
    }

    public void setActivityTypes(String str) {
        this.ag = str;
    }

    public void setIsFinishedVerify(boolean z) {
        this.N = z;
    }

    public void setLightSensor(boolean z) {
        this.X = z;
    }

    public void setPicPath(String str) {
        this.J = str;
    }

    public void setReset(boolean z) {
        this.ah = z;
    }

    public void setRetryCount(int i) {
        this.Q = i;
    }

    public void setVideoPath(String str) {
        this.I = str;
    }

    public void startWbFaceVeirifySdk(Context context, WbCloudFaceVeirfyResultListener wbCloudFaceVeirfyResultListener) {
        Intent intent;
        Class<?> cls;
        if (this.E.equals("1")) {
            WLogger.i("WbCloudFaceVerifySdk", "enable startStatService");
            WBSimpleAnalyticsConfig.setEnableWBAService(true);
        } else {
            WLogger.i("WbCloudFaceVerifySdk", "disable startStatService");
            WBSimpleAnalyticsConfig.setEnableWBAService(false);
        }
        WBSimpleAnalyticsService.trackCustomKVEvent(context, "faceservice_startwb", Param.getCompareMode(), null);
        this.b = wbCloudFaceVeirfyResultListener;
        if (this.D.equals("1")) {
            intent = new Intent();
            cls = FaceGuideActivity.class;
        } else {
            intent = new Intent();
            cls = FaceVerifyActivity.class;
        }
        intent.setClass(context, cls);
        context.startActivity(intent);
        ((Activity) context).overridePendingTransition(0, 0);
    }
}