360手机助手 v3.3.0版本的 MD5 值为:127c345ad16bbebee6e347381328afd0

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


package com.qihoo360.mobilesafe.pcdaemon;

import android.os.Handler;
import com.qihoo360.mobilesafe.pcdaemon.data.PduBase;
import com.qihoo360.mobilesafe.ui.index.MobileSafeApplication;
import java.net.Socket;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

public class ak {

    private final MobileSafeApplication f5459a;

    private aw f5460b;
    private final a e;
    private final String k;
    private final Map c = Collections.synchronizedMap(new HashMap());
    private bh d = null;
    private final List f = Collections.synchronizedList(new ArrayList());
    private final List g = Collections.synchronizedList(new ArrayList());
    private final List h = Collections.synchronizedList(new ArrayList());
    private final Object l = new Object();
    private final s i = new s(this);
    private final Handler j = new Handler();

    public ak(MobileSafeApplication mobileSafeApplication) {
        this.f5460b = null;
        this.f5459a = mobileSafeApplication;
        this.k = com.qihoo360.mobilesafe.util.ai.d(mobileSafeApplication.getApplicationContext());
        this.e = new a(mobileSafeApplication);
        this.f5460b = new aw(mobileSafeApplication, this);
    }

    public int a(com.qihoo.express.mini.service.a.a aVar) {
        if (this.e != null) {
            return this.e.a(aVar);
        }
        return -1;
    }

    public int a(PduBase pduBase) {
        int i;
        bh bhVar;
        synchronized (this.f) {
            Iterator it = this.f.iterator();
            i = 0;
            while (it.hasNext()) {
                ((com.qihoo360.mobilesafe.pcdaemon.service.a) it.next()).a(pduBase);
                i++;
            }
        }
        synchronized (this.l) {
            bhVar = this.d;
        }
        if (bhVar != null) {
            bhVar.a(pduBase);
        }
        return i;
    }

    public bb a() {
        return bb.a("upload_file_cache");
    }

    public com.qihoo360.mobilesafe.pcdaemon.service.a a(com.qihoo360.mobilesafe.pcdaemon.service.p pVar, Socket socket) {
        al alVar = null;
        String hostAddress = socket.getLocalAddress().getHostAddress();
        String hostAddress2 = socket.getInetAddress().getHostAddress();
        com.qihoo360.mobilesafe.ui.index.d i = this.f5459a.i();
        if (this.f5459a.h().equalsIgnoreCase("USB_CLOSING")) {
            com.qihoo360.mobilesafe.util.h.d("PeerManager", "Socket Ignored when USB_CLOSING, Local: %s, INet: %s", socket.getLocalAddress(), socket.getInetAddress());
            return null;
        }
        if (hostAddress.equalsIgnoreCase("127.0.0.1") && hostAddress2.equalsIgnoreCase("127.0.0.1")) {
            com.qihoo360.mobilesafe.pcdaemon.service.a aVar = new com.qihoo360.mobilesafe.pcdaemon.service.a(socket, new am(this));
            aVar.b(this.k);
            synchronized (this.g) {
                this.g.add(aVar);
            }
            com.qihoo360.mobilesafe.util.h.b("PeerManager", "USB Session Created of New Socket, Local: %s, INet: %s, AESKey: %s, CountOfTotalUSBSessions: %d", socket.getLocalAddress(), socket.getInetAddress(), aVar.e(), Integer.valueOf(this.g.size()));
            return aVar;
        }
        if (i == null || !hostAddress.equalsIgnoreCase(i.b())) {
            com.qihoo360.mobilesafe.util.h.c("PeerManager", "Odd Socket from Nowhere, Local: %s, INet: %s", socket.getLocalAddress(), socket.getInetAddress());
            return null;
        }
        com.qihoo360.mobilesafe.pcdaemon.service.a aVar2 = new com.qihoo360.mobilesafe.pcdaemon.service.a(socket, new am(this));
        this.h.add(aVar2);
        com.qihoo360.mobilesafe.util.h.b("PeerManager", "WiFi Session Created of New Socket, Local: %s, INet: %s, CountOfTotalWiFiSessions: %d.", socket.getLocalAddress(), socket.getInetAddress(), Integer.valueOf(this.h.size()));
        return aVar2;
    }

    public void a(String str) {
        synchronized (this.l) {
            com.qihoo360.mobilesafe.util.h.c("PeerManager", "Kicking All WiFi Peers, Reason: %s", str);
            if (this.d != null) {
                this.d.a(str, null, null);
            }
        }
    }

    public boolean a(int i) {
        if (this.e != null) {
            return this.e.a(Integer.valueOf(i));
        }
        return false;
    }

    public bb b() {
        return bb.a("download_file_cache");
    }

    public aw c() {
        return this.f5460b;
    }

    public boolean d() {
        return this.c.size() > 0;
    }

    public int e() {
        return this.g.size();
    }

    public void f() {
        a().b();
        b().b();
    }
}