Introducing a new way to review your PRs.

Read the announcement

keiyoushi / extensions-source

Source code of extensions in https://github.com/keiyoushi/extensions

View on GitHub

13 documents · Updated Nov 19, 2026

docs / all-language-extensions

All-language extension modules

Overview

src/all/** is the extension collection for sources that are language-neutral, provide multiple language variants from one implementation, or target user-configured/self-hosted services rather than one fixed locale. Each child directory is an Android extension module with its own build.gradle.kts, launcher assets, and Kotlin source under src/eu/kanade/tachiyomi/extension/all/<module>/. The Gradle keiyoushi { source { ... } } blocks are the source registry: single-provider modules usually declare one lang = "all" source, while global sites declare one source per supported language by iterating a language list.

Most source implementations are annotated with @Source and extend KeiSource, then implement the standard source flow: getPopularManga, getLatestUpdates, getSearchMangaList, fetchMangaUpdate, getPageList, and URL helpers. State is usually either remote site state fetched over OkHttp or per-source preferences via getPreferencesLazy()/getPreferences(). Modules that need settings implement ConfigurableSource; local/self-hosted modules often also implement UnmeteredSource because they target a LAN or user-owned server.

The all package is intentionally broad. Route reviews by the first path segment after src/all/: for example, src/all/mangadex/** belongs to the MangaDex API source, src/all/komga/** to the Komga self-hosted source, and src/all/cubari/** to Cubari plus supported gallery URL ingestion. Shared Android assets such as res/…/ic_launcher.png are part of the same extension module but usually only affect packaging/branding, not source behavior.

Directory/module organization

  • src/…/build.gradle.kts defines extension metadata (name, versionCode, contentWarning, libVersion), generated source instances, optional deeplink routing, and direct library dependencies. Multi-language providers use language loops, as in src/…/build.gradle.kts, src/…/build.gradle.kts, and src/…/build.gradle.kts.
  • src/…/<Provider>.kt is normally the entry point. Larger providers split DTOs, filters, constants, queries, and preferences into sibling files such as src/all/mangadex/src/eu/kanade/tachiyomi/extension/all/mangadex/dto/*, src/…/Queries.kt, or src/all/komga/src/eu/kanade/tachiyomi/extension/all/komga/*.
  • src/all/<provider>/assets/** holds provider-specific static resources and i18n bundles. Examples include xkcd fonts/thumbnails under src/all/xkcd/assets/** and localized settings strings under modules such as src/all/yellownote/assets/i18n/**.
  • src/all/<provider>/res/** is packaging UI/launcher resource coverage for the extension APK and should be reviewed with the owning provider module.

Common extension patterns

  • Multi-source generation is driven from Gradle. src/…/build.gradle.kts declares many source entries for all, regional Chinese and Spanish variants, and many translated languages; src/…/MangaDex.kt maps those app language codes to MangaDex API codes with dexLang before building API query parameters.
  • Deep links are declared beside source generation and resolved in getMangaByUrl/getMangasByUrl. src/…/build.gradle.kts accepts mangaplus.shueisha.co.jp and jumpg-webapi.tokyo-cdn.com title/viewer paths, and src/…/MangaPlus.kt converts title, viewer, and share URLs into title IDs before fetching protobuf API data.
  • Configurable sources use preferences as part of runtime routing. src/…/Komga.kt reads address, credentials/API key, display name, default libraries, and chapter title templates from preferences, then builds /api/v1 list/search/detail/page URLs. src/…/LANraragi.kt similarly stores hostname, API key, random-search behavior, namespace parsing, and custom labels.
  • Remote API sources often parse JSON/protobuf DTOs and only scrape HTML for website-only flows. src/…/MangaDex.kt uses API endpoints for manga, chapters, covers, lists, and uploader searches; src/…/MangaPlus.kt uses parseAsProto and an image XorInterceptor; src/…/Webtoons.kt scrapes ranking/search/detail pages but uses the mobile API for episode lists.
  • Some modules wrap reusable platform/multisrc behavior with a minimal local source class. src/…/FoolSlideCustomizable.kt is only an @Source subclass of eu.kanade.tachiyomi.multisrc.foolslide.FoolSlide, while src/…/build.gradle.kts makes the base URL user-customizable.
  • WebView is used only where the remote site hides necessary state in browser storage or page scripts. src/…/Cubari.kt runs a WebView to read Cubari pinned/history state from the site's remoteStorage cache and to tag newly searched series in that history.

Notable provider families

  • Global public catalogues: src/all/mangadex/**, src/all/mangaplus/**, and src/all/webtoons/** are multi-language public services. They generate several language-specific source instances from one codebase, translate language codes internally, and enforce provider-specific constraints such as content ratings, language filters, session/view tokens, or locale cookies.
  • Self-hosted/local providers: src/all/komga/**, src/all/lanraragi/**, src/all/jellyfin/**, and src/all/stashapp/** target user-owned servers. Their baseUrl is preference-driven or intentionally localhost-like in Gradle, authentication is configured in the extension settings, and they use LAN-friendly client behavior such as Dns.SYSTEM or unmetered marking. src/…/Jellyfin.kt also downloads and reads archive/PDF pages through a PageReader cache because a Jellyfin book file must be converted into reader pages.
  • Gallery/booru-style providers: modules such as src/all/danbooru/** represent pools/posts as manga and chapters. src/…/Danbooru.kt can expose a pool either as one oneshot chapter or split each post into a chapter based on preferences, and adjusts CDN image headers to avoid 403s.
  • URL-ingestion and aggregator flows: src/all/cubari/** accepts Cubari, Imgur, Reddit gallery, ImgChest, Catbox, and GitHub raw/gist-like URLs in code, while its Gradle file declares the matching deeplinks. Search history/pinned entries are not a normal server catalogue; they come from Cubari browser storage and series APIs.
  • Customizable multisrc wrappers: src/all/foolslidecustomizable/** and similar small modules are path-routable because their Gradle metadata and base URL customizations live under src/all, even when the real parsing implementation is inherited from a multisrc outside this doc's coverage.

Routing guidance for src/all paths

  • If the path is src/…/build.gradle.kts, check generated source instances, language codes, id stability, content warning, dependencies, and deeplink hosts/paths for that provider. A Gradle-only change can still affect installation identity or URL routing.
  • If the path is src/…/<Provider>.kt, review the source lifecycle end to end: listing/search, URL resolution, details/chapter update, page/image request handling, and settings. For large providers, sibling Dto.kt, Filters.kt, Queries.kt, Constants.kt, or Preferences.kt files are direct dependencies of that same provider flow.
  • If the path is under src/all/<provider>/assets/** or res/**, route it to the same provider. Asset-only changes can alter localized preference text, fonts, thumbnails, or launcher resources, but usually do not affect network behavior unless code references the asset path.
  • If a provider's build.gradle.kts declares several sources, do not assume a code change affects only lang = "all". For example, MangaDex language mapping in src/…/MangaDex.kt affects every generated source from src/…/build.gradle.kts.
  • If a provider stores credentials, tokens, server addresses, or source display names in preferences, verify preference keys and migration behavior when changing settings UI or authentication. Komga, LANraragi, Jellyfin, and StashApp all depend on persisted settings for normal operation.

Coupling

  • If a deeplink block changes in src/…/build.gradle.kts, also verify the provider's getMangaByUrl/getMangasByUrl path parsing. src/…/build.gradle.kts lists multiple gallery hosts, and src/…/Cubari.kt must keep matching host/path parsing for those links to resolve.
  • If generated source languages change, verify language-to-provider-code mapping in the source class. src/…/build.gradle.kts includes zh-Hans, zh-Hant, fil, pt-BR, and es-419, and src/…/MangaDex.kt rewrites those before querying MangaDex; src/…/build.gradle.kts and src/…/MangaPlus.kt have a similar fixed language map.
  • If self-hosted auth settings change, verify both request headers/interceptors and preference-screen login/token invalidation. src/…/Komga.kt chooses API key over username/password and refreshes library preferences after login; src/…/Jellyfin.kt removes the cached token when address or account preferences change.
  • If page/image URL formats change, verify the matching image request interceptor. src/…/MangaPlus.kt stores the viewer token in Page.url and sends it as Plus-Vw-Token; src/…/Jellyfin.kt encodes archive/PDF page metadata in URL fragments that PageReader intercepts.
  • If filter DTOs or query payloads change, verify both fetchFilterData and getFilterList. Komga, LANraragi, Jellyfin, MangaPlus, and Webtoons all fetch remote filter data and later deserialize or interpret it when building search requests.

Risks

  • src/…/Webtoons.kt parses episode numbers with a broad localized regex and falls back to sequential numbering when unrecognized episodes outnumber recognized ones. If the site changes episode title formats, chapter numbers can silently reorder or collapse into fallback numbering.
  • src/…/Cubari.kt depends on Cubari page globals such as globalHistoryHandler, history-ready, and tag() through WebView JavaScript. If the site's client-side storage API changes, popular/latest/search history flows fail even when the JSON series API still works.
  • src/…/Komga.kt documents in code that Komga sessions are shared per host with the app tracker, and the settings dialog warns that same-host accounts require a different hostname. Changing auth behavior without preserving that constraint can make multiple Komga source instances authenticate as the wrong user.
  • src/…/Jellyfin.kt converts whole book files into page lists by downloading archives/PDFs and caching through PageReader; slow servers use a no-timeout download client. Changes to fragment formats (ZIP_PAGE, PDF_PAGE, FILE_PAGE) or range handling can break image loading for already listed chapters.