How keiyoushi/extensions-lib works
Main Components
• Library Module: The project’s core is the “library” folder, and within that, the Android library module. This module is what developers will include as a dependency into Tachiyomi.
• Android Platform Integration: Notice the AndroidManifest.xml and the usage of various Android and androidx components. These elements indicate Android framework integration, especially for UI preferences (see the androidx/preference package).
• Network Layer: There is a dedicated network package managing HTTP requests, JavaScript engine functionality (JavaScriptEngine.kt), and network helpers (NetworkHelper.kt, OkHttpExtensions.kt). It even includes specialized interceptors (RateLimitInterceptor and SpecificHostRateLimitInterceptor) for request management.
• Source Handling: The “source” package (and its subpackages ‘model’ and ‘online’) encapsulates the logic for various data sources—for example, CatalogueSource, ConfigurableSource, and ParsedHttpSource—each of which defines the contract for how Tachiyomi extensions retrieve content.
• Utility Components: A utilities package (e.g., util/JsoupExtensions.kt) that likely assists with parsing HTML and other common tasks encountered in a content aggregation extension library.
• Library Module as the central component from which everything emanates.
• Inside this module, create distinct subcomponents or layers:
• Android Foundation Layer: Represent AndroidManifest.xml, and the android and androidx/preference packages, indicating the integration with Android’s UI/Preference systems.
• Source Abstraction Layer: Show the source package, differentiating between general interfaces (Source.kt, SourceFactory.kt) and the online-specific implementations (ParsedHttpSource.kt). Additionally, indicate the “model” subpackage (containing classes like SManga, SChapter, Page, etc.) as the data structures consumed and produced by these sources.
Architectural Patterns and Design Principles
• Modular Design: The clear separation into packages (android, network, source, util) demonstrates a modular approach, making it easier to manage complexity and enforce separation of concerns.
Relevant Technologies and Frameworks
• Android SDK: Indicated by the AndroidManifest.xml, Context.java, and androidx preference classes.
• OkHttp (implied by OkHttpExtensions and the nature of network requests).
• Gradle: Shown by build.gradle files and gradle wrapper; this informs you about build and dependency management.
• Tachiyomi: As this is an extensions library for Tachiyomi, ensure to indicate the integration point at which Tachiyomi would use this library (likely through the dependency mechanism defined in the README).