更换检查更新接口和控制下载按钮状态接口
This commit is contained in:
@ -162,7 +162,7 @@ public class MainActivity extends BaseFragmentActivity implements OnClickListene
|
||||
if (downloadEntity.getName().contains("光环助手")) {
|
||||
DataUtils.onEvent(MainActivity.this, "软件更新", "下载完成");
|
||||
startActivity(PackageUtils.getInstallIntent(downloadEntity.getPath()));
|
||||
if (appEntity != null && appEntity.isIs_force()) {
|
||||
if (appEntity != null && appEntity.isForce()) {
|
||||
finish();
|
||||
}
|
||||
} else {
|
||||
@ -316,6 +316,7 @@ public class MainActivity extends BaseFragmentActivity implements OnClickListene
|
||||
getPackageName(), "TD_CHANNEL_ID");
|
||||
map.put("version", version);
|
||||
map.put("user", user);
|
||||
map.put("device_id", TokenUtils.getDeviceId(this));
|
||||
map.put("channel", channel);
|
||||
String url = "http://data.ghzhushou.com/api/v1d0/log";
|
||||
Map<String, String> params = new HashMap<>();
|
||||
@ -1029,7 +1030,7 @@ public class MainActivity extends BaseFragmentActivity implements OnClickListene
|
||||
|
||||
private void checkUpdate() {
|
||||
String TD_CHANNEL_ID = (String) PackageUtils.getMetaData(this, getPackageName(), "TD_CHANNEL_ID");
|
||||
String url = Config.HOST + "v2/version?version_name=" + PackageUtils.getVersion(getApplicationContext())
|
||||
String url = Config.HOST + "v2d0/support/upgrade?version=" + PackageUtils.getVersion(getApplicationContext())
|
||||
+ "&channel=" + TD_CHANNEL_ID;
|
||||
JsonObjectExtendedRequest request = new JsonObjectExtendedRequest(url,
|
||||
new Response.Listener<JSONObject>() {
|
||||
@ -1053,12 +1054,12 @@ public class MainActivity extends BaseFragmentActivity implements OnClickListene
|
||||
PackageManager.addUpdate(0, game);
|
||||
|
||||
String updateMD5 = MD5Utils.getUpdateMD5(appEntity.getUrl(), appEntity.getContent());
|
||||
if (appEntity.isIs_force()) {
|
||||
if (appEntity.isForce()) {
|
||||
// 强制更新
|
||||
showUpdateDialog(updateMD5);
|
||||
} else {
|
||||
// 非强制更新
|
||||
if ("EVERY_TIME_OPEN".equals(appEntity.getAlet_type())) {
|
||||
if ("EVERY_TIME_OPEN".equals(appEntity.getAlert())) {
|
||||
// 每次都提示
|
||||
showUpdateDialog(updateMD5);
|
||||
} else {
|
||||
@ -1097,7 +1098,7 @@ public class MainActivity extends BaseFragmentActivity implements OnClickListene
|
||||
new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (appEntity.isIs_force()) {
|
||||
if (appEntity.isForce()) {
|
||||
finish();
|
||||
} else {
|
||||
updateDialog.dismiss();
|
||||
@ -1122,7 +1123,7 @@ public class MainActivity extends BaseFragmentActivity implements OnClickListene
|
||||
}
|
||||
});
|
||||
|
||||
if (appEntity.isIs_force()) {
|
||||
if (appEntity.isForce()) {
|
||||
updateDialog.setCanceledOnTouchOutside(false);
|
||||
updateDialog.setCancelable(false);
|
||||
}
|
||||
@ -1151,7 +1152,7 @@ public class MainActivity extends BaseFragmentActivity implements OnClickListene
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
DownloadManager.getInstance(getApplicationContext()).cancel(appEntity.getUrl());
|
||||
if (appEntity.isIs_force()) {
|
||||
if (appEntity.isForce()) {
|
||||
finish();
|
||||
} else {
|
||||
dialog.dismiss();
|
||||
|
||||
Reference in New Issue
Block a user