CarrotChat v2.8.60.240131版本的 MD5 值为:2baf8b9f31830b86b5c5a85ae6b47e05

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


package com.mobile.auth.gatewayauth;

import ak.im.module.BleConstant;
import android.content.Context;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.text.TextUtils;
import androidx.annotation.IntRange;
import androidx.annotation.NonNull;
import com.alicom.tools.networking.ResultMsg;
import com.alicom.tools.serialization.JSONType;
import com.alicom.tools.serialization.JSONUtils;
import com.mobile.auth.gatewayauth.annotations.AuthNumber;
import com.mobile.auth.gatewayauth.annotations.SafeProtector;
import com.mobile.auth.gatewayauth.manager.RequestCallback;
import com.mobile.auth.gatewayauth.manager.SystemManager;
import com.mobile.auth.gatewayauth.manager.TokenMaskManager;
import com.mobile.auth.gatewayauth.manager.VendorSdkInfoManager;
import com.mobile.auth.gatewayauth.manager.compat.ResultCodeProcessor;
import com.mobile.auth.gatewayauth.manager.f;
import com.mobile.auth.gatewayauth.model.ConfigRule;
import com.mobile.auth.gatewayauth.model.LoginPhoneInfo;
import com.mobile.auth.gatewayauth.model.MonitorStruct;
import com.mobile.auth.gatewayauth.model.TokenRet;
import com.mobile.auth.gatewayauth.model.UStruct;
import com.mobile.auth.gatewayauth.network.PrivateKeyRespone;
import com.mobile.auth.gatewayauth.network.PrivateRespone;
import com.mobile.auth.gatewayauth.network.RequestState;
import com.mobile.auth.gatewayauth.network.RequestUtil;
import com.mobile.auth.gatewayauth.network.UTSharedPreferencesHelper;
import com.mobile.auth.gatewayauth.utils.EncryptUtils;
import com.mobile.auth.gatewayauth.utils.g;
import com.nirvana.tools.core.ComponentSdkCore;
import com.nirvana.tools.core.ExecutorManager;
import com.nirvana.tools.logger.UaidTracker;
import java.lang.reflect.Field;
import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import org.json.JSONException;
import org.json.JSONObject;
public class PhoneNumberAuthHelperProxy {
    @AuthNumber
    public static final int SERVICE_TYPE_AUTH = 1;
    @AuthNumber
    public static final int SERVICE_TYPE_LOGIN = 2;
    protected static volatile PhoneNumberAuthHelperProxy a;
    private TokenResultListener f12930b;
    private SystemManager f12931c;
    private com.mobile.auth.gatewayauth.manager.b f12932d;
    private VendorSdkInfoManager f12933e;
    private TokenMaskManager f;
    private com.mobile.auth.gatewayauth.manager.d g;
    private f h;
    private Future<?> i;
    private com.mobile.auth.q.a j;
    private String k;
    private volatile String n;
    private final ResultCodeProcessor l = new com.mobile.auth.gatewayauth.manager.compat.a();
    private final ResultCodeProcessor m = new com.mobile.auth.gatewayauth.manager.compat.b();
    private Handler o = new Handler(Looper.getMainLooper()) {
        @Override
        public void dispatchMessage(@NonNull Message message) {
            try {
                super.dispatchMessage(message);
                if (message.what == 0) {
                    PhoneNumberAuthHelperProxy.b(PhoneNumberAuthHelperProxy.this).a("", new RequestCallback<Void, String>() {
                        public void a(String str) {
                            try {
                                PhoneNumberAuthHelperProxy.d(PhoneNumberAuthHelperProxy.this).e("GetVendorList failed!", str);
                            } catch (Throwable th) {
                                try {
                                    ExceptionProcessor.processException(th);
                                } catch (Throwable th2) {
                                    ExceptionProcessor.processException(th2);
                                }
                            }
                        }

                        public void a(Void r2) {
                            try {
                                PhoneNumberAuthHelperProxy.c(PhoneNumberAuthHelperProxy.this).a(PhoneNumberAuthHelperProxy.b(PhoneNumberAuthHelperProxy.this));
                            } catch (Throwable th) {
                                try {
                                    ExceptionProcessor.processException(th);
                                } catch (Throwable th2) {
                                    ExceptionProcessor.processException(th2);
                                }
                            }
                        }

                        @Override
                        public void onError(String str) {
                            try {
                                a(str);
                            } catch (Throwable th) {
                                try {
                                    ExceptionProcessor.processException(th);
                                } catch (Throwable th2) {
                                    ExceptionProcessor.processException(th2);
                                }
                            }
                        }

                        @Override
                        public void onSuccess(Void r1) {
                            try {
                                a(r1);
                            } catch (Throwable th) {
                                try {
                                    ExceptionProcessor.processException(th);
                                } catch (Throwable th2) {
                                    ExceptionProcessor.processException(th2);
                                }
                            }
                        }
                    }, com.mobile.auth.gatewayauth.manager.e.a(PhoneNumberAuthHelperProxy.a(PhoneNumberAuthHelperProxy.this).e(), PhoneNumberAuthHelperProxy.b(PhoneNumberAuthHelperProxy.this), PhoneNumberAuthHelperProxy.e(PhoneNumberAuthHelperProxy.this), PhoneNumberAuthHelperProxy.d(PhoneNumberAuthHelperProxy.this)));
                }
            } catch (Throwable th) {
                try {
                    ExceptionProcessor.processException(th);
                } catch (Throwable th2) {
                    ExceptionProcessor.processException(th2);
                }
            }
        }
    };

    class AnonymousClass10 implements RequestCallback<com.mobile.auth.gatewayauth.manager.base.b, com.mobile.auth.gatewayauth.manager.base.b> {
        final c a;
        final MonitorStruct f12934b;
        final String f12935c;
        final ResultCodeProcessor f12936d;
        final TokenResultListener f12937e;
        final String f;

        AnonymousClass10(c cVar, MonitorStruct monitorStruct, String str, ResultCodeProcessor resultCodeProcessor, TokenResultListener tokenResultListener, String str2) {
            this.a = cVar;
            this.f12934b = monitorStruct;
            this.f12935c = str;
            this.f12936d = resultCodeProcessor;
            this.f12937e = tokenResultListener;
            this.f = str2;
        }

        public void a(com.mobile.auth.gatewayauth.manager.base.b bVar) {
            try {
                if (this.a.d()) {
                    this.f12934b.setCache(String.valueOf(bVar.e()));
                    PhoneNumberAuthHelperProxy.a(PhoneNumberAuthHelperProxy.this, true, this.f12935c, this.f12936d, this.f12934b, bVar.d(), this.f12937e, this.f);
                }
            } catch (Throwable th) {
                try {
                    ExceptionProcessor.processException(th);
                } catch (Throwable th2) {
                    ExceptionProcessor.processException(th2);
                }
            }
        }

        public void b(com.mobile.auth.gatewayauth.manager.base.b bVar) {
            try {
                if (this.a.d()) {
                    this.f12934b.setCache("false");
                    this.f12934b.setCarrierFailedResultData(bVar.d());
                    PhoneNumberAuthHelperProxy.b(PhoneNumberAuthHelperProxy.this, bVar.b(), bVar.c(), bVar.g(), this.f12935c, this.f12937e, this.f12936d, this.f12934b, this.f);
                }
            } catch (Throwable th) {
                try {
                    ExceptionProcessor.processException(th);
                } catch (Throwable th2) {
                    ExceptionProcessor.processException(th2);
                }
            }
        }

        @Override
        public void onError(com.mobile.auth.gatewayauth.manager.base.b bVar) {
            try {
                b(bVar);
            } catch (Throwable th) {
                try {
                    ExceptionProcessor.processException(th);
                } catch (Throwable th2) {
                    ExceptionProcessor.processException(th2);
                }
            }
        }

        @Override
        public void onSuccess(com.mobile.auth.gatewayauth.manager.base.b bVar) {
            try {
                a(bVar);
            } catch (Throwable th) {
                try {
                    ExceptionProcessor.processException(th);
                } catch (Throwable th2) {
                    ExceptionProcessor.processException(th2);
                }
            }
        }
    }

    class AnonymousClass20 implements Runnable {
        final RequestCallback a;

        AnonymousClass20(RequestCallback requestCallback) {
            this.a = requestCallback;
        }

        @Override
        public void run() {
            try {
                this.a.onError(com.mobile.auth.gatewayauth.manager.base.b.a(ResultCode.CODE_ERROR_FUNCTION_TIME_OUT, "请求超时"));
            } catch (Throwable th) {
                try {
                    ExceptionProcessor.processException(th);
                } catch (Throwable th2) {
                    ExceptionProcessor.processException(th2);
                }
            }
        }
    }

    class AnonymousClass21 implements RequestCallback<com.mobile.auth.gatewayauth.manager.base.b, com.mobile.auth.gatewayauth.manager.base.b> {
        final c a;
        final MonitorStruct f12962b;
        final ResultCodeProcessor f12963c;
        final RequestCallback f12964d;

        AnonymousClass21(c cVar, MonitorStruct monitorStruct, ResultCodeProcessor resultCodeProcessor, RequestCallback requestCallback) {
            this.a = cVar;
            this.f12962b = monitorStruct;
            this.f12963c = resultCodeProcessor;
            this.f12964d = requestCallback;
        }

        public void a(com.mobile.auth.gatewayauth.manager.base.b bVar) {
            try {
                if (this.a.d()) {
                    this.f12962b.setCache(String.valueOf(bVar.e()));
                    LoginPhoneInfo h = bVar.h();
                    this.f12962b.setPhoneNumber(h.getPhoneNumber());
                    PhoneNumberAuthHelperProxy.this.a(h.getPhoneNumber());
                    this.f12962b.setAuthSdkCode(this.f12963c.convertCode(Constant.CODE_GET_TOKEN_SUCCESS));
                    this.f12964d.onSuccess(h);
                }
            } catch (Throwable th) {
                try {
                    ExceptionProcessor.processException(th);
                } catch (Throwable th2) {
                    ExceptionProcessor.processException(th2);
                }
            }
        }

        public void b(com.mobile.auth.gatewayauth.manager.base.b bVar) {
            try {
                if (this.a.d()) {
                    this.f12962b.setCache("false");
                    this.f12962b.setCarrierFailedResultData(bVar.d());
                    PhoneNumberAuthHelperProxy.d(PhoneNumberAuthHelperProxy.this).e("justGetLoginPhone failed!", bVar.i());
                    this.f12964d.onError(bVar);
                }
            } catch (Throwable th) {
                try {
                    ExceptionProcessor.processException(th);
                } catch (Throwable th2) {
                    ExceptionProcessor.processException(th2);
                }
            }
        }

        @Override
        public void onError(com.mobile.auth.gatewayauth.manager.base.b bVar) {
            try {
                b(bVar);
            } catch (Throwable th) {
                try {
                    ExceptionProcessor.processException(th);
                } catch (Throwable th2) {
                    ExceptionProcessor.processException(th2);
                }
            }
        }

        @Override
        public void onSuccess(com.mobile.auth.gatewayauth.manager.base.b bVar) {
            try {
                a(bVar);
            } catch (Throwable th) {
                try {
                    ExceptionProcessor.processException(th);
                } catch (Throwable th2) {
                    ExceptionProcessor.processException(th2);
                }
            }
        }
    }

    class AnonymousClass7 implements Runnable {
        final String a;
        final TokenResultListener f12997b;
        final ResultCodeProcessor f12998c;
        final MonitorStruct f12999d;
        final String f13000e;

        AnonymousClass7(String str, TokenResultListener tokenResultListener, ResultCodeProcessor resultCodeProcessor, MonitorStruct monitorStruct, String str2) {
            this.a = str;
            this.f12997b = tokenResultListener;
            this.f12998c = resultCodeProcessor;
            this.f12999d = monitorStruct;
            this.f13000e = str2;
        }

        @Override
        public void run() {
            try {
                PhoneNumberAuthHelperProxy.a(PhoneNumberAuthHelperProxy.this, ResultCode.CODE_ERROR_FUNCTION_TIME_OUT, "请求超时", com.mobile.auth.gatewayauth.utils.a.a(ResultCode.CODE_ERROR_FUNCTION_TIME_OUT, "请求超时"), this.a, this.f12997b, this.f12998c, this.f12999d, this.f13000e);
                PhoneNumberAuthHelperProxy.d(PhoneNumberAuthHelperProxy.this).e("justGetLoginToken Timeout!");
            } catch (Throwable th) {
                try {
                    ExceptionProcessor.processException(th);
                } catch (Throwable th2) {
                    ExceptionProcessor.processException(th2);
                }
            }
        }
    }

    class AnonymousClass8 implements RequestCallback<com.mobile.auth.gatewayauth.manager.base.b, com.mobile.auth.gatewayauth.manager.base.b> {
        final c a;
        final MonitorStruct f13001b;
        final String f13002c;
        final TokenResultListener f13003d;
        final ResultCodeProcessor f13004e;
        final String f;

        AnonymousClass8(c cVar, MonitorStruct monitorStruct, String str, TokenResultListener tokenResultListener, ResultCodeProcessor resultCodeProcessor, String str2) {
            this.a = cVar;
            this.f13001b = monitorStruct;
            this.f13002c = str;
            this.f13003d = tokenResultListener;
            this.f13004e = resultCodeProcessor;
            this.f = str2;
        }

        public void a(com.mobile.auth.gatewayauth.manager.base.b bVar) {
            try {
                if (this.a.d()) {
                    this.f13001b.setCache(String.valueOf(bVar.e()));
                    PhoneNumberAuthHelperProxy.a(PhoneNumberAuthHelperProxy.this, true, this.f13002c, this.f13003d, this.f13004e, bVar.d(), this.f13001b, this.f);
                }
            } catch (Throwable th) {
                try {
                    ExceptionProcessor.processException(th);
                } catch (Throwable th2) {
                    ExceptionProcessor.processException(th2);
                }
            }
        }

        public void b(com.mobile.auth.gatewayauth.manager.base.b bVar) {
            try {
                if (this.a.d()) {
                    this.f13001b.setCache("false");
                    this.f13001b.setCarrierFailedResultData(bVar.d());
                    PhoneNumberAuthHelperProxy.a(PhoneNumberAuthHelperProxy.this, bVar.b(), bVar.c(), bVar.g(), this.f13002c, this.f13003d, this.f13004e, this.f13001b, this.f);
                }
            } catch (Throwable th) {
                try {
                    ExceptionProcessor.processException(th);
                } catch (Throwable th2) {
                    ExceptionProcessor.processException(th2);
                }
            }
        }

        @Override
        public void onError(com.mobile.auth.gatewayauth.manager.base.b bVar) {
            try {
                b(bVar);
            } catch (Throwable th) {
                try {
                    ExceptionProcessor.processException(th);
                } catch (Throwable th2) {
                    ExceptionProcessor.processException(th2);
                }
            }
        }

        @Override
        public void onSuccess(com.mobile.auth.gatewayauth.manager.base.b bVar) {
            try {
                a(bVar);
            } catch (Throwable th) {
                try {
                    ExceptionProcessor.processException(th);
                } catch (Throwable th2) {
                    ExceptionProcessor.processException(th2);
                }
            }
        }
    }

    class AnonymousClass9 implements Runnable {
        final String a;
        final TokenResultListener f13005b;
        final ResultCodeProcessor f13006c;
        final MonitorStruct f13007d;
        final String f13008e;

        AnonymousClass9(String str, TokenResultListener tokenResultListener, ResultCodeProcessor resultCodeProcessor, MonitorStruct monitorStruct, String str2) {
            this.a = str;
            this.f13005b = tokenResultListener;
            this.f13006c = resultCodeProcessor;
            this.f13007d = monitorStruct;
            this.f13008e = str2;
        }

        @Override
        public void run() {
            try {
                PhoneNumberAuthHelperProxy.b(PhoneNumberAuthHelperProxy.this, ResultCode.CODE_ERROR_FUNCTION_TIME_OUT, "请求超时", com.mobile.auth.gatewayauth.utils.a.a(ResultCode.CODE_ERROR_FUNCTION_TIME_OUT, "请求超时"), this.a, this.f13005b, this.f13006c, this.f13007d, this.f13008e);
                PhoneNumberAuthHelperProxy.d(PhoneNumberAuthHelperProxy.this).e("justGetToken Timeout!");
            } catch (Throwable th) {
                try {
                    ExceptionProcessor.processException(th);
                } catch (Throwable th2) {
                    ExceptionProcessor.processException(th2);
                }
            }
        }
    }

    static {
        b.a.a.a.SLoad("pns-2.13.2.1-LogOnlineStandardCuumRelease_alijtca_plus");
        a = null;
    }

    private PhoneNumberAuthHelperProxy(Context context, TokenResultListener tokenResultListener) {
        this.f12930b = tokenResultListener;
        ComponentSdkCore.register(context.getApplicationContext());
        a(context.getApplicationContext());
    }

    static SystemManager a(PhoneNumberAuthHelperProxy phoneNumberAuthHelperProxy) {
        try {
            return phoneNumberAuthHelperProxy.f12931c;
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
                return null;
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
                return null;
            }
        }
    }

    private void a(Context context) {
        try {
            com.mobile.auth.gatewayauth.manager.d dVar = new com.mobile.auth.gatewayauth.manager.d(context);
            this.g = dVar;
            this.j = dVar.a();
            this.f12931c = new SystemManager(context, this.j);
            VendorSdkInfoManager vendorSdkInfoManager = new VendorSdkInfoManager(this.g, this.f12931c);
            this.f12933e = vendorSdkInfoManager;
            this.f12932d = new com.mobile.auth.gatewayauth.manager.b(context, vendorSdkInfoManager, this.g);
            f fVar = new f(this.f12931c, this.g);
            this.h = fVar;
            this.g.a(fVar);
            this.f = new TokenMaskManager(this.f12932d, this.f12931c, this.g, this.h, this.f12933e);
            ExecutorManager.getInstance().scheduleFuture(new Runnable() {
                @Override
                public void run() {
                    try {
                        PhoneNumberAuthHelperProxy.a(PhoneNumberAuthHelperProxy.this).getSimCacheKey(false, null);
                    } catch (Throwable th) {
                        try {
                            ExceptionProcessor.processException(th);
                        } catch (Throwable th2) {
                            ExceptionProcessor.processException(th2);
                        }
                    }
                }
            });
            if (c(this.f12931c.e())) {
                this.i = d();
            }
            UaidTracker.getInstance().setKey(EncryptUtils.getSecret5().substring(4, 10) + EncryptUtils.getSecret6().substring(1, 7), EncryptUtils.getSecret5().substring(15) + EncryptUtils.getSecret6().substring(38, 54), EncryptUtils.getSecret6().substring(70, 76) + EncryptUtils.getSecret6().substring(86, 92));
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
            }
        }
    }

    private void a(Context context, boolean z) {
        try {
            ResultMsg privateKey = RequestUtil.getPrivateKey(context, this.f12933e.c(), this.g.j());
            if (!privateKey.isSuccess() || TextUtils.isEmpty(privateKey.getResult())) {
                return;
            }
            try {
                PrivateRespone privateRespone = (PrivateRespone) JSONUtils.fromJson(new JSONObject(privateKey.getResult()), (JSONType<Object>) new JSONType<PrivateRespone>() {
                }, (List<Field>) null);
                if ("OK".equals(privateRespone.getCode())) {
                    PrivateKeyRespone data = privateRespone.getData();
                    if (data.getExpiredTime() <= System.currentTimeMillis()) {
                        return;
                    }
                    UTSharedPreferencesHelper.saveAuthSDKPrivateKey(context, com.mobile.auth.gatewayauth.utils.security.a.a(data.toJson().toString().getBytes()));
                    RequestState.getInstance().setKeyRespone(data);
                }
            } catch (JSONException e2) {
                e2.printStackTrace();
            }
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
            }
        }
    }

    static void a(PhoneNumberAuthHelperProxy phoneNumberAuthHelperProxy, int i, ResultCodeProcessor resultCodeProcessor, boolean z, TokenResultListener tokenResultListener) {
        try {
            phoneNumberAuthHelperProxy.justGetToken(i, resultCodeProcessor, z, tokenResultListener);
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
            }
        }
    }

    static void a(PhoneNumberAuthHelperProxy phoneNumberAuthHelperProxy, long j, PreLoginResultListener preLoginResultListener) {
        try {
            phoneNumberAuthHelperProxy.justPreVerify(j, preLoginResultListener);
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
            }
        }
    }

    static void a(PhoneNumberAuthHelperProxy phoneNumberAuthHelperProxy, long j, PreLoginResultListener preLoginResultListener, ResultCodeProcessor resultCodeProcessor, boolean z, boolean z2) {
        try {
            phoneNumberAuthHelperProxy.justPreLogin(j, preLoginResultListener, resultCodeProcessor, z, z2);
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
            }
        }
    }

    static void a(PhoneNumberAuthHelperProxy phoneNumberAuthHelperProxy, long j, TokenResultListener tokenResultListener, ResultCodeProcessor resultCodeProcessor) {
        try {
            phoneNumberAuthHelperProxy.justGetLoginToken(j, tokenResultListener, resultCodeProcessor);
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
            }
        }
    }

    static void a(PhoneNumberAuthHelperProxy phoneNumberAuthHelperProxy, Context context, boolean z) {
        try {
            phoneNumberAuthHelperProxy.a(context, z);
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
            }
        }
    }

    static void a(PhoneNumberAuthHelperProxy phoneNumberAuthHelperProxy, String str, String str2, String str3, String str4, TokenResultListener tokenResultListener, ResultCodeProcessor resultCodeProcessor, MonitorStruct monitorStruct, String str5) {
        try {
            phoneNumberAuthHelperProxy.a(str, str2, str3, str4, tokenResultListener, resultCodeProcessor, monitorStruct, str5);
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
            }
        }
    }

    static void a(PhoneNumberAuthHelperProxy phoneNumberAuthHelperProxy, boolean z, boolean z2, String str, String str2, MonitorStruct monitorStruct, TokenResultListener tokenResultListener) {
        try {
            phoneNumberAuthHelperProxy.a(z, z2, str, str2, monitorStruct, tokenResultListener);
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
            }
        }
    }

    private void a(String str, String str2, String str3, String str4, TokenResultListener tokenResultListener, ResultCodeProcessor resultCodeProcessor, MonitorStruct monitorStruct, String str5) {
        try {
            this.g.h();
            if (monitorStruct.getAction().equals(this.f12931c.c(str4))) {
                a(false, false, str, str2, str3, str4, monitorStruct, tokenResultListener, resultCodeProcessor, str5);
            } else {
                a(false, true, str, str2, str3, str4, monitorStruct, tokenResultListener, resultCodeProcessor, str5);
            }
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
            }
        }
    }

    private void a(final String str, final boolean z, final MonitorStruct monitorStruct, final boolean z2) {
        try {
            ExecutorManager.getInstance().scheduleFuture(new Runnable() {
                @Override
                public void run() {
                    try {
                        if (monitorStruct != null) {
                            long currentTimeMillis = System.currentTimeMillis();
                            monitorStruct.setSuccess(z);
                            monitorStruct.setEndTime(currentTimeMillis);
                            if (!z) {
                                monitorStruct.setFailRet(str);
                            }
                            PhoneNumberAuthHelperProxy.d(PhoneNumberAuthHelperProxy.this).a(PhoneNumberAuthHelperProxy.f(PhoneNumberAuthHelperProxy.this).a(monitorStruct), monitorStruct.getUrgency());
                        }
                        if (z2) {
                            PhoneNumberAuthHelperProxy.d(PhoneNumberAuthHelperProxy.this).b();
                        }
                    } catch (Throwable th) {
                        try {
                            ExceptionProcessor.processException(th);
                        } catch (Throwable th2) {
                            ExceptionProcessor.processException(th2);
                        }
                    }
                }
            });
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
            }
        }
    }

    private void a(final boolean z, final String str, final TokenResultListener tokenResultListener) {
        try {
            ExecutorManager.getInstance().postMain(new ExecutorManager.SafeRunnable() {
                @Override
                protected void onException(Throwable th) {
                    try {
                        PhoneNumberAuthHelperProxy.d(PhoneNumberAuthHelperProxy.this).e("TokenResultListener callback exception!", ExecutorManager.getErrorInfoFromException(th));
                    } catch (Throwable th2) {
                        try {
                            ExceptionProcessor.processException(th2);
                        } catch (Throwable th3) {
                            ExceptionProcessor.processException(th3);
                        }
                    }
                }

                @Override
                protected void safeRun() {
                    try {
                        if (z) {
                            tokenResultListener.onTokenSuccess(str);
                        } else {
                            tokenResultListener.onTokenFailed(str);
                        }
                    } catch (Throwable th) {
                        try {
                            ExceptionProcessor.processException(th);
                        } catch (Throwable th2) {
                            ExceptionProcessor.processException(th2);
                        }
                    }
                }
            });
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
            }
        }
    }

    private void a(boolean z, boolean z2, String str, String str2, MonitorStruct monitorStruct, TokenResultListener tokenResultListener) {
        if (tokenResultListener != null) {
            try {
                a(z, str2, tokenResultListener);
            } catch (Throwable th) {
                try {
                    ExceptionProcessor.processException(th);
                    return;
                } catch (Throwable th2) {
                    ExceptionProcessor.processException(th2);
                    return;
                }
            }
        }
        if (monitorStruct != null && !Constant.ACTION_SDK_LIFE_BODY_VERIFY.equals(monitorStruct.getAction())) {
            a(str, z, monitorStruct, z2);
        }
    }

    static boolean a(PhoneNumberAuthHelperProxy phoneNumberAuthHelperProxy, boolean z, String str, TokenResultListener tokenResultListener, ResultCodeProcessor resultCodeProcessor, String str2, MonitorStruct monitorStruct, String str3) {
        try {
            return phoneNumberAuthHelperProxy.a(z, str, tokenResultListener, resultCodeProcessor, str2, monitorStruct, str3);
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
                return false;
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
                return false;
            }
        }
    }

    static boolean a(PhoneNumberAuthHelperProxy phoneNumberAuthHelperProxy, boolean z, String str, ResultCodeProcessor resultCodeProcessor, MonitorStruct monitorStruct, String str2, TokenResultListener tokenResultListener, String str3) {
        try {
            return phoneNumberAuthHelperProxy.a(z, str, resultCodeProcessor, monitorStruct, str2, tokenResultListener, str3);
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
                return false;
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
                return false;
            }
        }
    }

    private boolean a(final String str, String str2, final String str3) {
        try {
            final long currentTimeMillis = System.currentTimeMillis();
            boolean z = (str3 == null || str3.equals(str2)) ? false : true;
            final long currentTimeMillis2 = System.currentTimeMillis();
            final boolean z2 = z;
            ExecutorManager.getInstance().scheduleFuture(new Runnable() {
                @Override
                public void run() {
                    try {
                        PhoneNumberAuthHelperProxy.d(PhoneNumberAuthHelperProxy.this).a(PhoneNumberAuthHelperProxy.f(PhoneNumberAuthHelperProxy.this).a(str3, Constant.ACTION_SDK_CROSS_CARRIER_CHANGE, UStruct.newUStruct().isCarrierChanged(String.valueOf(z2)).requestId(PhoneNumberAuthHelperProxy.f(PhoneNumberAuthHelperProxy.this).e()).sessionId(str).startTime(currentTimeMillis).endTime(currentTimeMillis2).build(), ""), 2);
                    } catch (Throwable th) {
                        try {
                            ExceptionProcessor.processException(th);
                        } catch (Throwable th2) {
                            ExceptionProcessor.processException(th2);
                        }
                    }
                }
            });
            return z;
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
                return false;
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
                return false;
            }
        }
    }

    private boolean a(boolean z, String str, TokenResultListener tokenResultListener, ResultCodeProcessor resultCodeProcessor, String str2, MonitorStruct monitorStruct, String str3) {
        try {
            this.g.h();
            if (!TextUtils.isEmpty(str2)) {
                a(str2, str, monitorStruct, resultCodeProcessor, tokenResultListener);
                return true;
            }
            this.j.e("GetLoginToken from cache is null!");
            if (z) {
                monitorStruct.setAuthSdkCode(Constant.CODE_ERROR_UNKNOWN_FAIL);
                a(false, true, Constant.CODE_ERROR_UNKNOWN_FAIL, "未知异常", com.mobile.auth.gatewayauth.utils.a.a(Constant.CODE_ERROR_UNKNOWN_FAIL, "未知异常"), str, monitorStruct, tokenResultListener, resultCodeProcessor, str3);
            }
            return false;
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
                return false;
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
                return false;
            }
        }
    }

    private boolean a(boolean z, String str, ResultCodeProcessor resultCodeProcessor, MonitorStruct monitorStruct, String str2, TokenResultListener tokenResultListener, String str3) {
        try {
            this.g.i();
            if (!TextUtils.isEmpty(str2)) {
                a(str2, str, monitorStruct, resultCodeProcessor, tokenResultListener);
                return true;
            }
            this.j.e("GetVerifyToken from cache is null!");
            if (z) {
                a(false, true, Constant.CODE_ERROR_UNKNOWN_FAIL, "未知异常", com.mobile.auth.gatewayauth.utils.a.a(Constant.CODE_ERROR_UNKNOWN_FAIL, "未知异常"), str, monitorStruct, tokenResultListener, resultCodeProcessor, str3);
            }
            return false;
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
                return false;
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
                return false;
            }
        }
    }

    static VendorSdkInfoManager b(PhoneNumberAuthHelperProxy phoneNumberAuthHelperProxy) {
        try {
            return phoneNumberAuthHelperProxy.f12933e;
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
                return null;
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
                return null;
            }
        }
    }

    static void b(PhoneNumberAuthHelperProxy phoneNumberAuthHelperProxy, String str, String str2, String str3, String str4, TokenResultListener tokenResultListener, ResultCodeProcessor resultCodeProcessor, MonitorStruct monitorStruct, String str5) {
        try {
            phoneNumberAuthHelperProxy.b(str, str2, str3, str4, tokenResultListener, resultCodeProcessor, monitorStruct, str5);
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
            }
        }
    }

    private void b(String str, String str2, String str3, String str4, TokenResultListener tokenResultListener, ResultCodeProcessor resultCodeProcessor, MonitorStruct monitorStruct, String str5) {
        try {
            this.g.i();
            if (monitorStruct.getAction().equals(this.f12931c.d(str4))) {
                a(false, false, str, str2, str3, str4, monitorStruct, tokenResultListener, resultCodeProcessor, str5);
            } else {
                a(false, true, str, str2, str3, str4, monitorStruct, tokenResultListener, resultCodeProcessor, str5);
            }
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
            }
        }
    }

    private boolean b(final Context context) {
        try {
            String readAuthSDKPrivateKey = UTSharedPreferencesHelper.readAuthSDKPrivateKey(context);
            if (TextUtils.isEmpty(readAuthSDKPrivateKey)) {
                this.j.a("local pritekey is empty");
                RequestState.getInstance().setUseRequest(true);
                ExecutorManager.getInstance().scheduleFuture(new Runnable() {
                    @Override
                    public void run() {
                        try {
                            PhoneNumberAuthHelperProxy.a(PhoneNumberAuthHelperProxy.this, context, true);
                        } catch (Throwable th) {
                            try {
                                ExceptionProcessor.processException(th);
                            } catch (Throwable th2) {
                                ExceptionProcessor.processException(th2);
                            }
                        }
                    }
                });
                return false;
            }
            try {
                PrivateKeyRespone privateKeyRespone = (PrivateKeyRespone) JSONUtils.fromJson(new JSONObject(new String(com.mobile.auth.gatewayauth.utils.security.a.a(readAuthSDKPrivateKey))), (JSONType<Object>) new JSONType<PrivateKeyRespone>() {
                }, (List<Field>) null);
                if (privateKeyRespone == null) {
                    this.j.a("parse local privatekey is empty");
                    RequestState.getInstance().setUseRequest(true);
                    ExecutorManager.getInstance().scheduleFuture(new Runnable() {
                        @Override
                        public void run() {
                            try {
                                PhoneNumberAuthHelperProxy.a(PhoneNumberAuthHelperProxy.this, context, true);
                            } catch (Throwable th) {
                                try {
                                    ExceptionProcessor.processException(th);
                                } catch (Throwable th2) {
                                    ExceptionProcessor.processException(th2);
                                }
                            }
                        }
                    });
                    return false;
                }
                RequestState.getInstance().setKeyRespone(privateKeyRespone);
                if (RequestState.getInstance().checkTokenValied(30)) {
                    return true;
                }
                this.j.a("local privatekey expired not enough");
                long expiredTime = privateKeyRespone.getExpiredTime();
                long currentTimeMillis = System.currentTimeMillis();
                RequestState.getInstance().setUseRequest(true);
                ExecutorManager.getInstance().scheduleFuture(new Runnable() {
                    @Override
                    public void run() {
                        try {
                            PhoneNumberAuthHelperProxy.a(PhoneNumberAuthHelperProxy.this, context, true);
                        } catch (Throwable th) {
                            try {
                                ExceptionProcessor.processException(th);
                            } catch (Throwable th2) {
                                ExceptionProcessor.processException(th2);
                            }
                        }
                    }
                });
                if (expiredTime - currentTimeMillis > 0) {
                    return true;
                }
                this.j.a("local privatekey has expired");
                return false;
            } catch (JSONException e2) {
                e2.printStackTrace();
                this.j.a("parse local privatekey error");
                RequestState.getInstance().setUseRequest(true);
                ExecutorManager.getInstance().scheduleFuture(new Runnable() {
                    @Override
                    public void run() {
                        try {
                            PhoneNumberAuthHelperProxy.a(PhoneNumberAuthHelperProxy.this, context, true);
                        } catch (Throwable th) {
                            try {
                                ExceptionProcessor.processException(th);
                            } catch (Throwable th2) {
                                ExceptionProcessor.processException(th2);
                            }
                        }
                    }
                });
                return false;
            }
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
                return false;
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
                return false;
            }
        }
    }

    static f c(PhoneNumberAuthHelperProxy phoneNumberAuthHelperProxy) {
        try {
            return phoneNumberAuthHelperProxy.h;
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
                return null;
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
                return null;
            }
        }
    }

    private boolean c(Context context) {
        try {
            String readAuthSDKPrivateKey = UTSharedPreferencesHelper.readAuthSDKPrivateKey(context);
            if (!TextUtils.isEmpty(readAuthSDKPrivateKey)) {
                try {
                    PrivateKeyRespone privateKeyRespone = (PrivateKeyRespone) JSONUtils.fromJson(new JSONObject(new String(com.mobile.auth.gatewayauth.utils.security.a.a(readAuthSDKPrivateKey))), (JSONType<Object>) new JSONType<PrivateKeyRespone>() {
                    }, (List<Field>) null);
                    if (privateKeyRespone == null) {
                        return false;
                    }
                    RequestState.getInstance().setKeyRespone(privateKeyRespone);
                    return RequestState.getInstance().checkTokenValied(0);
                } catch (JSONException e2) {
                    e2.printStackTrace();
                    this.j.a("parse local privatekey error");
                }
            }
            return false;
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
                return false;
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
                return false;
            }
        }
    }

    static com.mobile.auth.q.a d(PhoneNumberAuthHelperProxy phoneNumberAuthHelperProxy) {
        try {
            return phoneNumberAuthHelperProxy.j;
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
                return null;
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
                return null;
            }
        }
    }

    private Future<?> d() {
        try {
            return ExecutorManager.getInstance().scheduleFuture(new Runnable() {
                @Override
                public void run() {
                    try {
                        final CountDownLatch countDownLatch = new CountDownLatch(1);
                        PhoneNumberAuthHelperProxy.e(PhoneNumberAuthHelperProxy.this).a(new RequestCallback<ConfigRule, Void>() {
                            public void a(ConfigRule configRule) {
                                try {
                                    countDownLatch.countDown();
                                } catch (Throwable th) {
                                    try {
                                        ExceptionProcessor.processException(th);
                                    } catch (Throwable th2) {
                                        ExceptionProcessor.processException(th2);
                                    }
                                }
                            }

                            public void a(Void r1) {
                                try {
                                    countDownLatch.countDown();
                                } catch (Throwable th) {
                                    try {
                                        ExceptionProcessor.processException(th);
                                    } catch (Throwable th2) {
                                        ExceptionProcessor.processException(th2);
                                    }
                                }
                            }

                            @Override
                            public void onError(Void r1) {
                                try {
                                    a(r1);
                                } catch (Throwable th) {
                                    try {
                                        ExceptionProcessor.processException(th);
                                    } catch (Throwable th2) {
                                        ExceptionProcessor.processException(th2);
                                    }
                                }
                            }

                            @Override
                            public void onSuccess(ConfigRule configRule) {
                                try {
                                    a(configRule);
                                } catch (Throwable th) {
                                    try {
                                        ExceptionProcessor.processException(th);
                                    } catch (Throwable th2) {
                                        ExceptionProcessor.processException(th2);
                                    }
                                }
                            }
                        });
                        try {
                            countDownLatch.await(BleConstant.SEND_OUTTIME, TimeUnit.MILLISECONDS);
                        } catch (InterruptedException e2) {
                            e2.printStackTrace();
                        }
                    } catch (Throwable th) {
                        try {
                            ExceptionProcessor.processException(th);
                        } catch (Throwable th2) {
                            ExceptionProcessor.processException(th2);
                        }
                    }
                }
            });
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
                return null;
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
                return null;
            }
        }
    }

    static com.mobile.auth.gatewayauth.manager.b e(PhoneNumberAuthHelperProxy phoneNumberAuthHelperProxy) {
        try {
            return phoneNumberAuthHelperProxy.f12932d;
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
                return null;
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
                return null;
            }
        }
    }

    static com.mobile.auth.gatewayauth.manager.d f(PhoneNumberAuthHelperProxy phoneNumberAuthHelperProxy) {
        try {
            return phoneNumberAuthHelperProxy.g;
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
                return null;
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
                return null;
            }
        }
    }

    static ResultCodeProcessor g(PhoneNumberAuthHelperProxy phoneNumberAuthHelperProxy) {
        try {
            return phoneNumberAuthHelperProxy.m;
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
                return null;
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
                return null;
            }
        }
    }

    @AuthNumber
    public static PhoneNumberAuthHelperProxy getInstance(Context context, TokenResultListener tokenResultListener) {
        try {
            if (a == null && context != null) {
                synchronized (PhoneNumberAuthHelperProxy.class) {
                    if (a == null) {
                        a = new PhoneNumberAuthHelperProxy(context, tokenResultListener);
                    }
                }
            }
            a.setAuthListener(tokenResultListener);
            return a;
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
                return null;
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
                return null;
            }
        }
    }

    @com.mobile.auth.gatewayauth.annotations.AuthNumber
    public static java.lang.String getVersion() {
        throw new UnsupportedOperationException("Method not decompiled: com.mobile.auth.gatewayauth.PhoneNumberAuthHelperProxy.getVersion():java.lang.String");
    }

    static Future h(PhoneNumberAuthHelperProxy phoneNumberAuthHelperProxy) {
        try {
            return phoneNumberAuthHelperProxy.i;
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
                return null;
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
                return null;
            }
        }
    }

    @SafeProtector
    private native void justGetLoginPhone(MonitorStruct monitorStruct, String str, int i, ResultCodeProcessor resultCodeProcessor, boolean z, RequestCallback<LoginPhoneInfo, com.mobile.auth.gatewayauth.manager.base.b> requestCallback, String str2, String str3, int i2);

    @SafeProtector
    private native void justGetLoginToken(long j, TokenResultListener tokenResultListener, ResultCodeProcessor resultCodeProcessor);

    @SafeProtector
    private native void justGetToken(int i, ResultCodeProcessor resultCodeProcessor, boolean z, TokenResultListener tokenResultListener);

    @SafeProtector
    private void justPreLogin(long j, final PreLoginResultListener preLoginResultListener, final ResultCodeProcessor resultCodeProcessor, boolean z, boolean z2) {
        String str;
        int i;
        String str2;
        String str3;
        try {
            final String j2 = this.g.j();
            String f = this.g.f();
            long j3 = j <= 0 ? 5000L : j;
            final String c2 = this.f12931c.c();
            final String b2 = this.f12931c.b(c2);
            final MonitorStruct monitorStruct = new MonitorStruct();
            monitorStruct.setApiLevel(resultCodeProcessor.getApiLevel());
            monitorStruct.putApiParam("timeout", String.valueOf(j3));
            monitorStruct.setSessionId(f);
            monitorStruct.setRequestId(j2);
            monitorStruct.setStartTime(System.currentTimeMillis());
            monitorStruct.setVendorKey(c2);
            monitorStruct.setAction(this.f12931c.c(c2));
            monitorStruct.setUrgency(1);
            monitorStruct.setNetworkType(com.mobile.auth.gatewayauth.utils.c.a(this.f12931c.e(), true));
            if (preLoginResultListener == null) {
                a(Constant.CODE_ERROR_UNKNOWN_FAIL, "PreLoginResultListener is null", com.mobile.auth.gatewayauth.utils.a.a(Constant.CODE_ERROR_UNKNOWN_FAIL, "PreLoginResultListener is null"), c2, (TokenResultListener) null, resultCodeProcessor, monitorStruct, j2);
                this.j.e("accelerateLoginPage errorMsg = PreLoginResultListener is null");
                return;
            }
            final TokenResultListener tokenResultListener = new TokenResultListener() {
                @Override
                public void onTokenFailed(String str4) {
                    try {
                        preLoginResultListener.onTokenFailed(b2, str4);
                    } catch (Throwable th) {
                        try {
                            ExceptionProcessor.processException(th);
                        } catch (Throwable th2) {
                            ExceptionProcessor.processException(th2);
                        }
                    }
                }

                @Override
                public void onTokenSuccess(String str4) {
                    try {
                        preLoginResultListener.onTokenSuccess(b2);
                    } catch (Throwable th) {
                        try {
                            ExceptionProcessor.processException(th);
                        } catch (Throwable th2) {
                            ExceptionProcessor.processException(th2);
                        }
                    }
                }
            };
            final c cVar = new c(j3, new Runnable() {
                @Override
                public void run() {
                    try {
                        PhoneNumberAuthHelperProxy.a(PhoneNumberAuthHelperProxy.this, ResultCode.CODE_ERROR_FUNCTION_TIME_OUT, "请求超时", com.mobile.auth.gatewayauth.utils.a.a(ResultCode.CODE_ERROR_FUNCTION_TIME_OUT, "请求超时"), c2, tokenResultListener, resultCodeProcessor, monitorStruct, j2);
                        PhoneNumberAuthHelperProxy.d(PhoneNumberAuthHelperProxy.this).e("justPreLogin errorCode = ", ResultCode.CODE_ERROR_FUNCTION_TIME_OUT, "; errorMsg = ", "请求超时", "; action = ", monitorStruct.getAction());
                    } catch (Throwable th) {
                        try {
                            ExceptionProcessor.processException(th);
                        } catch (Throwable th2) {
                            ExceptionProcessor.processException(th2);
                        }
                    }
                }
            });
            cVar.a();
            TokenRet a2 = this.f12931c.a(resultCodeProcessor, false, c2);
            if (a2 != null && cVar.d()) {
                a(a2.getCode(), a2.getMsg(), com.mobile.auth.gatewayauth.utils.a.a(a2.getCode(), a2.getMsg()), c2, tokenResultListener, resultCodeProcessor, monitorStruct, j2);
                this.j.e("justPreLogin errorCode = ", a2.getCode(), "; errorMsg = ", a2.getMsg(), "; action = ", monitorStruct.getAction());
                return;
            }
            com.mobile.auth.gatewayauth.manager.a a3 = this.h.a(c2);
            if (a3 == null) {
                if (cVar.d()) {
                    str2 = "justPreLogin errorCode = ";
                    str3 = "; errorMsg = ";
                    a(ResultCode.CODE_ERROR_OPERATOR_UNKNOWN_FAIL, "无法判运营商", com.mobile.auth.gatewayauth.utils.a.a(ResultCode.CODE_ERROR_OPERATOR_UNKNOWN_FAIL, "无法判运营商"), c2, tokenResultListener, resultCodeProcessor, monitorStruct, j2);
                } else {
                    str2 = "justPreLogin errorCode = ";
                    str3 = "; errorMsg = ";
                }
                this.j.e(str2, ResultCode.CODE_ERROR_OPERATOR_UNKNOWN_FAIL, str3, "无法判运营商");
            } else if (this.f12932d.c()) {
                if (cVar.d()) {
                    i = 6;
                    a(Constant.CODE_ERROR_FUNCTION_DEMOTE, "系统维护,功能不可用", com.mobile.auth.gatewayauth.utils.a.a(Constant.CODE_ERROR_FUNCTION_DEMOTE, "系统维护,功能不可用"), c2, tokenResultListener, resultCodeProcessor, monitorStruct, j2);
                } else {
                    i = 6;
                }
                com.mobile.auth.q.a aVar = this.j;
                String[] strArr = new String[i];
                strArr[0] = "justPreLogin errorCode = ";
                strArr[1] = Constant.CODE_ERROR_FUNCTION_DEMOTE;
                strArr[2] = "; errorMsg = ";
                strArr[3] = "系统维护,功能不可用";
                strArr[4] = "; action = ";
                strArr[5] = monitorStruct.getAction();
                aVar.e(strArr);
            } else if (z2) {
                if (cVar.d()) {
                    a(ResultCode.CODE_ERROR_CALL_PRE_LOGIN_IN_AUTH_PAGE, ResultCode.MSG_ERROR_CALL_PRE_LOGIN_IN_AUTH_PAGE, com.mobile.auth.gatewayauth.utils.a.a(ResultCode.CODE_ERROR_CALL_PRE_LOGIN_IN_AUTH_PAGE, ResultCode.MSG_ERROR_CALL_PRE_LOGIN_IN_AUTH_PAGE), c2, tokenResultListener, resultCodeProcessor, monitorStruct, j2);
                }
                this.j.e("Auth page has been showing!");
            } else if (z && !this.f12933e.a()) {
                this.j.e("justGetToken SceneCode = null");
                if (cVar.d()) {
                    a(ResultCode.CODE_ERROR_ANALYZE_SDK_INFO, ResultCode.MSG_ERROR_ANALYZE_SDK_INFO, com.mobile.auth.gatewayauth.utils.a.a(ResultCode.CODE_ERROR_ANALYZE_SDK_INFO, ResultCode.MSG_ERROR_ANALYZE_SDK_INFO), b2, tokenResultListener, resultCodeProcessor, monitorStruct, j2);
                }
            } else {
                if (z) {
                    str = f;
                } else {
                    str = f;
                    if (!this.f12933e.a(str, com.mobile.auth.gatewayauth.manager.e.a(this.f12931c.e(), this.f12933e, this.f12932d, this.j))) {
                        this.j.e("justGetToken SceneCode = null");
                        if (cVar.d()) {
                            a(Constant.CODE_ERROR_GET_CONFIG_FAIL, "获取运营商配置信息失败", com.mobile.auth.gatewayauth.utils.a.a(Constant.CODE_ERROR_GET_CONFIG_FAIL, "获取运营商配置信息失败"), b2, tokenResultListener, resultCodeProcessor, monitorStruct, j2);
                            return;
                        }
                        return;
                    }
                    this.h.a(this.f12933e);
                }
                a3.a(j3);
                this.f.updateMask(j3, c2, new RequestCallback<com.mobile.auth.gatewayauth.manager.base.b, com.mobile.auth.gatewayauth.manager.base.b>() {
                    public void a(com.mobile.auth.gatewayauth.manager.base.b bVar) {
                        try {
                            if (cVar.d()) {
                                monitorStruct.setCache(String.valueOf(bVar.e()));
                                monitorStruct.setAuthSdkCode(resultCodeProcessor.convertCode(Constant.CODE_GET_TOKEN_SUCCESS));
                                PhoneNumberAuthHelperProxy.a(PhoneNumberAuthHelperProxy.this, true, false, "", b2, monitorStruct, tokenResultListener);
                            }
                        } catch (Throwable th) {
                            try {
                                ExceptionProcessor.processException(th);
                            } catch (Throwable th2) {
                                ExceptionProcessor.processException(th2);
                            }
                        }
                    }

                    public void b(com.mobile.auth.gatewayauth.manager.base.b bVar) {
                        try {
                            if (cVar.d()) {
                                monitorStruct.setCache("false");
                                monitorStruct.setCarrierFailedResultData(bVar.d());
                                PhoneNumberAuthHelperProxy.a(PhoneNumberAuthHelperProxy.this, bVar.b(), bVar.c(), bVar.g(), c2, tokenResultListener, resultCodeProcessor, monitorStruct, j2);
                            }
                        } catch (Throwable th) {
                            try {
                                ExceptionProcessor.processException(th);
                            } catch (Throwable th2) {
                                ExceptionProcessor.processException(th2);
                            }
                        }
                    }

                    @Override
                    public void onError(com.mobile.auth.gatewayauth.manager.base.b bVar) {
                        try {
                            b(bVar);
                        } catch (Throwable th) {
                            try {
                                ExceptionProcessor.processException(th);
                            } catch (Throwable th2) {
                                ExceptionProcessor.processException(th2);
                            }
                        }
                    }

                    @Override
                    public void onSuccess(com.mobile.auth.gatewayauth.manager.base.b bVar) {
                        try {
                            a(bVar);
                        } catch (Throwable th) {
                            try {
                                ExceptionProcessor.processException(th);
                            } catch (Throwable th2) {
                                ExceptionProcessor.processException(th2);
                            }
                        }
                    }
                }, this.f12931c.getSimCacheKey(!z, c2), 6, this.f12933e.a(!z), j2, str);
            }
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
            }
        }
    }

    @SafeProtector
    private void justPreVerify(long j, final PreLoginResultListener preLoginResultListener) {
        int i;
        char c2;
        String str;
        String str2;
        String str3;
        String str4;
        int i2;
        char c3;
        char c4;
        long j2 = j <= 0 ? 5000L : j;
        try {
            final String j3 = this.g.j();
            String g = this.g.g();
            final MonitorStruct monitorStruct = new MonitorStruct();
            monitorStruct.setApiLevel(this.m.getApiLevel());
            final String c5 = this.f12931c.c();
            final String b2 = this.f12931c.b(c5);
            monitorStruct.putApiParam("timeout", String.valueOf(j2));
            monitorStruct.setSessionId(g);
            monitorStruct.setRequestId(j3);
            monitorStruct.setStartTime(System.currentTimeMillis());
            monitorStruct.setVendorKey(c5);
            monitorStruct.setAction(this.f12931c.d(c5));
            monitorStruct.setUrgency(1);
            monitorStruct.setNetworkType(com.mobile.auth.gatewayauth.utils.c.a(this.f12931c.e(), true));
            if (preLoginResultListener == null) {
                b(Constant.CODE_ERROR_UNKNOWN_FAIL, "PreLoginResultListener is null", com.mobile.auth.gatewayauth.utils.a.a(Constant.CODE_ERROR_UNKNOWN_FAIL, "PreLoginResultListener is null"), c5, null, this.m, monitorStruct, j3);
                this.j.e("accelerateVerify errorMsg = PreLoginResultListener is null");
                return;
            }
            final TokenResultListener tokenResultListener = new TokenResultListener() {
                @Override
                public void onTokenFailed(String str5) {
                    try {
                        preLoginResultListener.onTokenFailed(b2, str5);
                    } catch (Throwable th) {
                        try {
                            ExceptionProcessor.processException(th);
                        } catch (Throwable th2) {
                            ExceptionProcessor.processException(th2);
                        }
                    }
                }

                @Override
                public void onTokenSuccess(String str5) {
                    try {
                        preLoginResultListener.onTokenSuccess(b2);
                    } catch (Throwable th) {
                        try {
                            ExceptionProcessor.processException(th);
                        } catch (Throwable th2) {
                            ExceptionProcessor.processException(th2);
                        }
                    }
                }
            };
            final c cVar = new c(j2, new Runnable() {
                @Override
                public void run() {
                    try {
                        PhoneNumberAuthHelperProxy.b(PhoneNumberAuthHelperProxy.this, ResultCode.CODE_ERROR_FUNCTION_TIME_OUT, "请求超时", com.mobile.auth.gatewayauth.utils.a.a(ResultCode.CODE_ERROR_FUNCTION_TIME_OUT, "请求超时"), c5, tokenResultListener, PhoneNumberAuthHelperProxy.g(PhoneNumberAuthHelperProxy.this), monitorStruct, j3);
                        PhoneNumberAuthHelperProxy.d(PhoneNumberAuthHelperProxy.this).e("justPreVerify errorCode = ", ResultCode.CODE_ERROR_FUNCTION_TIME_OUT, "; errorMsg = ", "请求超时", "; action = ", monitorStruct.getAction());
                    } catch (Throwable th) {
                        try {
                            ExceptionProcessor.processException(th);
                        } catch (Throwable th2) {
                            ExceptionProcessor.processException(th2);
                        }
                    }
                }
            });
            cVar.a();
            TokenRet a2 = this.f12931c.a(this.m, false, c5);
            if (a2 != null) {
                if (cVar.d()) {
                    str3 = "justPreVerify errorCode = ";
                    str4 = "; errorMsg = ";
                    i2 = 6;
                    c3 = 0;
                    c4 = 1;
                    b(a2.getCode(), a2.getMsg(), com.mobile.auth.gatewayauth.utils.a.a(a2.getCode(), a2.getMsg()), c5, tokenResultListener, this.m, monitorStruct, j3);
                } else {
                    str3 = "justPreVerify errorCode = ";
                    str4 = "; errorMsg = ";
                    i2 = 6;
                    c3 = 0;
                    c4 = 1;
                }
                com.mobile.auth.q.a aVar = this.j;
                String[] strArr = new String[i2];
                strArr[c3] = str3;
                strArr[c4] = a2.getCode();
                strArr[2] = str4;
                strArr[3] = a2.getMsg();
                strArr[4] = "; action = ";
                strArr[5] = monitorStruct.getAction();
                aVar.e(strArr);
                return;
            }
            com.mobile.auth.gatewayauth.manager.a a3 = this.h.a(c5);
            if (a3 == null) {
                if (cVar.d()) {
                    str = "justPreVerify errorCode = ";
                    str2 = "; errorMsg = ";
                    b(ResultCode.CODE_ERROR_OPERATOR_UNKNOWN_FAIL, "无法判运营商", com.mobile.auth.gatewayauth.utils.a.a(ResultCode.CODE_ERROR_OPERATOR_UNKNOWN_FAIL, "无法判运营商"), c5, tokenResultListener, this.m, monitorStruct, j3);
                } else {
                    str = "justPreVerify errorCode = ";
                    str2 = "; errorMsg = ";
                }
                this.j.e(str, ResultCode.CODE_ERROR_OPERATOR_UNKNOWN_FAIL, str2, "无法判运营商");
            } else if (!this.f12932d.b()) {
                if (this.f12933e.a()) {
                    a3.a(j2);
                    this.f.b(j2, c5, new RequestCallback<String, com.mobile.auth.gatewayauth.manager.base.b>() {
                        public void a(com.mobile.auth.gatewayauth.manager.base.b bVar) {
                            try {
                                if (cVar.d()) {
                                    monitorStruct.setCache("false");
                                    monitorStruct.setCarrierFailedResultData(bVar.d());
                                    PhoneNumberAuthHelperProxy.b(PhoneNumberAuthHelperProxy.this, bVar.b(), bVar.c(), bVar.g(), c5, tokenResultListener, PhoneNumberAuthHelperProxy.g(PhoneNumberAuthHelperProxy.this), monitorStruct, j3);
                                }
                            } catch (Throwable th) {
                                try {
                                    ExceptionProcessor.processException(th);
                                } catch (Throwable th2) {
                                    ExceptionProcessor.processException(th2);
                                }
                            }
                        }

                        public void a(String str5) {
                            try {
                                if (cVar.d()) {
                                    monitorStruct.setCache(str5);
                                    monitorStruct.setAuthSdkCode(PhoneNumberAuthHelperProxy.g(PhoneNumberAuthHelperProxy.this).convertCode(Constant.CODE_GET_TOKEN_SUCCESS));
                                    PhoneNumberAuthHelperProxy.a(PhoneNumberAuthHelperProxy.this, true, false, "", b2, monitorStruct, tokenResultListener);
                                }
                            } catch (Throwable th) {
                                try {
                                    ExceptionProcessor.processException(th);
                                } catch (Throwable th2) {
                                    ExceptionProcessor.processException(th2);
                                }
                            }
                        }

                        @Override
                        public void onError(com.mobile.auth.gatewayauth.manager.base.b bVar) {
                            try {
                                a(bVar);
                            } catch (Throwable th) {
                                try {
                                    ExceptionProcessor.processException(th);
                                } catch (Throwable th2) {
                                    ExceptionProcessor.processException(th2);
                                }
                            }
                        }

                        @Override
                        public void onSuccess(String str5) {
                            try {
                                a(str5);
                            } catch (Throwable th) {
                                try {
                                    ExceptionProcessor.processException(th);
                                } catch (Throwable th2) {
                                    ExceptionProcessor.processException(th2);
                                }
                            }
                        }
                    }, this.f12931c.getSimCacheKey(false, c5), com.mobile.auth.gatewayauth.manager.c.a(c5), this.f12933e.a(false), j3, g);
                    return;
                }
                this.j.e("justPreVerify SceneCode = null");
                if (cVar.d()) {
                    b(ResultCode.CODE_ERROR_ANALYZE_SDK_INFO, ResultCode.MSG_ERROR_ANALYZE_SDK_INFO, com.mobile.auth.gatewayauth.utils.a.a(ResultCode.CODE_ERROR_ANALYZE_SDK_INFO, ResultCode.MSG_ERROR_ANALYZE_SDK_INFO), b2, tokenResultListener, this.m, monitorStruct, j3);
                }
            } else {
                if (cVar.d()) {
                    c2 = 0;
                    i = 6;
                    b(Constant.CODE_ERROR_FUNCTION_DEMOTE, "系统维护,功能不可用", com.mobile.auth.gatewayauth.utils.a.a(Constant.CODE_ERROR_FUNCTION_DEMOTE, "系统维护,功能不可用"), c5, tokenResultListener, this.m, monitorStruct, j3);
                } else {
                    i = 6;
                    c2 = 0;
                }
                com.mobile.auth.q.a aVar2 = this.j;
                String[] strArr2 = new String[i];
                strArr2[c2] = "justPreVerify errorCode = ";
                strArr2[1] = Constant.CODE_ERROR_FUNCTION_DEMOTE;
                strArr2[2] = "; errorMsg = ";
                strArr2[3] = "系统维护,功能不可用";
                strArr2[4] = "; action = ";
                strArr2[5] = monitorStruct.getAction();
                aVar2.e(strArr2);
            }
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
            }
        }
    }

    public SystemManager a() {
        try {
            return this.f12931c;
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
                return null;
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
                return null;
            }
        }
    }

    public void a(final long j, final TokenResultListener tokenResultListener, final ResultCodeProcessor resultCodeProcessor) {
        try {
            ExecutorManager.getInstance().scheduleFuture(new g.a(tokenResultListener) {
                @Override
                protected void a() {
                    try {
                        PhoneNumberAuthHelperProxy.a(PhoneNumberAuthHelperProxy.this, j, tokenResultListener, resultCodeProcessor);
                    } catch (Throwable th) {
                        try {
                            ExceptionProcessor.processException(th);
                        } catch (Throwable th2) {
                            ExceptionProcessor.processException(th2);
                        }
                    }
                }
            });
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
            }
        }
    }

    public synchronized void a(String str) {
        try {
            this.n = str;
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
            }
        }
    }

    protected void a(String str, String str2, MonitorStruct monitorStruct, ResultCodeProcessor resultCodeProcessor, TokenResultListener tokenResultListener) {
        if (tokenResultListener == null) {
            return;
        }
        try {
            TokenRet convertErrorInfo = resultCodeProcessor.convertErrorInfo(Constant.CODE_GET_TOKEN_SUCCESS, "获取token成功", str2);
            convertErrorInfo.setToken(str);
            convertErrorInfo.setRequestId(monitorStruct.getRequestId());
            monitorStruct.setPerformanceTrace(com.mobile.auth.gatewayauth.utils.e.a().a(monitorStruct.getRequestId()));
            monitorStruct.setAccessCode(str);
            monitorStruct.setAuthSdkCode(convertErrorInfo.getCode());
            a(true, true, "", convertErrorInfo.toJsonString(), monitorStruct, tokenResultListener);
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
            }
        }
    }

    public void a(boolean z, boolean z2, String str, String str2, String str3, String str4, MonitorStruct monitorStruct, TokenResultListener tokenResultListener, ResultCodeProcessor resultCodeProcessor, String str5) {
        try {
            TokenRet convertErrorInfo = resultCodeProcessor.convertErrorInfo(str, str2, str4);
            if (monitorStruct != null) {
                monitorStruct.setPerformanceTrace(com.mobile.auth.gatewayauth.utils.e.a().a(str5));
                monitorStruct.setAuthSdkCode(convertErrorInfo.getCode());
                convertErrorInfo.setCarrierFailedResultData(monitorStruct.getCarrierFailedResultData());
            }
            convertErrorInfo.setRequestId(str5);
            a(z, z2, str3, convertErrorInfo.toJsonString(), monitorStruct, tokenResultListener);
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
            }
        }
    }

    @AuthNumber
    public void accelerateLoginPage(final int i, final PreLoginResultListener preLoginResultListener, final boolean z) {
        try {
            ExecutorManager.getInstance().scheduleFuture(new g.a(this.f12930b) {
                @Override
                protected void a() {
                    try {
                        PhoneNumberAuthHelperProxy phoneNumberAuthHelperProxy = PhoneNumberAuthHelperProxy.this;
                        PhoneNumberAuthHelperProxy.a(phoneNumberAuthHelperProxy, i, preLoginResultListener, PhoneNumberAuthHelperProxy.g(phoneNumberAuthHelperProxy), true, z);
                    } catch (Throwable th) {
                        try {
                            ExceptionProcessor.processException(th);
                        } catch (Throwable th2) {
                            ExceptionProcessor.processException(th2);
                        }
                    }
                }
            });
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
            }
        }
    }

    @AuthNumber
    public void accelerateVerify(final int i, final PreLoginResultListener preLoginResultListener) {
        try {
            ExecutorManager.getInstance().scheduleFuture(new g.a(new TokenResultListener() {
                @Override
                public void onTokenFailed(String str) {
                    try {
                        PreLoginResultListener preLoginResultListener2 = preLoginResultListener;
                        if (preLoginResultListener2 != null) {
                            preLoginResultListener2.onTokenFailed("", str);
                        }
                    } catch (Throwable th) {
                        try {
                            ExceptionProcessor.processException(th);
                        } catch (Throwable th2) {
                            ExceptionProcessor.processException(th2);
                        }
                    }
                }

                @Override
                public void onTokenSuccess(String str) {
                }
            }) {
                @Override
                protected void a() {
                    try {
                        PhoneNumberAuthHelperProxy.a(PhoneNumberAuthHelperProxy.this, i, preLoginResultListener);
                    } catch (Throwable th) {
                        try {
                            ExceptionProcessor.processException(th);
                        } catch (Throwable th2) {
                            ExceptionProcessor.processException(th2);
                        }
                    }
                }
            });
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
            }
        }
    }

    public com.mobile.auth.gatewayauth.manager.d b() {
        try {
            return this.g;
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
                return null;
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
                return null;
            }
        }
    }

    public com.mobile.auth.q.a c() {
        try {
            return this.j;
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
                return null;
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
                return null;
            }
        }
    }

    @AuthNumber
    public void checkEnvAvailable(@IntRange(from = 1, to = 2) final int i, final TokenResultListener tokenResultListener) {
        try {
            ExecutorManager.getInstance().scheduleFuture(new g.a() {
                @Override
                protected void a() {
                    int i2;
                    try {
                        String c2 = PhoneNumberAuthHelperProxy.a(PhoneNumberAuthHelperProxy.this).c();
                        String j = PhoneNumberAuthHelperProxy.f(PhoneNumberAuthHelperProxy.this).j();
                        TokenRet tokenRet = null;
                        try {
                            try {
                                int i3 = i;
                                if (i3 != 1 && i3 != 2) {
                                    TokenRet convertErrorInfo = PhoneNumberAuthHelperProxy.g(PhoneNumberAuthHelperProxy.this).convertErrorInfo("600025", ResultCode.MSG_ERROR_INVALID_PARAM, c2);
                                    PhoneNumberAuthHelperProxy.d(PhoneNumberAuthHelperProxy.this).c();
                                    if (convertErrorInfo != null) {
                                        PhoneNumberAuthHelperProxy.this.a(false, false, convertErrorInfo.getCode(), convertErrorInfo.getMsg(), com.mobile.auth.gatewayauth.utils.a.a(convertErrorInfo.getCode(), convertErrorInfo.getMsg()), c2, null, tokenResultListener, PhoneNumberAuthHelperProxy.g(PhoneNumberAuthHelperProxy.this), j);
                                        return;
                                    }
                                    return;
                                }
                                TokenRet a2 = PhoneNumberAuthHelperProxy.a(PhoneNumberAuthHelperProxy.this).a(PhoneNumberAuthHelperProxy.g(PhoneNumberAuthHelperProxy.this), true, c2);
                                if (a2 != null) {
                                    try {
                                        PhoneNumberAuthHelperProxy.d(PhoneNumberAuthHelperProxy.this).e("checkEnvAvailable errorCode = ", a2.getCode(), "; errorMsg = ", a2.getMsg());
                                        PhoneNumberAuthHelperProxy.d(PhoneNumberAuthHelperProxy.this).c();
                                        PhoneNumberAuthHelperProxy.this.a(false, false, a2.getCode(), a2.getMsg(), com.mobile.auth.gatewayauth.utils.a.a(a2.getCode(), a2.getMsg()), c2, null, tokenResultListener, PhoneNumberAuthHelperProxy.g(PhoneNumberAuthHelperProxy.this), j);
                                    } catch (Exception e2) {
                                        e = e2;
                                        i2 = 2;
                                        e.printStackTrace();
                                        TokenRet convertErrorInfo2 = PhoneNumberAuthHelperProxy.g(PhoneNumberAuthHelperProxy.this).convertErrorInfo(ResultCode.CODE_ERROR_UNKNOWN_FAIL, ExecutorManager.getErrorInfoFromException(e), c2);
                                        com.mobile.auth.q.a d2 = PhoneNumberAuthHelperProxy.d(PhoneNumberAuthHelperProxy.this);
                                        String[] strArr = new String[i2];
                                        strArr[0] = "checkEnvAvailable exception:";
                                        strArr[1] = convertErrorInfo2.toJsonString();
                                        d2.e(strArr);
                                        PhoneNumberAuthHelperProxy.d(PhoneNumberAuthHelperProxy.this).c();
                                        PhoneNumberAuthHelperProxy.this.a(false, false, convertErrorInfo2.getCode(), convertErrorInfo2.getMsg(), com.mobile.auth.gatewayauth.utils.a.a(convertErrorInfo2.getCode(), convertErrorInfo2.getMsg()), c2, null, tokenResultListener, PhoneNumberAuthHelperProxy.g(PhoneNumberAuthHelperProxy.this), j);
                                    } catch (Throwable th) {
                                        th = th;
                                        tokenRet = a2;
                                        PhoneNumberAuthHelperProxy.d(PhoneNumberAuthHelperProxy.this).c();
                                        if (tokenRet != null) {
                                            PhoneNumberAuthHelperProxy.this.a(false, false, tokenRet.getCode(), tokenRet.getMsg(), com.mobile.auth.gatewayauth.utils.a.a(tokenRet.getCode(), tokenRet.getMsg()), c2, null, tokenResultListener, PhoneNumberAuthHelperProxy.g(PhoneNumberAuthHelperProxy.this), j);
                                        }
                                        throw th;
                                    }
                                } else if (!PhoneNumberAuthHelperProxy.b(PhoneNumberAuthHelperProxy.this).a()) {
                                    TokenRet convertErrorInfo3 = PhoneNumberAuthHelperProxy.g(PhoneNumberAuthHelperProxy.this).convertErrorInfo(ResultCode.CODE_ERROR_ANALYZE_SDK_INFO, ResultCode.MSG_ERROR_ANALYZE_SDK_INFO, c2);
                                    PhoneNumberAuthHelperProxy.d(PhoneNumberAuthHelperProxy.this).e("checkEnvAvailable errorCode = ", ResultCode.CODE_ERROR_ANALYZE_SDK_INFO, "; errorMsg = ", ResultCode.MSG_ERROR_ANALYZE_SDK_INFO);
                                    PhoneNumberAuthHelperProxy.d(PhoneNumberAuthHelperProxy.this).c();
                                    if (convertErrorInfo3 != null) {
                                        PhoneNumberAuthHelperProxy.this.a(false, false, convertErrorInfo3.getCode(), convertErrorInfo3.getMsg(), com.mobile.auth.gatewayauth.utils.a.a(convertErrorInfo3.getCode(), convertErrorInfo3.getMsg()), c2, null, tokenResultListener, PhoneNumberAuthHelperProxy.g(PhoneNumberAuthHelperProxy.this), j);
                                    }
                                } else if (PhoneNumberAuthHelperProxy.c(PhoneNumberAuthHelperProxy.this).a(c2) == null) {
                                    TokenRet convertErrorInfo4 = PhoneNumberAuthHelperProxy.g(PhoneNumberAuthHelperProxy.this).convertErrorInfo(ResultCode.CODE_ERROR_OPERATOR_UNKNOWN_FAIL, "无法判运营商", c2);
                                    PhoneNumberAuthHelperProxy.d(PhoneNumberAuthHelperProxy.this).e("checkEnvAvailable failed! Unsupported Vendor!");
                                    PhoneNumberAuthHelperProxy.d(PhoneNumberAuthHelperProxy.this).c();
                                    if (convertErrorInfo4 != null) {
                                        PhoneNumberAuthHelperProxy.this.a(false, false, convertErrorInfo4.getCode(), convertErrorInfo4.getMsg(), com.mobile.auth.gatewayauth.utils.a.a(convertErrorInfo4.getCode(), convertErrorInfo4.getMsg()), c2, null, tokenResultListener, PhoneNumberAuthHelperProxy.g(PhoneNumberAuthHelperProxy.this), j);
                                    }
                                } else {
                                    PhoneNumberAuthHelperProxy.b(PhoneNumberAuthHelperProxy.this).b();
                                    if (PhoneNumberAuthHelperProxy.h(PhoneNumberAuthHelperProxy.this) != null) {
                                        PhoneNumberAuthHelperProxy.h(PhoneNumberAuthHelperProxy.this).get();
                                    }
                                    if (i == 1) {
                                        if (PhoneNumberAuthHelperProxy.e(PhoneNumberAuthHelperProxy.this).b()) {
                                            TokenRet convertErrorInfo5 = PhoneNumberAuthHelperProxy.g(PhoneNumberAuthHelperProxy.this).convertErrorInfo(ResultCode.CODE_ERROR_FUNCTION_DEMOTE, "系统维护,功能不可用", c2);
                                            PhoneNumberAuthHelperProxy.d(PhoneNumberAuthHelperProxy.this).e("checkEnvAvailable errorCode = ", ResultCode.CODE_ERROR_FUNCTION_DEMOTE, "; errorMsg = ", "系统维护,功能不可用");
                                            PhoneNumberAuthHelperProxy.d(PhoneNumberAuthHelperProxy.this).c();
                                            if (convertErrorInfo5 != null) {
                                                PhoneNumberAuthHelperProxy.this.a(false, false, convertErrorInfo5.getCode(), convertErrorInfo5.getMsg(), com.mobile.auth.gatewayauth.utils.a.a(convertErrorInfo5.getCode(), convertErrorInfo5.getMsg()), c2, null, tokenResultListener, PhoneNumberAuthHelperProxy.g(PhoneNumberAuthHelperProxy.this), j);
                                                return;
                                            }
                                            return;
                                        }
                                    } else if (PhoneNumberAuthHelperProxy.e(PhoneNumberAuthHelperProxy.this).c()) {
                                        TokenRet convertErrorInfo6 = PhoneNumberAuthHelperProxy.g(PhoneNumberAuthHelperProxy.this).convertErrorInfo(ResultCode.CODE_ERROR_FUNCTION_DEMOTE, "系统维护,功能不可用", c2);
                                        PhoneNumberAuthHelperProxy.d(PhoneNumberAuthHelperProxy.this).e("checkEnvAvailable errorCode = ", ResultCode.CODE_ERROR_FUNCTION_DEMOTE, "; errorMsg = ", "系统维护,功能不可用");
                                        PhoneNumberAuthHelperProxy.d(PhoneNumberAuthHelperProxy.this).c();
                                        if (convertErrorInfo6 != null) {
                                            PhoneNumberAuthHelperProxy.this.a(false, false, convertErrorInfo6.getCode(), convertErrorInfo6.getMsg(), com.mobile.auth.gatewayauth.utils.a.a(convertErrorInfo6.getCode(), convertErrorInfo6.getMsg()), c2, null, tokenResultListener, PhoneNumberAuthHelperProxy.g(PhoneNumberAuthHelperProxy.this), j);
                                            return;
                                        }
                                        return;
                                    }
                                    PhoneNumberAuthHelperProxy phoneNumberAuthHelperProxy = PhoneNumberAuthHelperProxy.this;
                                    i2 = 2;
                                    try {
                                        phoneNumberAuthHelperProxy.a(true, false, ResultCode.CODE_ERROR_ENV_CHECK_SUCCESS, ResultCode.MSG_ERROR_ENV_CHECK_SUCCESS, "", c2, null, tokenResultListener, PhoneNumberAuthHelperProxy.g(phoneNumberAuthHelperProxy), j);
                                        PhoneNumberAuthHelperProxy.d(PhoneNumberAuthHelperProxy.this).c();
                                    } catch (Exception e3) {
                                        e = e3;
                                        e.printStackTrace();
                                        TokenRet convertErrorInfo22 = PhoneNumberAuthHelperProxy.g(PhoneNumberAuthHelperProxy.this).convertErrorInfo(ResultCode.CODE_ERROR_UNKNOWN_FAIL, ExecutorManager.getErrorInfoFromException(e), c2);
                                        com.mobile.auth.q.a d22 = PhoneNumberAuthHelperProxy.d(PhoneNumberAuthHelperProxy.this);
                                        String[] strArr2 = new String[i2];
                                        strArr2[0] = "checkEnvAvailable exception:";
                                        strArr2[1] = convertErrorInfo22.toJsonString();
                                        d22.e(strArr2);
                                        PhoneNumberAuthHelperProxy.d(PhoneNumberAuthHelperProxy.this).c();
                                        PhoneNumberAuthHelperProxy.this.a(false, false, convertErrorInfo22.getCode(), convertErrorInfo22.getMsg(), com.mobile.auth.gatewayauth.utils.a.a(convertErrorInfo22.getCode(), convertErrorInfo22.getMsg()), c2, null, tokenResultListener, PhoneNumberAuthHelperProxy.g(PhoneNumberAuthHelperProxy.this), j);
                                    }
                                }
                            } catch (Exception e4) {
                                e = e4;
                            }
                        } catch (Throwable th2) {
                            th = th2;
                        }
                    } catch (Throwable th3) {
                        try {
                            ExceptionProcessor.processException(th3);
                        } catch (Throwable th4) {
                            ExceptionProcessor.processException(th4);
                        }
                    }
                }
            });
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
            }
        }
    }

    @AuthNumber
    @Deprecated
    public boolean checkEnvAvailable() {
        int i;
        char c2;
        TokenRet tokenRet;
        try {
            String c3 = this.f12931c.c();
            String j = this.g.j();
            TokenRet tokenRet2 = null;
            try {
                tokenRet = this.f12931c.a(this.m, true, c3);
                if (tokenRet != null) {
                    a(false, false, tokenRet.getCode(), tokenRet.getMsg(), com.mobile.auth.gatewayauth.utils.a.a(tokenRet.getCode(), tokenRet.getMsg()), c3, null, null, this.m, j);
                    this.j.e("checkEnvAvailable code = ", tokenRet.getCode(), "; msg = ", tokenRet.getMsg());
                    return false;
                }
                i = 4;
                c2 = 1;
                try {
                    if (!this.f12933e.a()) {
                        TokenRet convertErrorInfo = this.m.convertErrorInfo(ResultCode.CODE_ERROR_ANALYZE_SDK_INFO, ResultCode.MSG_ERROR_ANALYZE_SDK_INFO, c3);
                        this.j.e("checkEnvAvailable failed! Has no sceneCode!");
                        if (convertErrorInfo == null) {
                            a(true, false, "", "", "", "", null, null, this.m, j);
                            return false;
                        }
                        a(false, false, convertErrorInfo.getCode(), convertErrorInfo.getMsg(), com.mobile.auth.gatewayauth.utils.a.a(convertErrorInfo.getCode(), convertErrorInfo.getMsg()), c3, null, null, this.m, j);
                        this.j.e("checkEnvAvailable code = ", convertErrorInfo.getCode(), "; msg = ", convertErrorInfo.getMsg());
                        return false;
                    }
                    this.f12933e.b();
                    if (this.h.a(c3) != null) {
                        if (tokenRet != null) {
                            a(false, false, tokenRet.getCode(), tokenRet.getMsg(), com.mobile.auth.gatewayauth.utils.a.a(tokenRet.getCode(), tokenRet.getMsg()), c3, null, null, this.m, j);
                            this.j.e("checkEnvAvailable code = ", tokenRet.getCode(), "; msg = ", tokenRet.getMsg());
                        } else {
                            a(true, false, "", "", "", "", null, null, this.m, j);
                        }
                        return true;
                    }
                    TokenRet convertErrorInfo2 = this.m.convertErrorInfo(ResultCode.CODE_ERROR_OPERATOR_UNKNOWN_FAIL, "无法判运营商", c3);
                    this.j.e("checkEnvAvailable failed! Unsupported Vendor!");
                    if (convertErrorInfo2 == null) {
                        a(true, false, "", "", "", "", null, null, this.m, j);
                        return false;
                    }
                    a(false, false, convertErrorInfo2.getCode(), convertErrorInfo2.getMsg(), com.mobile.auth.gatewayauth.utils.a.a(convertErrorInfo2.getCode(), convertErrorInfo2.getMsg()), c3, null, null, this.m, j);
                    this.j.e("checkEnvAvailable code = ", convertErrorInfo2.getCode(), "; msg = ", convertErrorInfo2.getMsg());
                    return false;
                } catch (Exception e2) {
                    e = e2;
                    tokenRet2 = tokenRet;
                    try {
                        e.printStackTrace();
                        TokenRet convertErrorInfo3 = this.m.convertErrorInfo(ResultCode.CODE_ERROR_UNKNOWN_FAIL, ExecutorManager.getErrorInfoFromException(e), c3);
                        if (convertErrorInfo3 == null) {
                            a(true, false, "", "", "", "", null, null, this.m, j);
                            return false;
                        }
                        a(false, false, convertErrorInfo3.getCode(), convertErrorInfo3.getMsg(), com.mobile.auth.gatewayauth.utils.a.a(convertErrorInfo3.getCode(), convertErrorInfo3.getMsg()), c3, null, null, this.m, j);
                        com.mobile.auth.q.a aVar = this.j;
                        String[] strArr = new String[i];
                        strArr[0] = "checkEnvAvailable code = ";
                        strArr[c2] = convertErrorInfo3.getCode();
                        strArr[2] = "; msg = ";
                        strArr[3] = convertErrorInfo3.getMsg();
                        aVar.e(strArr);
                        return false;
                    } catch (Throwable th) {
                        th = th;
                        tokenRet = tokenRet2;
                        if (tokenRet != null) {
                            a(false, false, tokenRet.getCode(), tokenRet.getMsg(), com.mobile.auth.gatewayauth.utils.a.a(tokenRet.getCode(), tokenRet.getMsg()), c3, null, null, this.m, j);
                            com.mobile.auth.q.a aVar2 = this.j;
                            String[] strArr2 = new String[i];
                            strArr2[0] = "checkEnvAvailable code = ";
                            strArr2[c2] = tokenRet.getCode();
                            strArr2[2] = "; msg = ";
                            strArr2[3] = tokenRet.getMsg();
                            aVar2.e(strArr2);
                        } else {
                            a(true, false, "", "", "", "", null, null, this.m, j);
                        }
                        throw th;
                    }
                } catch (Throwable th2) {
                    th = th2;
                    if (tokenRet != null) {
                    }
                    throw th;
                }
            } catch (Exception e3) {
                e = e3;
                i = 4;
                c2 = 1;
            } catch (Throwable th3) {
                th = th3;
                i = 4;
                c2 = 1;
                tokenRet = tokenRet2;
                if (tokenRet != null) {
                }
                throw th;
            }
        } catch (Throwable th4) {
            try {
                ExceptionProcessor.processException(th4);
                return false;
            } catch (Throwable th5) {
                ExceptionProcessor.processException(th5);
                return false;
            }
        }
    }

    @AuthNumber
    public void clearPreInfo() {
        try {
            this.f.a();
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
            }
        }
    }

    @AuthNumber
    public String getCurrentCarrierName() {
        try {
            return this.f12931c.d();
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
                return null;
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
                return null;
            }
        }
    }

    @AuthNumber
    public String getLoginMaskPhone(int i, final String str, final OnLoginPhoneListener onLoginPhoneListener, final boolean z, boolean z2, final String str2) {
        try {
            final MonitorStruct monitorStruct = new MonitorStruct();
            String f = this.g.f();
            monitorStruct.setStartTime(System.currentTimeMillis());
            justGetLoginPhone(monitorStruct, str, i, this.m, z2, new RequestCallback<LoginPhoneInfo, com.mobile.auth.gatewayauth.manager.base.b>() {
                public void a(com.mobile.auth.gatewayauth.manager.base.b bVar) {
                    try {
                        PhoneNumberAuthHelperProxy.f(PhoneNumberAuthHelperProxy.this).h();
                        PhoneNumberAuthHelperProxy.this.a(false, true, bVar.b(), bVar.c(), bVar.g(), str, monitorStruct, new TokenResultListener() {
                            @Override
                            public void onTokenFailed(String str3) {
                                try {
                                    onLoginPhoneListener.onGetFailed(str3);
                                } catch (Throwable th) {
                                    try {
                                        ExceptionProcessor.processException(th);
                                    } catch (Throwable th2) {
                                        ExceptionProcessor.processException(th2);
                                    }
                                }
                            }

                            @Override
                            public void onTokenSuccess(String str3) {
                            }
                        }, PhoneNumberAuthHelperProxy.g(PhoneNumberAuthHelperProxy.this), str2);
                    } catch (Throwable th) {
                        try {
                            ExceptionProcessor.processException(th);
                        } catch (Throwable th2) {
                            ExceptionProcessor.processException(th2);
                        }
                    }
                }

                public void a(final LoginPhoneInfo loginPhoneInfo) {
                    try {
                        loginPhoneInfo.setVendor(PhoneNumberAuthHelperProxy.a(PhoneNumberAuthHelperProxy.this).b(str));
                        if (com.mobile.auth.gatewayauth.utils.c.e(PhoneNumberAuthHelperProxy.a(PhoneNumberAuthHelperProxy.this).e())) {
                            PhoneNumberAuthHelperProxy phoneNumberAuthHelperProxy = PhoneNumberAuthHelperProxy.this;
                            phoneNumberAuthHelperProxy.a(true, z, "600000", "获取掩码成功", "", str, monitorStruct, null, PhoneNumberAuthHelperProxy.g(phoneNumberAuthHelperProxy), str2);
                            ExecutorManager.getInstance().postMain(new ExecutorManager.SafeRunnable() {
                                @Override
                                protected void onException(Throwable th) {
                                }

                                @Override
                                protected void safeRun() {
                                    try {
                                        onLoginPhoneListener.onGetLoginPhone(loginPhoneInfo);
                                    } catch (Throwable th) {
                                        try {
                                            ExceptionProcessor.processException(th);
                                        } catch (Throwable th2) {
                                            ExceptionProcessor.processException(th2);
                                        }
                                    }
                                }
                            });
                        } else {
                            PhoneNumberAuthHelperProxy.this.a(false, true, ResultCode.CODE_ERROR_NO_MOBILE_NETWORK_FAIL, ResultCode.MSG_ERROR_NO_MOBILE_NETWORK_FAIL, "", str, monitorStruct, new TokenResultListener() {
                                @Override
                                public void onTokenFailed(String str3) {
                                    try {
                                        onLoginPhoneListener.onGetFailed(str3);
                                    } catch (Throwable th) {
                                        try {
                                            ExceptionProcessor.processException(th);
                                        } catch (Throwable th2) {
                                            ExceptionProcessor.processException(th2);
                                        }
                                    }
                                }

                                @Override
                                public void onTokenSuccess(String str3) {
                                }
                            }, PhoneNumberAuthHelperProxy.g(PhoneNumberAuthHelperProxy.this), str2);
                        }
                    } catch (Throwable th) {
                        try {
                            ExceptionProcessor.processException(th);
                        } catch (Throwable th2) {
                            ExceptionProcessor.processException(th2);
                        }
                    }
                }

                @Override
                public void onError(com.mobile.auth.gatewayauth.manager.base.b bVar) {
                    try {
                        a(bVar);
                    } catch (Throwable th) {
                        try {
                            ExceptionProcessor.processException(th);
                        } catch (Throwable th2) {
                            ExceptionProcessor.processException(th2);
                        }
                    }
                }

                @Override
                public void onSuccess(LoginPhoneInfo loginPhoneInfo) {
                    try {
                        a(loginPhoneInfo);
                    } catch (Throwable th) {
                        try {
                            ExceptionProcessor.processException(th);
                        } catch (Throwable th2) {
                            ExceptionProcessor.processException(th2);
                        }
                    }
                }
            }, str2, f, 6);
            return str2;
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
                return null;
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
                return null;
            }
        }
    }

    @AuthNumber
    public PnsReporter getReporter() {
        try {
            return this.g.b();
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
                return null;
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
                return null;
            }
        }
    }

    @AuthNumber
    public void getVerifyToken(final int i, final TokenResultListener tokenResultListener) {
        try {
            ExecutorManager.getInstance().scheduleFuture(new g.a(tokenResultListener) {
                @Override
                protected void a() {
                    try {
                        PhoneNumberAuthHelperProxy phoneNumberAuthHelperProxy = PhoneNumberAuthHelperProxy.this;
                        PhoneNumberAuthHelperProxy.a(phoneNumberAuthHelperProxy, i, PhoneNumberAuthHelperProxy.g(phoneNumberAuthHelperProxy), true, tokenResultListener);
                    } catch (Throwable th) {
                        try {
                            ExceptionProcessor.processException(th);
                        } catch (Throwable th2) {
                            ExceptionProcessor.processException(th2);
                        }
                    }
                }
            });
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
            }
        }
    }

    @AuthNumber
    public void prohibitUseUtdid() {
        try {
            com.mobile.auth.gatewayauth.manager.d dVar = this.g;
            if (dVar != null) {
                dVar.n();
            }
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
            }
        }
    }

    @AuthNumber
    public void setAuthListener(TokenResultListener tokenResultListener) {
        try {
            this.f12930b = tokenResultListener;
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
            }
        }
    }

    @AuthNumber
    public void setAuthSDKInfo(String str) {
        try {
            this.j.a("setAuthSDKInfo secretInfo = ", str);
            this.f12931c.a(str);
            this.f12933e.setLocalVendorSdkInfo(str);
            if (!this.h.a(this.f12933e)) {
                this.j.e("VendorSdkFactor update local VendorConfig failed!");
                return;
            }
            com.mobile.auth.gatewayauth.utils.c.g(this.f12931c.e());
            if (!b(this.f12931c.e()) || RequestState.getInstance().checkTokenValied(1) || RequestState.getInstance().isUseRequest() || RequestState.getInstance().checkTokenValied(1)) {
                return;
            }
            ExecutorManager.getInstance().scheduleFuture(new Runnable() {
                @Override
                public void run() {
                    try {
                        PhoneNumberAuthHelperProxy phoneNumberAuthHelperProxy = PhoneNumberAuthHelperProxy.this;
                        PhoneNumberAuthHelperProxy.a(phoneNumberAuthHelperProxy, PhoneNumberAuthHelperProxy.a(phoneNumberAuthHelperProxy).e(), true);
                    } catch (Throwable th) {
                        try {
                            ExceptionProcessor.processException(th);
                        } catch (Throwable th2) {
                            ExceptionProcessor.processException(th2);
                        }
                    }
                }
            });
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
            }
        }
    }
}