This commit is contained in:
@@ -18,7 +18,6 @@ package com.arialyy.aria.orm;
|
||||
import android.database.Cursor;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.support.v4.util.LruCache;
|
||||
import android.text.TextUtils;
|
||||
import com.arialyy.aria.util.ALog;
|
||||
import com.arialyy.aria.util.CommonUtil;
|
||||
import java.lang.reflect.Field;
|
||||
@@ -134,11 +133,13 @@ abstract class AbsDelegate {
|
||||
}
|
||||
|
||||
void closeCursor(Cursor cursor) {
|
||||
if (cursor != null && !cursor.isClosed()) {
|
||||
try {
|
||||
cursor.close();
|
||||
} catch (android.database.SQLException e) {
|
||||
e.printStackTrace();
|
||||
synchronized (AbsDelegate.class) {
|
||||
if (cursor != null && !cursor.isClosed()) {
|
||||
try {
|
||||
cursor.close();
|
||||
} catch (android.database.SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -201,7 +201,7 @@ class DelegateFind extends AbsDelegate {
|
||||
* @param pColumnAlias 关联查询父表别名
|
||||
* @param cColumnAlias 关联查询子表别名
|
||||
*/
|
||||
private <T extends AbsWrapper, P extends DbEntity, C extends DbEntity> List<T> newInstanceEntity(
|
||||
private synchronized <T extends AbsWrapper, P extends DbEntity, C extends DbEntity> List<T> newInstanceEntity(
|
||||
Class<T> clazz, Class<P> parent,
|
||||
Class<C> child,
|
||||
Cursor cursor,
|
||||
@@ -373,7 +373,7 @@ class DelegateFind extends AbsDelegate {
|
||||
/**
|
||||
* 根据数据游标创建一个具体的对象
|
||||
*/
|
||||
private <T extends DbEntity> List<T> newInstanceEntity(Class<T> clazz, Cursor cursor) {
|
||||
private synchronized <T extends DbEntity> List<T> newInstanceEntity(Class<T> clazz, Cursor cursor) {
|
||||
List<Field> fields = CommonUtil.getAllFields(clazz);
|
||||
List<T> entitys = new ArrayList<>();
|
||||
if (fields != null && fields.size() > 0) {
|
||||
@@ -419,6 +419,10 @@ class DelegateFind extends AbsDelegate {
|
||||
*/
|
||||
private void setFieldValue(Class type, Field field, int column, Cursor cursor, Object entity)
|
||||
throws IllegalAccessException {
|
||||
if (cursor == null || cursor.isClosed()) {
|
||||
ALog.e(TAG, "cursor没有初始化");
|
||||
return;
|
||||
}
|
||||
if (type == String.class) {
|
||||
String temp = cursor.getString(column);
|
||||
if (!TextUtils.isEmpty(temp)) {
|
||||
|
||||
@@ -58,6 +58,9 @@ public class SSLContextUtil {
|
||||
*/
|
||||
public static SSLContext getSSLContextFromAssets(String caAlias, String caPath,
|
||||
@ProtocolType String protocol) {
|
||||
if (TextUtils.isEmpty(caAlias) || TextUtils.isEmpty(caPath)){
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
String cacheKey = getCacheKey(caAlias, caPath);
|
||||
SSLContext sslContext = SSL_CACHE.get(cacheKey);
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
## 开发日志
|
||||
+ v_3.4.9
|
||||
- fix bug https://github.com/AriaLyy/Aria/issues/276
|
||||
+ v_3.4.8
|
||||
- 组合任务新增`updateUrls(List<String>)`用于修改组合子任务的url,[see](https://aria.laoyuyu.me/aria_doc/api/update_url.html)
|
||||
- 出于安全考虑,FTP数据库去掉密码的保存
|
||||
|
||||
@@ -32,8 +32,8 @@ Aria有以下特点:
|
||||
[](https://bintray.com/arialyy/maven/AriaApi/_latestVersion)
|
||||
[](https://bintray.com/arialyy/maven/AriaCompiler/_latestVersion)
|
||||
```java
|
||||
compile 'com.arialyy.aria:aria-core:3.4.8'
|
||||
annotationProcessor 'com.arialyy.aria:aria-compiler:3.4.8'
|
||||
compile 'com.arialyy.aria:aria-core:3.4.9'
|
||||
annotationProcessor 'com.arialyy.aria:aria-compiler:3.4.9'
|
||||
```
|
||||
如果出现android support,请将 `compile 'com.arialyy.aria:aria-core:<last-version>'`替换为
|
||||
```
|
||||
|
||||
@@ -15,11 +15,11 @@
|
||||
android:theme="@style/AppTheme.NoActionBar">
|
||||
<!--android:name=".MainActivity"-->
|
||||
<!--android:name=".download.group.DownloadGroupActivity"-->
|
||||
<!--android:name=".test.AnyRunActivity"-->
|
||||
<!--android:name=".test.TestFTPDirActivity"-->
|
||||
<!--android:name=".download.SingleTaskActivity"-->
|
||||
<!--android:name=".test.TestFTPActivity"-->
|
||||
<activity
|
||||
android:name=".test.TestFTPActivity"
|
||||
android:name=".test.AnyRunActivity"
|
||||
android:label="@string/app_name">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
|
||||
@@ -21,12 +21,12 @@ public class AnyRunActivity extends BaseActivity<ActivityTestBinding> {
|
||||
AnyRunnModule module;
|
||||
String[] urls;
|
||||
int index = 0;
|
||||
String URL = "http://static.gaoshouyou.com/d/12/0d/7f120f50c80d2e7b8c4ba24ece4f9cdd.apk";
|
||||
//String URL = "http://static.gaoshouyou.com/d/12/0d/7f120f50c80d2e7b8c4ba24ece4f9cdd.apk";
|
||||
//String URL = "http://58.213.157.242:8081/sims_file/rest/v1/file/mshd_touchscreen_ms/guideFile/41c33556-dc4a-4d78-bb76-b9f627f94448.mp4/%E5%85%AB%E5%8D%A6%E6%B4%B2%E5%8D%97%E4%BA%AC%E5%86%9C%E4%B8%9A%E5%98%89%E5%B9%B4%E5%8D%8E0511.mp4";
|
||||
//String URL = "http://d1.showself.com/download/showself_android-s236279_release.apk";
|
||||
//String URL = "http://static.gaoshouyou.com/d/22/94/822260b849944492caadd2983f9bb624.apk";
|
||||
//private final String URL = "ftp://192.168.29.140:21/download/AriaPrj.rar";
|
||||
//String URL = "https://dl.genymotion.com/releases/genymotion-2.12.1/genymotion-2.12.1-vbox.exe";
|
||||
String URL = "https://dl.genymotion.com/releases/genymotion-2.12.1/genymotion-2.12.1-vbox.exe";
|
||||
//String URL = "ftp://192.168.29.140:21/download/SDK_Demo-release.apk";
|
||||
//String URL = "ftps://192.168.29.140:990/download/SDK_Demo-release.apk";
|
||||
//String URL = "http://d.quanscreen.com/k/down/resourceDownLoad?resourceId=1994&clientId=A000011106034058176";
|
||||
|
||||
@@ -39,7 +39,7 @@ task clean(type: Delete) {
|
||||
ext {
|
||||
userOrg = 'arialyy'
|
||||
groupId = 'com.arialyy.aria'
|
||||
publishVersion = '3.4.8'
|
||||
publishVersion = '3.4.9'
|
||||
// publishVersion = '1.0.3' //FTP插件
|
||||
repoName='maven'
|
||||
desc = 'android 下载框架'
|
||||
|
||||
Reference in New Issue
Block a user