QQ浏览器 v12.2.3.7053版本的 MD5 值为:8285ab3059e5c8b521a264dfbc5c3685
以下内容为反编译后的 oicq_request.java 源代码,内容仅作参考
package oicq.wlogin_sdk.request;
import android.content.Context;
import com.tencent.common.http.HttpHeader;
import com.tencent.common.http.NetUtils;
import com.tencent.mtt.compliance.MethodDelegate;
import com.tencent.tar.Config;
import com.tencent.thumbplayer.api.TPOptionalID;
import com.xiaomi.mipush.sdk.Constants;
import java.io.InputStream;
import java.io.OutputStream;
import java.lang.reflect.Array;
import java.net.ConnectException;
import java.net.HttpURLConnection;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.net.URL;
import java.util.Random;
import oicq.wlogin_sdk.report.report_t3;
import oicq.wlogin_sdk.sharemem.WloginSigInfo;
import oicq.wlogin_sdk.sharemem.WloginSimpleInfo;
import oicq.wlogin_sdk.tlv_type.tlv_t;
import oicq.wlogin_sdk.tlv_type.tlv_t102;
import oicq.wlogin_sdk.tlv_type.tlv_t103;
import oicq.wlogin_sdk.tlv_type.tlv_t104;
import oicq.wlogin_sdk.tlv_type.tlv_t105;
import oicq.wlogin_sdk.tlv_type.tlv_t106;
import oicq.wlogin_sdk.tlv_type.tlv_t108;
import oicq.wlogin_sdk.tlv_type.tlv_t10a;
import oicq.wlogin_sdk.tlv_type.tlv_t10b;
import oicq.wlogin_sdk.tlv_type.tlv_t10c;
import oicq.wlogin_sdk.tlv_type.tlv_t10d;
import oicq.wlogin_sdk.tlv_type.tlv_t10e;
import oicq.wlogin_sdk.tlv_type.tlv_t113;
import oicq.wlogin_sdk.tlv_type.tlv_t114;
import oicq.wlogin_sdk.tlv_type.tlv_t118;
import oicq.wlogin_sdk.tlv_type.tlv_t119;
import oicq.wlogin_sdk.tlv_type.tlv_t11a;
import oicq.wlogin_sdk.tlv_type.tlv_t11c;
import oicq.wlogin_sdk.tlv_type.tlv_t11d;
import oicq.wlogin_sdk.tlv_type.tlv_t11f;
import oicq.wlogin_sdk.tlv_type.tlv_t120;
import oicq.wlogin_sdk.tlv_type.tlv_t121;
import oicq.wlogin_sdk.tlv_type.tlv_t125;
import oicq.wlogin_sdk.tlv_type.tlv_t126;
import oicq.wlogin_sdk.tlv_type.tlv_t130;
import oicq.wlogin_sdk.tlv_type.tlv_t132;
import oicq.wlogin_sdk.tlv_type.tlv_t136;
import oicq.wlogin_sdk.tlv_type.tlv_t138;
import oicq.wlogin_sdk.tlv_type.tlv_t143;
import oicq.wlogin_sdk.tlv_type.tlv_t145;
import oicq.wlogin_sdk.tlv_type.tlv_t146;
import oicq.wlogin_sdk.tlv_type.tlv_t149;
import oicq.wlogin_sdk.tlv_type.tlv_t150;
import oicq.wlogin_sdk.tlv_type.tlv_t161;
import oicq.wlogin_sdk.tlv_type.tlv_t164;
import oicq.wlogin_sdk.tlv_type.tlv_t165;
import oicq.wlogin_sdk.tlv_type.tlv_t167;
import oicq.wlogin_sdk.tlv_type.tlv_t169;
import oicq.wlogin_sdk.tlv_type.tlv_t16a;
import oicq.wlogin_sdk.tlv_type.tlv_t16d;
import oicq.wlogin_sdk.tlv_type.tlv_t171;
import oicq.wlogin_sdk.tlv_type.tlv_t172;
import oicq.wlogin_sdk.tlv_type.tlv_t173;
import oicq.wlogin_sdk.tlv_type.tlv_t174;
import oicq.wlogin_sdk.tlv_type.tlv_t178;
import oicq.wlogin_sdk.tlv_type.tlv_t179;
import oicq.wlogin_sdk.tlv_type.tlv_t17d;
import oicq.wlogin_sdk.tlv_type.tlv_t17e;
import oicq.wlogin_sdk.tlv_type.tlv_t182;
import oicq.wlogin_sdk.tlv_type.tlv_t183;
import oicq.wlogin_sdk.tlv_type.tlv_t186;
import oicq.wlogin_sdk.tlv_type.tlv_t192;
import oicq.wlogin_sdk.tlv_type.tlv_t196;
import oicq.wlogin_sdk.tlv_type.tlv_t199;
import oicq.wlogin_sdk.tlv_type.tlv_t200;
import oicq.wlogin_sdk.tlv_type.tlv_t305;
import oicq.wlogin_sdk.tlv_type.tlv_t402;
import oicq.wlogin_sdk.tlv_type.tlv_t403;
import oicq.wlogin_sdk.tlv_type.tlv_t508;
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;
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 G = "";
static String H = "";
public Context f85586a;
byte w;
public t x;
int f85587b = 4096;
int f85588c = 0;
int f85589d = 27;
int e = 0;
public int f = 15;
protected int g = 0;
protected byte[] h = new byte[this.f85587b];
protected int i = 8001;
protected int j = 0;
protected int k = 3;
protected int l = 0;
protected int m = 0;
protected int n = 2;
protected int o = 0;
protected int p = 0;
InetSocketAddress q = null;
int r = 0;
byte[] s = new byte[6144];
protected int t = 0;
protected int u = 0;
protected String v = "";
protected EncryptionMethod y = EncryptionMethod.EM_ECDH;
protected boolean z = false;
protected byte[] A = new byte[0];
protected byte[] B = new byte[0];
int E = 0;
public enum EncryptionMethod {
EM_ECDH,
EM_ST
}
private void a(int i, int i2, long j, int i3, int i4, int i5, int i6) {
a(i, i2, j, !this.z ? 7 : TPOptionalID.OPTION_ID_BEFORE_BOOL_ENABLE_PLAYER_TIMER_THREAD, 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.j + 1;
this.j = i8;
this.f85588c = 0;
util.int8_to_buf(this.h, this.f85588c, 2);
this.f85588c++;
util.int16_to_buf(this.h, this.f85588c, this.f85589d + 2 + i7);
this.f85588c += 2;
util.int16_to_buf(this.h, this.f85588c, i);
this.f85588c += 2;
util.int16_to_buf(this.h, this.f85588c, i2);
this.f85588c += 2;
util.int16_to_buf(this.h, this.f85588c, i8);
this.f85588c += 2;
util.int32_to_buf(this.h, this.f85588c, (int) j);
this.f85588c += 4;
util.int8_to_buf(this.h, this.f85588c, 3);
this.f85588c++;
util.int8_to_buf(this.h, this.f85588c, i3);
this.f85588c++;
util.int8_to_buf(this.h, this.f85588c, i4);
this.f85588c++;
util.int32_to_buf(this.h, this.f85588c, 2);
this.f85588c += 4;
util.int32_to_buf(this.h, this.f85588c, i5);
this.f85588c += 4;
util.int32_to_buf(this.h, this.f85588c, i6);
this.f85588c += 4;
}
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);
a(bArr, bArr.length);
a();
}
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.t;
report_t3Var._sub = this.u;
report_t3Var._rst2 = i;
report_t3Var._used = (int) (System.currentTimeMillis() - j);
report_t3Var._try = i3;
report_t3Var._host = H;
if (report_t3Var._host == null) {
report_t3Var._host = "";
}
InetSocketAddress inetSocketAddress = this.q;
if (inetSocketAddress == null) {
report_t3Var._ip = "";
} else {
report_t3Var._ip = MethodDelegate.getHostAddress(inetSocketAddress.getAddress());
}
report_t3Var._port = c(z);
report_t3Var._conn = i2;
report_t3Var._net = t.D;
report_t3Var._str = "";
report_t3Var._slen = 0;
report_t3Var._rlen = 0;
report_t3Var._wap = z ? z2 ? 2 : 1 : 0;
t.an.add_t3(report_t3Var);
}
public static void a(int i, String str) {
F = i;
G = str;
}
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 b(int i, int i2, long j, int i3, int i4, int i5, byte[] bArr) {
b(i, i2, j, i3, i4, i5, bArr.length);
a(bArr, bArr.length);
a();
}
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 int a(int i) {
t.b(this.x.h)._last_flowid = i;
return i;
}
public int a(String str, boolean z, WUserSigInfo wUserSigInfo) {
int b2 = this.x.e() ? b(str, z, wUserSigInfo) : e();
if (b2 == -1000) {
ErrMsg errMsg = new ErrMsg();
errMsg.setMessage(InternationMsg.a(InternationMsg.MSG_TYPE.MSG_4));
a(errMsg);
}
return b2;
}
public int a(tlv_t161 tlv_t161Var) {
tlv_t173 tlv_t173Var = new tlv_t173();
tlv_t172 tlv_t172Var = new tlv_t172();
byte[] bArr = tlv_t161Var.get_data();
int length = bArr.length;
if (tlv_t173Var.get_tlv(bArr, 2, length) > 0) {
a(tlv_t173Var);
}
if (tlv_t172Var.get_tlv(bArr, 2, length) <= 0) {
return 0;
}
t tVar = this.x;
tVar.m = 1;
tVar.r = tlv_t172Var.get_data();
util.LOGI("get rollback sig", "");
return 0;
}
public int a(tlv_t173 tlv_t173Var) {
int buf_to_int16;
int buf_to_int162;
byte[] bArr = tlv_t173Var.get_data();
if (bArr != null && bArr.length > 2) {
int buf_to_int8 = util.buf_to_int8(bArr, 1);
int i = 0;
int i2 = 2;
while (i < buf_to_int8) {
int i3 = i2 + 1;
if (bArr.length >= i3) {
int buf_to_int82 = util.buf_to_int8(bArr, i2);
int i4 = i3 + 2;
if (bArr.length < i4 || bArr.length < (buf_to_int162 = i4 + (buf_to_int16 = util.buf_to_int16(bArr, i3)))) {
break;
}
byte[] bArr2 = new byte[buf_to_int16];
System.arraycopy(bArr, i4, bArr2, 0, buf_to_int16);
int i5 = buf_to_int162 + 2;
if (bArr.length < i5) {
break;
}
a(buf_to_int82, bArr2, util.buf_to_int16(bArr, buf_to_int162));
i++;
i2 = i5;
} else {
break;
}
}
}
return 0;
}
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;
int length = decrypt.length;
int i3 = this.f;
if (length + i3 + 2 > this.f85587b) {
this.f85587b = decrypt.length + i3 + 2;
byte[] bArr3 = new byte[this.f85587b];
System.arraycopy(this.h, 0, bArr3, 0, this.f85588c);
this.h = bArr3;
}
this.f85588c = 0;
System.arraycopy(decrypt, 0, this.h, i, decrypt.length);
this.f85588c += this.f + 2 + decrypt.length;
return 0;
}
public String a(int i, boolean z) {
String a2;
String str;
int i2 = i / 2;
if (F != 0 && (str = G) != null && str.length() > 0) {
a2 = G;
} else if (i2 < 1) {
int i3 = t.D;
if (z) {
if (i3 == 1) {
a2 = new String(util.get_wap_server_host1(t.t));
} else {
if (t.D == 2) {
a2 = new String(util.get_wap_server_host2(t.t));
}
a2 = "";
}
} else if (i3 == 1) {
a2 = new String(util.get_server_host1(t.t));
} else {
if (t.D == 2) {
a2 = new String(util.get_server_host2(t.t));
}
a2 = "";
}
} else {
if (i2 >= 2) {
a2 = a(z);
}
a2 = b(z);
}
H = a2;
return a2;
}
public String a(boolean z) {
return !z ? C[((int) (Math.random() * 2.147483647E9d)) % C.length] : D[((int) (Math.random() * 2.147483647E9d)) % D.length];
}
public void a() {
util.int8_to_buf(this.h, this.f85588c, 3);
this.f85588c++;
}
public void a(int i, int i2, int i3, long j, int i4, int i5, int i6, int i7, int i8) {
int i9 = this.j + 1;
this.j = i9;
this.f85588c = 0;
util.int8_to_buf(this.h, this.f85588c, 2);
this.f85588c++;
util.int16_to_buf(this.h, this.f85588c, this.f85589d + 2 + i8);
this.f85588c += 2;
util.int16_to_buf(this.h, this.f85588c, i);
this.f85588c += 2;
util.int16_to_buf(this.h, this.f85588c, i2);
this.f85588c += 2;
util.int16_to_buf(this.h, this.f85588c, i9);
this.f85588c += 2;
util.int32_to_buf(this.h, this.f85588c, (int) j);
this.f85588c += 4;
util.int8_to_buf(this.h, this.f85588c, 3);
this.f85588c++;
util.int8_to_buf(this.h, this.f85588c, 7);
this.f85588c++;
util.int8_to_buf(this.h, this.f85588c, i4);
this.f85588c++;
util.int32_to_buf(this.h, this.f85588c, i5);
this.f85588c += 4;
util.int32_to_buf(this.h, this.f85588c, i6);
this.f85588c += 4;
util.int32_to_buf(this.h, this.f85588c, i7);
this.f85588c += 4;
}
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);
}
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);
a(bArr, i8);
a();
}
void a(int i, byte[] bArr, int i2) {
if (bArr == null || bArr.length <= 0) {
return;
}
if (i == 1) {
if (t.D == 1) {
util.set_server_host1(t.t, bArr);
} else if (t.D == 2) {
util.set_server_host2(t.t, bArr);
}
} else if (i == 2) {
if (t.D == 1) {
util.set_wap_server_host1(t.t, bArr);
} else if (t.D == 2) {
util.set_wap_server_host2(t.t, bArr);
}
}
util.LOGI("net type:" + t.D + " type:" + i + " host:" + new String(bArr) + " port:" + i2, "" + this.x.f);
}
public void a(long j, byte[] bArr) {
a(this.i, this.t, j, this.m, t.w, this.p, bArr);
}
public void a(long j, byte[] bArr, EncryptionMethod encryptionMethod) {
if (encryptionMethod == EncryptionMethod.EM_ST) {
b(j, bArr);
return;
}
if (encryptionMethod == EncryptionMethod.EM_ECDH) {
a(j, bArr);
return;
}
util.LOGI("getRequestEncrptedPackage unknown encryption method " + encryptionMethod, "" + j);
}
public void a(Socket socket) {
this.x.aj = socket;
}
public void a(WloginSigInfo wloginSigInfo) {
if (true == wloginSigInfo.isWtSessionTicketExpired() || wloginSigInfo.wtSessionTicket == null || wloginSigInfo.wtSessionTicketKey == null) {
return;
}
this.A = (byte[]) wloginSigInfo.wtSessionTicket.clone();
this.B = (byte[]) wloginSigInfo.wtSessionTicketKey.clone();
}
public void a(tlv_t149 tlv_t149Var) {
try {
ErrMsg errMsg = new ErrMsg();
if (tlv_t149Var != null) {
errMsg.setType(tlv_t149Var.get_type());
errMsg.setTitle(new String(tlv_t149Var.get_title()));
errMsg.setMessage(new String(tlv_t149Var.get_content()));
errMsg.setOtherinfo(new String(tlv_t149Var.get_otherinfo()));
new e(t.t, errMsg).start();
}
} catch (Exception unused) {
}
}
public void a(ErrMsg errMsg) {
async_context b2 = t.b(this.x.h);
b2._last_err_msg = new ErrMsg(0, "", "", "");
if (errMsg != null) {
try {
b2._last_err_msg = (ErrMsg) errMsg.clone();
} catch (CloneNotSupportedException unused) {
b2._last_err_msg = new ErrMsg(0, "", "", "");
}
}
}
public void a(byte[] bArr, int i) {
int i2 = this.f85588c;
if (i + i2 + 1 > this.f85587b) {
this.f85587b = i + i2 + 1 + 128;
byte[] bArr2 = new byte[this.f85587b];
System.arraycopy(this.h, 0, bArr2, 0, i2);
this.h = bArr2;
}
System.arraycopy(bArr, 0, this.h, this.f85588c, i);
this.f85588c += i;
}
public byte[] a(tlv_t169 tlv_t169Var) {
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();
byte[] bArr = tlv_t169Var.get_data();
int length = bArr.length;
if (tlv_t106Var.get_tlv(bArr, 2, length) < 0 || tlv_t10cVar.get_tlv(bArr, 2, length) < 0 || tlv_t16aVar.get_tlv(bArr, 2, length) < 0) {
return null;
}
byte[] bArr2 = tlv_t106Var.get_buf();
byte[] bArr3 = tlv_t10cVar.get_buf();
byte[] bArr4 = tlv_t16aVar.get_buf();
byte[] bArr5 = tlv_t145Var.get_tlv_145(t.A);
byte[] bArr6 = new byte[bArr2.length + 3 + bArr3.length + bArr4.length + bArr5.length];
bArr6[0] = 64;
util.int16_to_buf(bArr6, 1, 4);
System.arraycopy(bArr2, 0, bArr6, 3, bArr2.length);
int length2 = 3 + bArr2.length;
System.arraycopy(bArr3, 0, bArr6, length2, bArr3.length);
int length3 = length2 + bArr3.length;
System.arraycopy(bArr4, 0, bArr6, length3, bArr4.length);
System.arraycopy(bArr5, 0, bArr6, length3 + bArr4.length, bArr5.length);
int length4 = bArr5.length;
return bArr6;
}
public byte[] a(byte[] bArr) {
return this.x.m == 0 ? a(bArr, this.x.f85593c, this.x.n, this.x.p) : a(bArr, this.x.f85593c);
}
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[] 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, "");
return null;
}
byte[] a(byte[] bArr, byte[] bArr2) {
if (bArr == null || bArr2 == null) {
return new byte[0];
}
int i = this.x.m == 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, Config.ENABLE_CLOUD);
int i2 = length + 2;
util.int16_to_buf(bArr3, i2, 0);
System.arraycopy(encrypt, 0, bArr3, i2 + 2, encrypt.length);
int length2 = 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, 2 + bArr2.length, encrypt.length);
int length = encrypt.length;
return bArr4;
}
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, Config.ENABLE_CLOUD);
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);
int length2 = encrypt.length;
return bArr5;
}
public int b() {
String str;
String str2;
int i = this.f85588c;
int i2 = this.f;
if (i <= i2 + 2) {
return -1009;
}
this.g = (i - i2) - 2;
int buf_to_int16 = util.buf_to_int16(this.h, 13);
util.LOGI("enrypt method " + this.y + " rsp flag " + buf_to_int16, "");
int i3 = 0;
if (this.y == EncryptionMethod.EM_ECDH && buf_to_int16 == 0) {
if (this.x.m == 0) {
i3 = a(this.h, this.f + 1, this.g, this.x.p);
if (i3 < 0) {
util.LOGI("use ecdh decrypt_body failed", "");
i3 = a(this.h, this.f + 1, this.g, this.x.f85593c);
}
} else {
i3 = a(this.h, this.f + 1, this.g, this.x.f85593c);
}
} else if (this.y == EncryptionMethod.EM_ST && 3 == buf_to_int16) {
i3 = a(this.h, this.f + 1, this.g, this.B);
if (i3 < 0) {
t.an.attr_api(2494911);
async_context b2 = t.b(this.x.h);
if (b2 != null) {
t tVar = this.x;
tVar.c(tVar.f, b2._sappid);
}
util.LOGI("use session key decrypt_body failed", "");
i3 = util.E_NEWST_DECRYPT;
}
} else {
if (this.y == EncryptionMethod.EM_ECDH && true == this.z && 4 == buf_to_int16) {
byte[] decrypt = cryptor.decrypt(this.h, this.f + 1, this.g, this.x.p);
if (decrypt == null) {
str = "" + this.x.f;
str2 = "decrypted outer body failed";
} else {
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, "" + this.x.f);
return -1009;
}
byte[] bArr = new byte[buf_to_int162];
System.arraycopy(decrypt, 2, bArr, 0, buf_to_int162);
byte[] calShareKeyMd5ByPeerPublicKey = new EcdhCrypt(this.f85586a).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) {
t.an.attr_api(2461266);
str = "" + this.x.f;
str2 = "use share key md5 decrypt failed";
} else {
byte[] bArr2 = this.h;
int length = bArr2.length;
int i4 = this.f;
if (length < i4 + 2 + decrypt2.length) {
this.f85587b = i4 + 2 + decrypt2.length;
byte[] bArr3 = new byte[this.f85587b];
System.arraycopy(bArr2, 0, bArr3, 0, i4 + 1);
this.h = bArr3;
}
System.arraycopy(decrypt2, 0, this.h, this.f + 1, decrypt2.length);
this.f85588c += this.f + 2 + decrypt2.length;
}
}
util.LOGI(str2, str);
return -1002;
}
util.LOGI("unknown encryption method " + this.y, "");
i3 = util.E_ENCRYPTION_METHOD;
}
return i3 < 0 ? i3 : d(this.h, this.f + 1, this.g);
}
public int b(String str, boolean z, WUserSigInfo wUserSigInfo) {
int i;
WtloginMsfListener wtloginMsfListener;
util.LOGI(getClass().getName() + ":snd_rcv_req_msf ...", "" + this.x.f);
int i2 = this.x.l;
byte[] c2 = c();
long currentTimeMillis = System.currentTimeMillis();
byte[] bArr = null;
try {
util.LOGI("WtloginMsfListener uin:" + str + " service_cmd:" + this.v + " timeout:" + i2 + " flag:" + z, "" + this.x.f);
wtloginMsfListener = new WtloginMsfListener(str, this.v, c2, i2, z, wUserSigInfo);
Thread thread = new Thread(wtloginMsfListener);
thread.start();
thread.join(i2);
bArr = wtloginMsfListener.getRetData();
} catch (Exception e) {
util.printException(e, "" + this.x.f);
}
if (bArr != null) {
b(bArr, bArr.length);
i = 0;
if (this.t != 2066) {
}
util.LOGI(getClass().getName() + ":snd_rcv_req_msf ret=" + i, "" + this.x.f);
return i;
}
util.LOGI("recv data from server failed, ret=" + wtloginMsfListener.getRet(), "" + this.x.f);
i = -1000;
if (this.t != 2066) {
report_t3 report_t3Var = new report_t3();
report_t3Var._cmd = this.t;
report_t3Var._sub = this.u;
report_t3Var._rst2 = i;
report_t3Var._used = (int) (System.currentTimeMillis() - currentTimeMillis);
report_t3Var._try = 0;
report_t3Var._host = "";
report_t3Var._ip = "";
report_t3Var._port = 0;
report_t3Var._conn = 0;
report_t3Var._net = 0;
report_t3Var._str = "";
if (i == 0) {
report_t3Var._slen = c2.length;
report_t3Var._rlen = bArr.length;
} else {
report_t3Var._slen = 0;
report_t3Var._rlen = 0;
}
report_t3Var._wap = 3;
t.an.add_t3(report_t3Var);
}
util.LOGI(getClass().getName() + ":snd_rcv_req_msf ret=" + i, "" + this.x.f);
return i;
}
public int b(byte[] bArr) {
return util.buf_to_int16(bArr, 1);
}
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 void b(long j, byte[] bArr) {
b(this.i, this.t, j, this.m, t.w, this.p, bArr);
}
public void b(byte[] bArr, int i) {
if (i > this.f85587b) {
this.f85587b = i + 128;
this.h = new byte[this.f85587b];
}
this.f85588c = i;
System.arraycopy(bArr, 0, this.h, 0, i);
}
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.m == 0 ? a(bArr2, this.x.f85593c, this.x.n, this.x.p) : a(bArr2, this.x.f85593c);
}
protected byte[] b(byte[] bArr, byte[] bArr2, byte[] bArr3) {
return a(bArr, bArr2, bArr3);
}
public int c(boolean z) {
return 443;
}
public int c(byte[] bArr, int i) {
this.w = bArr[i];
return bArr[i] & 255;
}
public void c(byte[] bArr, int i, int i2) {
tlv_t146 tlv_t146Var = new tlv_t146();
int i3 = tlv_t146Var.get_tlv(bArr, i, i2);
async_context b2 = t.b(this.x.h);
if (i3 >= 0) {
b2._last_err_msg.setTitle(new String(tlv_t146Var.get_title()));
b2._last_err_msg.setMessage(new String(tlv_t146Var.get_msg()));
b2._last_err_msg.setType(tlv_t146Var.get_type());
b2._last_err_msg.setOtherinfo(new String(tlv_t146Var.get_errorinfo()));
}
}
public byte[] c() {
int i = this.f85588c;
byte[] bArr = new byte[i];
System.arraycopy(this.h, 0, bArr, 0, i);
return bArr;
}
public byte[] c(byte[] bArr) {
byte[] decrypt;
if (t.B == null || t.B.length <= 0) {
decrypt = cryptor.decrypt(bArr, 0, bArr.length, "%4;7t>;28<fc.5*6".getBytes());
} else {
byte[] bArr2 = new byte[16];
if (t.B.length > bArr2.length) {
System.arraycopy(t.B, 0, bArr2, 0, bArr2.length);
} else {
System.arraycopy(t.B, 0, bArr2, 0, t.B.length);
int length = t.B.length;
while (length < bArr2.length) {
int i = length + 1;
bArr2[length] = (byte) i;
length = i;
}
}
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());
}
}
if (decrypt == null) {
decrypt = (byte[]) bArr.clone();
}
if (decrypt == null || decrypt.length < 16) {
return (byte[]) null;
}
int length2 = decrypt.length - 16;
byte[] bArr3 = new byte[length2];
System.arraycopy(decrypt, 0, bArr3, 0, length2);
byte[] bArr4 = new byte[16];
System.arraycopy(decrypt, length2, bArr4, 0, 16);
t.b(this.x.h)._tgtgt_key = bArr4;
return bArr3;
}
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);
int length2 = bArr3.length;
return MD5.toMD5Byte(bArr4);
}
public int d(byte[] bArr, int i, int i2) {
int i3;
int c2;
String str;
tlv_t119 tlv_t119Var;
tlv_t403 tlv_t403Var;
int i4;
byte[] bArr2;
int i5;
int i6;
int i7;
int i8;
tlv_t108 tlv_t108Var;
byte[] bArr3;
tlv_t10b tlv_t10bVar;
byte[] bArr4;
tlv_t11c tlv_t11cVar;
byte[] bArr5;
tlv_t120 tlv_t120Var;
byte[] bArr6;
tlv_t121 tlv_t121Var;
byte[] bArr7;
tlv_t125 tlv_t125Var;
byte[] bArr8;
tlv_t186 tlv_t186Var;
byte[] bArr9;
byte[] bArr10;
async_context async_contextVar;
tlv_t403 tlv_t403Var2;
byte[] bArr11;
int i9;
int i10;
byte[] bArr12;
String str2;
tlv_t10a tlv_t10aVar;
tlv_t118 tlv_t118Var;
int i11;
long j;
long j2;
t tVar;
int b2;
int i12;
int i13;
ErrMsg errMsg;
int i14;
int i15;
if (i2 < 5) {
return -1009;
}
tlv_t104 tlv_t104Var = new tlv_t104();
tlv_t105 tlv_t105Var = new tlv_t105();
tlv_t113 tlv_t113Var = new tlv_t113();
tlv_t119 tlv_t119Var2 = new tlv_t119();
tlv_t10d tlv_t10dVar = new tlv_t10d();
tlv_t10e tlv_t10eVar = new tlv_t10e();
tlv_t10a tlv_t10aVar2 = new tlv_t10a();
tlv_t114 tlv_t114Var = new tlv_t114();
tlv_t103 tlv_t103Var = new tlv_t103();
tlv_t11a tlv_t11aVar = new tlv_t11a();
tlv_t102 tlv_t102Var = new tlv_t102();
tlv_t10b tlv_t10bVar2 = new tlv_t10b();
tlv_t11c tlv_t11cVar2 = new tlv_t11c();
tlv_t11d tlv_t11dVar = new tlv_t11d();
tlv_t120 tlv_t120Var2 = new tlv_t120();
tlv_t121 tlv_t121Var2 = new tlv_t121();
tlv_t130 tlv_t130Var = new tlv_t130();
tlv_t108 tlv_t108Var2 = new tlv_t108();
tlv_t106 tlv_t106Var = new tlv_t106();
tlv_t10c tlv_t10cVar = new tlv_t10c();
tlv_t125 tlv_t125Var2 = new tlv_t125();
tlv_t11f tlv_t11fVar = new tlv_t11f();
tlv_t138 tlv_t138Var = new tlv_t138();
tlv_t132 tlv_t132Var = new tlv_t132();
tlv_t149 tlv_t149Var = new tlv_t149();
tlv_t150 tlv_t150Var = new tlv_t150();
tlv_t143 tlv_t143Var = new tlv_t143();
tlv_t305 tlv_t305Var = new tlv_t305();
tlv_t164 tlv_t164Var = new tlv_t164();
tlv_t165 tlv_t165Var = new tlv_t165();
tlv_t167 tlv_t167Var = new tlv_t167();
tlv_t16a tlv_t16aVar = new tlv_t16a();
tlv_t169 tlv_t169Var = new tlv_t169();
tlv_t161 tlv_t161Var = new tlv_t161();
tlv_t171 tlv_t171Var = new tlv_t171();
tlv_t tlv_tVar = new tlv_t(1298);
tlv_t16d tlv_t16dVar = new tlv_t16d();
tlv_t174 tlv_t174Var = new tlv_t174();
tlv_t178 tlv_t178Var = new tlv_t178();
tlv_t179 tlv_t179Var = new tlv_t179();
tlv_t17d tlv_t17dVar = new tlv_t17d();
tlv_t17e tlv_t17eVar = new tlv_t17e();
tlv_t126 tlv_t126Var = new tlv_t126();
tlv_t182 tlv_t182Var = new tlv_t182();
tlv_t183 tlv_t183Var = new tlv_t183();
tlv_t186 tlv_t186Var2 = new tlv_t186();
tlv_t402 tlv_t402Var = new tlv_t402();
tlv_t403 tlv_t403Var3 = new tlv_t403();
tlv_t136 tlv_t136Var = new tlv_t136();
tlv_t118 tlv_t118Var2 = new tlv_t118();
async_context b3 = t.b(this.x.h);
long j3 = b3._sappid;
long j4 = b3._appid;
if (this.t == 2064) {
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 -1012;
case 4:
i3 = 3;
break;
case 7:
i3 = 6;
break;
case 9:
case 17:
case 19:
case 20:
case 22:
break;
case 10:
case 11:
i3 = 1;
break;
case 13:
i3 = 4;
break;
case 15:
i3 = 5;
break;
case 18:
i3 = 7;
break;
}
c2 = c(bArr, i + 2);
int i16 = i3;
int i17 = i + 5;
t tVar2 = this.x;
tVar2.f85594d = null;
if (c2 == 0) {
if (c2 != 1) {
if (c2 == 2) {
i13 = tlv_t104Var.get_tlv(bArr, i17, (this.f85588c - i17) - 1);
if (i13 >= 0) {
b3._t104 = tlv_t104Var;
tlv_t192 tlv_t192Var = new tlv_t192();
if (tlv_t192Var.get_tlv(bArr, i17, (this.f85588c - i17) - 1) >= 0) {
str = "";
errMsg = new ErrMsg(c2, str, str, tlv_t192Var.getUrl());
} else {
str = "";
int i18 = tlv_t105Var.get_tlv(bArr, i17, (this.f85588c - i17) - 1);
if (i18 < 0) {
i6 = i18;
i5 = i17;
i4 = c2;
bArr2 = bArr;
} else {
b3._t105 = tlv_t105Var;
if (tlv_t165Var.get_tlv(bArr, i17, (this.f85588c - i17) - 1) >= 0) {
b3._t165 = tlv_t165Var;
} else {
b3._t165 = new tlv_t165();
}
errMsg = null;
}
}
a(errMsg);
bArr2 = bArr;
i5 = i17;
i6 = c2;
i4 = i6;
}
i6 = i13;
i5 = i17;
i4 = c2;
str = "";
bArr2 = bArr;
} else if (c2 != 15) {
if (c2 == 16) {
i14 = 1;
tVar2.e(tVar2.f, j3);
i15 = tlv_t130Var.get_tlv(bArr, i17, (this.f85588c - i17) - 1);
if (i15 >= 0) {
this.x.a(tlv_t130Var.get_time(), tlv_t130Var.get_ipaddr());
c(bArr, i17, (this.f85588c - i17) - i14);
str = "";
bArr2 = bArr;
i5 = i17;
i6 = c2;
i4 = i6;
}
bArr2 = bArr;
i6 = i15;
i5 = i17;
i4 = c2;
str = "";
} else if (c2 == 41 || c2 == 116) {
i14 = 1;
tlv_t tlv_tVar2 = new tlv_t(405);
i13 = tlv_tVar2.get_tlv(bArr, i17, (this.f85588c - i17) - 1);
if (i13 >= 0) {
WloginSigInfo._LHSig = tlv_tVar2.get_data();
c(bArr, i17, (this.f85588c - i17) - i14);
str = "";
bArr2 = bArr;
i5 = i17;
i6 = c2;
i4 = i6;
}
i6 = i13;
i5 = i17;
i4 = c2;
str = "";
bArr2 = bArr;
} else if (c2 == 160) {
if (tlv_t113Var.get_tlv(bArr, i17, (this.f85588c - i17) - 1) >= 0) {
this.x.f = tlv_t113Var.get_uin();
t tVar3 = this.x;
tVar3.a(tVar3.g, Long.valueOf(this.x.f));
}
i6 = tlv_t104Var.get_tlv(bArr, i17, (this.f85588c - i17) - 1);
if (i6 >= 0) {
b3._t104 = tlv_t104Var;
i6 = tlv_t174Var.get_tlv(bArr, i17, (this.f85588c - i17) - 1);
if (i6 >= 0) {
b3._t174 = tlv_t174Var;
if (tlv_t178Var.get_tlv(bArr, i17, (this.f85588c - i17) - 1) >= 0) {
b3._devlock_info.CountryCode = new String(tlv_t178Var.get_country_code());
b3._devlock_info.Mobile = new String(tlv_t178Var.get_mobile());
b3._devlock_info.MbItemSmsCodeStatus = tlv_t178Var.get_smscode_status();
b3._devlock_info.AvailableMsgCount = tlv_t178Var.get_available_msg_cnt();
b3._devlock_info.TimeLimit = tlv_t178Var.get_time_limit();
}
tlv_t196 tlv_t196Var = new tlv_t196();
if (tlv_t196Var.get_tlv(bArr, i17, (this.f85588c - i17) - 1) >= 0) {
b3._devlock_info.BakCountryCode = tlv_t196Var.getCountryCode();
b3._devlock_info.BakMobile = tlv_t196Var.getBakMobile();
b3._devlock_info.BakMobileState = tlv_t196Var.getBakMobileState();
}
if (tlv_t179Var.get_tlv(bArr, i17, (this.f85588c - i17) - 1) >= 0) {
b3._devlock_info.UnionVerifyUrl = new String(tlv_t179Var.get_verify_url());
}
if (tlv_t17dVar.get_tlv(bArr, i17, (this.f85588c - i17) - 1) >= 0) {
b3._devlock_info.MbGuideType = tlv_t17dVar.get_mb_guide_type();
b3._devlock_info.MbGuideMsg = new String(tlv_t17dVar.get_mb_guide_msg());
b3._devlock_info.MbGuideInfoType = tlv_t17dVar.get_mb_guide_info_type();
b3._devlock_info.MbGuideInfo = new String(tlv_t17dVar.get_mb_guide_info());
}
if (tlv_t17eVar.get_tlv(bArr, i17, (this.f85588c - i17) - 1) >= 0) {
b3._devlock_info.VerifyReason = new String(tlv_t17eVar.get_data());
}
i14 = 1;
if (tlv_t402Var.get_tlv(bArr, i17, (this.f85588c - i17) - 1) < 0) {
tlv_t402Var = new tlv_t402();
}
b3._t402 = tlv_t402Var;
if (tlv_t403Var3.get_tlv(bArr, i17, (this.f85588c - i17) - 1) < 0) {
b3._t403 = new tlv_t403();
c(bArr, i17, (this.f85588c - i17) - i14);
str = "";
bArr2 = bArr;
i5 = i17;
i6 = c2;
i4 = i6;
}
b3._t403 = tlv_t403Var3;
c(bArr, i17, (this.f85588c - i17) - i14);
str = "";
bArr2 = bArr;
i5 = i17;
i6 = c2;
i4 = i6;
}
}
bArr2 = bArr;
i5 = i17;
i4 = c2;
str = "";
} else if (c2 == 176) {
c(bArr, i17, (this.f85588c - i17) - 1);
t tVar4 = this.x;
tVar4.a(tVar4.g);
str = "";
bArr2 = bArr;
i5 = i17;
i6 = c2;
i4 = i6;
} else if (c2 != 180) {
if (c2 == 204) {
if (tlv_t113Var.get_tlv(bArr, i17, (this.f85588c - i17) - 1) >= 0) {
this.x.f = tlv_t113Var.get_uin();
t tVar5 = this.x;
tVar5.a(tVar5.g, Long.valueOf(this.x.f));
}
i14 = 1;
i6 = tlv_t104Var.get_tlv(bArr, i17, (this.f85588c - i17) - 1);
if (i6 >= 0) {
b3._t104 = tlv_t104Var;
i6 = tlv_t402Var.get_tlv(bArr, i17, (this.f85588c - i17) - 1);
if (i6 >= 0) {
b3._t402 = tlv_t402Var;
i13 = tlv_t403Var3.get_tlv(bArr, i17, (this.f85588c - i17) - 1);
}
}
bArr2 = bArr;
i5 = i17;
i4 = c2;
str = "";
} else if (c2 != 208) {
c(bArr, i17, (this.f85588c - i17) - 1);
str = "";
bArr2 = bArr;
i5 = i17;
i6 = c2;
i4 = i6;
} else {
i13 = tlv_t104Var.get_tlv(bArr, i17, (this.f85588c - i17) - 1);
if (i13 >= 0) {
b3._t104 = tlv_t104Var;
i13 = tlv_t126Var.get_tlv(bArr, i17, (this.f85588c - i17) - 1);
if (i13 >= 0) {
b3._t126 = tlv_t126Var;
i13 = tlv_t182Var.get_tlv(bArr, i17, (this.f85588c - i17) - 1);
if (i13 >= 0) {
b3._smslogin_msgcnt = tlv_t182Var.getMsgCnt();
b3._smslogin_timelimit = tlv_t182Var.getTimeLimit();
i13 = tlv_t183Var.get_tlv(bArr, i17, (this.f85588c - i17) - 1);
if (i13 >= 0) {
b3._msalt = tlv_t183Var.getMsalt();
bArr2 = bArr;
i5 = i17;
i4 = c2;
str = "";
i6 = 0;
}
}
}
}
}
i6 = i13;
i5 = i17;
i4 = c2;
str = "";
bArr2 = bArr;
} else {
i14 = 1;
i15 = tlv_t161Var.get_tlv(bArr, i17, (this.f85588c - i17) - 1);
if (i15 >= 0) {
a(tlv_t161Var);
c(bArr, i17, (this.f85588c - i17) - i14);
str = "";
bArr2 = bArr;
i5 = i17;
i6 = c2;
i4 = i6;
}
bArr2 = bArr;
i6 = i15;
i5 = i17;
i4 = c2;
str = "";
}
}
}
str = "";
util.LOGI("cmd " + Integer.toHexString(this.t) + " subcmd " + Integer.toHexString(this.u) + " result " + c2 + " will clean sig for uin " + this.x.f + " appid " + j3);
t tVar6 = this.x;
tVar6.e(tVar6.f, j3);
c(bArr, i17, (this.f85588c - i17) - 1);
bArr2 = bArr;
i5 = i17;
i6 = c2;
i4 = i6;
} else {
str = "";
if (i16 != 1) {
tlv_t119Var = tlv_t119Var2;
if (i16 == 2) {
if (tlv_t183Var.get_tlv(bArr, i17, this.f85588c - i17) >= 0) {
tlv_t403Var = tlv_t403Var3;
b3._msalt = tlv_t183Var.getMsalt();
} else {
tlv_t403Var = tlv_t403Var3;
}
if (f() != 3) {
if (tlv_t150Var.get_tlv(bArr, i17, (this.f85588c - i17) - 1) >= 0) {
this.x.f85594d = tlv_t150Var;
}
if (tlv_t161Var.get_tlv(bArr, i17, (this.f85588c - i17) - 1) >= 0) {
a(tlv_t161Var);
}
i7 = tlv_t119Var.get_tlv(bArr, i17, (this.f85588c - i17) - 1, b3._tgtgt_key);
} else if (tlv_t113Var.get_tlv(bArr, i17, (this.f85588c - i17) - 1) >= 0) {
this.x.f = tlv_t113Var.get_uin();
t tVar7 = this.x;
tVar7.a(tVar7.g, Long.valueOf(this.x.f));
}
} else {
tlv_t403Var = tlv_t403Var3;
if (i16 == 3 || i16 == 7) {
i16 = i16;
i4 = c2;
bArr2 = bArr;
i5 = i17;
if (tlv_t183Var.get_tlv(bArr2, i5, this.f85588c - i17) >= 0) {
b3._msalt = tlv_t183Var.getMsalt();
}
if (tlv_t113Var.get_tlv(bArr2, i5, this.f85588c - i5) >= 0) {
this.x.f = tlv_t113Var.get_uin();
t tVar8 = this.x;
tVar8.a(tVar8.g, Long.valueOf(this.x.f));
}
int i19 = tlv_t104Var.get_tlv(bArr2, i5, this.f85588c - i5);
if (i19 < 0) {
i6 = i19;
} else {
b3._t104 = tlv_t104Var;
i6 = 0;
}
} else if (22 == this.u) {
int i20 = tlv_t104Var.get_tlv(bArr, i17, this.f85588c - i17);
if (i20 < 0) {
i6 = i20;
i16 = i16;
i5 = i17;
i4 = c2;
bArr2 = bArr;
}
b3._t104 = tlv_t104Var;
bArr2 = bArr;
i16 = i16;
i5 = i17;
i4 = c2;
i6 = 0;
} else {
if (tlv_t150Var.get_tlv(bArr, i17, (this.f85588c - i17) - 1) >= 0) {
this.x.f85594d = tlv_t150Var;
}
if (tlv_t161Var.get_tlv(bArr, i17, (this.f85588c - i17) - 1) >= 0) {
a(tlv_t161Var);
}
i7 = tlv_t119Var.get_tlv(bArr, i17, (this.f85588c - i17) - 1, b3._tgtgt_key);
s.I = 0;
}
}
} else {
if (tVar2.f85592b == null) {
return -1006;
}
if (tlv_t150Var.get_tlv(bArr, i17, (this.f85588c - i17) - 1) >= 0) {
this.x.f85594d = tlv_t150Var;
}
if (tlv_t161Var.get_tlv(bArr, i17, (this.f85588c - i17) - 1) >= 0) {
a(tlv_t161Var);
}
tlv_t119Var = tlv_t119Var2;
i7 = tlv_t119Var.get_tlv(bArr, i17, (this.f85588c - i17) - 1, this.x.f85592b);
tlv_t403Var = tlv_t403Var3;
}
if (i7 < 0) {
bArr2 = bArr;
i6 = i7;
i16 = i16;
i5 = i17;
} else {
byte[] bArr13 = tlv_t119Var.get_data();
int length = bArr13.length;
if (tlv_t149Var.get_tlv(bArr13, 2, length) > 0) {
a(tlv_t149Var);
}
if (tlv_t130Var.get_tlv(bArr13, 2, length) > 0) {
this.x.a(tlv_t130Var.get_time(), tlv_t130Var.get_ipaddr());
}
if (tlv_t113Var.get_tlv(bArr13, 2, length) >= 0) {
this.x.f = tlv_t113Var.get_uin();
t tVar9 = this.x;
tVar9.a(tVar9.g, Long.valueOf(this.x.f));
}
tlv_t tlv_tVar3 = new tlv_t(1320);
if (tlv_tVar3.get_tlv(bArr13, 2, length) > 0) {
util.LOGI("get tlv528 and put into context from seq " + this.x.h, str + this.x.f);
b3.tlv528 = tlv_tVar3;
}
tlv_t10dVar.get_tlv(bArr13, 2, length);
tlv_t10eVar.get_tlv(bArr13, 2, length);
tlv_t10aVar2.get_tlv(bArr13, 2, length);
tlv_t114Var.get_tlv(bArr13, 2, length);
int i21 = tlv_t11aVar.get_tlv(bArr13, 2, length);
if (i21 < 0) {
bArr2 = bArr;
i16 = i16;
i5 = i17;
i6 = i21;
} else {
i16 = i16;
if (tlv_t118Var2.get_tlv(bArr13, 2, length) < 0) {
StringBuilder sb = new StringBuilder();
sb.append(str);
i4 = c2;
i8 = i17;
sb.append(this.x.f);
util.LOGI("t118 get failed", sb.toString());
} else {
i8 = i17;
i4 = c2;
}
if (tlv_t103Var.get_tlv(bArr13, 2, length) >= 0) {
bArr3 = tlv_t103Var.get_data();
tlv_t108Var = tlv_t108Var2;
} else {
tlv_t108Var = tlv_t108Var2;
bArr3 = null;
}
if (tlv_t108Var.get_tlv(bArr13, 2, length) >= 0) {
util.set_ksid(t.t, tlv_t108Var.get_data());
}
if (tlv_t102Var.get_tlv(bArr13, 2, length) >= 0) {
bArr4 = tlv_t102Var.get_data();
tlv_t10bVar = tlv_t10bVar2;
} else {
tlv_t10bVar = tlv_t10bVar2;
bArr4 = null;
}
if (tlv_t10bVar.get_tlv(bArr13, 2, length) >= 0) {
bArr5 = tlv_t10bVar.get_data();
tlv_t11cVar = tlv_t11cVar2;
} else {
tlv_t11cVar = tlv_t11cVar2;
bArr5 = null;
}
if (tlv_t11cVar.get_tlv(bArr13, 2, length) >= 0) {
bArr6 = tlv_t11cVar.get_data();
tlv_t120Var = tlv_t120Var2;
} else {
tlv_t120Var = tlv_t120Var2;
bArr6 = null;
}
if (tlv_t120Var.get_tlv(bArr13, 2, length) >= 0) {
bArr7 = tlv_t120Var.get_data();
tlv_t121Var = tlv_t121Var2;
} else {
tlv_t121Var = tlv_t121Var2;
bArr7 = null;
}
if (tlv_t121Var.get_tlv(bArr13, 2, length) >= 0) {
bArr8 = tlv_t121Var.get_data();
tlv_t125Var = tlv_t125Var2;
} else {
tlv_t125Var = tlv_t125Var2;
bArr8 = null;
}
if (tlv_t125Var.get_tlv(bArr13, 2, length) >= 0) {
bArr9 = tlv_t125Var.get_openid();
bArr10 = tlv_t125Var.get_openkey();
tlv_t186Var = tlv_t186Var2;
} else {
tlv_t186Var = tlv_t186Var2;
bArr9 = null;
bArr10 = null;
}
if (tlv_t186Var.get_tlv(bArr13, 2, length) >= 0) {
String str3 = this.x.g;
if (util.check_uin_account(str3).booleanValue()) {
t tVar10 = this.x;
async_contextVar = b3;
str3 = tVar10.e(tVar10.f);
if (str3 == null || str3.length() <= 0) {
tlv_t403Var2 = tlv_t403Var;
bArr11 = bArr13;
util.LOGI("put t186: name: " + str3 + " uin: " + this.x.f + " pwd=" + tlv_t186Var.getPwdflag(), str);
} else {
tVar = this.x;
tlv_t403Var2 = tlv_t403Var;
bArr11 = bArr13;
}
} else {
async_contextVar = b3;
tlv_t403Var2 = tlv_t403Var;
bArr11 = bArr13;
tVar = this.x;
}
tVar.a(str3, Long.valueOf(tVar.f), tlv_t186Var.getPwdflag());
util.LOGI("put t186: name: " + str3 + " uin: " + this.x.f + " pwd=" + tlv_t186Var.getPwdflag(), str);
} else {
async_contextVar = b3;
tlv_t403Var2 = tlv_t403Var;
bArr11 = bArr13;
}
util.LOGI("tgt len:" + util.buf_len(tlv_t10aVar2.get_data()) + " tgt_key len:" + util.buf_len(tlv_t10dVar.get_data()) + " st len:" + util.buf_len(tlv_t114Var.get_data()) + " st_key len:" + util.buf_len(tlv_t10eVar.get_data()) + " stwx_web len:" + util.buf_len(bArr3) + " lskey len:" + util.buf_len(bArr6) + " skey len:" + util.buf_len(bArr7) + " sig64 len:" + util.buf_len(bArr8) + " openid len:" + util.buf_len(bArr9) + " openkey len:" + util.buf_len(bArr10) + " pwdflag: " + tlv_t186Var.get_data_len() + " " + tlv_t186Var.getPwdflag(), str + this.x.f);
byte[] bArr14 = bArr11;
if (tlv_t169Var.get_tlv(bArr14, 2, length) >= 0) {
byte[] a2 = a(tlv_t169Var);
if (a2 == null || a2.length <= 0) {
this.x.j = new WFastLoginInfo();
} else {
this.x.j = new WFastLoginInfo(a2);
}
}
byte[][] bArr15 = (byte[][]) Array.newInstance((Class<?>) byte.class, 3, 0);
if (tlv_t167Var.get_tlv(bArr14, 2, length) >= 0) {
i9 = 0;
bArr15[0] = tlv_t167Var.get_img_type();
bArr15[1] = tlv_t167Var.get_img_format();
bArr15[2] = tlv_t167Var.get_img_url();
} else {
i9 = 0;
}
byte[] bArr16 = bArr9;
byte[][] bArr17 = (byte[][]) Array.newInstance((Class<?>) byte.class, 5, i9);
int i22 = 0;
for (int i23 = 5; i22 < i23; i23 = 5) {
bArr17[i22] = new byte[i9];
i22++;
i9 = 0;
}
int i24 = tlv_t10cVar.get_tlv(bArr14, 2, length);
if (tlv_t106Var.get_tlv(bArr14, 2, length) >= 0 && i24 >= 0) {
bArr17[0] = (byte[]) b(tlv_t106Var.get_data(), tlv_t10cVar.get_data()).clone();
}
if (tlv_t16aVar.get_tlv(bArr14, 2, length) >= 0) {
bArr17[1] = tlv_t16aVar.get_data();
}
if (tlv_t403Var2.get_tlv(bArr14, 2, length) >= 0) {
bArr17[4] = tlv_t403Var2.get_data();
}
async_context async_contextVar2 = async_contextVar;
if (async_contextVar2._sec_guid_flag) {
bArr17[2] = async_contextVar2._G;
bArr17[3] = async_contextVar2._dpwd;
bArr17[4] = async_contextVar2._t403.get_data();
i10 = 0;
async_contextVar2._sec_guid_flag = false;
} else {
i10 = 0;
}
byte[][] bArr18 = (byte[][]) Array.newInstance((Class<?>) byte.class, 15, i10);
for (int i25 = 0; i25 < 15; i25++) {
bArr18[i25] = new byte[i10];
}
if (tlv_t136Var.get_tlv(bArr14, 2, length) >= 0) {
bArr18[i10] = tlv_t136Var.get_data();
}
if (tlv_t132Var.get_tlv(bArr14, 2, length) >= 0) {
bArr18[1] = tlv_t132Var.get_access_token();
bArr16 = tlv_t132Var.get_openid();
}
if (tlv_t143Var.get_tlv(bArr14, 2, length) >= 0) {
bArr18[2] = tlv_t143Var.get_data();
}
if (tlv_t305Var.get_tlv(bArr14, 2, length) >= 0) {
bArr18[3] = tlv_t305Var.get_data();
}
if (tlv_t164Var.get_tlv(bArr14, 2, length) >= 0) {
bArr18[4] = tlv_t164Var.get_data();
}
if (tlv_t171Var.get_tlv(bArr14, 2, length) >= 0) {
bArr18[5] = tlv_t171Var.get_data();
}
if (tlv_tVar.get_tlv(bArr14, 2, length) >= 0) {
bArr18[6] = tlv_tVar.get_data();
}
if (tlv_t16dVar.get_tlv(bArr14, 2, length) >= 0) {
bArr18[7] = tlv_t16dVar.get_data();
}
tlv_t199 tlv_t199Var = new tlv_t199();
if (tlv_t199Var.get_tlv(bArr14, 2, length) >= 0) {
bArr18[8] = tlv_t199Var.getPayToken();
bArr12 = tlv_t199Var.getOpenId();
} else {
bArr12 = bArr16;
}
tlv_t200 tlv_t200Var = new tlv_t200();
if (tlv_t200Var.get_tlv(bArr14, 2, length) >= 0) {
bArr18[9] = tlv_t200Var.getPf();
bArr18[10] = tlv_t200Var.getPfKey();
}
tlv_t tlv_tVar4 = new tlv_t(515);
if (tlv_tVar4.get_tlv(bArr14, 2, length) >= 0) {
bArr18[11] = tlv_tVar4.get_data();
str2 = "get DA2 in rsp";
} else {
str2 = "no DA2 in rsp";
}
util.LOGI(str2, str);
tlv_t tlv_tVar5 = new tlv_t(com.tencent.luggage.wxa.mc.i.CTRL_INDEX);
if (tlv_tVar5.get_tlv(bArr14, 2, length) >= 0) {
WloginSigInfo._QRPUSHSig = tlv_tVar5.get_data();
} else {
WloginSigInfo._QRPUSHSig = new byte[0];
}
tlv_t tlv_tVar6 = new tlv_t(307);
if (tlv_tVar6.get_tlv(bArr14, 2, length) >= 0) {
bArr18[13] = tlv_tVar6.get_data();
} else {
util.LOGW("get t133 failed", str + this.x.f);
}
tlv_t tlv_tVar7 = new tlv_t(308);
if (tlv_tVar7.get_tlv(bArr14, 2, length) >= 0) {
bArr18[14] = tlv_tVar7.get_data();
} else {
util.LOGW("get t134 failed", str + this.x.f);
}
util.LOGI("encrypt_a1 len:" + util.buf_len(bArr17[0]) + " no_pic_sig len:" + util.buf_len(bArr17[1]) + " G len:" + util.buf_len(bArr17[2]) + " dpwd len:" + util.buf_len(bArr17[3]) + " randseed len:" + util.buf_len(bArr17[4]) + " vkey len:" + util.buf_len(bArr18[0]) + " openid len:" + util.buf_len(bArr12) + " access_token len:" + util.buf_len(bArr18[1]) + " d2 len:" + util.buf_len(bArr18[2]) + " d2_key len:" + util.buf_len(bArr18[3]) + " sid len:" + util.buf_len(bArr18[4]) + " aq_sig len:" + util.buf_len(bArr18[5]) + " pskey len:" + util.buf_len(bArr18[6]) + " super_key len:" + util.buf_len(bArr18[7]) + " paytoken len:" + util.buf_len(bArr18[8]) + " pf len:" + util.buf_len(bArr18[9]) + " pfkey len:" + util.buf_len(bArr18[10]) + " da2 len:" + util.buf_len(bArr18[11]) + " wt session ticket:" + util.buf_len(bArr18[13]) + " wt session ticket key:" + util.buf_len(bArr18[14]), str + this.x.f);
long j5 = 4294967295L;
if (tlv_t11fVar.get_tlv(bArr14, 2, length) >= 0) {
tlv_t10aVar = tlv_t10aVar2;
tlv_t118Var = tlv_t118Var2;
j5 = tlv_t11fVar.get_tk_pri() & 4294967295L;
} else {
tlv_t10aVar = tlv_t10aVar2;
tlv_t118Var = tlv_t118Var2;
}
long[] jArr = new long[7];
int i26 = 2;
long j6 = 2160000;
while (true) {
int i27 = tlv_t138Var.get_tlv(bArr14, i26, length);
if (i27 >= 0) {
if (tlv_t138Var.get_a2_chg_time() != 0) {
j6 = tlv_t138Var.get_a2_chg_time();
}
if (tlv_t138Var.get_lskey_chg_time() != 0) {
i11 = i27;
j = j6;
jArr[0] = tlv_t138Var.get_lskey_chg_time();
} else {
i11 = i27;
j = j6;
jArr[0] = 1641600;
}
if (tlv_t138Var.get_skey_chg_time() != 0) {
jArr[1] = tlv_t138Var.get_skey_chg_time();
} else {
jArr[1] = 86400;
}
if (tlv_t138Var.get_vkey_chg_time() != 0) {
jArr[2] = tlv_t138Var.get_vkey_chg_time();
} else {
jArr[2] = 1728000;
}
if (tlv_t138Var.get_a8_chg_time() != 0) {
jArr[3] = tlv_t138Var.get_a8_chg_time();
} else {
jArr[3] = 72000;
}
if (tlv_t138Var.get_stweb_chg_time() != 0) {
jArr[4] = tlv_t138Var.get_stweb_chg_time();
} else {
jArr[4] = 6000;
}
if (tlv_t138Var.get_d2_chg_time() != 0) {
jArr[5] = tlv_t138Var.get_d2_chg_time();
j2 = 1728000;
} else {
j2 = 1728000;
jArr[5] = 1728000;
}
if (tlv_t138Var.get_sid_chg_time() != 0) {
jArr[6] = tlv_t138Var.get_sid_chg_time();
} else {
jArr[6] = j2;
}
i26 = i11;
j6 = j;
} else {
util.LOGI("sappid:" + j3 + " appid:" + j4 + " app_pri:" + j5 + " login_bitmap:" + async_contextVar2._login_bitmap + " tk_valid:0 a2_valid:" + j6 + " 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], str + this.x.f);
WloginSimpleInfo wloginSimpleInfo = new WloginSimpleInfo();
wloginSimpleInfo.setUin(this.x.f);
wloginSimpleInfo.setFace(tlv_t11aVar.get_face());
wloginSimpleInfo.setAge(tlv_t11aVar.get_age());
wloginSimpleInfo.setGender(tlv_t11aVar.get_gender());
wloginSimpleInfo.setNick(tlv_t11aVar.get_nick());
wloginSimpleInfo.setReserveUinInfo(bArr15);
wloginSimpleInfo.setMainDisplayName(tlv_t118Var.get_data());
this.x.aq = async_contextVar2._main_sigmap;
t tVar11 = this.x;
int a3 = tVar11.a(tVar11.f, j3, bArr17, j4, j5, t.f(), t.f() + 0, t.f() + j6, wloginSimpleInfo, tlv_t10aVar.get_data(), tlv_t10dVar.get_data(), tlv_t114Var.get_data(), tlv_t10eVar.get_data(), bArr3, bArr5, bArr4, bArr6, bArr7, bArr8, bArr12, bArr10, bArr18, jArr, async_contextVar2._login_bitmap);
if (a3 != 0) {
ErrMsg errMsg2 = new ErrMsg();
errMsg2.setMessage(InternationMsg.a(InternationMsg.MSG_TYPE.MSG_2));
a(errMsg2);
util.LOGI("put_siginfo fail,ret=" + a3, str + this.x.f);
bArr2 = bArr;
i6 = a3;
i5 = i8;
} else {
int i28 = 2;
while (true) {
i28 = tlv_t11dVar.get_tlv(bArr14, i28, length);
if (i28 >= 0) {
t tVar12 = this.x;
tVar12.a(tVar12.f, tlv_t11dVar.get_appid(), t.f(), t.f() + 0, tlv_t11dVar.get_st(), tlv_t11dVar.get_stkey());
} else {
bArr2 = bArr;
i5 = i8;
i6 = 0;
}
}
}
}
}
}
}
i4 = c2;
}
StringBuilder sb2 = new StringBuilder();
sb2.append("type:");
sb2.append(i4);
sb2.append(" ret:");
sb2.append(i6 <= 0 ? "0x" + Integer.toHexString(i6) : Integer.valueOf(i6));
util.LOGI(sb2.toString(), str + this.x.f);
if (i6 != 0) {
a((ErrMsg) null);
} else {
new tlv_t508().get_tlv(bArr2, i5, (this.f85588c - i5) - 1);
if (tlv_t508.doFetch) {
ErrMsg errMsg3 = new ErrMsg();
b2 = new i(this.x, this.t, this.u, errMsg3).b(i6);
if (b2 != -1000) {
a(errMsg3);
if (b2 != 10 || b2 == 161 || b2 == 162 || b2 == 164 || b2 == 165 || b2 == 166 || b2 == 154 || (b2 >= 128 && b2 <= 143)) {
b2 = -1000;
}
i12 = i16;
if (i12 != 2 && i12 != 6 && i12 != 7) {
a(i12);
}
return b2;
}
}
}
b2 = i6;
if (b2 != 10) {
}
b2 = -1000;
i12 = i16;
if (i12 != 2) {
a(i12);
}
return b2;
}
i3 = 0;
c2 = c(bArr, i + 2);
int i162 = i3;
int i172 = i + 5;
t tVar22 = this.x;
tVar22.f85594d = null;
if (c2 == 0) {
}
StringBuilder sb22 = new StringBuilder();
sb22.append("type:");
sb22.append(i4);
sb22.append(" ret:");
if (i6 <= 0) {
}
sb22.append(i6 <= 0 ? "0x" + Integer.toHexString(i6) : Integer.valueOf(i6));
util.LOGI(sb22.toString(), str + this.x.f);
if (i6 != 0) {
}
b2 = i6;
if (b2 != 10) {
}
b2 = -1000;
i12 = i162;
if (i12 != 2) {
}
return b2;
}
public Socket d() {
return this.x.aj;
}
public int e() {
long j;
int i;
int i2;
boolean z;
int i3;
String str;
String str2;
int i4;
int i5;
boolean z2;
boolean z3;
boolean z4;
int i6;
boolean z5;
int i7;
boolean z6;
boolean z7;
boolean is_wap_proxy_retry;
String str3;
int i8;
boolean z8;
boolean z9;
boolean z10;
String str4;
boolean z11;
String str5;
boolean z12;
boolean z13;
boolean z14;
boolean z15;
String hostAddress;
URL url;
String str6;
StringBuilder sb;
HttpURLConnection httpURLConnection;
InputStream inputStream;
Socket socket;
int i9;
int i10;
String str7;
Socket socket2;
String str8;
util.LOGI(getClass().getName() + ":snd_rcv_req_tcp ...", "" + this.x.f);
byte[] c2 = c();
boolean z16 = false;
?? r6 = 0;
Socket d2 = d();
long j2 = 0;
String str9 = "";
String str10 = str9;
int i11 = 0;
int i12 = 0;
int i13 = 0;
boolean z17 = false;
boolean z18 = false;
int i14 = 0;
while (true) {
if (i12 >= 6) {
j = j2;
i = i11;
i2 = i13;
z = z18;
i3 = i14;
break;
}
if (i12 != 0) {
util.chg_retry_type(t.t);
}
boolean is_wap_retry = util.is_wap_retry(t.t);
this.q = r6;
if (i12 == 0 || this.t == 2066) {
str = str9;
str2 = str10;
i4 = i11;
i5 = i12;
} else {
str2 = str10;
i4 = i11;
i5 = i12;
str = str9;
a(i11, j2, i13, i12, is_wap_retry, z17);
}
long currentTimeMillis = System.currentTimeMillis();
if (is_wap_retry) {
StringBuilder sb2 = new StringBuilder();
sb2.append("try http connect ");
i12 = i5;
sb2.append(i12);
sb2.append(" ...");
util.LOGI(sb2.toString(), "" + this.x.f);
String a2 = a(i12, is_wap_retry);
try {
is_wap_proxy_retry = util.is_wap_proxy_retry(t.t);
if (is_wap_proxy_retry) {
try {
str3 = util.get_proxy_ip();
i8 = util.get_proxy_port();
if (str3 == null || str3.length() <= 0 || i8 == -1) {
try {
String str11 = "proxy_ip=" + str3 + ",proxy_port=" + i8 + ",set is_wap_proxy_retry=" + z16;
StringBuilder sb3 = new StringBuilder();
sb3.append("");
j = currentTimeMillis;
try {
sb3.append(this.x.f);
util.LOGI(str11, sb3.toString());
is_wap_proxy_retry = false;
} catch (ConnectException unused) {
z2 = is_wap_retry;
str9 = str;
z4 = false;
z17 = false;
i12++;
str10 = str2;
z18 = z2;
j2 = j;
i11 = util.E_NO_NETWORK;
r6 = z4;
z16 = false;
} catch (Exception unused2) {
z2 = is_wap_retry;
str9 = str;
i7 = util.E_NO_NETWORK;
z8 = false;
z17 = false;
i6 = i4;
z5 = z8;
if (i7 == i6) {
}
i12++;
str10 = str2;
z7 = z5;
z18 = z2;
j2 = j;
r6 = z7;
z16 = false;
}
} catch (ConnectException unused3) {
j = currentTimeMillis;
} catch (Exception unused4) {
j = currentTimeMillis;
}
} else {
j = currentTimeMillis;
}
} catch (ConnectException unused5) {
j = currentTimeMillis;
z17 = is_wap_proxy_retry;
z2 = is_wap_retry;
str9 = str;
z10 = false;
z4 = z10;
i12++;
str10 = str2;
z18 = z2;
j2 = j;
i11 = util.E_NO_NETWORK;
r6 = z4;
z16 = false;
} catch (Exception unused6) {
j = currentTimeMillis;
z17 = is_wap_proxy_retry;
z2 = is_wap_retry;
str9 = str;
i7 = util.E_NO_NETWORK;
z9 = false;
z8 = z9;
i6 = i4;
z5 = z8;
if (i7 == i6) {
}
i12++;
str10 = str2;
z7 = z5;
z18 = z2;
j2 = j;
r6 = z7;
z16 = false;
}
} else {
j = currentTimeMillis;
str3 = null;
i8 = -1;
}
if (is_wap_proxy_retry) {
try {
url = new URL(NetUtils.SCHEME_HTTP + str3 + Constants.COLON_SEPARATOR + i8 + "/cgi-bin/wlogin_proxy_login");
str4 = str;
z11 = false;
} catch (ConnectException unused7) {
z17 = is_wap_proxy_retry;
z2 = is_wap_retry;
str9 = str;
z10 = false;
z4 = z10;
i12++;
str10 = str2;
z18 = z2;
j2 = j;
i11 = util.E_NO_NETWORK;
r6 = z4;
z16 = false;
} catch (Exception unused8) {
z17 = is_wap_proxy_retry;
z2 = is_wap_retry;
str9 = str;
i7 = util.E_NO_NETWORK;
z9 = false;
z8 = z9;
i6 = i4;
z5 = z8;
if (i7 == i6) {
}
i12++;
str10 = str2;
z7 = z5;
z18 = z2;
j2 = j;
r6 = z7;
z16 = false;
}
} else {
try {
this.q = a.a(a2, 0, this.x.l);
if (this.q != null) {
try {
hostAddress = MethodDelegate.getHostAddress(this.q.getAddress());
str5 = str;
try {
if (str5.equals(hostAddress)) {
z12 = false;
z13 = false;
try {
throw new Exception("repeated failed http ip " + str5);
break;
} catch (ConnectException unused9) {
str9 = str5;
z15 = z13;
z17 = is_wap_proxy_retry;
z2 = is_wap_retry;
z10 = z15;
z4 = z10;
i12++;
str10 = str2;
z18 = z2;
j2 = j;
i11 = util.E_NO_NETWORK;
r6 = z4;
z16 = false;
} catch (Exception unused10) {
str9 = str5;
z14 = z12;
z17 = is_wap_proxy_retry;
z2 = is_wap_retry;
i7 = util.E_NO_NETWORK;
z9 = z14;
z8 = z9;
i6 = i4;
z5 = z8;
if (i7 == i6) {
}
i12++;
str10 = str2;
z7 = z5;
z18 = z2;
j2 = j;
r6 = z7;
z16 = false;
}
} else {
z14 = false;
z11 = false;
z15 = false;
try {
this.q = null;
str4 = hostAddress;
} catch (ConnectException unused11) {
str9 = hostAddress;
z17 = is_wap_proxy_retry;
z2 = is_wap_retry;
z10 = z15;
z4 = z10;
i12++;
str10 = str2;
z18 = z2;
j2 = j;
i11 = util.E_NO_NETWORK;
r6 = z4;
z16 = false;
} catch (Exception unused12) {
str9 = hostAddress;
z17 = is_wap_proxy_retry;
z2 = is_wap_retry;
i7 = util.E_NO_NETWORK;
z9 = z14;
z8 = z9;
i6 = i4;
z5 = z8;
if (i7 == i6) {
}
i12++;
str10 = str2;
z7 = z5;
z18 = z2;
j2 = j;
r6 = z7;
z16 = false;
}
}
} catch (ConnectException unused13) {
z13 = false;
str9 = str5;
z15 = z13;
z17 = is_wap_proxy_retry;
z2 = is_wap_retry;
z10 = z15;
z4 = z10;
i12++;
str10 = str2;
z18 = z2;
j2 = j;
i11 = util.E_NO_NETWORK;
r6 = z4;
z16 = false;
} catch (Exception unused14) {
z12 = false;
str9 = str5;
z14 = z12;
z17 = is_wap_proxy_retry;
z2 = is_wap_retry;
i7 = util.E_NO_NETWORK;
z9 = z14;
z8 = z9;
i6 = i4;
z5 = z8;
if (i7 == i6) {
}
i12++;
str10 = str2;
z7 = z5;
z18 = z2;
j2 = j;
r6 = z7;
z16 = false;
}
} catch (ConnectException unused15) {
str5 = str;
} catch (Exception unused16) {
str5 = str;
}
} else {
str4 = str;
z11 = false;
hostAddress = a2;
}
try {
url = new URL(NetUtils.SCHEME_HTTP + hostAddress + "/cgi-bin/wlogin_proxy_login");
z11 = z11;
} catch (ConnectException unused17) {
z2 = is_wap_retry;
str9 = str4;
z17 = is_wap_proxy_retry;
z4 = z11;
i12++;
str10 = str2;
z18 = z2;
j2 = j;
i11 = util.E_NO_NETWORK;
r6 = z4;
z16 = false;
} catch (Exception unused18) {
z2 = is_wap_retry;
str9 = str4;
z17 = is_wap_proxy_retry;
z3 = z11;
i6 = i4;
z6 = z3;
i7 = util.E_NO_NETWORK;
z5 = z6;
if (i7 == i6) {
}
i12++;
str10 = str2;
z7 = z5;
z18 = z2;
j2 = j;
r6 = z7;
z16 = false;
}
} catch (ConnectException unused19) {
z2 = is_wap_retry;
str4 = str;
z11 = false;
str9 = str4;
z17 = is_wap_proxy_retry;
z4 = z11;
i12++;
str10 = str2;
z18 = z2;
j2 = j;
i11 = util.E_NO_NETWORK;
r6 = z4;
z16 = false;
} catch (Exception unused20) {
z2 = is_wap_retry;
str4 = str;
z11 = false;
str9 = str4;
z17 = is_wap_proxy_retry;
z3 = z11;
i6 = i4;
z6 = z3;
i7 = util.E_NO_NETWORK;
z5 = z6;
if (i7 == i6) {
}
i12++;
str10 = str2;
z7 = z5;
z18 = z2;
j2 = j;
r6 = z7;
z16 = false;
}
}
str6 = "try http proxy=" + is_wap_proxy_retry + " connect to " + url + " host " + a2;
sb = new StringBuilder();
sb.append("");
z2 = is_wap_retry;
} catch (ConnectException unused21) {
j = currentTimeMillis;
z2 = is_wap_retry;
z4 = false;
str9 = str;
} catch (Exception unused22) {
j = currentTimeMillis;
z2 = is_wap_retry;
z3 = false;
str9 = str;
}
try {
sb.append(this.x.f);
util.LOGI(str6, sb.toString());
httpURLConnection = (HttpURLConnection) url.openConnection();
httpURLConnection.setRequestMethod("POST");
if (is_wap_proxy_retry) {
try {
httpURLConnection.setRequestProperty(HttpHeader.REQ.X_ONLINE_HOST, a2);
} catch (ConnectException unused23) {
str9 = str4;
z17 = is_wap_proxy_retry;
z10 = z11;
z4 = z10;
i12++;
str10 = str2;
z18 = z2;
j2 = j;
i11 = util.E_NO_NETWORK;
r6 = z4;
z16 = false;
} catch (Exception unused24) {
str9 = str4;
z17 = is_wap_proxy_retry;
i6 = i4;
i7 = util.E_NO_NETWORK;
z5 = z11;
if (i7 == i6) {
}
i12++;
str10 = str2;
z7 = z5;
z18 = z2;
j2 = j;
r6 = z7;
z16 = false;
}
}
httpURLConnection.setRequestProperty("Content-Type", com.tencent.luggage.wxa.rt.a.f24957a);
httpURLConnection.setRequestProperty("Content-Disposition", "attachment; filename=micromsgresp.dat");
httpURLConnection.setRequestProperty("Content-Length", String.valueOf(c2.length));
httpURLConnection.setConnectTimeout(this.x.l);
httpURLConnection.setReadTimeout(this.x.l);
try {
try {
httpURLConnection.setDoOutput(true);
httpURLConnection.setDoInput(true);
util.LOGI("http request connect ...", "" + this.x.f);
} catch (Exception unused25) {
str9 = str4;
z17 = is_wap_proxy_retry;
z3 = z11;
i6 = i4;
z6 = z3;
i7 = util.E_NO_NETWORK;
z5 = z6;
if (i7 == i6) {
}
i12++;
str10 = str2;
z7 = z5;
z18 = z2;
j2 = j;
r6 = z7;
z16 = false;
}
} catch (ConnectException unused26) {
str9 = str4;
z17 = is_wap_proxy_retry;
z4 = z11;
i12++;
str10 = str2;
z18 = z2;
j2 = j;
i11 = util.E_NO_NETWORK;
r6 = z4;
z16 = false;
}
} catch (ConnectException unused27) {
str9 = str4;
z17 = is_wap_proxy_retry;
z4 = z11;
i12++;
str10 = str2;
z18 = z2;
j2 = j;
i11 = util.E_NO_NETWORK;
r6 = z4;
z16 = false;
} catch (Exception unused28) {
str9 = str4;
z17 = is_wap_proxy_retry;
z3 = z11;
i6 = i4;
z6 = z3;
i7 = util.E_NO_NETWORK;
z5 = z6;
if (i7 == i6) {
}
i12++;
str10 = str2;
z7 = z5;
z18 = z2;
j2 = j;
r6 = z7;
z16 = false;
}
if (j.a(httpURLConnection, this.x.l)) {
util.LOGI("http request write ...", "" + this.x.f);
OutputStream outputStream = httpURLConnection.getOutputStream();
outputStream.write(c2, 0, c2.length);
outputStream.flush();
int responseCode = httpURLConnection.getResponseCode();
try {
util.LOGI("http request response code=" + responseCode, "" + this.x.f);
} catch (Exception unused29) {
i6 = responseCode;
str9 = str4;
z17 = is_wap_proxy_retry;
z6 = z11;
i7 = util.E_NO_NETWORK;
z5 = z6;
i11 = i7 == i6 ? -1000 : i6;
i12++;
str10 = str2;
z7 = z5;
z18 = z2;
j2 = j;
r6 = z7;
z16 = false;
}
if (200 != responseCode) {
i12++;
str9 = str4;
z17 = is_wap_proxy_retry;
str10 = str2;
z18 = z2;
j2 = j;
i11 = -1000;
r6 = z11;
z16 = false;
} else {
inputStream = httpURLConnection.getInputStream();
z17 = is_wap_proxy_retry;
socket = d2;
z = z2;
}
} else {
util.LOGI("http request connect failed", "" + this.x.f);
if (-1026 != i4) {
i4 = -1000;
}
i12++;
str9 = str4;
z17 = is_wap_proxy_retry;
str10 = str2;
i11 = i4;
z7 = z11;
z18 = z2;
j2 = j;
r6 = z7;
z16 = false;
}
} else {
j = currentTimeMillis;
i12 = i5;
str4 = str;
util.LOGI("try bin connect " + i12 + " ...", "" + this.x.f);
if (d2 == null) {
if (this.q == null) {
z = is_wap_retry;
str8 = a(i12, z);
util.LOGI("DNS for " + str8 + " request ...", "" + this.x.f);
try {
this.r = c(z);
this.q = a.a(str8, this.r, this.x.l);
} catch (Exception unused30) {
}
} else {
z = is_wap_retry;
str8 = "";
}
InetSocketAddress inetSocketAddress = this.q;
if (inetSocketAddress == null || inetSocketAddress.getAddress() != null) {
InetSocketAddress inetSocketAddress2 = this.q;
if (inetSocketAddress2 == null || str2.equals(MethodDelegate.getHostAddress(inetSocketAddress2.getAddress()))) {
if (this.q == null) {
util.LOGI("DNS for " + str8 + " request failed", "" + this.x.f);
i11 = -1007;
} else {
util.LOGI("repeated failed bin ip " + str2, "" + this.x.f);
i11 = -1026 != i4 ? -1000 : i4;
}
i12++;
this.q = null;
a((Socket) null);
z18 = z;
str9 = str4;
str10 = str2;
j2 = j;
} else {
str7 = MethodDelegate.getHostAddress(this.q.getAddress());
util.LOGI("DNS for " + str8 + "(" + this.q.toString() + ") request OK", "" + this.x.f);
i13 = 1;
}
} else {
if (this.q.getAddress() == null) {
util.LOGI("_server_ip get address failed", "" + this.x.f);
}
i12++;
this.q = null;
a((Socket) null);
z18 = z;
str9 = str4;
str10 = str2;
j2 = j;
i11 = -1007;
}
r6 = 0;
z16 = false;
i13 = 1;
d2 = null;
} else {
z = is_wap_retry;
str7 = str2;
}
if (d2 == null) {
try {
util.LOGI("tcp connect to " + this.q + " request ...", "" + this.x.f);
socket2 = new Socket();
a(socket2);
socket2.connect(this.q, this.x.l);
socket2.setSoTimeout(this.x.l);
socket2.setReceiveBufferSize(this.s.length);
util.LOGI("tcp connect to " + this.q + " OK", "" + this.x.f);
} catch (ConnectException unused31) {
i12++;
this.q = null;
a((Socket) null);
d2 = null;
z18 = z;
str10 = str7;
i11 = util.E_NO_NETWORK;
z16 = false;
r6 = d2;
str9 = str4;
j2 = j;
} catch (Throwable unused32) {
i11 = -1026 != i4 ? -1000 : i4;
i12++;
this.q = null;
a((Socket) null);
d2 = null;
z18 = z;
str10 = str7;
z16 = false;
r6 = d2;
str9 = str4;
j2 = j;
}
} else {
socket2 = d2;
}
util.LOGI("tcp request write ...", "" + this.x.f);
OutputStream outputStream2 = socket2.getOutputStream();
outputStream2.write(c2, 0, c2.length);
outputStream2.flush();
str2 = str7;
socket = socket2;
inputStream = socket2.getInputStream();
}
util.LOGI("recv data from server ...", "" + this.x.f);
int i15 = 0;
int i16 = 0;
while (i15 < this.f + 1 && (i16 = inputStream.read(this.s, i15, (this.f + 1) - i15)) >= 0) {
i15 += i16;
}
if (i16 < 0) {
i12++;
if (!z) {
socket.close();
this.q = null;
try {
a((Socket) null);
} catch (Throwable unused33) {
}
d2 = null;
z18 = z;
str9 = str4;
str10 = str2;
j2 = j;
i11 = -1000;
r6 = 0;
z16 = false;
}
d2 = socket;
z18 = z;
str9 = str4;
str10 = str2;
j2 = j;
i11 = -1000;
r6 = 0;
z16 = false;
} else {
i3 = b(this.s);
try {
if (i3 > this.f + 1) {
if (i3 < this.s.length) {
int i17 = this.f + 1;
int i18 = i3 - i17;
while (true) {
if (i18 <= 0) {
i10 = -1;
break;
}
i16 = inputStream.read(this.s, i17, i18);
i10 = -1;
if (i16 == -1) {
break;
}
i17 += i16;
i18 -= i16;
}
if (i16 != i10) {
i = i16;
i2 = i13;
break;
}
i12++;
if (!z) {
socket.close();
this.q = null;
a((Socket) null);
d2 = null;
}
d2 = socket;
} else {
i12++;
if (!z) {
socket.close();
this.q = null;
a((Socket) null);
d2 = null;
}
d2 = socket;
}
} else {
i12++;
if (!z) {
socket.close();
this.q = null;
try {
a((Socket) null);
d2 = null;
} catch (Throwable unused34) {
i14 = i3;
}
}
d2 = socket;
}
z18 = z;
i14 = i3;
} catch (Throwable unused35) {
i14 = i3;
i9 = 1;
i12 += i9;
if (!z) {
}
d2 = socket;
z18 = z;
str9 = str4;
str10 = str2;
j2 = j;
i11 = -1000;
r6 = 0;
z16 = false;
}
str9 = str4;
str10 = str2;
j2 = j;
i11 = -1000;
r6 = 0;
z16 = false;
}
i9 = 1;
socket = null;
i12 += i9;
if (!z) {
try {
if (socket.isConnected()) {
socket.close();
}
} catch (Exception unused36) {
}
this.q = null;
a((Socket) null);
d2 = null;
z18 = z;
str9 = str4;
str10 = str2;
j2 = j;
i11 = -1000;
r6 = 0;
z16 = false;
}
d2 = socket;
z18 = z;
str9 = str4;
str10 = str2;
j2 = j;
i11 = -1000;
r6 = 0;
z16 = false;
}
}
public int f() {
return t.b(this.x.h)._last_flowid;
}
public void g() {
this.z = true;
}
}