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 / chinese-language-extensions

Chinese Language Extensions

Overview

src/zh/ contains the Chinese-language extension modules. Each immediate child directory is one Android extension project with a build.gradle.kts, launcher resources, and usually Kotlin sources under src/eu/kanade/tachiyomi/extension/zh/<module>/. The Gradle files declare the user-facing source name, lang = "zh", content warning, source ID/base URL or mirrors, optional deeplink paths, and whether the project is backed by a shared multisrc theme. For example, src/…/build.gradle.kts is a config-only Kei source with deeplinks for /manhua-..* and /view-..*, while src/…/build.gradle.kts declares theme = "madara" and the Kotlin class in src/…/Bakamh.kt only supplies site-specific overrides.

Most custom providers are @Source abstract class ... : KeiSource() implementations. They implement the same source lifecycle: list pages (getPopularManga, getLatestUpdates, getSearchMangaList), detail/chapter refresh (fetchMangaUpdate), reader pages (getPageList), filter construction, and optional URL routing through getMangaByUrl, getMangasByUrl, or fetchBaseUrls. State is normally in Tachiyomi/Mihon models (SManga, SChapter, Page) and Android SharedPreferences for configurable login, filtering, mirror, or content settings.

Directory/module organization

Common source implementation patterns

  • HTML catalogue providers fetch documents with Fetch.DOCUMENT, parse cards with Jsoup, and return MangasPage. src/…/Zerobyw.kt lists cards from a[href*=/details/?kuid=], maps chapters from div.grid a[href*=/view/index.php], and strips comment-count decorations from titles. src/…/Longjinman.kt builds /bookcata/.../page/<n> and /search/.../page/<n> URLs, then parses .module-poster-item, .module-info-main, and #m_r_imgbox_0 img[data-src].
  • JSON/API providers construct API URLs or JSON POST bodies, deserialize DTOs, and use frontend URLs only for user-visible links. src/…/Zazhimi.kt uses https://android2026.zazhimi.net/api, exposes a single 全本 chapter, and marks details ONLY_FETCH_ONCE. src/…/Utifa.kt posts to /api/manga/common/list, fetches category data from /api/manga/common/categoryTree, and re-signs image URLs after 403 responses because chapter page links expire after about 30 minutes.
  • Authenticated/configurable providers implement ConfigurableSource and install request interceptors. src/…/Picacomic.kt signs Pica API requests with HMAC headers, stores login token/channel/image-quality/blocklist preferences, refreshes tokens on 401, and can route favourites via a filter. src/…/Zaimanhua.kt stores username/password/token preferences, retries chapter/image requests with auth headers, and optionally appends a chapter comments page. src/…/NoyAcg.kt uses a session cookie jar and synchronized login retry when an API response indicates login is required.
  • Mirror/domain discovery appears where source domains rotate. src/…/Zerobyw.kt fetches the current base URL from https://stevenyomi.github.io/source-domains/zerobyw.txt; src/…/WNACG.kt merges a remote domain list with hard-coded unlisted mirrors and rate-limits mirror hosts; src/…/ManwaManhua.kt decodes candidate domains from https://mwmw.cc/ and selects the first one whose /check endpoint answers; src/…/Longjinman.kt reads backup domains from footer friend links.
  • Page protection/decoding is usually localized in the provider. src/…/ManwaManhua.kt decrypts /en_images/ responses with aesDecryptWithPrependedIv; src/…/Miaoqu.kt base64-decodes and XORs var DATA using a chapter-ID-derived key; src/…/Roumanwu.kt installs ScrambledImageInterceptor and falls back from Next.js data to TanStack hydration strings when parsing page URLs.
  • Dynamic filters often use supportsFilterFetching. src/…/Vomic.kt fetches category IDs from /c/getCatList before building CategoryFilter; src/…/BikaManhua.kt reads genres from /category/; src/…/ManwaManhua.kt scrapes tag slugs from /cate/; src/…/Utifa.kt turns API category tree entries into sort/category filters.

Notable provider/template families

Routing guidance for src/zh paths

  • Route src/…/build.gradle.kts changes to this doc because the Gradle block defines the source name, language, source ID, base URL/mirrors, content warning, deeplink paths, lib version, and multisrc theme for the provider.
  • Route src/…/<Provider>.kt to the provider’s runtime behavior: listing/search, detail/chapter refresh, URL import/deeplink handling, page loading, base URL discovery, interceptors, and preferences.
  • Route src/…/Filters.kt or Filter.kt with the owning provider, because filters are parsed directly by getSearchMangaList; query-vs-filter precedence is source-specific, as seen in src/…/Zerobyw.kt, src/…/Zazhimi.kt, and src/…/Zaimanhua.kt.
  • Route src/…/Dto.kt, *Dto.kt, Response.kt, and decoder helpers with their provider. DTO shape changes feed parse calls in the provider class and can silently break API flows.
  • Route src/…/*Interceptor.kt, cookie jars, signers, and WAF/session helpers with their provider. These files usually control auth, anti-bot, image retry/decryption, or page availability (Zaimanhua comments/image retry, Vomic request signing, BookWalkerTaiwan WAF/Publus, NoyAcg sessions).
  • Treat res/…/ic_launcher.png changes as provider metadata/icon-only unless paired with Kotlin or Gradle changes.

Path-routable coverage notes

  • src/…/build.gradle.kts: extension packaging metadata, source IDs, base URLs/mirrors, content warnings, deeplinks, and multisrc theme declarations for all Chinese providers.
  • src/…/*.kt: standalone source implementations, multisrc overrides, DTOs, filters, interceptors, preference screens, URL import/deeplink handlers, API clients, page parsers, and site-specific decoding/signing logic.
  • src/zh/**/res/**: extension-owned resources such as launcher icons; these do not change runtime parsing unless accompanied by Gradle/source changes.

Coupling

Risks

  • src/…/Picacomic.kt: API requests depend on exact mobile headers, HMAC input, nonce/time fields, channel DNS, and token refresh. If any signed header, Content-Type, or URL path normalization changes, the API can reject every listing/detail/page request or fail login refresh.
  • src/…/Zaimanhua.kt: the auth interceptor conditionally retries PC and H5 chapter APIs with bearer tokens and image retry depends on URL fragments. If request headers/fragments are stripped or token validity parsing changes, paid/hidden chapters can appear empty or images can stay broken after cached URLs expire.
  • src/…/BookWalkerTaiwan.kt: page loading depends on WAF handling, a viewer redirect, parsing js/config.js for serverDomain, and Publus auth. If the viewer route or config regex drifts, details may still parse but getPageList returns an empty list for protected books.
  • src/…/ManwaManhua.kt: the selected live domain is discovered from base64-encoded address-page content and image responses under /en_images/ are decrypted by an interceptor. If the address page format, /check marker, or image encryption key changes, startup can find no base URL or pages can download unreadable encrypted data.
  • src/…/Miaoqu.kt and src/…/SixMH.kt: reader pages decode obfuscated payloads (var DATA XOR/base64 for Miaoqu, params = '<base64>' for SixMH). If the obfuscation marker or key schedule changes, listings/details may continue to work while all chapter pages fail.