How yenalyliew/han1meviewer works
Purpose and runtime
Han1meViewer is an unmaintained Android 7.0+ Kotlin application for browsing, searching, playing, managing lists/comments, and downloading Hanime content. It is a Gradle multi-module Android project: the application module is app, supported by reusable Android base/UI utilities in yenaly_libs. Primary runtime configuration is in app/build.gradle.kts and app/src/main/AndroidManifest.xml.
Application bootstrap and navigation
HanimeApplication is the process-level entry point and likely coordinates initialization, preferences, crash handling, and app-wide managers via HInitializer and HCrashHandler. MainActivity is the principal shell, with navigation declared in nav_main.xml; dedicated activities own search, preview/detail, video playback, login, downloads, and settings.
• app/src/main/java/com/yenaly/han1meviewer/HanimeApplication.kt
• app/src/main/java/com/yenaly/han1meviewer/ui/activity/MainActivity.kt
• app/src/main/res/navigation/nav_main.xml
Presentation and state boundary
The UI is conventional Android Activities/Fragments backed by feature ViewModels. Screen interactions flow from activities/fragments to ViewModels, which expose loading/domain state and invoke repositories/managers; adapters render lists. The central user paths are home/list browsing, search, preview/detail, playback/comments, authenticated “My List,” download management, and settings.
• app/src/main/java/com/yenaly/han1meviewer/ui/viewmodel/MainViewModel.kt
• app/src/main/java/com/yenaly/han1meviewer/ui/viewmodel/SearchViewModel.kt
• app/src/main/java/com/yenaly/han1meviewer/ui/viewmodel/VideoViewModel.kt
Remote-content acquisition and parsing
Network behavior is isolated under logic/network: service interfaces cover the base site, comments, user lists, subscriptions, and GitHub. HanimeNetwork/ServiceCreator construct the client path, including cookies, custom DNS/proxy selection, user-agent and speed-limit interception. NetworkRepo and Parser convert remote responses into domain models and explicit website/parse/blocking states, insulating UI from site-specific protocols and failures.
• app/src/main/java/com/yenaly/han1meviewer/logic/network/HanimeNetwork.kt
• app/src/main/java/com/yenaly/han1meviewer/logic/NetworkRepo.kt
• app/src/main/java/com/yenaly/han1meviewer/logic/Parser.kt
Local persistence, preferences, and bundled metadata
Room-like database boundaries separate watch/search history, keyframes, and downloaded-video/category data. DatabaseRepo is the application-facing persistence layer. User settings are centralized in Preferences; local assets ship search facets and seed keyframe JSON, while file/cache managers support on-device content and storage operations.
• app/src/main/java/com/yenaly/han1meviewer/logic/DatabaseRepo.kt
• app/src/main/java/com/yenaly/han1meviewer/logic/dao/DownloadDatabase.kt
• app/src/main/assets/search_options/genre.json
Playback, downloads, and background work
Video playback uses a custom media stack/data source, invoked from VideoActivity and driven by VideoViewModel. Downloads are durable background work: HanimeDownloadManager[V2] schedules/coordinates HanimeDownloadWorker, with download records persisted for the download UI. This is a critical boundary between foreground UI lifecycle and long-running network/file operations.
• app/src/main/java/com/yenaly/han1meviewer/ui/view/video/HanimeDataSource.kt
• app/src/main/java/com/yenaly/han1meviewer/worker/HanimeDownloadManagerV2.kt
• app/src/main/java/com/yenaly/han1meviewer/worker/HanimeDownloadWorker.kt
External services and operational integration
The app communicates with Hanime endpoints and GitHub APIs; GitHub models/services plus HUpdater and HUpdateWorker support release/update checks. Firebase-related constants/utilities indicate Firebase integration, though the available tree does not establish which Firebase products are active. Network settings expose DNS and proxy behavior, important for deployment variability.
• app/src/main/java/com/yenaly/han1meviewer/logic/network/HUpdater.kt
• app/src/main/java/com/yenaly/han1meviewer/worker/HUpdateWorker.kt
• app/src/main/java/com/yenaly/han1meviewer/FirebaseConstants.kt>
Shared library module
yenaly_libs supplies the app’s base application/activity/fragment/view-model classes, crash and settings framework, and navigation/view utilities. App-layer components likely inherit these abstractions rather than Android framework types directly.
• yenaly_libs/src/main/java/com/yenaly/yenaly_libs/base/YenalyApplication.kt
• yenaly_libs/src/main/java/com/yenaly/yenaly_libs/base/YenalyActivity.kt
• yenaly_libs/src/main/java/com/yenaly/yenaly_libs/base/YenalyViewModel.kt
Main entry points: HanimeApplication.kt HanimeApplication · MainViewModel.kt Feature ViewModels · NetworkRepo.kt NetworkRepo · VideoViewModel.kt VideoViewModel
Components 20
Android app
- HanimeApplication · Process initialization and app-wide managers.
app/src/main/java/com/yenaly/han1meviewer/HanimeApplication.kt - MainActivity
app/src/main/java/com/yenaly/han1meviewer/ui/activity/MainActivity.kt - Main navigation · Routes browsing and feature screens.
app/src/main/res/navigation/nav_main.xml - Feature screens · Browse, search, detail, login, downloads, and settings.
- Feature ViewModels · Screen state and user actions.
app/src/main/java/com/yenaly/han1meviewer/ui/viewmodel/MainViewModel.kt - SearchViewModel
app/src/main/java/com/yenaly/han1meviewer/ui/viewmodel/SearchViewModel.kt - VideoViewModel
app/src/main/java/com/yenaly/han1meviewer/ui/viewmodel/VideoViewModel.kt - HanimeDataSource · Custom playback content source.
app/src/main/java/com/yenaly/han1meviewer/ui/view/video/HanimeDataSource.kt
Data & services
- NetworkRepo · UI-facing remote-content boundary.
app/src/main/java/com/yenaly/han1meviewer/logic/NetworkRepo.kt - Parser · Maps site responses to models and explicit states.
app/src/main/java/com/yenaly/han1meviewer/logic/Parser.kt - HanimeNetwork · Configures cookies, DNS/proxy, user agent, and limits.
app/src/main/java/com/yenaly/han1meviewer/logic/network/HanimeNetwork.kt - Hanime & GitHub APIs
- DatabaseRepo · Application-facing local data boundary.
app/src/main/java/com/yenaly/han1meviewer/logic/DatabaseRepo.kt - DownloadDatabase
app/src/main/java/com/yenaly/han1meviewer/logic/dao/DownloadDatabase.kt - Preferences & assets · Settings and bundled search/keyframe metadata.
app/src/main/assets/search_options/genre.json
Background work
- HanimeDownloadManagerV2 · Schedules durable downloads.
app/src/main/java/com/yenaly/han1meviewer/worker/HanimeDownloadManagerV2.kt - HanimeDownloadWorker · Performs network and file download work.
app/src/main/java/com/yenaly/han1meviewer/worker/HanimeDownloadWorker.kt - HUpdater · Checks GitHub releases.
app/src/main/java/com/yenaly/han1meviewer/logic/network/HUpdater.kt - HUpdateWorker
app/src/main/java/com/yenaly/han1meviewer/worker/HUpdateWorker.kt
Shared module
- Yenaly base classes · Base application, activity, and ViewModel abstractions.
yenaly_libs/src/main/java/com/yenaly/yenaly_libs/base/YenalyApplication.kt
Connections 25
- HanimeApplication → MainActivity: launches
- HanimeApplication → Preferences & assets: initializes settings
- HanimeApplication → HUpdater: coordinates updates
- MainActivity → Main navigation: hosts
- Main navigation → Feature screens: routes to
- Feature screens → Feature ViewModels: binds state
- Feature screens → SearchViewModel: search actions
- Feature screens → VideoViewModel: playback actions
- Feature ViewModels → NetworkRepo: loads content
- SearchViewModel → NetworkRepo: searches
- VideoViewModel → NetworkRepo: loads video/comments
- Feature ViewModels → DatabaseRepo: reads/writes local state
- NetworkRepo → Parser: parses responses
- Parser → HanimeNetwork: consumes responses
- HanimeNetwork → Hanime & GitHub APIs: HTTP requests
- DatabaseRepo → DownloadDatabase: persists downloads
- VideoViewModel → HanimeDataSource: drives playback
- Feature screens → HanimeDownloadManagerV2: queues downloads
- HanimeDownloadManagerV2 → HanimeDownloadWorker: schedules
- HanimeDownloadWorker → HanimeNetwork: downloads content
- HanimeDownloadWorker → DownloadDatabase: updates records
- HUpdater → HUpdateWorker: runs checks
- HUpdateWorker → Hanime & GitHub APIs: checks releases
- HanimeApplication → Yenaly base classes: inherits base framework
- Feature ViewModels → Yenaly base classes: inherits base ViewModel