Skip to content

feat: Add native Tsundoku (Tachiyomi/Mihon) extension support (NOT COMPLETE)#243

Merged
kazemcodes merged 14 commits into
masterfrom
feature/tsundoku-extension-support
Jun 29, 2026
Merged

feat: Add native Tsundoku (Tachiyomi/Mihon) extension support (NOT COMPLETE)#243
kazemcodes merged 14 commits into
masterfrom
feature/tsundoku-extension-support

Conversation

@kazemcodes

Copy link
Copy Markdown
Member
  • Add adapter layer to bridge Tsundoku source-api with IReader's CatalogSource
  • Create shim classes for RxJava, Injekt, NetworkHelper (no external deps)
  • Add source-api shims: HttpSource, CatalogueSource, SManga, SChapter, etc.
  • Support both Android (ChildFirstPathClassLoader) and Desktop (dex2jar)
  • Add Tsundoku extension repository to QuickAdd presets
  • Add tsundoku format parser in CatalogGithubApi
  • Add org.jsoup:jsoup dependency for HTML parsing
  • Gracefully skip extensions requiring Android APIs on Desktop

Files created:

  • data/src/commonMain/kotlin/eu/kanade/tachiyomi/ (source-api shims)
  • data/src/commonMain/kotlin/rx/ (RxJava shim)
  • data/src/commonMain/kotlin/uy/kohesive/injekt/ (Injekt shim)
  • data/src/commonMain/kotlin/tachiyomi/ (awaitSingle shim)
  • data/src/commonMain/kotlin/ireader/data/catalog/impl/tsundoku/ (adapters)
  • data/src/androidMain/kotlin/ireader/data/catalog/impl/tsundoku/ (Android loader)
  • data/src/desktopMain/kotlin/ireader/data/catalog/impl/tsundoku/ (Desktop loader)

Files modified:

  • AndroidCatalogLoader.kt (tsundoku loading + ChildFirst classloaders)
  • DesktopCatalogLoader.kt (tsundoku loading + dex2jar)
  • CatalogGithubApi.kt (tsundoku format parser)
  • CatalogRemote.kt (TSUNDOKU repository type)
  • ExtensionSource.kt (isTsundokuRepository)
  • AddingRepositryScreen.kt (QuickAdd preset + UI)
  • data/build.gradle.kts (jsoup dependency)

- Add adapter layer to bridge Tsundoku source-api with IReader's CatalogSource
- Create shim classes for RxJava, Injekt, NetworkHelper (no external deps)
- Add source-api shims: HttpSource, CatalogueSource, SManga, SChapter, etc.
- Support both Android (ChildFirstPathClassLoader) and Desktop (dex2jar)
- Add Tsundoku extension repository to QuickAdd presets
- Add tsundoku format parser in CatalogGithubApi
- Add org.jsoup:jsoup dependency for HTML parsing
- Gracefully skip extensions requiring Android APIs on Desktop

Files created:
- data/src/commonMain/kotlin/eu/kanade/tachiyomi/ (source-api shims)
- data/src/commonMain/kotlin/rx/ (RxJava shim)
- data/src/commonMain/kotlin/uy/kohesive/injekt/ (Injekt shim)
- data/src/commonMain/kotlin/tachiyomi/ (awaitSingle shim)
- data/src/commonMain/kotlin/ireader/data/catalog/impl/tsundoku/ (adapters)
- data/src/androidMain/kotlin/ireader/data/catalog/impl/tsundoku/ (Android loader)
- data/src/desktopMain/kotlin/ireader/data/catalog/impl/tsundoku/ (Desktop loader)

Files modified:
- AndroidCatalogLoader.kt (tsundoku loading + ChildFirst classloaders)
- DesktopCatalogLoader.kt (tsundoku loading + dex2jar)
- CatalogGithubApi.kt (tsundoku format parser)
- CatalogRemote.kt (TSUNDOKU repository type)
- ExtensionSource.kt (isTsundokuRepository)
- AddingRepositryScreen.kt (QuickAdd preset + UI)
- data/build.gradle.kts (jsoup dependency)
…ed source handling

- Introduced ParsedHttpSource as a base class for sources using Jsoup, providing methods for parsing popular manga, search results, latest updates, manga details, chapter lists, and page lists.
- Added ResolvableSource interface to handle opening SManga or SChapter from a given URI, including methods to get the type of URI and retrieve corresponding manga or chapter.
- Implemented JsoupExtensions for converting HTTP responses to Jsoup Document objects.
- Created RxExtension to provide an extension function for awaiting single emissions from Observables.
- Added RxCoroutineBridge to facilitate the integration of RxJava Observables with Kotlin coroutines.
- Introduced `CefResourceRequestHandler` and `CefResourceRequestHandlerAdapter` for managing resource requests.
- Added `CefResourceSkipCallback` interface for handling resource skipping.
- Implemented `BoolRef`, `IntRef`, and `StringRef` classes for reference types.
- Created `CefPostData` and `CefPostDataElement` classes for managing POST data in requests.
- Developed `CefRequest` and `CefResponse` classes to encapsulate HTTP request and response details.
- Updated `ApplicationInfoImpl`, `AndroidFiles`, and `JavaSharedPreferences` to utilize new config management.
- Added serialization extensions for settings in `SettingsSerializationExt.kt`.
- Refactored various UI state classes to remove unnecessary `@Stable` annotations for improved performance.
- Enhanced dependency management in `build.gradle.kts` for Injekt library integration.
- Drop reflection-based TsundokuCatalogSource; use typed CatalogueSource directly
- Add interceptors: rate-limit, user-agent, gzip suppression, uncaught exception catch
- Wire AndroidCookieJar and request helpers (GET/POST/PUT/DELETE)
- Expose Context stubs for file/cache dirs on non-Android targets
Add HTML parsing for novel content using Ksoup.
Refactor model conversions to handle relative/absolute URL
mismatches between Tachiyomi extensions and internal models.
Enable HttpSource base URL access for proper path joining.
Lower default log severity to Info for better debugging.
…ading

- allow single APK to register multiple catalog sources
- replace slf4j shim with system out/err logging
- implement parent-last ChildFirstPathClassLoader
- trim unused ViewParent interface methods
- update build config to include Log.java stub
…ading

- Allow multiple sources per extension APK via flatMap mapping
- Switch to ChildFirstPathClassLoader for better isolation
- Relax lib version constraints (1.3–2.0) and tolerate invalid formats
- Fetch icon from PackageInfo instead of empty string
- Use source ID from GitHub API for unique identification
- Update desktop loader to match android behavior

→ skipped: explicit version bump checks, add when releasing.
Move platform-agnostic parsing, listings, and trivial overrides from
Android/Desktop TsundokuCatalogSource into new BaseTsundokuCatalogSource
in commonMain. This eliminates duplication between platforms.

Remove unused dependencies (OkHttpClient, Json) from DI modules as they
are no longer needed in the loader layer.

Fix duplicate catalog entry in AndroidCatalogLoader.
Move dex2jar conversion from DesktopCatalogLoader and
DesktopTsundokuExtensionLoader into a new Dex2JarConverter
utility class. This removes duplicated try/catch blocks and
external library imports from loaders. Also refine
TsundokuCatalogSource to catch UninitializedPropertyAccessException
instead of generic Exception for safer property access.

ponytail: Extracted shared logic → reduces duplication, improves testability.
Eliminated the entire `android-compat/Config` module, removing
dependency injection for config management, logging initialization,
and Typesafe Config usage. Removed unused ImageIO and OkHttp
dependencies from build scripts.

→ skipped: migration of config consumers, add when all callers updated.
Add native Android icon extraction for system-wide extensions and
integrate apk-parser for local APKs on both Android and Desktop.
Icons are saved as PNGs in the extension directory to improve
catalog UI fidelity.
Implement onError fallbacks for Clean, Enhanced, and Modern
catalog cards to display initials when image loading fails.

Filter catalog list in CatalogGithubApi to show only novel-type
entries (`isNovel == true`).

Update icon URL generation to use package name instead of APK
filename for consistency.
- Remove verbose node-iteration logic in BaseTsundokuCatalogSource
- Use marker-based splitting for robust whitespace handling across nesting depths
- Strip noise elements (scripts, styles) before extraction
- Clean up stale setup docs and ignore files

ponytail: revert to old parser if marker collision occurs with exotic HTML → add escape sequence validation.
- Implement bidirectional sync between IReader and Tsundoku filter states
- Support pre-fetched HTML via Commands for manga details, chapters, and pages
- Add SearchListing to available catalog listings
- Normalize chapter numbers to double and reverse chapter lists
- Use Ksoup for HTML parsing in fetch command handlers
@kazemcodes kazemcodes merged commit 311ec17 into master Jun 29, 2026
0 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant