夏天YY v1.0版本的 MD5 值为:04df6daece98ad4aaa5f0e7a450865f8

以下内容为反编译后的 h.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.db;
import com.uc.crashsdk.export.ExitType;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
public class h extends bv implements bm, Runnable {
    private volatile bl f;
    private File g;
    private volatile boolean f125c = false;
    private String h = "wf4_bf";
    private String i = "wf4";
    private StringBuilder j = new StringBuilder(100);
    private ap e = new ap(8192, 5);
    private List<String> d = new ArrayList();

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

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

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

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

    @Override
    public void a() {
        cu.b(e());
        a(101, 0L);
    }

    @Override
    public void a(Message message) throws Exception {
        db.a a;
        if (this.g == null) {
            return;
        }
        boolean z = false;
        switch (message.what) {
            case 100:
                this.f = new bl(new File(this.g, this.i));
                this.f.a(this);
                byte[] b = cr.b(new File(this.g, this.h));
                long longValue = ((Long) dh.b("LocationSDK", "log_fc_wf_bf_create_t_ms", (Object) 0L)).longValue();
                long currentTimeMillis = System.currentTimeMillis();
                if (currentTimeMillis - longValue < 2592000000L && !de.a(b)) {
                    this.e.a(b);
                    cy.a("WifiInfoPro", "bf init.");
                } else {
                    dh.a("LocationSDK", "log_fc_wf_bf_create_t_ms", Long.valueOf(currentTimeMillis));
                    cy.a("WifiInfoPro", "bf reset.");
                }
                a(ExitType.UNEXP_REASON_ANR, 300000L);
                cr.a(new File(this.g, this.h), this.e.a(), false);
                a(ExitType.UNEXP_REASON_EXIT, 300000L);
                return;
            case 101:
                b(this.d);
                cr.a(new File(this.g, this.h), this.e.a(), false);
                if (this.f != null) {
                    this.f.a();
                    this.f = null;
                }
                cu.b(e(), ExitType.UNEXP_REASON_ANR);
                if (message.what != 101 && g()) {
                    a(ExitType.UNEXP_REASON_ANR, 1800000L);
                }
                long currentTimeMillis2 = System.currentTimeMillis();
                long longValue2 = ((Long) dh.b("LocationSDK", "log_fc_wf_up_t_ms", (Object) 0L)).longValue();
                a = db.a();
                if (a != db.a.NETWORK_WIFI || (a == db.a.NETWORK_MOBILE && (j.f || j.g))) {
                    z = true;
                }
                if (cy.a()) {
                    cy.a("WifiInfoPro", "lastUpT:" + longValue2 + ",deltaT:" + (currentTimeMillis2 - longValue2) + ",network status:" + a + ",isUpload:" + z);
                }
                if (z) {
                    return;
                }
                if (longValue2 != 0 && currentTimeMillis2 - longValue2 >= 86400000) {
                    cs.a("th_loc_task_t_consume", this);
                    dh.a("LocationSDK", "log_fc_wf_up_t_ms", Long.valueOf(currentTimeMillis2));
                    return;
                } else if (longValue2 == 0) {
                    dh.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 (cy.a()) {
                    cy.a("WifiInfoPro", "wf list size:" + this.d.size());
                }
                if (this.d.size() >= 30) {
                    b(this.d);
                    return;
                }
                return;
            case ExitType.UNEXP_REASON_ANR:
                cu.b(e(), ExitType.UNEXP_REASON_ANR);
                if (message.what != 101) {
                    a(ExitType.UNEXP_REASON_ANR, 1800000L);
                    break;
                }
                long currentTimeMillis22 = System.currentTimeMillis();
                long longValue22 = ((Long) dh.b("LocationSDK", "log_fc_wf_up_t_ms", (Object) 0L)).longValue();
                a = db.a();
                if (a != db.a.NETWORK_WIFI) {
                    break;
                }
                z = true;
                if (cy.a()) {
                }
                if (z) {
                }
                break;
            case ExitType.UNEXP_REASON_EXIT:
                cr.a(new File(this.g, this.h), this.e.a(), false);
                a(ExitType.UNEXP_REASON_EXIT, 300000L);
                return;
            default:
                return;
        }
    }

    private void b(List<String> list) throws IOException {
        if (this.f125c || de.a((Collection) list) || de.a(this.f)) {
            return;
        }
        long length = this.f.b().length();
        if (cy.a()) {
            cy.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("UTF-8"), 2));
            sb2.append(',');
            StringBuilder sb3 = this.j;
            sb3.append(scanResult.frequency);
            sb3.append(',');
            this.j.append(Base64.encodeToString(scanResult.capabilities.getBytes("UTF-8"), 2));
        } catch (Throwable unused) {
            this.j.setLength(0);
        }
        return this.j.toString();
    }

    @Override
    public byte[] a(byte[] bArr) {
        byte[] a = cn.a(cj.a(bArr), cn.a("fc_wf_up"));
        if (!de.a(a)) {
            byte[] encode = Base64.encode(a, 2);
            if (!de.a(encode)) {
                String str = new String(encode);
                try {
                    return (str + '$').getBytes("UTF-8");
                } catch (Throwable unused) {
                }
            }
        }
        return new byte[0];
    }

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

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