Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize router automatic registration by generating bytecode #254

Merged
merged 1 commit into from
Dec 18, 2017

Conversation

luckybilly
Copy link
Contributor

scan all classes with package name: com.alibaba.android.arouter.routers at compile time, and generating code to call constructor of these class into LogisticsCenter. LoadRouterMap () method by bytecode inserting. Then ARouter framework can initialize router map by calling loadRouterMap().
after code generating, loadRouterMap method looks like below:

private static void loadRouterMap() {
    registerRouteRoot(new ARouter..Root..modulejava());
    registerRouteRoot(new ARouter..Root..modulekotlin());
}

App doesn't need to iterate through all of the dex files to find these classes at run time, and it doesn't need reflection to get objects

…,providers and interceptors by generating bytecode.
@avenue2013
Copy link

这个怎么用啊?

@luckybilly
Copy link
Contributor Author

@avenue2013这里 第6条的介绍。
中文看这里,也是第6条

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants