TIM v2.3.1版本的 MD5 值为:d6957e3ee7ce901ccc491cefdea0da8c
以下内容为反编译后的 MonitorSocketDownload.java 源代码,内容仅作参考
package com.tencent.mobileqq.app.automator.step;
import android.content.SharedPreferences;
import com.tencent.common.app.BaseApplicationImpl;
import com.tencent.mobileqq.app.QQAppInterface;
import com.tencent.mobileqq.app.automator.AsyncStep;
import com.tencent.mobileqq.transfile.HttpNetReq;
import com.tencent.mobileqq.transfile.INetEngine;
import com.tencent.mobileqq.transfile.NetReq;
import com.tencent.mobileqq.transfile.NetResp;
import com.tencent.qphone.base.util.QLog;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import mqq.app.AppRuntime;
public class MonitorSocketDownload extends AsyncStep implements INetEngine.INetEngineListener {
protected static INetEngine.IBreakDownFix f87684a = new pbl();
public static final String f87685c = "MonitorSocketDownload";
private long f18895c;
private final String d = "http://3gimg.qq.com/qq_product_operations/minitext/monitorconfig.txt";
private final String e = "http://3gimg.qq.com/qq_product_operations/minitext/monitorversion.txt";
@Override
public int mo4903a() {
return b();
}
private int b() {
this.f18895c = System.currentTimeMillis();
AppRuntime m1871a = BaseApplicationImpl.a().m1871a();
if (m1871a instanceof QQAppInterface) {
try {
INetEngine netEngine = ((QQAppInterface) m1871a).getNetEngine(0);
HttpNetReq httpNetReq = new HttpNetReq();
httpNetReq.f30937a = this;
httpNetReq.f30916a = "http://3gimg.qq.com/qq_product_operations/minitext/monitorversion.txt";
httpNetReq.f93414c = 0;
httpNetReq.f30945c = BaseApplicationImpl.a().getFilesDir().getAbsolutePath() + "/com.tencent.mobileqq_checkurl";
httpNetReq.m = 0;
httpNetReq.f30936a = f87684a;
netEngine.mo8566a((NetReq) httpNetReq);
if (QLog.isColorLevel()) {
QLog.d(f87685c, 2, "send request to check version and decide whether to download MS config");
}
return 7;
} catch (Exception e) {
QLog.d(f87685c, 1, "" + e);
return 6;
}
}
return 7;
}
private void c() {
AppRuntime m1871a = BaseApplicationImpl.a().m1871a();
if (m1871a instanceof QQAppInterface) {
try {
INetEngine netEngine = ((QQAppInterface) m1871a).getNetEngine(0);
HttpNetReq httpNetReq = new HttpNetReq();
httpNetReq.f30937a = this;
httpNetReq.f30916a = "http://3gimg.qq.com/qq_product_operations/minitext/monitorconfig.txt";
httpNetReq.f93414c = 0;
httpNetReq.f30945c = BaseApplicationImpl.a().getFilesDir().getAbsolutePath() + "/monitor_config.properties";
httpNetReq.m = 0;
httpNetReq.f30936a = f87684a;
netEngine.mo8566a((NetReq) httpNetReq);
if (QLog.isColorLevel()) {
QLog.d(f87685c, 2, "download MS config");
}
} catch (Exception e) {
QLog.d(f87685c, 1, "" + e);
}
}
}
@Override
public void mo8474a(NetResp netResp) {
boolean z = netResp.f30968e == 0;
HttpNetReq httpNetReq = (HttpNetReq) netResp.f30961a;
File file = new File(httpNetReq.f30945c);
if (z) {
if (httpNetReq.f30916a.equals("http://3gimg.qq.com/qq_product_operations/minitext/monitorversion.txt")) {
if (QLog.isColorLevel()) {
QLog.d(f87685c, 2, "file exists " + file.exists());
}
try {
FileInputStream fileInputStream = new FileInputStream(file);
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(fileInputStream));
String readLine = bufferedReader.readLine();
if (readLine != null) {
if (QLog.isColorLevel()) {
QLog.d(f87685c, 2, readLine);
}
int parseInt = Integer.parseInt(readLine.split("\\=")[1]);
SharedPreferences sharedPreferences = BaseApplicationImpl.a().getSharedPreferences("monitor_socket_config", 0);
if (sharedPreferences.getInt("version", -1) == parseInt) {
if (QLog.isColorLevel()) {
QLog.d(f87685c, 2, "config version does not change, no need to download config file, used " + (System.currentTimeMillis() - this.f18895c) + "ms");
}
} else {
c();
sharedPreferences.edit().putInt("version", parseInt);
}
}
bufferedReader.close();
fileInputStream.close();
return;
} catch (Exception e) {
QLog.d(f87685c, 1, "" + e);
return;
}
} else if (httpNetReq.f30916a.equals("http://3gimg.qq.com/qq_product_operations/minitext/monitorconfig.txt") && QLog.isColorLevel()) {
try {
FileInputStream fileInputStream2 = new FileInputStream(file);
BufferedReader bufferedReader2 = new BufferedReader(new InputStreamReader(fileInputStream2));
for (String readLine2 = bufferedReader2.readLine(); readLine2 != null; readLine2 = bufferedReader2.readLine()) {
QLog.d(f87685c, 2, "Banlist: " + readLine2 + ", used " + (System.currentTimeMillis() - this.f18895c) + "ms");
}
bufferedReader2.close();
fileInputStream2.close();
return;
} catch (Exception e2) {
QLog.d(f87685c, 1, "" + e2);
return;
}
} else {
return;
}
}
QLog.d(f87685c, 1, "result: " + netResp.f30968e);
}
@Override
public void a(NetReq netReq, long j, long j2) {
}
}