360手机助手 v3.3.0版本的 MD5 值为:127c345ad16bbebee6e347381328afd0
以下内容为反编译后的 am.java 源代码,内容仅作参考
package com.qihoo360.mobilesafe.pcdaemon;
import android.os.Handler;
import com.qihoo.speedometer.Config;
import com.qihoo360.mobilesafe.pcdaemon.data.ACSIITextPdu;
import com.qihoo360.mobilesafe.pcdaemon.data.PduBase;
import com.qihoo360.mobilesafe.ui.index.MobileSafeApplication;
import java.util.List;
import java.util.Map;
public final class am extends com.qihoo360.mobilesafe.pcdaemon.service.d {
final ak f5461a;
private am(ak akVar) {
this.f5461a = akVar;
}
@Override
public PduBase a(com.qihoo360.mobilesafe.pcdaemon.service.a aVar, PduBase pduBase) {
List list;
Object obj;
bh bhVar;
MobileSafeApplication mobileSafeApplication;
bg bgVar;
s sVar;
s sVar2;
Map map;
Map map2;
Map map3;
Object obj2;
bh bhVar2;
bh bhVar3;
s sVar3;
MobileSafeApplication mobileSafeApplication2;
MobileSafeApplication mobileSafeApplication3;
Object obj3;
bh bhVar4;
bh bhVar5;
s sVar4;
MobileSafeApplication mobileSafeApplication4;
MobileSafeApplication mobileSafeApplication5;
a aVar2;
List list2;
List list3;
MobileSafeApplication mobileSafeApplication6;
String e = pduBase.e();
if (e.equalsIgnoreCase("ACK")) {
return null;
}
list = this.f5461a.g;
if (list.contains(aVar)) {
if (pduBase.b() == 3) {
list2 = this.f5461a.f;
synchronized (list2) {
list3 = this.f5461a.f;
list3.add(aVar);
}
mobileSafeApplication6 = this.f5461a.f5459a;
mobileSafeApplication6.u();
}
aVar2 = this.f5461a.e;
return aVar2.a(pduBase, aVar);
}
if (aVar.c() == null) {
if (!e.equalsIgnoreCase("CMD_PEER_CHALLENGE") && !e.equalsIgnoreCase("CMD_CHALLENGE")) {
throw new w("Challenge or Peer Challenge Required");
}
aVar.a(pduBase.d()[0]);
}
String d = aVar.d();
obj = this.f5461a.l;
synchronized (obj) {
bhVar = this.f5461a.d;
}
if (bhVar != null && bhVar.a(d) != null) {
return bhVar.a(pduBase, aVar);
}
mobileSafeApplication = this.f5461a.f5459a;
bf bfVar = new bf(mobileSafeApplication.k());
try {
bgVar = bfVar.a(pduBase, aVar);
} catch (Exception e2) {
bgVar = null;
}
if (bgVar == null) {
return null;
}
com.qihoo360.mobilesafe.util.h.b("PeerManager", "User Authorization Required, Result: %s", bgVar);
sVar = this.f5461a.i;
if (sVar.b(bgVar.d)) {
return new ACSIITextPdu("RET_PEER_QUERY_AUTHORIZE:FINISHED:ABANDONED");
}
sVar2 = this.f5461a.i;
if (sVar2.a(bgVar.d)) {
obj3 = this.f5461a.l;
synchronized (obj3) {
bhVar4 = this.f5461a.d;
if (bhVar4 == null) {
ak akVar = this.f5461a;
mobileSafeApplication5 = this.f5461a.f5459a;
akVar.d = new bh(mobileSafeApplication5.getApplicationContext(), bfVar.a(), bfVar.b(), new an(this.f5461a));
} else {
bhVar5 = this.f5461a.d;
bhVar5.a(bfVar.a());
}
}
sVar4 = this.f5461a.i;
sVar4.a(bgVar.d, false);
mobileSafeApplication4 = this.f5461a.f5459a;
mobileSafeApplication4.b("WIFI_ONLINE");
return new ACSIITextPdu("RET_PEER_QUERY_AUTHORIZE:FINISHED:SUCCESS:");
}
map = this.f5461a.c;
map.put(d, bfVar);
map2 = this.f5461a.c;
if (((bf) map2.remove(d)) == null) {
com.qihoo360.mobilesafe.util.h.c("PeerManager", "Peer Authorized by User but Authenticator NOT Found , PeerKey: %s, Remember: %s", d, false);
return new ACSIITextPdu("RET_PEER_QUERY_AUTHORIZE:FINISHED:ABANDONED");
}
map3 = this.f5461a.c;
map3.clear();
obj2 = this.f5461a.l;
synchronized (obj2) {
bhVar2 = this.f5461a.d;
if (bhVar2 == null) {
ak akVar2 = this.f5461a;
mobileSafeApplication3 = this.f5461a.f5459a;
akVar2.d = new bh(mobileSafeApplication3.getApplicationContext(), bfVar.a(), bfVar.b(), new an(this.f5461a));
} else {
bhVar3 = this.f5461a.d;
bhVar3.a(bfVar.a());
}
}
sVar3 = this.f5461a.i;
sVar3.a(bgVar.d, false);
mobileSafeApplication2 = this.f5461a.f5459a;
mobileSafeApplication2.b("WIFI_ONLINE");
com.qihoo360.mobilesafe.util.h.c("PeerManager", "Peer Authorized by User success , PeerKey: %s, Remember: %s", d, false);
return new ACSIITextPdu("RET_PEER_QUERY_AUTHORIZE:FINISHED:SUCCESS");
}
@Override
public void a(com.qihoo360.mobilesafe.pcdaemon.service.a aVar) {
List list;
Map map;
Object obj;
bh bhVar;
Handler handler;
Map map2;
List list2;
List list3;
List list4;
List list5;
List list6;
aw awVar;
al alVar = null;
if (aVar.b().equalsIgnoreCase("127.0.0.1")) {
list2 = this.f5461a.g;
synchronized (list2) {
list3 = this.f5461a.g;
list3.remove(aVar);
}
list4 = this.f5461a.f;
synchronized (list4) {
list5 = this.f5461a.f;
list5.remove(aVar);
}
list6 = this.f5461a.g;
if (list6.size() == 0) {
awVar = this.f5461a.f5460b;
awVar.a(5000L);
return;
}
return;
}
list = this.f5461a.h;
list.remove(aVar);
String d = aVar.d();
map = this.f5461a.c;
bf bfVar = (bf) map.get(d);
if (bfVar != null && bfVar.a() == aVar) {
com.qihoo360.mobilesafe.util.h.b("PeerManager", "Removing WiFi Authenticator by Session Closed, PeerKey: %s", d);
map2 = this.f5461a.c;
map2.remove(d);
}
obj = this.f5461a.l;
synchronized (obj) {
bhVar = this.f5461a.d;
}
if (bhVar != null) {
bhVar.b(aVar);
if (bhVar.b() == 0) {
com.qihoo360.mobilesafe.util.h.b("PeerManager", "WiFi Handler All Long Sessions Closed, PeerKey: %s", d);
this.f5461a.d = null;
long currentTimeMillis = System.currentTimeMillis();
handler = this.f5461a.j;
handler.postDelayed(new ao(this.f5461a, currentTimeMillis, aVar.d()), Config.PAUSE_BETWEEN_CHECKIN_CHANGE_MSEC);
}
}
}
}