Mi Love v2.1.19版本的 MD5 值为:359343d6da08b606640b0d6b4dd9d399

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


package c.t.m.g;

import android.net.wifi.ScanResult;
import android.os.Looper;
import android.os.Message;
import android.util.Base64;
import c.t.m.g.ep;
import com.bumptech.glide.load.Key;
import com.tencent.map.geolocation.util.DateUtils;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import kotlin.text.Typography;
public class cz extends dt implements dm, Runnable {
    private volatile dl f;
    private File g;
    private volatile boolean f40c = false;
    private String h = "wf4_bf";
    private String i = "wf4";
    private StringBuilder j = new StringBuilder(100);
    private dk e = new dk(8192, 5);
    private List<String> d = new ArrayList();

    @Override
    public String b() {
        return "WifiInfoPro";
    }

    public cz(File file) {
        this.g = file;
        if (en.a()) {
            en.a("WifiInfoPro", "data dir:" + this.g.getAbsolutePath());
        }
    }

    public void a(List<ScanResult> list) {
        if (!e() || es.a((Collection) list)) {
            return;
        }
        Message obtainMessage = d().obtainMessage(102);
        obtainMessage.obj = list;
        a(obtainMessage, 0L);
    }

    @Override
    public int a(Looper looper) {
        a(100, 0L);
        return 0;
    }

    @Override
    public void a() {
        a(101, 0L);
    }

    @Override
    public void a(Message message) throws Exception {
        ep.a a;
        if (this.g == null) {
            return;
        }
        boolean z = false;
        switch (message.what) {
            case 100:
                this.f = new dl(new File(this.g, this.i));
                this.f.a(this);
                byte[] a2 = eg.a(new File(this.g, this.h));
                long longValue = ((Long) eu.b("LocationSDK", "log_fc_wf_bf_create_t_ms", (Object) 0L)).longValue();
                long currentTimeMillis = System.currentTimeMillis();
                if (currentTimeMillis - longValue < 2592000000L && !es.a(a2)) {
                    this.e.a(a2);
                    en.a("WifiInfoPro", "bf init.");
                } else {
                    eu.a("LocationSDK", "log_fc_wf_bf_create_t_ms", Long.valueOf(currentTimeMillis));
                    en.a("WifiInfoPro", "bf reset.");
                }
                a(103, 300000L);
                eg.a(new File(this.g, this.h), this.e.a(), false);
                a(104, 300000L);
                return;
            case 101:
                b(this.d);
                eg.a(new File(this.g, this.h), this.e.a(), false);
                if (this.f != null) {
                    this.f.a();
                    this.f = null;
                }
                if (e()) {
                    a(103, 1800000L);
                }
                long currentTimeMillis2 = System.currentTimeMillis();
                long longValue2 = ((Long) eu.b("LocationSDK", "log_fc_wf_up_t_ms", (Object) 0L)).longValue();
                a = ep.a();
                if (a != ep.a.NETWORK_WIFI || (a == ep.a.NETWORK_MOBILE && (db.f || db.g))) {
                    z = true;
                }
                if (en.a()) {
                    en.a("WifiInfoPro", "lastUpT:" + longValue2 + ",deltaT:" + (currentTimeMillis2 - longValue2) + ",network status:" + a + ",isUpload:" + z);
                }
                if (z) {
                    return;
                }
                if (longValue2 != 0 && currentTimeMillis2 - longValue2 >= DateUtils.ONE_DAY) {
                    eh.a("th_loc_task_t_consume", this);
                    eu.a("LocationSDK", "log_fc_wf_up_t_ms", Long.valueOf(currentTimeMillis2));
                    return;
                } else if (longValue2 == 0) {
                    eu.a("LocationSDK", "log_fc_wf_up_t_ms", Long.valueOf(currentTimeMillis2));
                    return;
                } else {
                    return;
                }
            case 102:
                for (ScanResult scanResult : (List) message.obj) {
                    if (!this.e.b(scanResult.BSSID)) {
                        this.e.a(scanResult.BSSID);
                        this.d.add(a(scanResult));
                    }
                }
                if (en.a()) {
                    en.a("WifiInfoPro", "wf list size:" + this.d.size());
                }
                if (this.d.size() >= 30) {
                    b(this.d);
                    return;
                }
                return;
            case 103:
                if (e()) {
                }
                long currentTimeMillis22 = System.currentTimeMillis();
                long longValue22 = ((Long) eu.b("LocationSDK", "log_fc_wf_up_t_ms", (Object) 0L)).longValue();
                a = ep.a();
                if (a != ep.a.NETWORK_WIFI) {
                    break;
                }
                z = true;
                if (en.a()) {
                }
                if (z) {
                }
                break;
            case 104:
                eg.a(new File(this.g, this.h), this.e.a(), false);
                a(104, 300000L);
                return;
            default:
                return;
        }
    }

    private void b(List<String> list) throws IOException {
        if (this.f40c || es.a((Collection) list) || es.a(this.f)) {
            return;
        }
        long length = this.f.b().length();
        if (en.a()) {
            en.a("WifiInfoPro", "wf file len:" + length);
        }
        if (length <= 51200) {
            StringBuilder sb = new StringBuilder(500);
            sb.append("1|");
            sb.append(list.size());
            for (String str : list) {
                sb.append('|');
                sb.append(str);
            }
            this.f.a(sb.toString());
        }
        list.clear();
    }

    private String a(ScanResult scanResult) {
        this.j.setLength(0);
        try {
            StringBuilder sb = this.j;
            sb.append(scanResult.BSSID);
            sb.append(',');
            StringBuilder sb2 = this.j;
            sb2.append(Base64.encodeToString(scanResult.SSID.getBytes(Key.STRING_CHARSET_NAME), 2));
            sb2.append(',');
            StringBuilder sb3 = this.j;
            sb3.append(scanResult.frequency);
            sb3.append(',');
            this.j.append(Base64.encodeToString(scanResult.capabilities.getBytes(Key.STRING_CHARSET_NAME), 2));
        } catch (Throwable unused) {
            this.j.setLength(0);
        }
        return this.j.toString();
    }

    @Override
    public byte[] a(byte[] bArr) {
        byte[] a = ef.a(ec.a(bArr), "0PEq^X$sjtWqEqa2$dg4TG2PT^4dFEep");
        if (!es.a(a)) {
            byte[] encode = Base64.encode(a, 2);
            if (!es.a(encode)) {
                String str = new String(encode);
                try {
                    return (str + Typography.dollar).getBytes(Key.STRING_CHARSET_NAME);
                } catch (Throwable unused) {
                }
            }
        }
        return new byte[0];
    }

    @Override
    public void run() {
        try {
            this.f40c = true;
            if (this.f != null) {
                this.f.a();
                this.f = null;
            }
            final File file = new File(this.g, this.i);
            if (en.a()) {
                en.a("WifiInfoPro", "upload:" + file.getName() + "," + file.length());
            }
            byte[] a = ec.a(eg.a(file));
            String str = db.h ? "https://testdatalbs.sparta.html5.qq.com/tr?wf4" : "https://analytics.map.qq.com/?wf4";
            if (!db.e) {
                str = str.replace("https:", "http:");
            }
            db.k.a(str, a, new dn() {
                @Override
                public void a(String str2) {
                    file.delete();
                    if (en.a()) {
                        en.a("WifiInfoPro", "upload suc & del:" + str2);
                    }
                }

                @Override
                public void b(String str2) {
                    if (en.a()) {
                        en.a("WifiInfoPro", "upload failed:" + str2);
                    }
                }
            });
            if (e()) {
                this.f = new dl(new File(this.g, this.i));
                this.f.a(this);
            }
        } finally {
            try {
            } finally {
            }
        }
    }
}