工作空间 v3.6.5.2版本的 MD5 值为:58e65af156c65a63bf64ed2e64960853

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


package com.loc;

import android.content.Context;
import android.net.ConnectivityManager;
import com.amap.api.location.AMapLocationClientOption;
import java.util.Timer;
import java.util.TimerTask;
import org.json.JSONObject;
public final class Da {
    public Object f5617a = null;
    private boolean f5618b = false;
    public String f5619c = "com.data.carrier_v4.CollectorManager";
    private Timer f5620d = null;
    private TimerTask f5621e = null;
    private int f = 0;
    private boolean g = true;
    private Na h = null;
    private Fa i = null;
    private ConnectivityManager j = null;
    private long k = 0;
    private Context l = null;

    class a implements Runnable {
        a() {
        }

        @Override
        public final void run() {
            try {
                Va.a(Da.this.f5617a, "destroy", new Object[0]);
            } catch (Throwable th) {
                Sa.a(th, "CollectionManager", "stop3rdCM");
            }
        }
    }

    public static void a(Da da, int i) {
        Object obj;
        if (!da.j() || !Ra.r()) {
            da.i();
            return;
        }
        int i2 = 674234367;
        if (i != 0) {
            if (i != 1) {
                if (i == 2) {
                    try {
                        if (da.i == null || da.i.a(da.j)) {
                            i2 = 2083520511;
                        }
                    } catch (Throwable th) {
                        Sa.a(th, "CollectionManager", "up");
                        return;
                    }
                }
            }
            Object obj2 = da.f5617a;
            JSONObject jSONObject = new JSONObject();
            jSONObject.put("e", 1);
            jSONObject.put("d", i2);
            jSONObject.put("u", 1);
            Va.a(obj2, "callBackWrapData", jSONObject.toString());
            obj = Va.a(da.f5617a, "getReportDate", new Object[0]);
            if (obj != null) {
                String a2 = da.h.a((byte[]) obj, da.l, "http://cgicol.amap.com/collection/writedata?ver=v1.0_ali&");
                if (da.j()) {
                    da.f = ((Integer) Va.a(da.f5617a, "setUploadResult", a2, Integer.valueOf(i2))).intValue();
                }
            }
            da.e();
            if (!da.j() && da.k() == 0) {
                da.i();
                return;
            } else if (da.f < 3) {
                da.i();
                return;
            } else {
                return;
            }
        }
        i2 = 70254591;
        Object obj22 = da.f5617a;
        JSONObject jSONObject2 = new JSONObject();
        jSONObject2.put("e", 1);
        jSONObject2.put("d", i2);
        jSONObject2.put("u", 1);
        Va.a(obj22, "callBackWrapData", jSONObject2.toString());
        obj = Va.a(da.f5617a, "getReportDate", new Object[0]);
        if (obj != null) {
        }
        da.e();
        if (!da.j()) {
        }
        if (da.f < 3) {
        }
    }

    private boolean g() {
        try {
            if (j()) {
                return h();
            }
            return false;
        } catch (Throwable th) {
            Sa.a(th, "CollectionManager", "collStarted");
            return false;
        }
    }

    private boolean h() {
        try {
            return ((Boolean) Va.a(this.f5617a, "isStarted", new Object[0])).booleanValue();
        } catch (Throwable unused) {
            return false;
        }
    }

    public void i() {
        TimerTask timerTask = this.f5621e;
        if (timerTask != null) {
            timerTask.cancel();
            this.f5621e = null;
        }
        Timer timer = this.f5620d;
        if (timer != null) {
            timer.cancel();
            this.f5620d.purge();
            this.f5620d = null;
        }
    }

    public boolean j() {
        return this.f5617a != null;
    }

    public int k() {
        try {
            return ((Integer) Va.a(this.f5617a, "getLeftUploadNum", new Object[0])).intValue();
        } catch (Throwable unused) {
            return 0;
        }
    }

    public final void a() {
        if (j()) {
            try {
                Va.a(this.f5617a, "getColUpHist", new Object[0]);
            } catch (Throwable unused) {
            }
        }
    }

    public final void a(Context context, Na na, Fa fa, AMapLocationClientOption aMapLocationClientOption, ConnectivityManager connectivityManager) {
        if (Ra.r()) {
            Sa.a(aMapLocationClientOption);
            try {
                if (this.f5617a == null) {
                    this.l = context;
                    this.h = na;
                    this.i = fa;
                    this.j = connectivityManager;
                    if (!this.f5618b) {
                        this.k = ab.b();
                        rb a2 = Sa.a("Collection", "1.0.0");
                        this.f5618b = Xa.a(context, a2);
                        if (this.f5618b) {
                            try {
                                this.f5617a = A.a(context, a2, this.f5619c, null, new Class[]{Context.class}, new Object[]{context});
                            } catch (Throwable unused) {
                            }
                        } else {
                            this.f5618b = true;
                        }
                    }
                }
            } catch (Throwable th) {
                Sa.a(th, "CollectionManager", "initCollection");
            }
            if (this.g && !g() && j()) {
                if (!Ra.r()) {
                    b();
                } else if (g()) {
                } else {
                    try {
                        e();
                        try {
                            Va.a(this.f5617a, "start", new Object[0]);
                        } catch (Throwable unused2) {
                        }
                    } catch (Throwable th2) {
                        Sa.a(th2, "CollectionManager", "start3rdCM");
                    }
                }
            }
        }
    }

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

    public final void b() {
        if (j() && g()) {
            try {
                Va.a(this.f5617a, "destroy", new Object[0]);
            } catch (Throwable th) {
                Sa.a(th, "CollectionManager", "stop3rdCM");
            }
            i();
        }
    }

    public final void c() {
        if (j() && g()) {
            C0417d.b().submit(new a());
            i();
        }
    }

    public final void d() {
        Fa fa;
        if (this.g && j() && (fa = this.i) != null && fa.a(this.j)) {
            if (!Ra.r()) {
                i();
                return;
            }
            if (this.f5621e == null) {
                this.f5621e = new Ca(this);
            }
            if (this.f5620d == null) {
                this.f5620d = new Timer("T-U", false);
                this.f5620d.schedule(this.f5621e, 2000L, 2000L);
            }
        }
    }

    public final void e() {
        if (j() && k() > 0) {
        }
    }

    public final String f() {
        try {
            if (this.f5617a != null) {
                return (String) Va.a(this.f5617a, "getInnerString", "version");
            }
            return null;
        } catch (Throwable th) {
            Sa.a(th, "CollectionManager", "getCollVer");
            return null;
        }
    }
}