├── 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_module_one.xml │ │ │ │ ├── activity_module_two.xml │ │ │ │ └── activity_main.xml │ │ │ ├── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ │ └── drawable │ │ │ │ └── ic_launcher_background.xml │ │ ├── java │ │ │ └── im │ │ │ │ └── wangchao │ │ │ │ └── mrouterapp │ │ │ │ ├── App.java │ │ │ │ ├── ModuleTwoProvider.java │ │ │ │ ├── MainActivity.java │ │ │ │ ├── OneInterceptor.java │ │ │ │ ├── GlobalLevelOneInterceptor.java │ │ │ │ ├── GlobalLevelTwoInterceptor.java │ │ │ │ ├── ModuleOneService.java │ │ │ │ ├── ModuleTwoActivity.java │ │ │ │ └── ModuleOneActivity.java │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── im │ │ │ └── wangchao │ │ │ └── mrouterapp │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── im │ │ └── wangchao │ │ └── mrouterapp │ │ └── ExampleInstrumentedTest.java ├── build.gradle └── proguard-rules.pro ├── mrouter ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ └── values │ │ │ │ └── strings.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── im │ │ │ └── wangchao │ │ │ └── mrouter │ │ │ ├── IProvider.java │ │ │ ├── IRouterService.java │ │ │ ├── exception │ │ │ └── TargetClassNotFoundException.java │ │ │ ├── RouterCallback.java │ │ │ ├── internal │ │ │ ├── Utils.java │ │ │ ├── RealInterceptorRequestChain.java │ │ │ ├── RealInterceptorPopChain.java │ │ │ └── RealInterceptorPushChain.java │ │ │ ├── ForwardServiceInterceptor.java │ │ │ ├── IInterceptor.java │ │ │ ├── ILoader.java │ │ │ ├── ILoaderImpl.java │ │ │ ├── RealCallInterceptor.java │ │ │ ├── RouterRepository.java │ │ │ ├── Router.java │ │ │ ├── RouteIntent.java │ │ │ └── RouterServiceCenter.java │ ├── test │ │ └── java │ │ │ └── im │ │ │ └── wangchao │ │ │ └── mrouter │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── im │ │ └── wangchao │ │ └── mrouter │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro ├── gradle.properties └── build.gradle ├── example-module ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── values │ │ │ │ └── strings.xml │ │ │ └── layout │ │ │ │ └── activity_example.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── im │ │ │ └── wangchao │ │ │ └── examplemodule │ │ │ ├── ExampleProvider.java │ │ │ ├── ExampleActivity.java │ │ │ ├── ExampleInterceptor.java │ │ │ ├── ExampleRouterService.java │ │ │ └── GlobalExampleInterceptor.java │ ├── test │ │ └── java │ │ │ └── im │ │ │ └── wangchao │ │ │ └── examplemodule │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── im │ │ └── wangchao │ │ └── examplemodule │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro └── build.gradle ├── mrouter-compiler ├── .gitignore ├── build.gradle ├── gradle.properties └── src │ └── main │ └── java │ └── im │ └── wangchao │ └── mrouter │ └── compiler │ ├── RouterLoaderProcessor.java │ └── BuildLoaderClass.java ├── mrouter-plugin ├── .gitignore ├── src │ └── main │ │ ├── resources │ │ └── META-INF │ │ │ └── gradle-plugins │ │ │ └── im.wangchao.mrouter.properties │ │ ├── groovy │ │ └── im │ │ │ └── wangchao │ │ │ └── mrouter │ │ │ └── plugin │ │ │ ├── RouterPlugin.groovy │ │ │ └── transform │ │ │ └── RouterTransform.groovy │ │ └── java │ │ └── im │ │ └── wangchao │ │ └── mrouter │ │ └── plugin │ │ ├── Utils.java │ │ └── RouterClassVisitor.java ├── gradle.properties └── build.gradle ├── mrouter-annotations ├── .gitignore ├── build.gradle ├── src │ └── main │ │ └── java │ │ └── im │ │ └── wangchao │ │ └── mrouter │ │ └── annotations │ │ ├── RouterService.java │ │ ├── Route.java │ │ ├── Provider.java │ │ ├── Interceptor.java │ │ └── Constants.java └── gradle.properties ├── upload.sh ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── settings.gradle ├── .gitignore ├── gradle.properties ├── gradlew.bat ├── README.md └── gradlew /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /mrouter/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /example-module/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /mrouter-compiler/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /mrouter-plugin/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /mrouter-annotations/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /upload.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source ~/.bash_profile 3 | ./gradlew bintrayUpload --stacktrace -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | MRouter 3 | 4 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jymot/MRouter/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /mrouter/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | mrouter 3 | 4 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':mrouter', ':mrouter-annotations', ':mrouter-compiler', ':mrouter-plugin', ':example-module' 2 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jymot/MRouter/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jymot/MRouter/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example-module/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | example-module 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jymot/MRouter/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jymot/MRouter/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jymot/MRouter/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /mrouter-plugin/src/main/resources/META-INF/gradle-plugins/im.wangchao.mrouter.properties: -------------------------------------------------------------------------------- 1 | implementation-class=im.wangchao.mrouter.plugin.RouterPlugin -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jymot/MRouter/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/jymot/MRouter/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/jymot/MRouter/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/jymot/MRouter/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/jymot/MRouter/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /mrouter/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Thu Nov 09 13:12:27 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 | -------------------------------------------------------------------------------- /example-module/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 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 | -------------------------------------------------------------------------------- /mrouter-annotations/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java-library' 2 | 3 | dependencies { 4 | implementation fileTree(dir: 'libs', include: ['*.jar']) 5 | } 6 | 7 | sourceCompatibility = rootProject.ext.sourceCompatibilityVersion 8 | targetCompatibility = rootProject.ext.targetCompatibilityVersion 9 | 10 | //apply from: 'https://raw.githubusercontent.com/motcwang/Utils/master/bintray-publish/bintray-java.gradle' -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /mrouter/src/main/java/im/wangchao/mrouter/IProvider.java: -------------------------------------------------------------------------------- 1 | package im.wangchao.mrouter; 2 | 3 | /** 4 | *

Description : IProvider.

5 | *

Author : wangchao.

6 | *

Date : 2017/11/16.

7 | *

Time : 下午3:58.

8 | */ 9 | public interface IProvider { 10 | 11 | /** 12 | * 接收请求方法 13 | * 14 | * @param route RouteIntent 15 | * @param callback 回调函数 16 | */ 17 | void onReceiver(RouteIntent route, RouterCallback callback); 18 | } 19 | -------------------------------------------------------------------------------- /app/src/test/java/im/wangchao/mrouterapp/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package im.wangchao.mrouterapp; 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 | } -------------------------------------------------------------------------------- /mrouter/src/test/java/im/wangchao/mrouter/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package im.wangchao.mrouter; 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 | } -------------------------------------------------------------------------------- /example-module/src/test/java/im/wangchao/examplemodule/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package im.wangchao.examplemodule; 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 | } -------------------------------------------------------------------------------- /mrouter/src/main/java/im/wangchao/mrouter/IRouterService.java: -------------------------------------------------------------------------------- 1 | package im.wangchao.mrouter; 2 | 3 | import android.content.Context; 4 | 5 | /** 6 | *

Description : RouterService.

7 | *

Author : wangchao.

8 | *

Date : 2017/11/10.

9 | *

Time : 下午1:34.

10 | */ 11 | public interface IRouterService { 12 | void push(Context context, RouteIntent route, int requestCode, RouterCallback callback); 13 | 14 | void pop(Context context, RouteIntent route, int resultCode, RouterCallback callback); 15 | } 16 | -------------------------------------------------------------------------------- /mrouter/src/main/java/im/wangchao/mrouter/exception/TargetClassNotFoundException.java: -------------------------------------------------------------------------------- 1 | package im.wangchao.mrouter.exception; 2 | 3 | import im.wangchao.mrouter.RouteIntent; 4 | 5 | /** 6 | *

Description : TargetClassNotFoundException.

7 | *

Author : wangchao.

8 | *

Date : 2017/12/7.

9 | *

Time : 下午5:24.

10 | */ 11 | public class TargetClassNotFoundException extends RuntimeException{ 12 | 13 | public TargetClassNotFoundException(RouteIntent route){ 14 | super(String.format("Can not found target class with Uri(%s).", route.uri())); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /mrouter/src/main/java/im/wangchao/mrouter/RouterCallback.java: -------------------------------------------------------------------------------- 1 | package im.wangchao.mrouter; 2 | 3 | /** 4 | *

Description : RouterRequestCallback.

5 | *

Author : wangchao.

6 | *

Date : 2017/11/16.

7 | *

Time : 下午4:12.

8 | */ 9 | public interface RouterCallback { 10 | 11 | /** 12 | * 响应成功 13 | * @param route RouterIntent 14 | */ 15 | void onSuccess(RouteIntent route); 16 | 17 | /** 18 | * 响应失败 19 | * @param route RouterIntent 20 | * @param e 相关异常信息,可能为null 21 | */ 22 | void onFailure(RouteIntent route, Exception e); 23 | } 24 | -------------------------------------------------------------------------------- /mrouter-compiler/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java-library' 2 | 3 | dependencies { 4 | implementation fileTree(dir: 'libs', include: ['*.jar']) 5 | implementation 'com.google.auto.service:auto-service:1.0-rc2' 6 | implementation 'com.google.auto:auto-common:0.6' 7 | implementation 'com.squareup:javapoet:1.9.0' 8 | // implementation project(':mrouter-annotations') 9 | implementation 'im.wangchao:mrouter-annotations:0.1.3' 10 | } 11 | 12 | sourceCompatibility = rootProject.ext.sourceCompatibilityVersion 13 | targetCompatibility = rootProject.ext.targetCompatibilityVersion 14 | 15 | //apply from: 'https://raw.githubusercontent.com/motcwang/Utils/master/bintray-publish/bintray-java.gradle' -------------------------------------------------------------------------------- /example-module/src/main/res/layout/activity_example.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | 12 |