"">
- String jsonStr = HttpUtils.doHttpPost(patchConfigUrl,null);
+ if(patchConfigUrl.contains("?")){
+ patchConfigUrl+="&platform=android";
+ }else{
+ patchConfigUrl+="?platform=android";
+ }
+ patchConfigUrl+="&version="+ BuildConfig.VERSION_NAME;
+ patchConfigUrl+="&channel="+"guanwang";
+ HashMap<String,String> httpParams = new HashMap<>();
+ httpParams.put("src","0");
+ String jsonStr = HttpUtils.doHttpPost(patchConfigUrl,httpParams);
try{
JSONObject response = new JSONObject(jsonStr);
- md5 = response.getString("md5");
- return response.getString("patch_url");
+ JSONObject data = response.getJSONObject("data");
+ patchUrl = data.getString("patch_url");
+ return patchUrl;
}catch (Exception e){
e.printStackTrace();
}
@@ -33,7 +45,7 @@ public class PatchManager extends IPatchManager{
@Override
protected boolean isNewPatchFound() {
- if(!Preferences.getInstance(context).getPatchMD5().equals(md5)){
+ if(!Preferences.getInstance(context).getPatchUrl().equals(patchUrl)){
return true;
}
if(!new File(patchSavePath).exists()){
@@ -44,6 +56,6 @@ public class PatchManager extends IPatchManager{
@Override
protected void afterPatchSuccess() {
- Preferences.getInstance(context).setPatchMD5(md5);
+ Preferences.getInstance(context).setPatchUrl(patchUrl);
}
}
@@ -86,5 +86,5 @@ public class UrlContainer {
|
||
| 86 | 86 |
|
| 87 | 87 |
public static final String TOUR_INFO_URL = HOST_URL +"pai2/tginfo"; |
| 88 | 88 |
|
| 89 |
- public static final String PATCH_CONFIG_URL = HOST_URL+"patch"; |
|
| 89 |
+ public static final String PATCH_CONFIG_URL = HOST_URL+"op/patch"; |
|
| 90 | 90 |
} |