BTGO游戏盒 v3.4.80版本的 MD5 值为:000032bab1addaabfdc671ee6a7087ab

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


package com.qiyukf.nimlib.session;

import android.os.SystemClock;
import android.util.Pair;
import com.mobile.auth.BuildConfig;
import com.qiyukf.nimlib.net.a.d.a;
import com.qiyukf.nimlib.sdk.msg.constant.SessionTypeEnum;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public final class h {

    private static final ArrayList<Pair<c, Long>> f15960a = new ArrayList<>(8);

    private static final Object f15961b = new Object();

    private static ScheduledExecutorService f15962c = null;

    public static void a() {
        if (com.qiyukf.nimlib.c.v() && f15962c == null) {
            com.qiyukf.nimlib.j.b.b.a.c("MessageReporter", "start msg report timer");
            ScheduledExecutorService newScheduledThreadPool = Executors.newScheduledThreadPool(1);
            f15962c = newScheduledThreadPool;
            newScheduledThreadPool.scheduleWithFixedDelay(new Runnable() {
                @Override
                public final void run() {
                    h.d();
                }
            }, 0L, 10000L, TimeUnit.MILLISECONDS);
        }
    }

    public static void b() {
        ScheduledExecutorService scheduledExecutorService = f15962c;
        if (scheduledExecutorService == null) {
            return;
        }
        scheduledExecutorService.shutdown();
        f15962c = null;
    }

    private static void c() {
        String str;
        ArrayList<Pair<c, Long>> arrayList = f15960a;
        if (com.qiyukf.nimlib.q.d.a((Collection) arrayList)) {
            return;
        }
        long b10 = com.qiyukf.nimlib.q.t.b();
        if (b10 <= 0) {
            com.qiyukf.nimlib.q.t.c();
            return;
        }
        JSONArray jSONArray = new JSONArray();
        Iterator<Pair<c, Long>> it = arrayList.iterator();
        while (it.hasNext()) {
            Pair<c, Long> next = it.next();
            c cVar = (c) next.first;
            long longValue = ((Long) next.second).longValue() + b10;
            if (cVar != null && longValue > 0) {
                JSONObject jSONObject = new JSONObject();
                try {
                    jSONObject.putOpt("accid", com.qiyukf.nimlib.c.k());
                    jSONObject.putOpt("fromAccid", cVar.getFromAccount());
                    jSONObject.putOpt("msgId", Long.valueOf(cVar.getServerId()));
                    jSONObject.putOpt("serverTime", Long.valueOf(cVar.getTime()));
                    jSONObject.putOpt("receiveTime", Long.valueOf(longValue));
                    jSONObject.putOpt("sessionId", cVar.getSessionId());
                } catch (JSONException e10) {
                    e10.printStackTrace();
                }
                if (!com.qiyukf.nimlib.e.e.a() && !com.qiyukf.nimlib.e.e.b()) {
                    str = BuildConfig.FLAVOR_env;
                    jSONObject.putOpt("env", str);
                    jSONArray.put(jSONObject);
                }
                str = "test";
                jSONObject.putOpt("env", str);
                jSONArray.put(jSONObject);
            }
        }
        com.qiyukf.nimlib.j.b.b.a.c("MessageReporter", "report msg, len=" + jSONArray.length());
        a.C0157a<String> a10 = com.qiyukf.nimlib.net.a.d.a.a("https://statistic.live.126.net/statics/report/im/sdk/msgreceived", null, jSONArray);
        if (a10.f15125a == 200) {
            f15960a.clear();
        }
        com.qiyukf.nimlib.j.b.b.a.c("MessageReporter", "report msg result, code=" + a10.f15125a);
    }

    public static void d() {
        synchronized (f15961b) {
            if (!com.qiyukf.nimlib.q.d.a((Collection) f15960a)) {
                c();
            }
        }
    }

    public static void a(c cVar) {
        if (com.qiyukf.nimlib.c.v() && cVar.getSessionType() == SessionTypeEnum.P2P) {
            long elapsedRealtime = SystemClock.elapsedRealtime();
            synchronized (f15961b) {
                ArrayList<Pair<c, Long>> arrayList = f15960a;
                arrayList.add(new Pair<>(cVar, Long.valueOf(elapsedRealtime)));
                if (arrayList.size() >= 5) {
                    c();
                }
            }
        }
    }
}