TIM v2.3.1版本的 MD5 值为:d6957e3ee7ce901ccc491cefdea0da8c

以下内容为反编译后的 MTAReportController.java 源代码,内容仅作参考


package com.tencent.mobileqq.statistics;

import android.content.Context;
import com.tencent.common.app.BaseApplicationImpl;
import com.tencent.mobileqq.app.QQAppInterface;
import com.tencent.mobileqq.msf.core.NetConnInfoCenter;
import com.tencent.mobileqq.msf.sdk.report.IMTAReporter;
import com.tencent.mobileqq.msf.sdk.report.MTAReportManager;
import com.tencent.mobileqq.troop.utils.TroopBarUtils;
import com.tencent.qphone.base.util.QLog;
import com.tencent.stat.StatConfig;
import com.tencent.stat.StatReportStrategy;
import com.tencent.stat.StatServiceImpl;
import com.tencent.stat.StatSpecifyReportedInfo;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.Properties;
import mqq.app.AppRuntime;
public class MTAReportController implements IMTAReporter {
    private static volatile MTAReportController f92850a = null;
    private static final String f29294a = "MTAReportController";
    private Context f29295a;
    private StatSpecifyReportedInfo f29296a = new StatSpecifyReportedInfo();
    private boolean f29297a;
    private volatile String f92851b;

    private MTAReportController(Context context) {
        this.f29295a = context.getApplicationContext();
        this.f29297a = LightDpcConfig.m8098a(this.f29295a, true);
    }

    @Override
    public boolean isMtaSupported() {
        return this.f29297a;
    }

    @Override
    public void initMtaConfig(String str, String str2) {
        this.f29296a.setAppKey(str2);
        this.f29296a.setInstallChannel(str);
        StatConfig.setEnableConcurrentProcess(true);
        StatConfig.setAutoExceptionCaught(false);
        StatServiceImpl.setContext(this.f29295a);
        b(false);
    }

    public void a(String str) {
        this.f92851b = str;
    }

    public static MTAReportController a(Context context) {
        if (f92850a == null) {
            synchronized (MTAReportController.class) {
                if (f92850a == null) {
                    f92850a = new MTAReportController(context);
                }
            }
        }
        return f92850a;
    }

    @Override
    public void reportKVEvent(String str, Properties properties) {
        if (this.f29297a) {
            if (QLog.isColorLevel()) {
                QLog.d(f29294a, 2, "reportKVEvent " + str + " \n\t\t" + properties);
            }
            b(true);
            StatServiceImpl.trackCustomKVEvent(this.f29295a, str, properties, this.f29296a);
        }
    }

    public void a(boolean z) {
        StatConfig.setDebugEnable(z);
    }

    private void b(boolean z) {
        StatConfig.setStatSendStrategy(StatReportStrategy.PERIOD);
        StatConfig.setSendPeriodMinutes(30);
        StatConfig.setEnableSmartReporting(true);
        StatConfig.setStatReportUrl("http://sngmta.qq.com:80/mstat/report/");
        String str = this.f92851b;
        if (str != null) {
            StatConfig.setCustomUserId(this.f29295a, str);
            if (z) {
                this.f92851b = null;
                StatServiceImpl.reportQQ(this.f29295a, str, this.f29296a);
                AppRuntime m1871a = BaseApplicationImpl.a().m1871a();
                ReportController.b(m1871a instanceof QQAppInterface ? (QQAppInterface) m1871a : null, "dc01331", "", "", "0X80075F3", "0X80075F3", 0, 0, new SimpleDateFormat("yyyyMMdd", Locale.US).format(new Date(NetConnInfoCenter.getServerTimeMillis())), "", "", "");
                MTAReportManager.setMTAReporter(f92850a);
            }
        }
        if (QLog.isColorLevel()) {
            QLog.d(f29294a, 2, "calledBeforeStat:" + str + ", " + z);
        }
    }

    @Override
    public void reportTimeKVEvent(String str, Properties properties, int i) {
        if (this.f29297a) {
            if (QLog.isColorLevel()) {
                QLog.d(f29294a, 2, "reportKVEvent " + str + TroopBarUtils.y + i + "\n\t\t" + properties);
            }
            b(true);
            StatServiceImpl.trackCustomKVTimeIntervalEvent(this.f29295a, str, properties, i, this.f29296a);
        }
    }

    @Override
    public void trackBeginPage(String str) {
        if (this.f29297a) {
            if (QLog.isColorLevel()) {
                QLog.d(f29294a, 2, "trackBeginPage " + str);
            }
            b(true);
            StatServiceImpl.trackBeginPage(this.f29295a, str, this.f29296a);
        }
    }

    @Override
    public void trackEndPage(String str) {
        if (this.f29297a) {
            if (QLog.isColorLevel()) {
                QLog.d(f29294a, 2, "trackEndPage " + str);
            }
            b(true);
            StatServiceImpl.trackEndPage(this.f29295a, str, this.f29296a);
        }
    }
}