{"owner":"jiangtian616","repo":"JHenTai","hasSkills":true,"hasMcp":false,"mcpConfig":null,"found":["CLAUDE.md"],"skills":{"CLAUDE.md":"# CLAUDE.md\n\nThis file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.\n\n## Project overview\n\nJHenTai is a Flutter app for browsing E-Hentai / EXHentai, targeting Android, iOS, Windows, macOS, and Linux. Version `8.0.14+328` (from pubspec.yaml).\n\n## Build & dev commands\n\n```bash\n# Get dependencies\nflutter pub get\n\n# Run code generation (Drift DB, etc.) — required after editing any @DriftDatabase tables/queries\ndart run build_runner build\n\n# Run code generation in watch mode during active DB work\ndart run build_runner watch --delete-conflicting-outputs\n\n# Run app on a connected device\nflutter run\n\n# Lint\nflutter analyze\n\n# Run tests\nflutter test\n```\n\nNo test directory files are present, so `flutter test` is purely for when new tests are added.\n\n## Architecture\n\n### Dependency framework: GetX\nState management, routing, dependency injection, and i18n all use GetX. Widgets use `GetBuilder<T>` (manual `update()`), not reactive `.obs` streams. Pages use `.obs` for settings that must broadcast changes across views.\n\n### Lifecycle: `JHLifeCircleBean` pattern\n\nEvery singleton service and setting implements `JHLifeCircleBean` from `lib/src/service/jh_service.dart`:\n\n- `initBean()` — async init (called before `runApp`)\n- `afterBeanReady()` — post-runApp setup\n- `initDependencies` — list of other beans this one needs initialized first\n\nAll beans are registered in a topological-sorted list in `lib/src/main.dart` and initialized in order. **Adding a new service/setting requires inserting it into this list with the correct `initDependencies` ordering** — out-of-order registration will cause init failures. Three mixins simplify common patterns:\n- `JHLifeCircleBeanErrorCatch` — wraps init/ready in try/catch with logging; subclasses override `doInitBean()` / `doAfterBeanReady()` instead\n- `JHLifeCircleBeanWithConfigStorage` — adds JSON serialize/deserialize to the `local_config` DB table via `applyBeanConfig()` / `getBeanConfig()`\n- Service beans live in `lib/src/service/`; settings singletons live in `lib/src/setting/`\n\n### Logging\n\nUses the `logger` package via the global `log` singleton (`lib/src/service/log.dart`). Four tiered outputs:\n- Console logger (dev: colored + method info; prod: plain with timestamp)\n- Verbose file logger (trace-level, `verbose/`)\n- Warning file logger (warn+, `warning/`)\n- Download-specific file logger (`download/`)\n\nCall `log.trace/debug/info/warn/error(msg, e, stack)`. Errors in `JHLifeCircleBeanErrorCatch` mixin are automatically logged.\n\n### Supporting directories\n\n- `lib/src/config/` — app-level configuration (theme, UI constants, Sentry, API secrets)\n- `lib/src/enum/` — enums shared across the app (`EHNamespace`, `ConfigEnum`, `ConfigTypeEnum`)\n- `lib/src/extension/` — extension methods on framework types (DioException, String, List, Directory, Widget, GetLogic)\n- `lib/src/mixin/` — reusable page mixins: scroll-to-top, double-tap-refresh, login-required guard, animation, window-widget\n- `lib/src/model/` — data classes: `Gallery`, `GalleryTag`, `GalleryImage`, `GalleryComment`, `SearchConfig`, `SearchHistory`, and per-endpoint response models in `model/jh_response/` and `model/archive_bot_response/`\n- `lib/src/utils/` — 30+ utility files for parsing (eh_spider_parser, jh_spider_parser), IO, date, crypto, proxy, version, etc.\n- `lib/src/exception/` — custom exception classes (`EHSiteException`, `NotUploadException`)\n\n### Routing\n\nAll routes are defined in `lib/src/routes/routes.dart` as static const strings on `class Routes`. The `EHPage` class extends `GetPage` and adds:\n- `side` — `left`/`right`/`fullScreen` (tablet layout uses left/right split)\n- `offAllBefore` — whether previous right-side routes are popped\n\nNested settings routes use a `settingPrefix` convention (`/setting_*`).\n\n### Page pattern\n\nPages follow a consistent GetX structure in `lib/src/pages/`:\n\n- `*_page.dart` — Widget\n- `*_logic.dart` — `GetxController` subclass (business logic)\n- `*_state.dart` — Mutable state object\n\nThe base class is `BasePageLogic` (`pages/base/base_page_logic.dart`) which handles gallery-list pages: pull-to-refresh, pagination (prev/next gid), search config persistence, and tag blocking/filtering. Subclasses override `getGalleryPage()` to provide page-specific API calls.\n\n### Network layer (`lib/src/network/`)\n\nUses a custom Dio fork (`dio` from `jiangtian616/dio` at `append-mode` ref). Main request classes:\n- `EHRequest` — all E-Hentai API calls, with cookie management, caching, domain fronting for EX\n- `JHRequest` — backend API calls (tag translations, app update checks, built-in block lists)\n- `ArchiveBotRequest` — archive.org resolution\n\nParsers for HTML responses live in `lib/src/utils/eh_spider_parser.dart`.\n\n### Database (`lib/src/database/`)\n\nDrift (SQLite) at schema version 24 with heavy migration chain. Tables in `database/table/`, DAOs in `database/dao/`. The global `appDb` singleton is declared at the bottom of `database.dart`. Generated code is in `database.g.dart` — re-run `dart run build_runner build` after any schema change and add a migration step in `MigrationStrategy.onUpgrade`.\n\n### Services (`lib/src/service/`)\n\nIndependent singletons that manage core features:\n- `gallery_download_service.dart` / `archive_download_service.dart` — download engine with parallel queue, resume, priority\n- `tag_translation_service.dart` — fetches and caches tag translations from EhTagTranslation\n- `local_block_rule_service.dart` — user-configured gallery blocking rules\n- `cloud_service.dart` — config sync\n- `storage_service.dart` — JSON/GetStorage NoSQL persistence\n- `super_resolution_service.dart` — image upscaling metadata tracking\n- `path_service.dart` — platform-aware directory resolution\n\n### Settings (`lib/src/setting/`)\n\nEach setting module is a standalone singleton (e.g., `ehSetting`, `styleSetting`, `preferenceSetting`) using `JHLifeCircleBeanWithConfigStorage`. Settings are serialized as JSON and stored in the `local_config` DB table. Reactive `.obs` values are used when settings need to trigger UI rebuilds across the app.\n\n### Layout system (`lib/src/pages/layout/`)\n\nThree layout modes:\n- `mobile_v2` — bottom navigation bar with tab-style pages\n- `tablet_v2` — master-detail split (left/right route sides)\n- `desktop` — sidebar navigation with persistent detail panel\n\nThe home page (`home_page.dart`) selects the layout based on screen width.\n\n### i18n (`lib/src/l18n/`)\n\nCustom translation system via `LocaleText` (GetX `Translations`). One `.dart` file per language with key-value pairs. Adding a new language requires: the locale file, an entry in `locale_text.dart`, and an entry in `locale_consts.dart`.\n\n### Widget library (`lib/src/widget/`)\n\nReusable widgets prefixed `eh_` — dialogs, cards, image components, tag displays, etc. The `app_manager.dart` widget wraps the entire app for global concerns. The `loading_state_indicator.dart` provides a standard loading/error/empty/idle state widget.\n\n### Key dependencies (beyond Flutter standard)\n\n- `get` 4.6.6 — state management, routing, i18n, NoSQL storage\n- `dio` (custom fork) — HTTP client\n- `drift` 2.21.0 — SQLite ORM\n- `extended_image` — image loading with cache\n- `photo_view` / `zoom_view` (custom forks) — reading page image viewer\n- `desktop_webview_window` — desktop webview for cookie login\n"},"files":{"CLAUDE.md":"# CLAUDE.md\n\nThis file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.\n\n## Project overview\n\nJHenTai is a Flutter app for browsing E-Hentai / EXHentai, targeting Android, iOS, Windows, macOS, and Linux. Version `8.0.14+328` (from pubspec.yaml).\n\n## Build & dev commands\n\n```bash\n# Get dependencies\nflutter pub get\n\n# Run code generation (Drift DB, etc.) — required after editing any @DriftDatabase tables/queries\ndart run build_runner build\n\n# Run code generation in watch mode during active DB work\ndart run build_runner watch --delete-conflicting-outputs\n\n# Run app on a connected device\nflutter run\n\n# Lint\nflutter analyze\n\n# Run tests\nflutter test\n```\n\nNo test directory files are present, so `flutter test` is purely for when new tests are added.\n\n## Architecture\n\n### Dependency framework: GetX\nState management, routing, dependency injection, and i18n all use GetX. Widgets use `GetBuilder<T>` (manual `update()`), not reactive `.obs` streams. Pages use `.obs` for settings that must broadcast changes across views.\n\n### Lifecycle: `JHLifeCircleBean` pattern\n\nEvery singleton service and setting implements `JHLifeCircleBean` from `lib/src/service/jh_service.dart`:\n\n- `initBean()` — async init (called before `runApp`)\n- `afterBeanReady()` — post-runApp setup\n- `initDependencies` — list of other beans this one needs initialized first\n\nAll beans are registered in a topological-sorted list in `lib/src/main.dart` and initialized in order. **Adding a new service/setting requires inserting it into this list with the correct `initDependencies` ordering** — out-of-order registration will cause init failures. Three mixins simplify common patterns:\n- `JHLifeCircleBeanErrorCatch` — wraps init/ready in try/catch with logging; subclasses override `doInitBean()` / `doAfterBeanReady()` instead\n- `JHLifeCircleBeanWithConfigStorage` — adds JSON serialize/deserialize to the `local_config` DB table via `applyBeanConfig()` / `getBeanConfig()`\n- Service beans live in `lib/src/service/`; settings singletons live in `lib/src/setting/`\n\n### Logging\n\nUses the `logger` package via the global `log` singleton (`lib/src/service/log.dart`). Four tiered outputs:\n- Console logger (dev: colored + method info; prod: plain with timestamp)\n- Verbose file logger (trace-level, `verbose/`)\n- Warning file logger (warn+, `warning/`)\n- Download-specific file logger (`download/`)\n\nCall `log.trace/debug/info/warn/error(msg, e, stack)`. Errors in `JHLifeCircleBeanErrorCatch` mixin are automatically logged.\n\n### Supporting directories\n\n- `lib/src/config/` — app-level configuration (theme, UI constants, Sentry, API secrets)\n- `lib/src/enum/` — enums shared across the app (`EHNamespace`, `ConfigEnum`, `ConfigTypeEnum`)\n- `lib/src/extension/` — extension methods on framework types (DioException, String, List, Directory, Widget, GetLogic)\n- `lib/src/mixin/` — reusable page mixins: scroll-to-top, double-tap-refresh, login-required guard, animation, window-widget\n- `lib/src/model/` — data classes: `Gallery`, `GalleryTag`, `GalleryImage`, `GalleryComment`, `SearchConfig`, `SearchHistory`, and per-endpoint response models in `model/jh_response/` and `model/archive_bot_response/`\n- `lib/src/utils/` — 30+ utility files for parsing (eh_spider_parser, jh_spider_parser), IO, date, crypto, proxy, version, etc.\n- `lib/src/exception/` — custom exception classes (`EHSiteException`, `NotUploadException`)\n\n### Routing\n\nAll routes are defined in `lib/src/routes/routes.dart` as static const strings on `class Routes`. The `EHPage` class extends `GetPage` and adds:\n- `side` — `left`/`right`/`fullScreen` (tablet layout uses left/right split)\n- `offAllBefore` — whether previous right-side routes are popped\n\nNested settings routes use a `settingPrefix` convention (`/setting_*`).\n\n### Page pattern\n\nPages follow a consistent GetX structure in `lib/src/pages/`:\n\n- `*_page.dart` — Widget\n- `*_logic.dart` — `GetxController` subclass (business logic)\n- `*_state.dart` — Mutable state object\n\nThe base class is `BasePageLogic` (`pages/base/base_page_logic.dart`) which handles gallery-list pages: pull-to-refresh, pagination (prev/next gid), search config persistence, and tag blocking/filtering. Subclasses override `getGalleryPage()` to provide page-specific API calls.\n\n### Network layer (`lib/src/network/`)\n\nUses a custom Dio fork (`dio` from `jiangtian616/dio` at `append-mode` ref). Main request classes:\n- `EHRequest` — all E-Hentai API calls, with cookie management, caching, domain fronting for EX\n- `JHRequest` — backend API calls (tag translations, app update checks, built-in block lists)\n- `ArchiveBotRequest` — archive.org resolution\n\nParsers for HTML responses live in `lib/src/utils/eh_spider_parser.dart`.\n\n### Database (`lib/src/database/`)\n\nDrift (SQLite) at schema version 24 with heavy migration chain. Tables in `database/table/`, DAOs in `database/dao/`. The global `appDb` singleton is declared at the bottom of `database.dart`. Generated code is in `database.g.dart` — re-run `dart run build_runner build` after any schema change and add a migration step in `MigrationStrategy.onUpgrade`.\n\n### Services (`lib/src/service/`)\n\nIndependent singletons that manage core features:\n- `gallery_download_service.dart` / `archive_download_service.dart` — download engine with parallel queue, resume, priority\n- `tag_translation_service.dart` — fetches and caches tag translations from EhTagTranslation\n- `local_block_rule_service.dart` — user-configured gallery blocking rules\n- `cloud_service.dart` — config sync\n- `storage_service.dart` — JSON/GetStorage NoSQL persistence\n- `super_resolution_service.dart` — image upscaling metadata tracking\n- `path_service.dart` — platform-aware directory resolution\n\n### Settings (`lib/src/setting/`)\n\nEach setting module is a standalone singleton (e.g., `ehSetting`, `styleSetting`, `preferenceSetting`) using `JHLifeCircleBeanWithConfigStorage`. Settings are serialized as JSON and stored in the `local_config` DB table. Reactive `.obs` values are used when settings need to trigger UI rebuilds across the app.\n\n### Layout system (`lib/src/pages/layout/`)\n\nThree layout modes:\n- `mobile_v2` — bottom navigation bar with tab-style pages\n- `tablet_v2` — master-detail split (left/right route sides)\n- `desktop` — sidebar navigation with persistent detail panel\n\nThe home page (`home_page.dart`) selects the layout based on screen width.\n\n### i18n (`lib/src/l18n/`)\n\nCustom translation system via `LocaleText` (GetX `Translations`). One `.dart` file per language with key-value pairs. Adding a new language requires: the locale file, an entry in `locale_text.dart`, and an entry in `locale_consts.dart`.\n\n### Widget library (`lib/src/widget/`)\n\nReusable widgets prefixed `eh_` — dialogs, cards, image components, tag displays, etc. The `app_manager.dart` widget wraps the entire app for global concerns. The `loading_state_indicator.dart` provides a standard loading/error/empty/idle state widget.\n\n### Key dependencies (beyond Flutter standard)\n\n- `get` 4.6.6 — state management, routing, i18n, NoSQL storage\n- `dio` (custom fork) — HTTP client\n- `drift` 2.21.0 — SQLite ORM\n- `extended_image` — image loading with cache\n- `photo_view` / `zoom_view` (custom forks) — reading page image viewer\n- `desktop_webview_window` — desktop webview for cookie login\n"},"items":[{"name":"CLAUDE.md","path":"CLAUDE.md","title":"CLAUDE.md","content":"# CLAUDE.md\n\nThis file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.\n\n## Project overview\n\nJHenTai is a Flutter app for browsing E-Hentai / EXHentai, targeting Android, iOS, Windows, macOS, and Linux. Version `8.0.14+328` (from pubspec.yaml).\n\n## Build & dev commands\n\n```bash\n# Get dependencies\nflutter pub get\n\n# Run code generation (Drift DB, etc.) — required after editing any @DriftDatabase tables/queries\ndart run build_runner build\n\n# Run code generation in watch mode during active DB work\ndart run build_runner watch --delete-conflicting-outputs\n\n# Run app on a connected device\nflutter run\n\n# Lint\nflutter analyze\n\n# Run tests\nflutter test\n```\n\nNo test directory files are present, so `flutter test` is purely for when new tests are added.\n\n## Architecture\n\n### Dependency framework: GetX\nState management, routing, dependency injection, and i18n all use GetX. Widgets use `GetBuilder<T>` (manual `update()`), not reactive `.obs` streams. Pages use `.obs` for settings that must broadcast changes across views.\n\n### Lifecycle: `JHLifeCircleBean` pattern\n\nEvery singleton service and setting implements `JHLifeCircleBean` from `lib/src/service/jh_service.dart`:\n\n- `initBean()` — async init (called before `runApp`)\n- `afterBeanReady()` — post-runApp setup\n- `initDependencies` — list of other beans this one needs initialized first\n\nAll beans are registered in a topological-sorted list in `lib/src/main.dart` and initialized in order. **Adding a new service/setting requires inserting it into this list with the correct `initDependencies` ordering** — out-of-order registration will cause init failures. Three mixins simplify common patterns:\n- `JHLifeCircleBeanErrorCatch` — wraps init/ready in try/catch with logging; subclasses override `doInitBean()` / `doAfterBeanReady()` instead\n- `JHLifeCircleBeanWithConfigStorage` — adds JSON serialize/deserialize to the `local_config` DB table via `applyBeanConfig()` / `getBeanConfig()`\n- Service beans live in `lib/src/service/`; settings singletons live in `lib/src/setting/`\n\n### Logging\n\nUses the `logger` package via the global `log` singleton (`lib/src/service/log.dart`). Four tiered outputs:\n- Console logger (dev: colored + method info; prod: plain with timestamp)\n- Verbose file logger (trace-level, `verbose/`)\n- Warning file logger (warn+, `warning/`)\n- Download-specific file logger (`download/`)\n\nCall `log.trace/debug/info/warn/error(msg, e, stack)`. Errors in `JHLifeCircleBeanErrorCatch` mixin are automatically logged.\n\n### Supporting directories\n\n- `lib/src/config/` — app-level configuration (theme, UI constants, Sentry, API secrets)\n- `lib/src/enum/` — enums shared across the app (`EHNamespace`, `ConfigEnum`, `ConfigTypeEnum`)\n- `lib/src/extension/` — extension methods on framework types (DioException, String, List, Directory, Widget, GetLogic)\n- `lib/src/mixin/` — reusable page mixins: scroll-to-top, double-tap-refresh, login-required guard, animation, window-widget\n- `lib/src/model/` — data classes: `Gallery`, `GalleryTag`, `GalleryImage`, `GalleryComment`, `SearchConfig`, `SearchHistory`, and per-endpoint response models in `model/jh_response/` and `model/archive_bot_response/`\n- `lib/src/utils/` — 30+ utility files for parsing (eh_spider_parser, jh_spider_parser), IO, date, crypto, proxy, version, etc.\n- `lib/src/exception/` — custom exception classes (`EHSiteException`, `NotUploadException`)\n\n### Routing\n\nAll routes are defined in `lib/src/routes/routes.dart` as static const strings on `class Routes`. The `EHPage` class extends `GetPage` and adds:\n- `side` — `left`/`right`/`fullScreen` (tablet layout uses left/right split)\n- `offAllBefore` — whether previous right-side routes are popped\n\nNested settings routes use a `settingPrefix` convention (`/setting_*`).\n\n### Page pattern\n\nPages follow a consistent GetX structure in `lib/src/pages/`:\n\n- `*_page.dart` — Widget\n- `*_logic.dart` — `GetxController` subclass (business logic)\n- `*_state.dart` — Mutable state object\n\nThe base class is `BasePageLogic` (`pages/base/base_page_logic.dart`) which handles gallery-list pages: pull-to-refresh, pagination (prev/next gid), search config persistence, and tag blocking/filtering. Subclasses override `getGalleryPage()` to provide page-specific API calls.\n\n### Network layer (`lib/src/network/`)\n\nUses a custom Dio fork (`dio` from `jiangtian616/dio` at `append-mode` ref). Main request classes:\n- `EHRequest` — all E-Hentai API calls, with cookie management, caching, domain fronting for EX\n- `JHRequest` — backend API calls (tag translations, app update checks, built-in block lists)\n- `ArchiveBotRequest` — archive.org resolution\n\nParsers for HTML responses live in `lib/src/utils/eh_spider_parser.dart`.\n\n### Database (`lib/src/database/`)\n\nDrift (SQLite) at schema version 24 with heavy migration chain. Tables in `database/table/`, DAOs in `database/dao/`. The global `appDb` singleton is declared at the bottom of `database.dart`. Generated code is in `database.g.dart` — re-run `dart run build_runner build` after any schema change and add a migration step in `MigrationStrategy.onUpgrade`.\n\n### Services (`lib/src/service/`)\n\nIndependent singletons that manage core features:\n- `gallery_download_service.dart` / `archive_download_service.dart` — download engine with parallel queue, resume, priority\n- `tag_translation_service.dart` — fetches and caches tag translations from EhTagTranslation\n- `local_block_rule_service.dart` — user-configured gallery blocking rules\n- `cloud_service.dart` — config sync\n- `storage_service.dart` — JSON/GetStorage NoSQL persistence\n- `super_resolution_service.dart` — image upscaling metadata tracking\n- `path_service.dart` — platform-aware directory resolution\n\n### Settings (`lib/src/setting/`)\n\nEach setting module is a standalone singleton (e.g., `ehSetting`, `styleSetting`, `preferenceSetting`) using `JHLifeCircleBeanWithConfigStorage`. Settings are serialized as JSON and stored in the `local_config` DB table. Reactive `.obs` values are used when settings need to trigger UI rebuilds across the app.\n\n### Layout system (`lib/src/pages/layout/`)\n\nThree layout modes:\n- `mobile_v2` — bottom navigation bar with tab-style pages\n- `tablet_v2` — master-detail split (left/right route sides)\n- `desktop` — sidebar navigation with persistent detail panel\n\nThe home page (`home_page.dart`) selects the layout based on screen width.\n\n### i18n (`lib/src/l18n/`)\n\nCustom translation system via `LocaleText` (GetX `Translations`). One `.dart` file per language with key-value pairs. Adding a new language requires: the locale file, an entry in `locale_text.dart`, and an entry in `locale_consts.dart`.\n\n### Widget library (`lib/src/widget/`)\n\nReusable widgets prefixed `eh_` — dialogs, cards, image components, tag displays, etc. The `app_manager.dart` widget wraps the entire app for global concerns. The `loading_state_indicator.dart` provides a standard loading/error/empty/idle state widget.\n\n### Key dependencies (beyond Flutter standard)\n\n- `get` 4.6.6 — state management, routing, i18n, NoSQL storage\n- `dio` (custom fork) — HTTP client\n- `drift` 2.21.0 — SQLite ORM\n- `extended_image` — image loading with cache\n- `photo_view` / `zoom_view` (custom forks) — reading page image viewer\n- `desktop_webview_window` — desktop webview for cookie login\n","category":"root","tokens":1835}]}