From 48b4f171352cb166aae8a0d294872c145cd6eec4 Mon Sep 17 00:00:00 2001 From: wjt983049539 Date: Wed, 7 Jul 2021 10:44:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E6=8E=89auto-service=E4=BE=9D?= =?UTF-8?q?=E8=B5=96=20=E4=BF=AE=E6=94=B9Test=E6=A3=80=E6=B5=8B=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry/build.gradle | 8 ++++---- router_api/build.gradle | 1 - .../java/com/lzh/nonview/router/launcher/Launcher.java | 4 ++-- .../java/com/lzh/nonview/router/compiler/Compiler.java | 3 --- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/entry/build.gradle b/entry/build.gradle index 589e9fb..65c41c4 100644 --- a/entry/build.gradle +++ b/entry/build.gradle @@ -11,11 +11,11 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) testImplementation 'junit:junit:4.13' ohosTestImplementation 'com.huawei.ohos.testkit:runner:1.0.0.100' - implementation 'com.gitee.chinasoft_ohos:router_api:0.0.2-SNAPSHOT' - annotationProcessor 'com.gitee.chinasoft_ohos:router_compiler:0.0.2-SNAPSHOT' +// implementation 'com.gitee.chinasoft_ohos:router_api:0.0.2-SNAPSHOT' +// annotationProcessor 'com.gitee.chinasoft_ohos:router_compiler:0.0.2-SNAPSHOT' // 这是依赖本地方式 -// annotationProcessor project(path:':router_compiler') -// implementation project(path:':router_api') + annotationProcessor project(path:':router_compiler') + implementation project(path:':router_api') } decc { supportType = ['html','xml'] diff --git a/router_api/build.gradle b/router_api/build.gradle index ac594f3..ccfd2ea 100644 --- a/router_api/build.gradle +++ b/router_api/build.gradle @@ -11,5 +11,4 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' api'com.gitee.chinasoft_ohos:router_anno:0.0.1-SNAPSHOT' - api 'com.google.auto.service:auto-service:1.0-rc2' } diff --git a/router_api/src/main/java/com/lzh/nonview/router/launcher/Launcher.java b/router_api/src/main/java/com/lzh/nonview/router/launcher/Launcher.java index 3cf698e..9886709 100644 --- a/router_api/src/main/java/com/lzh/nonview/router/launcher/Launcher.java +++ b/router_api/src/main/java/com/lzh/nonview/router/launcher/Launcher.java @@ -10,14 +10,14 @@ import ohos.aafwk.content.IntentParams; import ohos.app.Context; import ohos.utils.net.Uri; +import java.security.SecureRandom; import java.util.Random; /** * */ public abstract class Launcher { - private static Random sCodeGenerator = new Random(); - + private static SecureRandom sCodeGenerator = new SecureRandom(); protected Uri uri; protected IntentParams bundle; protected RouteBundleExtras extras; diff --git a/router_compiler/src/main/java/com/lzh/nonview/router/compiler/Compiler.java b/router_compiler/src/main/java/com/lzh/nonview/router/compiler/Compiler.java index 1c09c5a..8e2aaf5 100644 --- a/router_compiler/src/main/java/com/lzh/nonview/router/compiler/Compiler.java +++ b/router_compiler/src/main/java/com/lzh/nonview/router/compiler/Compiler.java @@ -1,6 +1,5 @@ package com.lzh.nonview.router.compiler; -import com.google.auto.service.AutoService; import com.lzh.nonview.router.anno.RouteConfig; import com.lzh.nonview.router.anno.RouterRule; import com.lzh.nonview.router.compiler.exception.RouterException; @@ -20,7 +19,6 @@ import java.util.Set; import javax.annotation.processing.AbstractProcessor; import javax.annotation.processing.ProcessingEnvironment; -import javax.annotation.processing.Processor; import javax.annotation.processing.RoundEnvironment; import javax.lang.model.SourceVersion; import javax.lang.model.element.Element; @@ -30,7 +28,6 @@ import javax.tools.Diagnostic; /** * The entry class of annotation processor */ -@AutoService(Processor.class) public class Compiler extends AbstractProcessor { @Override public boolean process(Set annotations, RoundEnvironment roundEnv) { -- Gitee