alibaba/ARouter
62.5
Adequate · 25 September 2026
9.9k
lines of production code
Java
with Python, Groovy
5
measurements over time
What this system is
ARouter is an Android routing and dependency injection framework that enables decoupled navigation between components and service discovery via annotations. It provides a compiler-based infrastructure to generate route tables and inject fields, supporting both legacy APT and modern KSP2 toolchains. The system manages complex navigation flows through interceptors, handles deep linking, and ensures compatibility with AndroidX, R8 minification, and Gradle configuration caching.
How it got here
2016–2017 — AndroidX migration and KSP adoption
14 changes.
The project underwent a comprehensive migration to native AndroidX, establishing the core ARouter framework with updated annotations, compiler infrastructure, and thread-safe interceptor logic. This period also introduced KSP as an alternative build toolchain and expanded the demo applications to verify routing, dependency injection, and cross-language compatibility across Java and Kotlin.
2018–2026 — KSP2 migration and Gradle compatibility
11 changes.
The project introduced a new KSP2 compiler module to modernize code generation and updated the Gradle plugin to support AGP 7.4+ via the Scoped Artifacts API. Comprehensive testing and fixture modules were added to validate these changes, ensure R8 compatibility, and verify correct behavior across mixed KSP and KAPT toolchains.
Features
ARouter Gradle plugin now supports Android Gradle Plugin 7.4+ via Scoped Artifacts API
The arouter-gradle-plugin has been updated to support modern Android Gradle Plugin (AGP) versions (7.4 and newer) by migrating from the deprecated Transform API to the public Scoped Artifacts API. This change introduces a new \ScopedRegisterTask\ and \ScopedClassTransformer\ that leverage AGP's scoped transforms, ensuring compatibility with AGP 8 and future versions while maintaining backward compatibility with legacy AGP versions through a fallback to the old \RegisterTransform\. The plugin now correctly isolates transform state per variant, supports modern Java class files (including Java 17+ features like nest hosts), and skips non-class route entries to prevent build errors such as \DexArchiveMergeException\ during incremental builds or multi-channel packaging.
arouter-gradle-plugin · high confidence
Add ARouter Helper plugin with gutter navigation for Java and Kotlin
The arouter-idea-plugin introduces the 'ARouter Helper' plugin (v1.1.0), which adds a gutter icon to ARouter \build()\ calls in both Java and Kotlin source files. Clicking the icon navigates the user directly to the destination class annotated with \@Route\ matching the call's path. The implementation registers a \NavigationLineMarker\ via \plugin.xml\ and includes tests verifying that it correctly resolves literal and constant path arguments while ignoring unrelated classes or dynamic paths.
arouter-idea-plugin · high confidence
Add Java-based demo module for ARouter testing
The module-java module introduces a new Java-based demo application for the ARouter framework, providing a comprehensive set of test fixtures. This includes multiple Activities (such as Test1Activity, Test2Activity, and ReorderProbeActivity) and Fragments (BlankFragment, AutowiredR8Fragment) that demonstrate and verify the @Autowired dependency injection mechanism, including support for R8 obfuscation scenarios. The module also registers several Interceptors (Test1Interceptor, LoginRedirectInterceptor) to test routing interception and redirect logic, alongside Service implementations (HelloServiceImpl, JsonServiceImpl) to validate service discovery and serialization. These components serve as the concrete test harness for verifying routing, injection, and interceptor behaviors within the framework.
module-java · high confidence
Add Kotlin demo module with ARouter navigation and pretreatment testing
Introduces a new Kotlin-based demo module for the ARouter library, providing concrete examples of navigation and dependency injection in Kotlin. This includes a test activity (KotlinTestActivity) demonstrating field injection of nullable and non-nullable types, a standard Java activity (TestNormalActivity) to verify cross-language compatibility, and a RecordingPretreatmentService that allows developers to inspect the context and postcard data passed during the navigation pretreatment phase.
module-kotlin · high confidence
Add route type and field type kind enums
The library now includes two new enumeration classes, RouteType and TypeKind, to define supported route targets and field data types. RouteType enumerates specific Android components such as Activity, Service, Provider, ContentProvider, Broadcast, Method, and Fragment, allowing the router to identify and handle different destination types. TypeKind defines the supported primitive and object types for route parameters, including booleans, integers, strings, and serializable objects, enabling proper type checking and serialization during navigation.
arouter-annotation/src/main/java/com/alibaba/android/arouter/facade/enums · high confidence
Added Java-export demo module for service and navigation examples
A new \module-java-export\ module has been added to the project structure to demonstrate the framework's design concepts. This module provides a concrete example of how to define and use a service interface (\HelloService\) that extends \IProvider\, allowing consumers to depend on the interface rather than a specific implementation. It also includes an \Entrance\ utility class that showcases how to use ARouter to navigate to an activity with parameters, and introduces new data model classes (\TestObj\, \TestParcelable\, \TestSerializable\) to demonstrate different serialization strategies for passing data between components.
module-java-export · high confidence
Demo app adds activities to test caller-owned activity result launchers and array extras
The demo application now includes new host activities to demonstrate and verify specific ARouter capabilities. ActivityResultHostActivity allows navigation with caller-owned activity result launchers, enabling developers to see how to handle results from routed destinations using the new launcher API. PostcardArrayHostActivity demonstrates passing array-type extras (strings, ints, longs, doubles) via Postcard. Additionally, AutowiredFragmentHostActivity tests R8-proguarded autowiring for fragments, and SchemeFilterActivity shows handling external URIs through ARouter.
app/src/main/java · high confidence
Initial release of ARouter annotation definitions
This change introduces the core annotation definitions for the ARouter library, including @Route for defining navigation paths, @Autowired for field injection (replacing the deprecated @Param), and @Interceptor for route interception. These annotations establish the API surface for route registration, dependency injection, and interceptor priority management.
arouter-annotation/src/main/java/com/alibaba/android/arouter/facade/annotation · high confidence
Initial repository setup with AndroidX migration and documentation
This change establishes the project's initial public structure, introducing the core ARouter framework which has been migrated to native AndroidX (requiring \android.useAndroidX=true\ in consuming apps). It includes the runtime API, compiler, and Gradle plugin, along with comprehensive documentation (README, Code of Conduct, Contributing guidelines) and a demo application. The runtime maintains a minimum SDK of 14, while the demo targets API 21.
(repo-wide) · high confidence
Introduce compiler infrastructure for autowired injection and route documentation generation
The arouter-compiler module now includes the foundational processor classes and supporting utilities required for the new @Autowired field injection feature and optional route documentation generation. This change adds the AutowiredProcessor to generate helper classes that inject fields into Activities and Fragments (including AndroidX), the RouteProcessor to handle route metadata and support the new RouteDoc entity for generating JSON documentation, and the InterceptorProcessor to manage interceptor registration with semantic interface comparison. It also introduces the BaseProcessor abstraction, utility classes for type and string handling, and configuration constants for module names and doc generation switches.
arouter-compiler · high confidence
New model classes for route metadata and type introspection
The \arouter-annotation\ module now includes \RouteMeta\ and \TypeWrapper\ classes. \RouteMeta\ serves as the data model for route information, storing details such as path, group, priority, destination, and parameter types, while also supporting an inject configuration map for dependency injection metadata. \TypeWrapper\ provides a mechanism to capture and retrieve generic type information at runtime using Java reflection, enabling the framework to handle complex object types during route processing.
arouter-annotation/src/main/java/com/alibaba/android/arouter/facade/model · high confidence
New standalone KSP2 compiler for ARouter route and injection generation
A new standalone KSP2 compiler module (arouter-compiler-ksp) has been added, implementing route/provider registration, field injection, and interceptor table generation using the KSP2 toolchain. This processor generates the same Java Root, Group, Provider, and Interceptor registry classes as the legacy APT/KAPT backend, preserving existing runtime entry points and the Gradle registration plugin. It supports Java and Kotlin targets, including Kotlin @JvmField and lateinit fields, while maintaining the current annotation model and generated package structure. The module includes benchmarking documentation comparing KSP2 performance against KAPT and detailed setup instructions for local development and integration.
arouter-compiler-ksp · high confidence
Behavioural changes
1 commit (0 fixes) modifying app/doc
A change to existing behaviour in app/doc — 1 commit, 1 file.
app/doc · low confidence · unverified
6 commits (0 fixes) modifying demo
A change to existing behaviour in demo — 6 commits, 7 files.
demo · medium confidence · unverified
Add ProGuard rules for minified instrumentation tests
Added proguard-android-test.pro and proguard-rules.pro to preserve public API surfaces and entry points required for instrumentation tests running in a separate APK against a minified target. This ensures that cross-APK calls, such as those involving ARouter demo activities, interceptors, Kotlin pretreatment services, and AndroidX compatibility classes, are not stripped during code shrinking.
app · high confidence
Interceptor initialization and execution are now isolated and thread-safe
The ARouter API now ensures that interceptor state is correctly isolated across reinitializations (such as during debug mode or app updates) and prevents blocking on interceptor callbacks. The \InterceptorServiceImpl\ and \InterceptorChain\ classes have been rewritten to use a dedicated \InterceptorInitState\ for coordinating async initialization with a timeout, ensuring that old async initializers do not interfere with new registry states. The chain execution logic now strictly handles duplicate or racing callbacks, timeouts, and exceptions to guarantee the chain completes exactly once, improving stability and preventing crashes during navigation.
arouter-api/src · high confidence
Fixes
Add R8 consumer rules to preserve reflection-based routing and injection
A new consumer-rules.pro file has been added to the arouter-api module to ensure compatibility with R8 code shrinking and obfuscation. This file preserves public constructors for generated route-table classes, autowired field targets, and service injectors (ISyringe), while also retaining no-argument constructors for providers, interceptors, and Fragment subclasses. These changes prevent runtime failures caused by R8 removing or obfuscating classes and methods that Arouter accesses via reflection.
arouter-api · high confidence
Add configuration-cache fixture modules for daily and online variants
Added two new Android library modules, \feature-daily\ and \feature-online\, to the \gradle/configuration-cache-fixture\ project. Each module provides a minimal AndroidManifest and a corresponding \IProvider\ implementation (\DailyProvider\ and \OnlineProvider\) annotated with ARouter routes (\/fixture/daily\ and \/fixture/online\). These modules serve as isolated test fixtures to validate Gradle configuration-cache behavior with legacy transform state per variant.
gradle/configuration-cache-fixture/feature-daily, gradle/configuration-cache-fixture/feature-online · medium confidence
Test coverage
Added KAPT Room regression test fixture; Added instrumented tests for ARouter navigation, interceptors, and extras; Added instrumented tests for route availability, routing failure diagnostics, and intent robustness; Added local test page for navigation scheme validation; KSP fixture validates mixed KSP/KAPT injection and routing; New Gradle-based verification and benchmark tooling for AndroidX and configuration cache.
Dependencies
Introduce KSP compiler and update build toolchain dependencies
This change adds a new \arouter-compiler-ksp\ module, providing a KSP2-based route compiler as an alternative to the legacy APT compiler, and updates the project's build toolchain to use Kotlin 2.3.20 and KSP 2.3.12. It also upgrades the IntelliJ IDEA plugin to version 1.1.0, migrating it to the IntelliJ Platform Gradle Plugin 2.x and targeting Android Studio 2024.3, while the core \arouter-api\ library is updated to version 1.5.2.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.
Score
- CAI 47 → 62 (+15.8)
- Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 91 → 88 (-2.7)
- Architecture 100 → 100 (+0.0)
- Maturity 47 → 61 (+13.8)
- Readiness 29 → 54 (+25.3)
- Security 64 → 67 (+3.2)
Resolved (16)
- AutowiredProcessor.buildStatement (cognitive 27) (arouter-compiler/src/main/java/com/alibaba/android/arouter/compiler/processor/AutowiredProcessor.java)
- AutowiredProcessor.buildStatement (cyclomatic 26) (arouter-compiler/src/main/java/com/alibaba/android/arouter/compiler/processor/AutowiredProcessor.java)
- Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
- Dormant codebase
- Duplicated block (10 lines × 2) (arouter-compiler/src/main/java/com/alibaba/android/arouter/compiler/processor/RouteProcessor.java)
- Duplicated block (9 lines × 3) (app/src/main/java/com/alibaba/android/arouter/demo/MainActivity.java)
- High: security finding (details withheld)
- High: security finding (details withheld)
- Largest orphaned file (arouter-compiler/src/main/java/com/alibaba/android/arouter/compiler/processor/RouteProcessor.java)
- No automated tests
- No exposed public API
- No tests found
- Test reliability not included
- Unpinned build actions
- Workflow token permissions not restricted
- dormant codebase — no living knowledge left to concentrate
New (64)
- AutowiredEmitter.emit (cognitive 21) (arouter-compiler-ksp/src/main/java/com/alibaba/android/arouter/compiler/ksp/AutowiredEmitter.java)
- AutowiredProcessor.generateHelper (cyclomatic 18) (arouter-compiler/src/main/java/com/alibaba/android/arouter/compiler/processor/AutowiredProcessor.java)
- AutowiredSymbolProcessor.parse (cognitive 18) (arouter-compiler-ksp/src/main/java/com/alibaba/android/arouter/compiler/ksp/AutowiredSymbolProcessor.java)
- AutowiredSymbolProcessor.process (cognitive 17) (arouter-compiler-ksp/src/main/java/com/alibaba/android/arouter/compiler/ksp/AutowiredSymbolProcessor.java)
- AutowiredSymbolProcessor.validateField (cognitive 17) (arouter-compiler-ksp/src/main/java/com/alibaba/android/arouter/compiler/ksp/AutowiredSymbolProcessor.java)
- AutowiredSymbolProcessor.validateField (cyclomatic 16) (arouter-compiler-ksp/src/main/java/com/alibaba/android/arouter/compiler/ksp/AutowiredSymbolProcessor.java)
- Benchmark.assert_common_artifacts (cognitive 25) (gradle/benchmark-ksp.py)
- Benchmark.copy_dependency_tree (cognitive 35) (gradle/benchmark-ksp.py)
- Benchmark.copy_dependency_tree (cyclomatic 18) (gradle/benchmark-ksp.py)
- Benchmark.device_preflight (cognitive 18) (gradle/benchmark-ksp.py)
- Benchmark.freeze_local_repository (cognitive 21) (gradle/benchmark-ksp.py)
- Benchmark.invoke (cognitive 31) (gradle/benchmark-ksp.py)
- Benchmark.invoke (cyclomatic 21) (gradle/benchmark-ksp.py)
- Benchmark.measure (cognitive 53) (gradle/benchmark-ksp.py)
- Benchmark.measure (cyclomatic 22) (gradle/benchmark-ksp.py)
- Benchmark.prepare (cognitive 27) (gradle/benchmark-ksp.py)
- Benchmark.prepare (cyclomatic 20) (gradle/benchmark-ksp.py)
- Benchmark.summarize (cognitive 24) (gradle/benchmark-ksp.py)
- Benchmark.verify_measured_work (cognitive 27) (gradle/benchmark-ksp.py)
- Benchmark.verify_measured_work (cyclomatic 19) (gradle/benchmark-ksp.py)
- …and 44 more
Changes since last survey
- 72 commits — 46 feature/other, 26 fixes
By area
- (repo) — 14 commits
- arouter-api/src — 12 commits
- .github/workflows — 8 commits
- (root) — 6 commits
- app/src — 6 commits
- gradle/configuration-cache-fixture — 5 commits
- arouter-compiler/src — 4 commits
- arouter-gradle-plugin/src — 4 commits
- gradle/ksp-fixture — 3 commits
- app/build.gradle — 1 commit
- app/proguard-android-test.pro — 1 commit
- arouter-api/consumer-rules.pro — 1 commit
- arouter-compiler-ksp/src — 1 commit
- arouter-idea-plugin/src — 1 commit
- gradle/kapt-room-fixture — 1 commit
- gradle/ksp-benchmark-fixture — 1 commit
- gradle/verify-configuration-cache.sh — 1 commit
- module-java/build.gradle — 1 commit
- module-java/src — 1 commit
Notable commits
- fix: Merge pull request #1084 from alibaba/fix/1.5.3-correctness
- fix: Merge pull request #1087 from alibaba/fix/device-validation
- fix: fix(annotation): isolate processing metadata from runtime model (#1060)
- fix: fix(api): avoid PackageManager dependency during route scan (#807)
- fix: fix(api): avoid blocking on interceptor callbacks (#893)
- fix: fix(api): bound interceptor initialization wait (#919)
- fix: fix(api): bundle R8 route reflection rules
- fix: fix(api): invalidate route cache after app updates (#1020)
- fix: fix(api): isolate interceptor state across reinitialization
- fix: fix(api): preserve autowired targets under R8 (#980)
- fix: fix(api): preserve fragment construction failure causes
- fix: fix(api): preserve routing failure causes
- fix: fix(api): resolve forward-result request conflicts (#955)
- fix: fix(api): retain fragment constructors under R8
- fix: fix(api): tolerate malformed legacy auto-inject extras (#1059)
- fix: fix(api): use effective context for pretreatment (#1055)
- fix: fix(compiler): compare interceptor interfaces semantically
- fix: fix(compiler): define duplicate route priority semantics (#1016)
- fix: fix(compiler): harden fragment and nullable injection
- fix: fix(ksp): preserve generic field types across Android toolchains
- …and 52 more
Architecture
- Containers 0 added · 0 removed · contexts 2 added · 1 removed · edges 1 added · 0 removed
Added bounded contexts (2)
- arouter-api
- module-java-export
Removed bounded contexts (1)
- .
Added dependency edges (1)
- module-java-export → arouter-api
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
alibaba/ARouter was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 25 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 08b926a5cd603721afbef95efd30884ba25b5a65 — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-f917f263222d.