imToken v2.9.3版本的 MD5 值为:42af1a08a3f01f69d2f3782d81007b3c

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


package com.pingplusplus.android;

import android.content.Context;
import android.os.Build;
import com.brentvatne.react.ReactVideoView;
import io.sentry.protocol.App;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import kotlin.Metadata;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import org.json.JSONException;
import org.json.JSONObject;

@Metadata(bv = {1, 0, 3}, d1 = {"\u0000Z\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\u0005\n\u0002\u0010!\n\u0002\b\u0005\n\u0002\u0010%\n\u0002\u0010\b\n\u0002\b\b\n\u0002\u0010\t\n\u0002\b\u0014\n\u0002\u0010 \n\u0002\b\u001c\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010$\n\u0002\b\u0004\u0018\u0000 [2\u00020\u0001:\u0002[\\B\r\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004J\u000e\u0010M\u001a\u00020N2\u0006\u0010O\u001a\u00020PJ\u0010\u0010Q\u001a\u00020N2\u0006\u0010R\u001a\u00020\u0006H\u0002J\u0010\u0010S\u001a\u00020N2\u0006\u0010T\u001a\u00020\u0006H\u0002J\u0006\u0010U\u001a\u00020NJ\b\u0010V\u001a\u00020NH\u0002J\u000e\u0010?\u001a\u00020N2\u0006\u0010<\u001a\u00020WJ\u0018\u0010X\u001a\u0012\u0012\u0006\u0012\u0004\u0018\u00010\u0006\u0012\u0006\u0012\u0004\u0018\u00010\u00010YH\u0002J\u0006\u0010Z\u001a\u00020\u0006R\u001a\u0010\u0005\u001a\u00020\u0006X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0007\u0010\b\"\u0004\b\t\u0010\nR \u0010\u000b\u001a\b\u0012\u0004\u0012\u00020\u00060\fX\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\r\u0010\u000e\"\u0004\b\u000f\u0010\u0010R(\u0010\u0011\u001a\u0010\u0012\u0004\u0012\u00020\u0006\u0012\u0006\u0012\u0004\u0018\u00010\u00130\u0012X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0014\u0010\u0015\"\u0004\b\u0016\u0010\u0017R\u001a\u0010\u0018\u001a\u00020\u0006X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0019\u0010\b\"\u0004\b\u001a\u0010\nR\u001a\u0010\u001b\u001a\u00020\u001cX\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u001d\u0010\u001e\"\u0004\b\u001f\u0010 R&\u0010!\u001a\u000e\u0012\u0004\u0012\u00020\u0006\u0012\u0004\u0012\u00020\u00060\u0012X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\"\u0010\u0015\"\u0004\b#\u0010\u0017R\u001c\u0010$\u001a\u0004\u0018\u00010\u0006X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b%\u0010\b\"\u0004\b&\u0010\nR\u001c\u0010'\u001a\u0004\u0018\u00010\u0006X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b(\u0010\b\"\u0004\b)\u0010\nR\u001c\u0010*\u001a\u0004\u0018\u00010\u0006X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b+\u0010\b\"\u0004\b,\u0010\nR\u001c\u0010-\u001a\u0004\u0018\u00010\u0006X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b.\u0010\b\"\u0004\b/\u0010\nR\"\u00100\u001a\n\u0012\u0004\u0012\u00020\u0001\u0018\u000101X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b2\u0010\u000e\"\u0004\b3\u0010\u0010R\u001e\u00104\u001a\u0004\u0018\u00010\u001cX\u0086\u000e¢\u0006\u0010\n\u0002\u00109\u001a\u0004\b5\u00106\"\u0004\b7\u00108R\u0016\u0010:\u001a\u0004\u0018\u00010\u00068BX\u0082\u0004¢\u0006\u0006\u001a\u0004\b;\u0010\bR\u001e\u0010<\u001a\u0004\u0018\u00010\u0013X\u0086\u000e¢\u0006\u0010\n\u0002\u0010A\u001a\u0004\b=\u0010>\"\u0004\b?\u0010@R\u001a\u0010B\u001a\u00020\u0006X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\bC\u0010\b\"\u0004\bD\u0010\nR\u0014\u0010E\u001a\u00020\u00068BX\u0082\u0004¢\u0006\u0006\u001a\u0004\bF\u0010\bR\u001a\u0010G\u001a\u00020\u0006X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\bH\u0010\b\"\u0004\bI\u0010\nR\u001a\u0010J\u001a\u00020\u0006X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\bK\u0010\b\"\u0004\bL\u0010\n¨\u0006]"}, d2 = {"Lcom/pingplusplus/android/PingppDataCollection;", "", "contenxt", "Landroid/content/Context;", "(Landroid/content/Context;)V", "appId", "", "getAppId", "()Ljava/lang/String;", "setAppId", "(Ljava/lang/String;)V", "chIds", "", "getChIds", "()Ljava/util/List;", "setChIds", "(Ljava/util/List;)V", "channels", "", "", "getChannels", "()Ljava/util/Map;", "setChannels", "(Ljava/util/Map;)V", "deviceId", "getDeviceId", "setDeviceId", "enterTime", "", "getEnterTime", "()J", "setEnterTime", "(J)V", ReactVideoView.EVENT_PROP_EXTRA, "getExtra", "setExtra", "firstChannel", "getFirstChannel", "setFirstChannel", "gps", "getGps", "setGps", "ip", "getIp", "setIp", "lastChannel", "getLastChannel", "setLastChannel", "nocard", "", "getNocard", "setNocard", "quitTime", "getQuitTime", "()Ljava/lang/Long;", "setQuitTime", "(Ljava/lang/Long;)V", "Ljava/lang/Long;", "reportToken", "getReportToken", "sdkType", "getSdkType", "()Ljava/lang/Integer;", "setSdkType", "(Ljava/lang/Integer;)V", "Ljava/lang/Integer;", "sdkVersion", "getSdkVersion", "setSdkVersion", "stringToBeSigned", "getStringToBeSigned", "system", "getSystem", "setSystem", "systemVersion", "getSystemVersion", "setSystemVersion", "addCharge", "", "charge", "Lorg/json/JSONObject;", "addChargeId", "chargeId", "increaseChannel", "channel", "sendToServer", "setQuitTimeNow", "Lcom/pingplusplus/android/PingppDataCollection$SdkType;", "toHashMap", "", "toJSONString", "Companion", "SdkType", "pingpp-android_release"}, k = 1, mv = {1, 1, 16})
public final class PingppDataCollection {

    public static final Companion INSTANCE = new Companion(null);
    private static final String[] q = {com.alipay.sdk.app.statistic.c.ar, "device_id", "enter_time", "sdk_type", "sdk_version", "system", "system_version"};

    private String f1575a;
    private String b;
    private String c;
    private String d;
    private String e;
    private String f;
    private String g;
    private Integer h;
    private long i;
    private Long j;
    private Map<String, Integer> k;
    private String l;
    private String m;
    private List<String> n;
    private List<? extends Object> o;
    private Map<String, String> p;

    public static final class Companion {
        private Companion() {
        }

        public Companion(DefaultConstructorMarker defaultConstructorMarker) {
            this();
        }

        public final long a() {
            return new Date().getTime() / 1000;
        }
    }

    public enum b {
        SDK(0),
        ONE(1);


        private int f1576a;

        b(int i) {
            this.f1576a = i;
        }

        public final int a() {
            return this.f1576a;
        }

        @Override
        public String toString() {
            return String.valueOf(this.f1576a);
        }
    }

    public PingppDataCollection(Context contenxt) {
        Intrinsics.checkParameterIsNotNull(contenxt, "contenxt");
        this.f1575a = "Android";
        this.b = Build.MODEL + "," + Build.VERSION.RELEASE;
        StringBuilder sb = new StringBuilder();
        sb.append("systemVersion=");
        sb.append(this.b);
        PingppLog.a(sb.toString());
        this.c = Pingpp.VERSION;
        String a2 = PingppUtil.b.a(contenxt).a();
        this.d = a2;
        PingppLog.a(a2);
        this.n = new ArrayList();
        this.k = new HashMap();
        this.i = INSTANCE.a();
        this.f = com.alipay.sdk.app.statistic.c.ar;
        HashMap hashMap = new HashMap();
        this.p = hashMap;
        hashMap.put("module", "SDK");
        try {
            Class.forName("com.jianmi.uexpingpp.EUExPingpp");
            this.p.put("module", "AppCan");
        } catch (ClassNotFoundException unused) {
        }
        try {
            Class.forName("com.pingplusplus.apicloud.ModulePingpp");
            this.p.put("module", "APICloud");
        } catch (ClassNotFoundException unused2) {
        }
        try {
            Class.forName("com.justep.cordova.plugin.pingpp.PingppPlugin");
            this.p.put("module", "WeX5");
        } catch (ClassNotFoundException unused3) {
        }
    }

    private final void a(String str) {
        this.n.add(str);
    }

    private final String b() {
        PingppLog.a(c());
        PingppLog.a(a());
        return PingppUtil.b.a(c());
    }

    private final void b(String str) {
        if (this.l == null) {
            this.l = str;
        }
        this.m = str;
        int i = 1;
        if (this.k.containsKey(str)) {
            Integer num = this.k.get(str);
            if (num == null) {
                Intrinsics.throwNpe();
            }
            i = 1 + num.intValue();
        }
        this.k.put(str, Integer.valueOf(i));
    }

    private final String c() {
        Map<String, Object> e = e();
        StringBuilder sb = new StringBuilder();
        for (String str : q) {
            if (sb.length() > 0) {
                sb.append(com.alipay.sdk.sys.a.b);
            }
            sb.append(str);
            sb.append("=");
            sb.append(e.get(str) == null ? "" : e.get(str));
        }
        String sb2 = sb.toString();
        Intrinsics.checkExpressionValueIsNotNull(sb2, "sb.toString()");
        return sb2;
    }

    private final void d() {
        this.j = Long.valueOf(INSTANCE.a());
    }

    private final Map<String, Object> e() {
        HashMap hashMap = new HashMap();
        hashMap.put("system", this.f1575a);
        hashMap.put("system_version", this.b);
        hashMap.put("sdk_version", this.c);
        hashMap.put("device_id", this.d);
        hashMap.put("ip", this.e);
        hashMap.put(com.alipay.sdk.app.statistic.c.ar, this.f);
        hashMap.put("gps", this.g);
        hashMap.put("sdk_type", this.h);
        hashMap.put("enter_time", Long.valueOf(this.i));
        hashMap.put("quit_time", this.j);
        hashMap.put("channels", this.k);
        hashMap.put("first_channel", this.l);
        hashMap.put("ch_ids", this.n);
        hashMap.put("last_channel", this.m);
        hashMap.put("nocard", this.o);
        hashMap.put(ReactVideoView.EVENT_PROP_EXTRA, this.p);
        return hashMap;
    }

    public final String a() {
        String jSONObject = new JSONObject(e()).toString();
        Intrinsics.checkExpressionValueIsNotNull(jSONObject, "jsonObject.toString()");
        return jSONObject;
    }

    public final void a(b sdkType) {
        Intrinsics.checkParameterIsNotNull(sdkType, "sdkType");
        this.h = Integer.valueOf(sdkType.a());
    }

    public final void a(JSONObject charge) {
        Intrinsics.checkParameterIsNotNull(charge, "charge");
        try {
            String chargeId = charge.getString("id");
            Intrinsics.checkExpressionValueIsNotNull(chargeId, "chargeId");
            a(chargeId);
            String channel = charge.getString("channel");
            Intrinsics.checkExpressionValueIsNotNull(channel, "channel");
            b(channel);
        } catch (JSONException e) {
            e.printStackTrace();
        }
        String str = null;
        try {
            str = charge.getString(App.TYPE);
        } catch (JSONException e2) {
            e2.printStackTrace();
        }
        if (str == null) {
            try {
                str = charge.getJSONObject(App.TYPE).getString("id");
            } catch (JSONException e3) {
                e3.printStackTrace();
            }
        }
        if (str != null) {
            this.f = str;
        }
    }

    public final void sendToServer() {
        if (this.j == null) {
            d();
        }
        HashMap hashMap = new HashMap();
        if (b() != null) {
            hashMap.put("X-Pingpp-Report-Token", b());
        }
        ArrayList arrayList = new ArrayList();
        arrayList.add(e());
        PingppUtil.a(PingppUtil.b.a(), "https://statistics.pingxx.com/report", arrayList, hashMap, null, 8, null);
    }
}