forked from alibaba/ARouter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
solve the main dex file size is too large
- Loading branch information
1 parent
f7ec450
commit 20c6494
Showing
4 changed files
with
38 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,6 +68,31 @@ private static void loadRouterMap() { | |
// registerRouteRoot(new ARouter..Root..modulekotlin()); | ||
} | ||
|
||
/** | ||
* register by class name | ||
* Sacrificing a bit of efficiency to solve | ||
* the problem that the main dex file size is too large | ||
* @author billy.qi <a href="mailto:[email protected]">Contact me.</a> | ||
* @param className class name | ||
*/ | ||
private static void register(String className) { | ||
if (!TextUtils.isEmpty(className)) { | ||
try { | ||
Class<?> clazz = Class.forName(className); | ||
Object obj = clazz.getConstructor().newInstance(); | ||
if (obj instanceof IRouteRoot) { | ||
registerRouteRoot((IRouteRoot) obj); | ||
} else if (obj instanceof IProviderGroup) { | ||
registerProvider((IProviderGroup) obj); | ||
} else if (obj instanceof IInterceptorGroup) { | ||
registerInterceptor((IInterceptorGroup) obj); | ||
} | ||
} catch (Exception e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
} | ||
|
||
/** | ||
* method for arouter-auto-register plugin to register Routers | ||
* @param routeRoot IRouteRoot implementation class in the package: com.alibaba.android.arouter.core.routers | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters