diff --git a/entry/build.gradle b/entry/build.gradle index 589e9fba18a0527aceeecaf0365431e58e4db0bd..65c41c4b3133d18096d577ef74c8aa2f4c28a0a4 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 ac594f3ae7200fe838242be585a94501680b2ddf..ccfd2eae16c276e67a1e88e62a0e73a788152d44 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 3cf698e748eb71a941a903dd84f04a9c7c6922c5..9886709532b7bf521558f123b3ae4a490219b1ff 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 1c09c5a005e45d219b4fba85be4fe028fe3bc8e8..8e2aaf5b5a7d1a82b400feaf2a1996c70c7f8bd3 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) {