From d6993eb1598bec8d750b00e6b146c3b012f17ed6 Mon Sep 17 00:00:00 2001 From: laoyuyu <511455842@qq.com> Date: Fri, 1 Nov 2019 21:20:07 +0800 Subject: [PATCH] fix bug https://github.com/AriaLyy/Aria/issues/495 fix bug https://github.com/AriaLyy/Aria/issues/496 --- .../com/arialyy/aria/core/AriaManager.java | 2 +- DEV_LOG.md | 7 +++- .../com/arialyy/aria/core/AriaConfig.java | 2 ++ .../aria/core/manager/ThreadTaskManager.java | 2 +- .../java/com/arialyy/aria/orm/SqlUtil.java | 4 ++- .../com/arialyy/aria/util/CommonUtil.java | 10 ++++++ README.md | 36 ++++++------------- .../core/download/HttpDownloadModule.java | 3 +- .../core/download/SingleTaskActivity.java | 4 +-- .../core/download/mutil/DownloadAdapter.java | 24 ++++++++++++- .../download/mutil/MultiDownloadActivity.java | 3 ++ .../download/mutil/MultiTaskActivity.java | 3 ++ build.gradle | 4 +-- 13 files changed, 69 insertions(+), 35 deletions(-) diff --git a/Aria/src/main/java/com/arialyy/aria/core/AriaManager.java b/Aria/src/main/java/com/arialyy/aria/core/AriaManager.java index dc988c96..be47804d 100644 --- a/Aria/src/main/java/com/arialyy/aria/core/AriaManager.java +++ b/Aria/src/main/java/com/arialyy/aria/core/AriaManager.java @@ -401,7 +401,7 @@ import java.util.concurrent.ConcurrentHashMap; return false; } else { String parentName = parentClass.getName(); - if (mFragmentClassName.contains(parentName)) { + if (mDialogFragmentClassName.contains(parentName)) { return true; } else { return isDialogFragment(parentClass); diff --git a/DEV_LOG.md b/DEV_LOG.md index a8bc96af..627fe4bb 100644 --- a/DEV_LOG.md +++ b/DEV_LOG.md @@ -1,5 +1,10 @@ ## 开发日志 - + v_3.7 + + v_3.7.4 + - 修复一个class被莫名改变的问题 + + v_3.7.3 (2019/10/31) + - fix bug https://github.com/AriaLyy/Aria/issues/495 + - fix bug https://github.com/AriaLyy/Aria/issues/496 + + v_3.7.2 (2019/10/28) - fix bug https://github.com/AriaLyy/Aria/issues/450 - fix bug https://github.com/AriaLyy/Aria/issues/466 - fix bug https://github.com/AriaLyy/Aria/issues/454 diff --git a/PublicComponent/src/main/java/com/arialyy/aria/core/AriaConfig.java b/PublicComponent/src/main/java/com/arialyy/aria/core/AriaConfig.java index 3676ca51..cfe73566 100644 --- a/PublicComponent/src/main/java/com/arialyy/aria/core/AriaConfig.java +++ b/PublicComponent/src/main/java/com/arialyy/aria/core/AriaConfig.java @@ -43,6 +43,8 @@ public class AriaConfig { public static final String DOWNLOAD_TEMP_DIR = "/Aria/temp/download/"; public static final String UPLOAD_TEMP_DIR = "/Aria/temp/upload/"; + public static final String IGNORE_CLASS_KLASS = "shadow$_klass_"; + public static final String IGNORE_CLASS_MONITOR = "shadow$_monitor_"; private static volatile AriaConfig Instance; private static Context APP; diff --git a/PublicComponent/src/main/java/com/arialyy/aria/core/manager/ThreadTaskManager.java b/PublicComponent/src/main/java/com/arialyy/aria/core/manager/ThreadTaskManager.java index 75a28cbd..24b83aa1 100644 --- a/PublicComponent/src/main/java/com/arialyy/aria/core/manager/ThreadTaskManager.java +++ b/PublicComponent/src/main/java/com/arialyy/aria/core/manager/ThreadTaskManager.java @@ -48,7 +48,7 @@ public class ThreadTaskManager { } private ThreadTaskManager() { - mExePool = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors()); + mExePool = Executors.newCachedThreadPool(); } /** diff --git a/PublicComponent/src/main/java/com/arialyy/aria/orm/SqlUtil.java b/PublicComponent/src/main/java/com/arialyy/aria/orm/SqlUtil.java index 5e9116a7..0dea4c5d 100644 --- a/PublicComponent/src/main/java/com/arialyy/aria/orm/SqlUtil.java +++ b/PublicComponent/src/main/java/com/arialyy/aria/orm/SqlUtil.java @@ -16,6 +16,7 @@ package com.arialyy.aria.orm; import android.text.TextUtils; +import com.arialyy.aria.core.AriaConfig; import com.arialyy.aria.orm.annotation.Default; import com.arialyy.aria.orm.annotation.Foreign; import com.arialyy.aria.orm.annotation.Ignore; @@ -178,7 +179,8 @@ final class SqlUtil { int modifiers = field.getModifiers(); String fieldName = field.getName(); return (ignore != null && ignore.value()) || fieldName.equals("rowID") || fieldName.equals( - "shadow$_klass_") || fieldName.equals("shadow$_monitor_") || field.isSynthetic() || Modifier + AriaConfig.IGNORE_CLASS_KLASS) || fieldName.equals(AriaConfig.IGNORE_CLASS_MONITOR) + || field.isSynthetic() || Modifier .isStatic(modifiers) || Modifier.isFinal(modifiers); } diff --git a/PublicComponent/src/main/java/com/arialyy/aria/util/CommonUtil.java b/PublicComponent/src/main/java/com/arialyy/aria/util/CommonUtil.java index cbf97a57..07eb8088 100644 --- a/PublicComponent/src/main/java/com/arialyy/aria/util/CommonUtil.java +++ b/PublicComponent/src/main/java/com/arialyy/aria/util/CommonUtil.java @@ -626,6 +626,16 @@ public class CommonUtil { Collections.addAll(fields, personClazz.getDeclaredFields()); } Collections.addAll(fields, clazz.getDeclaredFields()); + List ignore = new ArrayList<>(); + for (Field field : fields) { + if (field.getName().equals(AriaConfig.IGNORE_CLASS_KLASS) || field.getName() + .equals(AriaConfig.IGNORE_CLASS_MONITOR)) { + ignore.add(field); + } + } + if (!ignore.isEmpty()){ + fields.removeAll(ignore); + } return fields; } diff --git a/README.md b/README.md index 1bc30f4c..5bb590a1 100644 --- a/README.md +++ b/README.md @@ -44,16 +44,16 @@ Aria有以下特点: ## 引入库 [![license](http://img.shields.io/badge/license-Apache2.0-brightgreen.svg?style=flat)](https://github.com/AriaLyy/Aria/blob/master/LICENSE) -[![Core](https://img.shields.io/badge/Core-3.7.2-blue)](https://github.com/AriaLyy/Aria) -[![Compiler](https://img.shields.io/badge/Compiler-3.7.2-blue)](https://github.com/AriaLyy/Aria) -[![FtpComponent](https://img.shields.io/badge/FtpComponent-3.7.2-orange)](https://github.com/AriaLyy/Aria) -[![M3U8Component](https://img.shields.io/badge/M3U8Component-3.7.2-orange)](https://github.com/AriaLyy/Aria) +[![Core](https://img.shields.io/badge/Core-3.7.3-blue)](https://github.com/AriaLyy/Aria) +[![Compiler](https://img.shields.io/badge/Compiler-3.7.3-blue)](https://github.com/AriaLyy/Aria) +[![FtpComponent](https://img.shields.io/badge/FtpComponent-3.7.3-orange)](https://github.com/AriaLyy/Aria) +[![M3U8Component](https://img.shields.io/badge/M3U8Component-3.7.3-orange)](https://github.com/AriaLyy/Aria) ```java -implementation 'com.arialyy.aria:core:3.7.2' -annotationProcessor 'com.arialyy.aria:compiler:3.7.2' -implementation 'com.arialyy.aria:ftpComponent:3.7.2' # 如果需要使用ftp,请增加该组件 -implementation 'com.arialyy.aria:m3u8Component:3.7.2' # 如果需要使用m3u8下载功能,请增加该组件 +implementation 'com.arialyy.aria:core:3.7.3' +annotationProcessor 'com.arialyy.aria:compiler:3.7.3' +implementation 'com.arialyy.aria:ftpComponent:3.7.3' # 如果需要使用ftp,请增加该组件 +implementation 'com.arialyy.aria:m3u8Component:3.7.3' # 如果需要使用m3u8下载功能,请增加该组件 ``` 如果出现android support依赖错误,请将 `compile 'com.arialyy.aria:aria-core:'`替换为 ``` @@ -137,23 +137,9 @@ protected void onCreate(Bundle savedInstanceState) { ### 版本日志 - + v_3.7 - - fix bug https://github.com/AriaLyy/Aria/issues/450 - - fix bug https://github.com/AriaLyy/Aria/issues/466 - - fix bug https://github.com/AriaLyy/Aria/issues/454 - - fix bug https://github.com/AriaLyy/Aria/issues/467 - - fix bug https://github.com/AriaLyy/Aria/issues/459 - - fix bug https://github.com/AriaLyy/Aria/issues/487 - - fix bug https://github.com/AriaLyy/Aria/issues/483 - - fix bug https://github.com/AriaLyy/Aria/issues/482 - - fix bug https://github.com/AriaLyy/Aria/issues/473 - - 移除隐藏api的反射 https://github.com/AriaLyy/Aria/issues/456 - - 新增ftp免证书登陆功能h ttps://github.com/AriaLyy/Aria/issues/455 - - 适配androidX - - 修复组合任务,恢复下载,会出现进度显示为0的问题 - - m3u8点播下载新增创建ts索引功能 - - 修复多任务的m3u8点播下载时,一个任务调用`jumpIndex`,其它m3u8任务也会自动调用`jumpIndex`的问题 - - 添加权限检查 + + v_3.7.3 + - fix bug https://github.com/AriaLyy/Aria/issues/495 + - fix bug https://github.com/AriaLyy/Aria/issues/496 [更多版本记录](https://github.com/AriaLyy/Aria/blob/master/DEV_LOG.md) diff --git a/app/src/main/java/com/arialyy/simple/core/download/HttpDownloadModule.java b/app/src/main/java/com/arialyy/simple/core/download/HttpDownloadModule.java index dd449cb9..19bfc6db 100644 --- a/app/src/main/java/com/arialyy/simple/core/download/HttpDownloadModule.java +++ b/app/src/main/java/com/arialyy/simple/core/download/HttpDownloadModule.java @@ -47,9 +47,10 @@ public class HttpDownloadModule extends BaseViewModule { * 单任务下载的信息 */ LiveData getHttpDownloadInfo(Context context) { - String url = AppUtil.getConfigValue(context, HTTP_URL_KEY, defUrl); + //String url = AppUtil.getConfigValue(context, HTTP_URL_KEY, defUrl); //String url = // "http://sdkdown.muzhiwan.com/openfile/2019/05/21/com.netease.tom.mzw_5ce3ef8754d05.apk"; + String url = "http://image.totwoo.com/totwoo-TOTWOO-v3.5.6.apk"; String filePath = AppUtil.getConfigValue(context, HTTP_PATH_KEY, defFilePath); singDownloadInfo = Aria.download(context).getFirstDownloadEntity(url); diff --git a/app/src/main/java/com/arialyy/simple/core/download/SingleTaskActivity.java b/app/src/main/java/com/arialyy/simple/core/download/SingleTaskActivity.java index 1bc32a7f..64c0b12c 100644 --- a/app/src/main/java/com/arialyy/simple/core/download/SingleTaskActivity.java +++ b/app/src/main/java/com/arialyy/simple/core/download/SingleTaskActivity.java @@ -289,8 +289,8 @@ public class SingleTaskActivity extends BaseActivity { private void startD() { HttpOption option = new HttpOption(); option.addHeader("1", "@") - .setFileLenAdapter(new FileLenAdapter()) - .useServerFileName(true); + .useServerFileName(true) + .setFileLenAdapter(new FileLenAdapter()); mTaskId = Aria.download(SingleTaskActivity.this) .load(mUrl) .setFilePath(mFilePath, true) diff --git a/app/src/main/java/com/arialyy/simple/core/download/mutil/DownloadAdapter.java b/app/src/main/java/com/arialyy/simple/core/download/mutil/DownloadAdapter.java index f59fb5d6..ef05d29a 100644 --- a/app/src/main/java/com/arialyy/simple/core/download/mutil/DownloadAdapter.java +++ b/app/src/main/java/com/arialyy/simple/core/download/mutil/DownloadAdapter.java @@ -257,7 +257,11 @@ public class DownloadAdapter extends AbsRVAdapter { } @Download.onTaskFail void taskFail(DownloadTask task) { + if (task == null || task.getEntity() == null){ + return; + } mAdapter.updateBtState(task.getKey(), true); } diff --git a/build.gradle b/build.gradle index 5591b15f..69b9f7bf 100644 --- a/build.gradle +++ b/build.gradle @@ -44,8 +44,8 @@ task clean(type: Delete) { } ext { - versionCode = 372 - versionName = '3.7.2' + versionCode = 373 + versionName = '3.7.3' userOrg = 'arialyy' groupId = 'com.arialyy.aria' publishVersion = versionName