diff --git a/Aria/src/main/java/com/arialyy/aria/core/download/FtpDirDownloadTarget.java b/Aria/src/main/java/com/arialyy/aria/core/download/FtpDirDownloadTarget.java index d18b90dd..4d0f2a5c 100644 --- a/Aria/src/main/java/com/arialyy/aria/core/download/FtpDirDownloadTarget.java +++ b/Aria/src/main/java/com/arialyy/aria/core/download/FtpDirDownloadTarget.java @@ -79,6 +79,16 @@ public class FtpDirDownloadTarget extends BaseGroupTarget } } } + if (mTaskEntity.getUrlEntity().isFtps) { + if (TextUtils.isEmpty(mTaskEntity.getUrlEntity().storePath)) { + ALog.e(TAG, "证书路径为空"); + return false; + } + if (TextUtils.isEmpty(mTaskEntity.getUrlEntity().keyAlias)) { + ALog.e(TAG, "证书别名为空"); + return false; + } + } return b; } diff --git a/Aria/src/main/java/com/arialyy/aria/core/download/FtpDownloadTarget.java b/Aria/src/main/java/com/arialyy/aria/core/download/FtpDownloadTarget.java index 8494ec20..1c19c66c 100644 --- a/Aria/src/main/java/com/arialyy/aria/core/download/FtpDownloadTarget.java +++ b/Aria/src/main/java/com/arialyy/aria/core/download/FtpDownloadTarget.java @@ -17,10 +17,12 @@ package com.arialyy.aria.core.download; import android.support.annotation.CheckResult; import android.support.annotation.NonNull; +import android.text.TextUtils; import com.arialyy.aria.core.common.ftp.FTPSConfig; import com.arialyy.aria.core.common.ftp.FtpDelegate; import com.arialyy.aria.core.inf.AbsTaskEntity; import com.arialyy.aria.core.inf.IFtpTarget; +import com.arialyy.aria.util.ALog; import com.arialyy.aria.util.CommonUtil; import java.net.Proxy; @@ -61,6 +63,20 @@ public class FtpDownloadTarget extends BaseNormalTarget return new FTPSConfig<>(this); } + @Override protected boolean checkEntity() { + if (mTaskEntity.getUrlEntity().isFtps){ + if (TextUtils.isEmpty(mTaskEntity.getUrlEntity().storePath)){ + ALog.e(TAG, "证书路径为空"); + return false; + } + if (TextUtils.isEmpty(mTaskEntity.getUrlEntity().keyAlias)){ + ALog.e(TAG, "证书别名为空"); + return false; + } + } + return super.checkEntity(); + } + /** * 设置文件保存文件夹路径 * diff --git a/Aria/src/main/java/com/arialyy/aria/core/upload/BaseNormalTarget.java b/Aria/src/main/java/com/arialyy/aria/core/upload/BaseNormalTarget.java index 805bc1e5..b56ad759 100644 --- a/Aria/src/main/java/com/arialyy/aria/core/upload/BaseNormalTarget.java +++ b/Aria/src/main/java/com/arialyy/aria/core/upload/BaseNormalTarget.java @@ -80,6 +80,16 @@ abstract class BaseNormalTarget mEntity.save(); mTaskEntity.save(); } + if (mTaskEntity.getUrlEntity().isFtps) { + if (TextUtils.isEmpty(mTaskEntity.getUrlEntity().storePath)) { + ALog.e(TAG, "证书路径为空"); + return false; + } + if (TextUtils.isEmpty(mTaskEntity.getUrlEntity().keyAlias)) { + ALog.e(TAG, "证书别名为空"); + return false; + } + } return b; } diff --git a/DEV_LOG.md b/DEV_LOG.md index 2f0f0626..a4c11901 100644 --- a/DEV_LOG.md +++ b/DEV_LOG.md @@ -1,9 +1,10 @@ ## 开发日志 + v_3.4.8 - - 组合任务新增`updateUrls(List)`用于修改组合子任务的url,[see](https://aria.laoyuyu.me/aria_doc/api/task_handle.html#%E6%9B%B4%E6%96%B0%E4%BB%BB%E5%8A%A1url) + - 组合任务新增`updateUrls(List)`用于修改组合子任务的url,[see](https://aria.laoyuyu.me/aria_doc/api/update_url.html) - 出于安全考虑,FTP数据库去掉密码的保存 - - 增加FTPS支持 [see]() - - 增加速度限制支持[see]() + - 增加FTPS支持 [see](https://aria.laoyuyu.me/aria_doc/download/ftps.html) + - 增加速度限制支持[see](https://aria.laoyuyu.me/aria_doc/api/speed_handle.html) + - 增加内存空间不足验证 + v_3.4.7 - 修复分块任务异常操作导致的问题 + v_3.4.6 diff --git a/README.md b/README.md index 9a9668aa..e4e13d78 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ Aria有以下特点: - 支持HTTP任务组\FTP文件夹,断点续传下载 - 支持HTTP表单上传 - 支持文件FTP断点续传上传 + - 支持FTPS/SFTP断点续传,[see](https://aria.laoyuyu.me/aria_doc/download/ftps.html) + 支持https地址下载 - 在配置文件中很容易就可以设置CA证书的信息 + 支持[多线程分块下载](https://aria.laoyuyu.me/aria_doc/start/config.html),能更有效的发挥机器IO性能 @@ -31,8 +32,8 @@ Aria有以下特点: [![Download](https://api.bintray.com/packages/arialyy/maven/AriaApi/images/download.svg)](https://bintray.com/arialyy/maven/AriaApi/_latestVersion) [![Download](https://api.bintray.com/packages/arialyy/maven/AriaCompiler/images/download.svg)](https://bintray.com/arialyy/maven/AriaCompiler/_latestVersion) ```java -compile 'com.arialyy.aria:aria-core:3.4.7' -annotationProcessor 'com.arialyy.aria:aria-compiler:3.4.7' +compile 'com.arialyy.aria:aria-core:3.4.8' +annotationProcessor 'com.arialyy.aria:aria-compiler:3.4.8' ``` 如果出现android support,请将 `compile 'com.arialyy.aria:aria-core:'`替换为 ``` @@ -100,8 +101,12 @@ protected void onCreate(Bundle savedInstanceState) { ### 版本日志 - + v_3.4.7 - - 修复分块任务异常操作导致的问题 + + v_3.4.8 + - 组合任务新增`updateUrls(List)`用于修改组合子任务的url,[see](https://aria.laoyuyu.me/aria_doc/api/update_url.html) + - 出于安全考虑,FTP数据库去掉密码的保存 + - 增加FTPS支持 [see](https://aria.laoyuyu.me/aria_doc/download/ftps.html) + - 增加速度限制支持[see](https://aria.laoyuyu.me/aria_doc/api/speed_handle.html) + - 增加内存空间不足验证 [更多版本记录](https://github.com/AriaLyy/Aria/blob/master/DEV_LOG.md) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 36686969..c29c9966 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -17,9 +17,9 @@ - + diff --git a/app/src/main/java/com/arialyy/simple/test/TestFTPActivity.java b/app/src/main/java/com/arialyy/simple/test/TestFTPActivity.java index 7be6bf1b..3ca181e2 100644 --- a/app/src/main/java/com/arialyy/simple/test/TestFTPActivity.java +++ b/app/src/main/java/com/arialyy/simple/test/TestFTPActivity.java @@ -6,6 +6,7 @@ import android.util.Log; import android.view.View; import com.arialyy.annotations.Upload; import com.arialyy.aria.core.Aria; +import com.arialyy.aria.core.common.ProtocolType; import com.arialyy.aria.core.common.RequestEnum; import com.arialyy.aria.core.upload.UploadTask; import com.arialyy.aria.util.ALog; @@ -83,9 +84,8 @@ public class TestFTPActivity extends BaseActivity { .setUploadUrl(URL) .setExtendField("韩寒哈大双") .asFtps() - .setStorePath("/mnt/sdcard/Download/server.crt") - .setAlias("www.laoyuyu.me") - .setStorePass("123456") + //.setStorePath("/mnt/sdcard/Download/server.crt") + //.setAlias("www.laoyuyu.me") .start(); //Uri uri = Uri.parse("ftp://z:z@dygod18.com:21211/[电影天堂www.dy2018.com]猩球崛起3:终极之战BD国英双语中英双字.mkv"); //ALog.d(TAG, "sh = " + uri.getScheme() + ", user = " + uri.getUserInfo() + ", host = " + uri.getHost() + ", port = " + uri.getPort() + " remotePath = " + uri.getPath()); diff --git a/build.gradle b/build.gradle index 2c1ceeb5..5f5e6e62 100644 --- a/build.gradle +++ b/build.gradle @@ -39,7 +39,7 @@ task clean(type: Delete) { ext { userOrg = 'arialyy' groupId = 'com.arialyy.aria' - publishVersion = '3.4.7' + publishVersion = '3.4.8' // publishVersion = '1.0.3' //FTP插件 repoName='maven' desc = 'android 下载框架'