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

以下内容为反编译后的 a.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.Calendar;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.atomic.AtomicBoolean;

public class a {

    private static boolean f3197a = false;

    private static boolean f3198b = true;
    private static boolean c = false;
    private static SharedPreferences d = AppStoreApplication.d().getSharedPreferences("new_stat_feature", 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 (d() == null) {
                str = Config.INVALID_IP;
            } else {
                Map<String, ?> all = d().getAll();
                all.remove("LAST_UPDATE_TIME_KEY");
                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("NewStatHelper", str2 + str4);
                    }
                }
                str = str2 + str4;
            }
        }
        return str;
    }

    public static void a(Context context, String str) {
        new b(context, str).start();
    }

    public static void a(String str, int i) {
        synchronized (e) {
            if (TextUtils.isEmpty(str)) {
                return;
            }
            if (d() == null) {
                return;
            }
            a(str, Config.INVALID_IP + (Integer.parseInt(b(str)) + i));
            if (com.qihoo360.mobilesafe.a.a.f5313a) {
                bk.b("newstat", e());
            }
        }
    }

    public static void a(String str, Context context) {
        try {
            if (b()) {
                if (com.qihoo360.mobilesafe.a.a.f5313a) {
                    bk.b("NewStat", "清除一周前的日志");
                }
                f();
                d.a();
                return;
            }
            if (f3197a && a(context)) {
                a(str, (Set) null);
            }
        } catch (Exception e2) {
        }
    }

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

    public static void a(String str, String str2) {
        if (d() == null) {
            return;
        }
        ag.a(d().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 c(set, str));
        d.a(str, set, z);
    }

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

    public static boolean a() {
        return c;
    }

    public static boolean a(Context context) {
        if (d() == null) {
            return false;
        }
        return d().getInt("LAST_UPDATE_TIME_KEY", -1) != Calendar.getInstance().get(6);
    }

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

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

    public static void b(boolean z) {
        if (!z) {
            f();
            d.a();
        }
        d.b(z);
        f3197a = z;
        f3198b = z;
    }

    public static boolean b() {
        int i;
        if (d() == null || (i = d().getInt("LAST_UPDATE_TIME_KEY", -1)) == -1) {
            return false;
        }
        Calendar calendar = Calendar.getInstance();
        return calendar.get(6) + (-7) > i || i + (-7) > calendar.get(6);
    }

    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://openbox.mobilem.360.cn/AppStore/info?");
        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 (d() == null) {
                return;
            }
            SharedPreferences.Editor edit = d().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);
            }
            if (set == null) {
                edit.putInt("LAST_UPDATE_TIME_KEY", Calendar.getInstance().get(6));
            }
            ag.a(edit);
        }
    }

    private static SharedPreferences d() {
        return d;
    }

    private static String e() {
        if (d() == null) {
            return Config.INVALID_IP;
        }
        Map<String, ?> all = d().getAll();
        String str = Config.INVALID_IP;
        for (String str2 : all.keySet()) {
            if (!str2.equals("LAST_UPDATE_TIME_KEY")) {
                str = str + "-" + str2 + "_" + all.get(str2);
            }
        }
        return str;
    }

    private static void f() {
        if (d() == null) {
            return;
        }
        ag.a(d().edit().clear());
    }
}