QQ浏览器 v12.2.3.7053版本的 MD5 值为:8285ab3059e5c8b521a264dfbc5c3685

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


package oicq.wlogin_sdk.request;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import com.eclipsesource.mmv8.Platform;
import com.tencent.mtt.apkplugin.impl.IAPInjectService;
import com.xiaomi.mipush.sdk.Constants;
import java.lang.reflect.Array;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Timer;
import java.util.TimerTask;
import oicq.wlogin_sdk.code2d.fetch_code;
import oicq.wlogin_sdk.devicelock.DevlockBase;
import oicq.wlogin_sdk.devicelock.DevlockInfo;
import oicq.wlogin_sdk.devicelock.DevlockRst;
import oicq.wlogin_sdk.devicelock.TLV_CommRsp;
import oicq.wlogin_sdk.report.report_t2;
import oicq.wlogin_sdk.sharemem.WloginLoginInfo;
import oicq.wlogin_sdk.sharemem.WloginSigInfo;
import oicq.wlogin_sdk.sharemem.WloginSimpleInfo;
import oicq.wlogin_sdk.tlv_type.RegTLV;
import oicq.wlogin_sdk.tlv_type.tlv_t;
import oicq.wlogin_sdk.tlv_type.tlv_t106;
import oicq.wlogin_sdk.tlv_type.tlv_t10c;
import oicq.wlogin_sdk.tlv_type.tlv_t145;
import oicq.wlogin_sdk.tlv_type.tlv_t16a;
import oicq.wlogin_sdk.tlv_type.tlv_t400;
import oicq.wlogin_sdk.tools.EcdhCrypt;
import oicq.wlogin_sdk.tools.ErrMsg;
import oicq.wlogin_sdk.tools.InternationMsg;
import oicq.wlogin_sdk.tools.MD5;
import oicq.wlogin_sdk.tools.RSACrypt;
import oicq.wlogin_sdk.tools.cryptor;
import oicq.wlogin_sdk.tools.util;

public class WtloginHelper extends WtloginListener {
    static final Object __sync_top = new Object();
    static int __top;
    private boolean isForLocal;
    private long mAysncSeq;
    private Context mContext;
    private t mG;
    private Handler mHelperHandler;
    private WtloginListener mListener;
    private int mMainSigMap;
    private int mMiscBitmap;
    private long mOpenAppid;
    private oicq.wlogin_sdk.a.h mRegStatus;
    private int mSubSigMap;

    private static class A1SRC {
        public static final int A1SRC_PASSWORD = 1;
        public static final int A1SRC_PTSIG = 4;
        public static final int A1SRC_QUICKLOGIN = 2;
        public static final int A1SRC_SMS = 3;

        private A1SRC() {
        }
    }

    public class HelperThread extends Thread {
        boolean isSelfLooper;
        byte[] mAppName2;
        byte[] mAppSign2;
        byte[] mAppVer2;
        long mAppid1;
        long mAppid2;
        long mDwAppid;
        long mDwDstAppPri;
        long mDwDstAppid;
        long[] mDwDstSubAppidList;
        int mDwMainSigMap;
        long[] mDwSubAppidList;
        long mDwSubDstAppid;
        int mEncrypt;
        WFastLoginInfo mFastLoginInfo;
        Handler mHandler;
        WtloginHelper mHelper;
        boolean mIsSmslogin;
        String mMsgCode;
        byte[] mPictureData;
        WtTicketPromise mPromise;
        boolean mPwdMd5;
        int mReportErrType;
        TransReqContext mReqContext;
        int mReqType;
        byte[][] mReserve;
        long mRole;
        byte[][] mST;
        byte[] mST1;
        byte[] mST1Key;
        long mSmsAppid;
        long mSsoVer2;
        long mSubAppid1;
        long mSubAppid2;
        long mUIN;
        String mUserAccount;
        byte[] mUserInput;
        String mUserPasswd;
        WUserSigInfo mUserSigInfo;
        String ptSig;
        QuickLoginParam quickLoginParam;

        HelperThread(WtloginHelper wtloginHelper, Handler handler) {
            this.isSelfLooper = false;
            this.mUserSigInfo = null;
            this.mIsSmslogin = false;
            this.mHelper = wtloginHelper;
            this.mHandler = handler;
        }

        HelperThread(WtloginHelper wtloginHelper, Handler handler, int i, String str, long j, long j2, TransReqContext transReqContext, String str2) {
            this.isSelfLooper = false;
            this.mUserSigInfo = null;
            this.mIsSmslogin = false;
            this.mHelper = wtloginHelper;
            this.mHandler = handler;
            this.mEncrypt = i;
            this.mUserAccount = str;
            this.mDwAppid = j;
            this.mRole = j2;
            this.mReqContext = transReqContext;
            setName(str2);
        }

        HelperThread(WtloginHelper wtloginHelper, Handler handler, int i, String str, long j, long j2, TransReqContext transReqContext, WUserSigInfo wUserSigInfo, String str2) {
            this.isSelfLooper = false;
            this.mUserSigInfo = null;
            this.mIsSmslogin = false;
            this.mHelper = wtloginHelper;
            this.mHandler = handler;
            this.mEncrypt = i;
            this.mUserAccount = str;
            this.mDwAppid = j;
            this.mRole = j2;
            this.mReqContext = transReqContext;
            this.mUserSigInfo = wUserSigInfo;
            setName(str2);
        }

        HelperThread(WtloginHelper wtloginHelper, Handler handler, long j, long j2, String str, WUserSigInfo wUserSigInfo, String str2) {
            this.isSelfLooper = false;
            this.mUserSigInfo = null;
            this.mIsSmslogin = false;
            this.mHelper = wtloginHelper;
            this.mHandler = handler;
            this.mUserAccount = str;
            this.mAppid1 = j;
            this.mSubAppid1 = j2;
            this.mUserSigInfo = wUserSigInfo;
            setName(str2);
        }

        HelperThread(WtloginHelper wtloginHelper, Handler handler, String str, long j, int i, long j2, WUserSigInfo wUserSigInfo, String str2) {
            this.isSelfLooper = false;
            this.mUserSigInfo = null;
            this.mIsSmslogin = false;
            this.mHelper = wtloginHelper;
            this.mHandler = handler;
            this.mUserAccount = str;
            this.mDwAppid = j;
            this.mDwMainSigMap = i;
            this.mDwSubDstAppid = j2;
            this.mUserSigInfo = wUserSigInfo;
            setName(str2);
        }

        HelperThread(WtloginHelper wtloginHelper, Handler handler, String str, long j, int i, long j2, long[] jArr, boolean z, String str2, WUserSigInfo wUserSigInfo, byte[][] bArr, boolean z2, String str3) {
            this.isSelfLooper = false;
            this.mUserSigInfo = null;
            this.mIsSmslogin = false;
            this.mHelper = wtloginHelper;
            this.mHandler = handler;
            this.mUserAccount = str;
            this.mDwAppid = j;
            this.mDwMainSigMap = i;
            this.mDwSubDstAppid = j2;
            this.mDwSubAppidList = jArr;
            this.mPwdMd5 = z;
            this.mUserPasswd = str2;
            this.mUserSigInfo = wUserSigInfo;
            this.mST = bArr;
            this.mIsSmslogin = z2;
            setName(str3);
        }

        HelperThread(WtloginHelper wtloginHelper, Handler handler, String str, long j, long j2, int i, byte[] bArr, long j3, long j4, long j5, byte[] bArr2, byte[] bArr3, WUserSigInfo wUserSigInfo, WFastLoginInfo wFastLoginInfo, String str2) {
            this.isSelfLooper = false;
            this.mUserSigInfo = null;
            this.mIsSmslogin = false;
            this.mHelper = wtloginHelper;
            this.mHandler = handler;
            this.mUserAccount = str;
            this.mAppid1 = j;
            this.mSubAppid1 = j2;
            this.mDwMainSigMap = i;
            this.mAppName2 = bArr;
            this.mSsoVer2 = j4;
            this.mAppid2 = j4;
            this.mSubAppid2 = j5;
            this.mAppVer2 = bArr2;
            this.mAppSign2 = bArr3;
            this.mUserSigInfo = wUserSigInfo;
            this.mFastLoginInfo = wFastLoginInfo;
            setName(str2);
        }

        HelperThread(WtloginHelper wtloginHelper, Handler handler, String str, long j, WUserSigInfo wUserSigInfo, String str2) {
            this.isSelfLooper = false;
            this.mUserSigInfo = null;
            this.mIsSmslogin = false;
            this.mHelper = wtloginHelper;
            this.mHandler = handler;
            this.mUserAccount = str;
            this.mSmsAppid = j;
            this.mUserSigInfo = wUserSigInfo;
            setName(str2);
        }

        HelperThread(WtloginHelper wtloginHelper, Handler handler, String str, String str2, WUserSigInfo wUserSigInfo, String str3) {
            this.isSelfLooper = false;
            this.mUserSigInfo = null;
            this.mIsSmslogin = false;
            this.mHelper = wtloginHelper;
            this.mHandler = handler;
            this.mUserAccount = str;
            this.mMsgCode = str2;
            this.mUserSigInfo = wUserSigInfo;
            setName(str3);
        }

        HelperThread(WtloginHelper wtloginHelper, Handler handler, String str, String str2, QuickLoginParam quickLoginParam, String str3) {
            this.isSelfLooper = false;
            this.mUserSigInfo = null;
            this.mIsSmslogin = false;
            this.mHelper = wtloginHelper;
            this.mHandler = handler;
            this.mUserAccount = str;
            this.ptSig = str2;
            this.quickLoginParam = quickLoginParam;
            this.mUserSigInfo = quickLoginParam.userSigInfo;
            setName(str3);
        }

        HelperThread(WtloginHelper wtloginHelper, Handler handler, String str, WUserSigInfo wUserSigInfo, String str2) {
            this.isSelfLooper = false;
            this.mUserSigInfo = null;
            this.mIsSmslogin = false;
            this.mHelper = wtloginHelper;
            this.mHandler = handler;
            this.mUserAccount = str;
            this.mUserSigInfo = wUserSigInfo;
            setName(str2);
        }

        HelperThread(WtloginHelper wtloginHelper, Handler handler, String str, QuickLoginParam quickLoginParam, String str2) {
            this.isSelfLooper = false;
            this.mUserSigInfo = null;
            this.mIsSmslogin = false;
            this.mHelper = wtloginHelper;
            this.mHandler = handler;
            this.mUserAccount = str;
            this.quickLoginParam = quickLoginParam;
            this.mUserSigInfo = quickLoginParam.userSigInfo;
            setName(str2);
        }

        HelperThread(WtloginHelper wtloginHelper, Handler handler, String str, byte[] bArr, WUserSigInfo wUserSigInfo, byte[][] bArr2, String str2) {
            this.isSelfLooper = false;
            this.mUserSigInfo = null;
            this.mIsSmslogin = false;
            this.mHelper = wtloginHelper;
            this.mHandler = handler;
            this.mUserAccount = str;
            this.mUserInput = bArr;
            this.mUserSigInfo = wUserSigInfo;
            this.mST = bArr2;
            setName(str2);
        }

        HelperThread(WtloginHelper wtloginHelper, Handler handler, WtTicketPromise wtTicketPromise, String str, long j, long j2, long j3, int i, long j4, long[] jArr, WUserSigInfo wUserSigInfo, byte[][] bArr, byte[][] bArr2, String str2) {
            this.isSelfLooper = false;
            this.mUserSigInfo = null;
            this.mIsSmslogin = false;
            this.mHelper = wtloginHelper;
            this.mHandler = handler;
            this.mPromise = wtTicketPromise;
            this.mUserAccount = str;
            this.mDwAppid = j;
            this.mDwDstAppid = j2;
            this.mDwDstAppPri = j3;
            this.mDwMainSigMap = i;
            this.mDwSubDstAppid = j4;
            this.mDwDstSubAppidList = jArr;
            this.mUserSigInfo = wUserSigInfo;
            this.mST = bArr;
            this.mReserve = bArr2;
            setName(str2);
        }

        HelperThread(WtloginHelper wtloginHelper, Handler handler, byte[] bArr, byte[] bArr2, long j, long j2, int i, String str) {
            this.isSelfLooper = false;
            this.mUserSigInfo = null;
            this.mIsSmslogin = false;
            this.mHelper = wtloginHelper;
            this.mHandler = handler;
            this.mST1 = bArr;
            this.mST1Key = bArr2;
            this.mUIN = j;
            this.mDwAppid = j2;
            this.mReportErrType = i;
            setName(str);
        }

        HelperThread(WtloginHelper wtloginHelper, Handler handler, byte[] bArr, byte[] bArr2, long j, long j2, String str) {
            this.isSelfLooper = false;
            this.mUserSigInfo = null;
            this.mIsSmslogin = false;
            this.mHelper = wtloginHelper;
            this.mHandler = handler;
            this.mST1 = bArr;
            this.mST1Key = bArr2;
            this.mUIN = j;
            this.mDwAppid = j2;
            setName(str);
        }

        public void quitSelfLooper() {
            try {
                if (this.isSelfLooper) {
                    Looper myLooper = Looper.myLooper();
                    if (myLooper != null) {
                        myLooper.quit();
                    }
                    this.mHandler = null;
                }
            } catch (Exception e) {
                util.printException(e, "");
            }
        }

        public void RunReq(int i) {
            this.mReqType = i;
            if (this.mReqType == 7) {
                start();
                return;
            }
            synchronized (WtloginHelper.__sync_top) {
                Timer timer = new Timer();
                TimerTask timerTask = new TimerTask() {
                    @Override
                    public void run() {
                        HelperThread.this.start();
                    }
                };
                WtloginHelper.__top = WtloginHelper.__top + 1;
                timer.schedule(timerTask, r2 * 500);
                util.LOGI("push queue " + WtloginHelper.__top, "");
            }
        }

        @Override
        public void run() {
            final int i;
            Handler handler;
            Runnable runnable;
            final int i2;
            Handler handler2;
            Runnable runnable2;
            if (this.mHelper.mListener == null && this.mPromise == null) {
                return;
            }
            final int i3 = this.mHelper.mG.s;
            this.isSelfLooper = this.mHandler == null;
            if (this.isSelfLooper) {
                Looper.prepare();
                this.mHandler = WtloginHelper.this.newHelperHandler();
            }
            try {
                try {
                    try {
                        if (this.mHandler == null) {
                            throw new Exception("Handler should not be null!");
                        }
                        if (this.mReqType == 0) {
                            final int GetStWithPasswd = this.mHelper.GetStWithPasswd(this.mUserAccount, this.mDwAppid, this.mDwMainSigMap, this.mDwSubDstAppid, this.mDwSubAppidList, this.mPwdMd5, this.mUserPasswd, this.mUserSigInfo, this.mST, this.mIsSmslogin, 1);
                            handler2 = this.mHandler;
                            runnable2 = new Runnable() {
                                @Override
                                public void run() {
                                    HelperThread.this.quitSelfLooper();
                                    if (i3 != 0) {
                                        return;
                                    }
                                    async_context b2 = t.b(HelperThread.this.mUserSigInfo._seqence);
                                    ErrMsg errMsg = b2._last_err_msg;
                                    if (HelperThread.this.mHelper.mListener == null) {
                                        util.LOGW("login helper listener is null", HelperThread.this.mUserAccount);
                                        return;
                                    }
                                    if (GetStWithPasswd == 0 && b2.tlv528 != null) {
                                        util.LOGI("context from seq " + HelperThread.this.mUserSigInfo._seqence + " tlv528 length " + b2.tlv528.get_data_len(), HelperThread.this.mUserAccount);
                                        HelperThread.this.mUserSigInfo.loginResultTLVMap.put(new Integer(1320), b2.tlv528);
                                    }
                                    if (HelperThread.this.mDwSubAppidList == null) {
                                        if (HelperThread.this.mIsSmslogin) {
                                            HelperThread.this.mHelper.mListener.OnGetStViaSMSVerifyLogin(HelperThread.this.mUserAccount, HelperThread.this.mDwAppid, HelperThread.this.mDwMainSigMap, HelperThread.this.mDwSubDstAppid, HelperThread.this.mUserSigInfo, GetStWithPasswd, errMsg);
                                            return;
                                        } else {
                                            HelperThread.this.mHelper.mListener.OnGetStWithPasswd(HelperThread.this.mUserAccount, HelperThread.this.mDwAppid, HelperThread.this.mDwMainSigMap, HelperThread.this.mDwSubDstAppid, HelperThread.this.mUserPasswd, HelperThread.this.mUserSigInfo, GetStWithPasswd, errMsg);
                                            return;
                                        }
                                    }
                                    if (HelperThread.this.mIsSmslogin) {
                                        HelperThread.this.mHelper.mListener.OnGetStViaSMSVerifyLogin(HelperThread.this.mUserAccount, HelperThread.this.mDwAppid, HelperThread.this.mDwMainSigMap, HelperThread.this.mDwSubDstAppid, HelperThread.this.mDwSubAppidList, HelperThread.this.mUserSigInfo, HelperThread.this.mST, GetStWithPasswd, errMsg);
                                    } else {
                                        HelperThread.this.mHelper.mListener.OnGetStWithPasswd(HelperThread.this.mUserAccount, HelperThread.this.mDwAppid, HelperThread.this.mDwMainSigMap, HelperThread.this.mDwSubDstAppid, HelperThread.this.mDwSubAppidList, HelperThread.this.mUserPasswd, HelperThread.this.mUserSigInfo, HelperThread.this.mST, GetStWithPasswd, errMsg);
                                    }
                                }
                            };
                        } else if (this.mReqType == 1) {
                            final int RefreshPictureData = this.mHelper.RefreshPictureData(this.mUserAccount, this.mUserSigInfo, 1);
                            handler2 = this.mHandler;
                            runnable2 = new Runnable() {
                                @Override
                                public void run() {
                                    HelperThread.this.quitSelfLooper();
                                    if (i3 != 0) {
                                        return;
                                    }
                                    if (HelperThread.this.mHelper.mListener == null) {
                                        util.LOGW("login helper listener is null", HelperThread.this.mUserAccount);
                                        return;
                                    }
                                    async_context b2 = t.b(HelperThread.this.mUserSigInfo._seqence);
                                    ErrMsg errMsg = b2._last_err_msg;
                                    HelperThread.this.mPictureData = b2._t105.get_pic();
                                    HelperThread.this.mHelper.mListener.OnRefreshPictureData(HelperThread.this.mUserAccount, HelperThread.this.mUserSigInfo, HelperThread.this.mPictureData, RefreshPictureData, errMsg);
                                }
                            };
                        } else if (this.mReqType == 2) {
                            final int CheckPictureAndGetSt = this.mHelper.CheckPictureAndGetSt(this.mUserAccount, this.mUserInput, this.mUserSigInfo, this.mST, 1);
                            handler2 = this.mHandler;
                            runnable2 = new Runnable() {
                                @Override
                                public void run() {
                                    HelperThread.this.quitSelfLooper();
                                    if (i3 != 0) {
                                        return;
                                    }
                                    ErrMsg errMsg = t.b(HelperThread.this.mUserSigInfo._seqence)._last_err_msg;
                                    if (o.I) {
                                        if (HelperThread.this.mST == null) {
                                            HelperThread.this.mHelper.mListener.OnCheckWebsigAndGetSt(HelperThread.this.mUserAccount, HelperThread.this.mUserInput, HelperThread.this.mUserSigInfo, CheckPictureAndGetSt, errMsg);
                                            return;
                                        } else {
                                            HelperThread.this.mHelper.mListener.OnCheckWebsigAndGetSt(HelperThread.this.mUserAccount, HelperThread.this.mUserInput, HelperThread.this.mUserSigInfo, HelperThread.this.mST, CheckPictureAndGetSt, errMsg);
                                            return;
                                        }
                                    }
                                    if (HelperThread.this.mST == null) {
                                        HelperThread.this.mHelper.mListener.OnCheckPictureAndGetSt(HelperThread.this.mUserAccount, HelperThread.this.mUserInput, HelperThread.this.mUserSigInfo, CheckPictureAndGetSt, errMsg);
                                    } else {
                                        HelperThread.this.mHelper.mListener.OnCheckPictureAndGetSt(HelperThread.this.mUserAccount, HelperThread.this.mUserInput, HelperThread.this.mUserSigInfo, HelperThread.this.mST, CheckPictureAndGetSt, errMsg);
                                    }
                                }
                            };
                        } else if (this.mReqType == 3) {
                            final int RefreshSMSData = this.mHelper.RefreshSMSData(this.mUserAccount, this.mSmsAppid, this.mUserSigInfo, 1);
                            handler2 = this.mHandler;
                            runnable2 = new Runnable() {
                                @Override
                                public void run() {
                                    HelperThread.this.quitSelfLooper();
                                    if (i3 != 0) {
                                        return;
                                    }
                                    async_context b2 = t.b(HelperThread.this.mUserSigInfo._seqence);
                                    ErrMsg errMsg = b2._last_err_msg;
                                    HelperThread.this.mHelper.mListener.OnRefreshSMSData(HelperThread.this.mUserAccount, HelperThread.this.mSmsAppid, HelperThread.this.mUserSigInfo, b2._t17b.get_available_msg_cnt(), b2._t17b.get_time_limit(), RefreshSMSData, errMsg);
                                }
                            };
                        } else if (this.mReqType == 4) {
                            final int CheckSMSAndGetSt = this.mHelper.CheckSMSAndGetSt(this.mUserAccount, this.mUserInput, this.mUserSigInfo, this.mST, 1);
                            handler2 = this.mHandler;
                            runnable2 = new Runnable() {
                                @Override
                                public void run() {
                                    HelperThread.this.quitSelfLooper();
                                    if (i3 != 0) {
                                        return;
                                    }
                                    ErrMsg errMsg = t.b(HelperThread.this.mUserSigInfo._seqence)._last_err_msg;
                                    if (HelperThread.this.mST == null) {
                                        HelperThread.this.mHelper.mListener.OnCheckSMSAndGetSt(HelperThread.this.mUserAccount, HelperThread.this.mUserInput, HelperThread.this.mUserSigInfo, CheckSMSAndGetSt, errMsg);
                                    } else {
                                        HelperThread.this.mHelper.mListener.OnCheckSMSAndGetSt(HelperThread.this.mUserAccount, HelperThread.this.mUserInput, HelperThread.this.mUserSigInfo, HelperThread.this.mST, CheckSMSAndGetSt, errMsg);
                                    }
                                }
                            };
                        } else {
                            try {
                                if (this.mReqType == 5) {
                                    i2 = i3;
                                    final int GetStWithoutPasswd = this.mHelper.GetStWithoutPasswd(this.mUserAccount, this.mDwAppid, this.mDwDstAppid, this.mDwDstAppPri, this.mDwMainSigMap, this.mDwSubDstAppid, this.mDwDstSubAppidList, this.mUserSigInfo, this.mST, this.mReserve, 1, this.mPromise);
                                    handler = this.mHandler;
                                    runnable = new Runnable() {
                                        @Override
                                        public void run() {
                                            HelperThread.this.quitSelfLooper();
                                            if (i2 != 0) {
                                                return;
                                            }
                                            ErrMsg errMsg = t.b(HelperThread.this.mUserSigInfo._seqence)._last_err_msg;
                                            t.c(HelperThread.this.mUserSigInfo._seqence);
                                            if (HelperThread.this.mDwDstAppid == WtloginHelper.this.mOpenAppid) {
                                                HelperThread helperThread = HelperThread.this;
                                                helperThread.mDwDstAppid = helperThread.mDwSubDstAppid;
                                                HelperThread.this.mDwSubDstAppid = 0L;
                                            }
                                            if (HelperThread.this.mPromise == null) {
                                                if (HelperThread.this.mHelper.mListener == null) {
                                                    return;
                                                }
                                                if (HelperThread.this.mDwDstSubAppidList != null || WtloginHelper.this.mG.e()) {
                                                    HelperThread.this.mHelper.mListener.OnGetStWithoutPasswd(HelperThread.this.mUserAccount, HelperThread.this.mDwAppid, HelperThread.this.mDwDstAppid, HelperThread.this.mDwMainSigMap, HelperThread.this.mDwSubDstAppid, HelperThread.this.mDwDstSubAppidList, HelperThread.this.mUserSigInfo, HelperThread.this.mST, GetStWithoutPasswd, errMsg);
                                                    return;
                                                } else {
                                                    HelperThread.this.mHelper.mListener.OnGetStWithoutPasswd(HelperThread.this.mUserAccount, HelperThread.this.mDwAppid, HelperThread.this.mDwDstAppid, HelperThread.this.mDwMainSigMap, HelperThread.this.mDwSubDstAppid, HelperThread.this.mUserSigInfo, GetStWithoutPasswd, errMsg);
                                                    return;
                                                }
                                            }
                                            errMsg.setType(GetStWithoutPasswd);
                                            int i4 = GetStWithoutPasswd;
                                            if (i4 == 0) {
                                                HelperThread.this.mPromise.Done(null);
                                            } else if (i4 == -1000) {
                                                HelperThread.this.mPromise.Timeout(errMsg);
                                            } else {
                                                HelperThread.this.mPromise.Failed(errMsg);
                                            }
                                        }
                                    };
                                } else {
                                    if (this.mReqType != 6) {
                                        if (this.mReqType == 7) {
                                            this.mHelper.RequestReport(1, this.mST1, this.mST1Key, this.mUIN, this.mDwAppid);
                                        } else {
                                            if (this.mReqType == 9) {
                                                final int RequestTransport = this.mHelper.RequestTransport(1, this.mEncrypt, this.mUserAccount, this.mDwAppid, this.mRole, this.mReqContext, this.mUserSigInfo);
                                                handler = this.mHandler;
                                                runnable = new Runnable() {
                                                    @Override
                                                    public void run() {
                                                        HelperThread.this.quitSelfLooper();
                                                        if (i3 != 0) {
                                                            return;
                                                        }
                                                        if (HelperThread.this.mReqContext.is_register_req()) {
                                                            HelperThread.this.mHelper.OnRequestRegister(HelperThread.this.mUserAccount, HelperThread.this.mDwAppid, HelperThread.this.mRole, HelperThread.this.mReqContext, HelperThread.this.mUserSigInfo, RequestTransport);
                                                            return;
                                                        }
                                                        if (HelperThread.this.mReqContext.is_code2d_func_req()) {
                                                            HelperThread.this.mHelper.OnRequestCode2d(HelperThread.this.mUserAccount, HelperThread.this.mDwAppid, HelperThread.this.mRole, HelperThread.this.mReqContext, HelperThread.this.mUserSigInfo, RequestTransport);
                                                        } else if (HelperThread.this.mReqContext.is_devlock_req()) {
                                                            HelperThread.this.mHelper.OnDeviceLockRequest(HelperThread.this.mUserAccount, HelperThread.this.mDwAppid, HelperThread.this.mRole, HelperThread.this.mReqContext, HelperThread.this.mUserSigInfo, RequestTransport);
                                                        } else {
                                                            HelperThread.this.mHelper.mListener.OnRequestTransport(HelperThread.this.mUserAccount, HelperThread.this.mDwAppid, HelperThread.this.mRole, HelperThread.this.mReqContext, HelperThread.this.mUserSigInfo, RequestTransport);
                                                        }
                                                    }
                                                };
                                            } else if (this.mReqType == 10) {
                                                final int RequestTransportMsf = this.mHelper.RequestTransportMsf(1, this.mEncrypt, this.mUserAccount, this.mDwAppid, this.mRole, this.mReqContext);
                                                handler = this.mHandler;
                                                runnable = new Runnable() {
                                                    @Override
                                                    public void run() {
                                                        HelperThread.this.quitSelfLooper();
                                                        if (i3 != 0) {
                                                            return;
                                                        }
                                                        HelperThread.this.mHelper.mListener.OnRequestTransport(HelperThread.this.mUserAccount, HelperThread.this.mDwAppid, HelperThread.this.mRole, HelperThread.this.mReqContext, RequestTransportMsf);
                                                    }
                                                };
                                            } else if (this.mReqType == 12) {
                                                final int CheckSMSVerifyLoginAccount = this.mHelper.CheckSMSVerifyLoginAccount(this.mAppid1, this.mSubAppid1, this.mUserAccount, this.mUserSigInfo, 1);
                                                handler = this.mHandler;
                                                runnable = new Runnable() {
                                                    @Override
                                                    public void run() {
                                                        HelperThread.this.quitSelfLooper();
                                                        if (i3 != 0) {
                                                            return;
                                                        }
                                                        async_context b2 = t.b(HelperThread.this.mUserSigInfo._seqence);
                                                        HelperThread.this.mHelper.mListener.OnCheckSMSVerifyLoginAccount(HelperThread.this.mAppid1, HelperThread.this.mSubAppid1, HelperThread.this.mUserAccount, b2._smslogin_msg, b2._smslogin_msgcnt, b2._smslogin_timelimit, HelperThread.this.mUserSigInfo, CheckSMSVerifyLoginAccount, b2._last_err_msg);
                                                    }
                                                };
                                            } else if (this.mReqType == 13) {
                                                final int VerifySMSVerifyLoginCode = this.mHelper.VerifySMSVerifyLoginCode(this.mUserAccount, this.mMsgCode, this.mUserSigInfo, 1);
                                                handler = this.mHandler;
                                                runnable = new Runnable() {
                                                    @Override
                                                    public void run() {
                                                        HelperThread.this.quitSelfLooper();
                                                        if (i3 != 0) {
                                                            return;
                                                        }
                                                        HelperThread.this.mHelper.mListener.OnVerifySMSVerifyLoginCode(HelperThread.this.mUserAccount, HelperThread.this.mMsgCode, HelperThread.this.mUserSigInfo, VerifySMSVerifyLoginCode, t.b(HelperThread.this.mUserSigInfo._seqence)._last_err_msg);
                                                    }
                                                };
                                            } else if (this.mReqType == 14) {
                                                final int RefreshSMSVerifyLoginCode = this.mHelper.RefreshSMSVerifyLoginCode(this.mUserAccount, this.mUserSigInfo, 1);
                                                handler = this.mHandler;
                                                runnable = new Runnable() {
                                                    @Override
                                                    public void run() {
                                                        HelperThread.this.quitSelfLooper();
                                                        if (i3 != 0) {
                                                            return;
                                                        }
                                                        async_context b2 = t.b(HelperThread.this.mUserSigInfo._seqence);
                                                        HelperThread.this.mHelper.mListener.OnRefreshSMSVerifyLoginCode(HelperThread.this.mUserAccount, b2._smslogin_msg, b2._smslogin_msgcnt, b2._smslogin_timelimit, HelperThread.this.mUserSigInfo, RefreshSMSVerifyLoginCode, b2._last_err_msg);
                                                    }
                                                };
                                            } else if (this.mReqType == 8) {
                                                this.mHelper.RequestReportError(1, this.mST1, this.mST1Key, this.mUIN, this.mDwAppid, this.mReportErrType);
                                            } else if (this.mReqType == 15) {
                                                final int stWithQQSig = this.mHelper.getStWithQQSig(this.mUserAccount, this.quickLoginParam, 1);
                                                handler = this.mHandler;
                                                runnable = new Runnable() {
                                                    @Override
                                                    public void run() {
                                                        HelperThread.this.quitSelfLooper();
                                                        if (i3 != 0) {
                                                            return;
                                                        }
                                                        if (HelperThread.this.mHelper.mListener == null) {
                                                            util.LOGW("login helper listener is null", HelperThread.this.mUserAccount);
                                                        } else {
                                                            HelperThread.this.mHelper.mListener.onQuickLogin(HelperThread.this.mUserAccount, HelperThread.this.quickLoginParam, stWithQQSig, t.b(HelperThread.this.mUserSigInfo._seqence)._last_err_msg);
                                                        }
                                                    }
                                                };
                                            } else if (this.mReqType == 16) {
                                                final int stWithPtSig = this.mHelper.getStWithPtSig(this.mUserAccount, this.ptSig, this.quickLoginParam, 1);
                                                handler = this.mHandler;
                                                runnable = new Runnable() {
                                                    @Override
                                                    public void run() {
                                                        HelperThread.this.quitSelfLooper();
                                                        if (i3 != 0) {
                                                            return;
                                                        }
                                                        if (HelperThread.this.mHelper.mListener == null) {
                                                            util.LOGW("login helper listener is null", HelperThread.this.mUserAccount);
                                                        } else {
                                                            HelperThread.this.mHelper.mListener.onQuickLogin(HelperThread.this.mUserAccount, HelperThread.this.quickLoginParam, stWithPtSig, t.b(HelperThread.this.mUserSigInfo._seqence)._last_err_msg);
                                                        }
                                                    }
                                                };
                                            } else if (this.mReqType == 17) {
                                                final int stWithQrSig = this.mHelper.getStWithQrSig(this.mUserAccount, this.mDwAppid, this.mDwSubDstAppid, this.mDwMainSigMap, this.mUserSigInfo, 1);
                                                handler = this.mHandler;
                                                runnable = new Runnable() {
                                                    @Override
                                                    public void run() {
                                                        HelperThread.this.quitSelfLooper();
                                                        if (i3 != 0) {
                                                            return;
                                                        }
                                                        if (HelperThread.this.mHelper.mListener == null) {
                                                            util.LOGW("login helper listener is null", HelperThread.this.mUserAccount);
                                                        } else {
                                                            HelperThread.this.mHelper.mListener.onGetStWithQrSig(HelperThread.this.mUserAccount, HelperThread.this.mDwAppid, HelperThread.this.mDwMainSigMap, HelperThread.this.mDwSubDstAppid, HelperThread.this.mUserSigInfo, stWithQrSig, t.b(HelperThread.this.mUserSigInfo._seqence)._last_err_msg);
                                                        }
                                                    }
                                                };
                                            }
                                            handler.post(runnable);
                                        }
                                        if (this.isSelfLooper) {
                                            Looper.loop();
                                        }
                                        if (this.mReqType != 7) {
                                            synchronized (WtloginHelper.__sync_top) {
                                                if (WtloginHelper.__top > 0) {
                                                    WtloginHelper.__top--;
                                                }
                                                util.LOGI("pop queue " + WtloginHelper.__top, "");
                                            }
                                            return;
                                        }
                                        return;
                                    }
                                    i2 = i3;
                                    final int GetA1WithA1 = this.mHelper.GetA1WithA1(this.mUserAccount, this.mAppid1, this.mSubAppid1, this.mDwMainSigMap, this.mAppName2, this.mSsoVer2, this.mAppid2, this.mSubAppid2, this.mAppVer2, this.mAppSign2, this.mUserSigInfo, this.mFastLoginInfo, 1);
                                    handler = this.mHandler;
                                    runnable = new Runnable() {
                                        @Override
                                        public void run() {
                                            HelperThread.this.quitSelfLooper();
                                            if (i2 != 0) {
                                                return;
                                            }
                                            ErrMsg errMsg = t.b(HelperThread.this.mUserSigInfo._seqence)._last_err_msg;
                                            t.c(HelperThread.this.mUserSigInfo._seqence);
                                            HelperThread.this.mHelper.mListener.onGetA1WithA1(HelperThread.this.mUserAccount, HelperThread.this.mAppid1, HelperThread.this.mDwMainSigMap, HelperThread.this.mSubAppid1, HelperThread.this.mAppName2, HelperThread.this.mSsoVer2, HelperThread.this.mAppid2, HelperThread.this.mSubAppid2, HelperThread.this.mAppVer2, HelperThread.this.mAppSign2, HelperThread.this.mUserSigInfo, HelperThread.this.mFastLoginInfo, GetA1WithA1, errMsg);
                                        }
                                    };
                                }
                                handler.post(runnable);
                                if (this.isSelfLooper) {
                                }
                                if (this.mReqType != 7) {
                                }
                            } catch (Exception e) {
                                e = e;
                                i = i2;
                                util.printException(e, "");
                                this.mHandler.post(new Runnable() {
                                    @Override
                                    public void run() {
                                        HelperThread.this.quitSelfLooper();
                                        if (i != 0) {
                                            return;
                                        }
                                        if (HelperThread.this.mHelper.mListener == null) {
                                            util.LOGW("login helper listener is null", HelperThread.this.mUserAccount);
                                        } else {
                                            HelperThread.this.mHelper.mListener.OnException(new ErrMsg(), HelperThread.this.mReqType, HelperThread.this.mUserSigInfo);
                                        }
                                    }
                                });
                                if (this.isSelfLooper) {
                                    Looper.loop();
                                }
                                if (this.mReqType != 7) {
                                    synchronized (WtloginHelper.__sync_top) {
                                        if (WtloginHelper.__top > 0) {
                                            WtloginHelper.__top--;
                                        }
                                        util.LOGI("pop queue " + WtloginHelper.__top, "");
                                    }
                                    return;
                                }
                                return;
                            }
                        }
                        handler2.post(runnable2);
                        if (this.isSelfLooper) {
                        }
                        if (this.mReqType != 7) {
                        }
                    } catch (Exception e2) {
                        e = e2;
                    }
                } catch (Throwable th) {
                    if (this.isSelfLooper) {
                        Looper.loop();
                    }
                    if (this.mReqType != 7) {
                        synchronized (WtloginHelper.__sync_top) {
                            if (WtloginHelper.__top > 0) {
                                WtloginHelper.__top--;
                            }
                            util.LOGI("pop queue " + WtloginHelper.__top, "");
                        }
                    }
                    throw th;
                }
            } catch (Exception e3) {
                e = e3;
                i = i3;
            }
        }
    }

    public static class LoginSourceType {
        public static final int IM = 10;
        public static final int QQConn = 20;
        public static final int QQWallet = 40;
        public static final int unknown = 0;
        public static final int webView = 30;
        public static final int webViewForceRefresh = 31;
        public static final int webViewOnTimeRefresh = 32;
    }

    public static class QuickLoginParam {
        public long appid;
        public long dstAppid;
        public long[] dstSubAppidList;
        public int sigMap;
        public String userAccount;
        public String webViewActivityClassName;
        public boolean forceWebLogin = false;
        public boolean isUserAccountLocked = false;
        public String titleBackgroundColor = "#3F51B5";
        public String titleTextColor = "#FFFFFF";
        public int startAnimEnter = 0;
        public int startAnimExit = 0;
        public int finishAnimEnter = 0;
        public int finishAnimExit = 0;
        public long subAppid = 1;
        public WUserSigInfo userSigInfo = new WUserSigInfo();
    }

    public class QuickLoginRequestCode {
        public static final int REQUEST_PT_LOGIN = 1202;
        public static final int REQUEST_QQ_LOGIN = 1201;

        public QuickLoginRequestCode() {
        }
    }

    public static class RegTLVType {
        public static final int ADDRESS_BOOK = 7;
        public static final int APPID = 2;
        public static final int APPNAME = 14;
        public static final int CALL_BACK_URL = 5;
        public static final int EMAIL_URL = 4;
        public static final int GUID = 10;
        public static final int HAS_ADDRESS_BOOK = 8;
        public static final int ID = 1;
        public static final int LANGUAGE = 3;
        public static final int MPASSWD = 11;
        public static final int MSALT = 12;
        public static final int NEW_UIN = 31;
        public static final int NICK_NAME = 6;
        public static final int NOPASSWD_REG = 9;
        public static final int PHONE_NUMBER = 30;
        public static final int PHONE_NUMBER_BOUND_UIN = 36;
        public static final int PICTURE_ID = 17;
        public static final int PICTURE_URL = 40;
        public static final int REGISTER_SIG = 16;
        public static final int REG_SIG = 33;
        public static final int SET_DEVLOCK_FLG = 15;
        public static final int SUBAPPID = 13;
    }

    public static final class SigType {
        public static final int WLOGIN_A2 = 64;
        public static final int WLOGIN_A5 = 2;
        public static final int WLOGIN_AQSIG = 2097152;
        public static final int WLOGIN_D2 = 262144;
        public static final int WLOGIN_DA2 = 33554432;
        public static final int WLOGIN_LHSIG = 4194304;
        public static final int WLOGIN_LSKEY = 512;
        public static final int WLOGIN_OPENKEY = 16384;
        public static final int WLOGIN_PAYTOKEN = 8388608;
        public static final int WLOGIN_PF = 16777216;
        public static final int WLOGIN_PSKEY = 1048576;
        public static final int WLOGIN_PT4Token = 134217728;
        public static final int WLOGIN_QRPUSH = 67108864;
        public static final int WLOGIN_RESERVED = 16;
        public static final int WLOGIN_SID = 524288;
        public static final int WLOGIN_SIG64 = 8192;
        public static final int WLOGIN_SKEY = 4096;
        public static final int WLOGIN_ST = 128;
        public static final int WLOGIN_STWEB = 32;
        public static final int WLOGIN_TOKEN = 32768;
        public static final int WLOGIN_VKEY = 131072;
    }

    public WtloginHelper(Context context) {
        this.mG = new t(null);
        this.mHelperHandler = newHelperHandler();
        this.mContext = null;
        this.mListener = null;
        this.mRegStatus = new oicq.wlogin_sdk.a.h();
        this.mMainSigMap = 16724722;
        this.mSubSigMap = 66560;
        this.mMiscBitmap = 16252796;
        this.mOpenAppid = 715019303L;
        this.mAysncSeq = 0L;
        this.isForLocal = false;
        this.isForLocal = false;
        this.mContext = context;
        this.mG.b(context);
        RequestInit();
    }

    public WtloginHelper(Context context, Object obj) {
        this.mG = new t(null);
        this.mHelperHandler = newHelperHandler();
        this.mContext = null;
        this.mListener = null;
        this.mRegStatus = new oicq.wlogin_sdk.a.h();
        this.mMainSigMap = 16724722;
        this.mSubSigMap = 66560;
        this.mMiscBitmap = 16252796;
        this.mOpenAppid = 715019303L;
        this.mAysncSeq = 0L;
        this.isForLocal = false;
        WtloginMsfListener.TicketMgr = obj;
        localInit(context, this.isForLocal);
    }

    public WtloginHelper(Context context, boolean z) {
        this.mG = new t(null);
        this.mHelperHandler = newHelperHandler();
        this.mContext = null;
        this.mListener = null;
        this.mRegStatus = new oicq.wlogin_sdk.a.h();
        this.mMainSigMap = 16724722;
        this.mSubSigMap = 66560;
        this.mMiscBitmap = 16252796;
        this.mOpenAppid = 715019303L;
        this.mAysncSeq = 0L;
        this.isForLocal = false;
        localInit(context, z);
    }

    private void AsyncGenRSAKey() {
        if (this.isForLocal) {
            return;
        }
        new Thread("AsyncGenRSAKey") {
            @Override
            public void run() {
                new RSACrypt(WtloginHelper.this.mContext).GenRSAKey();
            }
        }.start();
    }

    public int CheckPictureAndGetSt(String str, byte[] bArr, WUserSigInfo wUserSigInfo, byte[][] bArr2, int i) {
        long parseLong;
        boolean z;
        boolean z2;
        int a2;
        int i2;
        long parseLong2;
        int i3;
        String str2;
        async_context async_contextVar;
        String str3;
        int a3;
        int i4;
        int i5;
        Ticket GetUserSigInfoTicket;
        Ticket ticket;
        String str4;
        async_context async_contextVar2;
        String str5;
        int i6;
        t tVar;
        if (str == null || bArr == null || wUserSigInfo == null) {
            return -1017;
        }
        if (i == 0) {
            new HelperThread(this, this.mHelperHandler, str, bArr, wUserSigInfo, bArr2, "CheckPictureAndGetSt").RunReq(2);
            return -1001;
        }
        if (wUserSigInfo._seqence == 0) {
            wUserSigInfo._seqence = this.mAysncSeq;
        }
        t a4 = this.mG.a(wUserSigInfo._seqence);
        wUserSigInfo._seqence = a4.h;
        async_context b2 = t.b(wUserSigInfo._seqence);
        util.LOGI("user:" + str + " CheckPictureAndGetSt Seq:" + a4.h + " ...", str);
        a4.g = str;
        b2._last_err_msg = new ErrMsg();
        if (util.check_uin_account(str).booleanValue()) {
            parseLong = Long.parseLong(str);
        } else {
            parseLong = a4.b(str);
            if (parseLong == 0) {
                z = false;
                if (z) {
                    a4.f = parseLong;
                    wUserSigInfo.uin = parseLong + "";
                }
                z2 = z;
                a2 = new o(a4).a(bArr, this.mMiscBitmap, this.mSubSigMap, b2._sub_appid_list, wUserSigInfo);
                if (a2 == 204) {
                    a2 = new q(a4).a(this.mMiscBitmap, this.mSubSigMap, b2._sub_appid_list, wUserSigInfo);
                }
                i2 = a2;
                if (i2 != 0 || i2 == 160) {
                    if (util.check_uin_account(str).booleanValue()) {
                        parseLong2 = a4.b(str);
                    } else {
                        parseLong2 = Long.parseLong(str);
                    }
                    z2 = true;
                    if (b2._msalt == 0 || z2) {
                        a4.f = parseLong2;
                        wUserSigInfo.uin = parseLong2 + "";
                        if (i2 != 160) {
                            if (wUserSigInfo._reserveData == null || wUserSigInfo._reserveData.length <= 3) {
                                i3 = 0;
                                a4.i = 0;
                            } else {
                                i3 = 0;
                                a4.i = util.buf_to_int32(wUserSigInfo._reserveData, 0);
                                util.LOGI("MSF SSO SEQ:" + a4.i, str);
                            }
                            WloginSigInfo a5 = a4.a(parseLong2, b2._appid);
                            if (a5 != null) {
                                wUserSigInfo.get_clone(a5);
                                if (b2._sub_appid_list != null && bArr2 != null && b2._sub_appid_list.length * 2 == bArr2.length) {
                                    for (int i7 = 0; b2._sub_appid_list != null && i7 < b2._sub_appid_list.length; i7++) {
                                        WloginSigInfo a6 = a4.a(parseLong2, b2._sub_appid_list[i7]);
                                        if (a6 != null) {
                                            int i8 = i7 * 2;
                                            bArr2[i8] = (byte[]) a6._userSt_Key.clone();
                                            bArr2[i8 + 1] = (byte[]) a6._userStSig.clone();
                                        }
                                    }
                                }
                                str2 = "user:";
                                str3 = "";
                                async_contextVar = b2;
                            } else {
                                byte[] bArr3 = (wUserSigInfo._in_ksid == null || wUserSigInfo._in_ksid.length <= 0) ? t.aa : (byte[]) wUserSigInfo._in_ksid.clone();
                                if (b2._tmp_pwd_type != 0) {
                                    l lVar = new l(a4, this.mContext);
                                    lVar.g();
                                    str2 = "user:";
                                    a3 = lVar.a(b2._appid, b2._sub_appid, a4.f, 0, t.ad, b2._tmp_pwd, null, this.mMiscBitmap, this.mSubSigMap, b2._sub_appid_list, b2._main_sigmap, b2._sub_appid, t.y, 0, 0, 1, bArr3, wUserSigInfo);
                                    async_contextVar = b2;
                                    i4 = 204;
                                    str3 = "";
                                } else {
                                    str2 = "user:";
                                    byte[] bArr4 = new byte[4];
                                    util.int64_to_buf32(bArr4, i3, (System.currentTimeMillis() / 1000) + t.ac);
                                    int i9 = b2._isSmslogin ? 3 : 1;
                                    l lVar2 = new l(a4, this.mContext);
                                    lVar2.g();
                                    async_contextVar = b2;
                                    str3 = "";
                                    a3 = lVar2.a(b2._appid, b2._sub_appid, a4.f, 0, t.ad, bArr4, async_contextVar._tmp_pwd, i9, this.mMiscBitmap, this.mSubSigMap, async_contextVar._sub_appid_list, async_contextVar._main_sigmap, async_contextVar._sub_appid, t.y, 0, 0, 1, bArr3, wUserSigInfo);
                                    i4 = 204;
                                }
                                if (a3 == i4) {
                                    a3 = new q(a4).a(this.mMiscBitmap, this.mSubSigMap, async_contextVar._sub_appid_list, wUserSigInfo);
                                }
                                if (a3 == 0 || a3 == 160) {
                                    long b3 = a4.b(str);
                                    wUserSigInfo.uin = b3 + str3;
                                    if (a3 != 160) {
                                        WloginSigInfo a7 = a4.a(b3, async_contextVar._appid);
                                        if (a7 == null) {
                                            i5 = -1004;
                                        } else {
                                            wUserSigInfo.get_clone(a7);
                                            if (async_contextVar._sub_appid_list != null && bArr2 != null && async_contextVar._sub_appid_list.length * 2 == bArr2.length) {
                                                for (int i10 = 0; async_contextVar._sub_appid_list != null && i10 < async_contextVar._sub_appid_list.length; i10++) {
                                                    WloginSigInfo a8 = a4.a(b3, async_contextVar._sub_appid_list[i10]);
                                                    if (a8 != null) {
                                                        int i11 = i10 * 2;
                                                        bArr2[i11] = (byte[]) a8._userSt_Key.clone();
                                                        bArr2[i11 + 1] = (byte[]) a8._userStSig.clone();
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                                i5 = a3;
                            }
                            i5 = 0;
                        }
                    } else {
                        str2 = "user:";
                        str3 = "";
                        async_contextVar = b2;
                        i5 = -1003;
                    }
                    GetUserSigInfoTicket = GetUserSigInfoTicket(wUserSigInfo, 128);
                    if (GetUserSigInfoTicket == null) {
                        GetUserSigInfoTicket = new Ticket();
                    }
                    ticket = GetUserSigInfoTicket;
                    t.an.commit_t2(a4.f, a4.g, util.format_ret_code(i5), i5);
                    if (i5 == 0) {
                        if (ticket._sig == null || ticket._sig.length == 0) {
                            str4 = str2;
                            async_contextVar2 = async_contextVar;
                            str5 = str3;
                            i6 = i5;
                        } else {
                            i6 = i5;
                            str5 = str3;
                            async_contextVar2 = async_contextVar;
                            str4 = str2;
                            RequestReport(0, ticket._sig, ticket._sig_key, a4.f, async_contextVar._appid);
                        }
                        tVar = a4;
                    } else {
                        str4 = str2;
                        async_contextVar2 = async_contextVar;
                        str5 = str3;
                        i6 = i5;
                        tVar = a4;
                        RequestReportError(0, ticket._sig, ticket._sig_key, a4.f, async_contextVar2._appid, 0);
                    }
                    if (tVar.f85594d != null && tVar.f85594d.get_bitmap() != 0) {
                        this.mG.f85594d = tVar.f85594d;
                        RequestReportError(0, ticket._sig, ticket._sig_key, tVar.f, async_contextVar2._appid, 1);
                    }
                    t.b();
                    tVar.h();
                    StringBuilder sb = new StringBuilder();
                    sb.append(str4);
                    sb.append(str);
                    sb.append(" CheckPictureAndGetSt Seq:");
                    sb.append(tVar.h);
                    sb.append(" ret=");
                    int i12 = i6;
                    sb.append(i12);
                    util.LOGI(sb.toString(), str5 + tVar.f);
                    return i12;
                }
                i5 = i2;
                str2 = "user:";
                str3 = "";
                async_contextVar = b2;
                GetUserSigInfoTicket = GetUserSigInfoTicket(wUserSigInfo, 128);
                if (GetUserSigInfoTicket == null) {
                }
                ticket = GetUserSigInfoTicket;
                t.an.commit_t2(a4.f, a4.g, util.format_ret_code(i5), i5);
                if (i5 == 0) {
                }
                if (tVar.f85594d != null) {
                    this.mG.f85594d = tVar.f85594d;
                    RequestReportError(0, ticket._sig, ticket._sig_key, tVar.f, async_contextVar2._appid, 1);
                }
                t.b();
                tVar.h();
                StringBuilder sb2 = new StringBuilder();
                sb2.append(str4);
                sb2.append(str);
                sb2.append(" CheckPictureAndGetSt Seq:");
                sb2.append(tVar.h);
                sb2.append(" ret=");
                int i122 = i6;
                sb2.append(i122);
                util.LOGI(sb2.toString(), str5 + tVar.f);
                return i122;
            }
        }
        z = true;
        if (z) {
        }
        z2 = z;
        a2 = new o(a4).a(bArr, this.mMiscBitmap, this.mSubSigMap, b2._sub_appid_list, wUserSigInfo);
        if (a2 == 204) {
        }
        i2 = a2;
        if (i2 != 0) {
        }
        if (util.check_uin_account(str).booleanValue()) {
        }
        z2 = true;
        if (b2._msalt == 0) {
        }
        a4.f = parseLong2;
        wUserSigInfo.uin = parseLong2 + "";
        if (i2 != 160) {
        }
        i5 = i2;
        str2 = "user:";
        str3 = "";
        async_contextVar = b2;
        GetUserSigInfoTicket = GetUserSigInfoTicket(wUserSigInfo, 128);
        if (GetUserSigInfoTicket == null) {
        }
        ticket = GetUserSigInfoTicket;
        t.an.commit_t2(a4.f, a4.g, util.format_ret_code(i5), i5);
        if (i5 == 0) {
        }
        if (tVar.f85594d != null) {
        }
        t.b();
        tVar.h();
        StringBuilder sb22 = new StringBuilder();
        sb22.append(str4);
        sb22.append(str);
        sb22.append(" CheckPictureAndGetSt Seq:");
        sb22.append(tVar.h);
        sb22.append(" ret=");
        int i1222 = i6;
        sb22.append(i1222);
        util.LOGI(sb22.toString(), str5 + tVar.f);
        return i1222;
    }

    public int CheckSMSAndGetSt(String str, byte[] bArr, WUserSigInfo wUserSigInfo, byte[][] bArr2, int i) {
        long parseLong;
        int i2;
        Ticket GetUserSigInfoTicket;
        String str2;
        Ticket ticket;
        if (str == null || bArr == null || wUserSigInfo == null) {
            return -1017;
        }
        if (i == 0) {
            new HelperThread(this, this.mHelperHandler, str, bArr, wUserSigInfo, bArr2, "CheckSMSAndGetSt").RunReq(4);
            return -1001;
        }
        if (wUserSigInfo._seqence == 0) {
            wUserSigInfo._seqence = this.mAysncSeq;
        }
        t a2 = this.mG.a(wUserSigInfo._seqence);
        wUserSigInfo._seqence = a2.h;
        async_context b2 = t.b(wUserSigInfo._seqence);
        util.LOGI("user:" + str + " CheckSMSAndGetSt Seq:" + a2.h + " ...", str);
        a2.g = str;
        a2.f = 0L;
        b2._last_err_msg = new ErrMsg();
        if (wUserSigInfo._reserveData == null || wUserSigInfo._reserveData.length <= 3) {
            a2.i = 0;
        } else {
            a2.i = util.buf_to_int32(wUserSigInfo._reserveData, 0);
            util.LOGI("MSF SSO SEQ:" + a2.i, str);
        }
        if (util.check_uin_account(str).booleanValue()) {
            parseLong = Long.parseLong(str);
        } else {
            parseLong = a2.b(str);
            if (parseLong == 0) {
                util.LOGI("user:" + str + " have not found uin record.", str);
                i2 = -1003;
                GetUserSigInfoTicket = GetUserSigInfoTicket(wUserSigInfo, 128);
                if (GetUserSigInfoTicket == null) {
                    GetUserSigInfoTicket = new Ticket();
                }
                Ticket ticket2 = GetUserSigInfoTicket;
                t.an.commit_t2(a2.f, a2.g, util.format_ret_code(i2), i2);
                if (i2 != 0) {
                    if (ticket2._sig != null && ticket2._sig.length != 0) {
                        RequestReport(0, ticket2._sig, ticket2._sig_key, a2.f, b2._appid);
                    }
                    str2 = "";
                    ticket = ticket2;
                } else {
                    str2 = "";
                    ticket = ticket2;
                    RequestReportError(0, ticket2._sig, ticket2._sig_key, a2.f, b2._appid, 0);
                }
                if (a2.f85594d != null && a2.f85594d.get_bitmap() != 0) {
                    this.mG.f85594d = a2.f85594d;
                    RequestReportError(0, ticket._sig, ticket._sig_key, a2.f, b2._appid, 1);
                }
                t.b();
                a2.h();
                util.LOGI("user:" + str + " CheckSMSAndGetSt Seq:" + a2.h + " ret=" + i2, str2 + a2.f);
                return i2;
            }
        }
        long j = parseLong;
        a2.f = j;
        wUserSigInfo.uin = j + "";
        int a3 = new p(a2).a(bArr, this.mMiscBitmap, this.mSubSigMap, b2._sub_appid_list, wUserSigInfo);
        if (a3 != 0) {
            i2 = a3;
        } else {
            WloginSigInfo a4 = a2.a(j, b2._appid);
            if (a4 == null) {
                i2 = -1004;
            } else {
                wUserSigInfo.get_clone(a4);
                if (b2._sub_appid_list != null && bArr2 != null && b2._sub_appid_list.length * 2 == bArr2.length) {
                    for (int i3 = 0; b2._sub_appid_list != null && i3 < b2._sub_appid_list.length; i3++) {
                        WloginSigInfo a5 = a2.a(j, b2._sub_appid_list[i3]);
                        if (a5 != null) {
                            int i4 = i3 * 2;
                            bArr2[i4] = (byte[]) a5._userSt_Key.clone();
                            bArr2[i4 + 1] = (byte[]) a5._userStSig.clone();
                        }
                    }
                }
                i2 = 0;
            }
        }
        GetUserSigInfoTicket = GetUserSigInfoTicket(wUserSigInfo, 128);
        if (GetUserSigInfoTicket == null) {
        }
        Ticket ticket22 = GetUserSigInfoTicket;
        t.an.commit_t2(a2.f, a2.g, util.format_ret_code(i2), i2);
        if (i2 != 0) {
        }
        if (a2.f85594d != null) {
            this.mG.f85594d = a2.f85594d;
            RequestReportError(0, ticket._sig, ticket._sig_key, a2.f, b2._appid, 1);
        }
        t.b();
        a2.h();
        util.LOGI("user:" + str + " CheckSMSAndGetSt Seq:" + a2.h + " ret=" + i2, str2 + a2.f);
        return i2;
    }

    public int CheckSMSVerifyLoginAccount(long j, long j2, String str, WUserSigInfo wUserSigInfo, int i) {
        oicq.wlogin_sdk.a.h.x = false;
        oicq.wlogin_sdk.a.h.y = 0L;
        if (str == null || wUserSigInfo == null) {
            return -1017;
        }
        if (i == 0) {
            new HelperThread(this, this.mHelperHandler, j, j2, str, wUserSigInfo, "CheckSMSVerifyLoginAccount").RunReq(12);
            return -1001;
        }
        t a2 = this.mG.a(0L);
        wUserSigInfo._seqence = a2.h;
        this.mAysncSeq = a2.h;
        async_context b2 = t.b(a2.h);
        a2.g = str;
        util.LOGI("user:" + str + " Seq:" + a2.h + " CheckSMSVerifyLoginAccount ...", str);
        b2._login_bitmap = wUserSigInfo._login_bitmap;
        b2._last_err_msg = new ErrMsg();
        int a3 = new v(a2).a(j, j2, this.mMainSigMap, t.aa, str, this.mMiscBitmap, this.mSubSigMap, (long[]) null, wUserSigInfo);
        int i2 = a3 != 208 ? a3 : 0;
        StringBuilder sb = new StringBuilder();
        sb.append("user:");
        sb.append(a2.g);
        sb.append(" Seq:");
        sb.append(a2.h);
        sb.append(" CheckSMSVerifyLoginAccount ret=");
        sb.append(i2 > 0 ? Integer.toHexString(i2) : Integer.valueOf(i2));
        util.LOGI(sb.toString(), str);
        return i2;
    }

    private WloginSigInfo FindUserSig(long j, long j2) {
        return this.mG.a(j, j2);
    }

    private byte[] GetA1ByAccount(String str, long j) {
        long parseLong;
        WloginSigInfo a2;
        if (str == null) {
            return null;
        }
        if (util.check_uin_account(str).booleanValue()) {
            parseLong = Long.parseLong(str);
        } else {
            parseLong = this.mG.b(str);
            if (parseLong == 0) {
                a2 = null;
                if (a2 != null || a2._en_A1 == null || a2._en_A1.length <= 0) {
                    util.LOGI("userAccount:" + str + " dwAppid:" + j + " GetA1ByAccount return: null", str);
                    return null;
                }
                util.LOGI("userAccount:" + str + " dwAppid:" + j + " GetA1ByAccount return: not null", str);
                return (byte[]) a2._en_A1.clone();
            }
        }
        a2 = this.mG.a(parseLong, j);
        if (a2 != null) {
        }
        util.LOGI("userAccount:" + str + " dwAppid:" + j + " GetA1ByAccount return: null", str);
        return null;
    }

    public int GetA1WithA1(String str, long j, long j2, int i, byte[] bArr, long j3, long j4, long j5, byte[] bArr2, byte[] bArr3, WUserSigInfo wUserSigInfo, WFastLoginInfo wFastLoginInfo, int i2) {
        long parseLong;
        byte[] bArr4;
        WUserSigInfo wUserSigInfo2;
        String str2;
        String str3;
        String str4;
        int i3;
        Ticket GetUserSigInfoTicket;
        String str5;
        String str6;
        int i4;
        long j6;
        String str7;
        String str8;
        int i5;
        String str9;
        WtloginHelper wtloginHelper;
        Ticket ticket;
        t tVar;
        t tVar2;
        if (str == null || bArr == null || bArr2 == null || bArr3 == null || wUserSigInfo == null || wFastLoginInfo == null) {
            return -1017;
        }
        int i6 = i | 192;
        if (i2 == 0) {
            new HelperThread(this, this.mHelperHandler, str, j, j2, i6, bArr, j3, j4, j5, bArr2, bArr3, wUserSigInfo, wFastLoginInfo, "GetA1WithA1").RunReq(6);
            return -1001;
        }
        t a2 = this.mG.a(0L);
        wUserSigInfo._seqence = a2.h;
        async_context b2 = t.b(a2.h);
        util.LOGI("wtlogin login with GetA1WithA1:" + str + " dwSrcAppid:" + j + " dwMainSigMap:" + i6 + " dwSubSrcAppid:" + j2 + " dstAppName:" + new String(bArr) + " dwDstAppid:" + j4 + " dwSubDstAppid:" + j5 + " Seq:" + a2.h + " ...", str);
        int i7 = util.get_saved_network_type(this.mContext);
        t.D = util.get_network_type(this.mContext);
        if (i7 != t.D) {
            util.set_net_retry_type(this.mContext, 0);
            util.save_network_type(this.mContext, t.D);
        }
        t.F = util.get_apn_string(this.mContext).getBytes();
        a2.g = str;
        a2.f = 0L;
        b2._sappid = j;
        b2._appid = j;
        b2._sub_appid = j2;
        b2._main_sigmap = i6;
        b2._last_err_msg = new ErrMsg();
        t.an.add_t2(new report_t2("login", new String(t.C), System.currentTimeMillis(), j4, j5, null));
        if (util.check_uin_account(str).booleanValue()) {
            parseLong = Long.parseLong(str);
        } else {
            parseLong = a2.b(str);
            if (parseLong == 0) {
                util.LOGI("user:" + str + " have not found uin record.", str);
                bArr4 = bArr;
                wUserSigInfo2 = wUserSigInfo;
                str2 = " dwSubSrcAppid:";
                str3 = " dwSrcAppid:";
                str4 = " dwMainSigMap:";
                i3 = -1003;
                GetUserSigInfoTicket = GetUserSigInfoTicket(wUserSigInfo2, 128);
                if (GetUserSigInfoTicket == null) {
                    GetUserSigInfoTicket = new Ticket();
                }
                Ticket ticket2 = GetUserSigInfoTicket;
                t.an.commit_t2(a2.f, a2.g, util.format_ret_code(i3), i3);
                if (i3 == 0) {
                    str5 = "wtlogin login with GetA1WithA1:";
                    str6 = " dstAppName:";
                    i4 = i6;
                    j6 = j;
                    str7 = " dwDstAppid:";
                    str8 = " dwSubDstAppid:";
                    i5 = i3;
                    str9 = " Seq:";
                    wtloginHelper = this;
                    ticket = ticket2;
                    RequestReportError(0, ticket2._sig, ticket2._sig_key, a2.f, j, 0);
                    tVar = a2;
                } else if (ticket2._sig == null || ticket2._sig.length == 0) {
                    str5 = "wtlogin login with GetA1WithA1:";
                    str6 = " dstAppName:";
                    i4 = i6;
                    j6 = j;
                    str7 = " dwDstAppid:";
                    str8 = " dwSubDstAppid:";
                    wtloginHelper = this;
                    ticket = ticket2;
                    i5 = i3;
                    str9 = " Seq:";
                    tVar = a2;
                } else {
                    str5 = "wtlogin login with GetA1WithA1:";
                    str6 = " dstAppName:";
                    str7 = " dwDstAppid:";
                    str8 = " dwSubDstAppid:";
                    i4 = i6;
                    j6 = j;
                    RequestReport(0, ticket2._sig, ticket2._sig_key, a2.f, j);
                    i5 = i3;
                    str9 = " Seq:";
                    wtloginHelper = this;
                    ticket = ticket2;
                    tVar = a2;
                }
                if (tVar.f85594d != null || tVar.f85594d.get_bitmap() == 0) {
                    tVar2 = tVar;
                } else {
                    wtloginHelper.mG.f85594d = tVar.f85594d;
                    tVar2 = tVar;
                    RequestReportError(0, ticket._sig, ticket._sig_key, tVar.f, j, 1);
                }
                t.b();
                tVar2.h();
                StringBuilder sb = new StringBuilder();
                sb.append(str5);
                sb.append(str);
                sb.append(str3);
                sb.append(j6);
                sb.append(str4);
                sb.append(i4);
                sb.append(str2);
                sb.append(j2);
                sb.append(str6);
                sb.append(new String(bArr4));
                sb.append(str7);
                sb.append(j4);
                sb.append(str8);
                sb.append(j5);
                sb.append(str9);
                sb.append(tVar2.h);
                sb.append(" ret=");
                int i8 = i5;
                sb.append(i8);
                util.LOGI(sb.toString(), str);
                return i8;
            }
        }
        long j7 = parseLong;
        a2.f = j7;
        a2.j();
        byte[] GetA1ByAccount = GetA1ByAccount(str, j);
        byte[] GetNoPicSigByAccount = GetNoPicSigByAccount(str, j);
        if (GetA1ByAccount == null || GetA1ByAccount.length <= 0) {
            bArr4 = bArr;
            wUserSigInfo2 = wUserSigInfo;
            str2 = " dwSubSrcAppid:";
            str3 = " dwSrcAppid:";
            str4 = " dwMainSigMap:";
            util.LOGI("user:" + str + " have no a1 or pic_sig.", str);
            i3 = -1016;
        } else {
            util.LOGI("user:" + str + " login with A1 exchange A1.", str);
            str2 = " dwSubSrcAppid:";
            str4 = " dwMainSigMap:";
            str3 = " dwSrcAppid:";
            int a3 = new m(a2).a(j7, j, j2, 1, i6, GetA1ByAccount, GetNoPicSigByAccount, this.mMiscBitmap, this.mSubSigMap, (long[]) null, bArr, j3, j4, j5, bArr2, bArr3, wUserSigInfo);
            if (a3 != 0) {
                wUserSigInfo2 = wUserSigInfo;
            } else {
                WloginSigInfo a4 = a2.a(j7, j);
                if (a4 == null) {
                    wUserSigInfo2 = wUserSigInfo;
                    bArr4 = bArr;
                    i3 = -1004;
                } else {
                    wUserSigInfo2 = wUserSigInfo;
                    wUserSigInfo2.get_clone(a4);
                    wFastLoginInfo.get_clone(a2.j);
                }
            }
            bArr4 = bArr;
            i3 = a3;
        }
        GetUserSigInfoTicket = GetUserSigInfoTicket(wUserSigInfo2, 128);
        if (GetUserSigInfoTicket == null) {
        }
        Ticket ticket22 = GetUserSigInfoTicket;
        t.an.commit_t2(a2.f, a2.g, util.format_ret_code(i3), i3);
        if (i3 == 0) {
        }
        if (tVar.f85594d != null) {
        }
        tVar2 = tVar;
        t.b();
        tVar2.h();
        StringBuilder sb2 = new StringBuilder();
        sb2.append(str5);
        sb2.append(str);
        sb2.append(str3);
        sb2.append(j6);
        sb2.append(str4);
        sb2.append(i4);
        sb2.append(str2);
        sb2.append(j2);
        sb2.append(str6);
        sb2.append(new String(bArr4));
        sb2.append(str7);
        sb2.append(j4);
        sb2.append(str8);
        sb2.append(j5);
        sb2.append(str9);
        sb2.append(tVar2.h);
        sb2.append(" ret=");
        int i82 = i5;
        sb2.append(i82);
        util.LOGI(sb2.toString(), str);
        return i82;
    }

    private int GetFastLoginInfo(byte[] bArr, async_context async_contextVar) {
        String str;
        if (bArr == null || bArr.length <= 3 || async_contextVar == null) {
            return -1017;
        }
        tlv_t106 tlv_t106Var = new tlv_t106();
        tlv_t10c tlv_t10cVar = new tlv_t10c();
        tlv_t16a tlv_t16aVar = new tlv_t16a();
        tlv_t145 tlv_t145Var = new tlv_t145();
        int length = bArr.length;
        if (tlv_t106Var.get_tlv(bArr, 3, length) < 0) {
            str = "fast login info no tgtgt data";
        } else if (tlv_t10cVar.get_tlv(bArr, 3, length) < 0) {
            str = "fast login info no gtkey data";
        } else {
            if (tlv_t16aVar.get_tlv(bArr, 3, length) >= 0) {
                if (tlv_t145Var.get_tlv(bArr, 3, length) > 0) {
                    byte[] bArr2 = tlv_t145Var.get_data();
                    byte[] bArr3 = t.A;
                    util.LOGD("new guid:" + util.buf_to_string(bArr2) + " old guid:" + util.buf_to_string(bArr3));
                    if (!Arrays.equals(bArr2, bArr3)) {
                        util.LOGI("fast login info guid not equal", "");
                        util.saveGuidToFile(t.t, bArr2);
                        t.A = (byte[]) bArr2.clone();
                        t.B = (byte[]) bArr2.clone();
                    }
                }
                async_contextVar._tmp_pwd = oicq_request.b(tlv_t106Var.get_data(), tlv_t10cVar.get_data());
                async_contextVar._tmp_no_pic_sig = tlv_t16aVar.get_data();
                return 0;
            }
            str = "fast login info no nopicsig data";
        }
        util.LOGI(str, "");
        return -1017;
    }

    public static WFastLoginInfo GetFastLoginUrl(String str, long j) {
        StringBuilder sb;
        String str2;
        if (str != null) {
            try {
                if (str.length() != 0) {
                    util.LOGI("packageName:" + str + " uin:" + j, "");
                    if (j == 1689053018) {
                        sb = new StringBuilder();
                        sb.append("http://imgcache.qq.com/wtlogin");
                        str2 = "/test";
                    } else {
                        sb = new StringBuilder();
                        sb.append("http://imgcache.qq.com/wtlogin");
                        str2 = "/app";
                    }
                    sb.append(str2);
                    String sb2 = sb.toString();
                    for (String str3 : str.split("\\.")) {
                        sb2 = (sb2 + "/") + str3;
                    }
                    WFastLoginInfo wFastLoginInfo = new WFastLoginInfo();
                    wFastLoginInfo.iconUrl = sb2 + "/icon.png";
                    wFastLoginInfo.adUrl = sb2 + "/ad_img.png";
                    wFastLoginInfo.profileUrl = sb2 + "/profile.js";
                    return wFastLoginInfo;
                }
            } catch (Exception unused) {
            }
        }
        return null;
    }

    private byte[] GetNoPicSigByAccount(String str, long j) {
        long parseLong;
        WloginSigInfo a2;
        if (str == null) {
            return null;
        }
        if (util.check_uin_account(str).booleanValue()) {
            parseLong = Long.parseLong(str);
        } else {
            parseLong = this.mG.b(str);
            if (parseLong == 0) {
                a2 = null;
                if (a2 != null || a2._noPicSig == null || a2._noPicSig.length <= 0) {
                    util.LOGI("userAccount:" + str + " dwAppid:" + j + " GetNoPicSigByAccount return: null", str);
                    return null;
                }
                util.LOGI("userAccount:" + str + " dwAppid:" + j + " GetNoPicSigByAccount return: not null", str);
                return (byte[]) a2._noPicSig.clone();
            }
        }
        a2 = this.mG.a(parseLong, j);
        if (a2 != null) {
        }
        util.LOGI("userAccount:" + str + " dwAppid:" + j + " GetNoPicSigByAccount return: null", str);
        return null;
    }

    public int GetStWithPasswd(String str, long j, int i, long j2, long[] jArr, boolean z, String str2, WUserSigInfo wUserSigInfo, byte[][] bArr, boolean z2, int i2) {
        return 0;
    }

    public int GetStWithoutPasswd(String str, long j, long j2, long j3, int i, long j4, long[] jArr, WUserSigInfo wUserSigInfo, byte[][] bArr, byte[][] bArr2, int i2, WtTicketPromise wtTicketPromise) {
        long parseLong;
        String str2;
        long j5;
        long[] jArr2;
        int a2;
        long[] jArr3;
        int i3;
        Ticket GetUserSigInfoTicket;
        Ticket ticket;
        long j6;
        String str3;
        String str4;
        String str5;
        String str6;
        int i4;
        String str7;
        String str8;
        t tVar;
        WtloginHelper wtloginHelper;
        async_context async_contextVar;
        if (str == null || wUserSigInfo == null) {
            return -1017;
        }
        int i5 = i | 192;
        if (2 == j4) {
            i5 &= -33554433;
        }
        int i6 = i5;
        if (i2 == 0) {
            new HelperThread(this, this.mHelperHandler, wtTicketPromise, str, j, j2, j3, i6, j4, jArr, wUserSigInfo, bArr, bArr2, "GetStWithoutPasswd").RunReq(5);
            return -1001;
        }
        t a3 = this.mG.a(0L);
        wUserSigInfo._seqence = a3.h;
        async_context b2 = t.b(a3.h);
        util.LOGI("start GetStWithoutPasswd:user:" + str + " dwSrcAppid:" + j + " dwDstAppid:" + j2 + " dwDstAppPri:" + j3 + " dwMainSigMap:0x" + Integer.toHexString(i6) + " dwSubDstAppid:" + j4 + " Seq:" + a3.h, str);
        int i7 = util.get_saved_network_type(this.mContext);
        t.D = util.get_network_type(this.mContext);
        if (i7 != t.D) {
            util.set_net_retry_type(this.mContext, 0);
            util.save_network_type(this.mContext, t.D);
        }
        t.F = util.get_apn_string(this.mContext).getBytes();
        a3.g = str;
        a3.f = 0L;
        b2._sappid = j;
        b2._appid = j2;
        b2._sub_appid = j4;
        b2._main_sigmap = i6;
        b2._last_err_msg = new ErrMsg();
        if (jArr != null) {
            b2._sub_appid_list = (long[]) jArr.clone();
        }
        if (wUserSigInfo._reserveData == null || wUserSigInfo._reserveData.length <= 3) {
            a3.i = 0;
        } else {
            a3.i = util.buf_to_int32(wUserSigInfo._reserveData, 0);
            util.LOGI("MSF SSO SEQ:" + a3.i, str);
        }
        async_context async_contextVar2 = b2;
        t.an.add_t2(new report_t2("exchg", new String(t.C), System.currentTimeMillis(), j2, j4, jArr));
        if (util.check_uin_account(str).booleanValue()) {
            parseLong = Long.parseLong(str);
        } else {
            parseLong = a3.b(str);
            if (parseLong == 0) {
                util.LOGI("user:" + str + " have not found uin record.", str);
                str2 = "";
                i3 = -1003;
                GetUserSigInfoTicket = GetUserSigInfoTicket(wUserSigInfo, 128);
                if (GetUserSigInfoTicket == null) {
                    GetUserSigInfoTicket = new Ticket();
                }
                ticket = GetUserSigInfoTicket;
                t.an.commit_t2(a3.f, a3.g, util.format_ret_code(i3), i3);
                if (i3 == 0) {
                    j6 = j;
                    str3 = " dwSrcAppid:";
                    str4 = " dwDstAppid:";
                    str5 = " Seq:";
                    str6 = str2;
                    i4 = i3;
                    str7 = " dwMainSigMap:0x";
                    str8 = " dwSubDstAppid:";
                    async_context async_contextVar3 = async_contextVar2;
                    tVar = a3;
                    wtloginHelper = this;
                    async_contextVar = async_contextVar3;
                    RequestReportError(0, ticket._sig, ticket._sig_key, tVar.f, async_contextVar3._appid, 0);
                } else if (ticket._sig == null || ticket._sig.length == 0) {
                    j6 = j;
                    str3 = " dwSrcAppid:";
                    str4 = " dwDstAppid:";
                    str5 = " Seq:";
                    str6 = str2;
                    i4 = i3;
                    str7 = " dwMainSigMap:0x";
                    str8 = " dwSubDstAppid:";
                    tVar = a3;
                    wtloginHelper = this;
                    async_contextVar = async_contextVar2;
                } else {
                    async_context async_contextVar4 = async_contextVar2;
                    str4 = " dwDstAppid:";
                    str8 = " dwSubDstAppid:";
                    str3 = " dwSrcAppid:";
                    str5 = " Seq:";
                    str7 = " dwMainSigMap:0x";
                    j6 = j;
                    i4 = i3;
                    str6 = str2;
                    tVar = a3;
                    RequestReport(0, ticket._sig, ticket._sig_key, a3.f, async_contextVar4._appid);
                    wtloginHelper = this;
                    async_contextVar = async_contextVar4;
                }
                if (tVar.f85594d != null && tVar.f85594d.get_bitmap() != 0) {
                    wtloginHelper.mG.f85594d = tVar.f85594d;
                    RequestReportError(0, ticket._sig, ticket._sig_key, tVar.f, async_contextVar._appid, 1);
                }
                t.b();
                tVar.h();
                StringBuilder sb = new StringBuilder();
                sb.append("end GetStWithoutPasswd:user:");
                sb.append(str);
                sb.append(str3);
                sb.append(j6);
                sb.append(str4);
                sb.append(j2);
                sb.append(" dwDstAppPri:");
                sb.append(j3);
                sb.append(str7);
                sb.append(Integer.toHexString(i6));
                sb.append(str8);
                sb.append(j4);
                sb.append(str5);
                sb.append(tVar.h);
                sb.append(" ret=");
                int i8 = i4;
                sb.append(i8);
                util.LOGI(sb.toString(), str6 + tVar.f);
                return i8;
            }
        }
        long j7 = parseLong;
        a3.f = j7;
        wUserSigInfo.uin = "" + j7;
        if (bArr2 != null && bArr2.length == 4 && bArr2[0] != null && bArr2[0].length == 1 && bArr2[0][0] == 1) {
            util.LOGI("user:" + str + " exchange A2 from A2/D2/KEY.", "" + a3.f);
            if (bArr2[1] == null || bArr2[1].length == 0 || bArr2[2] == null || bArr2[2].length == 0 || bArr2[3] == null || bArr2[3].length == 0) {
                str2 = "";
                i3 = -1004;
            } else {
                a3.f85592b = MD5.toMD5Byte(bArr2[3]);
                jArr2 = jArr;
                a2 = new n(a3).a(j7, j2, j4, 1, i6, bArr2[1], this.mMiscBitmap, this.mSubSigMap, jArr, bArr2[2], wUserSigInfo);
                j5 = j7;
                str2 = "";
                if (a2 == 0) {
                }
                i3 = a2;
            }
        } else {
            if (bArr2 == null || bArr2.length != 3) {
                str2 = "";
            } else if (bArr2[0] != null && bArr2[0].length == 1 && bArr2[0][0] == 2) {
                util.LOGI("user:" + str + " exchange A2 from A2/A2KEY.", "" + a3.f);
                if (bArr2[1] == null || bArr2[1].length == 0 || bArr2[2] == null || bArr2[2].length == 0) {
                    str2 = "";
                    i3 = -1004;
                } else {
                    a3.f85592b = bArr2[2];
                    str2 = "";
                    jArr2 = jArr;
                    a2 = new n(a3).a(j7, j2, j4, 1, i6, bArr2[1], this.mMiscBitmap, this.mSubSigMap, jArr, null, wUserSigInfo);
                    j5 = j7;
                    if (a2 == 0) {
                        WloginSigInfo a4 = a3.a(j5, j2);
                        if (a4 != null) {
                            wUserSigInfo.get_clone(a4);
                            if (jArr2 != null && bArr != null && jArr2.length * 2 == bArr.length) {
                                int i9 = 0;
                                while (i9 < jArr2.length) {
                                    WloginSigInfo a5 = a3.a(j5, jArr2[i9]);
                                    if (a5 != null) {
                                        int i10 = i9 * 2;
                                        bArr[i10] = (byte[]) a5._userSt_Key.clone();
                                        bArr[i10 + 1] = (byte[]) a5._userStSig.clone();
                                    }
                                    i9++;
                                    jArr2 = jArr;
                                }
                            }
                        }
                        i3 = -1004;
                    }
                    i3 = a2;
                }
            } else {
                str2 = "";
            }
            a3.j();
            byte[] GetA1ByAccount = GetA1ByAccount(String.valueOf(a3.f), j);
            byte[] GetNoPicSigByAccount = GetNoPicSigByAccount(String.valueOf(a3.f), j);
            if (GetA1ByAccount == null || GetA1ByAccount.length <= 0 || GetNoPicSigByAccount == null || GetNoPicSigByAccount.length <= 0) {
                j5 = j7;
                util.LOGI("user:" + str + " exchange A2 from A2.", str2 + a3.f);
                WloginSigInfo a6 = a3.a(j5, j);
                if (a6 != null && a6._TGT != null && a6._TGT.length != 0 && !a6.iSExpireA2(t.f())) {
                    util.LOGI("user:" + str + " exchange A2 from A2 without Priority.", str2 + a3.f);
                    printTicket(a6);
                    a3.f85592b = a6._TGTKey;
                    jArr2 = jArr;
                    a2 = new n(a3).a(j5, j2, j4, 1, i6, a6._TGT, this.mMiscBitmap, this.mSubSigMap, jArr, null, wUserSigInfo);
                }
                i3 = -1004;
            } else {
                util.LOGI("user:" + str + " exchange A2 from A1.", str2 + a3.f);
                async_contextVar2._tmp_pwd = GetA1ByAccount;
                async_contextVar2._tmp_no_pic_sig = GetNoPicSigByAccount;
                byte[] bArr3 = (wUserSigInfo._in_ksid == null || wUserSigInfo._in_ksid.length <= 0) ? t.aa : (byte[]) wUserSigInfo._in_ksid.clone();
                y yVar = new y(a3, this.mContext);
                j5 = j7;
                WloginSigInfo FindUserSig = FindUserSig(j5, j);
                if (FindUserSig != null) {
                    yVar.a(FindUserSig);
                }
                async_contextVar2 = async_contextVar2;
                int a7 = yVar.a(j2, 1, a3.f, 0, t.ad, GetA1ByAccount, GetNoPicSigByAccount, this.mMiscBitmap, this.mSubSigMap, jArr, i6, j4, 1, t.y, 0, 0, 1, bArr3, j, wUserSigInfo);
                if (a7 == 204) {
                    jArr3 = jArr;
                    a7 = new q(a3).a(this.mMiscBitmap, this.mSubSigMap, jArr3, wUserSigInfo);
                } else {
                    jArr3 = jArr;
                }
                a2 = a7;
                jArr2 = jArr3;
            }
            if (a2 == 0) {
            }
            i3 = a2;
        }
        GetUserSigInfoTicket = GetUserSigInfoTicket(wUserSigInfo, 128);
        if (GetUserSigInfoTicket == null) {
        }
        ticket = GetUserSigInfoTicket;
        t.an.commit_t2(a3.f, a3.g, util.format_ret_code(i3), i3);
        if (i3 == 0) {
        }
        if (tVar.f85594d != null) {
            wtloginHelper.mG.f85594d = tVar.f85594d;
            RequestReportError(0, ticket._sig, ticket._sig_key, tVar.f, async_contextVar._appid, 1);
        }
        t.b();
        tVar.h();
        StringBuilder sb2 = new StringBuilder();
        sb2.append("end GetStWithoutPasswd:user:");
        sb2.append(str);
        sb2.append(str3);
        sb2.append(j6);
        sb2.append(str4);
        sb2.append(j2);
        sb2.append(" dwDstAppPri:");
        sb2.append(j3);
        sb2.append(str7);
        sb2.append(Integer.toHexString(i6));
        sb2.append(str8);
        sb2.append(j4);
        sb2.append(str5);
        sb2.append(tVar.h);
        sb2.append(" ret=");
        int i82 = i4;
        sb2.append(i82);
        util.LOGI(sb2.toString(), str6 + tVar.f);
        return i82;
    }

    private int GetStWithoutPasswd(String str, long j, long j2, long j3, int i, WUserSigInfo wUserSigInfo, WtTicketPromise wtTicketPromise) {
        byte[][] bArr = (byte[][]) null;
        return GetStWithoutPasswd(str, j, j2, -1L, i, j3, null, wUserSigInfo, bArr, bArr, 0, wtTicketPromise);
    }

    public static byte[] GetTicketSig(WUserSigInfo wUserSigInfo, int i) {
        Ticket GetUserSigInfoTicket = GetUserSigInfoTicket(wUserSigInfo, i);
        return GetUserSigInfoTicket != null ? GetUserSigInfoTicket._sig : new byte[0];
    }

    public static byte[] GetTicketSigKey(WUserSigInfo wUserSigInfo, int i) {
        if (i != 64 && i != 262144 && i != 128 && i != 16384 && i != 32768 && i != 16777216) {
            throw null;
        }
        Ticket GetUserSigInfoTicket = GetUserSigInfoTicket(wUserSigInfo, i);
        return GetUserSigInfoTicket != null ? GetUserSigInfoTicket._sig_key : new byte[0];
    }

    public static Ticket GetUserSigInfoTicket(WUserSigInfo wUserSigInfo, int i) {
        if (i == 4194304) {
            util.LOGI("get lhsig", "");
            return new Ticket(4194304, WloginSigInfo._LHSig, (byte[]) null, t.f(), 0L);
        }
        if (i == 67108864) {
            util.LOGI("get qrpushsig", "");
            return new Ticket(67108864, WloginSigInfo._QRPUSHSig, (byte[]) null, t.f(), 0L);
        }
        if (wUserSigInfo == null) {
            util.LOGI("userInfo is null " + Integer.toHexString(i), "");
            return null;
        }
        if (wUserSigInfo._tickets == null) {
            util.LOGI("tickets is null " + Integer.toHexString(i), wUserSigInfo.uin);
            return null;
        }
        util.LOGI("GetUserSigInfoTicket ticket type:0x" + Integer.toHexString(i), "");
        if (wUserSigInfo._tickets != null) {
            for (int i2 = 0; i2 < wUserSigInfo._tickets.size(); i2++) {
                Ticket ticket = wUserSigInfo._tickets.get(i2);
                if (ticket._type == i) {
                    util.LOGI("GetUserSigInfoTicket type:0x" + Integer.toHexString(i) + " sig:" + util.buf_len(ticket._sig) + " key:" + util.buf_len(ticket._sig_key) + " create time:" + ticket._create_time + " expire time:" + ticket._expire_time, "");
                    util.LOGI(ticket.getContent(), wUserSigInfo.uin);
                    return ticket;
                }
            }
        }
        return null;
    }

    public void OnDeviceLockRequest(String str, long j, long j2, TransReqContext transReqContext, WUserSigInfo wUserSigInfo, int i) {
        DevlockRst devlockRst = DevlockBase.rst;
        devlockRst.commRsp = new TLV_CommRsp();
        DevlockInfo devlockInfo = new DevlockInfo();
        ErrMsg errMsg = new ErrMsg(0, "", "", "");
        if (i != 0) {
            util.LOGI("OnDeviceLockRequest ret:" + i, str);
            errMsg.setMessage(util.get_error_msg(i));
            errMsg.setTitle(InternationMsg.a(InternationMsg.MSG_TYPE.MSG_5));
        }
        int i2 = transReqContext.get_subcmd();
        if (i2 == 5) {
            if (i == 0) {
                i = new oicq.wlogin_sdk.devicelock.a().parse_rsp(transReqContext.get_body());
                util.LOGI("CheckDevLockStatus ret:" + i, str);
                if (i != -1009) {
                    tlvCommRsp2ErrMsg(devlockRst.commRsp, errMsg);
                    if (devlockRst.devSetupInfo != null && devlockRst.devSetupInfo.get_data_len() > 0) {
                        devlockInfo.DevSetup = devlockRst.devSetupInfo.f85529a;
                        devlockInfo.AllowSet = devlockRst.devSetupInfo.f85530b;
                        devlockInfo.ProtectIntro = (devlockRst.devGuideInfo == null || devlockRst.devGuideInfo.get_data_len() <= 0) ? new String(devlockRst.devSetupInfo.f85532d) : new String(devlockRst.devGuideInfo.f85528a);
                        devlockInfo.WarningInfo = new String(devlockRst.devSetupInfo.g);
                        devlockInfo.WarningTitle = new String(devlockRst.devSetupInfo.e);
                        devlockInfo.WarningMsg = new String(devlockRst.devSetupInfo.f);
                        devlockInfo.WarningInfoType = devlockRst.devSetupInfo.f85531c;
                    }
                    if (devlockRst.mbMobileInfo != null && devlockRst.mbMobileInfo.get_data_len() > 0) {
                        devlockInfo.CountryCode = new String(devlockRst.mbMobileInfo.f85537a);
                        devlockInfo.Mobile = new String(devlockRst.mbMobileInfo.f85538b);
                        devlockInfo.MbItemSmsCodeStatus = devlockRst.mbMobileInfo.f85539c;
                        devlockInfo.AvailableMsgCount = devlockRst.mbMobileInfo.f85540d;
                        devlockInfo.TimeLimit = devlockRst.mbMobileInfo.e;
                    }
                    if (devlockRst.mbGuideInfo != null && devlockRst.mbGuideInfo.get_data_len() > 0) {
                        devlockInfo.MbGuideType = devlockRst.mbGuideInfo.f85535c;
                        devlockInfo.MbGuideInfoType = devlockRst.mbGuideInfo.f85536d;
                        devlockInfo.MbGuideInfo = new String(devlockRst.mbGuideInfo.f85534b);
                        devlockInfo.MbGuideMsg = new String(devlockRst.mbGuideInfo.f85533a);
                    }
                    if (devlockRst.transferInfo != null && devlockRst.transferInfo.get_data_len() > 0) {
                        devlockInfo.TransferInfo = devlockRst.transferInfo.get_data();
                    }
                }
            }
            WtloginListener wtloginListener = this.mListener;
            if (wtloginListener != null) {
                wtloginListener.OnCheckDevLockStatus(wUserSigInfo, devlockInfo, i, errMsg);
                return;
            }
            return;
        }
        if (i2 == 12) {
            if (i == 0) {
                i = new oicq.wlogin_sdk.devicelock.b().parse_rsp(transReqContext.get_body());
                util.LOGI("CloseDevLock ret:" + i, str);
                if (i != -1009) {
                    tlvCommRsp2ErrMsg(devlockRst.commRsp, errMsg);
                    try {
                        this.mG.b(!util.check_uin_account(str).booleanValue() ? this.mG.b(str) : Long.parseLong(str), j);
                        for (int i3 = 0; i3 < wUserSigInfo._tickets.size(); i3++) {
                            if (wUserSigInfo._tickets.get(i3)._type == 33554432) {
                                wUserSigInfo._tickets.remove(i3);
                            }
                        }
                    } catch (Exception e) {
                        util.printException(e);
                    }
                }
            }
            WtloginListener wtloginListener2 = this.mListener;
            if (wtloginListener2 != null) {
                wtloginListener2.OnCloseDevLock(wUserSigInfo, i, errMsg);
                return;
            }
            return;
        }
        if (i2 != 7) {
            if (i2 != 8) {
                return;
            }
            if (i == 0) {
                i = new oicq.wlogin_sdk.devicelock.f().parse_rsp(transReqContext.get_body());
                util.LOGI("CheckDevLockSms ret:" + i, str);
                if (i != -1009) {
                    tlvCommRsp2ErrMsg(devlockRst.commRsp, errMsg);
                }
            }
            WtloginListener wtloginListener3 = this.mListener;
            if (wtloginListener3 != null) {
                wtloginListener3.OnCheckDevLockSms(wUserSigInfo, i, errMsg);
                return;
            }
            return;
        }
        if (i == 0) {
            i = new oicq.wlogin_sdk.devicelock.d().parse_rsp(transReqContext.get_body());
            util.LOGI("AskDevLockSms ret:" + i, str);
            if (i != -1009) {
                tlvCommRsp2ErrMsg(devlockRst.commRsp, errMsg);
                if (devlockRst.smsInfo != null) {
                    devlockInfo.AvailableMsgCount = devlockRst.smsInfo.f85542a;
                    devlockInfo.TimeLimit = devlockRst.smsInfo.f85543b;
                }
            }
        }
        WtloginListener wtloginListener4 = this.mListener;
        if (wtloginListener4 != null) {
            wtloginListener4.OnAskDevLockSms(wUserSigInfo, devlockInfo, i, errMsg);
        }
    }

    public void OnRequestCode2d(String str, long j, long j2, TransReqContext transReqContext, WUserSigInfo wUserSigInfo, int i) {
        int i2 = i;
        if (this.mListener == null) {
            return;
        }
        oicq.wlogin_sdk.code2d.c cVar = oicq.wlogin_sdk.code2d.b._status;
        if (i2 != 0) {
            util.LOGI("OnRequestCode2d ret:" + i2, str);
        }
        int i3 = transReqContext.get_subcmd();
        if (i3 == 49) {
            if (i2 == 0) {
                int i4 = new fetch_code().get_response(transReqContext.get_body());
                util.LOGI("FetchCodeSig ret:" + cVar.f85518b, str);
                i2 = i4;
            }
            this.mListener.OnFetchCodeSig(cVar.j, cVar.k, cVar.l, wUserSigInfo, cVar.f, i2);
            return;
        }
        switch (i3) {
            case 18:
                if (i2 == 0) {
                    int a2 = new oicq.wlogin_sdk.code2d.d().a(transReqContext.get_body());
                    util.LOGI("QueryCodeResult ret:" + cVar.f85518b, str);
                    i2 = a2;
                }
                this.mListener.OnQueryCodeResult(cVar.f85517a, cVar.e, cVar.f85519c, wUserSigInfo, cVar.f, i2);
                return;
            case 19:
                if (i2 != 0) {
                    this.mListener.OnVerifyCode(str, cVar.f85520d, cVar.f85519c, cVar.e, wUserSigInfo, cVar.f, i);
                    return;
                }
                cVar.f85518b = new oicq.wlogin_sdk.code2d.e().a(transReqContext.get_body());
                util.LOGI("VerifyCode ret:" + cVar.f85518b, str);
                if (cVar.f85518b == 0 && cVar.g != null && cVar.g.length > 0) {
                    this.mG.a(cVar.f85517a, j, cVar.g);
                }
                this.mListener.OnVerifyCode(str, cVar.f85520d, cVar.f85519c, cVar.e, wUserSigInfo, cVar.f, cVar.f85518b);
                return;
            case 20:
                if (i2 != 0) {
                    this.mListener.OnCloseCode(str, cVar.f85520d, cVar.f85519c, wUserSigInfo, cVar.f, i);
                    return;
                }
                oicq.wlogin_sdk.code2d.a aVar = new oicq.wlogin_sdk.code2d.a();
                WUserSigInfo wUserSigInfo2 = wUserSigInfo == null ? new WUserSigInfo() : wUserSigInfo;
                cVar.f85518b = aVar.a(transReqContext.get_body(), j, t.t, wUserSigInfo2.loginTLVMap);
                util.LOGI("CloseCode ret:" + cVar.f85518b, str);
                oicq.wlogin_sdk.code2d.c.t = false;
                this.mListener.OnCloseCode(str, cVar.f85520d, cVar.f85519c, wUserSigInfo2, cVar.f, cVar.f85518b);
                return;
            default:
                util.LOGW("OnRequestName unhandle cmd", "", str);
                this.mListener.OnException(new ErrMsg(), 9, wUserSigInfo);
                return;
        }
    }

    public void OnRequestRegister(String str, long j, long j2, TransReqContext transReqContext, WUserSigInfo wUserSigInfo, int i) {
        WtloginListener wtloginListener;
        String str2;
        WtloginListener wtloginListener2;
        WtloginListener wtloginListener3;
        if (this.mListener == null) {
            return;
        }
        String a2 = InternationMsg.a(InternationMsg.MSG_TYPE.MSG_3);
        if (i != 0) {
            WtloginListener wtloginListener4 = this.mListener;
            if (wtloginListener4 != null) {
                wtloginListener4.OnRegError(wUserSigInfo, i, a2.getBytes());
                return;
            }
            return;
        }
        oicq.wlogin_sdk.a.h hVar = this.mRegStatus;
        int i2 = transReqContext.get_subcmd();
        if (i2 == 3) {
            int a3 = oicq.wlogin_sdk.a.a.a(3, transReqContext.get_body(), hVar);
            if (a3 != 0) {
                WtloginListener wtloginListener5 = this.mListener;
                if (wtloginListener5 != null) {
                    wtloginListener5.OnRegError(wUserSigInfo, a3, a2.getBytes());
                    return;
                }
                return;
            }
            util.LOGI("reg cmd:" + transReqContext.get_subcmd() + " ret:" + hVar.f85515d, "");
            if (hVar.f85515d == 0 || hVar.f85515d == 4 || hVar.f85515d == 31 || hVar.f85515d == 118) {
                if (hVar.f85515d == 0) {
                    wUserSigInfo.regTLVMap = hVar.B;
                    hVar.B = new HashMap<>();
                }
                this.mListener.OnRegQueryClientSentMsgStatus(wUserSigInfo, hVar.f85515d, hVar.s, hVar.t, new String(hVar.f));
                return;
            }
            if (hVar.f85515d == 3) {
                WtloginListener wtloginListener6 = this.mListener;
                if (wtloginListener6 != null) {
                    wtloginListener6.OnRegCheckValidUrl(wUserSigInfo, hVar.r);
                    return;
                }
                return;
            }
            util.LOGW("OnRequestRegister 0x3 return code:", String.valueOf(hVar.f85515d), str);
            WtloginListener wtloginListener7 = this.mListener;
            if (wtloginListener7 != null) {
                wtloginListener7.OnRegError(wUserSigInfo, hVar.f85515d, hVar.f);
                return;
            }
            return;
        }
        if (i2 == 4) {
            int a4 = oicq.wlogin_sdk.a.a.a(transReqContext.get_body(), hVar);
            if (a4 != 0) {
                WtloginListener wtloginListener8 = this.mListener;
                if (wtloginListener8 != null) {
                    wtloginListener8.OnRegError(wUserSigInfo, a4, a2.getBytes());
                    return;
                }
                return;
            }
            util.LOGI("reg cmd:" + transReqContext.get_subcmd() + " ret:" + hVar.f85515d, "");
            if (hVar.f85515d == 0) {
                wtloginListener = this.mListener;
                if (wtloginListener == null) {
                    return;
                }
            } else {
                if (hVar.f85515d == 3) {
                    WtloginListener wtloginListener9 = this.mListener;
                    if (wtloginListener9 != null) {
                        wtloginListener9.OnRegCheckValidUrl(wUserSigInfo, hVar.r);
                        return;
                    }
                    return;
                }
                if (hVar.f85515d != 5) {
                    util.LOGW("OnRequestRegister 0x4 return code:", String.valueOf(hVar.f85515d), str);
                    WtloginListener wtloginListener10 = this.mListener;
                    if (wtloginListener10 != null) {
                        wtloginListener10.OnRegError(wUserSigInfo, hVar.f85515d, hVar.f);
                        return;
                    }
                    return;
                }
                wtloginListener = this.mListener;
                if (wtloginListener == null) {
                    return;
                }
            }
            wtloginListener.OnRegRequestServerResendMsg(wUserSigInfo, hVar.f85515d, hVar.s, hVar.t);
            return;
        }
        if (i2 == 5) {
            int b2 = oicq.wlogin_sdk.a.a.b(transReqContext.get_body(), hVar);
            if (b2 != 0) {
                WtloginListener wtloginListener11 = this.mListener;
                if (wtloginListener11 != null) {
                    wtloginListener11.OnRegError(wUserSigInfo, b2, a2.getBytes());
                    return;
                }
                return;
            }
            wUserSigInfo.regTLVMap = hVar.B;
            hVar.B = new HashMap<>();
            util.LOGI("reg cmd:" + transReqContext.get_subcmd() + " ret:" + hVar.f85515d, "");
            WtloginListener wtloginListener12 = this.mListener;
            if (wtloginListener12 != null) {
                wtloginListener12.OnRegSubmitMsgChk(wUserSigInfo, hVar.f85515d, hVar.f);
                return;
            }
            return;
        }
        if (i2 == 6) {
            int c2 = oicq.wlogin_sdk.a.a.c(transReqContext.get_body(), hVar);
            if (c2 != 0) {
                WtloginListener wtloginListener13 = this.mListener;
                if (wtloginListener13 != null) {
                    wtloginListener13.OnRegError(wUserSigInfo, c2, a2.getBytes());
                    return;
                }
                return;
            }
            wUserSigInfo.regTLVMap = hVar.B;
            hVar.B = new HashMap<>();
            util.LOGI("reg cmd:" + transReqContext.get_subcmd() + " ret:" + hVar.f85515d, "");
            if (this.mListener != null) {
                if (hVar.f85513b != null && hVar.f85513b.indexOf(Constants.ACCEPT_TIME_SEPARATOR_SERVER) > 0) {
                    int indexOf = hVar.f85513b.indexOf(Constants.ACCEPT_TIME_SEPARATOR_SERVER);
                    String substring = hVar.f85513b.substring(0, indexOf);
                    if (substring.equals("86")) {
                        str2 = hVar.f85513b.substring(indexOf + 1);
                    } else {
                        str2 = "00" + substring + hVar.f85513b.substring(indexOf + 1);
                    }
                    hVar.f85513b = str2;
                }
                if (hVar.f85513b != null && hVar.f85513b.length() != 0) {
                    this.mG.d(hVar.f85513b);
                    this.mG.a(hVar.f85513b, Long.valueOf(hVar.u));
                }
                util.LOGI("reg userAccount: " + hVar.f85513b, hVar.u + "");
                if (oicq.wlogin_sdk.a.h.z.length() > 0) {
                    this.mListener.OnRegGetSMSVerifyLoginAccount(wUserSigInfo, hVar.f85515d, hVar.u, hVar.v, hVar.w, hVar.f);
                    return;
                } else {
                    this.mListener.OnRegGetAccount(wUserSigInfo, hVar.f85515d, hVar.u, hVar.v, hVar.w, hVar.f);
                    return;
                }
            }
            return;
        }
        if (i2 == 7) {
            int d2 = oicq.wlogin_sdk.a.a.d(transReqContext.get_body(), hVar);
            if (d2 != 0) {
                WtloginListener wtloginListener14 = this.mListener;
                if (wtloginListener14 != null) {
                    wtloginListener14.OnRegError(wUserSigInfo, d2, a2.getBytes());
                    return;
                }
                return;
            }
            util.LOGI("reg cmd:" + transReqContext.get_subcmd() + " ret:" + hVar.f85515d, "");
            WtloginListener wtloginListener15 = this.mListener;
            if (wtloginListener15 != null) {
                wtloginListener15.OnRegQueryAccount(wUserSigInfo, hVar.f85515d, hVar.f);
                return;
            }
            return;
        }
        if (i2 != 10) {
            if (i2 == 16) {
                int e = oicq.wlogin_sdk.a.a.e(transReqContext.get_body(), hVar);
                if (e != 0 && (wtloginListener2 = this.mListener) != null) {
                    wtloginListener2.OnRegError(wUserSigInfo, e, a2.getBytes());
                }
                util.LOGI("reg cmd:" + transReqContext.get_subcmd() + " ret:" + hVar.f85515d, "");
                this.mListener.OnQuickRegisterCheckAccount(wUserSigInfo, hVar.f85515d, hVar.f);
                return;
            }
            if (i2 != 17) {
                util.LOGW("OnRequestRegister unhandle cmd:" + transReqContext.get_subcmd(), "", str);
                WtloginListener wtloginListener16 = this.mListener;
                if (wtloginListener16 != null) {
                    wtloginListener16.OnRegError(wUserSigInfo, -1010, a2.getBytes());
                    return;
                }
                return;
            }
            int f = oicq.wlogin_sdk.a.a.f(transReqContext.get_body(), hVar);
            if (f != 0 && (wtloginListener3 = this.mListener) != null) {
                wtloginListener3.OnRegError(wUserSigInfo, f, a2.getBytes());
            }
            util.LOGI("reg cmd:" + transReqContext.get_subcmd() + " ret:" + hVar.f85515d, "");
            wUserSigInfo.regTLVMap = hVar.B;
            hVar.B = new HashMap<>();
            this.mListener.OnQuickRegisterGetAccount(wUserSigInfo, hVar.f85515d, hVar.f);
            return;
        }
        int a5 = oicq.wlogin_sdk.a.a.a(transReqContext.get_body(), hVar);
        if (a5 != 0) {
            WtloginListener wtloginListener17 = this.mListener;
            if (wtloginListener17 != null) {
                wtloginListener17.OnRegError(wUserSigInfo, a5, a2.getBytes());
                return;
            }
            return;
        }
        util.LOGI("reg cmd:" + transReqContext.get_subcmd() + " ret:" + hVar.f85515d, "");
        if (hVar.f85515d == 0) {
            WtloginListener wtloginListener18 = this.mListener;
            if (wtloginListener18 != null) {
                wtloginListener18.OnRegCheckDownloadMsg(wUserSigInfo, hVar.m, hVar.n);
                return;
            }
            return;
        }
        if (hVar.f85515d == 2) {
            WtloginListener wtloginListener19 = this.mListener;
            if (wtloginListener19 != null) {
                wtloginListener19.OnRegCheckUploadMsg(wUserSigInfo, new String(hVar.q));
                return;
            }
            return;
        }
        if (hVar.f85515d == 3) {
            WtloginListener wtloginListener20 = this.mListener;
            if (wtloginListener20 != null) {
                wtloginListener20.OnRegCheckValidUrl(wUserSigInfo, hVar.r);
                return;
            }
            return;
        }
        if (hVar.f85515d == 6 || hVar.f85515d == 44) {
            WtloginListener wtloginListener21 = this.mListener;
            if (wtloginListener21 != null) {
                wtloginListener21.OnRegCheckWebSig(wUserSigInfo, new String(hVar.r), new String(hVar.f));
            }
            hVar.r = new byte[0];
            return;
        }
        util.LOGW("OnRequestRegister 0xa return code:", String.valueOf(hVar.f85515d), str);
        WtloginListener wtloginListener22 = this.mListener;
        if (wtloginListener22 != null) {
            wtloginListener22.OnRegError(wUserSigInfo, hVar.f85515d, hVar.f);
        }
    }

    public int RefreshPictureData(String str, WUserSigInfo wUserSigInfo, int i) {
        long parseLong;
        boolean z;
        int a2;
        if (str == null || wUserSigInfo == null) {
            return -1017;
        }
        if (i == 0) {
            new HelperThread(this, this.mHelperHandler, str, wUserSigInfo, "RefreshPictureData").RunReq(1);
            return -1001;
        }
        if (wUserSigInfo._seqence == 0) {
            wUserSigInfo._seqence = this.mAysncSeq;
        }
        t a3 = this.mG.a(wUserSigInfo._seqence);
        wUserSigInfo._seqence = a3.h;
        async_context b2 = t.b(a3.h);
        util.LOGI("user:" + str + " Seq:" + a3.h + " RefreshPictureData ...", "" + str);
        a3.g = str;
        b2._last_err_msg = new ErrMsg();
        if (util.check_uin_account(str).booleanValue()) {
            parseLong = Long.parseLong(str);
        } else {
            parseLong = a3.b(str);
            if (parseLong == 0) {
                z = false;
                if (z) {
                    a3.f = parseLong;
                }
                a2 = new r(a3).a(this.mMiscBitmap, this.mSubSigMap, b2._sub_appid_list, wUserSigInfo);
                if (a2 == 2) {
                    a2 = 0;
                }
                util.LOGI("user:" + str + " Seq:" + a3.h + " RefreshPictureData ret=" + a2, "" + str);
                return a2;
            }
        }
        z = true;
        if (z) {
        }
        a2 = new r(a3).a(this.mMiscBitmap, this.mSubSigMap, b2._sub_appid_list, wUserSigInfo);
        if (a2 == 2) {
        }
        util.LOGI("user:" + str + " Seq:" + a3.h + " RefreshPictureData ret=" + a2, "" + str);
        return a2;
    }

    public int RefreshSMSData(String str, long j, WUserSigInfo wUserSigInfo, int i) {
        long parseLong;
        long j2;
        boolean z;
        int a2;
        if (str == null || wUserSigInfo == null) {
            return -1017;
        }
        if (i == 0) {
            new HelperThread(this, this.mHelperHandler, str, j, wUserSigInfo, "RefreshSMSData").RunReq(3);
            return -1001;
        }
        if (wUserSigInfo._seqence == 0) {
            wUserSigInfo._seqence = this.mAysncSeq;
        }
        t a3 = this.mG.a(wUserSigInfo._seqence);
        wUserSigInfo._seqence = a3.h;
        async_context b2 = t.b(a3.h);
        util.LOGI("user:" + str + " smsAppid:" + j + " Seq:" + a3.h + " RefreshSMSData ...", "" + str);
        a3.g = str;
        b2._last_err_msg = new ErrMsg();
        if (util.check_uin_account(str).booleanValue()) {
            parseLong = Long.parseLong(str);
        } else {
            parseLong = a3.b(str);
            if (parseLong == 0) {
                j2 = parseLong;
                z = false;
                if (z) {
                    a3.f = j2;
                }
                a2 = new s(a3).a(j, this.mMiscBitmap, this.mSubSigMap, b2._sub_appid_list, wUserSigInfo);
                if (a2 == 160) {
                    a2 = 0;
                }
                util.LOGI("user:" + str + " smsAppid:" + j + " Seq:" + a3.h + " RefreshSMSData ret=" + a2, "" + str);
                return a2;
            }
        }
        j2 = parseLong;
        z = true;
        if (z) {
        }
        a2 = new s(a3).a(j, this.mMiscBitmap, this.mSubSigMap, b2._sub_appid_list, wUserSigInfo);
        if (a2 == 160) {
        }
        util.LOGI("user:" + str + " smsAppid:" + j + " Seq:" + a3.h + " RefreshSMSData ret=" + a2, "" + str);
        return a2;
    }

    public int RefreshSMSVerifyLoginCode(String str, WUserSigInfo wUserSigInfo, int i) {
        if (str == null || str.length() == 0) {
            return -1017;
        }
        if (i == 0) {
            new HelperThread(this, this.mHelperHandler, str, wUserSigInfo, "RefreshSMSVerifyLoginCode").RunReq(14);
            return -1001;
        }
        if (wUserSigInfo._seqence == 0) {
            wUserSigInfo._seqence = this.mAysncSeq;
        }
        t a2 = this.mG.a(wUserSigInfo._seqence);
        wUserSigInfo._seqence = a2.h;
        async_context b2 = t.b(a2.h);
        util.LOGI("user:" + str + " Seq:" + a2.h + " RefreshSMSVerifyLoginCode ...", str);
        a2.g = str;
        b2._last_err_msg = new ErrMsg();
        int a3 = new w(a2).a(this.mMiscBitmap, this.mSubSigMap, (long[]) null, wUserSigInfo);
        StringBuilder sb = new StringBuilder();
        sb.append("user:");
        sb.append(a2.g);
        sb.append(" Seq:");
        sb.append(a2.h);
        sb.append(" RefreshSMSVerifyLoginCode ret=");
        sb.append(a3 > 0 ? Integer.toHexString(a3) : Integer.valueOf(a3));
        util.LOGI(sb.toString(), str);
        return a3;
    }

    private int RegSubmitMobile(byte[] bArr, byte[] bArr2, byte[] bArr3, byte[] bArr4, int i, int i2, int i3, long j, long j2, WUserSigInfo wUserSigInfo) {
        if (bArr2 == null || bArr2.length <= 0 || bArr4 == null) {
            return -1017;
        }
        byte[] bArr5 = bArr == null ? new byte[0] : bArr;
        byte[] bArr6 = t.E;
        long j3 = 0;
        byte[] bArr7 = new byte[0];
        WloginLastLoginInfo GetLastLoginInfo = GetLastLoginInfo();
        if (GetLastLoginInfo != null) {
            j3 = GetLastLoginInfo.mUin;
            Ticket GetLocalTicket = GetLocalTicket(GetLastLoginInfo.mAccount, j, 64);
            if (GetLocalTicket != null && GetLocalTicket._sig != null) {
                bArr7 = GetLocalTicket._sig;
            }
        }
        byte[] bArr8 = bArr7;
        long j4 = j3;
        util.LOGI("has uin? " + j4 + ", a2: " + bArr8.length);
        util.LOGI("RegSubmitMobile mobile ..." + new String(bArr2) + " appname: " + new String(bArr6) + "...", "");
        this.mRegStatus.f85514c = new String(bArr2);
        oicq.wlogin_sdk.a.f fVar = new oicq.wlogin_sdk.a.f();
        TransReqContext transReqContext = new TransReqContext();
        oicq.wlogin_sdk.a.h hVar = this.mRegStatus;
        hVar.k = bArr2;
        hVar.g = j;
        hVar.h = j2;
        transReqContext.set_register_req();
        transReqContext.set_subcmd(fVar.a());
        transReqContext._body = fVar.a(bArr2, bArr6, bArr4, i, i2, i3, j, j2, null, util.generateGuid(this.mContext), util.get_IMSI(this.mContext), t.aa, j4, bArr8, GetGuid(), bArr5, wUserSigInfo.extraRegTLVMap);
        return RequestTransport(0, 1, null, 0L, hVar.i, transReqContext, wUserSigInfo);
    }

    private int RequestInit() {
        int ShareKeyInit;
        oicq.wlogin_sdk.tools.d.a(this.mContext);
        synchronized (this) {
            int i = util.get_saved_network_type(this.mContext);
            t.d();
            ShareKeyInit = ShareKeyInit();
            AsyncGenRSAKey();
            util.LOGI("init ok ret:" + ShareKeyInit + " os ver:" + new String(t.J) + " saved_network_type:" + i + " network_type:" + t.D + " svn " + util.SVN_VER + " at " + t.l(), "");
        }
        return ShareKeyInit;
    }

    public int RequestReport(int i, byte[] bArr, byte[] bArr2, long j, long j2) {
        if (i == 0) {
            new HelperThread(this, this.mHelperHandler, bArr, bArr2, j, j2, "RequestReport").RunReq(7);
            return -1001;
        }
        t a2 = this.mG.a(0L);
        a2.f = j;
        util.LOGI("user:" + j + " appid:" + j2 + " Seq:" + a2.h + " RequestReport...", "" + j);
        int a3 = new z(a2).a(j, (byte[]) null, bArr, bArr2, j2, new WUserSigInfo());
        a2.i();
        util.LOGI("user:" + j + " appid:" + j2 + " Seq:" + a2.h + " RequestReport ret=" + a3, "" + j);
        return a3;
    }

    public int RequestReportError(int i, byte[] bArr, byte[] bArr2, long j, long j2, int i2) {
        if (i == 0) {
            new HelperThread(this, this.mHelperHandler, bArr, bArr2, j, j2, i2, "RequestReportError").RunReq(8);
            return -1001;
        }
        t a2 = this.mG.a(0L);
        a2.f85594d = this.mG.f85594d;
        a2.f = j;
        util.LOGI("user:" + j + " appid:" + j2 + " Seq:" + a2.h + " RequestReportError...", "" + j);
        int a3 = new u(a2).a(j, null, bArr, bArr2, j2, i2);
        util.LOGI("user:" + j + " appid:" + j2 + " Seq:" + a2.h + " RequestReportError ret=" + a3, "" + j);
        return a3;
    }

    private int ShareKeyInit() {
        util.LOGI("start ShareKeyInit", "");
        EcdhCrypt ecdhCrypt = new EcdhCrypt(this.mContext);
        if (this.isForLocal) {
            return ecdhCrypt.initShareKeyByDefault();
        }
        int initShareKey = ecdhCrypt.initShareKey();
        util.LOGI("end ShareKeyInit", "");
        this.mG.n = ecdhCrypt.get_c_pub_key();
        this.mG.p = ecdhCrypt.get_g_share_key();
        return initShareKey;
    }

    public int VerifySMSVerifyLoginCode(String str, String str2, WUserSigInfo wUserSigInfo, int i) {
        if (str == null || str.length() == 0 || str2 == null || str2.length() == 0) {
            return -1017;
        }
        if (i == 0) {
            new HelperThread(this, this.mHelperHandler, str, str2, wUserSigInfo, "VerifySMSVerifyLoginCode").RunReq(13);
            return -1001;
        }
        if (wUserSigInfo._seqence == 0) {
            wUserSigInfo._seqence = this.mAysncSeq;
        }
        t a2 = this.mG.a(wUserSigInfo._seqence);
        wUserSigInfo._seqence = a2.h;
        async_context b2 = t.b(a2.h);
        util.LOGI("user:" + a2.g + " code:" + str2 + " Seq:" + a2.h + " VerifySMSVerifyLoginCode ...", str);
        a2.g = str;
        b2._last_err_msg = new ErrMsg();
        b2._mpasswd = util.get_mpasswd();
        int a3 = new x(a2).a(str2, this.mMiscBitmap, this.mSubSigMap, null, wUserSigInfo);
        StringBuilder sb = new StringBuilder();
        sb.append("user:");
        sb.append(str);
        sb.append(" code:");
        sb.append(str2);
        sb.append(" Seq:");
        sb.append(a2.h);
        sb.append(" VerifySMSVerifyLoginAccount ret=");
        sb.append(a3 > 0 ? Integer.toHexString(a3) : Integer.valueOf(a3));
        util.LOGI(sb.toString(), str);
        return a3;
    }

    public static void customizeLogDir(String str) {
        t.at = str;
        util.LOGI("set log dir " + str, "");
    }

    public static String getLoginResultField(WUserSigInfo wUserSigInfo) {
        tlv_t tlv_tVar = wUserSigInfo.loginResultTLVMap.get(new Integer(1320));
        if (tlv_tVar == null) {
            util.LOGI("getLoginResultField get null", wUserSigInfo.uin);
            return "";
        }
        String str = new String(tlv_tVar.get_data());
        util.LOGI("getLoginResultField get str " + str, wUserSigInfo.uin);
        return str;
    }

    public static byte[] getLoginTlvValue(WUserSigInfo wUserSigInfo, int i) {
        tlv_t tlv_tVar = wUserSigInfo.loginTLVMap.get(new Integer(i));
        if (tlv_tVar != null) {
            return tlv_tVar.get_data();
        }
        return null;
    }

    public static byte[] getRegTlvValue(WUserSigInfo wUserSigInfo, int i) {
        tlv_t tlv_tVar = wUserSigInfo.regTLVMap.get(new Integer(i));
        if (tlv_tVar != null) {
            return tlv_tVar.get_data();
        }
        return null;
    }

    private int getStWithPtSig(String str, String str2, QuickLoginParam quickLoginParam) {
        return getStWithPtSig(str, str2, quickLoginParam, 0);
    }

    public int getStWithPtSig(String str, String str2, QuickLoginParam quickLoginParam, int i) {
        int i2;
        String str3;
        String str4;
        Ticket ticket;
        async_context async_contextVar;
        t tVar;
        if (i == 0) {
            new HelperThread(this, this.mHelperHandler, str, str2, quickLoginParam, "getStWithPtSig").RunReq(16);
            return -1001;
        }
        WUserSigInfo wUserSigInfo = quickLoginParam.userSigInfo;
        wUserSigInfo.uin = str;
        t a2 = this.mG.a(0L);
        a2.f = Long.parseLong(str);
        a2.g = quickLoginParam.userAccount;
        wUserSigInfo._seqence = a2.h;
        this.mAysncSeq = a2.h;
        async_context b2 = t.b(a2.h);
        util.LOGI("getStWithPtSig seq:" + a2.h, str);
        b2._last_err_msg = new ErrMsg();
        quickLoginParam.sigMap = quickLoginParam.sigMap | 192;
        b2._mpasswd = util.get_mpasswd();
        b2._msalt = util.constructSalt();
        b2._sappid = quickLoginParam.appid;
        b2._appid = quickLoginParam.appid;
        b2._sub_appid = quickLoginParam.subAppid;
        b2._main_sigmap = quickLoginParam.sigMap;
        b2._sub_appid_list = quickLoginParam.dstSubAppidList;
        int a3 = new c(a2, str2).a(this.mMiscBitmap, this.mSubSigMap, wUserSigInfo);
        if (a3 != 0) {
            util.LOGI("VerifyPTSig seq " + a2.h + " ret " + a3, str);
            return a3;
        }
        b2._tmp_pwd = MD5.toMD5Byte(b2._mpasswd.getBytes());
        l lVar = new l(a2, this.mContext);
        lVar.g();
        int a4 = lVar.a(quickLoginParam.appid, quickLoginParam.subAppid, a2.f, 0, t.ad, util.getRequestInitTime(), b2._tmp_pwd, 4, this.mMiscBitmap, this.mSubSigMap, quickLoginParam.dstSubAppidList, quickLoginParam.sigMap, quickLoginParam.subAppid, t.y, 0, 0, 1, t.aa, wUserSigInfo);
        if (a4 == 204) {
            a4 = new q(a2).a(this.mMiscBitmap, this.mSubSigMap, quickLoginParam.dstSubAppidList, wUserSigInfo);
        }
        int i3 = a4;
        if (i3 != 0) {
            util.LOGI("getStWithPtSig seq:" + a2.h + " ret:" + i3, str);
            return i3;
        }
        WloginSigInfo a5 = a2.a(a2.f, quickLoginParam.appid);
        if (a5 == null) {
            return -1004;
        }
        wUserSigInfo.get_clone(a5);
        if (quickLoginParam.dstSubAppidList != null) {
            wUserSigInfo.stList = new byte[quickLoginParam.dstSubAppidList.length * 2];
            for (int i4 = 0; i4 < quickLoginParam.dstSubAppidList.length; i4++) {
                WloginSigInfo a6 = a2.a(a2.f, quickLoginParam.dstSubAppidList[i4]);
                if (a6 != null) {
                    int i5 = i4 * 2;
                    wUserSigInfo.stList[i5] = (byte[]) a6._userSt_Key.clone();
                    wUserSigInfo.stList[i5 + 1] = (byte[]) a6._userStSig.clone();
                }
            }
        }
        Ticket GetUserSigInfoTicket = GetUserSigInfoTicket(wUserSigInfo, 128);
        if (GetUserSigInfoTicket == null) {
            GetUserSigInfoTicket = new Ticket();
        }
        Ticket ticket2 = GetUserSigInfoTicket;
        t.an.commit_t2(a2.f, a2.g, util.format_ret_code(i3), i3);
        if (i3 != 0) {
            i2 = i3;
            str3 = "getStWithPtSig seq:";
            str4 = " ret ";
            ticket = ticket2;
            async_contextVar = b2;
            if (i2 != 2 && i2 != 160) {
                tVar = a2;
                RequestReportError(0, ticket._sig, ticket._sig_key, a2.f, async_contextVar._appid, 0);
            }
            tVar = a2;
        } else if (ticket2._sig == null || ticket2._sig.length == 0) {
            str3 = "getStWithPtSig seq:";
            str4 = " ret ";
            ticket = ticket2;
            async_contextVar = b2;
            i2 = i3;
            tVar = a2;
        } else {
            str3 = "getStWithPtSig seq:";
            str4 = " ret ";
            ticket = ticket2;
            async_contextVar = b2;
            RequestReport(0, ticket2._sig, ticket2._sig_key, a2.f, b2._appid);
            tVar = a2;
            i2 = i3;
        }
        if (tVar.f85594d != null && tVar.f85594d.get_bitmap() != 0) {
            this.mG.f85594d = tVar.f85594d;
            RequestReportError(0, ticket._sig, ticket._sig_key, tVar.f, async_contextVar._appid, 1);
        }
        t.b();
        tVar.h();
        util.LOGI(str3 + tVar.h + str4 + i2, str);
        return i2;
    }

    private int getStWithQQSig(String str, QuickLoginParam quickLoginParam) {
        return getStWithQQSig(str, quickLoginParam, 0);
    }

    public int getStWithQQSig(String str, QuickLoginParam quickLoginParam, int i) {
        StringBuilder sb;
        int i2;
        String str2;
        String str3;
        Ticket ticket;
        async_context async_contextVar;
        int i3;
        t tVar;
        if (i == 0) {
            new HelperThread(this, this.mHelperHandler, str, quickLoginParam, "getStWithQQSig").RunReq(15);
            return -1001;
        }
        WUserSigInfo wUserSigInfo = quickLoginParam.userSigInfo;
        wUserSigInfo.uin = str;
        t a2 = this.mG.a(0L);
        wUserSigInfo._seqence = a2.h;
        this.mAysncSeq = a2.h;
        async_context b2 = t.b(a2.h);
        int i4 = util.get_saved_network_type(this.mContext);
        t.D = util.get_network_type(this.mContext);
        if (i4 != t.D) {
            util.set_net_retry_type(this.mContext, 0);
            util.save_network_type(this.mContext, t.D);
        }
        t.F = util.get_apn_string(this.mContext).getBytes();
        quickLoginParam.sigMap |= 192;
        a2.g = str;
        a2.f = Long.parseLong(str);
        b2._sappid = quickLoginParam.appid;
        b2._appid = quickLoginParam.appid;
        b2._sub_appid = quickLoginParam.subAppid;
        b2._main_sigmap = quickLoginParam.sigMap;
        b2._login_bitmap = wUserSigInfo._login_bitmap;
        b2._last_err_msg = new ErrMsg();
        if (quickLoginParam.dstSubAppidList != null) {
            b2._sub_appid_list = (long[]) quickLoginParam.dstSubAppidList.clone();
        } else {
            b2._sub_appid_list = null;
        }
        if (wUserSigInfo._reserveData == null || wUserSigInfo._reserveData.length <= 3) {
            a2.i = 0;
        } else {
            a2.i = util.buf_to_int32(wUserSigInfo._reserveData, 0);
            util.LOGI("MSF SSO SEQ:" + a2.i, str);
        }
        if (wUserSigInfo._fastLoginBuf == null || wUserSigInfo._fastLoginBuf.length == 0) {
            sb = new StringBuilder();
            sb.append("fast login buff is null seq:");
            i2 = a2.i;
        } else {
            if (GetFastLoginInfo(wUserSigInfo._fastLoginBuf, b2) >= 0) {
                l lVar = new l(a2, this.mContext);
                lVar.g();
                int a3 = lVar.a(quickLoginParam.appid, quickLoginParam.subAppid, a2.f, 0, t.ad, b2._tmp_pwd, b2._tmp_no_pic_sig, this.mMiscBitmap, this.mSubSigMap, quickLoginParam.dstSubAppidList, quickLoginParam.sigMap, quickLoginParam.subAppid, t.y, 0, 0, 1, t.aa, wUserSigInfo);
                if (a3 == 204) {
                    a3 = new q(a2).a(this.mMiscBitmap, this.mSubSigMap, quickLoginParam.dstSubAppidList, wUserSigInfo);
                }
                int i5 = a3;
                if (i5 != 0) {
                    util.LOGI("getStWithQQSig seq:" + a2.h + " ret:" + i5, str);
                    return i5;
                }
                WloginSigInfo a4 = a2.a(a2.f, quickLoginParam.appid);
                if (a4 == null) {
                    return -1004;
                }
                wUserSigInfo.get_clone(a4);
                if (quickLoginParam.dstSubAppidList != null) {
                    wUserSigInfo.stList = new byte[quickLoginParam.dstSubAppidList.length * 2];
                    for (int i6 = 0; i6 < quickLoginParam.dstSubAppidList.length; i6++) {
                        WloginSigInfo a5 = a2.a(a2.f, quickLoginParam.dstSubAppidList[i6]);
                        if (a5 != null) {
                            int i7 = i6 * 2;
                            wUserSigInfo.stList[i7] = (byte[]) a5._userSt_Key.clone();
                            wUserSigInfo.stList[i7 + 1] = (byte[]) a5._userStSig.clone();
                        }
                    }
                }
                Ticket GetUserSigInfoTicket = GetUserSigInfoTicket(wUserSigInfo, 128);
                if (GetUserSigInfoTicket == null) {
                    GetUserSigInfoTicket = new Ticket();
                }
                Ticket ticket2 = GetUserSigInfoTicket;
                t.an.commit_t2(a2.f, a2.g, util.format_ret_code(i5), i5);
                if (i5 != 0) {
                    str2 = "getStWithQQSig seq:";
                    str3 = " ret:";
                    ticket = ticket2;
                    async_contextVar = b2;
                    i3 = i5;
                    if (i3 != 2 && i3 != 160) {
                        tVar = a2;
                        RequestReportError(0, ticket._sig, ticket._sig_key, a2.f, async_contextVar._appid, 0);
                        if (tVar.f85594d != null && tVar.f85594d.get_bitmap() != 0) {
                            this.mG.f85594d = tVar.f85594d;
                            RequestReportError(0, ticket._sig, ticket._sig_key, tVar.f, async_contextVar._appid, 1);
                        }
                        t.b();
                        tVar.h();
                        util.LOGI(str2 + tVar.h + str3 + i3, str);
                        return i3;
                    }
                } else if (ticket2._sig == null || ticket2._sig.length == 0) {
                    str2 = "getStWithQQSig seq:";
                    str3 = " ret:";
                    ticket = ticket2;
                    async_contextVar = b2;
                    i3 = i5;
                } else {
                    str2 = "getStWithQQSig seq:";
                    str3 = " ret:";
                    ticket = ticket2;
                    async_contextVar = b2;
                    i3 = i5;
                    RequestReport(0, ticket2._sig, ticket2._sig_key, a2.f, b2._appid);
                }
                tVar = a2;
                if (tVar.f85594d != null) {
                    this.mG.f85594d = tVar.f85594d;
                    RequestReportError(0, ticket._sig, ticket._sig_key, tVar.f, async_contextVar._appid, 1);
                }
                t.b();
                tVar.h();
                util.LOGI(str2 + tVar.h + str3 + i3, str);
                return i3;
            }
            sb = new StringBuilder();
            sb.append("GetFastLoginInfo fast login buff is failed seq:");
            i2 = a2.i;
        }
        sb.append(i2);
        util.LOGI(sb.toString(), str);
        return -1017;
    }

    public int getStWithQrSig(String str, long j, long j2, int i, WUserSigInfo wUserSigInfo, int i2) {
        String str2;
        int i3;
        Ticket GetUserSigInfoTicket;
        String str3;
        String str4;
        Ticket ticket;
        t tVar;
        int i4;
        int i5;
        String str5;
        String str6;
        async_context async_contextVar;
        Ticket ticket2;
        async_context async_contextVar2;
        int i6;
        String str7;
        if (str == null || wUserSigInfo == null) {
            return -1017;
        }
        int i7 = i | 192;
        if (i2 == 0) {
            new HelperThread(this, this.mHelperHandler, str, j, i7, j2, wUserSigInfo, "getStWithQrSig").RunReq(17);
            return -1001;
        }
        t a2 = this.mG.a(0L);
        wUserSigInfo._seqence = a2.h;
        this.mAysncSeq = a2.h;
        oicq.wlogin_sdk.a.h.z = "";
        async_context b2 = t.b(a2.h);
        util.LOGI("start getStWithQrSig:user:" + str + " appid:" + j + " sigMap:0x" + Integer.toHexString(i7) + " subAppid:" + j2 + " Seq:" + a2.h, str);
        int i8 = util.get_saved_network_type(this.mContext);
        t.D = util.get_network_type(this.mContext);
        if (i8 != t.D) {
            util.set_net_retry_type(this.mContext, 0);
            util.save_network_type(this.mContext, t.D);
        }
        t.F = util.get_apn_string(this.mContext).getBytes();
        if (!util.check_uin_account(str).booleanValue()) {
            util.LOGI("userAccount " + str + " isn't valid", "");
            return -1017;
        }
        long parseLong = Long.parseLong(str);
        wUserSigInfo.uin = str;
        a2.g = str;
        a2.f = parseLong;
        b2._sappid = j;
        b2._appid = j;
        b2._sub_appid_list = null;
        b2._sub_appid = j2;
        b2._main_sigmap = i7;
        b2._login_bitmap = wUserSigInfo._login_bitmap;
        b2._last_err_msg = new ErrMsg();
        if (wUserSigInfo._reserveData != null) {
            str2 = " Seq:";
            if (wUserSigInfo._reserveData.length > 3) {
                a2.i = util.buf_to_int32(wUserSigInfo._reserveData, 0);
                util.LOGI("MSF SSO SEQ:" + a2.i, str);
                String str8 = "";
                t.an.add_t2(new report_t2("login", new String(t.C), System.currentTimeMillis(), j, j2, null));
                if (oicq.wlogin_sdk.code2d.c.q != null && oicq.wlogin_sdk.code2d.c.q.length > 0) {
                    b2._tmp_pwd = oicq.wlogin_sdk.code2d.c.q;
                    b2._tmp_no_pic_sig = oicq.wlogin_sdk.code2d.c.r;
                    if (b2._tmp_no_pic_sig != null || b2._tmp_no_pic_sig.length == 0) {
                        str7 = "no pic sig length is 0";
                    } else {
                        str7 = "no pic sig length " + b2._tmp_no_pic_sig.length;
                    }
                    util.LOGI(str7, str);
                    b2.tgtQR = oicq.wlogin_sdk.code2d.c.s;
                    oicq.wlogin_sdk.code2d.c.q = null;
                    oicq.wlogin_sdk.code2d.c.r = null;
                    oicq.wlogin_sdk.code2d.c.s = null;
                }
                if (b2._tmp_pwd != null || b2._tmp_pwd.length < 16) {
                    i3 = -1016;
                } else {
                    b2._tmp_pwd_type = 1;
                    byte[] bArr = (wUserSigInfo._in_ksid == null || wUserSigInfo._in_ksid.length <= 0) ? t.aa : (byte[]) wUserSigInfo._in_ksid.clone();
                    if (b2._tmp_pwd_type != 0) {
                        util.LOGI("user:" + str + " login with qrsig", str);
                        l lVar = new l(a2, this.mContext);
                        lVar.g();
                        i6 = lVar.a(j, j2, a2.f, 0, t.ad, b2._tmp_pwd, b2._tmp_no_pic_sig, this.mMiscBitmap, this.mSubSigMap, null, i7, j2, t.y, 0, 0, 1, bArr, wUserSigInfo);
                    } else {
                        i6 = 0;
                    }
                    if (i6 == 204) {
                        i6 = new q(a2).a(this.mMiscBitmap, this.mSubSigMap, (long[]) null, wUserSigInfo);
                    }
                    if (i6 == 0 || i6 == 160) {
                        WloginSigInfo a3 = a2.a(parseLong, j);
                        if (a3 == null) {
                            i3 = -1004;
                        } else {
                            wUserSigInfo.get_clone(a3);
                        }
                    }
                    i3 = i6;
                }
                GetUserSigInfoTicket = GetUserSigInfoTicket(wUserSigInfo, 128);
                if (GetUserSigInfoTicket == null) {
                    GetUserSigInfoTicket = new Ticket();
                }
                Ticket ticket3 = GetUserSigInfoTicket;
                t.an.commit_t2(a2.f, a2.g, util.format_ret_code(i3), i3);
                if (i3 == 0) {
                    str3 = " sigMap:0x";
                    str4 = " subAppid:";
                    ticket = ticket3;
                    tVar = a2;
                    i4 = i3;
                    i5 = i7;
                    str5 = str2;
                    str6 = " appid:";
                    async_contextVar = b2;
                    if (i4 == 2 || i4 == 160) {
                        str8 = str8;
                        ticket2 = ticket;
                        async_contextVar2 = async_contextVar;
                        if (tVar.f85594d != null) {
                        }
                        t.b();
                        tVar.h();
                        util.LOGI("end getStWithQrSig user:" + str + str6 + j + str3 + Integer.toHexString(i5) + str4 + j2 + str5 + tVar.h + " ret=" + i4, str8 + tVar.f);
                        return i4;
                    }
                    ticket2 = ticket;
                    str8 = str8;
                    async_contextVar2 = async_contextVar;
                    RequestReportError(0, ticket._sig, ticket._sig_key, tVar.f, async_contextVar._appid, 0);
                    if (tVar.f85594d != null) {
                    }
                    t.b();
                    tVar.h();
                    util.LOGI("end getStWithQrSig user:" + str + str6 + j + str3 + Integer.toHexString(i5) + str4 + j2 + str5 + tVar.h + " ret=" + i4, str8 + tVar.f);
                    return i4;
                }
                if (ticket3._sig == null || ticket3._sig.length == 0) {
                    str3 = " sigMap:0x";
                    str4 = " subAppid:";
                    tVar = a2;
                    i4 = i3;
                    i5 = i7;
                    str5 = str2;
                    str6 = " appid:";
                    async_contextVar2 = b2;
                    ticket2 = ticket3;
                    if (tVar.f85594d != null && tVar.f85594d.get_bitmap() != 0) {
                        this.mG.f85594d = tVar.f85594d;
                        Ticket ticket4 = ticket2;
                        RequestReportError(0, ticket4._sig, ticket4._sig_key, tVar.f, async_contextVar2._appid, 1);
                    }
                    t.b();
                    tVar.h();
                    util.LOGI("end getStWithQrSig user:" + str + str6 + j + str3 + Integer.toHexString(i5) + str4 + j2 + str5 + tVar.h + " ret=" + i4, str8 + tVar.f);
                    return i4;
                }
                str5 = str2;
                str4 = " subAppid:";
                str3 = " sigMap:0x";
                ticket = ticket3;
                i5 = i7;
                str6 = " appid:";
                async_contextVar = b2;
                tVar = a2;
                i4 = i3;
                RequestReport(0, ticket3._sig, ticket3._sig_key, a2.f, b2._appid);
                ticket2 = ticket;
                async_contextVar2 = async_contextVar;
                if (tVar.f85594d != null) {
                    this.mG.f85594d = tVar.f85594d;
                    Ticket ticket42 = ticket2;
                    RequestReportError(0, ticket42._sig, ticket42._sig_key, tVar.f, async_contextVar2._appid, 1);
                }
                t.b();
                tVar.h();
                util.LOGI("end getStWithQrSig user:" + str + str6 + j + str3 + Integer.toHexString(i5) + str4 + j2 + str5 + tVar.h + " ret=" + i4, str8 + tVar.f);
                return i4;
            }
        } else {
            str2 = " Seq:";
        }
        a2.i = 0;
        String str82 = "";
        t.an.add_t2(new report_t2("login", new String(t.C), System.currentTimeMillis(), j, j2, null));
        if (oicq.wlogin_sdk.code2d.c.q != null) {
            b2._tmp_pwd = oicq.wlogin_sdk.code2d.c.q;
            b2._tmp_no_pic_sig = oicq.wlogin_sdk.code2d.c.r;
            if (b2._tmp_no_pic_sig != null) {
            }
            str7 = "no pic sig length is 0";
            util.LOGI(str7, str);
            b2.tgtQR = oicq.wlogin_sdk.code2d.c.s;
            oicq.wlogin_sdk.code2d.c.q = null;
            oicq.wlogin_sdk.code2d.c.r = null;
            oicq.wlogin_sdk.code2d.c.s = null;
        }
        if (b2._tmp_pwd != null) {
        }
        i3 = -1016;
        GetUserSigInfoTicket = GetUserSigInfoTicket(wUserSigInfo, 128);
        if (GetUserSigInfoTicket == null) {
        }
        Ticket ticket32 = GetUserSigInfoTicket;
        t.an.commit_t2(a2.f, a2.g, util.format_ret_code(i3), i3);
        if (i3 == 0) {
        }
    }

    private int isPskeyExpired(int i, String[] strArr, Ticket ticket, long j, int i2) {
        String str;
        boolean z;
        boolean z2;
        int i3;
        if (i != 1048576 || strArr == null || strArr.length <= 0) {
            return 0;
        }
        int length = strArr.length;
        int i4 = 0;
        int i5 = 0;
        while (true) {
            boolean z3 = true;
            if (i4 >= length) {
                break;
            }
            String str2 = strArr[i4];
            if (str2 != null && str2.length() != 0) {
                int indexOf = str2.indexOf(40);
                int indexOf2 = str2.indexOf(41);
                if (indexOf != 0 || indexOf2 <= 0) {
                    str = str2;
                    z = false;
                    z2 = true;
                } else {
                    int intValue = Integer.valueOf(str2.substring(indexOf + 1, indexOf2)).intValue();
                    z2 = (intValue & 1048576) > 0;
                    z = (intValue & 134217728) > 0;
                    str = str2.substring(indexOf2 + 1);
                }
                boolean z4 = z2 && (ticket._pskey_map.get(str) == null || Ticket.isPskeyExpired(ticket._pskey_expire.get(str).longValue()));
                if (!z || (ticket._pt4token_map.get(str) != null && !Ticket.isPskeyExpired(ticket._pt4token_expire.get(str).longValue()))) {
                    z3 = false;
                }
                if (z4 || z3) {
                    i3 = i5 + 1;
                    strArr[i5] = str2;
                    util.LOGI("isPskeyExpired refresh " + str + " need refresh pskey:" + z4 + " and pt4token:" + z3, "");
                } else {
                    i3 = i5;
                }
                util.LOGI("isPskeyExpired domain " + str + " get pskey:" + z2 + " get pt4token:" + z, "");
                i5 = i3;
            }
            i4++;
        }
        if (i5 == 0) {
            return 3;
        }
        while (i5 < strArr.length) {
            util.LOGI("isPskeyExpired domain " + strArr[i5] + " cleared", "");
            strArr[i5] = null;
            i5++;
        }
        if (i2 == 1) {
            return 1;
        }
        RefreshMemorySig();
        return 2;
    }

    private void localInit(Context context, boolean z) {
        this.isForLocal = z;
        try {
            this.mContext = context.getApplicationContext();
        } catch (Throwable th) {
            this.mContext = context;
            util.printThrowable(th, "");
        }
        this.mG.b(context);
        RequestInit();
    }

    public Handler newHelperHandler() {
        try {
            if (Looper.myLooper() == null) {
                return null;
            }
            return new Handler();
        } catch (Throwable unused) {
            return null;
        }
    }

    private void printTicket(WloginSigInfo wloginSigInfo) {
        util.LOGI("a1 " + wloginSigInfo._en_A1.length);
        util.LOGI("a2 " + wloginSigInfo._TGT.length);
        util.LOGI("skey " + wloginSigInfo._sKey.length);
        util.LOGI("pskey " + wloginSigInfo._psKey.length);
        util.LOGI("superkey " + wloginSigInfo._superKey.length);
        util.LOGI("d2 " + wloginSigInfo._D2.length);
        util.LOGI("d2key " + wloginSigInfo._D2Key.length);
    }

    public static void setCustomerGuid(Context context, byte[] bArr) {
        util.LOGI("set customer guid " + util.buf_to_string(bArr), "");
        t.ai = bArr;
        util.saveGuidToFile(context, bArr);
    }

    public static void setExtraLoginTlvValue(WUserSigInfo wUserSigInfo, int i, byte[] bArr) {
        Integer num = new Integer(i);
        tlv_t tlv_tVar = new tlv_t(i);
        tlv_tVar.set_data(bArr, bArr.length);
        wUserSigInfo.extraLoginTLVMap.put(num, tlv_tVar);
    }

    public static void setExtraRegTlvValue(WUserSigInfo wUserSigInfo, int i, byte[] bArr) {
        Integer num = new Integer(i);
        RegTLV regTLV = new RegTLV(i);
        regTLV.set_data(bArr, bArr.length);
        wUserSigInfo.extraRegTLVMap.put(num, regTLV);
    }

    public static void setExtraRegTlvValueWatchQQLicense(WUserSigInfo wUserSigInfo, byte[] bArr) {
        setExtraRegTlvValue(wUserSigInfo, 38, bArr);
    }

    public static void setLoadEncryptSo(boolean z) {
        util.loadEncryptSo = z;
    }

    public static void setLoadSoFlg(boolean z) {
        t.as = z;
    }

    public static void setProductType(int i) {
        t.au = i;
    }

    public static void setRegisterFlg(int i) {
        t.ah = i | t.ah;
    }

    private void tlvCommRsp2ErrMsg(TLV_CommRsp tLV_CommRsp, ErrMsg errMsg) {
        if (tLV_CommRsp == null || tLV_CommRsp.get_data_len() == 0) {
            return;
        }
        errMsg.setType(tLV_CommRsp.ErrInfoType);
        errMsg.setOtherinfo(new String(tLV_CommRsp.ErrInfo));
        errMsg.setTitle(new String(tLV_CommRsp.ErrTitle));
        errMsg.setMessage(new String(tLV_CommRsp.ErrMsg));
    }

    public int AskDevLockSms(String str, long j, long j2, WUserSigInfo wUserSigInfo) {
        if (str == null) {
            return -1017;
        }
        WloginSimpleInfo wloginSimpleInfo = new WloginSimpleInfo();
        if (!GetBasicUserInfo(str, wloginSimpleInfo).booleanValue()) {
            return -1003;
        }
        long j3 = wloginSimpleInfo._uin;
        util.LOGI("AskDevLockSms ...", str);
        oicq.wlogin_sdk.devicelock.d dVar = new oicq.wlogin_sdk.devicelock.d();
        TransReqContext transReqContext = new TransReqContext();
        transReqContext.set_devlock_req();
        transReqContext.set_subcmd(dVar.get_msgType());
        transReqContext._body = dVar.a(j3, j, j2);
        if (transReqContext._body == null || transReqContext._body.length == 0) {
            return -1017;
        }
        return RequestTransport(0, 1, str, j, dVar.Role, transReqContext, wUserSigInfo);
    }

    public void CancelRequest() {
        this.mG.s = 1;
    }

    public int CheckDevLockSms(String str, long j, long j2, String str2, byte[] bArr, WUserSigInfo wUserSigInfo) {
        if (str == null) {
            return -1017;
        }
        WloginSimpleInfo wloginSimpleInfo = new WloginSimpleInfo();
        if (!GetBasicUserInfo(str, wloginSimpleInfo).booleanValue()) {
            return -1003;
        }
        long j3 = wloginSimpleInfo._uin;
        WloginSigInfo FindUserSig = FindUserSig(j3, j);
        if (FindUserSig == null) {
            return -1004;
        }
        if (bArr != null && bArr.length > 0) {
            DevlockBase.rst.setSppKey(bArr);
        }
        util.LOGI("CheckDevLockSms ...", str);
        oicq.wlogin_sdk.devicelock.f fVar = new oicq.wlogin_sdk.devicelock.f();
        TransReqContext transReqContext = new TransReqContext();
        String str3 = Build.VERSION.RELEASE;
        if (str3 == null) {
            str3 = "";
        }
        transReqContext.set_devlock_req();
        transReqContext.set_subcmd(fVar.get_msgType());
        transReqContext.setSTEncryptMethod();
        transReqContext.setWtST(FindUserSig);
        transReqContext._body = fVar.a(j3, j, j2, FindUserSig._TGT, t.A, t.E, util.SDK_VERSION.getBytes(), Platform.ANDROID.getBytes(), str3.getBytes(), str2 == null ? null : str2.getBytes());
        if (transReqContext._body == null || transReqContext._body.length == 0) {
            return -1017;
        }
        return RequestTransport(0, 1, str, j, fVar.Role, transReqContext, wUserSigInfo);
    }

    public int CheckDevLockStatus(String str, long j, long j2, WUserSigInfo wUserSigInfo) {
        if (str == null) {
            return -1017;
        }
        WloginSimpleInfo wloginSimpleInfo = new WloginSimpleInfo();
        if (!GetBasicUserInfo(str, wloginSimpleInfo).booleanValue()) {
            return -1003;
        }
        long j3 = wloginSimpleInfo._uin;
        WloginSigInfo FindUserSig = FindUserSig(j3, j);
        if (FindUserSig == null) {
            return -1004;
        }
        util.LOGI("CheckDevLockStatus ...", str);
        DevlockBase.rst = new DevlockRst();
        oicq.wlogin_sdk.devicelock.a aVar = new oicq.wlogin_sdk.devicelock.a();
        TransReqContext transReqContext = new TransReqContext();
        transReqContext.set_devlock_req();
        transReqContext.set_subcmd(aVar.get_msgType());
        transReqContext.setSTEncryptMethod();
        transReqContext.setWtST(FindUserSig);
        transReqContext._body = aVar.a(j3, j, j2, FindUserSig._TGT, t.A, t.E, util.SDK_VERSION.getBytes(), t.K, t.J);
        if (transReqContext._body == null || transReqContext._body.length == 0) {
            return -1017;
        }
        return RequestTransport(0, 1, str, j, aVar.Role, transReqContext, wUserSigInfo);
    }

    public int CheckPictureAndGetSt(String str, byte[] bArr, WUserSigInfo wUserSigInfo) {
        o.I = false;
        return CheckPictureAndGetSt(str, bArr, wUserSigInfo, (byte[][]) null, 0);
    }

    public int CheckPictureAndGetSt(String str, byte[] bArr, WUserSigInfo wUserSigInfo, byte[][] bArr2) {
        o.I = false;
        return CheckPictureAndGetSt(str, bArr, wUserSigInfo, bArr2, 0);
    }

    public int CheckSMSAndGetSt(String str, byte[] bArr, WUserSigInfo wUserSigInfo) {
        return CheckSMSAndGetSt(str, bArr, wUserSigInfo, (byte[][]) null, 0);
    }

    public int CheckSMSAndGetSt(String str, byte[] bArr, WUserSigInfo wUserSigInfo, byte[][] bArr2) {
        return CheckSMSAndGetSt(str, bArr, wUserSigInfo, bArr2, 0);
    }

    public int CheckSMSVerifyLoginAccount(long j, long j2, String str, WUserSigInfo wUserSigInfo) {
        return CheckSMSVerifyLoginAccount(j, j2, str, wUserSigInfo, 0);
    }

    public int CheckWebsigAndGetSt(String str, String str2, WUserSigInfo wUserSigInfo) {
        o.I = true;
        return CheckPictureAndGetSt(str, str2.getBytes(), wUserSigInfo, (byte[][]) null, 0);
    }

    public int CheckWebsigAndGetSt(String str, String str2, WUserSigInfo wUserSigInfo, byte[][] bArr) {
        o.I = true;
        return CheckPictureAndGetSt(str, str2.getBytes(), wUserSigInfo, bArr, 0);
    }

    public void ClearPSkey(String str, long j) {
        long parseLong;
        util.LOGI("user:" + str + " appid:" + j + " ClearPSkey ...", str);
        if (str == null || str.length() <= 0) {
            return;
        }
        boolean z = true;
        synchronized (this) {
            if (util.check_uin_account(str).booleanValue()) {
                parseLong = Long.parseLong(str);
            } else {
                parseLong = this.mG.b(str);
                if (parseLong == 0) {
                    z = false;
                }
            }
            if (z) {
                this.mG.d(parseLong, j);
            }
        }
    }

    public Boolean ClearUserLoginData(String str, long j) {
        long parseLong;
        boolean z;
        util.LOGI("user:" + str + " appid:" + j + " ClearUserLoginData ...", str);
        if (str == null || str.length() <= 0) {
            return true;
        }
        synchronized (this) {
            if (util.check_uin_account(str).booleanValue()) {
                parseLong = Long.parseLong(str);
            } else {
                parseLong = this.mG.b(str);
                if (parseLong == 0) {
                    z = false;
                    if (z) {
                        this.mG.e(parseLong, j);
                    }
                } else {
                    this.mG.d(str);
                }
            }
            z = true;
            if (z) {
            }
        }
        WloginSigInfo._QRPUSHSig = new byte[0];
        WloginSigInfo._LHSig = new byte[0];
        return true;
    }

    public int CloseCode(String str, long j, byte[] bArr, int i, List<byte[]> list, WUserSigInfo wUserSigInfo) {
        WloginSimpleInfo wloginSimpleInfo = new WloginSimpleInfo();
        if (!GetBasicUserInfo(str, wloginSimpleInfo).booleanValue()) {
            return -1003;
        }
        long j2 = wloginSimpleInfo._uin;
        this.mG.j();
        WloginSigInfo FindUserSig = FindUserSig(j2, j);
        if (FindUserSig == null) {
            return -1004;
        }
        util.LOGI("user:" + str + " CloseCode ...", str);
        oicq.wlogin_sdk.code2d.a aVar = new oicq.wlogin_sdk.code2d.a();
        TransReqContext transReqContext = new TransReqContext();
        transReqContext.set_code2d_func_req();
        transReqContext.set_subcmd(aVar.get_cmd());
        transReqContext.setSTEncryptMethod();
        transReqContext.setWtST(FindUserSig);
        transReqContext._body = aVar.a(j2, j, 1L, bArr, FindUserSig._userStSig, t.A, i, list, FindUserSig._en_A1, FindUserSig._noPicSig, this.mMiscBitmap, 0L);
        return RequestTransport(0, 1, str, j, aVar._role, transReqContext, wUserSigInfo);
    }

    public int CloseDevLock(String str, long j, long j2, WUserSigInfo wUserSigInfo) {
        if (str == null) {
            return -1017;
        }
        WloginSimpleInfo wloginSimpleInfo = new WloginSimpleInfo();
        if (!GetBasicUserInfo(str, wloginSimpleInfo).booleanValue()) {
            return -1003;
        }
        long j3 = wloginSimpleInfo._uin;
        WloginSigInfo FindUserSig = FindUserSig(j3, j);
        if (FindUserSig == null) {
            return -1004;
        }
        util.LOGI("CloseDevLock ...", str);
        oicq.wlogin_sdk.devicelock.b bVar = new oicq.wlogin_sdk.devicelock.b();
        TransReqContext transReqContext = new TransReqContext();
        String str2 = Build.VERSION.RELEASE;
        if (str2 == null) {
            str2 = "";
        }
        transReqContext.set_devlock_req();
        transReqContext.set_subcmd(bVar.get_msgType());
        transReqContext.setSTEncryptMethod();
        transReqContext.setWtST(FindUserSig);
        transReqContext._body = bVar.a(j3, j, j2, FindUserSig._TGT, t.A, t.E, util.SDK_VERSION.getBytes(), Platform.ANDROID.getBytes(), str2.getBytes());
        if (transReqContext._body == null || transReqContext._body.length == 0) {
            return -1017;
        }
        return RequestTransport(0, 1, str, j, bVar.Role, transReqContext, wUserSigInfo);
    }

    public int FetchCodeSig(long j, long j2, fetch_code.QRCodeCustom qRCodeCustom, WUserSigInfo wUserSigInfo) {
        util.LOGI(" FetchCodeSig ...", "");
        fetch_code fetch_codeVar = new fetch_code();
        TransReqContext transReqContext = new TransReqContext();
        transReqContext.set_code2d_func_req();
        transReqContext.set_subcmd(fetch_codeVar.get_cmd());
        transReqContext._body = fetch_codeVar.get_request(0L, j, j2, new byte[0], qRCodeCustom, this.mMiscBitmap, 0L, WloginSigInfo._QRPUSHSig);
        return RequestTransport(0, 1, null, j, fetch_codeVar._role, transReqContext, wUserSigInfo);
    }

    public int GetA1WithA1(String str, long j, long j2, byte[] bArr, long j3, long j4, long j5, byte[] bArr2, byte[] bArr3, WUserSigInfo wUserSigInfo, WFastLoginInfo wFastLoginInfo) {
        return GetA1WithA1(str, j, j2, this.mMainSigMap, bArr, j3, j4, j5, bArr2, bArr3, wUserSigInfo, wFastLoginInfo, 0);
    }

    public byte[] GetA2A2KeyBuf(String str, long j) {
        Ticket GetLocalTicket = GetLocalTicket(str, j, 64);
        if (GetLocalTicket == null || GetLocalTicket._sig == null || GetLocalTicket._sig.length <= 0 || GetLocalTicket._sig_key == null || GetLocalTicket._sig_key.length <= 0 || t.B == null || t.B.length <= 0) {
            return null;
        }
        byte[] bArr = new byte[str.getBytes().length + 2 + 8 + 2 + GetLocalTicket._sig.length + 2 + GetLocalTicket._sig_key.length];
        util.int16_to_buf(bArr, 0, str.getBytes().length);
        System.arraycopy(str.getBytes(), 0, bArr, 2, str.getBytes().length);
        int length = str.getBytes().length + 2;
        util.int64_to_buf(bArr, length, j);
        int i = length + 8;
        util.int16_to_buf(bArr, i, GetLocalTicket._sig.length);
        int i2 = i + 2;
        System.arraycopy(GetLocalTicket._sig, 0, bArr, i2, GetLocalTicket._sig.length);
        int length2 = i2 + GetLocalTicket._sig.length;
        util.int16_to_buf(bArr, length2, GetLocalTicket._sig_key.length);
        System.arraycopy(GetLocalTicket._sig_key, 0, bArr, length2 + 2, GetLocalTicket._sig_key.length);
        int length3 = GetLocalTicket._sig_key.length;
        return cryptor.encrypt(bArr, 0, bArr.length, t.B);
    }

    public List<WloginLoginInfo> GetAllLoginInfo() {
        return this.mG.k();
    }

    public long GetAppidFromUrl(String str) {
        int indexOf;
        int i;
        if (str == null || (indexOf = str.indexOf("f=")) == -1 || (i = indexOf + 2) >= str.length()) {
            return -1L;
        }
        String str2 = "";
        for (i = indexOf + 2; i < str.length() && str.charAt(i) != '&'; i++) {
            str2 = str2 + str.charAt(i);
        }
        try {
            return Long.parseLong(str2);
        } catch (Exception unused) {
            return -1L;
        }
    }

    public Boolean GetBasicUserInfo(String str, WloginSimpleInfo wloginSimpleInfo) {
        long parseLong;
        boolean z;
        if (str == null) {
            return false;
        }
        if (util.check_uin_account(str).booleanValue()) {
            parseLong = Long.parseLong(str);
        } else {
            parseLong = this.mG.b(str);
            if (parseLong == 0) {
                z = false;
                if (z) {
                    WloginSimpleInfo d2 = this.mG.d(parseLong);
                    if (d2 == null) {
                        z = false;
                    } else {
                        wloginSimpleInfo.setUin(d2._uin);
                        wloginSimpleInfo.setFace(d2._face);
                        wloginSimpleInfo.setGender(d2._gender);
                        wloginSimpleInfo.setNick(d2._nick);
                        wloginSimpleInfo.setAge(d2._age);
                        wloginSimpleInfo.setImgType(d2._img_type);
                        wloginSimpleInfo.setImgFormat(d2._img_format);
                        wloginSimpleInfo.setImgUrl(d2._img_url);
                        wloginSimpleInfo.setMainDisplayName(d2.mainDisplayName);
                    }
                }
                return Boolean.valueOf(z);
            }
        }
        z = true;
        if (z) {
        }
        return Boolean.valueOf(z);
    }

    public DevlockInfo GetDevLockInfo(String str) {
        return GetDevLockInfo(str, 0L);
    }

    public DevlockInfo GetDevLockInfo(String str, long j) {
        if (j <= 0) {
            j = this.mAysncSeq;
        }
        return t.b(j)._devlock_info;
    }

    public byte[] GetGuid() {
        byte[] a2 = t.a(this.mContext);
        if (a2 != null) {
            return a2;
        }
        if (t.A != null && t.A.length > 0) {
            a2 = new byte[t.A.length];
            System.arraycopy(t.A, 0, a2, 0, t.A.length);
        }
        util.LOGI("get guid " + util.buf_to_string(a2), "");
        return a2;
    }

    public WloginLastLoginInfo GetLastLoginInfo() {
        List<WloginLoginInfo> k = this.mG.k();
        if (k == null) {
            return null;
        }
        WloginLoginInfo wloginLoginInfo = null;
        for (WloginLoginInfo wloginLoginInfo2 : k) {
            if (wloginLoginInfo == null || wloginLoginInfo2.mCreateTime > wloginLoginInfo.mCreateTime) {
                wloginLoginInfo = wloginLoginInfo2;
            }
        }
        if (wloginLoginInfo == null) {
            return null;
        }
        return (wloginLoginInfo.mAccount == null || wloginLoginInfo.mAccount.length() <= 0) ? new WloginLastLoginInfo(String.valueOf(wloginLoginInfo.mUin), wloginLoginInfo.mUin) : new WloginLastLoginInfo(wloginLoginInfo.mAccount, wloginLoginInfo.mUin);
    }

    public WUserSigInfo GetLocalSig(String str, long j) {
        WUserSigInfo wUserSigInfo;
        long parseLong;
        if (str == null) {
            util.LOGI("userAccount null", "");
            return null;
        }
        try {
            if (util.check_uin_account(str).booleanValue()) {
                parseLong = Long.parseLong(str);
            } else {
                parseLong = this.mG.b(str);
                if (parseLong == 0) {
                    return null;
                }
            }
            WloginSigInfo a2 = this.mG.a(parseLong, j);
            if (a2 == null) {
                return null;
            }
            wUserSigInfo = new WUserSigInfo();
            try {
                wUserSigInfo.uin = str;
                wUserSigInfo.get_clone(a2);
                util.LOGI("skey in sigInfo " + util.getMaskBytes(a2._sKey, 2, 2), str);
                return wUserSigInfo;
            } catch (Exception e) {
                e = e;
                util.printException(e, str);
                return wUserSigInfo;
            }
        } catch (Exception e2) {
            e = e2;
            wUserSigInfo = null;
        }
    }

    public Ticket GetLocalTicket(String str, long j, int i) {
        util.LOGI("GetLocalTicket appid " + j + " type 0x" + String.format("%x", Integer.valueOf(i)), str);
        if (str != null) {
            return GetUserSigInfoTicket(GetLocalSig(str, j), i);
        }
        util.LOGI("userAccount null", "");
        return null;
    }

    public int GetOpenKeyWithoutPasswd(String str, long j, long j2, int i, WUserSigInfo wUserSigInfo) {
        byte[][] bArr = (byte[][]) null;
        return GetStWithoutPasswd(str, j, this.mOpenAppid, -1L, i, j2, null, wUserSigInfo, bArr, bArr, 0, null);
    }

    public byte[] GetPictureData(String str) {
        return GetPictureData(str, 0L);
    }

    public byte[] GetPictureData(String str, long j) {
        if (j <= 0) {
            j = this.mAysncSeq;
        }
        return t.b(j)._t105.get_pic();
    }

    @Deprecated
    public byte[] GetPicturePrompt(String str) {
        return GetPicturePrompt(str, 0L);
    }

    @Deprecated
    public byte[] GetPicturePrompt(String str, long j) {
        if (j <= 0) {
            j = this.mAysncSeq;
        }
        return t.b(j)._t165.get_data();
    }

    public String GetPicturePromptValue(String str) {
        return GetPicturePromptValue(str, 0L);
    }

    public String GetPicturePromptValue(String str, long j) {
        int buf_to_int8;
        int buf_to_int82;
        int buf_to_int32;
        int i;
        int buf_to_int322;
        byte[] GetPicturePrompt = GetPicturePrompt(str, j);
        if (GetPicturePrompt != null && GetPicturePrompt.length > 3) {
            int i2 = 0;
            int buf_to_int323 = util.buf_to_int32(GetPicturePrompt, 0);
            int i3 = 4;
            while (i2 < buf_to_int323) {
                int i4 = i3 + 1;
                if (GetPicturePrompt.length < i4 || GetPicturePrompt.length < (buf_to_int82 = i4 + (buf_to_int8 = util.buf_to_int8(GetPicturePrompt, i3)))) {
                    break;
                }
                String str2 = new String(GetPicturePrompt, i4, buf_to_int8);
                if (GetPicturePrompt.length < buf_to_int82 + 2 || GetPicturePrompt.length < (buf_to_int322 = (i = buf_to_int82 + 4) + (buf_to_int32 = util.buf_to_int32(GetPicturePrompt, buf_to_int82)))) {
                    break;
                }
                String str3 = new String(GetPicturePrompt, i, buf_to_int32);
                if (str2.equals("pic_reason")) {
                    return str3;
                }
                i2++;
                i3 = buf_to_int322;
            }
        }
        return "";
    }

    public Ticket GetPskey(String str, long j, String[] strArr, WtTicketPromise wtTicketPromise) {
        Bundle bundle = new Bundle();
        bundle.putStringArray("domains", strArr);
        String str2 = "";
        for (String str3 : strArr) {
            str2 = str2 + str3 + Constants.ACCEPT_TIME_SEPARATOR_SP;
        }
        util.LOGI("GetPskey appid " + j + " domains " + str2, str);
        return GetTicket(str, j, 1048576, wtTicketPromise, bundle);
    }

    public Ticket GetSkey(String str, long j, WtTicketPromise wtTicketPromise) {
        return GetTicket(str, j, 4096, wtTicketPromise, null);
    }

    public int GetStViaSMSVerifyLogin(String str, long j, long j2, int i, WUserSigInfo wUserSigInfo) {
        util.LOGI("user:" + str + " GetStViaSMSVerifyLogin ...", str);
        return GetStWithPasswd(str, j, i, j2, null, false, oicq.wlogin_sdk.a.h.x ? oicq.wlogin_sdk.a.h.z : "", wUserSigInfo, (byte[][]) null, true, 0);
    }

    public int GetStViaSMSVerifyLogin(String str, long j, long j2, long[] jArr, int i, WUserSigInfo wUserSigInfo) {
        byte[][] bArr = (byte[][]) null;
        if (jArr != null && jArr.length > 0) {
            bArr = (byte[][]) Array.newInstance((Class<?>) byte.class, jArr.length, 0);
        }
        byte[][] bArr2 = bArr;
        util.LOGI("user:" + str + " GetStViaSMSVerifyLogin ...", str);
        return GetStWithPasswd(str, j, i, j2, jArr, false, oicq.wlogin_sdk.a.h.x ? oicq.wlogin_sdk.a.h.z : "", wUserSigInfo, bArr2, true, 0);
    }

    public int GetStWithPasswdMd5(String str, long j, long j2, int i, String str2, WUserSigInfo wUserSigInfo) {
        return GetStWithPasswd(str, j, i, j2, null, true, str2, wUserSigInfo, (byte[][]) null, false, 0);
    }

    @Deprecated
    public int GetStWithPasswdMd5(String str, long j, String str2, WUserSigInfo wUserSigInfo) {
        return GetStWithPasswd(str, j, this.mMainSigMap, 1L, null, true, str2, wUserSigInfo, (byte[][]) null, false, 0);
    }

    public int GetStWithPasswdReserved(String str, long j, int i, long j2, long[] jArr, boolean z, String str2, WUserSigInfo wUserSigInfo, byte[][] bArr) {
        return GetStWithPasswd(str, j, i, j2, jArr, z, str2, wUserSigInfo, bArr, false, 0);
    }

    public int GetStWithPasswdReserved(String str, long j, long j2, int i, String str2, WUserSigInfo wUserSigInfo) {
        return GetStWithPasswd(str, j, i, j2, null, false, str2, wUserSigInfo, (byte[][]) null, false, 0);
    }

    @Deprecated
    public int GetStWithPasswdReserved(String str, long j, String str2, WUserSigInfo wUserSigInfo) {
        return GetStWithPasswd(str, j, this.mMainSigMap, 1L, null, false, str2, wUserSigInfo, (byte[][]) null, false, 0);
    }

    public int GetStWithoutPasswd(String str, long j, long j2, long j3, int i, long j4, long[] jArr, WUserSigInfo wUserSigInfo, byte[][] bArr, byte[][] bArr2) {
        return GetStWithoutPasswd(str, j, j2, j3, i, j4, jArr, wUserSigInfo, bArr, bArr2, 0, null);
    }

    public int GetStWithoutPasswd(String str, long j, long j2, long j3, int i, WUserSigInfo wUserSigInfo) {
        byte[][] bArr = (byte[][]) null;
        return GetStWithoutPasswd(str, j, j2, -1L, i, j3, null, wUserSigInfo, bArr, bArr, 0, null);
    }

    public int GetStWithoutPasswd(String str, long j, long j2, long j3, int i, byte[] bArr, byte[] bArr2, byte[] bArr3, WUserSigInfo wUserSigInfo) {
        r6[0][0] = 1;
        byte[][] bArr4 = {new byte[1], bArr, bArr2, bArr3};
        return GetStWithoutPasswd(str, j, j2, -1L, i, j3, null, wUserSigInfo, (byte[][]) null, bArr4, 0, null);
    }

    @Deprecated
    public int GetStWithoutPasswd(String str, long j, long j2, WUserSigInfo wUserSigInfo) {
        byte[][] bArr = (byte[][]) null;
        return GetStWithoutPasswd(str, j, j2, -1L, this.mMainSigMap, 1L, null, wUserSigInfo, bArr, bArr, 0, null);
    }

    public int GetStWithoutPasswd(byte[] bArr, long j, int i, WUserSigInfo wUserSigInfo) {
        byte[] decrypt;
        int buf_to_int16;
        int i2;
        int buf_to_int162;
        int i3;
        int buf_to_int163;
        if (bArr != null && bArr.length > 0 && (decrypt = cryptor.decrypt(bArr, 0, bArr.length, t.B)) != null && decrypt.length > 0 && 2 <= decrypt.length && (buf_to_int16 = util.buf_to_int16(decrypt, 0)) > 0 && (i2 = 2 + buf_to_int16) <= decrypt.length) {
            String str = new String(decrypt, 2, buf_to_int16);
            int i4 = i2 + 8;
            if (i4 > decrypt.length) {
                return -1017;
            }
            long buf_to_int64 = util.buf_to_int64(decrypt, i2);
            int i5 = i4 + 2;
            if (i5 <= decrypt.length && (buf_to_int162 = util.buf_to_int16(decrypt, i4)) > 0 && (i3 = i5 + buf_to_int162) <= decrypt.length) {
                byte[] bArr2 = new byte[buf_to_int162];
                System.arraycopy(decrypt, i5, bArr2, 0, bArr2.length);
                int i6 = i3 + 2;
                if (i6 <= decrypt.length && (buf_to_int163 = util.buf_to_int16(decrypt, i3)) > 0 && i6 + buf_to_int163 <= decrypt.length) {
                    byte[] bArr3 = new byte[buf_to_int163];
                    System.arraycopy(decrypt, i6, bArr3, 0, bArr3.length);
                    r0[0][0] = 2;
                    byte[][] bArr4 = {new byte[1], bArr2, bArr3};
                    return GetStWithoutPasswd(str, buf_to_int64, j, -1L, i, 1L, null, wUserSigInfo, (byte[][]) null, bArr4, 0, null);
                }
            }
        }
        return -1017;
    }

    public Ticket GetTicket(final String str, final long j, final int i, final WtTicketPromise wtTicketPromise, final Bundle bundle) {
        int i2;
        int i3;
        StringBuilder sb = new StringBuilder();
        sb.append("GetTicket ");
        sb.append(str);
        sb.append(", ");
        sb.append(j);
        sb.append(" sig ");
        sb.append(Integer.toHexString(i));
        sb.append(" ");
        sb.append(bundle == null ? IAPInjectService.EP_NULL : Integer.valueOf(bundle.size()));
        util.LOGI(sb.toString(), "");
        String[] strArr = null;
        int i4 = 2;
        while (true) {
            WUserSigInfo GetLocalSig = GetLocalSig(str, j);
            if (GetLocalSig == null) {
                if (i4 == 1) {
                    i2 = 1;
                    break;
                }
                RefreshMemorySig();
                i4--;
                i2 = 1;
                if (i4 > 0) {
                    break;
                }
            } else {
                Ticket GetUserSigInfoTicket = GetUserSigInfoTicket(GetLocalSig, i);
                if (GetUserSigInfoTicket == null || GetUserSigInfoTicket._sig == null || GetUserSigInfoTicket._sig.length == 0) {
                    int i5 = i4;
                    i2 = 1;
                    if (i5 == 1) {
                        break;
                    }
                    RefreshMemorySig();
                    i4 = i5 - 1;
                    if (i4 > 0) {
                    }
                } else {
                    long f = t.f();
                    if (bundle != null && i == 1048576) {
                        strArr = bundle.getStringArray("domains");
                    }
                    String[] strArr2 = strArr;
                    i2 = 1;
                    int i6 = i4;
                    int isPskeyExpired = isPskeyExpired(i, strArr2, GetUserSigInfoTicket, f, i4);
                    if (isPskeyExpired == 1) {
                        break;
                    }
                    if (isPskeyExpired == 2) {
                        i3 = i6;
                    } else {
                        i3 = i6;
                        if (isPskeyExpired == 3) {
                            return GetUserSigInfoTicket;
                        }
                        util.LOGI("GetTicket sigType:0x" + Integer.toHexString(i) + " expires in " + (((GetUserSigInfoTicket._expire_time - f) / 60) / 60) + "h", "");
                        long j2 = GetUserSigInfoTicket._expire_time;
                        if (i == 4096) {
                            if (true != Ticket.isSkeyExpired(j2)) {
                                return GetUserSigInfoTicket;
                            }
                            if (i3 == 1) {
                                break;
                            }
                            RefreshMemorySig();
                        } else {
                            if (f < j2) {
                                return GetUserSigInfoTicket;
                            }
                            if (i3 == 1) {
                                break;
                            }
                            RefreshMemorySig();
                        }
                        if (i4 > 0) {
                        }
                    }
                    i4 = i3 - 1;
                    strArr = strArr2;
                    if (i4 > 0) {
                    }
                }
            }
        }
        if (IsNeedLoginWithPasswd(str, j).booleanValue()) {
            ErrMsg errMsg = new ErrMsg();
            errMsg.setType(-1004);
            if (wtTicketPromise != null) {
                wtTicketPromise.Failed(errMsg);
            }
        } else {
            WUserSigInfo wUserSigInfo = new WUserSigInfo();
            if (bundle != null) {
                i2 = bundle.getInt("subappid", i2);
            }
            if (strArr != null) {
                int min = Math.min(20, strArr.length);
                for (int i7 = 0; i7 < min; i7++) {
                    String str2 = strArr[i7];
                    if (str2 != null && str2.length() > 0) {
                        wUserSigInfo._domains.add(str2);
                    }
                }
            }
            GetStWithoutPasswd(str, j, j, i2, i, wUserSigInfo, new WtTicketPromise() {
                @Override
                public void Done(Ticket ticket) {
                    WtTicketPromise wtTicketPromise2 = wtTicketPromise;
                    if (wtTicketPromise2 != null) {
                        wtTicketPromise2.Done(WtloginHelper.this.GetTicket(str, j, i, null, bundle));
                    }
                }

                @Override
                public void Failed(ErrMsg errMsg2) {
                    WtTicketPromise wtTicketPromise2 = wtTicketPromise;
                    if (wtTicketPromise2 != null) {
                        wtTicketPromise2.Failed(errMsg2);
                    }
                }

                @Override
                public void Timeout(ErrMsg errMsg2) {
                    WtTicketPromise wtTicketPromise2 = wtTicketPromise;
                    if (wtTicketPromise2 != null) {
                        wtTicketPromise2.Timeout(errMsg2);
                    }
                }
            });
        }
        util.LOGI("get null for sigType:0x" + Integer.toHexString(i), str);
        return null;
    }

    public long GetTimeDifference() {
        return t.ab;
    }

    public Boolean IsNeedLoginWithPasswd(String str, long j) {
        long parseLong;
        int i;
        boolean z = true;
        if (str == null) {
            return true;
        }
        synchronized (this) {
            if (util.check_uin_account(str).booleanValue()) {
                parseLong = Long.parseLong(str);
            } else {
                parseLong = this.mG.b(str);
                if (parseLong == 0) {
                    i = 1;
                }
            }
            WloginSigInfo a2 = this.mG.a(parseLong, j);
            if (a2 == null || a2._en_A1 == null || a2._en_A1.length == 0 || a2._noPicSig == null || a2._noPicSig.length == 0) {
                if (a2 != null && a2._TGT != null && a2._TGT.length != 0 && !a2.iSExpireA2(t.f())) {
                    z = false;
                    i = 0;
                }
                i = 3;
            } else {
                z = false;
                i = 2;
            }
        }
        util.LOGI("user:" + str + " appid:" + j + " need password:" + z + " flag=" + i, str);
        return Boolean.valueOf(z);
    }

    public Boolean IsUserHaveA1(String str, long j) {
        long parseLong;
        WloginSigInfo a2;
        if (str == null) {
            return false;
        }
        if (util.check_uin_account(str).booleanValue()) {
            parseLong = Long.parseLong(str);
        } else {
            parseLong = this.mG.b(str);
            if (parseLong == 0) {
                a2 = null;
                if (a2 != null || a2._en_A1 == null || a2._en_A1.length <= 0) {
                    util.LOGI("userAccount:" + str + " dwAppid:" + j + " IsUserHaveA1 return: null", str);
                    return false;
                }
                util.LOGI("userAccount:" + str + " dwAppid:" + j + " IsUserHaveA1 return: not null", str);
                return true;
            }
        }
        a2 = this.mG.a(parseLong, j);
        if (a2 != null) {
        }
        util.LOGI("userAccount:" + str + " dwAppid:" + j + " IsUserHaveA1 return: null", str);
        return false;
    }

    public boolean IsWtLoginUrl(String str) {
        int indexOf;
        int i;
        int i2;
        if (str == null || (indexOf = str.indexOf("?k=")) == -1 || (i2 = (i = indexOf + 3) + 32) > str.length()) {
            return false;
        }
        String substring = str.substring(i, i2);
        return util.base64_decode_url(substring.getBytes(), substring.length()) != null;
    }

    public byte[] PickupQRCode(String str) {
        if (str == null || !str.matches(".*[?&]k=([^&$]+).*")) {
            return null;
        }
        String replaceAll = str.replaceAll(".*[?&]k=([^&$]+).*", "$1");
        return util.base64_decode_url(replaceAll.getBytes(), replaceAll.length());
    }

    public Intent PrepareQloginIntent(long j, long j2, String str) {
        boolean isMQQExist = util.isMQQExist(this.mContext);
        Context context = this.mContext;
        String str2 = com.tencent.connect.common.Constants.PACKAGE_QQ_PAD;
        boolean isPackageExist = util.isPackageExist(context, com.tencent.connect.common.Constants.PACKAGE_QQ_PAD);
        if (isMQQExist) {
            str2 = "";
        } else if (!isPackageExist) {
            return null;
        }
        byte[] bArr = util.get_rsa_pubkey(this.mContext);
        if (bArr == null || bArr.length == 0) {
            bArr = util.string_to_buf(RSACrypt.DEFAULT_PUB_KEY);
        }
        Intent intent = new Intent();
        intent.setClassName(str2, "com.tencent.open.agent.AgentActivity");
        Bundle bundle = new Bundle();
        bundle.putLong("dstSsoVer", 1L);
        bundle.putLong("dstAppid", j);
        bundle.putLong("subDstAppid", j2);
        bundle.putByteArray("dstAppVer", str.getBytes());
        bundle.putByteArray("publickey", bArr);
        intent.putExtra(com.tencent.connect.common.Constants.KEY_PARAMS, bundle);
        intent.putExtra(com.tencent.connect.common.Constants.KEY_ACTION, "action_quick_login");
        return intent;
    }

    public Intent PrepareQloginResult(String str, long j, long j2, int i, WFastLoginInfo wFastLoginInfo) {
        Intent intent = new Intent();
        intent.putExtra("quicklogin_uin", str);
        byte[] bArr = (byte[]) wFastLoginInfo._outA1.clone();
        if (bArr != null && bArr.length > 0) {
            intent.putExtra("quicklogin_buff", new RSACrypt(this.mContext).EncryptData(util.get_cp_pubkey(this.mContext, j, j2), bArr));
        }
        intent.putExtra("quicklogin_ret", i);
        return intent;
    }

    public Intent PrepareSilenceLoginIntent(long j, long j2, String str) {
        byte[] bArr = util.get_rsa_pubkey(this.mContext);
        if (bArr == null || bArr.length == 0) {
            bArr = util.string_to_buf(RSACrypt.DEFAULT_PUB_KEY);
        }
        Intent intent = new Intent();
        Bundle bundle = new Bundle();
        bundle.putLong("dstSsoVer", 1L);
        bundle.putLong("dstAppid", j);
        bundle.putLong("subDstAppid", j2);
        bundle.putByteArray("dstAppVer", str.getBytes());
        bundle.putByteArray("publickey", bArr);
        intent.putExtra(com.tencent.connect.common.Constants.KEY_PARAMS, bundle);
        intent.putExtra(com.tencent.connect.common.Constants.KEY_ACTION, "action_quick_login");
        return intent;
    }

    public int QueryCodeResult(long j, WUserSigInfo wUserSigInfo) {
        util.LOGI(" QueryCodeResult ...", "");
        oicq.wlogin_sdk.code2d.d dVar = new oicq.wlogin_sdk.code2d.d();
        TransReqContext transReqContext = new TransReqContext();
        transReqContext.set_code2d_func_req();
        transReqContext.set_subcmd(dVar.get_cmd());
        util.LOGI("qrsig " + util.buf_to_string(oicq.wlogin_sdk.code2d.c.i));
        transReqContext._body = dVar.a(0L, j, oicq.wlogin_sdk.code2d.c.i, new byte[0]);
        return RequestTransport(0, 1, null, j, dVar._role, transReqContext, wUserSigInfo);
    }

    public void RefreshMemorySig() {
        this.mG.j();
    }

    public int RefreshPictureData(String str, WUserSigInfo wUserSigInfo) {
        if (wUserSigInfo == null) {
            wUserSigInfo = new WUserSigInfo();
        }
        return RefreshPictureData(str, wUserSigInfo, 0);
    }

    public int RefreshSMSData(String str, long j, WUserSigInfo wUserSigInfo) {
        if (wUserSigInfo == null) {
            wUserSigInfo = new WUserSigInfo();
        }
        return RefreshSMSData(str, j, wUserSigInfo, 0);
    }

    public int RefreshSMSVerifyLoginCode(String str, WUserSigInfo wUserSigInfo) {
        return RefreshSMSVerifyLoginCode(str, wUserSigInfo, 0);
    }

    public int RegGetAccount(byte[] bArr, byte[] bArr2, byte[] bArr3, byte[] bArr4, int i, WUserSigInfo wUserSigInfo) {
        if (bArr3 == null || bArr3.length <= 0) {
            return -1017;
        }
        util.LOGI("RegGetAccount ...", "");
        oicq.wlogin_sdk.a.b bVar = new oicq.wlogin_sdk.a.b();
        TransReqContext transReqContext = new TransReqContext();
        oicq.wlogin_sdk.a.h hVar = this.mRegStatus;
        if (bArr != null) {
            hVar.j = (byte[]) bArr.clone();
        } else {
            hVar.j = new byte[0];
        }
        if (i == 4) {
            hVar.f85513b = "";
        }
        transReqContext.set_register_req();
        transReqContext.set_subcmd(bVar.a());
        transReqContext._body = bVar.a(hVar.e, bArr, bArr3, bArr4, i, hVar.f85513b.getBytes(), bArr2, false, GetGuid(), 0L, t.E, t.z, wUserSigInfo.extraRegTLVMap);
        return RequestTransport(0, 1, null, 0L, hVar.i, transReqContext, wUserSigInfo);
    }

    public int RegGetSMSVerifyLoginAccount(byte[] bArr, byte[] bArr2, byte[] bArr3, WUserSigInfo wUserSigInfo) {
        util.LOGI("RegGetSMSVerifyLoginAccount ...", "");
        oicq.wlogin_sdk.a.b bVar = new oicq.wlogin_sdk.a.b();
        TransReqContext transReqContext = new TransReqContext();
        oicq.wlogin_sdk.a.h hVar = this.mRegStatus;
        if (bArr != null) {
            hVar.j = (byte[]) bArr.clone();
        } else {
            hVar.j = new byte[0];
        }
        oicq.wlogin_sdk.a.h.x = true;
        oicq.wlogin_sdk.a.h.z = util.get_mpasswd();
        transReqContext.set_register_req();
        transReqContext.set_subcmd(bVar.a());
        transReqContext._body = bVar.a(hVar.e, bArr, oicq.wlogin_sdk.a.h.z.getBytes(), bArr3, 1, hVar.f85513b.getBytes(), bArr2, true, GetGuid(), hVar.h, t.E, t.z, wUserSigInfo.extraRegTLVMap);
        return RequestTransport(0, 1, null, 0L, hVar.i, transReqContext, wUserSigInfo);
    }

    public int RegQueryAccount(int i, byte[] bArr, long j, WUserSigInfo wUserSigInfo) {
        byte[] bArr2 = bArr == null ? new byte[0] : bArr;
        util.LOGI("RegQueryAccount ...", "");
        this.mRegStatus = new oicq.wlogin_sdk.a.h();
        this.mRegStatus.f85513b = new String(bArr2);
        oicq.wlogin_sdk.a.c cVar = new oicq.wlogin_sdk.a.c();
        TransReqContext transReqContext = new TransReqContext();
        oicq.wlogin_sdk.a.h hVar = this.mRegStatus;
        transReqContext.set_register_req();
        transReqContext.set_subcmd(cVar.a());
        transReqContext._body = cVar.a(i, bArr2, j);
        return RequestTransport(0, 1, null, 0L, hVar.i, transReqContext, wUserSigInfo);
    }

    public int RegQueryClientSentMsgStatus(WUserSigInfo wUserSigInfo) {
        util.LOGI("RegQueryClientSentMsgStatus ...", "");
        oicq.wlogin_sdk.a.d dVar = new oicq.wlogin_sdk.a.d();
        TransReqContext transReqContext = new TransReqContext();
        oicq.wlogin_sdk.a.h hVar = this.mRegStatus;
        transReqContext.set_register_req();
        transReqContext.set_subcmd(dVar.a());
        transReqContext._body = dVar.b(hVar.e, this.mRegStatus.p);
        return RequestTransport(0, 1, null, 0L, hVar.i, transReqContext, wUserSigInfo);
    }

    public int RegRequestServerResendMsg(WUserSigInfo wUserSigInfo) {
        util.LOGI("RegRequestServerResendMsg ...", "");
        oicq.wlogin_sdk.a.e eVar = new oicq.wlogin_sdk.a.e();
        TransReqContext transReqContext = new TransReqContext();
        oicq.wlogin_sdk.a.h hVar = this.mRegStatus;
        transReqContext.set_register_req();
        transReqContext.set_subcmd(eVar.a());
        transReqContext._body = eVar.b(hVar.e, (byte[]) null);
        return RequestTransport(0, 1, null, 0L, hVar.i, transReqContext, wUserSigInfo);
    }

    public int RegSubmitMobile(String str, byte[] bArr, byte[] bArr2, int i, int i2, int i3, long j, long j2, WUserSigInfo wUserSigInfo) {
        return RegSubmitMobile(str == null ? new byte[0] : str.getBytes(), bArr, null, bArr2, i, i2, i3, j, j2, wUserSigInfo);
    }

    public int RegSubmitMobile(byte[] bArr, byte[] bArr2, byte[] bArr3, int i, int i2, int i3, long j, long j2, WUserSigInfo wUserSigInfo) {
        return RegSubmitMobile(null, bArr, bArr2, bArr3, i, i2, i3, j, j2, wUserSigInfo);
    }

    public int RegSubmitMsgChk(byte[] bArr, WUserSigInfo wUserSigInfo) {
        if (bArr == null) {
            return -1017;
        }
        util.LOGI("RegSubmitMsgChk ...", "");
        oicq.wlogin_sdk.a.g gVar = new oicq.wlogin_sdk.a.g();
        TransReqContext transReqContext = new TransReqContext();
        oicq.wlogin_sdk.a.h hVar = this.mRegStatus;
        transReqContext.set_register_req();
        transReqContext.set_subcmd(gVar.a());
        transReqContext._body = gVar.b(hVar.e, bArr);
        return RequestTransport(0, 1, null, 0L, hVar.i, transReqContext, wUserSigInfo);
    }

    public int RequestTransport(int i, int i2, String str, long j, long j2, TransReqContext transReqContext, WUserSigInfo wUserSigInfo) {
        String str2;
        String str3;
        z zVar;
        byte[] bArr;
        byte[] bArr2;
        long j3;
        TransReqContext transReqContext2;
        long j4;
        long j5;
        int i3;
        if (i == 0) {
            new HelperThread(this, this.mHelperHandler, i2, str, j, j2, transReqContext, wUserSigInfo, "RequestTransport").RunReq(9);
            return -1001;
        }
        t a2 = this.mG.a(0L);
        util.LOGI("user:" + str + " encrypt:" + i2 + " appid:" + j + " role:" + j2 + " Seq:" + a2.h + " RequestTransport...", str);
        a2.g = str;
        if (i2 == 0) {
            str2 = " Seq:";
            str3 = " role:";
            a2.f = 0L;
            zVar = new z(a2);
            bArr = null;
            bArr2 = null;
            j3 = a2.f;
            transReqContext2 = transReqContext;
            j4 = j;
            j5 = j2;
        } else {
            if (str != null) {
                str2 = " Seq:";
                str3 = " role:";
                WloginSimpleInfo wloginSimpleInfo = new WloginSimpleInfo();
                if (str == null || !GetBasicUserInfo(str, wloginSimpleInfo).booleanValue()) {
                    i3 = -1003;
                } else {
                    WloginSigInfo a3 = a2.a(wloginSimpleInfo._uin, j);
                    if (a3 == null) {
                        i3 = -1004;
                    } else {
                        a2.f = wloginSimpleInfo._uin;
                        i3 = new z(a2).a(wloginSimpleInfo._uin, transReqContext, a3._userStSig, a3._userSt_Key, j, j2, wUserSigInfo);
                    }
                }
                a2.i();
                util.LOGI("user:" + str + " encrypt:" + i2 + " appid:" + j + str3 + j2 + str2 + a2.h + " RequestTransport ret=" + i3, str);
                return i3;
            }
            a2.m = 0;
            bArr = null;
            bArr2 = null;
            str2 = " Seq:";
            zVar = new z(a2);
            str3 = " role:";
            j3 = 0;
            transReqContext2 = transReqContext;
            j4 = j;
            j5 = j2;
        }
        i3 = zVar.a(j3, transReqContext2, bArr, bArr2, j4, j5, wUserSigInfo);
        a2.i();
        util.LOGI("user:" + str + " encrypt:" + i2 + " appid:" + j + str3 + j2 + str2 + a2.h + " RequestTransport ret=" + i3, str);
        return i3;
    }

    public int RequestTransportMsf(int i, int i2, String str, long j, long j2, TransReqContext transReqContext) {
        String str2;
        String str3;
        String str4;
        int a2;
        if (i == 0) {
            new HelperThread(this, this.mHelperHandler, i2, str, j, j2, transReqContext, "RequestTransportMsf").RunReq(10);
            return -1001;
        }
        t a3 = this.mG.a(0L);
        util.LOGI("user:" + str + " encrypt:" + i2 + " appid:" + j + " role:" + j2 + " Seq:" + a3.h + " RequestTransportMsf...", str);
        a3.g = str;
        if (i2 != 0) {
            WloginSimpleInfo wloginSimpleInfo = new WloginSimpleInfo();
            if (str == null || !GetBasicUserInfo(str, wloginSimpleInfo).booleanValue()) {
                str2 = " Seq:";
                str3 = " appid:";
                str4 = " role:";
                a2 = -1003;
            } else {
                WloginSigInfo a4 = a3.a(wloginSimpleInfo._uin, j);
                if (a4 == null) {
                    str2 = " Seq:";
                    str3 = " appid:";
                    str4 = " role:";
                    a2 = -1004;
                } else {
                    a3.f = wloginSimpleInfo._uin;
                    str2 = " Seq:";
                    str4 = " role:";
                    str3 = " appid:";
                    a2 = new z(a3).a(wloginSimpleInfo._uin, transReqContext, a4._userStSig, a4._userSt_Key, a4._TGT, j, j2, new WUserSigInfo());
                }
            }
        } else {
            str2 = " Seq:";
            str3 = " appid:";
            str4 = " role:";
            if (util.check_uin_account(str).booleanValue() && Long.parseLong(str) == 0) {
                a3.f = 0L;
                a2 = new z(a3).a(0L, transReqContext, (byte[]) null, (byte[]) null, new byte[0], j, j2, new WUserSigInfo());
            } else {
                WloginSimpleInfo wloginSimpleInfo2 = new WloginSimpleInfo();
                if (str != null && GetBasicUserInfo(str, wloginSimpleInfo2).booleanValue()) {
                    WloginSigInfo a5 = a3.a(wloginSimpleInfo2._uin, j);
                    if (a5 != null) {
                        a3.f = wloginSimpleInfo2._uin;
                        a2 = new z(a3).a(wloginSimpleInfo2._uin, transReqContext, (byte[]) null, (byte[]) null, a5._TGT, j, j2, new WUserSigInfo());
                    }
                    a2 = -1004;
                }
                a2 = -1003;
            }
        }
        a3.i();
        util.LOGI("user:" + str + " encrypt:" + i2 + str3 + j + str4 + j2 + str2 + a3.h + " RequestTransportMsf ret=" + a2, str);
        return a2;
    }

    public WUserSigInfo ResolveQloginIntentReserved(Intent intent) {
        if (intent == null || intent.getExtras().getInt("quicklogin_ret") != 0) {
            return null;
        }
        String string = intent.getExtras().getString("quicklogin_uin");
        byte[] byteArray = intent.getExtras().getByteArray("quicklogin_buff");
        if (string == null || byteArray == null) {
            return null;
        }
        WUserSigInfo wUserSigInfo = new WUserSigInfo();
        wUserSigInfo._fastLoginBuf = new RSACrypt(this.mContext).DecryptData(null, byteArray);
        if (wUserSigInfo._fastLoginBuf == null) {
            util.LOGI("rsa decrypt failed", "");
            return null;
        }
        wUserSigInfo.uin = string;
        return wUserSigInfo;
    }

    public void SetAppClientVersion(int i) {
        t.w = i;
    }

    public void SetCanWebVerify(int i) {
        l.I = i;
    }

    public void SetDevlockMobileType(int i) {
        s.I = i;
    }

    public void SetImgType(int i) {
        t.x = i;
        this.mMiscBitmap |= 128;
    }

    public WtloginListener SetListener(WtloginListener wtloginListener) {
        WtloginListener wtloginListener2 = this.mListener;
        this.mListener = wtloginListener;
        return wtloginListener2;
    }

    public void SetLocalId(int i) {
        t.u = i;
    }

    public void SetMsfTransportFlag(int i) {
        t tVar = this.mG;
        tVar.k = i;
        if (i != 0) {
            t.ad = new byte[4];
            t.ac = 0L;
            tVar.l = 45000;
        }
    }

    public int SetNeedForPayToken(String str, String str2, byte[] bArr) {
        if (str == null || str.length() <= 0) {
            return -1;
        }
        l.J = str.getBytes();
        if (bArr != null) {
            l.L = bArr;
        }
        if (str2 == null || str2.length() == 0) {
            str2 = util.getChannelId(this.mContext, null);
        }
        l.K = str2.getBytes();
        return (str2 == null || str2.length() == 0) ? -2 : 0;
    }

    public void SetPicType(int i) {
        t.y = i;
    }

    public void SetRegDevLockFlag(int i) {
        t.z = i;
    }

    public void SetSigMap(int i) {
        this.mMainSigMap = i | 192;
    }

    public void SetTestHost(int i, String str) {
        oicq_request.a(i, str);
    }

    public void SetTimeOut(int i) {
        this.mG.l = i;
    }

    public int VerifyCode(String str, long j, boolean z, byte[] bArr, int[] iArr, int i, WUserSigInfo wUserSigInfo) {
        byte[] bArr2;
        WloginSimpleInfo wloginSimpleInfo = new WloginSimpleInfo();
        if (!GetBasicUserInfo(str, wloginSimpleInfo).booleanValue()) {
            return -1003;
        }
        long j2 = wloginSimpleInfo._uin;
        WloginSigInfo FindUserSig = FindUserSig(j2, j);
        if (FindUserSig == null) {
            return -1004;
        }
        tlv_t400 tlv_t400Var = new tlv_t400();
        byte[] bArr3 = new byte[0];
        if (FindUserSig._G == null || FindUserSig._G.length <= 0 || FindUserSig._dpwd == null || FindUserSig._dpwd.length <= 0 || FindUserSig._randseed == null || FindUserSig._randseed.length <= 0) {
            bArr2 = bArr3;
        } else {
            tlv_t400Var.get_tlv_400(FindUserSig._G, j2, t.A, FindUserSig._dpwd, j, 1L, FindUserSig._randseed);
            bArr2 = tlv_t400Var.get_data();
        }
        util.LOGI("user:" + str + " VerifyCode ...", str);
        oicq.wlogin_sdk.code2d.e eVar = new oicq.wlogin_sdk.code2d.e();
        TransReqContext transReqContext = new TransReqContext();
        transReqContext.set_code2d_func_req();
        transReqContext.set_subcmd(eVar.get_cmd());
        transReqContext.setSTEncryptMethod();
        transReqContext.setWtST(FindUserSig);
        transReqContext._body = eVar.a(j2, j, z, bArr, iArr, FindUserSig._userStSig, t.A, t.E, i, bArr2);
        return RequestTransport(0, 1, str, j, eVar._role, transReqContext, wUserSigInfo);
    }

    public int VerifySMSVerifyLoginCode(String str, String str2, WUserSigInfo wUserSigInfo) {
        return VerifySMSVerifyLoginCode(str, str2, wUserSigInfo, 0);
    }

    public boolean getHasPassword(long j) {
        UinInfo c2;
        String e = this.mG.e(j);
        util.LOGI("getHasPasswd ..." + String.valueOf(e), "" + j);
        if (e == null || (c2 = this.mG.c(e)) == null) {
            return true;
        }
        boolean hasPassword = c2.getHasPassword();
        util.LOGI("getHasPasswd userAccount: " + e + ", uin: " + j + " hasPasswd: " + hasPassword, "");
        return hasPassword;
    }

    public int getStWithQrSig(String str, long j, long j2, int i, WUserSigInfo wUserSigInfo) {
        return getStWithQrSig(str, j, j2, i, wUserSigInfo, 0);
    }

    public String getUserAccountFromQuickLoginResultData(Intent intent) {
        boolean booleanExtra = intent.getBooleanExtra("isRetFromWeb", false);
        util.LOGI("getUserAccountFromQuickLoginResultData isRetFromWeb " + booleanExtra);
        String stringExtra = intent.getStringExtra(!booleanExtra ? "quicklogin_uin" : "uin");
        return stringExtra == null ? "" : stringExtra;
    }

    public String getUserInputFromQuickLoginResultData(Intent intent) {
        boolean booleanExtra = intent.getBooleanExtra("isRetFromWeb", false);
        util.LOGI("getUserAccountFromQuickLoginResultData isRetFromWeb " + booleanExtra);
        return true == booleanExtra ? intent.getStringExtra("input") : "";
    }

    public int onQuickLoginActivityResultData(QuickLoginParam quickLoginParam, Intent intent) {
        String str;
        if (intent == null) {
            str = "onActivityResultData data is null";
        } else if (quickLoginParam == null) {
            str = "onActivityResultData quickLoginParam is null";
        } else {
            boolean booleanExtra = intent.getBooleanExtra("isRetFromWeb", false);
            util.LOGI("onQuickLoginActivityResultData isRetFromWeb " + booleanExtra);
            if (booleanExtra) {
                quickLoginParam.userAccount = getUserInputFromQuickLoginResultData(intent);
                return getStWithPtSig(intent.getStringExtra("uin"), intent.getStringExtra("sig"), quickLoginParam);
            }
            WUserSigInfo ResolveQloginIntentReserved = ResolveQloginIntentReserved(intent);
            if (ResolveQloginIntentReserved != null) {
                quickLoginParam.userSigInfo.uin = ResolveQloginIntentReserved.uin;
                quickLoginParam.userSigInfo._fastLoginBuf = ResolveQloginIntentReserved._fastLoginBuf;
                return getStWithQQSig("" + ResolveQloginIntentReserved.uin, quickLoginParam);
            }
            str = "onActivityResultData ResolveQloginIntent failed";
        }
        util.LOGI(str, "");
        return -1017;
    }

    public int quickLogin(Activity activity, long j, long j2, String str, QuickLoginParam quickLoginParam) {
        try {
            Method method = Class.forName("oicq.wlogin_sdk.quicklogin.QuickLogin").getMethod("jumpToLoginActivity", Context.class, Activity.class, Long.TYPE, Long.TYPE, String.class, QuickLoginParam.class);
            Object[] objArr = new Object[6];
            try {
                objArr[0] = this.mContext;
                objArr[1] = activity;
                objArr[2] = Long.valueOf(j);
                objArr[3] = Long.valueOf(j2);
                objArr[4] = str;
                objArr[5] = quickLoginParam;
                return ((Integer) method.invoke(null, objArr)).intValue();
            } catch (Exception unused) {
                return 0;
            }
        } catch (Exception unused2) {
        }
    }

    public int quickRegisterCheckAccount(long j, long j2, int i, int i2, byte[] bArr, WUserSigInfo wUserSigInfo) {
        return 0;
    }

    public int quickRegisterGetAccount(long j, long j2, int i, int i2, byte[] bArr, byte[] bArr2, String str, WUserSigInfo wUserSigInfo) {
        return 0;
    }

    public void setBabyQFlg(boolean z) {
        t.ag = z;
    }

    public void setCallSource(int i) {
        t.af = i;
    }

    public void setForQCall() {
        t.f85591ar = true;
        WtloginMsfListener.CLIENT_CLASSNAME = "com.tencent.lightalk.msf.core.auth.WtProvider";
    }

    public void setHasPassword(long j, boolean z) {
        String e = this.mG.e(j);
        util.LOGI("setHasPasswd ..." + String.valueOf(e), "");
        if (e == null) {
            return;
        }
        this.mG.a(e, Long.valueOf(j), z);
        util.LOGI("setHasPasswd userAccount: " + e + ", uin: " + j + " hasPassword:" + z, "");
    }

    public void setMsgType(int i, int i2, int i3) {
        DevlockBase.a.f85525a = i;
        DevlockBase.a.f85526b = i2;
        DevlockBase.a.f85527c = i3;
    }
}