fix bug https://github.com/AriaLyy/Aria/issues/496
This commit is contained in:
@@ -401,7 +401,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
String parentName = parentClass.getName();
|
String parentName = parentClass.getName();
|
||||||
if (mFragmentClassName.contains(parentName)) {
|
if (mDialogFragmentClassName.contains(parentName)) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return isDialogFragment(parentClass);
|
return isDialogFragment(parentClass);
|
||||||
|
|||||||
@@ -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/450
|
||||||
- fix bug https://github.com/AriaLyy/Aria/issues/466
|
- 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/454
|
||||||
|
|||||||
@@ -43,6 +43,8 @@ public class AriaConfig {
|
|||||||
|
|
||||||
public static final String DOWNLOAD_TEMP_DIR = "/Aria/temp/download/";
|
public static final String DOWNLOAD_TEMP_DIR = "/Aria/temp/download/";
|
||||||
public static final String UPLOAD_TEMP_DIR = "/Aria/temp/upload/";
|
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 volatile AriaConfig Instance;
|
||||||
private static Context APP;
|
private static Context APP;
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ public class ThreadTaskManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private ThreadTaskManager() {
|
private ThreadTaskManager() {
|
||||||
mExePool = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors());
|
mExePool = Executors.newCachedThreadPool();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
package com.arialyy.aria.orm;
|
package com.arialyy.aria.orm;
|
||||||
|
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
import com.arialyy.aria.core.AriaConfig;
|
||||||
import com.arialyy.aria.orm.annotation.Default;
|
import com.arialyy.aria.orm.annotation.Default;
|
||||||
import com.arialyy.aria.orm.annotation.Foreign;
|
import com.arialyy.aria.orm.annotation.Foreign;
|
||||||
import com.arialyy.aria.orm.annotation.Ignore;
|
import com.arialyy.aria.orm.annotation.Ignore;
|
||||||
@@ -178,7 +179,8 @@ final class SqlUtil {
|
|||||||
int modifiers = field.getModifiers();
|
int modifiers = field.getModifiers();
|
||||||
String fieldName = field.getName();
|
String fieldName = field.getName();
|
||||||
return (ignore != null && ignore.value()) || fieldName.equals("rowID") || fieldName.equals(
|
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);
|
.isStatic(modifiers) || Modifier.isFinal(modifiers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -626,6 +626,16 @@ public class CommonUtil {
|
|||||||
Collections.addAll(fields, personClazz.getDeclaredFields());
|
Collections.addAll(fields, personClazz.getDeclaredFields());
|
||||||
}
|
}
|
||||||
Collections.addAll(fields, clazz.getDeclaredFields());
|
Collections.addAll(fields, clazz.getDeclaredFields());
|
||||||
|
List<Field> 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;
|
return fields;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
36
README.md
36
README.md
@@ -44,16 +44,16 @@ Aria有以下特点:
|
|||||||
|
|
||||||
## 引入库
|
## 引入库
|
||||||
[](https://github.com/AriaLyy/Aria/blob/master/LICENSE)
|
[](https://github.com/AriaLyy/Aria/blob/master/LICENSE)
|
||||||
[](https://github.com/AriaLyy/Aria)
|
[](https://github.com/AriaLyy/Aria)
|
||||||
[](https://github.com/AriaLyy/Aria)
|
[](https://github.com/AriaLyy/Aria)
|
||||||
[](https://github.com/AriaLyy/Aria)
|
[](https://github.com/AriaLyy/Aria)
|
||||||
[](https://github.com/AriaLyy/Aria)
|
[](https://github.com/AriaLyy/Aria)
|
||||||
|
|
||||||
```java
|
```java
|
||||||
implementation 'com.arialyy.aria:core:3.7.2'
|
implementation 'com.arialyy.aria:core:3.7.3'
|
||||||
annotationProcessor 'com.arialyy.aria:compiler:3.7.2'
|
annotationProcessor 'com.arialyy.aria:compiler:3.7.3'
|
||||||
implementation 'com.arialyy.aria:ftpComponent:3.7.2' # 如果需要使用ftp,请增加该组件
|
implementation 'com.arialyy.aria:ftpComponent:3.7.3' # 如果需要使用ftp,请增加该组件
|
||||||
implementation 'com.arialyy.aria:m3u8Component:3.7.2' # 如果需要使用m3u8下载功能,请增加该组件
|
implementation 'com.arialyy.aria:m3u8Component:3.7.3' # 如果需要使用m3u8下载功能,请增加该组件
|
||||||
```
|
```
|
||||||
如果出现android support依赖错误,请将 `compile 'com.arialyy.aria:aria-core:<last-version>'`替换为
|
如果出现android support依赖错误,请将 `compile 'com.arialyy.aria:aria-core:<last-version>'`替换为
|
||||||
```
|
```
|
||||||
@@ -137,23 +137,9 @@ protected void onCreate(Bundle savedInstanceState) {
|
|||||||
|
|
||||||
|
|
||||||
### 版本日志
|
### 版本日志
|
||||||
+ v_3.7
|
+ v_3.7.3
|
||||||
- fix bug https://github.com/AriaLyy/Aria/issues/450
|
- fix bug https://github.com/AriaLyy/Aria/issues/495
|
||||||
- fix bug https://github.com/AriaLyy/Aria/issues/466
|
- fix bug https://github.com/AriaLyy/Aria/issues/496
|
||||||
- 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`的问题
|
|
||||||
- 添加权限检查
|
|
||||||
|
|
||||||
[更多版本记录](https://github.com/AriaLyy/Aria/blob/master/DEV_LOG.md)
|
[更多版本记录](https://github.com/AriaLyy/Aria/blob/master/DEV_LOG.md)
|
||||||
|
|
||||||
|
|||||||
@@ -47,9 +47,10 @@ public class HttpDownloadModule extends BaseViewModule {
|
|||||||
* 单任务下载的信息
|
* 单任务下载的信息
|
||||||
*/
|
*/
|
||||||
LiveData<DownloadEntity> getHttpDownloadInfo(Context context) {
|
LiveData<DownloadEntity> getHttpDownloadInfo(Context context) {
|
||||||
String url = AppUtil.getConfigValue(context, HTTP_URL_KEY, defUrl);
|
//String url = AppUtil.getConfigValue(context, HTTP_URL_KEY, defUrl);
|
||||||
//String url =
|
//String url =
|
||||||
// "http://sdkdown.muzhiwan.com/openfile/2019/05/21/com.netease.tom.mzw_5ce3ef8754d05.apk";
|
// "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);
|
String filePath = AppUtil.getConfigValue(context, HTTP_PATH_KEY, defFilePath);
|
||||||
|
|
||||||
singDownloadInfo = Aria.download(context).getFirstDownloadEntity(url);
|
singDownloadInfo = Aria.download(context).getFirstDownloadEntity(url);
|
||||||
|
|||||||
@@ -289,8 +289,8 @@ public class SingleTaskActivity extends BaseActivity<ActivitySingleBinding> {
|
|||||||
private void startD() {
|
private void startD() {
|
||||||
HttpOption option = new HttpOption();
|
HttpOption option = new HttpOption();
|
||||||
option.addHeader("1", "@")
|
option.addHeader("1", "@")
|
||||||
.setFileLenAdapter(new FileLenAdapter())
|
.useServerFileName(true)
|
||||||
.useServerFileName(true);
|
.setFileLenAdapter(new FileLenAdapter());
|
||||||
mTaskId = Aria.download(SingleTaskActivity.this)
|
mTaskId = Aria.download(SingleTaskActivity.this)
|
||||||
.load(mUrl)
|
.load(mUrl)
|
||||||
.setFilePath(mFilePath, true)
|
.setFilePath(mFilePath, true)
|
||||||
|
|||||||
@@ -257,7 +257,11 @@ public class DownloadAdapter extends AbsRVAdapter<AbsEntity, DownloadAdapter.Sim
|
|||||||
case IEntity.STATE_STOP:
|
case IEntity.STATE_STOP:
|
||||||
case IEntity.STATE_PRE:
|
case IEntity.STATE_PRE:
|
||||||
case IEntity.STATE_POST_PRE:
|
case IEntity.STATE_POST_PRE:
|
||||||
start(entity);
|
if (entity.getId() < 0){
|
||||||
|
start(entity);
|
||||||
|
}else {
|
||||||
|
resume(entity);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case IEntity.STATE_RUNNING:
|
case IEntity.STATE_RUNNING:
|
||||||
stop(entity);
|
stop(entity);
|
||||||
@@ -291,6 +295,24 @@ public class DownloadAdapter extends AbsRVAdapter<AbsEntity, DownloadAdapter.Sim
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void resume(AbsEntity entity){
|
||||||
|
switch (entity.getTaskType()) {
|
||||||
|
case AbsTaskWrapper.D_FTP:
|
||||||
|
//Aria.download(getContext()).loadFtp((DownloadEntity) entity).login("lao", "123456").create();
|
||||||
|
Aria.download(getContext()).loadFtp(entity.getId()).resume();
|
||||||
|
break;
|
||||||
|
case AbsTaskWrapper.D_FTP_DIR:
|
||||||
|
Aria.download(getContext()).loadFtpDir(entity.getId()).resume();
|
||||||
|
break;
|
||||||
|
case AbsTaskWrapper.D_HTTP:
|
||||||
|
Aria.download(getContext()).load(entity.getId()).resume();
|
||||||
|
break;
|
||||||
|
case AbsTaskWrapper.DG_HTTP:
|
||||||
|
Aria.download(getContext()).loadGroup(entity.getId()).resume();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void start(AbsEntity entity) {
|
private void start(AbsEntity entity) {
|
||||||
switch (entity.getTaskType()) {
|
switch (entity.getTaskType()) {
|
||||||
case AbsTaskWrapper.D_FTP:
|
case AbsTaskWrapper.D_FTP:
|
||||||
|
|||||||
@@ -103,6 +103,9 @@ public class MultiDownloadActivity extends BaseActivity<ActivityMultiDownloadBin
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Download.onTaskFail void taskFail(DownloadTask task) {
|
@Download.onTaskFail void taskFail(DownloadTask task) {
|
||||||
|
if (task == null || task.getEntity() == null){
|
||||||
|
return;
|
||||||
|
}
|
||||||
mAdapter.updateState(task.getEntity());
|
mAdapter.updateState(task.getEntity());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -101,6 +101,9 @@ public class MultiTaskActivity extends BaseActivity<ActivityMultiBinding> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Download.onTaskFail void taskFail(DownloadTask task) {
|
@Download.onTaskFail void taskFail(DownloadTask task) {
|
||||||
|
if (task == null || task.getEntity() == null){
|
||||||
|
return;
|
||||||
|
}
|
||||||
mAdapter.updateBtState(task.getKey(), true);
|
mAdapter.updateBtState(task.getKey(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -44,8 +44,8 @@ task clean(type: Delete) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ext {
|
ext {
|
||||||
versionCode = 372
|
versionCode = 373
|
||||||
versionName = '3.7.2'
|
versionName = '3.7.3'
|
||||||
userOrg = 'arialyy'
|
userOrg = 'arialyy'
|
||||||
groupId = 'com.arialyy.aria'
|
groupId = 'com.arialyy.aria'
|
||||||
publishVersion = versionName
|
publishVersion = versionName
|
||||||
|
|||||||
Reference in New Issue
Block a user