Kate Mobile v109.1版本的 MD5 值为:fcd76ded5f363ecbfac46035a4ed2a23

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


package com.my.target;

import android.content.Context;
import android.util.Base64;
import com.my.target.b1;
import java.nio.charset.Charset;
import java.util.HashMap;
import java.util.Map;
import org.json.JSONArray;
import org.json.JSONObject;
public final class w4 {
    public final Map a;
    public final Map b;
    public final long c;
    public final int d;
    public boolean e;

    public static final class a {
        public final int a;
        public boolean b = false;

        public a(int i) {
            this.a = i;
        }

        public w4 a() {
            w4 w4Var = new w4(this.a, "myTarget", 0);
            w4Var.a(this.b);
            return w4Var;
        }

        public void a(boolean z) {
            this.b = z;
        }
    }

    public w4(int i, String str, int i2) {
        HashMap hashMap = new HashMap();
        this.a = hashMap;
        this.b = new HashMap();
        this.d = i2;
        this.c = System.currentTimeMillis();
        hashMap.put("slot", Integer.valueOf(i));
        hashMap.put("network", str);
    }

    public static a a(int i) {
        return new a(i);
    }

    public void a(Context context) {
        String a2 = a();
        x8.a("MetricMessage: Send metrics message - \n " + a2);
        q1.d().a("https://ad.mail.ru/sdk/ms/", Base64.encodeToString(a2.getBytes(Charset.forName("UTF-8")), 0), context);
    }

    public String a() {
        JSONObject jSONObject = new JSONObject();
        try {
            for (Map.Entry entry : this.a.entrySet()) {
                jSONObject.put((String) entry.getKey(), entry.getValue());
            }
            JSONArray jSONArray = new JSONArray();
            jSONObject.put("events", jSONArray);
            for (Map.Entry entry2 : this.b.entrySet()) {
                JSONObject jSONObject2 = new JSONObject();
                jSONObject2.put("type", entry2.getKey());
                jSONObject2.put("value", entry2.getValue());
                jSONArray.put(jSONObject2);
            }
        } catch (Throwable unused) {
        }
        return jSONObject.toString();
    }

    public void a(int i, long j) {
        Long l = (Long) this.b.get(Integer.valueOf(i));
        if (l != null) {
            j += l.longValue();
        }
        b(i, j);
    }

    public void a(boolean z) {
        this.e = z;
    }

    public void b() {
        b(this.d, System.currentTimeMillis() - this.c);
    }

    public void b(int i, long j) {
        this.b.put(Integer.valueOf(i), Long.valueOf(j));
    }

    public void b(final Context context) {
        if (!this.e) {
            x8.a("MetricMessage: Metrics sending disabled");
        } else if (this.b.isEmpty()) {
            x8.a("MetricMessage: Metrics not send: empty");
        } else {
            b1.a a2 = h1.c().a();
            if (a2 == null) {
                x8.a("MetricMessage: Metrics not send: basic info not collected");
                return;
            }
            this.a.put("instanceId", a2.a);
            this.a.put("os", a2.b);
            this.a.put("osver", a2.c);
            this.a.put("app", a2.d);
            this.a.put("appver", a2.e);
            this.a.put("sdkver", a2.f);
            y.b(new Runnable() {
                @Override
                public final void run() {
                    w4.this.a(context);
                }
            });
        }
    }
}