支持取消下载

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>
<groupId>com.king.app</groupId>
<artifactId>app-updater</artifactId>
<version>1.0.4</version>
<version>1.0.5</version>
<type>pom</type>
</dependency>
@ -48,7 +48,7 @@ AppUpdater for Android 是一个专注于App更新,一键傻瓜式集成App版
<dependency>
<groupId>com.king.app</groupId>
<artifactId>app-dialog</artifactId>
<version>1.0.4</version>
<version>1.0.5</version>
<type>pom</type>
</dependency>
```
@ -57,25 +57,25 @@ AppUpdater for Android 是一个专注于App更新,一键傻瓜式集成App版
//----------AndroidX 版本
//app-updater
implementation 'com.king.app:app-updater:1.0.4-androidx'
implementation 'com.king.app:app-updater:1.0.5-androidx'
//app-dialog
implementation 'com.king.app:app-dialog:1.0.4-androidx'
implementation 'com.king.app:app-dialog:1.0.5-androidx'
//----------Android 版本
//app-updater
implementation 'com.king.app:app-updater:1.0.4'
implementation 'com.king.app:app-updater:1.0.5'
//app-dialog
implementation 'com.king.app:app-dialog:1.0.4'
implementation 'com.king.app:app-dialog:1.0.5'
```
### Lvy:
```lvy
//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>
</dependency>
//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>
</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)
* 支持添加请求头
@ -174,6 +177,8 @@ AppUpdater for Android 是一个专注于App更新,一键傻瓜式集成App版
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>
加入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){
dismissDialogFragment(fragmentManager,mTag);
mTag = null;
}
public void dismissDialogFragment(FragmentManager fragmentManager,String tag){

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

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

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

@ -102,7 +102,7 @@ public enum AppUtils {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.addCategory(Intent.CATEGORY_DEFAULT);
Uri uriData = null;
Uri uriData;
String type = "application/vnd.android.package-archive";
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.N){
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
def app_version = [:]
app_version.versionCode = 5 //androidx 6
app_version.versionName = "1.0.4"
app_version.versionCode = 7 //androidx 8
app_version.versionName = "1.0.5"
ext.app_version = app_version
//build version

Loading…
Cancel
Save