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

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


package com.qihoo.appstore.e.b;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Random;
import org.apache.http.client.methods.HttpGet;

public class g {

    static HashMap f1456a = new HashMap();

    static String[] f1457b = {"220.181.141.113", "220.181.141.114", "119.188.2.235", "119.188.2.236"};
    static int c = -1;

    public static String a(String str, b bVar) {
        ArrayList arrayList = (ArrayList) f1456a.get(str);
        if (arrayList == null) {
            try {
                String a2 = a(f1457b[(c + 1) % f1457b.length], str, bVar);
                String[] split = a2.substring(a2.indexOf(":") + 1).split(",");
                arrayList = new ArrayList();
                for (String str2 : split) {
                    arrayList.add(str2);
                }
                synchronized (f1456a) {
                    f1456a.put(str, arrayList);
                }
            } catch (Exception e) {
                c++;
                return null;
            }
        }
        return (String) arrayList.get(new Random().nextInt(arrayList.size()));
    }

    private static String a(String str, String str2, b bVar) {
        try {
            HttpGet httpGet = new HttpGet("http://" + str + "/index.html");
            httpGet.addHeader("Host", str);
            httpGet.addHeader("DPUName", str2);
            httpGet.addHeader("Cache-Control", "no-cache");
            httpGet.addHeader("User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1), 360appstore");
            httpGet.addHeader("Connection", "Close");
            BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(bVar.execute(httpGet).getEntity().getContent()));
            StringBuilder sb = new StringBuilder();
            while (true) {
                String readLine = bufferedReader.readLine();
                if (readLine == null) {
                    bufferedReader.close();
                    return sb.toString();
                }
                sb.append(readLine);
            }
        } catch (Exception e) {
            return null;
        }
    }
}