QQ浏览器 v12.2.3.7053版本的 MD5 值为:8285ab3059e5c8b521a264dfbc5c3685
以下内容为反编译后的 FeedsLogUtils.java 源代码,内容仅作参考
package com.tencent.mtt.miniprogram.util.log;
import android.os.SystemClock;
import com.huawei.hms.framework.common.ContainerUtils;
import com.tencent.common.featuretoggle.FeatureToggle;
import com.tencent.common.http.HttpHeader;
import com.tencent.common.http.MttRequestBase;
import com.tencent.common.http.MttResponse;
import com.tencent.common.http.Requester;
import com.tencent.common.http.RequesterFactory;
import com.tencent.common.threadpool.BrowserExecutorSupplier;
import com.tencent.common.utils.UrlUtils;
import com.tencent.library.BuildConfig;
import com.tencent.luggage.wxa.rt.a;
import com.tencent.mtt.AppInfoHolder;
import com.tencent.mtt.miniprogram.util.WeChatMiniProgramConstant;
import com.tencent.mtt.miniprogram.util.upload.MiniProgramUploadEntity;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Map;
public class FeedsLogUtils {
private static void doUpload(final String str) {
BrowserExecutorSupplier.getInstance().getIoExecutor().execute(new Runnable() {
@Override
public void run() {
BufferedReader bufferedReader;
Requester requester = RequesterFactory.getRequester();
MttRequestBase mttRequestBase = RequesterFactory.getMttRequestBase();
if (FeatureToggle.a(BuildConfig.FEATURE_TOGGLE_FEEDS_UPLOAD_865373545)) {
mttRequestBase.setUrl("https://icreport.html5.qq.com/report");
mttRequestBase.setMethod((byte) 1);
mttRequestBase.setPostData(UrlUtils.encode(str).getBytes());
} else {
mttRequestBase.setUrl(String.format("https://icreport.html5.qq.com/report?%s", str));
mttRequestBase.setMethod((byte) 0);
}
mttRequestBase.setRequestType(MttRequestBase.REQUEST_NORMAL);
mttRequestBase.addHeader("Content-Type", a.f24957a);
mttRequestBase.addHeader("Charset", "UTF-8");
mttRequestBase.addHeader("Referer", "https://quan.qq.com");
mttRequestBase.addHeader(HttpHeader.REQ.QGUID, AppInfoHolder.getAppInfoByID(AppInfoHolder.AppInfoID.APP_INFO_GUID));
mttRequestBase.addHeader(HttpHeader.REQ.QUA, AppInfoHolder.getAppInfoByID(AppInfoHolder.AppInfoID.APP_INFO_QUA));
mttRequestBase.addHeader(HttpHeader.REQ.QUA2, AppInfoHolder.getAppInfoByID(AppInfoHolder.AppInfoID.APP_INFO_QUA2_3));
try {
MttResponse execute = requester.execute(mttRequestBase);
int intValue = execute.getStatusCode().intValue();
StringBuilder sb = new StringBuilder();
bufferedReader = new BufferedReader(new InputStreamReader(execute.getInputStream()));
while (true) {
try {
String readLine = bufferedReader.readLine();
if (readLine == null) {
break;
} else {
sb.append(readLine);
}
} catch (Exception unused) {
requester.close();
if (bufferedReader == null) {
return;
}
bufferedReader.close();
} catch (Throwable th) {
th = th;
requester.close();
if (bufferedReader != null) {
try {
bufferedReader.close();
} catch (IOException unused2) {
}
}
throw th;
}
}
MiniLogUtil.log("doUpload response Code: " + intValue + " result: " + sb.toString());
requester.close();
} catch (Exception unused3) {
bufferedReader = null;
} catch (Throwable th2) {
th = th2;
bufferedReader = null;
}
try {
bufferedReader.close();
} catch (IOException unused4) {
}
}
});
}
private static String uploadClickBaseEventUrl(Object obj, int i) {
if (obj == null) {
return "";
}
Map map = (Map) obj;
if (!WeChatMiniProgramConstant.FEEDS_SOURCE.equals((String) map.get("source"))) {
return "";
}
StringBuilder sb = new StringBuilder();
sb.append("ctridext=");
sb.append((String) map.get("appid"));
String str = (String) map.get("sGrayPlatFormModelId");
sb.append("&sGrayPlatFormModelId=");
sb.append(UrlUtils.encode(str));
sb.append("&extInfo=");
sb.append(UrlUtils.encode(i != 0 ? ((String) map.get("extInfo")) + "&duration=" + i : (String) map.get("extInfo")));
sb.append("&net_type=wifi");
if (!map.keySet().isEmpty()) {
sb.append(ContainerUtils.FIELD_DELIMITER);
for (String str2 : map.keySet()) {
if (!str2.equals("sGrayPlatFormModelId") && !str2.equals("ctridext") && !str2.equals("extInfo")) {
sb.append(str2);
sb.append(ContainerUtils.KEY_VALUE_DELIMITER);
sb.append((String) map.get(str2));
sb.append(ContainerUtils.FIELD_DELIMITER);
}
}
}
return sb.toString();
}
private static String uploadClickBaseTimeEventUrl(Object obj) {
String str;
if (obj == null) {
return "";
}
Map map = (Map) obj;
if (!WeChatMiniProgramConstant.FEEDS_SOURCE.equals((String) map.get("source"))) {
return "";
}
StringBuilder sb = new StringBuilder();
sb.append("platform=android");
sb.append("&time_type=2");
sb.append("&data_type=1");
sb.append("&ctridext=");
sb.append((String) map.get("appid"));
String str2 = (String) map.get("sGrayPlatFormModelId");
sb.append("&sGrayPlatFormModelId=");
sb.append(UrlUtils.encode(str2));
String str3 = (String) map.get("actionType");
if ("1".equals(str3)) {
str = "&busi_type=1";
} else {
if (!"2".equals(str3)) {
if (WeChatMiniProgramConstant.LOG_TYPE_FLOW_VIDEO.equals(str3)) {
str = "&busi_type=19";
}
sb.append("&xcx=1");
sb.append("&extInfo=");
sb.append(UrlUtils.encode((String) map.get("extInfo")));
if (!map.keySet().isEmpty()) {
sb.append(ContainerUtils.FIELD_DELIMITER);
for (String str4 : map.keySet()) {
if (!str4.equals("sGrayPlatFormModelId") && !str4.equals("ctridext") && !str4.equals("extInfo")) {
sb.append(str4);
sb.append(ContainerUtils.KEY_VALUE_DELIMITER);
sb.append((String) map.get(str4));
sb.append(ContainerUtils.FIELD_DELIMITER);
}
}
}
return sb.toString();
}
str = "&busi_type=2";
}
sb.append(str);
sb.append("&xcx=1");
sb.append("&extInfo=");
sb.append(UrlUtils.encode((String) map.get("extInfo")));
if (!map.keySet().isEmpty()) {
}
return sb.toString();
}
public static void uploadClickEvent(Object obj, int i) {
StringBuilder sb = new StringBuilder();
sb.append(uploadClickBaseEventUrl(obj, i));
sb.append("xcx=1");
MiniLogUtil.log("uploadClickEvent upload url: " + sb.toString());
doUpload(sb.toString());
}
public static void uploadClickEvent(Object obj, boolean z) {
if (obj != null && WeChatMiniProgramConstant.FEEDS_SOURCE.equals((String) ((Map) obj).get("source"))) {
MiniLogUtil.log("uploadClickEvent");
uploadClickEvent(obj, 0);
}
}
public static void uploadCloseEvent(MiniProgramUploadEntity miniProgramUploadEntity) {
Object extras = miniProgramUploadEntity.getExtras();
if (extras != null && WeChatMiniProgramConstant.FEEDS_SOURCE.equals((String) ((Map) extras).get("source"))) {
MiniLogUtil.log("uploadCloseEvent");
uploadClickEvent(extras, false);
uploadTimeEvent(miniProgramUploadEntity);
uploadClickEvent(extras, Long.valueOf((SystemClock.elapsedRealtime() - miniProgramUploadEntity.getStartTimeSpan()) / 1000).intValue());
}
}
private static void uploadTimeEvent(MiniProgramUploadEntity miniProgramUploadEntity) {
StringBuilder sb = new StringBuilder();
sb.append(uploadClickBaseTimeEventUrl(miniProgramUploadEntity.getExtras()));
long startTimeSpan = miniProgramUploadEntity.getStartTimeSpan() / 1000;
long currentTimeMillis = System.currentTimeMillis() / 1000;
sb.append("&start_time=");
sb.append(startTimeSpan);
sb.append("&end_time=");
sb.append(currentTimeMillis);
sb.append("&use_time=");
sb.append(currentTimeMillis - startTimeSpan);
MiniLogUtil.log("uploadTimeEvent upload url: " + sb.toString());
doUpload(sb.toString());
}
public static void uploadTimeInterval(MiniProgramUploadEntity miniProgramUploadEntity) {
Object extras = miniProgramUploadEntity.getExtras();
if (extras != null && WeChatMiniProgramConstant.FEEDS_SOURCE.equals((String) ((Map) extras).get("source"))) {
uploadClickEvent(extras, 5);
}
}
}