Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
AriaLyy committed Nov 1, 2019
1 parent 39c485b commit d6993eb
Show file tree
Hide file tree
Showing 13 changed files with 69 additions and 35 deletions.
2 changes: 1 addition & 1 deletion Aria/src/main/java/com/arialyy/aria/core/AriaManager.java
Expand Up @@ -401,7 +401,7 @@ private boolean isDialogFragment(Class subClazz) {
return false;
} else {
String parentName = parentClass.getName();
if (mFragmentClassName.contains(parentName)) {
if (mDialogFragmentClassName.contains(parentName)) {
return true;
} else {
return isDialogFragment(parentClass);
Expand Down
7 changes: 6 additions & 1 deletion 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
Expand Down
Expand Up @@ -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;
Expand Down
Expand Up @@ -48,7 +48,7 @@ public static synchronized ThreadTaskManager getInstance() {
}

private ThreadTaskManager() {
mExePool = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors());
mExePool = Executors.newCachedThreadPool();
}

/**
Expand Down
Expand Up @@ -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;
Expand Down Expand Up @@ -178,7 +179,8 @@ static boolean isIgnore(Field field) {
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);
}

Expand Down
Expand Up @@ -626,6 +626,16 @@ public static List<Field> getAllFields(Class clazz) {
Collections.addAll(fields, personClazz.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;
}

Expand Down
36 changes: 11 additions & 25 deletions README.md
Expand Up @@ -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:<last-version>'`替换为
```
Expand Down Expand Up @@ -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)

Expand Down
Expand Up @@ -47,9 +47,10 @@ public class HttpDownloadModule extends BaseViewModule {
* 单任务下载的信息
*/
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 =
// "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);
Expand Down
Expand Up @@ -289,8 +289,8 @@ public void onClick(View view) {
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)
Expand Down
Expand Up @@ -257,7 +257,11 @@ private class BtClickListener implements View.OnClickListener {
case IEntity.STATE_STOP:
case IEntity.STATE_PRE:
case IEntity.STATE_POST_PRE:
start(entity);
if (entity.getId() < 0){
start(entity);
}else {
resume(entity);
}
break;
case IEntity.STATE_RUNNING:
stop(entity);
Expand Down Expand Up @@ -291,6 +295,24 @@ private void cancel(AbsEntity entity) {
}
}

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) {
switch (entity.getTaskType()) {
case AbsTaskWrapper.D_FTP:
Expand Down
Expand Up @@ -103,6 +103,9 @@ public class MultiDownloadActivity extends BaseActivity<ActivityMultiDownloadBin
}

@Download.onTaskFail void taskFail(DownloadTask task) {
if (task == null || task.getEntity() == null){
return;
}
mAdapter.updateState(task.getEntity());
}

Expand Down
Expand Up @@ -101,6 +101,9 @@ public void onClick(View view) {
}

@Download.onTaskFail void taskFail(DownloadTask task) {
if (task == null || task.getEntity() == null){
return;
}
mAdapter.updateBtState(task.getKey(), true);
}

Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Expand Up @@ -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
Expand Down

0 comments on commit d6993eb

Please sign in to comment.