Komikku Documentation

repository·master·Indexed 26 days ago

https://github.com/komikku-app/komikku

An open-source Android manga reader based on the Tachiyomi/Mihon ecosystem. It features automatic theme coloring, enhanced library management, and tracker synchronization with services like MyAnimeList and AniList. The documentation covers installation for Android 8.0+, developer guides for regenerating baseline profiles, image loading implementation via Coil, and logging configuration using the EXH system.

Tokens
2.4K
Snippets
3
Records
6
Agent score
89%

What's inside Komikku

  1. Overview of Komikku features

    master

    Komikku is a manga reader fork based on TachiyomiSY and Mihon/Tachiyomi. It provides a wide range of features including:

    Core Functionality

    • Online & Local Reading: Read from various online sources or from downloaded content.
    • Tracker Support: Sync progress with MyAnimeList, AniList, Kitsu, MangaUpdates, Shikimori, and Bangumi.
    • Library Management: Organize manga with categories, schedule updates, and create local or cloud backups.

    Unique Komikku Features

    • Suggestions: Automatically shows source-website recommendations for the current entry.
    • Visual Customization: Auto theme color based on cover art, custom app themes with color palettes, and panorama covers.
    • Library Enhancements: Bulk-favorite entries, merge multiple library entries, and range-selection for migration.
    • Advanced UI: Grouped entries in the Update tab, update notifications with covers, and a 'Feed' that supports all sources with up to 20 items.
    • Efficiency: Fast browsing for large libraries and auto 2-way sync with trackers.
  2. Download Komikku

    master

    Komikku is a free and open-source manga reader for Android. It requires Android 8.0 or higher. You can download the application via the following release channels:

    • Stable: For general users seeking a reliable experience.
    • Preview: For users who want to test the latest features and improvements before they reach the stable build.

    Always ensure you are downloading from the official GitHub releases page to get the latest version.

    https://github.com/komikku-app/komikku/releases/latest
  3. Regenerate Baseline Profiles

    master

    Baseline profiles enable AOT (Ahead-of-Time) compilation for critical user paths during app launch. If you make changes to the code that affect app startup, you must regenerate the baseline profile located at app/src/main/baseline-prof.txt.

    To regenerate the profile:

    1. Select the devBenchmark build variant in your IDE.
    2. Run the BaselineProfileGenerator benchmark test on an AOSP Android Emulator.
    3. Copy the generated baseline profile from the emulator to the project file at app/src/main/baseline-prof.txt.
  4. Report bugs and request features in Komikku

    master

    If you encounter issues or want to suggest new features, follow these guidelines:

    Before reporting

    1. Check the FAQ.
    2. Review the changelog.
    3. Search existing issues to see if it has already been reported.

    Reporting a Bug

    When submitting a bug report via the issue forms, include:

    • App Version: Found via More $\rightarrow$ About $\rightarrow$ Version.
    • Steps to reproduce: Clear instructions on how to trigger the bug.
    • Screenshots: If applicable.
    • Device Info: Note if the issue seems device-dependent.

    Feature Requests

    • Provide a detailed description of what the feature should do and how it should work.
    • Include screenshots if they help illustrate the concept.
  5. Implement SingletonImageLoader.Factory in Komikku

    master

    The App class implements SingletonImageLoader.Factory to provide a custom ImageLoader for the application using the Coil library. This configuration includes specialized fetchers and decoders for manga covers and page previews, as well as optimized coroutine contexts for image loading.

    Key components configured in the ImageLoader:

    • OkHttpNetworkFetcherFactory: Uses the application's NetworkHelper client.
    • TachiyomiImageDecoder.Factory: Custom decoder for manga content.
    • BufferedSourceFetcher.Factory: Standard fetcher.
    • MangaCoverFetcher.MangaCoverFactory & MangaCoverFetcher.MangaFactory: Specialized fetchers for manga covers.
    • MangaCoverKeyer & MangaKeyer: Custom keyers for cache management.
    • PagePreviewFetcher.Factory & PagePreviewKeyer: Specialized components for page previews.

    Performance optimizations:

    • fetcherCoroutineContext: Uses Dispatchers.IO.limitedParallelism(8).
    • decoderCoroutineContext: Uses Dispatchers.IO.limitedParallelism(3).
    • allowRgb565: Enabled on low-RAM devices to save memory.
    override fun newImageLoader(context: Context): ImageLoader {
        return ImageLoader.Builder(this).apply {
            val callFactoryLazy = lazy { Injekt.get<NetworkHelper>().client }
            components {
                add(OkHttpNetworkFetcherFactory(callFactoryLazy::value))
                add(TachiyomiImageDecoder.Factory())
                add(BufferedSourceFetcher.Factory())
                add(MangaCoverFetcher.MangaCoverFactory(callFactoryLazy))
                add(MangaCoverFetcher.MangaFactory(callFactoryLazy))
                add(MangaCoverKeyer())
                add(MangaKeyer())
                add(PagePreviewKeyer())
                add(PagePreviewFetcher.Factory(callFactoryLazy))
            }
            diskCache(
                DiskCache.Builder()
                    .directory(context.cacheDir.resolve("image_cache"))
                    .maxSizePercent(0.02)
                    .build(),
            )
            memoryCache(MemoryCache.Builder().maxSizePercent(context).build())
            crossfade((300 * this@App.animatorDurationScale).toInt())
            allowRgb565(DeviceUtil.isLowRamDevice(this))
            fetcherCoroutineContext(Dispatchers.IO.limitedParallelism(8))
            decoderCoroutineContext(Dispatchers.IO.limitedParallelism(3))
        }
        .build()
    }
  6. Configure Logging with EXH (Enhanced Logging)

    master

    Komikku uses the EXH logging system. The logging level and behavior are determined by the build type and specific logging flags.

    Log levels are mapped as follows:

    • EHLogLevel.isExtremeLogging(): LogLevel.ALL
    • EHLogLevel.isExtraLogging(): LogLevel.DEBUG
    • Default: LogLevel.WARN

    Logging includes:

    • AndroidPrinter: Standard Android logcat output.
    • EnhancedFilePrinter: Writes logs to the directory provided by StorageManager.getLogsDirectory(). Files are named using a DateFileNameGenerator and include the build type in the filename.
    • CrashlyticsPrinter: Installed in production builds to send LogLevel.ERROR logs to Crashlytics.
    • DebugLogger: Used in debug builds if EHLogLevel.isExtraLogging() is active.
    // Log level mapping logic
    val logLevel = when {
        EHLogLevel.isExtremeLogging() -> LogLevel.ALL
        EHLogLevel.isExtraLogging() -> LogLevel.DEBUG
        else -> LogLevel.WARN
    }
    
    // Printer configuration
    val printers = mutableListOf<Printer>(AndroidPrinter())
    val logFolder = Injekt.get<StorageManager>().getLogsDirectory()
    
    if (logFolder != null) {
        printers += EnhancedFilePrinter.Builder(logFolder) {
            fileNameGenerator = object : DateFileNameGenerator() {
                override fun generateFileName(logLevel: Int, timestamp: Long): String {
                    return super.generateFileName(logLevel, timestamp) + "-${BuildConfig.BUILD_TYPE}.txt"
                }
            }
            flattener { timeMillis, level, tag, message ->
                "${dateFormat.format(timeMillis)} ${LogLevel.getShortLevelName(level)}/$tag: $message"
            }
            backupStrategy = NeverBackupStrategy()
        }
    }
    
    if (telemetryIncluded) {
        printers += CrashlyticsPrinter(LogLevel.ERROR)
    }