$ show xiaojieonly/Ehviewer_CN_SXJ
EhViewer_CN_SXJ is an Android application for browsing, searching, and downloading content from E-Hentai (a manga/doujinshi platform). It provides a full-featured gallery viewer with offline download management, image caching, and archive extraction. The app integrates native C/C++ libraries (libjpeg-turbo, libpng, libwebp, giflib) via JNI for high-performance image decoding, and uses a custom OpenGL-based rendering framework (GLView) for smooth gallery navigation. The architecture is a monolith with a scene-based UI navigation system, a SQLite-backed persistence layer (greenDAO), and a custom HTTP client built on OkHttp with proxy and cookie management. The codebase is a mix of Java and Kotlin, with extensive native code for image processing and SIMD optimizations (SSE, NEON, MIPS). While the app is functional and actively maintained, it exhibits significant technical debt: tight coupling to E-Hentai's HTML structure, deprecated Android API usage, a forked Android-like environment, and heavy vendored native libraries that require ongoing security updates. The project demonstrates some reusable patterns (Conaco caching, UniFile abstraction, custom collections) but overall is a domain-specific application with limited generalizability.
The LLM identified 5 files worth highlighting for reuse:
Generic multi-tier caching framework with memory, disk, and network sources. Uses pluggable ValueHelper, ValueCache, and Register components to manage lifecycle, serialization, and eviction. Demonstrates clean separation of concerns and could be extracted for any project needing a configurable cache with async loading.
Abstract file I/O interface that unifies access to raw files, content URIs, and media store documents. Provides open/read/write/delete operations with a consistent API. The adapter pattern allows different backends (local, cloud, archive) to be swapped without changing client code. Reusable in any application needing a portable file system layer.
Disk-backed LRU cache with configurable size limits and journal-based persistence. Uses StrictLineReader for robust metadata parsing and supports atomic operations. The design is self-contained and can be reused in any Java application requiring a persistent cache with bounded disk usage.
Custom DNS resolver that overrides hostnames with hardcoded IPs (e-hentai.org, exhentai.org) and falls back to system DNS. Uses SQLite-backed storage for user-defined host-IP mappings. Demonstrates a clean strategy pattern for network resolution and can be adapted for any app needing custom DNS routing.
Efficient primitive int list implementation with automatic growth, binary search, and Parcelable serialization. Avoids boxing overhead of ArrayList<Integer>. Includes utility methods for sorting, deduplication, and bulk operations. Reusable in any Java project needing high-performance integer collections.