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

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


package com.qihoo.appstore.r;

import android.content.Context;
import android.net.Uri;
import android.os.Build;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.view.Display;
import android.view.WindowManager;
import com.qihoo.appstore.AppStoreApplication;
import com.qihoo.appstore.activities.MainActivity;
import com.qihoo.appstore.resource.app.App;
import com.qihoo.appstore.resource.ring.Ring;
import com.qihoo.appstore.resource.wallpaper.Wallpaper;
import com.qihoo.appstore.utils.aw;
import com.qihoo.appstore.utils.bk;
import com.qihoo.appstore.utils.dc;
import com.qihoo.appstore.utils.de;
import com.qihoo.speedometer.Config;
import com.qihoo360.mobilesafe.util.ah;
import com.qihoo360.mobilesafe.util.ai;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;

public class g {

    public static String f3208a;

    public static String f3209b;
    public static String c;
    public static String d;
    public static String e;
    public static String f;
    public static String g;
    public static String h;
    public static String i;
    public static String j;
    public static String k;
    public static String l;
    private static int m;
    private static int n = -1;

    public static int a() {
        return com.qihoo.appstore.http.netconfig.c.b().a().a();
    }

    private static String a(int i2, int i3) {
        return (i2 <= 0 || i2 >= 2000 || i3 <= 0 || i2 >= 2000) ? Config.INVALID_IP : Integer.toString(i2) + "x" + Integer.toString(i3);
    }

    public static String a(Context context, String str) {
        try {
            String str2 = str + b(context);
            if (com.qihoo360.mobilesafe.a.a.f5313a) {
                bk.b("StatHelper", "getQueryUpdateUrl = " + str2);
            }
            return str2;
        } catch (Exception e2) {
            return str;
        }
    }

    private static String a(com.qihoo.appstore.e.a.b bVar) {
        String s;
        int i2;
        if (c == null) {
            a(AppStoreApplication.d());
        }
        String str = bVar.T;
        if (TextUtils.isEmpty(str)) {
            str = MainActivity.g();
        }
        StringBuilder sb = new StringBuilder();
        sb.append("&m=").append(f3209b).append("&m2=").append(f);
        sb.append("&nt=").append(a());
        String j2 = bVar.j();
        if (!TextUtils.isEmpty(j2)) {
            sb.append("&").append(j2);
        }
        bk.b("getlog", "baselog=" + j2 + "  fm=" + str);
        if (AppStoreApplication.d().a()) {
            sb.append("&st=").append(g);
        }
        if (!TextUtils.isEmpty(str)) {
            sb.append("&fm=").append(str);
        }
        sb.append("&v=").append(c).append("&re=").append(f.f3207a).append("&ch=").append(e);
        if (bVar.g()) {
            sb.append("&cid=").append(e);
        } else {
            sb.append("&cid=").append(0);
        }
        String X = bVar.X();
        String U = bVar.U();
        if (!TextUtils.isEmpty(X)) {
            sb.append("&si=").append(X);
        }
        String aG = bVar.aG();
        if (!TextUtils.isEmpty(aG)) {
            sb.append("&xz=").append(aG);
        }
        if (!TextUtils.isEmpty(U)) {
            try {
                sb.append("&mk=").append(URLEncoder.encode(U, "UTF-8"));
            } catch (UnsupportedEncodingException e2) {
                e2.printStackTrace();
            }
        }
        if (bVar instanceof App) {
            App app = (App) bVar;
            if (app.y()) {
                i2 = 6;
            } else if (app.bC()) {
                i2 = 3;
            } else if (com.qihoo.appstore.l.d.e(app.W())) {
                i2 = 2;
            }
            sb.append("&at=").append(i2);
            s = bVar.s();
            if (s != null && !s.equals(Config.INVALID_IP)) {
                sb.append("&ref=").append(s);
                bVar.h(Config.INVALID_IP);
                if (!(bVar instanceof Wallpaper)) {
                    sb.append("&filetype=").append("picture");
                } else if (bVar instanceof Ring) {
                    sb.append("&filetype=").append("music");
                } else if (bVar instanceof App) {
                    sb.append("&filetype=").append("apk");
                } else if (bVar instanceof com.qihoo.appstore.resource.b) {
                    sb.append("&filetype=").append("doc");
                } else if (bVar instanceof com.qihoo.appstore.resource.d) {
                    sb.append("&filetype=").append("video");
                } else if (bVar.ad().equalsIgnoreCase("txturl")) {
                    sb.append("&filetype=").append("url");
                } else if (bVar.ad().equalsIgnoreCase("videourl")) {
                    sb.append("&filetype=").append("videourl");
                } else if (bVar.ad().equalsIgnoreCase("qvodurl")) {
                    sb.append("&filetype=").append("qvodurl");
                } else if (bVar.ad().equalsIgnoreCase("lightappurl")) {
                    sb.append("&filetype=").append("lightappurl");
                } else if (bVar.ad().equalsIgnoreCase("msgtxt")) {
                    sb.append("&filetype=").append("msgtxt");
                } else if (bVar.ad().equalsIgnoreCase("qhvideo")) {
                    sb.append("&filetype=").append("qhvideo");
                } else {
                    sb.append("&filetype=").append("other");
                }
                if (!TextUtils.isEmpty(bVar.t())) {
                    sb.append("&co=").append(bVar.t());
                }
            }
            if (bVar.i() >= 0) {
                sb.append("&pos=").append(bVar.i());
            }
            if (bVar.aa() != 0) {
                sb.append("&begin=").append(0);
            } else {
                sb.append("&begin=").append(1);
            }
            String sb2 = sb.toString();
            if (com.qihoo360.mobilesafe.a.a.f5313a) {
                bk.b("StatHelper", "appendDownloadParams = " + sb2);
            }
            return sb2;
        }
        i2 = 1;
        sb.append("&at=").append(i2);
        s = bVar.s();
        if (s != null) {
            sb.append("&ref=").append(s);
            bVar.h(Config.INVALID_IP);
            if (!(bVar instanceof Wallpaper)) {
            }
            if (!TextUtils.isEmpty(bVar.t())) {
            }
        }
        if (bVar.i() >= 0) {
        }
        if (bVar.aa() != 0) {
        }
        String sb22 = sb.toString();
        if (com.qihoo360.mobilesafe.a.a.f5313a) {
        }
        return sb22;
    }

    public static String a(String str) {
        try {
            if (str.startsWith("javascript:") || TextUtils.isEmpty(str)) {
                return str;
            }
            String str2 = str.contains("?") ? str.contains("fm=") ? str + b(str) : str + "&fm=" + MainActivity.g() + b(str) : str + "?fm=" + MainActivity.g() + b(str);
            try {
                if (com.qihoo360.mobilesafe.a.a.f5313a) {
                    bk.b("StatHelper", "genStatUrlForType2 = " + str2);
                }
                if (!str2.contains("&ui_version")) {
                    str2 = str2 + "&ui_version=v2";
                }
                return str2;
            } catch (Exception e2) {
                return str2;
            }
        } catch (Exception e3) {
            return str;
        }
    }

    public static String a(String str, com.qihoo.appstore.e.a.b bVar, int i2) {
        if (i2 >= 1) {
            return str;
        }
        try {
            String str2 = "http://res.qhsetup.com/360baohe/download.php?resurl=" + URLEncoder.encode(str) + a(bVar);
            if (com.qihoo.appstore.notification.b.d && com.qihoo.appstore.notification.b.f2869b != 0) {
                str2 = str2 + "&tid=" + com.qihoo.appstore.notification.b.f2869b;
            }
            if (com.qihoo360.mobilesafe.a.a.f5313a) {
                bk.b("StatHelper", "getDownloadUrl = " + str2);
            }
            return str2;
        } catch (Exception e2) {
            return str;
        }
    }

    public static String a(String str, String str2) {
        return a(str, str2, false);
    }

    public static String a(String str, String str2, boolean z) {
        try {
            String str3 = (str.contains("?") ? str + "&fm=" + str2 + b(str) : str + "?fm=" + str2 + b(str)) + dc.f;
            if (z) {
                str3 = str3 + "&snt=" + b();
            }
            if (com.qihoo360.mobilesafe.a.a.f5313a) {
                bk.b("StatHelper", "genStatUrlForType1 = " + str3);
            }
            return str3;
        } catch (Exception e2) {
            return str;
        }
    }

    public static void a(Context context) {
        try {
            f3208a = URLEncoder.encode(Build.MODEL);
            l = URLEncoder.encode(Build.BRAND);
            f3209b = aw.a(((TelephonyManager) context.getSystemService("phone")).getDeviceId());
            m = Build.VERSION.SDK_INT;
            c = URLEncoder.encode(de.f(context));
            Display defaultDisplay = ((WindowManager) context.getSystemService("window")).getDefaultDisplay();
            d = a(defaultDisplay.getWidth(), defaultDisplay.getHeight());
            e = de.i(context);
            f = ai.a(context);
            g = ai.b(context);
            h = ai.a();
            i = ai.b();
            j = URLEncoder.encode(ah.a(context), "utf-8");
            j = TextUtils.isEmpty(j) ? Config.INVALID_IP : j;
            k = String.valueOf(com.qihoo360.b.a.a.a(context));
            n = de.A(context);
        } catch (Exception e2) {
        }
    }

    public static void a(Context context, App app) {
        AppStoreApplication.a(new h(context, app));
    }

    public static int b() {
        return com.qihoo.appstore.http.netconfig.c.b().a().b();
    }

    private static String b(Context context) {
        if (c == null) {
            a(AppStoreApplication.d());
        }
        StringBuilder sb = new StringBuilder();
        if (AppStoreApplication.d().a()) {
            sb.append("&st=").append(g);
        }
        com.qihoo.express.mini.c.a.a().b("entershow_update_tip", true);
        sb.append("&m=").append(f3209b).append("&m2=").append(f).append("&md=").append(f3208a).append("&br=").append(l).append("&sk=").append(m).append("&v=").append(c).append("&ppi=").append(d).append("&nt=").append(a()).append("&re=").append(f.f3207a).append("&ch=").append(e);
        String sb2 = sb.toString();
        if (com.qihoo360.mobilesafe.a.a.f5313a) {
            bk.b("StatHelper", "appendUpgradeParams = " + sb2);
        }
        return sb2;
    }

    public static String b(String str) {
        if (c == null) {
            a(AppStoreApplication.d());
        }
        StringBuilder sb = new StringBuilder();
        if (AppStoreApplication.d().a()) {
            sb.append("&st=").append(g);
        }
        if (!str.contains("&m=")) {
            sb.append("&m=").append(f3209b);
        }
        if (!str.contains("&m2=")) {
            sb.append("&m2=").append(f);
        }
        if (!str.contains("&v=")) {
            sb.append("&v=").append(c);
        }
        if (!str.contains("&re=")) {
            sb.append("&re=").append(f.f3207a);
        }
        if (!str.contains("&ch=")) {
            sb.append("&ch=").append(e);
        }
        if (!str.contains("&os=")) {
            sb.append(dc.f3812b);
        }
        if (!str.contains("model=")) {
            sb.append("&").append(dc.e);
        }
        if (!str.contains("ppi=")) {
            sb.append("&ppi=").append(d);
        }
        String sb2 = sb.toString();
        if (com.qihoo360.mobilesafe.a.a.f5313a) {
            bk.b("StatHelper", "appendPageViewParams = " + sb2);
        }
        return sb2;
    }

    public static String c() {
        if (f3209b == null) {
            a(AppStoreApplication.d());
        }
        return f3209b;
    }

    public static String c(String str) {
        String str2;
        String str3;
        if (str == null) {
            return null;
        }
        try {
            Uri parse = Uri.parse(str);
            if (str != null) {
                str2 = "csid";
                try {
                    str3 = parse.getQueryParameter("csid");
                } catch (Exception e2) {
                    str3 = null;
                }
            } else {
                str2 = null;
                str3 = null;
            }
            if (str3 == null) {
                try {
                    str2 = "cid";
                    str3 = parse.getQueryParameter("cid");
                } catch (Exception e3) {
                }
            }
            if (str3 == null) {
                str2 = "cid";
                if (str.contains("/cid/")) {
                    String substring = str.substring(str.indexOf("/cid/") + 5);
                    str3 = substring.substring(0, substring.indexOf("/"));
                }
            }
        } catch (Exception e4) {
            str2 = null;
            str3 = null;
        }
        if (str3 != null) {
            return str2 + str3;
        }
        return null;
    }

    public static String d() {
        if (f == null) {
            a(AppStoreApplication.d());
        }
        return f;
    }

    public static String d(String str) {
        try {
            if (c == null) {
                a(MainActivity.e());
            }
            StringBuilder sb = new StringBuilder();
            sb.append(str);
            if (!str.contains("&m=")) {
                sb.append("&m=").append(f3209b);
            }
            if (!str.contains("&m2=")) {
                sb.append("&m2=").append(f);
            }
            if (!str.contains("&v=")) {
                sb.append("&v=").append(c);
            }
            if (!str.contains("&re=")) {
                sb.append("&re=").append(f.f3207a);
            }
            if (!str.contains("&nt=")) {
                sb.append("&nt=").append(a());
            }
            if (!str.contains("&ch=")) {
                sb.append("&ch=").append(e);
            }
            if (com.qihoo.appstore.notification.b.f2869b != 0) {
                sb.append("&tid=").append(com.qihoo.appstore.notification.b.f2869b);
            }
            String sb2 = sb.toString();
            bk.b("StatHelper", "getMusicPvUrl = " + sb2);
            return sb2;
        } catch (Exception e2) {
            return str;
        }
    }

    public static String e() {
        if (c == null) {
            a(AppStoreApplication.d());
        }
        StringBuilder sb = new StringBuilder();
        sb.append("&m=").append(f3209b).append("&m2=").append(f).append("&v=").append(c).append("&nt=").append(a()).append("&ch=").append(e);
        return sb.toString();
    }

    public static String f() {
        if (f3208a == null) {
            a(AppStoreApplication.d());
        }
        return f3208a;
    }

    public static String g() {
        if (d == null) {
            a(AppStoreApplication.d());
        }
        return d;
    }
}