360手机助手 v3.3.0版本的 MD5 值为:127c345ad16bbebee6e347381328afd0
以下内容为反编译后的 UpgradeManager.java 源代码,内容仅作参考
package com.qihoo.freewifi.push.download;
import android.content.Context;
import com.qihoo.freewifi.push.utils.DeviceIDUtils;
import com.qihoo.freewifi.push.utils.HttpUtils;
import com.qihoo.freewifi.push.utils.VersionUtils;
import java.io.IOException;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpGet;
public class UpgradeManager {
private static final String UPGRADE_URL = "http://openbox.mobilem.360.cn/AppStore/getIsUpdate?pname=%s&vercode=%s&vername=%s&m2=%s&t=%s&ch=%s";
public static final String URL = "http://openbox.mobilem.360.cn/AppStore/getIsUpdate";
private static boolean isDownloading = false;
public interface BeforeDownloadHandler {
void handleMessage(int i);
}
public static DownloadApkInfo checkUpgrade(Context context, String str, String str2, String str3) {
return getDownloadInfo(context, str, VersionUtils.getVersionCode(context), VersionUtils.getVersionName(context), str2, str3);
}
public static void clearIsDownloadingStatus() {
isDownloading = false;
}
private static DownloadApkInfo getDownloadInfo(Context context, String str, int i, String str2, String str3, String str4) {
HttpResponse execute = HttpUtils.createHttpClient().execute((HttpGet) HttpUtils.createHttpRequest(context, String.format(UPGRADE_URL, str, Integer.valueOf(i), str2, DeviceIDUtils.getIMEI2(context), str3, str4), true, true));
int statusCode = execute.getStatusLine().getStatusCode();
if (200 == statusCode) {
return DownloadApkInfo.parseJson(context, HttpUtils.getResponseStream(execute));
}
if (304 == statusCode) {
return null;
}
throw new IOException("Error response status code:" + statusCode);
}
public static boolean isDownloading() {
return isDownloading;
}
public static void setIsDownloadingStatus() {
isDownloading = true;
}
}