diff --git a/app/src/main/java/com/vector/appupdatedemo/MainActivity.java b/app/src/main/java/com/vector/appupdatedemo/MainActivity.java index 195bd82..17384b7 100644 --- a/app/src/main/java/com/vector/appupdatedemo/MainActivity.java +++ b/app/src/main/java/com/vector/appupdatedemo/MainActivity.java @@ -254,7 +254,7 @@ protected UpdateAppBean parseJson(String json) { //更新内容 .setUpdate_log(jsonObject.getString("update_log")) //是否强制更新 - .setConstraint(jsonObject.getBoolean("constraint")); + .setConstraint(true); } catch (JSONException e) { e.printStackTrace(); } diff --git a/update-app/build.gradle b/update-app/build.gradle index abe161a..41b01a9 100644 --- a/update-app/build.gradle +++ b/update-app/build.gradle @@ -41,7 +41,7 @@ publish { userOrg = 'qianwen'//bintray.com用户名 groupId = 'com.qianwen'//jcenter上的路径 artifactId = 'update-app'//项目名称 - publishVersion = '3.2.3'//版本号 + publishVersion = '3.2.4'//版本号 desc = 'App update tools' website = 'https://github.com/WVector/AppUpdateDemo' } diff --git a/update-app/src/main/AndroidManifest.xml b/update-app/src/main/AndroidManifest.xml index 09ca299..940d37a 100644 --- a/update-app/src/main/AndroidManifest.xml +++ b/update-app/src/main/AndroidManifest.xml @@ -11,7 +11,6 @@ diff --git a/update-app/src/main/java/com/vector/update_app/DialogActivity.java b/update-app/src/main/java/com/vector/update_app/DialogActivity.java index 4de6fad..6c07fa3 100644 --- a/update-app/src/main/java/com/vector/update_app/DialogActivity.java +++ b/update-app/src/main/java/com/vector/update_app/DialogActivity.java @@ -1,6 +1,7 @@ package com.vector.update_app; import android.content.ComponentName; +import android.content.Intent; import android.content.ServiceConnection; import android.graphics.Color; import android.os.Bundle; @@ -246,7 +247,10 @@ public void onBackPressed() { //禁用 if (mUpdateApp != null && mUpdateApp.isConstraint()) { // ActManager.getInstance().finishAllActivity(); - android.os.Process.killProcess(android.os.Process.myPid()); +// android.os.Process.killProcess(android.os.Process.myPid()); + //返回桌面 + startActivity(new Intent(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_HOME)); + return; } super.onBackPressed(); }