手机管家 v7.2.0版本的 MD5 值为:dd92ba71696e35a4b841cd1b5de53cd3
以下内容为反编译后的 oicq_request.java 源代码,内容仅作参考
package oicq.wlogin_sdk.request;
import android.content.Context;
import com.tencent.kingkong.database.SQLiteDatabase;
import java.io.InputStream;
import java.io.OutputStream;
import java.lang.reflect.Array;
import java.net.HttpURLConnection;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.net.URL;
import java.util.Random;
import oicq.wlogin_sdk.b.aa;
import oicq.wlogin_sdk.b.ab;
import oicq.wlogin_sdk.b.ad;
import oicq.wlogin_sdk.b.ae;
import oicq.wlogin_sdk.b.ah;
import oicq.wlogin_sdk.b.ai;
import oicq.wlogin_sdk.b.aj;
import oicq.wlogin_sdk.b.ak;
import oicq.wlogin_sdk.b.an;
import oicq.wlogin_sdk.b.ap;
import oicq.wlogin_sdk.b.aq;
import oicq.wlogin_sdk.b.at;
import oicq.wlogin_sdk.b.au;
import oicq.wlogin_sdk.b.ax;
import oicq.wlogin_sdk.b.ay;
import oicq.wlogin_sdk.b.az;
import oicq.wlogin_sdk.b.bb;
import oicq.wlogin_sdk.b.bc;
import oicq.wlogin_sdk.b.bd;
import oicq.wlogin_sdk.b.be;
import oicq.wlogin_sdk.b.bg;
import oicq.wlogin_sdk.b.bh;
import oicq.wlogin_sdk.b.bi;
import oicq.wlogin_sdk.b.bj;
import oicq.wlogin_sdk.b.bl;
import oicq.wlogin_sdk.b.bm;
import oicq.wlogin_sdk.b.bq;
import oicq.wlogin_sdk.b.br;
import oicq.wlogin_sdk.b.bt;
import oicq.wlogin_sdk.b.bu;
import oicq.wlogin_sdk.b.bx;
import oicq.wlogin_sdk.b.cb;
import oicq.wlogin_sdk.b.cd;
import oicq.wlogin_sdk.b.ce;
import oicq.wlogin_sdk.b.cf;
import oicq.wlogin_sdk.b.ci;
import oicq.wlogin_sdk.b.cl;
import oicq.wlogin_sdk.b.cm;
import oicq.wlogin_sdk.b.cn;
import oicq.wlogin_sdk.b.z;
import oicq.wlogin_sdk.report.report_t3;
import oicq.wlogin_sdk.sharemem.WloginSigInfo;
import oicq.wlogin_sdk.sharemem.WloginSimpleInfo;
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.cryptor;
import oicq.wlogin_sdk.tools.util;
import tcs.hv;
import tcs.vf;
public class oicq_request {
static String[] C = {"111.30.137.20", "123.126.122.126", "123.151.176.23", "120.198.203.150", "14.17.41.156", "163.177.71.159", "101.227.130.77", "117.135.172.187", "140.207.69.123"};
static String[] D = {"180.163.15.182", "183.192.200.28", "223.167.105.36", "183.61.56.18", "183.232.119.221", "163.177.86.123", "123.151.92.19", "125.39.52.120", "123.126.121.172", "117.135.169.107"};
static int F = 0;
static String eCh = SQLiteDatabase.KeyEmpty;
static String eCi = SQLiteDatabase.KeyEmpty;
public Context a;
byte w;
public s x;
int b = 4096;
int c = 0;
int d = 27;
int e = 0;
public int f = 15;
protected int g = 0;
protected byte[] h = new byte[this.b];
protected int adp = hv.bNB;
protected int adq = 0;
protected int bDY = 3;
protected int eDt = 0;
protected int alK = 0;
protected int alL = 2;
protected int csc = 0;
protected int alN = 0;
InetSocketAddress q = null;
int eKq = 0;
byte[] s = new byte[6144];
protected int eDw = 0;
protected int u = 0;
protected String eDy = SQLiteDatabase.KeyEmpty;
protected EncryptionMethod y = EncryptionMethod.EM_ECDH;
protected boolean eCO = false;
protected byte[] A = new byte[0];
protected byte[] B = new byte[0];
int E = 0;
public enum EncryptionMethod {
EM_ECDH,
EM_ST
}
public String a(boolean z) {
return !z ? C[((int) (Math.random() * 2.147483647E9d)) % C.length] : D[((int) (Math.random() * 2.147483647E9d)) % D.length];
}
public static void a(int i, String str) {
F = i;
eCh = str;
}
private void a(int i, int i2, long j, int i3, int i4, int i5, int i6) {
int i7;
if (!this.eCO) {
i7 = 7;
} else {
i7 = 135;
}
a(i, i2, j, i7, i3, i4, i5, i6);
}
private void b(int i, int i2, long j, int i3, int i4, int i5, int i6) {
a(i, i2, j, 69, i3, i4, i5, i6);
}
private void a(int i, int i2, long j, int i3, int i4, int i5, int i6, int i7) {
int i8 = this.adq + 1;
this.adq = i8;
this.c = 0;
util.int8_to_buf(this.h, this.c, 2);
this.c++;
util.int16_to_buf(this.h, this.c, this.d + 2 + i7);
this.c += 2;
util.int16_to_buf(this.h, this.c, i);
this.c += 2;
util.int16_to_buf(this.h, this.c, i2);
this.c += 2;
util.int16_to_buf(this.h, this.c, i8);
this.c += 2;
util.int32_to_buf(this.h, this.c, (int) j);
this.c += 4;
util.int8_to_buf(this.h, this.c, 3);
this.c++;
util.int8_to_buf(this.h, this.c, i3);
this.c++;
util.int8_to_buf(this.h, this.c, i4);
this.c++;
util.int32_to_buf(this.h, this.c, 2);
this.c += 4;
util.int32_to_buf(this.h, this.c, i5);
this.c += 4;
util.int32_to_buf(this.h, this.c, i6);
this.c += 4;
}
public void a(int i, int i2, int i3, long j, int i4, int i5, int i6, int i7, int i8) {
int i9 = this.adq + 1;
this.adq = i9;
this.c = 0;
util.int8_to_buf(this.h, this.c, 2);
this.c++;
util.int16_to_buf(this.h, this.c, this.d + 2 + i8);
this.c += 2;
util.int16_to_buf(this.h, this.c, i);
this.c += 2;
util.int16_to_buf(this.h, this.c, i2);
this.c += 2;
util.int16_to_buf(this.h, this.c, i9);
this.c += 2;
util.int32_to_buf(this.h, this.c, (int) j);
this.c += 4;
util.int8_to_buf(this.h, this.c, 3);
this.c++;
util.int8_to_buf(this.h, this.c, 7);
this.c++;
util.int8_to_buf(this.h, this.c, i4);
this.c++;
util.int32_to_buf(this.h, this.c, i5);
this.c += 4;
util.int32_to_buf(this.h, this.c, i6);
this.c += 4;
util.int32_to_buf(this.h, this.c, i7);
this.c += 4;
}
public void a() {
util.int8_to_buf(this.h, this.c, 3);
this.c++;
}
public void g(byte[] bArr, int i) {
if (this.c + i + 1 > this.b) {
this.b = this.c + i + 1 + 128;
byte[] bArr2 = new byte[this.b];
System.arraycopy(this.h, 0, bArr2, 0, this.c);
this.h = bArr2;
}
System.arraycopy(bArr, 0, this.h, this.c, i);
this.c += i;
}
public void a(int i, int i2, int i3, long j, int i4, int i5, int i6, int i7, byte[] bArr, int i8) {
a(i, i2, i3, j, i4, i5, i6, i7, i8);
g(bArr, i8);
a();
}
public void a(int i, int i2, int i3, long j, int i4, int i5, int i6, int i7, byte[] bArr) {
a(i, i2, i3, j, i4, i5, i6, i7, bArr, bArr.length);
}
private void a(int i, int i2, long j, int i3, int i4, int i5, byte[] bArr) {
a(i, i2, j, i3, i4, i5, bArr.length);
g(bArr, bArr.length);
a();
}
private void b(int i, int i2, long j, int i3, int i4, int i5, byte[] bArr) {
b(i, i2, j, i3, i4, i5, bArr.length);
g(bArr, bArr.length);
a();
}
public void a(long j, byte[] bArr) {
a(this.adp, this.eDw, j, this.alK, s.w, this.alN, bArr);
}
public void b(long j, byte[] bArr) {
b(this.adp, this.eDw, j, this.alK, s.w, this.alN, bArr);
}
public void a(long j, byte[] bArr, EncryptionMethod encryptionMethod) {
if (encryptionMethod == EncryptionMethod.EM_ST) {
b(j, bArr);
} else if (encryptionMethod == EncryptionMethod.EM_ECDH) {
a(j, bArr);
} else {
util.LOGI("getRequestEncrptedPackage unknown encryption method " + encryptionMethod, SQLiteDatabase.KeyEmpty + j);
}
}
public int b() {
int i;
if (this.c <= this.f + 2) {
return util.E_PK_LEN;
}
this.g = (r3 - this.f) - 2;
int buf_to_int16 = util.buf_to_int16(this.h, 13);
util.LOGI("enrypt method " + this.y + " rsp flag " + buf_to_int16, SQLiteDatabase.KeyEmpty);
if (this.y == EncryptionMethod.EM_ECDH && buf_to_int16 == 0) {
if (this.x.alK == 0) {
i = a(this.h, this.f + 1, this.g, this.x.p);
if (i < 0) {
util.LOGI("use ecdh decrypt_body failed", SQLiteDatabase.KeyEmpty);
i = a(this.h, this.f + 1, this.g, this.x.agT);
if (i < 0) {
util.LOGI("use kc decrypt_body failed", SQLiteDatabase.KeyEmpty);
}
}
} else {
i = a(this.h, this.f + 1, this.g, this.x.agT);
if (i < 0) {
util.LOGI("use kc decrypt_body failed", SQLiteDatabase.KeyEmpty);
}
}
} else if (this.y == EncryptionMethod.EM_ST && 3 == buf_to_int16) {
i = a(this.h, this.f + 1, this.g, this.B);
if (i < 0) {
s.al.attr_api(2494911);
async_context b = s.b(this.x.afZ);
if (b != null) {
this.x.c(this.x.WA, b._sappid);
}
util.LOGI("use session key decrypt_body failed", SQLiteDatabase.KeyEmpty);
i = util.E_NEWST_DECRYPT;
}
} else if (this.y == EncryptionMethod.EM_ECDH && true == this.eCO && 4 == buf_to_int16) {
byte[] decrypt = cryptor.decrypt(this.h, this.f + 1, this.g, this.x.p);
if (decrypt == null) {
util.LOGI("decrypted outer body failed", SQLiteDatabase.KeyEmpty + this.x.WA);
return -1002;
}
int buf_to_int162 = util.buf_to_int16(decrypt, 0);
if (buf_to_int162 > decrypt.length - 2) {
util.LOGI("peer public key len wrong " + buf_to_int162, SQLiteDatabase.KeyEmpty + this.x.WA);
return util.E_PK_LEN;
}
byte[] bArr = new byte[buf_to_int162];
System.arraycopy(decrypt, 2, bArr, 0, buf_to_int162);
byte[] calShareKeyMd5ByPeerPublicKey = new EcdhCrypt(this.a).calShareKeyMd5ByPeerPublicKey(bArr);
if (calShareKeyMd5ByPeerPublicKey == null || calShareKeyMd5ByPeerPublicKey.length == 0) {
return -1002;
}
byte[] decrypt2 = cryptor.decrypt(decrypt, buf_to_int162 + 2, (decrypt.length - 2) - buf_to_int162, calShareKeyMd5ByPeerPublicKey);
if (decrypt2 == null) {
s.al.attr_api(2461266);
util.LOGI("use share key md5 decrypt failed", SQLiteDatabase.KeyEmpty + this.x.WA);
return -1002;
}
if (this.h.length < this.f + 2 + decrypt2.length) {
this.b = this.f + 2 + decrypt2.length;
byte[] bArr2 = new byte[this.b];
System.arraycopy(this.h, 0, bArr2, 0, this.f + 1);
this.h = bArr2;
}
System.arraycopy(decrypt2, 0, this.h, this.f + 1, decrypt2.length);
this.c = decrypt2.length + this.f + 2 + this.c;
i = 0;
} else {
util.LOGI("unknown encryption method " + this.y, SQLiteDatabase.KeyEmpty);
i = util.E_ENCRYPTION_METHOD;
}
if (i >= 0) {
return d(this.h, this.f + 1, this.g);
}
return i;
}
public void b(byte[] bArr, int i) {
if (i > this.b) {
this.b = i + 128;
this.h = new byte[this.b];
}
this.c = i;
System.arraycopy(bArr, 0, this.h, 0, i);
}
public byte[] pu() {
byte[] bArr = new byte[this.c];
System.arraycopy(this.h, 0, bArr, 0, this.c);
return bArr;
}
public int a(byte[] bArr, int i, int i2, byte[] bArr2) {
byte[] decrypt = cryptor.decrypt(bArr, i, i2, bArr2);
if (decrypt == null) {
return -1002;
}
this.g = decrypt.length;
if (decrypt.length + this.f + 2 > this.b) {
this.b = decrypt.length + this.f + 2;
byte[] bArr3 = new byte[this.b];
System.arraycopy(this.h, 0, bArr3, 0, this.c);
this.h = bArr3;
}
this.c = 0;
System.arraycopy(decrypt, 0, this.h, i, decrypt.length);
this.c = decrypt.length + this.f + 2 + this.c;
return 0;
}
byte[] a(byte[] bArr, byte[] bArr2, byte[] bArr3, byte[] bArr4) {
if (bArr == null || bArr2 == null || bArr3 == null || bArr4 == null) {
return new byte[0];
}
byte[] encrypt = cryptor.encrypt(bArr, 0, bArr.length, bArr4);
byte[] bArr5 = new byte[bArr2.length + 2 + 2 + 2 + bArr3.length + encrypt.length];
util.int8_to_buf(bArr5, 0, 1);
util.int8_to_buf(bArr5, 1, 1);
System.arraycopy(bArr2, 0, bArr5, 2, bArr2.length);
int length = bArr2.length + 2;
util.int16_to_buf(bArr5, length, vf.s.fmo);
int i = length + 2;
util.int16_to_buf(bArr5, i, bArr3.length);
int i2 = i + 2;
System.arraycopy(bArr3, 0, bArr5, i2, bArr3.length);
System.arraycopy(encrypt, 0, bArr5, i2 + bArr3.length, encrypt.length);
return bArr5;
}
byte[] a(byte[] bArr, byte[] bArr2) {
if (bArr == null || bArr2 == null) {
return new byte[0];
}
int i = this.x.alK == 2 ? 3 : 2;
byte[] encrypt = cryptor.encrypt(bArr, 0, bArr.length, bArr2);
byte[] bArr3 = new byte[bArr2.length + 2 + 2 + 2 + encrypt.length];
util.int8_to_buf(bArr3, 0, 1);
util.int8_to_buf(bArr3, 1, i);
System.arraycopy(bArr2, 0, bArr3, 2, bArr2.length);
int length = bArr2.length + 2;
util.int16_to_buf(bArr3, length, vf.s.fmo);
int i2 = length + 2;
util.int16_to_buf(bArr3, i2, 0);
System.arraycopy(encrypt, 0, bArr3, i2 + 2, encrypt.length);
return bArr3;
}
byte[] a(byte[] bArr, byte[] bArr2, byte[] bArr3) {
byte[] encrypt = cryptor.encrypt(bArr, 0, bArr.length, bArr3);
byte[] bArr4 = new byte[bArr2.length + 2 + encrypt.length];
util.int16_to_buf(bArr4, 0, bArr2.length);
System.arraycopy(bArr2, 0, bArr4, 2, bArr2.length);
System.arraycopy(encrypt, 0, bArr4, bArr2.length + 2, encrypt.length);
return bArr4;
}
public byte[] a(byte[] bArr, int i, int i2) {
byte[] bArr2 = new byte[bArr.length + 4];
util.int16_to_buf(bArr2, 0, i);
util.int16_to_buf(bArr2, 2, i2);
System.arraycopy(bArr, 0, bArr2, 4, bArr.length);
return bArr2;
}
public byte[] b(byte[] bArr, int i, int i2) {
byte[] bArr2 = new byte[bArr.length + 4];
util.int16_to_buf(bArr2, 0, i);
util.int16_to_buf(bArr2, 2, i2);
System.arraycopy(bArr, 0, bArr2, 4, bArr.length);
return this.x.alK == 0 ? a(bArr2, this.x.agT, this.x.n, this.x.p) : a(bArr2, this.x.agT);
}
public byte[] a(byte[] bArr, EncryptionMethod encryptionMethod, byte[] bArr2, byte[] bArr3) {
if (EncryptionMethod.EM_ST == encryptionMethod) {
return b(bArr, bArr2, bArr3);
}
if (EncryptionMethod.EM_ECDH == encryptionMethod) {
return a(bArr);
}
util.LOGI("encryptBody unknown encryption method " + encryptionMethod, SQLiteDatabase.KeyEmpty);
return null;
}
public byte[] a(byte[] bArr) {
return this.x.alK == 0 ? a(bArr, this.x.agT, this.x.n, this.x.p) : a(bArr, this.x.agT);
}
protected byte[] b(byte[] bArr, byte[] bArr2, byte[] bArr3) {
return a(bArr, bArr2, bArr3);
}
public Socket d() {
return this.x.ah;
}
public void a(Socket socket) {
this.x.ah = socket;
}
public String b(boolean z) {
String[] strArr = new String[2];
if (z) {
strArr[0] = "wlogin.qq.com";
strArr[1] = "wlogin1.qq.com";
} else {
strArr[0] = "wtlogin.qq.com";
strArr[1] = "wtlogin1.qq.com";
}
return strArr[Math.abs(new Random().nextInt() % strArr.length)];
}
public int c(boolean z) {
if (z) {
}
return 443;
}
public String a(int i, boolean z) {
String str = SQLiteDatabase.KeyEmpty;
int i2 = i / 2;
if (F != 0 && eCh != null && eCh.length() > 0) {
str = eCh;
} else if (i2 < 1) {
if (z) {
if (s.D == 1) {
str = new String(util.get_wap_server_host1(s.t));
} else if (s.D == 2) {
str = new String(util.get_wap_server_host2(s.t));
}
} else if (s.D == 1) {
str = new String(util.get_server_host1(s.t));
} else if (s.D == 2) {
str = new String(util.get_server_host2(s.t));
}
if (str.length() <= 0) {
str = b(z);
}
} else if (i2 < 2) {
str = b(z);
} else {
str = a(z);
}
eCi = str;
return str;
}
public int a(String str, boolean z, WUserSigInfo wUserSigInfo) {
int lU;
if (this.x.e()) {
lU = b(str, z, wUserSigInfo);
} else {
lU = lU();
}
if (lU == -1000) {
ErrMsg errMsg = new ErrMsg();
errMsg.setMessage(InternationMsg.a(InternationMsg.MSG_TYPE.MSG_4));
a(errMsg);
}
return lU;
}
public int b(String str, boolean z, WUserSigInfo wUserSigInfo) {
Exception exc;
Object[] objArr;
?? r1;
WtloginMsfListener wtloginMsfListener;
util.LOGI(getClass().getName() + ":snd_rcv_req_msf ...", SQLiteDatabase.KeyEmpty + this.x.WA);
int i = this.x.eDt;
byte[] pu = pu();
long currentTimeMillis = System.currentTimeMillis();
try {
util.LOGI("WtloginMsfListener uin:" + str + " service_cmd:" + this.eDy + " timeout:" + i + " flag:" + z, SQLiteDatabase.KeyEmpty + this.x.WA);
wtloginMsfListener = new WtloginMsfListener(str, this.eDy, pu, i, z, wUserSigInfo);
Thread thread = new Thread(wtloginMsfListener);
thread.start();
thread.join(i);
r1 = wtloginMsfListener.getRetData();
} catch (Exception e) {
exc = e;
objArr = null;
}
try {
if (r1 == 0) {
util.LOGI("recv data from server failed, ret=" + wtloginMsfListener.xE(), SQLiteDatabase.KeyEmpty + this.x.WA);
r1 = -1000;
objArr = r1;
} else {
b(r1, r1.length);
r1 = 0;
objArr = r1;
}
} catch (Exception e2) {
objArr = r1;
exc = e2;
util.printException(exc, SQLiteDatabase.KeyEmpty + this.x.WA);
r1 = -1000;
if (this.eDw != 2066) {
}
util.LOGI(getClass().getName() + ":snd_rcv_req_msf ret=" + r1, SQLiteDatabase.KeyEmpty + this.x.WA);
return r1;
}
if (this.eDw != 2066) {
report_t3 report_t3Var = new report_t3();
report_t3Var._cmd = this.eDw;
report_t3Var._sub = this.u;
report_t3Var._rst2 = r1;
report_t3Var._used = (int) (System.currentTimeMillis() - currentTimeMillis);
report_t3Var._try = 0;
report_t3Var._host = SQLiteDatabase.KeyEmpty;
report_t3Var._ip = SQLiteDatabase.KeyEmpty;
report_t3Var._port = 0;
report_t3Var._conn = 0;
report_t3Var._net = 0;
report_t3Var._str = SQLiteDatabase.KeyEmpty;
if (r1 == 0) {
report_t3Var._slen = pu.length;
report_t3Var._rlen = objArr.length;
} else {
report_t3Var._slen = 0;
report_t3Var._rlen = 0;
}
report_t3Var._wap = 3;
s.al.add_t3(report_t3Var);
}
util.LOGI(getClass().getName() + ":snd_rcv_req_msf ret=" + r1, SQLiteDatabase.KeyEmpty + this.x.WA);
return r1;
}
public int b(byte[] bArr) {
return util.buf_to_int16(bArr, 1);
}
private void a(int i, long j, int i2, int i3, boolean z, boolean z2) {
report_t3 report_t3Var = new report_t3();
report_t3Var._cmd = this.eDw;
report_t3Var._sub = this.u;
report_t3Var._rst2 = i;
report_t3Var._used = (int) (System.currentTimeMillis() - j);
report_t3Var._try = i3;
report_t3Var._host = eCi;
if (report_t3Var._host == null) {
report_t3Var._host = SQLiteDatabase.KeyEmpty;
}
if (this.q == null) {
report_t3Var._ip = SQLiteDatabase.KeyEmpty;
} else {
report_t3Var._ip = this.q.getAddress().getHostAddress();
}
report_t3Var._port = c(z);
report_t3Var._conn = i2;
report_t3Var._net = s.D;
report_t3Var._str = SQLiteDatabase.KeyEmpty;
report_t3Var._slen = 0;
report_t3Var._rlen = 0;
if (z) {
if (z2) {
report_t3Var._wap = 2;
} else {
report_t3Var._wap = 1;
}
} else {
report_t3Var._wap = 0;
}
s.al.add_t3(report_t3Var);
}
public int lU() {
int i;
int i2;
String str;
String str2;
int i3;
String str3;
String str4;
URL url;
String str5;
InputStream inputStream;
Socket socket;
String str6;
Socket socket2;
int i4;
util.LOGI(getClass().getName() + ":snd_rcv_req_tcp ...", SQLiteDatabase.KeyEmpty + this.x.WA);
byte[] pu = pu();
int i5 = 0;
int i6 = 0;
int i7 = 0;
long j = 0;
Socket d = d();
boolean z = false;
boolean z2 = false;
int i8 = 0;
String str7 = SQLiteDatabase.KeyEmpty;
String str8 = SQLiteDatabase.KeyEmpty;
Socket socket3 = d;
while (true) {
if (i7 >= 6) {
i = i5;
break;
}
if (i7 != 0) {
util.chg_retry_type(s.t);
}
z = util.is_wap_retry(s.t);
this.q = null;
if (i7 != 0 && this.eDw != 2066) {
a(i6, j, i8, i7, z, z2);
}
j = System.currentTimeMillis();
if (z) {
util.LOGI("try http connect " + i7 + " ...", SQLiteDatabase.KeyEmpty + this.x.WA);
String a = a(i7, z);
try {
z2 = util.is_wap_proxy_retry(s.t);
if (!z2) {
str2 = null;
i3 = -1;
} else {
String str9 = util.get_proxy_ip();
int i9 = util.get_proxy_port();
if (str9 == null || str9.length() <= 0 || i9 == -1) {
z2 = false;
util.LOGI("proxy_ip=" + str9 + ",proxy_port=" + i9 + ",set is_wap_proxy_retry=false", SQLiteDatabase.KeyEmpty + this.x.WA);
}
str2 = str9;
i3 = i9;
}
if (z2) {
url = new URL("http://" + str2 + ":" + i3 + "/cgi-bin/wlogin_proxy_login");
str4 = str8;
} else {
this.q = a.a(a, 0, this.x.eDt);
if (this.q != null) {
str = this.q.getAddress().getHostAddress();
if (str8.equals(str)) {
throw new Exception("repeated failed http ip " + str8);
break;
}
try {
this.q = null;
str3 = str;
} catch (Exception e) {
i6 = -1000;
i7++;
str8 = str;
}
} else {
str = str8;
str3 = a;
}
str4 = str;
url = new URL("http://" + str3 + "/cgi-bin/wlogin_proxy_login");
}
} catch (Exception e2) {
str = str8;
}
try {
util.LOGI("try http proxy=" + z2 + " connect to " + url + " host " + a, SQLiteDatabase.KeyEmpty + this.x.WA);
HttpURLConnection httpURLConnection = (HttpURLConnection) url.openConnection();
httpURLConnection.setRequestMethod("POST");
if (z2) {
httpURLConnection.setRequestProperty("X-Online-Host", a);
}
httpURLConnection.setRequestProperty("Content-Type", "application/octet-stream");
httpURLConnection.setRequestProperty("Content-Disposition", "attachment; filename=micromsgresp.dat");
httpURLConnection.setRequestProperty("Content-Length", String.valueOf(pu.length));
httpURLConnection.setConnectTimeout(this.x.eDt);
httpURLConnection.setReadTimeout(this.x.eDt);
httpURLConnection.setDoOutput(true);
httpURLConnection.setDoInput(true);
util.LOGI("http request connect ...", SQLiteDatabase.KeyEmpty + this.x.WA);
if (!j.a(httpURLConnection, this.x.eDt)) {
util.LOGI("http request connect failed", SQLiteDatabase.KeyEmpty + this.x.WA);
i7++;
str8 = str4;
i6 = -1000;
} else {
util.LOGI("http request write ...", SQLiteDatabase.KeyEmpty + this.x.WA);
OutputStream outputStream = httpURLConnection.getOutputStream();
outputStream.write(pu, 0, pu.length);
outputStream.flush();
int responseCode = httpURLConnection.getResponseCode();
util.LOGI("http request response code=" + responseCode, SQLiteDatabase.KeyEmpty + this.x.WA);
if (200 != responseCode) {
i7++;
str8 = str4;
i6 = -1000;
} else {
str5 = str7;
inputStream = httpURLConnection.getInputStream();
socket = socket3;
str6 = str4;
}
}
} catch (Exception e3) {
str = str4;
i6 = -1000;
i7++;
str8 = str;
}
} else {
util.LOGI("try bin connect " + i7 + " ...", SQLiteDatabase.KeyEmpty + this.x.WA);
if (socket3 == null) {
String str10 = SQLiteDatabase.KeyEmpty;
i8 = 1;
if (this.q == null) {
str10 = a(i7, z);
util.LOGI("DNS for " + str10 + " request ...", SQLiteDatabase.KeyEmpty + this.x.WA);
try {
this.eKq = c(z);
this.q = a.a(str10, this.eKq, this.x.eDt);
} catch (Exception e4) {
}
}
if (this.q != null && this.q.getAddress() == null) {
if (this.q.getAddress() == null) {
util.LOGI("_server_ip get address failed", SQLiteDatabase.KeyEmpty + this.x.WA);
}
i6 = util.E_RESOLVE_ADDR;
i7++;
this.q = null;
a((Socket) null);
socket3 = null;
} else if (this.q == null || str7.equals(this.q.getAddress().getHostAddress())) {
if (this.q == null) {
util.LOGI("DNS for " + str10 + " request failed", SQLiteDatabase.KeyEmpty + this.x.WA);
i4 = util.E_RESOLVE_ADDR;
} else {
util.LOGI("repeated failed bin ip " + str7, SQLiteDatabase.KeyEmpty + this.x.WA);
i4 = -1000;
}
i7++;
this.q = null;
socket3 = null;
a((Socket) null);
i6 = i4;
} else {
str7 = this.q.getAddress().getHostAddress();
util.LOGI("DNS for " + str10 + "(" + this.q.toString() + ") request OK", SQLiteDatabase.KeyEmpty + this.x.WA);
}
}
String str11 = str7;
if (socket3 == null) {
try {
util.LOGI("tcp connect to " + this.q + " request ...", SQLiteDatabase.KeyEmpty + this.x.WA);
socket2 = new Socket();
a(socket2);
socket2.connect(this.q, this.x.eDt);
socket2.setSoTimeout(this.x.eDt);
socket2.setReceiveBufferSize(this.s.length);
util.LOGI("tcp connect to " + this.q + " OK", SQLiteDatabase.KeyEmpty + this.x.WA);
} catch (Throwable th) {
i6 = -1000;
i7++;
this.q = null;
socket3 = null;
a((Socket) null);
str7 = str11;
}
} else {
socket2 = socket3;
}
util.LOGI("tcp request write ...", SQLiteDatabase.KeyEmpty + this.x.WA);
OutputStream outputStream2 = socket2.getOutputStream();
outputStream2.write(pu, 0, pu.length);
outputStream2.flush();
str6 = str8;
str5 = str11;
inputStream = socket2.getInputStream();
socket = socket2;
}
util.LOGI("recv data from server ...", SQLiteDatabase.KeyEmpty + this.x.WA);
int i10 = 0;
int i11 = 0;
while (i11 < this.f + 1 && (i10 = inputStream.read(this.s, i11, (this.f + 1) - i11)) >= 0) {
i11 += i10;
}
if (i10 < 0) {
i6 = -1000;
i7++;
if (!z) {
socket.close();
this.q = null;
socket = null;
a((Socket) null);
}
str8 = str6;
str7 = str5;
socket3 = socket;
} else {
i = b(this.s);
try {
if (i <= this.f + 1) {
i7++;
if (!z) {
socket.close();
this.q = null;
socket = null;
a((Socket) null);
}
str7 = str5;
i5 = i;
i6 = -1000;
str8 = str6;
socket3 = socket;
} else if (i >= this.s.length) {
i7++;
if (!z) {
socket.close();
this.q = null;
socket = null;
a((Socket) null);
}
str7 = str5;
i5 = i;
i6 = -1000;
str8 = str6;
socket3 = socket;
} else {
int i12 = this.f + 1;
int i13 = i - i12;
while (i13 > 0) {
i10 = inputStream.read(this.s, i12, i13);
if (i10 == -1) {
break;
}
i12 += i10;
i13 -= i10;
}
if (i10 != -1) {
break;
}
i7++;
if (!z) {
socket.close();
this.q = null;
socket = null;
a((Socket) null);
}
str7 = str5;
i5 = i;
i6 = -1000;
str8 = str6;
socket3 = socket;
}
} catch (Throwable th2) {
i7++;
if (!z) {
try {
if (socket.isConnected()) {
socket.close();
}
} catch (Exception e5) {
}
this.q = null;
socket = null;
a((Socket) null);
}
str7 = str5;
i5 = i;
i6 = -1000;
str8 = str6;
socket3 = socket;
}
}
}
if (i7 >= 6) {
i2 = -1000;
} else {
i2 = 0;
}
if (i2 == 0) {
b(this.s, i);
}
if (i2 == 0 && this.eDw != 2066) {
report_t3 report_t3Var = new report_t3();
report_t3Var._cmd = this.eDw;
report_t3Var._sub = this.u;
report_t3Var._rst2 = i2;
report_t3Var._used = (int) (System.currentTimeMillis() - j);
report_t3Var._try = i7;
report_t3Var._host = eCi;
if (report_t3Var._host == null) {
report_t3Var._host = SQLiteDatabase.KeyEmpty;
}
if (this.q == null) {
report_t3Var._ip = SQLiteDatabase.KeyEmpty;
} else {
report_t3Var._ip = this.q.getAddress().getHostAddress();
}
report_t3Var._port = this.eKq;
report_t3Var._conn = i8;
report_t3Var._net = s.D;
report_t3Var._str = SQLiteDatabase.KeyEmpty;
report_t3Var._slen = pu.length;
report_t3Var._rlen = i;
if (z) {
if (z2) {
report_t3Var._wap = 2;
} else {
report_t3Var._wap = 1;
}
} else {
report_t3Var._wap = 0;
}
s.al.add_t3(report_t3Var);
}
util.LOGI(getClass().getName() + ":snd_rcv_req_tcp ret=" + i2, SQLiteDatabase.KeyEmpty + this.x.WA);
return i2;
}
public int c(byte[] bArr, int i) {
this.w = bArr[i];
return bArr[i] & 255;
}
public void c(byte[] bArr, int i, int i2) {
aq aqVar = new aq();
int b = aqVar.b(bArr, i, i2);
async_context b2 = s.b(this.x.afZ);
if (b >= 0) {
b2._last_err_msg.setTitle(new String(aqVar.f()));
b2._last_err_msg.setMessage(new String(aqVar.g()));
b2._last_err_msg.setType(aqVar.je());
b2._last_err_msg.setOtherinfo(new String(aqVar.oV()));
}
}
public void a(ErrMsg errMsg) {
async_context b = s.b(this.x.afZ);
b._last_err_msg = new ErrMsg(0, SQLiteDatabase.KeyEmpty, SQLiteDatabase.KeyEmpty, SQLiteDatabase.KeyEmpty);
if (errMsg != null) {
try {
b._last_err_msg = (ErrMsg) errMsg.clone();
} catch (CloneNotSupportedException e) {
b._last_err_msg = new ErrMsg(0, SQLiteDatabase.KeyEmpty, SQLiteDatabase.KeyEmpty, SQLiteDatabase.KeyEmpty);
}
}
}
public void a(at atVar) {
try {
ErrMsg errMsg = new ErrMsg();
if (atVar != null) {
errMsg.setType(atVar.vo());
errMsg.setTitle(new String(atVar.g()));
errMsg.setMessage(new String(atVar.h()));
errMsg.setOtherinfo(new String(atVar.oV()));
new e(s.t, errMsg).start();
}
} catch (Exception e) {
}
}
public static byte[] b(byte[] bArr, byte[] bArr2) {
byte[] bArr3 = new byte[bArr.length + bArr2.length];
System.arraycopy(bArr, 0, bArr3, 0, bArr.length);
System.arraycopy(bArr2, 0, bArr3, bArr.length, bArr2.length);
return bArr3;
}
public byte[] c(byte[] bArr) {
byte[] decrypt;
if (s.B == null || s.B.length <= 0) {
decrypt = cryptor.decrypt(bArr, 0, bArr.length, "%4;7t>;28<fc.5*6".getBytes());
} else {
byte[] bArr2 = new byte[16];
if (s.B.length > bArr2.length) {
System.arraycopy(s.B, 0, bArr2, 0, bArr2.length);
} else {
System.arraycopy(s.B, 0, bArr2, 0, s.B.length);
for (int length = s.B.length; length < bArr2.length; length++) {
bArr2[length] = (byte) (length + 1);
}
}
decrypt = cryptor.decrypt(bArr, 0, bArr.length, bArr2);
if (decrypt == null || decrypt.length <= 0) {
decrypt = cryptor.decrypt(bArr, 0, bArr.length, "%4;7t>;28<fc.5*6".getBytes());
}
}
byte[] bArr3 = decrypt == null ? (byte[]) bArr.clone() : decrypt;
if (bArr3 == null || bArr3.length < 16) {
return (byte[]) null;
}
int length2 = bArr3.length - 16;
byte[] bArr4 = new byte[length2];
System.arraycopy(bArr3, 0, bArr4, 0, length2);
byte[] bArr5 = new byte[16];
System.arraycopy(bArr3, length2, bArr5, 0, 16);
s.b(this.x.afZ)._tgtgt_key = bArr5;
return bArr4;
}
public int a(int i) {
s.b(this.x.afZ)._last_flowid = i;
return i;
}
public int vo() {
return s.b(this.x.afZ)._last_flowid;
}
public byte[] c(byte[] bArr, byte[] bArr2, byte[] bArr3) {
if (bArr == null || bArr2 == null || bArr3 == null) {
return new byte[16];
}
byte[] bArr4 = new byte[bArr.length + bArr2.length + bArr3.length];
System.arraycopy(bArr, 0, bArr4, 0, bArr.length);
int length = bArr.length + 0;
System.arraycopy(bArr2, 0, bArr4, length, bArr2.length);
System.arraycopy(bArr3, 0, bArr4, length + bArr2.length, bArr3.length);
return MD5.toMD5Byte(bArr4);
}
public byte[] a(bc bcVar) {
oicq.wlogin_sdk.b.h hVar = new oicq.wlogin_sdk.b.h();
oicq.wlogin_sdk.b.n nVar = new oicq.wlogin_sdk.b.n();
bd bdVar = new bd();
ap apVar = new ap();
byte[] sO = bcVar.sO();
int length = sO.length;
if (hVar.b(sO, 2, length) < 0 || nVar.b(sO, 2, length) < 0 || bdVar.b(sO, 2, length) < 0) {
return null;
}
byte[] a = hVar.a();
byte[] a2 = nVar.a();
byte[] a3 = bdVar.a();
byte[] a4 = apVar.a(s.A);
byte[] bArr = new byte[a.length + 3 + a2.length + a3.length + a4.length];
bArr[0] = 64;
util.int16_to_buf(bArr, 1, 4);
System.arraycopy(a, 0, bArr, 3, a.length);
int length2 = a.length + 3;
System.arraycopy(a2, 0, bArr, length2, a2.length);
int length3 = length2 + a2.length;
System.arraycopy(a3, 0, bArr, length3, a3.length);
System.arraycopy(a4, 0, bArr, length3 + a3.length, a4.length);
return bArr;
}
void a(int i, byte[] bArr, int i2) {
if (bArr != null && bArr.length > 0) {
if (i == 1) {
if (s.D == 1) {
util.set_server_host1(s.t, bArr);
} else if (s.D == 2) {
util.set_server_host2(s.t, bArr);
}
} else if (i == 2) {
if (s.D == 1) {
util.set_wap_server_host1(s.t, bArr);
} else if (s.D == 2) {
util.set_wap_server_host2(s.t, bArr);
}
}
util.LOGI("net type:" + s.D + " type:" + i + " host:" + new String(bArr) + " port:" + i2, SQLiteDatabase.KeyEmpty + this.x.WA);
}
}
public int a(bi biVar) {
byte[] sO = biVar.sO();
if (sO != null && sO.length > 2) {
int buf_to_int8 = util.buf_to_int8(sO, 1);
int i = 2;
for (int i2 = 0; i2 < buf_to_int8 && sO.length >= i + 1; i2++) {
int buf_to_int82 = util.buf_to_int8(sO, i);
int i3 = i + 1;
if (sO.length < i3 + 2) {
break;
}
int buf_to_int16 = util.buf_to_int16(sO, i3);
int i4 = i3 + 2;
if (sO.length < i4 + buf_to_int16) {
break;
}
byte[] bArr = new byte[buf_to_int16];
System.arraycopy(sO, i4, bArr, 0, buf_to_int16);
int i5 = i4 + buf_to_int16;
if (sO.length < i5 + 2) {
break;
}
int buf_to_int162 = util.buf_to_int16(sO, i5);
i = i5 + 2;
a(buf_to_int82, bArr, buf_to_int162);
}
}
return 0;
}
public int a(ax axVar) {
bi biVar = new bi();
bh bhVar = new bh();
byte[] sO = axVar.sO();
int length = sO.length;
if (biVar.b(sO, 2, length) > 0) {
a(biVar);
}
if (bhVar.b(sO, 2, length) > 0) {
this.x.alK = 1;
this.x.r = bhVar.sO();
util.LOGI("get rollback sig", SQLiteDatabase.KeyEmpty);
return 0;
}
return 0;
}
public int d(byte[] bArr, int i, int i2) {
int i3;
int b;
byte[] bArr2;
byte[] bArr3;
if (i2 < 5) {
return util.E_PK_LEN;
}
long j = 2160000;
long j2 = 4294967295L;
oicq.wlogin_sdk.b.f fVar = new oicq.wlogin_sdk.b.f();
oicq.wlogin_sdk.b.g gVar = new oicq.wlogin_sdk.b.g();
oicq.wlogin_sdk.b.r rVar = new oicq.wlogin_sdk.b.r();
oicq.wlogin_sdk.b.v vVar = new oicq.wlogin_sdk.b.v();
oicq.wlogin_sdk.b.o oVar = new oicq.wlogin_sdk.b.o();
oicq.wlogin_sdk.b.p pVar = new oicq.wlogin_sdk.b.p();
oicq.wlogin_sdk.b.l lVar = new oicq.wlogin_sdk.b.l();
oicq.wlogin_sdk.b.s sVar = new oicq.wlogin_sdk.b.s();
oicq.wlogin_sdk.b.e eVar = new oicq.wlogin_sdk.b.e();
oicq.wlogin_sdk.b.w wVar = new oicq.wlogin_sdk.b.w();
oicq.wlogin_sdk.b.d dVar = new oicq.wlogin_sdk.b.d();
oicq.wlogin_sdk.b.m mVar = new oicq.wlogin_sdk.b.m();
oicq.wlogin_sdk.b.x xVar = new oicq.wlogin_sdk.b.x();
oicq.wlogin_sdk.b.y yVar = new oicq.wlogin_sdk.b.y();
aa aaVar = new aa();
ab abVar = new ab();
ah ahVar = new ah();
oicq.wlogin_sdk.b.j jVar = new oicq.wlogin_sdk.b.j();
oicq.wlogin_sdk.b.h hVar = new oicq.wlogin_sdk.b.h();
oicq.wlogin_sdk.b.n nVar = new oicq.wlogin_sdk.b.n();
ad adVar = new ad();
z zVar = new z();
ak akVar = new ak();
ai aiVar = new ai();
at atVar = new at();
au auVar = new au();
an anVar = new an();
ci ciVar = new ci();
ay ayVar = new ay();
az azVar = new az();
bb bbVar = new bb();
bd bdVar = new bd();
bc bcVar = new bc();
ax axVar = new ax();
bg bgVar = new bg();
oicq.wlogin_sdk.b.a aVar = new oicq.wlogin_sdk.b.a(1298);
be beVar = new be();
bj bjVar = new bj();
bl blVar = new bl();
bm bmVar = new bm();
bq bqVar = new bq();
br brVar = new br();
ae aeVar = new ae();
bt btVar = new bt();
bu buVar = new bu();
bx bxVar = new bx();
cl clVar = new cl();
cm cmVar = new cm();
byte[] bArr4 = null;
byte[] bArr5 = null;
byte[] bArr6 = null;
byte[] bArr7 = null;
byte[] bArr8 = null;
byte[] bArr9 = null;
byte[] bArr10 = null;
aj ajVar = new aj();
oicq.wlogin_sdk.b.u uVar = new oicq.wlogin_sdk.b.u();
async_context b2 = s.b(this.x.afZ);
long j3 = b2._sappid;
long j4 = b2._appid;
if (this.eDw != 2064) {
i3 = 0;
} else {
switch (this.u) {
case 2:
i3 = 2;
break;
case 3:
case 5:
case 6:
case 8:
case 12:
case 14:
case 16:
case 21:
default:
return util.E_SYSTEM;
case 4:
i3 = 3;
break;
case 7:
i3 = 6;
break;
case 9:
i3 = 0;
break;
case 10:
case 11:
i3 = 1;
break;
case 13:
i3 = 4;
break;
case 15:
i3 = 5;
break;
case 17:
case 19:
i3 = 0;
break;
case 18:
i3 = 7;
break;
case 20:
i3 = 0;
break;
case 22:
i3 = 0;
break;
}
}
int c = c(bArr, i + 2);
int i4 = i + 5;
this.x.d = null;
switch (c) {
case 0:
if (i3 == 1) {
if (this.x.baa == null) {
return util.E_NO_TGTKEY;
}
if (auVar.b(bArr, i4, (this.c - i4) - 1) >= 0) {
this.x.d = auVar;
}
if (axVar.b(bArr, i4, (this.c - i4) - 1) >= 0) {
a(axVar);
}
b = vVar.a(bArr, i4, (this.c - i4) - 1, this.x.baa);
} else if (i3 == 2) {
if (buVar.b(bArr, i4, this.c - i4) >= 0) {
b2._msalt = buVar.oG();
}
if (vo() == 3) {
if (rVar.b(bArr, i4, (this.c - i4) - 1) >= 0) {
this.x.WA = rVar.oG();
this.x.a(this.x.cms, Long.valueOf(this.x.WA));
}
if (fVar.b(bArr, i4, (this.c - i4) - 1) >= 0) {
b2._t104 = fVar;
}
b = 0;
break;
} else {
if (auVar.b(bArr, i4, (this.c - i4) - 1) >= 0) {
this.x.d = auVar;
}
if (axVar.b(bArr, i4, (this.c - i4) - 1) >= 0) {
a(axVar);
}
b = vVar.a(bArr, i4, (this.c - i4) - 1, b2._tgtgt_key);
}
} else if (i3 == 3 || i3 == 7) {
if (buVar.b(bArr, i4, this.c - i4) >= 0) {
b2._msalt = buVar.oG();
}
if (rVar.b(bArr, i4, this.c - i4) >= 0) {
this.x.WA = rVar.oG();
this.x.a(this.x.cms, Long.valueOf(this.x.WA));
}
b = fVar.b(bArr, i4, this.c - i4);
if (b >= 0) {
b2._t104 = fVar;
b = 0;
break;
}
} else if (22 == this.u) {
b = fVar.b(bArr, i4, this.c - i4);
if (b >= 0) {
b2._t104 = fVar;
b = 0;
break;
}
} else {
if (auVar.b(bArr, i4, (this.c - i4) - 1) >= 0) {
this.x.d = auVar;
}
if (axVar.b(bArr, i4, (this.c - i4) - 1) >= 0) {
a(axVar);
}
b = vVar.a(bArr, i4, (this.c - i4) - 1, b2._tgtgt_key);
r.I = 0;
}
if (b >= 0) {
byte[] sO = vVar.sO();
int i5 = 2;
int length = sO.length;
if (atVar.b(sO, 2, length) > 0) {
a(atVar);
}
if (ahVar.b(sO, 2, length) > 0) {
this.x.a(ahVar.f(), ahVar.g());
}
if (rVar.b(sO, 2, length) >= 0) {
this.x.WA = rVar.oG();
this.x.a(this.x.cms, Long.valueOf(this.x.WA));
}
oVar.b(sO, 2, length);
pVar.b(sO, 2, length);
lVar.b(sO, 2, length);
sVar.b(sO, 2, length);
b = wVar.b(sO, 2, length);
if (b >= 0) {
if (uVar.b(sO, 2, length) < 0) {
util.LOGI("t118 get failed", SQLiteDatabase.KeyEmpty + this.x.WA);
}
if (eVar.b(sO, 2, length) >= 0) {
bArr9 = eVar.sO();
}
if (jVar.b(sO, 2, length) >= 0) {
util.set_ksid(s.t, jVar.sO());
}
if (dVar.b(sO, 2, length) >= 0) {
bArr4 = dVar.sO();
}
if (mVar.b(sO, 2, length) >= 0) {
bArr5 = mVar.sO();
}
if (xVar.b(sO, 2, length) >= 0) {
bArr6 = xVar.sO();
}
if (aaVar.b(sO, 2, length) >= 0) {
bArr7 = aaVar.sO();
}
if (abVar.b(sO, 2, length) >= 0) {
bArr8 = abVar.sO();
}
if (adVar.b(sO, 2, length) < 0) {
bArr2 = null;
} else {
byte[] f = adVar.f();
bArr10 = adVar.g();
bArr2 = f;
}
if (bxVar.b(sO, 2, length) >= 0) {
String str = this.x.cms;
if (util.check_uin_account(str).booleanValue()) {
str = this.x.e(this.x.WA);
if (str != null && str.length() > 0) {
this.x.a(str, Long.valueOf(this.x.WA), bxVar.oZ());
}
} else {
this.x.a(str, Long.valueOf(this.x.WA), bxVar.oZ());
}
util.LOGI("put t186: name: " + str + " uin: " + this.x.WA + " pwd=" + bxVar.oZ(), SQLiteDatabase.KeyEmpty);
}
util.LOGI("tgt len:" + util.buf_len(lVar.sO()) + " tgt_key len:" + util.buf_len(oVar.sO()) + " st len:" + util.buf_len(sVar.sO()) + " st_key len:" + util.buf_len(pVar.sO()) + " stwx_web len:" + util.buf_len(bArr9) + " lskey len:" + util.buf_len(bArr6) + " skey len:" + util.buf_len(bArr7) + " sig64 len:" + util.buf_len(bArr8) + " openid len:" + util.buf_len(bArr2) + " openkey len:" + util.buf_len(bArr10) + " pwdflag: " + bxVar.c() + " " + bxVar.oZ(), SQLiteDatabase.KeyEmpty + this.x.WA);
if (bcVar.b(sO, 2, length) >= 0) {
byte[] a = a(bcVar);
if (a != null && a.length > 0) {
this.x.j = new WFastLoginInfo(a);
} else {
this.x.j = new WFastLoginInfo();
}
}
byte[][] bArr11 = (byte[][]) Array.newInstance((Class<?>) Byte.TYPE, 3, 0);
if (bbVar.b(sO, 2, length) >= 0) {
bArr11[0] = bbVar.f();
bArr11[1] = bbVar.g();
bArr11[2] = bbVar.h();
}
byte[][] bArr12 = (byte[][]) Array.newInstance((Class<?>) Byte.TYPE, 5, 0);
for (int i6 = 0; i6 < 5; i6++) {
bArr12[i6] = new byte[0];
}
int b3 = nVar.b(sO, 2, length);
if (hVar.b(sO, 2, length) >= 0 && b3 >= 0) {
bArr12[0] = (byte[]) b(hVar.sO(), nVar.sO()).clone();
}
if (bdVar.b(sO, 2, length) >= 0) {
bArr12[1] = bdVar.sO();
}
if (cmVar.b(sO, 2, length) >= 0) {
bArr12[4] = cmVar.sO();
}
if (b2._sec_guid_flag) {
bArr12[2] = b2._G;
bArr12[3] = b2._dpwd;
bArr12[4] = b2._t403.sO();
b2._sec_guid_flag = false;
}
byte[][] bArr13 = (byte[][]) Array.newInstance((Class<?>) Byte.TYPE, 15, 0);
for (int i7 = 0; i7 < 15; i7++) {
bArr13[i7] = new byte[0];
}
if (ajVar.b(sO, 2, length) >= 0) {
bArr13[0] = ajVar.sO();
}
if (aiVar.b(sO, 2, length) >= 0) {
bArr13[1] = aiVar.f();
bArr2 = aiVar.g();
}
if (anVar.b(sO, 2, length) >= 0) {
bArr13[2] = anVar.sO();
}
if (ciVar.b(sO, 2, length) >= 0) {
bArr13[3] = ciVar.sO();
}
if (ayVar.b(sO, 2, length) >= 0) {
bArr13[4] = ayVar.sO();
}
if (bgVar.b(sO, 2, length) >= 0) {
bArr13[5] = bgVar.sO();
}
if (aVar.b(sO, 2, length) >= 0) {
bArr13[6] = aVar.sO();
}
if (beVar.b(sO, 2, length) >= 0) {
bArr13[7] = beVar.sO();
}
ce ceVar = new ce();
if (ceVar.b(sO, 2, length) >= 0) {
bArr13[8] = ceVar.g();
bArr3 = ceVar.f();
} else {
bArr3 = bArr2;
}
cf cfVar = new cf();
if (cfVar.b(sO, 2, length) >= 0) {
bArr13[9] = cfVar.f();
bArr13[10] = cfVar.g();
}
oicq.wlogin_sdk.b.a aVar2 = new oicq.wlogin_sdk.b.a(515);
if (aVar2.b(sO, 2, length) >= 0) {
bArr13[11] = aVar2.sO();
util.LOGI("get DA2 in rsp", SQLiteDatabase.KeyEmpty);
} else {
util.LOGI("no DA2 in rsp", SQLiteDatabase.KeyEmpty);
}
oicq.wlogin_sdk.b.a aVar3 = new oicq.wlogin_sdk.b.a(hv.ayq);
if (aVar3.b(sO, 2, length) >= 0) {
WloginSigInfo._QRPUSHSig = aVar3.sO();
} else {
WloginSigInfo._QRPUSHSig = new byte[0];
}
oicq.wlogin_sdk.b.a aVar4 = new oicq.wlogin_sdk.b.a(307);
if (aVar4.b(sO, 2, length) >= 0) {
bArr13[13] = aVar4.sO();
} else {
util.LOGW("get t133 failed", SQLiteDatabase.KeyEmpty + this.x.WA);
}
oicq.wlogin_sdk.b.a aVar5 = new oicq.wlogin_sdk.b.a(308);
if (aVar5.b(sO, 2, length) >= 0) {
bArr13[14] = aVar5.sO();
} else {
util.LOGW("get t134 failed", SQLiteDatabase.KeyEmpty + this.x.WA);
}
util.LOGI("encrypt_a1 len:" + util.buf_len(bArr12[0]) + " no_pic_sig len:" + util.buf_len(bArr12[1]) + " G len:" + util.buf_len(bArr12[2]) + " dpwd len:" + util.buf_len(bArr12[3]) + " randseed len:" + util.buf_len(bArr12[4]) + " vkey len:" + util.buf_len(bArr13[0]) + " openid len:" + util.buf_len(bArr3) + " access_token len:" + util.buf_len(bArr13[1]) + " d2 len:" + util.buf_len(bArr13[2]) + " d2_key len:" + util.buf_len(bArr13[3]) + " sid len:" + util.buf_len(bArr13[4]) + " aq_sig len:" + util.buf_len(bArr13[5]) + " pskey len:" + util.buf_len(bArr13[6]) + " super_key len:" + util.buf_len(bArr13[7]) + " paytoken len:" + util.buf_len(bArr13[8]) + " pf len:" + util.buf_len(bArr13[9]) + " pfkey len:" + util.buf_len(bArr13[10]) + " da2 len:" + util.buf_len(bArr13[11]) + " wt session ticket:" + util.buf_len(bArr13[13]) + " wt session ticket key:" + util.buf_len(bArr13[14]), SQLiteDatabase.KeyEmpty + this.x.WA);
if (zVar.b(sO, 2, length) >= 0) {
j2 = 4294967295L & zVar.vo();
}
long[] jArr = new long[7];
int i8 = 2;
while (true) {
long j5 = j;
i8 = akVar.b(sO, i8, length);
if (i8 < 0) {
util.LOGI("sappid:" + j3 + " appid:" + j4 + " app_pri:" + j2 + " login_bitmap:" + b2._login_bitmap + " tk_valid:0 a2_valid:" + j5 + " lskey_valid:" + jArr[0] + " skey_valid:" + jArr[1] + " vkey_valid:" + jArr[2] + " a8_valid:" + jArr[3] + " stweb_valid:" + jArr[4] + " d2_valid:" + jArr[5] + " sid_valid:" + jArr[6], SQLiteDatabase.KeyEmpty + this.x.WA);
WloginSimpleInfo wloginSimpleInfo = new WloginSimpleInfo();
wloginSimpleInfo.c(this.x.WA);
wloginSimpleInfo.setFace(wVar.f());
wloginSimpleInfo.setAge(wVar.g());
wloginSimpleInfo.setGender(wVar.h());
wloginSimpleInfo.setNick(wVar.oV());
wloginSimpleInfo.setReserveUinInfo(bArr11);
wloginSimpleInfo.setMainDisplayName(uVar.sO());
this.x.ao = b2._main_sigmap;
b = this.x.a(this.x.WA, j3, bArr12, j4, j2, s.oG(), s.oG() + 0, j5 + s.oG(), wloginSimpleInfo, lVar.sO(), oVar.sO(), sVar.sO(), pVar.sO(), bArr9, bArr5, bArr4, bArr6, bArr7, bArr8, bArr3, bArr10, bArr13, jArr, b2._login_bitmap);
if (b != 0) {
ErrMsg errMsg = new ErrMsg();
errMsg.setMessage(InternationMsg.a(InternationMsg.MSG_TYPE.MSG_2));
a(errMsg);
util.LOGI("put_siginfo fail,ret=" + b, SQLiteDatabase.KeyEmpty + this.x.WA);
break;
} else {
while (true) {
i5 = yVar.b(sO, i5, length);
if (i5 >= 0) {
this.x.a(this.x.WA, yVar.oG(), s.oG(), s.oG() + 0, yVar.h(), yVar.g());
} else {
b = 0;
break;
}
}
}
} else {
j = akVar.vo() != 0 ? akVar.vo() : j5;
if (akVar.ja() == 0) {
jArr[0] = 1641600;
} else {
jArr[0] = akVar.ja();
}
if (akVar.je() != 0) {
jArr[1] = akVar.je();
} else {
jArr[1] = 86400;
}
if (akVar.i() != 0) {
jArr[2] = akVar.i();
} else {
jArr[2] = 1728000;
}
if (akVar.pa() == 0) {
jArr[3] = 72000;
} else {
jArr[3] = akVar.pa();
}
if (akVar.k() != 0) {
jArr[4] = akVar.k();
} else {
jArr[4] = 6000;
}
if (akVar.l() != 0) {
jArr[5] = akVar.l();
} else {
jArr[5] = 1728000;
}
if (akVar.m() == 0) {
jArr[6] = 1728000;
} else {
jArr[6] = akVar.m();
}
}
}
}
}
break;
case 1:
case 15:
util.LOGI("cmd " + Integer.toHexString(this.eDw) + " subcmd " + Integer.toHexString(this.u) + " result " + c + " will clean sig for uin " + this.x.WA + " appid " + j3);
this.x.e(this.x.WA, j3);
c(bArr, i4, (this.c - i4) - 1);
b = c;
break;
case 2:
b = fVar.b(bArr, i4, (this.c - i4) - 1);
if (b >= 0) {
b2._t104 = fVar;
cb cbVar = new cb();
if (cbVar.b(bArr, i4, (this.c - i4) - 1) >= 0) {
a(new ErrMsg(c, SQLiteDatabase.KeyEmpty, SQLiteDatabase.KeyEmpty, cbVar.lW()));
} else {
b = gVar.b(bArr, i4, (this.c - i4) - 1);
if (b >= 0) {
b2._t105 = gVar;
if (azVar.b(bArr, i4, (this.c - i4) - 1) >= 0) {
b2._t165 = azVar;
} else {
b2._t165 = new az();
}
a((ErrMsg) null);
}
}
b = c;
break;
}
break;
case 16:
this.x.e(this.x.WA, j3);
b = ahVar.b(bArr, i4, (this.c - i4) - 1);
if (b >= 0) {
this.x.a(ahVar.f(), ahVar.g());
c(bArr, i4, (this.c - i4) - 1);
b = c;
break;
}
break;
case 41:
case util.S_BABYLH_EXPIRED:
oicq.wlogin_sdk.b.a aVar6 = new oicq.wlogin_sdk.b.a(405);
b = aVar6.b(bArr, i4, (this.c - i4) - 1);
if (b >= 0) {
WloginSigInfo._LHSig = aVar6.sO();
c(bArr, i4, (this.c - i4) - 1);
b = c;
break;
}
break;
case 160:
if (rVar.b(bArr, i4, (this.c - i4) - 1) >= 0) {
this.x.WA = rVar.oG();
this.x.a(this.x.cms, Long.valueOf(this.x.WA));
}
b = fVar.b(bArr, i4, (this.c - i4) - 1);
if (b >= 0) {
b2._t104 = fVar;
b = bjVar.b(bArr, i4, (this.c - i4) - 1);
if (b >= 0) {
b2._t174 = bjVar;
if (blVar.b(bArr, i4, (this.c - i4) - 1) >= 0) {
b2._devlock_info.CountryCode = new String(blVar.f());
b2._devlock_info.Mobile = new String(blVar.g());
b2._devlock_info.MbItemSmsCodeStatus = blVar.je();
b2._devlock_info.AvailableMsgCount = blVar.i();
b2._devlock_info.TimeLimit = blVar.pa();
}
cd cdVar = new cd();
if (cdVar.b(bArr, i4, (this.c - i4) - 1) >= 0) {
b2._devlock_info.BakCountryCode = cdVar.ir();
b2._devlock_info.BakMobile = cdVar.kl();
b2._devlock_info.BakMobileState = cdVar.vo();
}
if (bmVar.b(bArr, i4, (this.c - i4) - 1) >= 0) {
b2._devlock_info.UnionVerifyUrl = new String(bmVar.f());
}
if (bqVar.b(bArr, i4, (this.c - i4) - 1) >= 0) {
b2._devlock_info.MbGuideType = bqVar.vo();
b2._devlock_info.MbGuideMsg = new String(bqVar.g());
b2._devlock_info.MbGuideInfoType = bqVar.je();
b2._devlock_info.MbGuideInfo = new String(bqVar.oV());
}
if (brVar.b(bArr, i4, (this.c - i4) - 1) >= 0) {
b2._devlock_info.VerifyReason = new String(brVar.sO());
}
if (clVar.b(bArr, i4, (this.c - i4) - 1) >= 0) {
b2._t402 = clVar;
} else {
b2._t402 = new cl();
}
if (cmVar.b(bArr, i4, (this.c - i4) - 1) >= 0) {
b2._t403 = cmVar;
} else {
b2._t403 = new cm();
}
c(bArr, i4, (this.c - i4) - 1);
b = c;
break;
}
}
break;
case 176:
c(bArr, i4, (this.c - i4) - 1);
this.x.a(this.x.cms);
b = c;
break;
case 180:
b = axVar.b(bArr, i4, (this.c - i4) - 1);
if (b >= 0) {
a(axVar);
c(bArr, i4, (this.c - i4) - 1);
b = c;
break;
}
break;
case 204:
if (rVar.b(bArr, i4, (this.c - i4) - 1) >= 0) {
this.x.WA = rVar.oG();
this.x.a(this.x.cms, Long.valueOf(this.x.WA));
}
b = fVar.b(bArr, i4, (this.c - i4) - 1);
if (b >= 0) {
b2._t104 = fVar;
b = clVar.b(bArr, i4, (this.c - i4) - 1);
if (b >= 0) {
b2._t402 = clVar;
b = cmVar.b(bArr, i4, (this.c - i4) - 1);
if (b >= 0) {
b2._t403 = cmVar;
c(bArr, i4, (this.c - i4) - 1);
b = c;
break;
}
}
}
break;
case 208:
b = fVar.b(bArr, i4, (this.c - i4) - 1);
if (b >= 0) {
b2._t104 = fVar;
b = aeVar.b(bArr, i4, (this.c - i4) - 1);
if (b >= 0) {
b2._t126 = aeVar;
b = btVar.b(bArr, i4, (this.c - i4) - 1);
if (b >= 0) {
b2._smslogin_msgcnt = btVar.vo();
b2._smslogin_timelimit = btVar.ja();
b = buVar.b(bArr, i4, (this.c - i4) - 1);
if (b >= 0) {
b2._msalt = buVar.oG();
b = 0;
break;
}
}
}
}
break;
default:
c(bArr, i4, (this.c - i4) - 1);
b = c;
break;
}
util.LOGI("type:" + c + " ret:" + (b > 0 ? "0x" + Integer.toHexString(b) : Integer.valueOf(b)), SQLiteDatabase.KeyEmpty + this.x.WA);
if (b == 0) {
a((ErrMsg) null);
} else {
new cn().b(bArr, i4, (this.c - i4) - 1);
if (cn.eBF) {
ErrMsg errMsg2 = new ErrMsg();
int b4 = new i(this.x, this.eDw, this.u, errMsg2).b(b);
if (b4 != -1000) {
a(errMsg2);
b = b4;
}
}
}
if (b == 10 || b == 161 || b == 162 || b == 164 || b == 165 || b == 166 || b == 154 || (b >= 128 && b <= 143)) {
b = -1000;
}
if (i3 != 2 && i3 != 6 && i3 != 7) {
a(i3);
return b;
}
return b;
}
public void a(WloginSigInfo wloginSigInfo) {
if (true != wloginSigInfo.isWtSessionTicketExpired() && wloginSigInfo.wtSessionTicket != null && wloginSigInfo.wtSessionTicketKey != null) {
this.A = (byte[]) wloginSigInfo.wtSessionTicket.clone();
this.B = (byte[]) wloginSigInfo.wtSessionTicketKey.clone();
}
}
public void pe() {
this.eCO = true;
}
}