diff --git a/Aria/src/main/java/com/arialyy/aria/core/ConfigHelper.java b/Aria/src/main/java/com/arialyy/aria/core/ConfigHelper.java index 9c0d8ae5..89414399 100644 --- a/Aria/src/main/java/com/arialyy/aria/core/ConfigHelper.java +++ b/Aria/src/main/java/com/arialyy/aria/core/ConfigHelper.java @@ -77,6 +77,9 @@ class ConfigHelper extends DefaultHandler { case "buffSize": loadBuffSize(value); break; + case "useBroadcast": + loadUseBroadcast(value); + break; case "ca": String caName = attributes.getValue("name"); String caPath = attributes.getValue("path"); @@ -114,6 +117,20 @@ class ConfigHelper extends DefaultHandler { } } + private void loadUseBroadcast(String value) { + boolean b = checkBoolean(value), temp = false; + + if (b) { + temp = Boolean.valueOf(value); + } + if (mType == ConfigType.DOWNLOAD) { + mDownloadConfig.useBroadcast = temp; + } + if (mType == ConfigType.UPLOAD) { + mUploadConfig.useBroadcast = temp; + } + } + private void loadUseBlock(String value) { if (mType == ConfigType.DOWNLOAD) { mDownloadConfig.useBlock = checkBoolean(value) ? Boolean.valueOf(value) : false; diff --git a/Aria/src/main/java/com/arialyy/aria/core/common/ftp/AbsFtpInfoThread.java b/Aria/src/main/java/com/arialyy/aria/core/common/ftp/AbsFtpInfoThread.java index 32910485..be29b6bd 100644 --- a/Aria/src/main/java/com/arialyy/aria/core/common/ftp/AbsFtpInfoThread.java +++ b/Aria/src/main/java/com/arialyy/aria/core/common/ftp/AbsFtpInfoThread.java @@ -45,8 +45,7 @@ import java.util.regex.Pattern; import javax.net.ssl.SSLContext; /** - * Created by Aria.Lao on 2017/7/25. - * 获取ftp文件夹信息 + * Created by Aria.Lao on 2017/7/25. 获取ftp文件夹信息 */ public abstract class AbsFtpInfoThread> implements Runnable { @@ -285,13 +284,7 @@ public abstract class AbsFtpInfoThread * - * {@literal @}Download.onPre(DownloadUrl) + * {@literal @}Download.onPre * protected void onPre(DownloadTask task) { * mUpdateHandler.obtainMessage(DOWNLOAD_PRE, task.getDownloadEntity().getFileSize()).sendToTarget(); * } diff --git a/AriaCompiler/src/main/java/com/arialyy/compiler/EventProxyFiler.java b/AriaCompiler/src/main/java/com/arialyy/compiler/EventProxyFiler.java index bf48b248..ce83f2b2 100644 --- a/AriaCompiler/src/main/java/com/arialyy/compiler/EventProxyFiler.java +++ b/AriaCompiler/src/main/java/com/arialyy/compiler/EventProxyFiler.java @@ -36,8 +36,7 @@ import javax.annotation.processing.Filer; import javax.lang.model.element.Modifier; /** - * Created by lyy on 2017/9/6. - * 任务事件代理文件 + * Created by lyy on 2017/9/6. 任务事件代理文件 * *
  *   
@@ -127,24 +126,13 @@ final class EventProxyFiler {
       }
     }
     StringBuilder sb = new StringBuilder();
-    sb.append("Set keys = keyMapping.get(\"")
-        .append(methodInfo.methodName)
-        .append("\");\n");
-    sb.append("if (keys != null) {\n\tif (keys.contains(task.getKey())) {\n")
-        .append("\t\tobj.")
-        .append(methodInfo.methodName)
-        .append("((")
-        .append(taskEnum.getClassName())
-        .append(")")
-        .append(callCode)
-        .append(");\n\t}\n} else {\n")
-        .append("\tobj.")
+    sb.append("obj.")
         .append(methodInfo.methodName)
         .append("((")
         .append(taskEnum.getClassName())
         .append(")")
         .append(callCode)
-        .append(");\n}\n");
+        .append(");\n");
 
     MethodSpec.Builder builder = MethodSpec.methodBuilder(annotation.getSimpleName())
         .addModifiers(Modifier.PUBLIC)
@@ -186,14 +174,6 @@ final class EventProxyFiler {
     FieldSpec observerField = FieldSpec.builder(obj, "obj").addModifiers(Modifier.PRIVATE).build();
     builder.addField(observerField);
 
-    //添加url映射表
-    FieldSpec mappingField = FieldSpec.builder(
-        ParameterizedTypeName.get(ClassName.get(Map.class), ClassName.get(String.class),
-            ParameterizedTypeName.get(ClassName.get(Set.class), ClassName.get(String.class))),
-        "keyMapping").addModifiers(Modifier.PRIVATE).initializer("new $T()", HashMap.class).build();
-    builder.addField(mappingField);
-
-    //Set type = new HashSet<>();
     //添加注解方法
     for (TaskEnum te : entity.methods.keySet()) {
       Map, MethodInfo> methodInfoMap = entity.methods.get(te);
@@ -214,23 +194,6 @@ final class EventProxyFiler {
       }
     }
 
-    //增加构造函数
-    CodeBlock.Builder cb = CodeBlock.builder();
-    cb.add("Set set = null;\n");
-    for (String methodName : entity.keyMappings.keySet()) {
-      //PrintLog.getInstance().info("methodName ====> " +  methodName);
-      Set keys = entity.keyMappings.get(methodName);
-      if (keys == null || keys.size() == 0) continue;
-      StringBuilder sb = new StringBuilder();
-      sb.append("set = new $T();\n");
-      for (String key : keys) {
-        if (key.isEmpty()) continue;
-        sb.append("set.add(\"").append(key).append("\");\n");
-      }
-
-      sb.append("keyMapping.put(\"").append(methodName).append("\", ").append("set);\n");
-      cb.add(sb.toString(), ClassName.get(HashSet.class));
-    }
     //注册当前类
     //for (Integer i : type) {
     //  String str = null;
@@ -249,8 +212,7 @@ final class EventProxyFiler {
     //  }
     //}
 
-    MethodSpec structure =
-        MethodSpec.constructorBuilder().addModifiers(Modifier.PUBLIC).addCode(cb.build()).build();
+    MethodSpec structure = MethodSpec.constructorBuilder().addModifiers(Modifier.PUBLIC).build();
     builder.addMethod(structure);
 
     //添加设置代理的类
diff --git a/DEV_LOG.md b/DEV_LOG.md
index 82d08400..33d0bb57 100644
--- a/DEV_LOG.md
+++ b/DEV_LOG.md
@@ -1,4 +1,7 @@
 ## 开发日志
+  + v_3.5.3
+    - 修复ftps不能加载默认证书的bug https://github.com/AriaLyy/Aria/issues/334
+    - 优化注解性能,移除不必要的判断代码
   + v_3.5.2
     - 添加Serializable接口支持 https://github.com/AriaLyy/Aria/issues/320
     - 失败回调增加错误原因 https://github.com/AriaLyy/Aria/issues/310
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 22d8cc6f..dcd6df68 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -20,7 +20,7 @@
     
           
     
       
         
diff --git a/app/src/main/assets/aria_config.xml b/app/src/main/assets/aria_config.xml
index 018b1e63..dc934680 100644
--- a/app/src/main/assets/aria_config.xml
+++ b/app/src/main/assets/aria_config.xml
@@ -66,6 +66,8 @@
 
     
     
+    
+    
 
   
 
@@ -101,6 +103,9 @@
 
     
     
+
+    
+    
   
 
 
\ No newline at end of file
diff --git a/app/src/main/java/com/arialyy/simple/download/FtpDownloadActivity.java b/app/src/main/java/com/arialyy/simple/download/FtpDownloadActivity.java
index 1a13aa42..45fca4fd 100644
--- a/app/src/main/java/com/arialyy/simple/download/FtpDownloadActivity.java
+++ b/app/src/main/java/com/arialyy/simple/download/FtpDownloadActivity.java
@@ -60,8 +60,6 @@ public class FtpDownloadActivity extends BaseActivity