IReader Extension

December 30, 2025 ยท View on GitHub

This repository contains the available extension catalogues for the IReader app.

Usage

Extension sources can be downloaded, installed, and uninstalled via the main IReader app. They are installed and uninstalled like regular apps, in .apk format.

Contributing

Contributions are welcome!

To get started with development, see CONTRIBUTING.md.

Check out the repo's sample.

Quick Start

Creating a New Source

python scripts/add-source.py

Answer 4 questions and get a working source template:

  1. Source name (e.g., NovelFull)
  2. Website URL (e.g., https://novelfull.com)
  3. Language code (e.g., en)
  4. Is it a Madara site? (y/n)

For Madara sites - generates zero-code source using @MadaraSource annotation.

For other sites - generates SourceFactory template with KSP annotations (@AutoSourceId, @GenerateFilters, @GenerateCommands). Just update the CSS selectors.

See ADD_SOURCE_GUIDE.md for details.

Legacy Scripts

# Old script (still works)
python scripts/create-empty-source.py NovelExample https://novelexample.com en

# Convert from lnreader-plugins
python scripts/js-to-kotlin-converter.py plugin.ts en

๐Ÿงช Source Test Server

A built-in test server for testing IReader sources with real data. Features:

  • Visual Browser - Browse novels like a real website at /browse
  • API Tester - Test source methods with JSON responses at /
  • dex2jar Integration - Automatically loads sources from compiled APKs
  • 85+ Sources - All compiled sources available for testing

Running the Test Server

# Option 1: Quick start (uses cached APKs)
./gradlew testServer

# Option 2: Build all sources first, then start server
./gradlew buildAndTest

# Option 3: Manual steps
./gradlew assembleDebug          # Build sources
./gradlew :source-test-server:run  # Start server

Server runs at http://localhost:8080

Android Studio Run Configurations

The project includes pre-configured run configurations (in the toolbar dropdown):

ConfigurationDescription
๐Ÿงช Test ServerStart the test server
๐Ÿ”จ Build All SourcesCompile all source APKs
๐Ÿš€ Build + Test ServerBuild sources then start server
๐Ÿ†” Generate Source IDGenerate a unique source ID

Quick Commands

CommandDescription
./gradlew testServerStart test server (port 8080)
./gradlew buildAndTestBuild all sources + start server
./gradlew listSourcesList all sources with build commands
./gradlew buildSourceHelpShow build command format

Building a Single Source

To build just one source (faster than building all):

# Format: ./gradlew :extensions:individual:{lang}:{name}:assembleDebug

# Examples:
./gradlew :extensions:individual:en:freewebnovel:assembleDebug
./gradlew :extensions:individual:en:royalroad:assembleDebug
./gradlew :extensions:individual:en:novelfull:assembleDebug

# Then start the test server
./gradlew testServer

Run ./gradlew listSources to see all available sources with their build commands.

Available Endpoints

EndpointDescription
/API Tester UI - Test source methods
/browseVisual Browser - Browse novels like a real website
/browse/{sourceId}Browse specific source
/browse/{sourceId}/novel?url=...View novel details
/browse/{sourceId}/read?url=...Read chapter content
/api/sourcesList all loaded sources (JSON)
/api/sources/{id}/search?q=...Search novels
/api/sources/{id}/details?url=...Get novel details
/api/sources/{id}/chapters?url=...Get chapter list
/api/sources/{id}/content?url=...Get chapter content
/api/sources/{id}/testRun automated test suite

Updating Sources

When you modify a source, you need to recompile and restart:

# Recompile specific source
./gradlew :sources:en:freewebnovel:assembleDebug

# Restart the server
./gradlew :source-test-server:run

The server loads sources at startup from APKs using dex2jar. JAR cache is automatically invalidated when APK changes.

How It Works

  1. APK Discovery - Scans sources/*/build/intermediates/apk/*/debug/*.apk
  2. dex2jar Conversion - Converts DEX bytecode to JAR (cached in source-test-server/jar-cache/)
  3. Dynamic Loading - Loads tachiyomix.extension.Extension class from each JAR
  4. Source Registration - Registers sources with mock dependencies for testing

Common Utilities

The repository includes shared utilities to reduce code duplication:

  • DateParser: Parse relative and absolute dates
  • StatusParser: Normalize status strings
  • ErrorHandler: Standardized error handling with retry logic
  • ImageUrlHelper: Handle image URLs and lazy loading
  • SelectorConstants: Common CSS selectors for popular themes

See Common Utilities README for details.

Recent Improvements

  • โœจ Added common utilities module for code reuse
  • ๐Ÿ› ๏ธ Created extension generator scripts
  • ๐Ÿ“ Added comprehensive documentation
  • ๐Ÿ”ง Improved build configuration
  • ๐ŸŽจ Added code quality tools (EditorConfig, Detekt)
  • ๐Ÿ“‹ Added GitHub issue templates
  • ๐Ÿงช Added source test server with visual browser

See IMPROVEMENTS.md for full details.

Disclaimer

The core architecture of this repository was originally inspired by Tachiyomi Extensions, but has been significantly modified and extended for IReader.

License

Copyright (C) 2022 The IReader Open Source Project

This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.