支持取消下载

android 1.0.5
jenly1314 5 years ago
parent 62210f4b88
commit bd74ae12ce
  1. 21
      README.md
  2. 1
      app-dialog/src/main/java/com/king/app/dialog/AppDialog.java
  3. 2
      app-updater/src/main/java/com/king/app/updater/AppUpdater.java
  4. 4
      app-updater/src/main/java/com/king/app/updater/http/HttpManager.java
  5. 1
      app-updater/src/main/java/com/king/app/updater/service/DownloadService.java
  6. 2
      app-updater/src/main/java/com/king/app/updater/util/AppUtils.java
  7. BIN
      app/release/app-release.apk
  8. 2
      app/release/output.json
  9. 4
      versions.gradle

@ -40,7 +40,7 @@ AppUpdater for Android 是一个专注于App更新,一键傻瓜式集成App版
<dependency> <dependency>
<groupId>com.king.app</groupId> <groupId>com.king.app</groupId>
<artifactId>app-updater</artifactId> <artifactId>app-updater</artifactId>
<version>1.0.4</version> <version>1.0.5</version>
<type>pom</type> <type>pom</type>
</dependency> </dependency>
@ -48,7 +48,7 @@ AppUpdater for Android 是一个专注于App更新,一键傻瓜式集成App版
<dependency> <dependency>
<groupId>com.king.app</groupId> <groupId>com.king.app</groupId>
<artifactId>app-dialog</artifactId> <artifactId>app-dialog</artifactId>
<version>1.0.4</version> <version>1.0.5</version>
<type>pom</type> <type>pom</type>
</dependency> </dependency>
``` ```
@ -57,25 +57,25 @@ AppUpdater for Android 是一个专注于App更新,一键傻瓜式集成App版
//----------AndroidX 版本 //----------AndroidX 版本
//app-updater //app-updater
implementation 'com.king.app:app-updater:1.0.4-androidx' implementation 'com.king.app:app-updater:1.0.5-androidx'
//app-dialog //app-dialog
implementation 'com.king.app:app-dialog:1.0.4-androidx' implementation 'com.king.app:app-dialog:1.0.5-androidx'
//----------Android 版本 //----------Android 版本
//app-updater //app-updater
implementation 'com.king.app:app-updater:1.0.4' implementation 'com.king.app:app-updater:1.0.5'
//app-dialog //app-dialog
implementation 'com.king.app:app-dialog:1.0.4' implementation 'com.king.app:app-dialog:1.0.5'
``` ```
### Lvy: ### Lvy:
```lvy ```lvy
//app-updater //app-updater
<dependency org='com.king.app' name='app-dialog' rev='1.0.4'> <dependency org='com.king.app' name='app-dialog' rev='1.0.5'>
<artifact name='$AID' ext='pom'></artifact> <artifact name='$AID' ext='pom'></artifact>
</dependency> </dependency>
//app-dialog //app-dialog
<dependency org='com.king.app' name='app-dialog' rev='1.0.4'> <dependency org='com.king.app' name='app-dialog' rev='1.0.5'>
<artifact name='$AID' ext='pom'></artifact> <artifact name='$AID' ext='pom'></artifact>
</dependency> </dependency>
``` ```
@ -140,6 +140,9 @@ AppUpdater for Android 是一个专注于App更新,一键傻瓜式集成App版
## 版本记录 ## 版本记录
#### v1.0.5:2019-9-4
* 支持取消下载
#### v1.0.4:2019-6-4 [支持AndroidX版本](https://github.com/jenly1314/AppUpdater/tree/androidx) #### v1.0.4:2019-6-4 [支持AndroidX版本](https://github.com/jenly1314/AppUpdater/tree/androidx)
* 支持添加请求头 * 支持添加请求头
@ -174,6 +177,8 @@ AppUpdater for Android 是一个专注于App更新,一键傻瓜式集成App版
CSDN: <a title="CSDN博客" href="http://blog.csdn.net/jenly121" target="_blank">jenly121</a> CSDN: <a title="CSDN博客" href="http://blog.csdn.net/jenly121" target="_blank">jenly121</a>
博客园: <a title="博客园" href="https://www.cnblogs.com/jenly" target="_blank">jenly</a>
Github: <a title="Github开源项目" href="https://github.com/jenly1314" target="_blank">jenly1314</a> Github: <a title="Github开源项目" href="https://github.com/jenly1314" target="_blank">jenly1314</a>
加入QQ群: <a title="点击加入QQ群" href="http://shang.qq.com/wpa/qunwpa?idkey=8fcc6a2f88552ea44b1411582c94fd124f7bb3ec227e2a400dbbfaad3dc2f5ad" target="_blank">20867961</a> 加入QQ群: <a title="点击加入QQ群" href="http://shang.qq.com/wpa/qunwpa?idkey=8fcc6a2f88552ea44b1411582c94fd124f7bb3ec227e2a400dbbfaad3dc2f5ad" target="_blank">20867961</a>

@ -86,6 +86,7 @@ public enum AppDialog {
public void dismissDialogFragment(FragmentManager fragmentManager){ public void dismissDialogFragment(FragmentManager fragmentManager){
dismissDialogFragment(fragmentManager,mTag); dismissDialogFragment(fragmentManager,mTag);
mTag = null;
} }
public void dismissDialogFragment(FragmentManager fragmentManager,String tag){ public void dismissDialogFragment(FragmentManager fragmentManager,String tag){

@ -112,7 +112,7 @@ public class AppUpdater {
} }
/** /**
* 停止 * 取消下载
*/ */
public void stop(){ public void stop(){
stopDownloadService(); stopDownloadService();

@ -141,10 +141,6 @@ public class HttpManager implements IHttpManager {
connect.disconnect(); connect.disconnect();
if(isCancelled()){
return null;
}
return file; return file;
}else {//连接失败 }else {//连接失败
throw new ConnectException(String.format("responseCode = %d",responseCode)); throw new ConnectException(String.format("responseCode = %d",responseCode));

@ -350,6 +350,7 @@ public class DownloadService extends Service {
@Override @Override
public void onDestroy() { public void onDestroy() {
isDownloading = false; isDownloading = false;
mHttpManager = null;
super.onDestroy(); super.onDestroy();
} }

@ -102,7 +102,7 @@ public enum AppUtils {
Intent intent = new Intent(Intent.ACTION_VIEW); Intent intent = new Intent(Intent.ACTION_VIEW);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.addCategory(Intent.CATEGORY_DEFAULT); intent.addCategory(Intent.CATEGORY_DEFAULT);
Uri uriData = null; Uri uriData;
String type = "application/vnd.android.package-archive"; String type = "application/vnd.android.package-archive";
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.N){ if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.N){
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);

Binary file not shown.

@ -1 +1 @@
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":5,"versionName":"1.0.4","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}] [{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":7,"versionName":"1.0.5","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]

@ -1,7 +1,7 @@
//App //App
def app_version = [:] def app_version = [:]
app_version.versionCode = 5 //androidx 6 app_version.versionCode = 7 //androidx 8
app_version.versionName = "1.0.4" app_version.versionName = "1.0.5"
ext.app_version = app_version ext.app_version = app_version
//build version //build version

Loading…
Cancel
Save