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

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


package com.qihoo.appstore.r;

import android.content.Context;
import android.content.SharedPreferences;
import android.text.TextUtils;
import com.qihoo.appstore.AppStoreApplication;
import com.qihoo.appstore.utils.bk;
import com.qihoo.appstore.utils.de;
import com.qihoo.speedometer.Config;
import com.qihoo360.mobilesafe.pcdaemon.service.k;
import com.qihoo360.mobilesafe.util.ag;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.atomic.AtomicBoolean;

public class d {

    private static boolean f3203a = false;

    private static boolean f3204b = true;
    private static boolean c = false;
    private static SharedPreferences d = AppStoreApplication.d().getSharedPreferences("new_stat_feature_2", 0);
    private static final Object e = new Object();
    private static AtomicBoolean f = new AtomicBoolean();

    public static String a(Set set, Set set2) {
        String str;
        synchronized (e) {
            if (c() == null) {
                str = Config.INVALID_IP;
            } else {
                Map<String, ?> all = c().getAll();
                String str2 = Config.INVALID_IP;
                boolean z = true;
                for (String str3 : all.keySet()) {
                    if (set == null || set.contains(str3)) {
                        if (str2.length() > 100) {
                            break;
                        }
                        if (!z) {
                            str2 = str2 + "-";
                        }
                        set2.add(str3);
                        z = false;
                        str2 = str2 + str3 + all.get(str3);
                    }
                }
                String str4 = Config.INVALID_IP;
                if (set == null) {
                    str4 = k.b(AppStoreApplication.d());
                    if (com.qihoo360.mobilesafe.a.a.f5313a) {
                        bk.b("NewStatHelper2", str2 + str4);
                    }
                }
                str = str2 + str4;
            }
        }
        return str;
    }

    public static void a() {
        if (c() == null) {
            return;
        }
        ag.a(c().edit().clear());
    }

    public static void a(String str, int i) {
        synchronized (e) {
            if (TextUtils.isEmpty(str)) {
                return;
            }
            if (c() == null) {
                return;
            }
            a(str, Config.INVALID_IP + (Integer.parseInt(b(str)) + i));
        }
    }

    public static void a(String str, Context context) {
        a(str, 1);
        HashSet hashSet = new HashSet();
        hashSet.add(str);
        b("getUpdate0", context, hashSet);
    }

    public static void a(String str, Context context, Set set) {
        if (f3203a || f3204b) {
            try {
                a(str, set, false);
            } catch (Exception e2) {
            }
        }
    }

    private static void a(String str, String str2) {
        if (c() == null) {
            return;
        }
        ag.a(c().edit().putString(str, str2));
    }

    public static void a(String str, Set set) {
        a(str, set, true);
    }

    public static void a(String str, Set set, boolean z) {
        if (f.getAndSet(true) && z) {
            return;
        }
        AppStoreApplication.a(new e(set, str));
    }

    public static void a(boolean z) {
        c = z;
    }

    private static String b(String str) {
        return c() == null ? "0" : c().getString(str, "0");
    }

    public static void b(String str, Context context, Set set) {
        if (f3203a) {
            try {
                a(str, set);
            } catch (Exception e2) {
            }
        }
    }

    public static void b(boolean z) {
        f3203a = z;
        f3204b = z;
    }

    private static SharedPreferences c() {
        return d;
    }

    public static String c(String str) {
        String valueOf = String.valueOf(de.c(AppStoreApplication.d(), AppStoreApplication.d().getPackageName()));
        String str2 = null;
        try {
            str2 = URLEncoder.encode(de.f(AppStoreApplication.d()), "UTF-8");
        } catch (UnsupportedEncodingException e2) {
            e2.printStackTrace();
        }
        StringBuilder sb = new StringBuilder("http://s.360.cn/appstore/info.htm?");
        sb.append("method=").append(str).append("&m=").append(g.f3209b).append("&m2=").append(g.f).append("&v=").append(valueOf).append("&vn=").append(str2).append("&re=").append(f.f3207a).append("&ch=").append(g.e);
        if (AppStoreApplication.d().a()) {
            sb.append("&st=").append(g.g);
        }
        return sb.toString();
    }

    public static void c(Set set, Set set2) {
        synchronized (e) {
            if (c() == null) {
                return;
            }
            SharedPreferences.Editor edit = c().edit();
            if (set == null) {
                k.a(AppStoreApplication.d(), (String) null);
            }
            Iterator it = set2.iterator();
            while (it.hasNext()) {
                edit.remove((String) it.next());
            }
            if (set != null) {
                set.removeAll(set2);
            }
            ag.a(edit);
        }
    }
}