QQ浏览器 v12.2.3.7053版本的 MD5 值为:8285ab3059e5c8b521a264dfbc5c3685
以下内容为反编译后的 TVideoStatController.java 源代码,内容仅作参考
package com.tencent.mtt.tvpage;
import android.os.Bundle;
import android.text.TextUtils;
import com.dike.lib.apkmarker.Apk;
import com.eclipsesource.mmv8.Platform;
import com.huawei.hms.framework.common.ContainerUtils;
import com.tencent.ad.tangram.analysis.sqlite.a;
import com.tencent.common.featuretoggle.FeatureToggle;
import com.tencent.common.http.Apn;
import com.tencent.common.utils.UrlUtils;
import com.tencent.matrix.trace.config.SharePluginInfo;
import com.tencent.mtt.account.base.IAccount;
import com.tencent.mtt.base.account.AccountInfo;
import com.tencent.mtt.base.stat.StatManager;
import com.tencent.mtt.base.stat.interfaces.IUnitTimeHelper;
import com.tencent.mtt.base.stat.utils.PlatformStatUtils;
import com.tencent.mtt.base.wup.GUIDManager;
import com.tencent.mtt.browser.video.adreward.RewardPointUtil;
import com.tencent.mtt.browser.video.adreward.bean.PointItem;
import com.tencent.mtt.browser.video.adreward.bean.RewardPointData;
import com.tencent.mtt.browser.video.engine.H5VideoPlayerManager;
import com.tencent.mtt.hippy.qb.update.HippyFileUtils;
import com.tencent.mtt.miniprogram.util.WeChatMiniProgramConstant;
import com.tencent.mtt.qbcontext.core.QBContext;
import com.tencent.mtt.qbinfo.QBInfoUtils;
import com.tencent.mtt.qbinfo.QUAUtils;
import com.tencent.mtt.video.base.QBVideoView;
import com.tencent.mtt.video.browser.export.wc.m3u8.M3U8Constants;
import com.tencent.mtt.video.internal.player.ui.tencentvideo.episode.bean.TVBaseInfo;
import com.tencent.mtt.video.internal.utils.VideoLogHelper;
import java.io.Serializable;
import java.net.URLDecoder;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.concurrent.atomic.AtomicBoolean;
import qb.video.BuildConfig;
import tmsdk.common.gourd.vine.IActionReportService;
public class TVideoStatController {
private Map<String, String> G;
private RewardPointData H;
private String I;
private boolean J;
private String L;
TVPageView f71927a;
String f71928b;
String f71929c;
String f71930d;
String e;
String f;
String h;
int i;
String j;
String k;
String l;
String m;
String n;
String o;
String p;
int q;
String t;
IUnitTimeHelper x;
String g = "1";
String r = "0";
String s = "-1";
boolean u = true;
long v = 0;
String w = "";
String y = "";
String z = "";
public final String A = String.valueOf(System.currentTimeMillis());
private final AtomicBoolean C = new AtomicBoolean(false);
private boolean D = false;
private long E = 0;
private boolean F = false;
boolean B = false;
private int[] K = {1, 1};
private String M = "";
public TVideoStatController(TVPageView tVPageView, String str) {
this.L = "1";
this.L = str;
this.f71927a = tVPageView;
Map<String, String> map = tVPageView.f;
this.f71928b = map.get("source");
this.f71929c = map.get("sceneid");
this.f71930d = map.get("c_sceneid");
this.e = map.get("data_src");
this.f = map.get(a.COLUMN_NAME_STRATEGY);
this.l = GUIDManager.a().f();
this.m = QBInfoUtils.i();
this.o = QBInfoUtils.b();
this.p = QUAUtils.a();
this.q = g();
HippyFileUtils.ModuleVersionInfo configModuleVersionInfo = HippyFileUtils.getConfigModuleVersionInfo("2".equals(this.L) ? "slideVideo" : "longVideo", true);
if (configModuleVersionInfo != null) {
this.n = String.valueOf(configModuleVersionInfo.getVersionCode());
}
b();
}
private void a(Bundle bundle, long j) {
RewardPointData rewardPointData = this.H;
if (rewardPointData == null || rewardPointData.getPointList() == null || this.H.getPointList().size() == 0) {
bundle.putString("s_play_ad_type", "0");
return;
}
bundle.putString("s_play_ad_type", "1");
PointItem a2 = RewardPointUtil.a(this.H.getPointList(), j);
if (a2 != null) {
bundle.putString("s_unlock_place", a2.b().getPointId());
bundle.putString("s_unlock_duration", String.valueOf(a2.b().getRangeEnd() - a2.b().getRangeBegin()));
}
}
private void a(TVBaseInfo tVBaseInfo) {
if (tVBaseInfo.f73591a == null || this.w.contains(tVBaseInfo.f73591a)) {
return;
}
this.w = "vd_" + tVBaseInfo.f73591a + M3U8Constants.COMMENT_PREFIX + System.currentTimeMillis();
}
private void b(Map<String, String> map) {
if (map == null) {
return;
}
StatManager.b().b(map.get("p_event_code"), map);
}
private void b(boolean z) {
Map<String, String> map = this.G;
this.G = null;
if (map != null) {
if (z) {
map.put("s_type", "0");
}
b(map);
}
}
private void c(boolean z) {
IUnitTimeHelper iUnitTimeHelper = this.x;
if (iUnitTimeHelper != null) {
Map<String, String> i = iUnitTimeHelper.i();
if (i != null) {
i.put("scene", z ? "v1p" : "v1");
i.put("kv", a(z ? "1" : "2", this.f71927a.k.f73594d != null ? this.f71927a.k.f73594d : ""));
}
StatManager.b().b(this.x, 1);
}
}
private Map<String, String> e(Bundle bundle) {
HashMap hashMap = new HashMap();
if (FeatureToggle.a(BuildConfig.BUG_TOGGLE_94672433)) {
hashMap.put("p_sdk_version", this.L);
hashMap.put("p_md5", this.M);
}
hashMap.put("p_qbid", this.h);
hashMap.put("p_uid_type", String.valueOf(this.i));
hashMap.put("p_vip", this.r);
hashMap.put("p_vuid", this.s);
hashMap.put("p_wx_openid", this.j);
hashMap.put("p_qq_openid", this.k);
hashMap.put("p_guid", this.l);
hashMap.put("p_qimei36", this.m);
hashMap.put("p_platform", Platform.ANDROID);
hashMap.put("p_network_type", String.valueOf(this.q));
hashMap.put("p_hippy_version", this.n);
hashMap.put("p_lcid", this.o);
hashMap.put("p_qua", this.p);
hashMap.put("p_pg_id", this.g);
hashMap.put("p_source", this.f71928b);
hashMap.put("p_sceneid", this.f71929c);
hashMap.put("p_c_sceneid", this.f71930d);
TVBaseInfo tVBaseInfo = this.f71927a.k;
hashMap.put("p_tx_cid", tVBaseInfo.f73592b);
hashMap.put("p_tx_vid", tVBaseInfo.f73591a);
hashMap.put("p_qb_cid", tVBaseInfo.f73594d);
hashMap.put("p_rowkey", tVBaseInfo.p);
hashMap.put("p_content_type", tVBaseInfo.e);
hashMap.put("p_video_type", String.valueOf(tVBaseInfo.o));
hashMap.put("p_sessionid", this.A);
a(hashMap);
for (String str : bundle.keySet()) {
hashMap.put(str, String.valueOf(bundle.get(str)));
}
hashMap.put("p_event_time", h());
hashMap.put("p_ad_profileId", TextUtils.isEmpty(this.t) ? "" : this.t);
return hashMap;
}
private int g() {
Apn.ApnInfo apnInfo = Apn.getApnInfo();
if (apnInfo == null) {
return 6;
}
if (apnInfo.isWifiNetwork()) {
return 2;
}
if (!apnInfo.isMobileNetwork()) {
return 6;
}
int mobileNetworkType = apnInfo.getMobileNetworkType();
if (mobileNetworkType == 1) {
return 3;
}
if (mobileNetworkType == 2) {
return 4;
}
return mobileNetworkType == 3 ? 5 : 6;
}
private String h() {
return new SimpleDateFormat("yyyy-M-d+HH:mm:ss", Locale.US).format(new Date());
}
private void i() {
char c2;
if (TextUtils.isEmpty(this.f71928b)) {
return;
}
String str = this.f71928b;
int hashCode = str.hashCode();
char c3 = 0;
if (hashCode != 1448635041) {
if (hashCode == 1448635047 && str.equals("100008")) {
c2 = 0;
}
c2 = 65535;
} else {
if (str.equals(WeChatMiniProgramConstant.FEEDS_SOURCE)) {
c2 = 1;
}
c2 = 65535;
}
if (c2 != 0) {
if (c2 == 1 && !TextUtils.isEmpty(this.f71929c)) {
String str2 = this.f71929c;
switch (str2.hashCode()) {
case -1718727384:
if (str2.equals("ddc_minivideo")) {
c3 = 4;
break;
}
c3 = 65535;
break;
case -1683816647:
if (str2.equals("ddc_feeds")) {
c3 = 2;
break;
}
c3 = 65535;
break;
case -1668922081:
if (str2.equals("ddc_video")) {
c3 = 3;
break;
}
c3 = 65535;
break;
case -330993810:
if (str2.equals("ddc_test")) {
c3 = 6;
break;
}
c3 = 65535;
break;
case -316181994:
if (str2.equals("ddc_videotab")) {
c3 = 5;
break;
}
c3 = 65535;
break;
case 49:
break;
case 48908:
if (str2.equals("194")) {
c3 = 1;
break;
}
c3 = 65535;
break;
default:
c3 = 65535;
break;
}
switch (c3) {
case 0:
this.y = "1";
this.z = "1";
return;
case 1:
break;
case 2:
this.y = "1";
this.z = "ddc_feeds";
return;
case 3:
this.y = "11";
this.z = "ddc_video";
return;
case 4:
this.y = "43";
this.z = "ddc_minivideo";
return;
case 5:
this.y = "3";
this.z = "ddc_videotab";
return;
case 6:
this.y = "158";
this.z = "ddc_test";
return;
default:
return;
}
} else {
return;
}
}
this.y = "149";
this.z = "194";
}
public String a(String str, String str2) {
StringBuilder sb = new StringBuilder();
sb.append("product_id=");
String str3 = this.y;
if (str3 == null) {
str3 = "";
}
sb.append(str3);
sb.append(IActionReportService.COMMON_SEPARATOR);
sb.append("sence_id=");
String str4 = this.z;
if (str4 == null) {
str4 = "";
}
sb.append(str4);
sb.append(IActionReportService.COMMON_SEPARATOR);
sb.append("time_type=");
sb.append(str);
sb.append(IActionReportService.COMMON_SEPARATOR);
sb.append("grayid=");
sb.append(IActionReportService.COMMON_SEPARATOR);
sb.append("data_type=");
sb.append(TextUtils.isEmpty(this.e) ? "1" : this.e);
sb.append(IActionReportService.COMMON_SEPARATOR);
sb.append("busi_type=3");
sb.append(IActionReportService.COMMON_SEPARATOR);
sb.append("cid=");
sb.append(str2);
sb.append(IActionReportService.COMMON_SEPARATOR);
sb.append("strategy=");
String str5 = this.f;
if (str5 == null) {
str5 = "";
}
sb.append(str5);
sb.append(IActionReportService.COMMON_SEPARATOR);
sb.append("theme=");
sb.append(IActionReportService.COMMON_SEPARATOR);
sb.append("data_id=");
sb.append(IActionReportService.COMMON_SEPARATOR);
sb.append("media_id=");
sb.append(IActionReportService.COMMON_SEPARATOR);
sb.append("f28=");
sb.append(IActionReportService.COMMON_SEPARATOR);
sb.append("pos=");
sb.append(IActionReportService.COMMON_SEPARATOR);
sb.append("xcx=0");
sb.append(IActionReportService.COMMON_SEPARATOR);
sb.append("ext=");
String str6 = this.f71929c;
if (str6 == null) {
str6 = "";
}
sb.append(str6);
sb.append(IActionReportService.COMMON_SEPARATOR);
sb.append("url_type=");
sb.append(IActionReportService.COMMON_SEPARATOR);
a(sb, TextUtils.isEmpty(this.f71927a.k.u) ? this.f71927a.f.get("extInfo") : this.f71927a.k.u);
sb.append("topnews=");
return sb.toString();
}
public void a() {
b(true);
StringBuilder sb = new StringBuilder();
sb.append("TV_PAGE_DESTROY_WITH_HIPPY_");
sb.append(this.f71927a.t ? "1" : "0");
PlatformStatUtils.a(sb.toString());
}
public void a(int i) {
Bundle bundle = new Bundle();
bundle.putString("s_play_result", String.valueOf(i));
bundle.putString("p_event_code", "txkd_video_error");
a(bundle);
}
public void a(int i, int i2, QBVideoView qBVideoView) {
a(i, i2, true, qBVideoView);
}
public void a(int i, int i2, boolean z, QBVideoView qBVideoView) {
long j;
if (this.v > 0) {
j = System.currentTimeMillis() - this.v;
this.v = 0L;
} else {
j = 0;
}
Bundle bundle = new Bundle();
bundle.putString("p_event_code", "txkd_video_vdend");
bundle.putString("p_area", H5VideoPlayerManager.getInstance().i() ? "hscr_play" : "vsce_play");
bundle.putString("s_play_sessionid", this.w);
bundle.putString("s_timelong", String.valueOf(j));
bundle.putString("s_end_reason", String.valueOf(i2));
bundle.putString("s_duration", String.valueOf(i));
bundle.putString("s_first_play", this.u ? "1" : "0");
bundle.putString("data_type", this.e);
bundle.putString("strategy_id", this.f);
bundle.putString("p_sdk_version", this.L);
bundle.putString("p_md5", this.M);
bundle.putString("s_play_type", this.u ? "1" : "2");
bundle.putString("s_data_type", this.e);
bundle.putString("s_strategy_id", this.f);
bundle.putString("ad_show", String.valueOf(this.B ? 1 : 0));
bundle.putString("siteid", "" + this.I);
bundle.putString("end_time", qBVideoView.getCurrenPosition() + "");
bundle.putString("collect_state", this.J ? "1" : "0");
if (TextUtils.equals("2", this.L)) {
bundle.putString("s_play_type", String.valueOf(this.K[1]));
}
a(bundle, qBVideoView.getCurrenPosition());
this.H = null;
a(bundle);
if (z) {
this.u = false;
}
c(false);
int[] iArr = this.K;
if (iArr[0] == 2) {
iArr[1] = 2;
}
}
public void a(int i, long j, long j2) {
if (this.C.compareAndSet(false, true)) {
Bundle bundle = new Bundle();
bundle.putString("p_event_code", "txkd_videro_native_loaded");
bundle.putString("p_area", H5VideoPlayerManager.getInstance().i() ? "hscr_play" : "vsce_play");
bundle.putString("s_timelong", i == 0 ? String.valueOf(j2 - j) : String.valueOf(i));
bundle.putString("state", i == 0 ? "0" : "1");
a(bundle);
}
}
public void a(long j, long j2) {
if (j2 >= j) {
HashMap hashMap = new HashMap();
hashMap.put(SharePluginInfo.ISSUE_COST, String.valueOf(j2 - j));
StatManager.b().b("tv_page_cost_event", hashMap);
}
}
public void a(long j, String str) {
this.s = String.valueOf(j);
this.r = str;
}
public void a(Bundle bundle) {
b(e(bundle));
}
public void a(Bundle bundle, TVBaseInfo tVBaseInfo) {
a(tVBaseInfo);
bundle.putString("p_event_code", "txkd_video_ask_result");
bundle.putString("p_area", H5VideoPlayerManager.getInstance().i() ? "hscr_play" : "vsce_play");
bundle.putString("s_play_sessionid", this.w);
bundle.putString("s_first_play", this.u ? "1" : "0");
bundle.putString("s_data_type", this.e);
bundle.putString("s_strategy_id", this.f);
bundle.putString("p_sdk_version", this.L);
bundle.putString("p_md5", this.M);
b(e(bundle));
}
public void a(IUnitTimeHelper iUnitTimeHelper) {
this.x = iUnitTimeHelper;
i();
if (iUnitTimeHelper != null) {
iUnitTimeHelper.a("videosdk");
Map<String, String> i = iUnitTimeHelper.i();
if (i != null) {
i.put("scene", "v1");
String str = this.f71928b;
if (str == null) {
str = "";
}
i.put(Apk.IEditor.KEY_CHANNEL, str);
i.put("kv", a("2", this.f71927a.k.f73594d != null ? this.f71927a.k.f73594d : ""));
}
}
}
public void a(TVBaseInfo tVBaseInfo, int i, QBVideoView qBVideoView) {
this.v = System.currentTimeMillis();
a(tVBaseInfo);
this.F = false;
this.D = false;
e();
boolean z = this.D;
this.D = true;
Bundle bundle = new Bundle();
bundle.putString("p_event_code", "txkd_video_vdstart");
bundle.putString("p_area", H5VideoPlayerManager.getInstance().i() ? "hscr_play" : "vsce_play");
bundle.putString("s_play_sessionid", this.w);
bundle.putString("s_duration", String.valueOf(i));
bundle.putString("s_first_play", this.u ? "1" : "0");
bundle.putString("data_type", this.e);
bundle.putString("strategy_id", this.f);
bundle.putString("s_play_type", z ? "2" : "1");
String str = this.L;
bundle.putString("p_sdk_version", str);
bundle.putString("p_md5", this.M);
if (TextUtils.equals("2", str)) {
bundle.putString("s_play_type", String.valueOf(this.K[0]));
}
bundle.putString("siteid", "" + this.I);
bundle.putString("start_time", qBVideoView.getCurrenPosition() + "");
bundle.putString("inspire_ad", String.valueOf(this.B ? 1 : 0));
bundle.putString("collect_state", this.J ? "1" : "0");
bundle.putString("s_data_type", this.e);
bundle.putString("s_strategy_id", this.f);
a(bundle, qBVideoView.getCurrenPosition());
a(bundle);
c(true);
this.K[0] = 2;
}
public void a(String str) {
Bundle bundle = new Bundle();
bundle.putString("p_event_code", str);
bundle.putString("p_area", "vsce_play");
bundle.putString("s_eid", "control_center");
bundle.putString("place", "0");
bundle.putString("p_sdk_version", this.L);
bundle.putString("p_md5", this.M);
a(bundle);
}
public void a(String str, boolean z) {
this.I = String.valueOf(Integer.parseInt(str) + 1);
this.J = z;
}
public void a(StringBuilder sb, String str) {
if (TextUtils.isEmpty(str)) {
return;
}
try {
HashMap<String, String> urlParam = UrlUtils.getUrlParam("https://www.qq.com?" + URLDecoder.decode(str, "UTF-8"));
if (urlParam != null) {
for (String str2 : urlParam.keySet()) {
String str3 = urlParam.get(str2) == null ? "" : urlParam.get(str2);
sb.append(str2);
sb.append(ContainerUtils.KEY_VALUE_DELIMITER);
sb.append(str3);
sb.append(IActionReportService.COMMON_SEPARATOR);
}
}
} catch (Exception unused) {
}
}
public void a(Map<String, String> map) {
String str = this.f71927a.k.u;
if (TextUtils.isEmpty(str)) {
str = UrlUtils.getUrlParamValue(this.f71927a.f71904d, "extInfo");
}
map.put("p_extInfo", str);
}
public void a(boolean z) {
if (this.F) {
this.F = false;
long j = 0;
if (this.E > 0) {
j = System.currentTimeMillis() - this.E;
this.E = System.currentTimeMillis();
}
Bundle bundle = new Bundle();
bundle.putString("p_event_code", "txkd_video_vdstop");
bundle.putString("s_timelong", String.valueOf(j));
bundle.putString("s_type", z ? "1" : "0");
bundle.putString("s_play_sessionid", this.w);
bundle.putString("p_sdk_version", this.L);
bundle.putString("p_md5", this.M);
b(false);
if (z) {
this.G = e(bundle);
} else {
a(bundle);
}
}
}
public void a(boolean z, int i, boolean z2, String str) {
Bundle bundle = new Bundle();
bundle.putString("showed_video", z ? "1" : "0");
bundle.putString("player_state", String.valueOf(i));
bundle.putString("permission_timeout", z2 ? "1" : "0");
bundle.putString("place", str);
HashMap hashMap = new HashMap();
for (String str2 : bundle.keySet()) {
hashMap.put(str2, bundle.getString(str2));
}
StatManager.b().b("tvideo_gap_analyze", hashMap);
bundle.putString("p_event_code", "txkd_page_destroy");
a(bundle);
}
public void a(boolean z, long j) {
Bundle bundle = new Bundle();
bundle.putString("p_event_code", "txkd_video_pgout");
bundle.putString("p_area", "vsce_play");
bundle.putString("s_timelong", String.valueOf(j));
bundle.putString("type", z ? "1" : "0");
bundle.putString("p_sdk_version", this.L);
bundle.putString("p_md5", this.M);
a(bundle);
}
public void b() {
AccountInfo currentUserInfo = ((IAccount) QBContext.getInstance().getService(IAccount.class)).getCurrentUserInfo();
this.j = "-1";
this.k = "-1";
if (currentUserInfo != null) {
this.h = currentUserInfo.qbId;
if (currentUserInfo.isQQAccount() || currentUserInfo.isConnectAccount()) {
this.i = 1;
this.k = currentUserInfo.getQQorWxId();
return;
} else if (currentUserInfo.isWXAccount()) {
this.i = 0;
this.j = currentUserInfo.getQQorWxId();
return;
} else if (currentUserInfo.isPhoneAccount()) {
this.i = 3;
return;
}
}
this.h = "-1";
this.i = 2;
}
public void b(Bundle bundle) {
Map<String, String> e = e(bundle);
e.put("s_play_sessionid", this.w);
b(e);
}
public void b(String str) {
this.t = str;
}
public void c() {
Bundle bundle = new Bundle();
bundle.putString("p_event_code", "txkd_video_pgin");
bundle.putString("p_area", "vsce_play");
bundle.putString("p_sdk_version", this.L);
bundle.putString("p_md5", this.M);
a(bundle);
}
public void c(Bundle bundle) {
Serializable serializable = bundle.getSerializable("rewardPoint");
this.H = serializable instanceof RewardPointData ? (RewardPointData) serializable : null;
}
public void c(String str) {
this.M = str;
}
public void d() {
this.K = new int[]{1, 1};
VideoLogHelper.c("TVideoStatController", "resetFirstPlayFlag" + this.K.toString());
}
public void d(Bundle bundle) {
this.B = false;
if (bundle != null) {
this.B = bundle.getBoolean("showedAd");
}
}
public void e() {
if (this.F) {
return;
}
this.F = true;
this.E = System.currentTimeMillis();
}
public IUnitTimeHelper f() {
return this.x;
}
public void onExternalSendEvent(String str, String str2, Bundle bundle, boolean z) {
Bundle bundle2 = new Bundle();
bundle2.putAll(bundle);
bundle2.putString("p_event_code", str);
bundle2.putString("p_area", str2);
if (z && !TextUtils.isEmpty(this.w)) {
bundle2.putString("s_play_sessionid", this.w);
}
a(bundle2);
}
}