├── app ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ ├── colors.xml │ │ │ │ └── styles.xml │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ ├── layout │ │ │ │ ├── activity_test.xml │ │ │ │ └── activity_main.xml │ │ │ ├── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ │ └── drawable │ │ │ │ └── ic_launcher_background.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── smart │ │ │ │ └── router │ │ │ │ └── app │ │ │ │ ├── App.java │ │ │ │ ├── TestActivity.java │ │ │ │ ├── SampleInterceptor.java │ │ │ │ └── MainActivity.java │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── smart │ │ │ └── router │ │ │ └── app │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── smart │ │ └── router │ │ └── app │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro └── build.gradle ├── router ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ └── values │ │ │ │ └── strings.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── smart │ │ │ └── router │ │ │ └── router │ │ │ ├── RouteResult.java │ │ │ ├── ParamInjector.java │ │ │ ├── RouteCallback.java │ │ │ ├── InterceptorTable.java │ │ │ ├── RouteInterceptor.java │ │ │ ├── RouteTable.java │ │ │ ├── TargetInterceptors.java │ │ │ ├── matcher │ │ │ ├── AbsImplicitMatcher.java │ │ │ ├── DirectMatcher.java │ │ │ ├── BrowserMatcher.java │ │ │ ├── Matcher.java │ │ │ ├── AbsExplicitMatcher.java │ │ │ ├── ImplicitMatcher.java │ │ │ ├── AbsMatcher.java │ │ │ └── SchemeMatcher.java │ │ │ ├── util │ │ │ └── RLog.java │ │ │ ├── Configuration.java │ │ │ ├── MatcherRegistry.java │ │ │ ├── IRouter.java │ │ │ ├── SmartRouter.java │ │ │ ├── AptHub.java │ │ │ ├── RouteRequest.java │ │ │ ├── AbsRouter.java │ │ │ └── RealRouter.java │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── smart │ │ │ └── router │ │ │ └── router │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── smart │ │ └── router │ │ └── router │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro ├── build.gradle └── publish.gradle ├── annotation ├── .gitignore ├── build.gradle ├── src │ └── main │ │ └── java │ │ └── com │ │ └── smart │ │ └── router │ │ └── annotation │ │ ├── Interceptor.java │ │ ├── InjectParam.java │ │ └── Route.java └── publish.gradle ├── compiler ├── .gitignore ├── src │ └── main │ │ ├── resources │ │ └── META-INF │ │ │ └── services │ │ │ └── javax.annotation.processing.Processor │ │ └── java │ │ └── com │ │ └── smart │ │ └── router │ │ └── compiler │ │ ├── util │ │ ├── Logger.java │ │ └── Consts.java │ │ └── processor │ │ ├── InterceptorProcessor.java │ │ ├── RouteProcessor.java │ │ └── InjectParamProcessor.java ├── build.gradle └── publish.gradle ├── settings.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── .idea ├── encodings.xml ├── runConfigurations.xml ├── modules.xml ├── gradle.xml └── misc.xml ├── VERSION.properties ├── gradle.properties ├── gradlew.bat ├── README.md └── gradlew /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /router/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /annotation/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /compiler/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':annotation', ':compiler', ':router' 2 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | SmartRouter 3 | 4 | -------------------------------------------------------------------------------- /router/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | router 3 | 4 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kongpengcheng/SmartRoute/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kongpengcheng/SmartRoute/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kongpengcheng/SmartRoute/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kongpengcheng/SmartRoute/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kongpengcheng/SmartRoute/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /router/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kongpengcheng/SmartRoute/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kongpengcheng/SmartRoute/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kongpengcheng/SmartRoute/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kongpengcheng/SmartRoute/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kongpengcheng/SmartRoute/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kongpengcheng/SmartRoute/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .externalNativeBuild 10 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /VERSION.properties: -------------------------------------------------------------------------------- 1 | # router gradle plugin version 2 | GRADLE_PLUGIN_VERSION=1.1.1 3 | # router library version 4 | ROUTER_VERSION=1.1.3 5 | # compiler library version 6 | COMPILER_VERSION=1.1.2 7 | # annotation library version 8 | ANNOTATION_VERSION=0.3.0 -------------------------------------------------------------------------------- /annotation/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | dependencies { 4 | implementation fileTree(dir: 'libs', include: ['*.jar']) 5 | } 6 | 7 | sourceCompatibility = "1.7" 8 | targetCompatibility = "1.7" 9 | //apply from: 'publish.gradle' 10 | -------------------------------------------------------------------------------- /compiler/src/main/resources/META-INF/services/javax.annotation.processing.Processor: -------------------------------------------------------------------------------- 1 | com.smart.router.compiler.processor.RouteProcessor 2 | com.smart.router.compiler.processor.InterceptorProcessor 3 | com.smart.router.compiler.processor.InjectParamProcessor -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /router/src/main/java/com/smart/router/router/RouteResult.java: -------------------------------------------------------------------------------- 1 | package com.smart.router.router; 2 | 3 | /** 4 | * Result for each route. 5 | *

6 | * Created by Harry.Kong. 7 | */ 8 | public enum RouteResult { 9 | SUCCEED, 10 | INTERCEPTED, 11 | FAILED 12 | } 13 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Nov 07 14:14:50 CST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip 7 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /router/src/main/java/com/smart/router/router/ParamInjector.java: -------------------------------------------------------------------------------- 1 | package com.smart.router.router; 2 | 3 | /** 4 | * Interface that help to generate param class. 5 | *

6 | * Created by Harry.Kong. 7 | */ 8 | public interface ParamInjector { 9 | /** 10 | * Inject params. 11 | * 12 | * @param obj Activity or fragment instance. 13 | */ 14 | void inject(Object obj); 15 | } 16 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /router/src/main/java/com/smart/router/router/RouteCallback.java: -------------------------------------------------------------------------------- 1 | package com.smart.router.router; 2 | 3 | import android.net.Uri; 4 | 5 | /** 6 | * Created by Harry.Kong.. 7 | */ 8 | public interface RouteCallback { 9 | /** 10 | * Callback 11 | * 12 | * @param state {@link RouteResult} 13 | * @param uri Uri 14 | * @param message notice msg 15 | */ 16 | void callback(RouteResult state, Uri uri, String message); 17 | } 18 | -------------------------------------------------------------------------------- /router/src/main/java/com/smart/router/router/InterceptorTable.java: -------------------------------------------------------------------------------- 1 | package com.smart.router.router; 2 | 3 | import java.util.Map; 4 | 5 | /** 6 | * Interceptor table mapping. 7 | *

8 | * Created by Harry.Kong. 9 | */ 10 | public interface InterceptorTable { 11 | /** 12 | * Mapping between name and interceptor. 13 | * 14 | * @param map name -> interceptor. 15 | */ 16 | void handle(Map> map); 17 | } 18 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_test.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/test/java/com/smart/router/app/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.smart.router.app; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 |