360手机助手 v3.3.0版本的 MD5 值为:127c345ad16bbebee6e347381328afd0
以下内容为反编译后的 a.java 源代码,内容仅作参考
package com.qihoo.appstore.i;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.net.Uri;
import com.qihoo.appstore.AppStoreApplication;
import com.qihoo.appstore.resource.app.App;
import com.qihoo.appstore.utils.bw;
import com.qihoo.appstore.utils.dc;
import com.qihoo.speedometer.Config;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import org.json.JSONArray;
import org.json.JSONObject;
public class a implements Runnable {
private static a c;
private int f1725b = 0;
private f e;
private static final byte[] d = new byte[0];
static boolean f1724a = false;
private a() {
}
public static Thread a() {
return bw.a("DesktopIconRunnable", 10, c());
}
public static ArrayList a(String str) {
ArrayList arrayList = new ArrayList();
try {
JSONArray jSONArray = new JSONArray(str);
int length = jSONArray.length();
for (int i = 0; i < length; i++) {
try {
JSONObject jSONObject = (JSONObject) jSONArray.opt(i);
App app = new App();
if (!jSONObject.isNull("name")) {
app.o(jSONObject.getString("name"));
if (!jSONObject.isNull("logo_url")) {
app.s(jSONObject.getString("logo_url"));
if (!jSONObject.isNull("version_code")) {
app.p(jSONObject.optInt("version_code"));
if (!jSONObject.isNull("soft_id")) {
app.n(jSONObject.optString("soft_id"));
if (!jSONObject.isNull("down_url")) {
app.q(jSONObject.optString("down_url"));
if (!jSONObject.isNull("apkid")) {
app.m(jSONObject.optString("apkid"));
app.g(jSONObject.optLong("download_times"));
app.d(0);
app.D(jSONObject.optString("type"));
if (app.aR().equalsIgnoreCase("game")) {
arrayList.add(app);
}
}
}
}
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
Collections.sort(arrayList, new e());
} catch (Exception e2) {
e2.printStackTrace();
}
return arrayList;
}
public static void a(int i) {
AppStoreApplication.f593a.postDelayed(new b(i), Config.MIN_TIME_BETWEEN_MEASUREMENT_ALARM_MSEC);
}
private static a c() {
if (c == null) {
synchronized (d) {
if (c == null) {
c = new a();
}
}
}
return c;
}
public static void c(int i) {
c().f1725b = i;
Thread a2 = a();
if (a2 != null) {
a2.start();
}
}
private void d() {
c().a(new c(this));
e();
}
private void e() {
List a2 = a(b());
if (a2 != null) {
g.a(a2);
if (this.e != null) {
this.e.a(g.a());
}
}
}
protected List a(List list) {
if (list == null || list.isEmpty()) {
return null;
}
int size = list.size();
String str = dc.d ? "http://test1.baohe.mobilem.360.cn/index/getTidySoftInfoByIds?gamefiter=1" : "http://openbox.mobilem.360.cn/index/getTidySoftInfoByIds?gamefiter=1";
StringBuffer stringBuffer = new StringBuffer("&pnames=");
for (int i = 0; i < size; i++) {
stringBuffer.append((String) list.get(i));
stringBuffer.append(",");
}
ArrayList a2 = a(com.qihoo.appstore.http.h.a().c(str, stringBuffer.deleteCharAt(stringBuffer.length() - 1).toString()));
Collections.sort(a2, new d(this));
ArrayList arrayList = new ArrayList();
Iterator it = a2.iterator();
while (it.hasNext()) {
arrayList.add(((App) it.next()).W());
}
if (arrayList.size() == 0) {
return null;
}
return arrayList;
}
public void a(f fVar) {
this.e = fVar;
}
protected List b() {
PackageManager packageManager = AppStoreApplication.d().getPackageManager();
Intent intent = new Intent("android.intent.action.MAIN", (Uri) null);
intent.addCategory("android.intent.category.LAUNCHER");
List<ResolveInfo> queryIntentActivities = packageManager.queryIntentActivities(intent, 0);
ArrayList arrayList = new ArrayList();
Iterator<ResolveInfo> it = queryIntentActivities.iterator();
while (it.hasNext()) {
arrayList.add(it.next().activityInfo.packageName);
}
queryIntentActivities.clear();
return arrayList;
}
@Override
public void run() {
switch (this.f1725b) {
case 4:
d();
return;
default:
return;
}
}
}