├── .github
├── dlls
│ ├── README.md
│ ├── media_kit_libs_windows_video_plugin.dll
│ ├── media_kit_native_event_loop.dll
│ └── media_kit_video_plugin.dll
├── images
│ ├── Bangumi-search.png
│ ├── hooray-found.png
│ ├── oops-not-found.png
│ └── source-selection.png
└── workflows
│ ├── auto-prerelease.yaml
│ └── auto-release.yaml
├── .gitignore
├── .metadata
├── LICENSE
├── README.md
├── analysis_options.yaml
├── android
├── .gitignore
├── app
│ ├── build.gradle
│ └── src
│ │ ├── debug
│ │ └── AndroidManifest.xml
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ ├── kotlin
│ │ │ └── com
│ │ │ │ └── example
│ │ │ │ └── knkpanime
│ │ │ │ └── MainActivity.kt
│ │ └── res
│ │ │ ├── drawable-v21
│ │ │ └── launch_background.xml
│ │ │ ├── drawable
│ │ │ └── launch_background.xml
│ │ │ ├── mipmap-hdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-mdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── values-night
│ │ │ └── styles.xml
│ │ │ └── values
│ │ │ └── styles.xml
│ │ └── profile
│ │ └── AndroidManifest.xml
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ └── gradle-wrapper.properties
└── settings.gradle
├── assets
├── fonts
│ ├── NotoSerifHK-Bold.ttf
│ ├── NotoSerifHK-Regular.ttf
│ └── NotoSerifHK-VariableFont_wght.ttf
└── images
│ ├── icon.jpg
│ ├── no_image.jpg
│ ├── placeholder.jpg
│ └── sidemenu_background.jpg
├── devtools_options.yaml
├── fastlane
└── metadata
│ └── android
│ ├── en-US
│ ├── full_description.txt
│ └── short_description.txt
│ └── zh-CN
│ ├── full_description.txt
│ └── short_description.txt
├── ios
├── .gitignore
├── Flutter
│ ├── AppFrameworkInfo.plist
│ ├── Debug.xcconfig
│ └── Release.xcconfig
├── Podfile
├── Runner.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ ├── IDEWorkspaceChecks.plist
│ │ │ └── WorkspaceSettings.xcsettings
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── Runner.xcscheme
├── Runner.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ ├── IDEWorkspaceChecks.plist
│ │ └── WorkspaceSettings.xcsettings
├── Runner
│ ├── AppDelegate.swift
│ ├── Assets.xcassets
│ │ ├── AppIcon.appiconset
│ │ │ ├── Contents.json
│ │ │ ├── Icon-App-1024x1024@1x.png
│ │ │ ├── Icon-App-20x20@1x.png
│ │ │ ├── Icon-App-20x20@2x.png
│ │ │ ├── Icon-App-20x20@3x.png
│ │ │ ├── Icon-App-29x29@1x.png
│ │ │ ├── Icon-App-29x29@2x.png
│ │ │ ├── Icon-App-29x29@3x.png
│ │ │ ├── Icon-App-40x40@1x.png
│ │ │ ├── Icon-App-40x40@2x.png
│ │ │ ├── Icon-App-40x40@3x.png
│ │ │ ├── Icon-App-60x60@2x.png
│ │ │ ├── Icon-App-60x60@3x.png
│ │ │ ├── Icon-App-76x76@1x.png
│ │ │ ├── Icon-App-76x76@2x.png
│ │ │ └── Icon-App-83.5x83.5@2x.png
│ │ └── LaunchImage.imageset
│ │ │ ├── Contents.json
│ │ │ ├── LaunchImage.png
│ │ │ ├── LaunchImage@2x.png
│ │ │ ├── LaunchImage@3x.png
│ │ │ └── README.md
│ ├── Base.lproj
│ │ ├── LaunchScreen.storyboard
│ │ └── Main.storyboard
│ ├── Info.plist
│ └── Runner-Bridging-Header.h
└── RunnerTests
│ └── RunnerTests.swift
├── lib
├── adapters
│ ├── adapter_base.dart
│ ├── adapter_registry.dart
│ ├── anime1_adapter.dart
│ ├── ant_adapter.dart
│ ├── bimi_adapter.dart
│ ├── girigirilove_adapter.dart
│ ├── iyf_adapter.dart
│ ├── js_adapter.dart
│ ├── models
│ │ ├── anime1_anime_info.dart
│ │ └── yhmd_response.dart
│ ├── nyafun_adapter.dart
│ └── yhdm_adapter.dart
├── app_module.dart
├── app_widget.dart
├── main.dart
├── models
│ ├── anime_info.dart
│ ├── anime_info.g.dart
│ ├── danmaku.dart
│ ├── episode.dart
│ ├── episode.g.dart
│ ├── history.dart
│ ├── history.g.dart
│ ├── image_set.dart
│ ├── image_set.g.dart
│ ├── series.dart
│ ├── series.g.dart
│ └── source.dart
├── navigation.dart
├── pages
│ ├── calendar
│ │ ├── calendar_controller.dart
│ │ ├── calendar_controller.g.dart
│ │ ├── calendar_module.dart
│ │ └── calendar_page.dart
│ ├── favorite
│ │ ├── favorite_controller.dart
│ │ ├── favorite_module.dart
│ │ └── favorite_page.dart
│ ├── history
│ │ ├── history_controller.dart
│ │ ├── history_module.dart
│ │ └── history_page.dart
│ ├── play
│ │ ├── play_module.dart
│ │ ├── play_page.dart
│ │ ├── player_controller.dart
│ │ └── player_controller.g.dart
│ ├── search
│ │ ├── adapter_search_controller.dart
│ │ ├── adapter_search_controller.g.dart
│ │ ├── adapter_search_page.dart
│ │ ├── bangumi_search_controller.dart
│ │ ├── bangumi_search_controller.g.dart
│ │ ├── bangumi_search_page.dart
│ │ └── search_module.dart
│ └── settings
│ │ ├── image_set_config_page.dart
│ │ ├── js_adapter_config_page.dart
│ │ ├── settings_controller.dart
│ │ ├── settings_module.dart
│ │ └── settings_page.dart
├── utils
│ ├── bangumi.dart
│ ├── danmaku.dart
│ ├── storage.dart
│ ├── utils.dart
│ └── webview.dart
└── widgets
│ ├── anime_card.dart
│ ├── danmaku_settings_window.dart
│ ├── desktop_player.dart
│ ├── mobile_player.dart
│ ├── series_card.dart
│ └── source_selection_window.dart
├── linux
├── .gitignore
├── CMakeLists.txt
├── flutter
│ ├── CMakeLists.txt
│ ├── generated_plugin_registrant.cc
│ ├── generated_plugin_registrant.h
│ └── generated_plugins.cmake
├── main.cc
├── my_application.cc
└── my_application.h
├── macos
├── .gitignore
├── Flutter
│ ├── Flutter-Debug.xcconfig
│ ├── Flutter-Release.xcconfig
│ └── GeneratedPluginRegistrant.swift
├── Podfile
├── Podfile.lock
├── Runner.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ └── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── Runner.xcscheme
├── Runner.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
├── Runner
│ ├── AppDelegate.swift
│ ├── Assets.xcassets
│ │ └── AppIcon.appiconset
│ │ │ ├── Contents.json
│ │ │ ├── app_icon_1024.png
│ │ │ ├── app_icon_128.png
│ │ │ ├── app_icon_16.png
│ │ │ ├── app_icon_256.png
│ │ │ ├── app_icon_32.png
│ │ │ ├── app_icon_512.png
│ │ │ └── app_icon_64.png
│ ├── Base.lproj
│ │ └── MainMenu.xib
│ ├── Configs
│ │ ├── AppInfo.xcconfig
│ │ ├── Debug.xcconfig
│ │ ├── Release.xcconfig
│ │ └── Warnings.xcconfig
│ ├── DebugProfile.entitlements
│ ├── Info.plist
│ ├── MainFlutterWindow.swift
│ └── Release.entitlements
└── RunnerTests
│ └── RunnerTests.swift
├── pubspec.lock
├── pubspec.yaml
├── test
└── widget_test.dart
├── web
├── favicon.png
├── icons
│ ├── Icon-192.png
│ ├── Icon-512.png
│ ├── Icon-maskable-192.png
│ └── Icon-maskable-512.png
├── index.html
└── manifest.json
└── windows
├── .gitignore
├── CMakeLists.txt
├── create_shortcut.bat
├── flutter
├── CMakeLists.txt
├── generated_plugin_registrant.cc
├── generated_plugin_registrant.h
└── generated_plugins.cmake
└── runner
├── CMakeLists.txt
├── Runner.rc
├── flutter_window.cpp
├── flutter_window.h
├── main.cpp
├── resource.h
├── resources
└── app_icon.ico
├── runner.exe.manifest
├── utils.cpp
├── utils.h
├── win32_window.cpp
└── win32_window.h
/.github/dlls/README.md:
--------------------------------------------------------------------------------
1 | This folder stores the dlls for substitution after github workflow compilation.
2 |
3 | Reference: https://github.com/KNKPA/KNKPAnime/issues/21
--------------------------------------------------------------------------------
/.github/dlls/media_kit_libs_windows_video_plugin.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KNKPA/KNKPAnime/bf0032a159938cfd3307d2692d6f42073734ca1f/.github/dlls/media_kit_libs_windows_video_plugin.dll
--------------------------------------------------------------------------------
/.github/dlls/media_kit_native_event_loop.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KNKPA/KNKPAnime/bf0032a159938cfd3307d2692d6f42073734ca1f/.github/dlls/media_kit_native_event_loop.dll
--------------------------------------------------------------------------------
/.github/dlls/media_kit_video_plugin.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KNKPA/KNKPAnime/bf0032a159938cfd3307d2692d6f42073734ca1f/.github/dlls/media_kit_video_plugin.dll
--------------------------------------------------------------------------------
/.github/images/Bangumi-search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KNKPA/KNKPAnime/bf0032a159938cfd3307d2692d6f42073734ca1f/.github/images/Bangumi-search.png
--------------------------------------------------------------------------------
/.github/images/hooray-found.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KNKPA/KNKPAnime/bf0032a159938cfd3307d2692d6f42073734ca1f/.github/images/hooray-found.png
--------------------------------------------------------------------------------
/.github/images/oops-not-found.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KNKPA/KNKPAnime/bf0032a159938cfd3307d2692d6f42073734ca1f/.github/images/oops-not-found.png
--------------------------------------------------------------------------------
/.github/images/source-selection.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KNKPA/KNKPAnime/bf0032a159938cfd3307d2692d6f42073734ca1f/.github/images/source-selection.png
--------------------------------------------------------------------------------
/.github/workflows/auto-release.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | name: "release"
3 |
4 | on:
5 | push:
6 | tags:
7 | - "1.*"
8 | workflow_dispatch:
9 | inputs:
10 | logLevel:
11 | description: "Log level"
12 | required: true
13 | default: "warning"
14 |
15 | env:
16 | APP_ID: ${{ secrets.APP_ID }}
17 | APP_SECRET: ${{ secrets.APP_SECRET }}
18 |
19 | jobs:
20 | flutter-build:
21 | name: "Release"
22 | runs-on: "windows-latest"
23 | permissions: write-all
24 |
25 | steps:
26 | - name: Clone repository
27 | uses: actions/checkout@v4
28 | - run: git config --system core.longpaths true # to avoid file name too long error
29 | - run: choco install yq
30 | - name: Set up Flutter
31 | uses: subosito/flutter-action@v2
32 | with:
33 | channel: stable
34 | flutter-version-file: pubspec.yaml
35 | cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:" # optional, change this to force refresh cache
36 | cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" # optional, change this to specify the cache path
37 | pub-cache-key: "flutter-pub:os:-:channel:-:version:-:arch:-:hash:" # optional, change this to force refresh cache of dart pub get dependencies
38 | pub-cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" # optional, change this to specify the cache path
39 | - name: Set up Java
40 | uses: actions/setup-java@v4
41 | with:
42 | distribution: "temurin"
43 | java-version: "18"
44 | - run: flutter pub get
45 | - run: flutter build apk --dart-define=APP_ID=${{ secrets.APP_ID }} --dart-define=APP_SECRET=${{ secrets.APP_SECRET }}
46 | - run: flutter build windows --dart-define=APP_ID=${{ secrets.APP_ID }} --dart-define=APP_SECRET=${{ secrets.APP_SECRET }}
47 |
48 | # Substitute DLLs
49 | - run: xcopy ".github\dlls\*.dll" "build\windows\x64\runner\Release\" /Y
50 |
51 | - run: Compress-Archive build/windows/x64/runner/Release knkpanime-windows.zip
52 | - uses: r0adkll/sign-android-release@v1
53 | name: Sign app APK
54 | id: sign_app
55 | with:
56 | releaseDirectory: build/app/outputs/apk/release
57 | signingKeyBase64: ${{ secrets.SIGNING_KEY }}
58 | alias: ${{ secrets.ALIAS }}
59 | keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
60 | env:
61 | BUILD_TOOLS_VERSION: "34.0.0"
62 | - run: Ren ${{ steps.sign_app.outputs.signedReleaseFile }} knkpanime-android.apk
63 | - uses: "marvinpinto/action-automatic-releases@latest"
64 | with:
65 | repo_token: "${{ secrets.GITHUB_TOKEN }}"
66 | prerelease: false
67 | files: |
68 | knkpanime-windows.zip
69 | build/app/outputs/apk/release/knkpanime-android.apk
70 | - name: Upload outputs
71 | uses: actions/upload-artifact@v4
72 | with:
73 | name: outputs
74 | path: |
75 | knkpanime-windows.zip
76 | build/app/outputs/apk/release/knkpanime-android.apk
77 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 | migrate_working_dir/
12 | .vscode/
13 |
14 | # IntelliJ related
15 | *.iml
16 | *.ipr
17 | *.iws
18 | .idea/
19 |
20 | # The .vscode folder contains launch configuration and tasks you configure in
21 | # VS Code which you may wish to be included in version control, so this line
22 | # is commented out by default.
23 | #.vscode/
24 |
25 | # Flutter/Dart/Pub related
26 | **/doc/api/
27 | **/ios/Flutter/.last_build_id
28 | .dart_tool/
29 | .flutter-plugins
30 | .flutter-plugins-dependencies
31 | .pub-cache/
32 | .pub/
33 | /build/
34 |
35 | # Symbolication related
36 | app.*.symbols
37 |
38 | # Obfuscation related
39 | app.*.map.json
40 |
41 | # Android Studio will place build artifacts here
42 | /android/app/debug
43 | /android/app/profile
44 | /android/app/release
45 |
--------------------------------------------------------------------------------
/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: "300451adae589accbece3490f4396f10bdf15e6e"
8 | channel: "stable"
9 |
10 | project_type: app
11 |
12 | # Tracks metadata for the flutter migrate command
13 | migration:
14 | platforms:
15 | - platform: root
16 | create_revision: 300451adae589accbece3490f4396f10bdf15e6e
17 | base_revision: 300451adae589accbece3490f4396f10bdf15e6e
18 | - platform: android
19 | create_revision: 300451adae589accbece3490f4396f10bdf15e6e
20 | base_revision: 300451adae589accbece3490f4396f10bdf15e6e
21 | - platform: ios
22 | create_revision: 300451adae589accbece3490f4396f10bdf15e6e
23 | base_revision: 300451adae589accbece3490f4396f10bdf15e6e
24 | - platform: linux
25 | create_revision: 300451adae589accbece3490f4396f10bdf15e6e
26 | base_revision: 300451adae589accbece3490f4396f10bdf15e6e
27 | - platform: macos
28 | create_revision: 300451adae589accbece3490f4396f10bdf15e6e
29 | base_revision: 300451adae589accbece3490f4396f10bdf15e6e
30 | - platform: web
31 | create_revision: 300451adae589accbece3490f4396f10bdf15e6e
32 | base_revision: 300451adae589accbece3490f4396f10bdf15e6e
33 | - platform: windows
34 | create_revision: 300451adae589accbece3490f4396f10bdf15e6e
35 | base_revision: 300451adae589accbece3490f4396f10bdf15e6e
36 |
37 | # User provided section
38 |
39 | # List of Local paths (relative to this file) that should be
40 | # ignored by the migrate tool.
41 | #
42 | # Files that are not part of the templates will be ignored by default.
43 | unmanaged_files:
44 | - 'lib/main.dart'
45 | - 'ios/Runner.xcodeproj/project.pbxproj'
46 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # knkpanime
2 |
3 | 一个支持多番剧源和弹幕的看番(甚至看电视剧)软件,甚至可以自定义你想接入的网站适配器!
4 |
5 | 有问题或建议欢迎通过issue反馈。
6 |
7 | ## 下载
8 |
9 | [
](https://f-droid.org/packages/com.example.knkpanime)
12 |
13 | [下载链接](https://github.com/KNKPA/KNKPAnime/releases/latest)
14 |
15 | 另:macOS版可以在[预览版](https://github.com/KNKPA/KNKPAnime/releases/tag/latest)中下载,但不知为什么,github workflow编译的macOS版在我的mac上打开视频播放页时会崩溃(目前猜测是libmpv问题),而本地编译的则不会。如果mac用户想用但在github的release中下载的软件打不开的话,可以尝试自行编译:
16 |
17 | ```
18 | [[ $(uname -m) == 'x86_64' ]] && wget https://storage.flutter-io.cn/flutter_infra_release/releases/stable/macos/flutter_macos_3.19.5-stable.zip -O flutter.zip || wget https://storage.flutter-io.cn/flutter_infra_release/releases/stable/macos/flutter_macos_arm64_3.19.5-stable.zip -O flutter.zip
19 | unzip flutter.zip
20 | git clone https://github.com/KNKPA/KNKPAnime.git # 如果访问github有问题可以选择国内镜像
21 | cd KNKPAnime
22 | ../flutter/bin/flutter build macos --release
23 | mv build/macos/Build/Products/Release/knkpanime.app ../
24 | cd ..
25 | rm -rf KNKPAnime flutter flutter.zip
26 | ```
27 |
28 | ## 介绍
29 |
30 | 最重要的当然就是搜索啦。作为一个支持多番剧源的软件,你可以先在Bangumi上搜索想看的番剧,再选择可用的源观看:
31 |
32 | 
33 |
34 | 
35 |
36 | 当然,有的时候也会因为不同译名或番剧名中有特殊符号而导致使用Bangumi搜索很难匹配到番剧源中的数据,这个时候就可以用番剧源搜索来自定义用来搜索的词:
37 |
38 | 
39 |
40 | 
41 |
42 | 需要注意的是,在”Bangumi搜索“页面搜索时,会使用Bangumi提供的番剧名以及你所输入的搜索词在各番剧源进行两次搜索;而在追番、新番日历这两个页面点击某一个番剧的时候,只会用Bangumi提供的番剧名进行一次搜索,因此可能会出现无法搜索到的情况。如果这种情况发生的话,请在两个搜索界面搜索或通过历史记录进入(如果你看过这部番的话)。
43 |
44 | 然后就是一些比较常规的功能 - 历史记录、追番、番剧更新日历等,应该不需要过多介绍。
45 |
46 | ## 桌面版快捷键
47 |
48 | | 快捷键 | 对应操作 |
49 | |-------|-------|
50 | | J | 快进90秒(跳过OP/ED)|
51 | | 左右箭头 | 快进/快退10秒 |
52 | | 上下箭头 | 音量增加/减少5% |
53 | | esc | 退出全屏 |
54 | | D | 开启/关闭弹幕 |
55 | | F | 开启/退出全屏 |
56 | | [ | 上一集 |
57 | | ] | 下一集 |
58 |
59 | ## 自定义适配器
60 |
61 | 所谓适配器,就是解析在线观看网站的接口从而获取搜索结果、视频资源并提供给播放器播放的代码模块。在船新的1.1.0版本中,本软件已经可以支持两种适配器的定义形式以及解析形式,分别为:
62 |
63 | ### 定义形式
64 |
65 | #### 内置适配器
66 |
67 | 这种适配器使用dart代码编写,直接随主程序编译,运行速度和资源消耗上最有优势。当然,既然是随主程序一起编译,代价就是
68 | - 加入新的适配器必须通过向主程序提交代码的方式,即PR,并需要我的允许。~~当然我也不会不允许就是了(~~
69 | - 新的适配器以及修复过期链接等操作必须随新版本发布,并不灵活。
70 |
71 | #### JavaScript适配器
72 |
73 | 通过使用[flutter_js](https://github.com/abner/flutter_js),软件内置了一个JavaScript runtime,可以用来即时执行JS代码。利用这个JS runtime,我们可以随时获取互联网上的适配器并添加到软件中。虽然损失了一些性能,但毕竟搜索和解析视频都是相对不频繁的操作(相对于UI等等耗能大户来说),因此不会造成太大影响。
74 |
75 | 关于如何定义自己的适配器,请参见[KNKPAnime-js-adapters](https://github.com/KNKPA/KNKPAnime-js-adapters)。
76 |
77 | **请从您信任的来源添加适配器**
78 |
79 | ### 解析形式
80 |
81 | #### 基于规则
82 |
83 | 基于手写规则的解析,需要编写者去检查网站代码并找出视频源的URL到底如何得到。
84 |
85 | #### 基于WebView
86 |
87 | 通过在软件中跑一个不可见的浏览器,我们可以用他山之石来攻他山的玉,通过执行原网站的全部操作并获取视频链接。
88 |
89 | ## Acknowledgement
90 |
91 | 本项目受[oneAnime](https://github.com/Predidit/oneAnime)启发,并在Anime1的适配器中借用了其代码。
92 |
93 | 本项目使用了[Bangumi](http://bangumi.tv/)、[dandanplay](https://www.dandanplay.com/)的开放API。网站运营不易,请各位在能力范围内尽量支持这两个网站的运营。
94 |
--------------------------------------------------------------------------------
/analysis_options.yaml:
--------------------------------------------------------------------------------
1 | # This file configures the analyzer, which statically analyzes Dart code to
2 | # check for errors, warnings, and lints.
3 | #
4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6 | # invoked from the command line by running `flutter analyze`.
7 |
8 | # The following line activates a set of recommended lints for Flutter apps,
9 | # packages, and plugins designed to encourage good coding practices.
10 | include: package:flutter_lints/flutter.yaml
11 |
12 | linter:
13 | # The lint rules applied to this project can be customized in the
14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml`
15 | # included above or to enable additional rules. A list of all available lints
16 | # and their documentation is published at https://dart.dev/lints.
17 | #
18 | # Instead of disabling a lint rule for the entire project in the
19 | # section below, it can also be suppressed for a single line of code
20 | # or a specific dart file by using the `// ignore: name_of_lint` and
21 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file
22 | # producing the lint.
23 | rules:
24 | prefer_function_declarations_over_variables: false
25 | # avoid_print: false # Uncomment to disable the `avoid_print` rule
26 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
27 |
28 | # Additional information about this file can be found at
29 | # https://dart.dev/guides/language/analysis-options
30 |
--------------------------------------------------------------------------------
/android/.gitignore:
--------------------------------------------------------------------------------
1 | gradle-wrapper.jar
2 | /.gradle
3 | /captures/
4 | /gradlew
5 | /gradlew.bat
6 | /local.properties
7 | GeneratedPluginRegistrant.java
8 |
9 | # Remember to never publicly share your keystore.
10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
11 | key.properties
12 | **/*.keystore
13 | **/*.jks
14 |
--------------------------------------------------------------------------------
/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id "com.android.application"
3 | id "kotlin-android"
4 | id "dev.flutter.flutter-gradle-plugin"
5 | }
6 |
7 | def localProperties = new Properties()
8 | def localPropertiesFile = rootProject.file('local.properties')
9 | if (localPropertiesFile.exists()) {
10 | localPropertiesFile.withReader('UTF-8') { reader ->
11 | localProperties.load(reader)
12 | }
13 | }
14 |
15 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
16 | if (flutterVersionCode == null) {
17 | flutterVersionCode = '1'
18 | }
19 |
20 | def flutterVersionName = localProperties.getProperty('flutter.versionName')
21 | if (flutterVersionName == null) {
22 | flutterVersionName = '1.0'
23 | }
24 |
25 | android {
26 | namespace "com.example.knkpanime"
27 | compileSdk flutter.compileSdkVersion
28 | ndkVersion flutter.ndkVersion
29 |
30 | compileOptions {
31 | sourceCompatibility JavaVersion.VERSION_1_8
32 | targetCompatibility JavaVersion.VERSION_1_8
33 | }
34 |
35 | kotlinOptions {
36 | jvmTarget = '1.8'
37 | }
38 |
39 | sourceSets {
40 | main.java.srcDirs += 'src/main/kotlin'
41 | }
42 |
43 | defaultConfig {
44 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
45 | applicationId "com.example.knkpanime"
46 | // You can update the following values to match your application needs.
47 | // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
48 | minSdkVersion 21
49 | targetSdkVersion flutter.targetSdkVersion
50 | versionCode flutterVersionCode.toInteger()
51 | versionName flutterVersionName
52 | }
53 |
54 | buildTypes {
55 | release {
56 | // TODO: Add your own signing config for the release build.
57 | // Signing with the debug keys for now, so `flutter run --release` works.
58 | //signingConfig signingConfigs.debug
59 | ndk {
60 | // The line below only builds arm64-v8a
61 | abiFilters 'armeabi-v7a','arm64-v8a','x86_64' // this includes all build targets
62 | }
63 | }
64 | }
65 | }
66 |
67 | flutter {
68 | source '../..'
69 | }
70 |
71 | dependencies {}
72 |
73 | ext.abiCodes = ["x86_64": 1, "armeabi-v7a": 2, "arm64-v8a": 3]
74 | import com.android.build.OutputFile
75 | android.applicationVariants.all { variant ->
76 | variant.outputs.each { output ->
77 | def abiVersionCode = project.ext.abiCodes.get(output.getFilter(OutputFile.ABI))
78 | if (abiVersionCode != null) {
79 | output.versionCodeOverride = variant.versionCode * 10 + abiVersionCode
80 | }
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
16 |
24 |
28 |
32 |
33 |
34 |
35 |
36 |
37 |
39 |
42 |
43 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/android/app/src/main/kotlin/com/example/knkpanime/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.example.knkpanime
2 |
3 | import io.flutter.embedding.android.FlutterActivity
4 |
5 | class MainActivity: FlutterActivity()
6 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-v21/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KNKPA/KNKPAnime/bf0032a159938cfd3307d2692d6f42073734ca1f/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KNKPA/KNKPAnime/bf0032a159938cfd3307d2692d6f42073734ca1f/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KNKPA/KNKPAnime/bf0032a159938cfd3307d2692d6f42073734ca1f/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KNKPA/KNKPAnime/bf0032a159938cfd3307d2692d6f42073734ca1f/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KNKPA/KNKPAnime/bf0032a159938cfd3307d2692d6f42073734ca1f/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/values-night/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | allprojects {
2 | repositories {
3 | google()
4 | mavenCentral()
5 | }
6 | }
7 |
8 | rootProject.buildDir = '../build'
9 | subprojects {
10 | project.buildDir = "${rootProject.buildDir}/${project.name}"
11 | }
12 | subprojects {
13 | project.evaluationDependsOn(':app')
14 | }
15 |
16 | tasks.register("clean", Delete) {
17 | delete rootProject.buildDir
18 | }
19 |
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx4G
2 | android.useAndroidX=true
3 | android.enableJetifier=true
4 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | zipStoreBase=GRADLE_USER_HOME
4 | zipStorePath=wrapper/dists
5 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip
6 |
--------------------------------------------------------------------------------
/android/settings.gradle:
--------------------------------------------------------------------------------
1 | pluginManagement {
2 | def flutterSdkPath = {
3 | def properties = new Properties()
4 | file("local.properties").withInputStream { properties.load(it) }
5 | def flutterSdkPath = properties.getProperty("flutter.sdk")
6 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
7 | return flutterSdkPath
8 | }
9 | settings.ext.flutterSdkPath = flutterSdkPath()
10 |
11 | includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle")
12 |
13 | repositories {
14 | google()
15 | mavenCentral()
16 | gradlePluginPortal()
17 | }
18 | }
19 |
20 | plugins {
21 | id "dev.flutter.flutter-plugin-loader" version "1.0.0"
22 | id "com.android.application" version "7.3.0" apply false
23 | id "org.jetbrains.kotlin.android" version "1.7.10" apply false
24 | }
25 |
26 | include ":app"
27 |
--------------------------------------------------------------------------------
/assets/fonts/NotoSerifHK-Bold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KNKPA/KNKPAnime/bf0032a159938cfd3307d2692d6f42073734ca1f/assets/fonts/NotoSerifHK-Bold.ttf
--------------------------------------------------------------------------------
/assets/fonts/NotoSerifHK-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KNKPA/KNKPAnime/bf0032a159938cfd3307d2692d6f42073734ca1f/assets/fonts/NotoSerifHK-Regular.ttf
--------------------------------------------------------------------------------
/assets/fonts/NotoSerifHK-VariableFont_wght.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KNKPA/KNKPAnime/bf0032a159938cfd3307d2692d6f42073734ca1f/assets/fonts/NotoSerifHK-VariableFont_wght.ttf
--------------------------------------------------------------------------------
/assets/images/icon.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KNKPA/KNKPAnime/bf0032a159938cfd3307d2692d6f42073734ca1f/assets/images/icon.jpg
--------------------------------------------------------------------------------
/assets/images/no_image.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KNKPA/KNKPAnime/bf0032a159938cfd3307d2692d6f42073734ca1f/assets/images/no_image.jpg
--------------------------------------------------------------------------------
/assets/images/placeholder.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KNKPA/KNKPAnime/bf0032a159938cfd3307d2692d6f42073734ca1f/assets/images/placeholder.jpg
--------------------------------------------------------------------------------
/assets/images/sidemenu_background.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KNKPA/KNKPAnime/bf0032a159938cfd3307d2692d6f42073734ca1f/assets/images/sidemenu_background.jpg
--------------------------------------------------------------------------------
/devtools_options.yaml:
--------------------------------------------------------------------------------
1 | extensions:
2 |
--------------------------------------------------------------------------------
/fastlane/metadata/android/en-US/full_description.txt:
--------------------------------------------------------------------------------
1 | A anime app which supports multiple anime source and danmaku. You can even add custom website adaptor!
2 |
--------------------------------------------------------------------------------
/fastlane/metadata/android/en-US/short_description.txt:
--------------------------------------------------------------------------------
1 | Anime app with multiple source and danmaku support
2 |
--------------------------------------------------------------------------------
/fastlane/metadata/android/zh-CN/full_description.txt:
--------------------------------------------------------------------------------
1 | 一个支持多番剧源和弹幕的看番(甚至看电视剧)软件,甚至可以自定义你想接入的网站适配器!
2 |
--------------------------------------------------------------------------------
/fastlane/metadata/android/zh-CN/short_description.txt:
--------------------------------------------------------------------------------
1 | 支持多番剧源与弹幕的看番软件
2 |
--------------------------------------------------------------------------------
/ios/.gitignore:
--------------------------------------------------------------------------------
1 | **/dgph
2 | *.mode1v3
3 | *.mode2v3
4 | *.moved-aside
5 | *.pbxuser
6 | *.perspectivev3
7 | **/*sync/
8 | .sconsign.dblite
9 | .tags*
10 | **/.vagrant/
11 | **/DerivedData/
12 | Icon?
13 | **/Pods/
14 | **/.symlinks/
15 | profile
16 | xcuserdata
17 | **/.generated/
18 | Flutter/App.framework
19 | Flutter/Flutter.framework
20 | Flutter/Flutter.podspec
21 | Flutter/Generated.xcconfig
22 | Flutter/ephemeral/
23 | Flutter/app.flx
24 | Flutter/app.zip
25 | Flutter/flutter_assets/
26 | Flutter/flutter_export_environment.sh
27 | ServiceDefinitions.json
28 | Runner/GeneratedPluginRegistrant.*
29 |
30 | # Exceptions to above rules.
31 | !default.mode1v3
32 | !default.mode2v3
33 | !default.pbxuser
34 | !default.perspectivev3
35 |
--------------------------------------------------------------------------------
/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | App
9 | CFBundleIdentifier
10 | io.flutter.flutter.app
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | App
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | MinimumOSVersion
24 | 12.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/ios/Podfile:
--------------------------------------------------------------------------------
1 | # Uncomment this line to define a global platform for your project
2 | # platform :ios, '12.0'
3 |
4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true'
6 |
7 | project 'Runner', {
8 | 'Debug' => :debug,
9 | 'Profile' => :release,
10 | 'Release' => :release,
11 | }
12 |
13 | def flutter_root
14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
15 | unless File.exist?(generated_xcode_build_settings_path)
16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
17 | end
18 |
19 | File.foreach(generated_xcode_build_settings_path) do |line|
20 | matches = line.match(/FLUTTER_ROOT\=(.*)/)
21 | return matches[1].strip if matches
22 | end
23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
24 | end
25 |
26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
27 |
28 | flutter_ios_podfile_setup
29 |
30 | target 'Runner' do
31 | use_frameworks!
32 | use_modular_headers!
33 |
34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
35 | target 'RunnerTests' do
36 | inherit! :search_paths
37 | end
38 | end
39 |
40 | post_install do |installer|
41 | installer.pods_project.targets.each do |target|
42 | flutter_additional_ios_build_settings(target)
43 | end
44 | end
45 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
37 |
38 |
39 |
40 |
43 |
49 |
50 |
51 |
52 |
53 |
63 |
65 |
71 |
72 |
73 |
74 |
80 |
82 |
88 |
89 |
90 |
91 |
93 |
94 |
97 |
98 |
99 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 | import Flutter
3 |
4 | @UIApplicationMain
5 | @objc class AppDelegate: FlutterAppDelegate {
6 | override func application(
7 | _ application: UIApplication,
8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
9 | ) -> Bool {
10 | GeneratedPluginRegistrant.register(with: self)
11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "Icon-App-20x20@2x.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "Icon-App-20x20@3x.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "Icon-App-29x29@1x.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "Icon-App-29x29@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "29x29",
29 | "idiom" : "iphone",
30 | "filename" : "Icon-App-29x29@3x.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "Icon-App-40x40@2x.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "40x40",
41 | "idiom" : "iphone",
42 | "filename" : "Icon-App-40x40@3x.png",
43 | "scale" : "3x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "Icon-App-60x60@2x.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "60x60",
53 | "idiom" : "iphone",
54 | "filename" : "Icon-App-60x60@3x.png",
55 | "scale" : "3x"
56 | },
57 | {
58 | "size" : "20x20",
59 | "idiom" : "ipad",
60 | "filename" : "Icon-App-20x20@1x.png",
61 | "scale" : "1x"
62 | },
63 | {
64 | "size" : "20x20",
65 | "idiom" : "ipad",
66 | "filename" : "Icon-App-20x20@2x.png",
67 | "scale" : "2x"
68 | },
69 | {
70 | "size" : "29x29",
71 | "idiom" : "ipad",
72 | "filename" : "Icon-App-29x29@1x.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "29x29",
77 | "idiom" : "ipad",
78 | "filename" : "Icon-App-29x29@2x.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "40x40",
83 | "idiom" : "ipad",
84 | "filename" : "Icon-App-40x40@1x.png",
85 | "scale" : "1x"
86 | },
87 | {
88 | "size" : "40x40",
89 | "idiom" : "ipad",
90 | "filename" : "Icon-App-40x40@2x.png",
91 | "scale" : "2x"
92 | },
93 | {
94 | "size" : "76x76",
95 | "idiom" : "ipad",
96 | "filename" : "Icon-App-76x76@1x.png",
97 | "scale" : "1x"
98 | },
99 | {
100 | "size" : "76x76",
101 | "idiom" : "ipad",
102 | "filename" : "Icon-App-76x76@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "83.5x83.5",
107 | "idiom" : "ipad",
108 | "filename" : "Icon-App-83.5x83.5@2x.png",
109 | "scale" : "2x"
110 | },
111 | {
112 | "size" : "1024x1024",
113 | "idiom" : "ios-marketing",
114 | "filename" : "Icon-App-1024x1024@1x.png",
115 | "scale" : "1x"
116 | }
117 | ],
118 | "info" : {
119 | "version" : 1,
120 | "author" : "xcode"
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KNKPA/KNKPAnime/bf0032a159938cfd3307d2692d6f42073734ca1f/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KNKPA/KNKPAnime/bf0032a159938cfd3307d2692d6f42073734ca1f/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KNKPA/KNKPAnime/bf0032a159938cfd3307d2692d6f42073734ca1f/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KNKPA/KNKPAnime/bf0032a159938cfd3307d2692d6f42073734ca1f/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KNKPA/KNKPAnime/bf0032a159938cfd3307d2692d6f42073734ca1f/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KNKPA/KNKPAnime/bf0032a159938cfd3307d2692d6f42073734ca1f/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KNKPA/KNKPAnime/bf0032a159938cfd3307d2692d6f42073734ca1f/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KNKPA/KNKPAnime/bf0032a159938cfd3307d2692d6f42073734ca1f/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KNKPA/KNKPAnime/bf0032a159938cfd3307d2692d6f42073734ca1f/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KNKPA/KNKPAnime/bf0032a159938cfd3307d2692d6f42073734ca1f/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KNKPA/KNKPAnime/bf0032a159938cfd3307d2692d6f42073734ca1f/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KNKPA/KNKPAnime/bf0032a159938cfd3307d2692d6f42073734ca1f/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KNKPA/KNKPAnime/bf0032a159938cfd3307d2692d6f42073734ca1f/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KNKPA/KNKPAnime/bf0032a159938cfd3307d2692d6f42073734ca1f/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KNKPA/KNKPAnime/bf0032a159938cfd3307d2692d6f42073734ca1f/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchImage.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchImage@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "LaunchImage@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KNKPA/KNKPAnime/bf0032a159938cfd3307d2692d6f42073734ca1f/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KNKPA/KNKPAnime/bf0032a159938cfd3307d2692d6f42073734ca1f/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KNKPA/KNKPAnime/bf0032a159938cfd3307d2692d6f42073734ca1f/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md:
--------------------------------------------------------------------------------
1 | # Launch Screen Assets
2 |
3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory.
4 |
5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
--------------------------------------------------------------------------------
/ios/Runner/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/ios/Runner/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ios/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleDisplayName
8 | Knkpanime
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | knkpanime
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | $(FLUTTER_BUILD_NAME)
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | $(FLUTTER_BUILD_NUMBER)
25 | LSRequiresIPhoneOS
26 |
27 | UILaunchStoryboardName
28 | LaunchScreen
29 | UIMainStoryboardFile
30 | Main
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 | UISupportedInterfaceOrientations~ipad
38 |
39 | UIInterfaceOrientationPortrait
40 | UIInterfaceOrientationPortraitUpsideDown
41 | UIInterfaceOrientationLandscapeLeft
42 | UIInterfaceOrientationLandscapeRight
43 |
44 | CADisableMinimumFrameDurationOnPhone
45 |
46 | UIApplicationSupportsIndirectInputEvents
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
2 |
--------------------------------------------------------------------------------
/ios/RunnerTests/RunnerTests.swift:
--------------------------------------------------------------------------------
1 | import Flutter
2 | import UIKit
3 | import XCTest
4 |
5 | class RunnerTests: XCTestCase {
6 |
7 | func testExample() {
8 | // If you add code to the Runner application, consider adding tests here.
9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest.
10 | }
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/lib/adapters/adapter_base.dart:
--------------------------------------------------------------------------------
1 | import 'package:knkpanime/models/series.dart';
2 | import 'package:knkpanime/models/episode.dart';
3 | import 'package:knkpanime/models/source.dart';
4 | import 'package:media_kit_video/media_kit_video.dart';
5 |
6 | enum SearchStatus { pending, success, failed }
7 |
8 | /// The base class that all the adapters must inherit.
9 | abstract class AdapterBase {
10 | /// Source name, e.g.: Anime1, yhdm
11 | String name;
12 |
13 | /// Source description, will be displayed on the source selection window if available.
14 | String? description;
15 |
16 | /// Status to reflect each search.
17 | SearchStatus status = SearchStatus.success;
18 |
19 | /// Wether this adapter uses webview to get video link or other resources
20 | bool useWebview;
21 |
22 | AdapterBase(this.name, {this.description, this.useWebview = false});
23 |
24 | /// Given an anime name, search possible resources.
25 | /// [bangumiName] is the name provided by bgm.tv, which could be
26 | /// very detailed but hard to match.
27 | /// [searchKeyword] is the user input, usually simple and short but
28 | /// might not be precise.
29 | ///
30 | /// It is at the subclasses' will to decide which to use and how to use them,
31 | /// and it's also the subclasses' responsibility to update the status.
32 | Future> search(String bangumiName, String searchKeyword);
33 |
34 | /// Given an seriesId returned by [search], get video sources of that anime.
35 | Future> getSources(String seriesId);
36 |
37 | /// Pass the control of player to the adapter to initialize the player.
38 | /// This function should handle all the details such as authentication.
39 | Future play(String episodeId, VideoController controller);
40 |
41 | @override
42 | String toString() {
43 | return name;
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/lib/adapters/adapter_registry.dart:
--------------------------------------------------------------------------------
1 | import 'package:knkpanime/adapters/adapter_base.dart';
2 | import 'package:knkpanime/adapters/anime1_adapter.dart';
3 | import 'package:knkpanime/adapters/bimi_adapter.dart';
4 | import 'package:knkpanime/adapters/girigirilove_adapter.dart';
5 | import 'package:knkpanime/adapters/iyf_adapter.dart';
6 | import 'package:knkpanime/adapters/ant_adapter.dart';
7 | import 'package:knkpanime/adapters/nyafun_adapter.dart';
8 | import 'package:knkpanime/adapters/yhdm_adapter.dart';
9 |
10 | final adapters = [
11 | GirigiriLoveAdapter(),
12 | BimiAdapter(),
13 | //YhdmAdapter(),
14 | Anime1Adapter(),
15 | IyfAdapter(),
16 | AntAdapter(),
17 | NyafunAdapter(),
18 | ];
19 |
--------------------------------------------------------------------------------
/lib/adapters/girigirilove_adapter.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 |
3 | import 'package:dio/dio.dart';
4 | import 'package:flutter_modular/flutter_modular.dart';
5 | import 'package:html/parser.dart';
6 | import 'package:knkpanime/adapters/adapter_base.dart';
7 | import 'package:knkpanime/models/episode.dart';
8 | import 'package:knkpanime/models/series.dart';
9 | import 'package:knkpanime/models/source.dart';
10 | import 'package:logger/logger.dart';
11 | import 'package:media_kit/media_kit.dart';
12 | import 'package:media_kit_video/media_kit_video.dart';
13 |
14 | class GirigiriLoveAdapter extends AdapterBase {
15 | final dio = Dio(BaseOptions(headers: {
16 | 'User-Agent':
17 | 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.3',
18 | }));
19 |
20 | final String baseUrl = 'https://anime.girigirilove.com';
21 | final String searchApi =
22 | 'https://anime.girigirilove.com/search/-------------/?wd=';
23 | final String seriesApi = 'https://anime.girigirilove.com/';
24 | final String playApi = 'https://anime.girigirilove.com/';
25 | late final logger = Modular.get();
26 |
27 | @override
28 | Future> getSources(String seriesId) async {
29 | var resp = await dio.get(seriesApi + seriesId);
30 | return _parseSeries(resp.data.toString());
31 | }
32 |
33 | @override
34 | Future play(String episodeId, VideoController controller) async {
35 | var resp = await dio.get(playApi + episodeId);
36 | await controller.player.open(Media(_parsePlayLink(resp.data.toString())));
37 | }
38 |
39 | @override
40 | Future> search(String bangumiName, String searchKeyword) async {
41 | List ret = [];
42 | status = SearchStatus.pending;
43 | try {
44 | if (bangumiName.isNotEmpty) {
45 | var resp = await dio.get(searchApi + bangumiName);
46 | ret.addAll(_parseSearchResult(resp.data.toString()));
47 | }
48 | if (searchKeyword.isNotEmpty) {
49 | var resp = await dio.get(searchApi + searchKeyword);
50 | ret.addAll(_parseSearchResult(resp.data.toString()));
51 | }
52 | status = SearchStatus.success;
53 | } catch (e) {
54 | status = SearchStatus.failed;
55 | logger.w(e);
56 | rethrow;
57 | }
58 | logger.i('Girigiri love adapter returns ${ret.length} results');
59 | return ret;
60 | }
61 |
62 | List _parseSearchResult(String html) {
63 | var doc = parse(html);
64 | return doc.getElementsByClassName('public-list-box').map((div) {
65 | String? image;
66 | var style = div.querySelector('.cover')?.attributes['style'];
67 | var regExp = RegExp(r'url\((.*?)\)');
68 | if (style != null && regExp.firstMatch(style) != null) {
69 | var url = regExp.firstMatch(style)!.group(1);
70 | image = baseUrl + url!;
71 | }
72 | String name = div.querySelector('.thumb-txt')!.text;
73 | String desc = div.querySelector('.thumb-blurb')!.text;
74 | String id = div
75 | .querySelector('.thumb-menu')!
76 | .firstChild!
77 | .attributes['href']!
78 | .replaceAll('/', '');
79 | return Series(id, name, description: desc, image: image);
80 | }).toList();
81 | }
82 |
83 | List _parseSeries(String html) {
84 | var doc = parse(html);
85 | var uls = doc.querySelectorAll('.anthology-list-play')!;
86 | List ret = [];
87 | uls.forEach((ul) {
88 | List episodes = [];
89 | ul.querySelectorAll('li').asMap().forEach((idx, li) {
90 | episodes.add(Episode(
91 | li.firstChild!.attributes['href']!.replaceAll('/', ''), idx));
92 | });
93 | ret.add(Source(episodes));
94 | });
95 | return ret;
96 | }
97 |
98 | String _parsePlayLink(String html) {
99 | var doc = parse(html);
100 | var div = doc.querySelector('.player-left');
101 | div ??= doc.querySelector('.player-top');
102 | var script =
103 | div!.querySelector('script')!.text.split(',').map((e) => e.trim());
104 | for (var line in script) {
105 | if (line.contains("\"url\"")) {
106 | var encoded =
107 | line.split(':')[1].replaceAll("\"", '').replaceAll(',', '');
108 | var decoded = base64Decode(encoded);
109 | var urlEncoded = String.fromCharCodes(decoded);
110 | var videoLink = Uri.decodeFull(urlEncoded);
111 | logger.i('Parsed video link: $videoLink');
112 | return videoLink;
113 | }
114 | }
115 | return '';
116 | }
117 |
118 | GirigiriLoveAdapter() : super('Girigiri Love');
119 | }
120 |
--------------------------------------------------------------------------------
/lib/adapters/js_adapter.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 | import 'dart:convert';
3 | import 'dart:io';
4 |
5 | import 'package:dio/dio.dart';
6 | import 'package:flutter_inappwebview/flutter_inappwebview.dart';
7 | import 'package:flutter_js/extensions/fetch.dart';
8 | import 'package:flutter_modular/flutter_modular.dart';
9 | import 'package:knkpanime/adapters/adapter_base.dart';
10 | import 'package:flutter_js/flutter_js.dart';
11 | import 'package:knkpanime/models/series.dart';
12 | import 'package:knkpanime/models/source.dart';
13 | import 'package:knkpanime/utils/webview.dart';
14 | import 'package:logger/logger.dart';
15 | import 'package:media_kit/media_kit.dart';
16 | import 'package:media_kit_video/media_kit_video.dart';
17 |
18 | class JSAdapter extends AdapterBase {
19 | late final jsEngine = getJavascriptRuntime();
20 | late final String jsSource;
21 | final completer = Completer();
22 | bool initialized = false;
23 | late final logger = Modular.get();
24 | final String sourceUrl;
25 |
26 | @override
27 | Future> getSources(String seriesId) async {
28 | await initializedOrThrow();
29 | final promise =
30 | jsEngine.evaluate("$jsSource\nadapter.getSources('$seriesId');");
31 | jsEngine.executePendingJob();
32 | final result = await jsEngine.handlePromise(promise);
33 | final ret = (jsonDecode(result.stringResult) as List)
34 | .map((sourceJson) => Source.fromDynamicJson(sourceJson))
35 | .toList();
36 | return ret;
37 | }
38 |
39 | @override
40 | Future play(String episodeId, VideoController controller) async {
41 | // For webview adapters, the js function `getVideoResource` should return
42 | // the url of the play page.
43 | // Otherwise, it should return the media resource's url.
44 | await initializedOrThrow();
45 | final promise =
46 | jsEngine.evaluate("$jsSource\nadapter.getVideoResource('$episodeId');");
47 | jsEngine.executePendingJob();
48 | final result = await jsEngine.handlePromise(promise);
49 | if (useWebview) {
50 | controller.player.open(
51 | Media((await Webview.getVideoResourceUrl(result.stringResult))!));
52 | } else {
53 | controller.player.open(Media(result.stringResult));
54 | }
55 | }
56 |
57 | @override
58 | Future> search(String bangumiName, String searchKeyword) async {
59 | await initializedOrThrow();
60 | status = SearchStatus.pending;
61 | List ret = [];
62 | try {
63 | if (bangumiName.isNotEmpty) {
64 | final promise =
65 | jsEngine.evaluate("$jsSource\nadapter.search('$bangumiName');");
66 | jsEngine.executePendingJob();
67 | final result = await jsEngine.handlePromise(promise);
68 | ret.addAll((jsonDecode(result.stringResult) as List)
69 | .map((json) => Series.fromDynamicJson(json)));
70 | }
71 | if (searchKeyword.isNotEmpty) {
72 | final promise =
73 | jsEngine.evaluate("$jsSource\nadapter.search('$searchKeyword');");
74 | jsEngine.executePendingJob();
75 | final result = await jsEngine.handlePromise(promise);
76 | ret.addAll((jsonDecode(result.stringResult) as List)
77 | .map((json) => Series.fromDynamicJson(json)));
78 | }
79 | } catch (e) {
80 | logger.w(e);
81 | rethrow;
82 | } finally {
83 | status = SearchStatus.failed;
84 | }
85 | status = SearchStatus.success;
86 | logger.i('$name adapter returns ${ret.length} results');
87 |
88 | return ret;
89 | }
90 |
91 | JSAdapter(this.sourceUrl) : super('') {
92 | init();
93 | }
94 |
95 | void init() async {
96 | try {
97 | await Dio()
98 | .get(sourceUrl)
99 | .then((resp) => jsSource = resp.data.toString());
100 | jsEngine.enableHandlePromises();
101 | await jsEngine.enableFetch();
102 | final configJson = jsEngine.evaluate("$jsSource\nadapter.getConfig();");
103 | final config = jsonDecode(configJson.stringResult);
104 | name = config['name']!;
105 | description = config['description'];
106 | useWebview = config['useWebview'] ?? false;
107 | completer.complete(true);
108 | initialized = true;
109 | } catch (e) {
110 | logger.w(e);
111 | completer.complete(false);
112 | }
113 | }
114 |
115 | Future initializedOrThrow() async {
116 | await completer.future;
117 | if (!initialized) throw ('该视频源初始化失败');
118 | }
119 | }
120 |
--------------------------------------------------------------------------------
/lib/adapters/models/anime1_anime_info.dart:
--------------------------------------------------------------------------------
1 | part of '../anime1_adapter.dart';
2 |
3 | class Anime1AnimeInfo {
4 | int id;
5 | String name;
6 |
7 | Anime1AnimeInfo(this.id, this.name);
8 | }
9 |
--------------------------------------------------------------------------------
/lib/adapters/models/yhmd_response.dart:
--------------------------------------------------------------------------------
1 | class YhdmResponse {
2 | int aid;
3 | int playindex;
4 | int epindex;
5 |
6 | YhdmResponse(this.aid, this.playindex, this.epindex);
7 |
8 | Map toJson() {
9 | return {
10 | 'aid': aid,
11 | 'playindex': playindex,
12 | 'epindex': epindex,
13 | };
14 | }
15 |
16 | static YhdmResponse extractNumbers(String input) {
17 | RegExp regex = RegExp(r'/(\d+)-(\d+)-(\d+)\.html');
18 | RegExpMatch? match = regex.firstMatch(input);
19 | if (match != null) {
20 | int aid = int.parse(match.group(1)!);
21 | int playindex = int.parse(match.group(2)!);
22 | int epindex = int.parse(match.group(3)!);
23 | return YhdmResponse(aid, playindex, epindex);
24 | }
25 | throw Exception('No match found');
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/lib/adapters/nyafun_adapter.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 |
3 | import 'package:dio/dio.dart';
4 | import 'package:flutter_modular/flutter_modular.dart';
5 | import 'package:html/parser.dart';
6 | import 'package:knkpanime/adapters/adapter_base.dart';
7 | import 'package:knkpanime/models/episode.dart';
8 | import 'package:knkpanime/models/series.dart';
9 | import 'package:knkpanime/models/source.dart';
10 | import 'package:knkpanime/utils/webview.dart';
11 | import 'package:logger/logger.dart';
12 | import 'package:media_kit/media_kit.dart';
13 | import 'package:media_kit_video/media_kit_video.dart';
14 |
15 | class NyafunAdapter extends AdapterBase {
16 | final dio = Dio(BaseOptions(headers: {
17 | 'User-Agent':
18 | 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.3',
19 | }));
20 |
21 | final String baseUrl = 'https://www.nyafun.net';
22 | final String searchApi = 'https://www.nyafun.net/search.html?wd=';
23 | final String seriesApi = 'https://www.nyafun.net';
24 | final String playApi = 'https://www.nyafun.net';
25 | late final logger = Modular.get();
26 |
27 | @override
28 | Future> getSources(String seriesId) async {
29 | var resp = await dio.get(seriesApi + seriesId);
30 | return _parseSeries(resp.data.toString());
31 | }
32 |
33 | @override
34 | Future play(String episodeId, VideoController controller) async {
35 | String url = (await Webview.getVideoResourceUrl(playApi + episodeId))!;
36 | await controller.player.open(Media(url, httpHeaders: {'Referer': url}));
37 | }
38 |
39 | @override
40 | Future> search(String bangumiName, String searchKeyword) async {
41 | List ret = [];
42 | status = SearchStatus.pending;
43 | try {
44 | if (bangumiName.isNotEmpty) {
45 | var resp = await dio.get(searchApi + bangumiName);
46 | ret.addAll(_parseSearchResult(resp.data.toString()));
47 | }
48 | if (searchKeyword.isNotEmpty) {
49 | var resp = await dio.get(searchApi + searchKeyword);
50 | ret.addAll(_parseSearchResult(resp.data.toString()));
51 | }
52 | status = SearchStatus.success;
53 | } catch (e) {
54 | status = SearchStatus.failed;
55 | logger.w(e);
56 | rethrow;
57 | }
58 | logger.i('Girigiri love adapter returns ${ret.length} results');
59 | return ret;
60 | }
61 |
62 | List _parseSearchResult(String html) {
63 | var doc = parse(html);
64 | return doc.getElementsByClassName('public-list-box').map((div) {
65 | final a = div.querySelector('.thumb-txt.cor4.hide')!.querySelector('a')!;
66 | String? image = div.querySelector('img')?.attributes['data-src'];
67 | String name = a.text;
68 | String? desc = div.querySelector('.cor5.thumb-blurb.hide2')?.text;
69 | String id = a.attributes['href']!;
70 | return Series(id, name, description: desc, image: image);
71 | }).toList();
72 | }
73 |
74 | List _parseSeries(String html) {
75 | var doc = parse(html);
76 | var uls = doc.querySelectorAll('.anthology-list-play');
77 | List ret = [];
78 | uls.forEach((ul) {
79 | List episodes = [];
80 | ul.querySelectorAll('li').asMap().forEach((idx, li) {
81 | final a = li.querySelector('a')!;
82 | episodes.add(Episode(a.attributes['href']!, idx, a.text));
83 | });
84 | ret.add(Source(episodes));
85 | });
86 | return ret;
87 | }
88 |
89 | String _parsePlayLink(String html) {
90 | var doc = parse(html);
91 | var div = doc.querySelector('.player-left');
92 | div ??= doc.querySelector('.player-top');
93 | var scriptText = div!
94 | .querySelectorAll('script')
95 | .fold('', (previousValue, element) => previousValue + element.text)
96 | .split(',')
97 | .map((e) => e.trim());
98 | for (var line in scriptText) {
99 | if (line.contains("\"url\"")) {
100 | var encoded =
101 | line.split(':')[1].replaceAll("\"", '').replaceAll(',', '');
102 | var decoded = base64Decode(encoded);
103 | var urlEncoded = String.fromCharCodes(decoded);
104 | var videoLink = Uri.decodeFull(urlEncoded);
105 | logger.i('Parsed video link: $videoLink');
106 | return videoLink;
107 | }
108 | }
109 | return '';
110 | }
111 |
112 | NyafunAdapter() : super('Nyafun', useWebview: true);
113 | }
114 |
--------------------------------------------------------------------------------
/lib/app_module.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart' hide SearchController;
2 | import 'package:flutter_modular/flutter_modular.dart';
3 | import 'package:knkpanime/pages/calendar/calendar_module.dart';
4 | import 'package:knkpanime/pages/favorite/favorite_controller.dart';
5 | import 'package:knkpanime/pages/favorite/favorite_module.dart';
6 | import 'package:knkpanime/pages/history/history_controller.dart';
7 | import 'package:knkpanime/pages/history/history_module.dart';
8 | import 'package:knkpanime/pages/play/play_module.dart';
9 | import 'package:knkpanime/pages/search/adapter_search_controller.dart';
10 | import 'package:knkpanime/pages/search/search_module.dart';
11 | import 'package:knkpanime/pages/settings/settings_controller.dart';
12 | import 'package:knkpanime/pages/settings/settings_module.dart';
13 | import 'package:knkpanime/pages/calendar/calendar_controller.dart';
14 | import 'package:knkpanime/pages/search/bangumi_search_controller.dart';
15 | import 'package:logger/logger.dart';
16 |
17 | class AppModule extends Module {
18 | @override
19 | void binds(i) {
20 | i.addInstance(Logger());
21 | i.addSingleton(SettingsController.new);
22 | i.addSingleton(CalendarController.new);
23 | i.addSingleton(BangumiSearchController.new);
24 | i.addSingleton(HistoryController.new);
25 | i.addSingleton(FavoriteController.new);
26 | i.addSingleton(AdapterSearchController.new);
27 | }
28 |
29 | @override
30 | void routes(r) {
31 | r.module('/search/',
32 | module: SearchModule(), transition: TransitionType.noTransition);
33 | r.module('/play/',
34 | module: PlayModule(), transition: TransitionType.noTransition);
35 | r.module('/history/',
36 | module: HistoryModule(), transition: TransitionType.noTransition);
37 | r.module('/favorite/',
38 | module: FavoriteModule(), transition: TransitionType.noTransition);
39 | r.module('/calendar/',
40 | module: CalendarModule(), transition: TransitionType.noTransition);
41 | r.module('/settings/',
42 | module: SettingsModule(), transition: TransitionType.noTransition);
43 | }
44 | }
45 |
46 | const routes = [
47 | {
48 | 'path': '/search/bangumi',
49 | 'name': 'Bangumi搜索',
50 | 'icon': Icon(Icons.search),
51 | 'bottom': false,
52 | },
53 | {
54 | 'path': '/search/adapter',
55 | 'name': '番剧源搜索',
56 | 'icon': Icon(Icons.search),
57 | 'bottom': false,
58 | },
59 | {
60 | 'path': '/history/',
61 | 'name': '历史记录',
62 | 'icon': Icon(Icons.history),
63 | 'bottom': false,
64 | },
65 | {
66 | 'path': '/favorite/',
67 | 'name': '追番',
68 | 'icon': Icon(Icons.favorite),
69 | 'bottom': false,
70 | },
71 | {
72 | 'path': '/calendar/',
73 | 'name': '新番日历',
74 | 'icon': Icon(Icons.calendar_month),
75 | 'bottom': false,
76 | },
77 | {
78 | 'path': '/settings/',
79 | 'name': '设置',
80 | 'icon': Icon(Icons.settings),
81 | 'bottom': true,
82 | },
83 | ];
84 |
--------------------------------------------------------------------------------
/lib/app_widget.dart:
--------------------------------------------------------------------------------
1 | import 'dart:io';
2 | import 'package:adaptive_theme/adaptive_theme.dart';
3 | import 'package:flutter/material.dart';
4 | import 'package:flutter_modular/flutter_modular.dart';
5 | import 'package:google_fonts/google_fonts.dart';
6 | import 'package:knkpanime/navigation.dart';
7 | import 'package:knkpanime/pages/settings/settings_controller.dart';
8 | import 'package:knkpanime/utils/utils.dart';
9 | import 'package:flutter_displaymode/flutter_displaymode.dart';
10 |
11 | class AppWidget extends StatefulWidget {
12 | const AppWidget({super.key});
13 |
14 | @override
15 | State createState() => _AppWidgetState();
16 | }
17 |
18 | class _AppWidgetState extends State {
19 | @override
20 | Widget build(BuildContext context) {
21 | // 设置高帧率
22 | if (Platform.isAndroid) {
23 | try {
24 | late List modes;
25 | FlutterDisplayMode.supported.then((value) {
26 | modes = value;
27 | DisplayMode f = DisplayMode.auto;
28 | DisplayMode preferred = modes.toList().firstWhere((el) => el == f);
29 | FlutterDisplayMode.setPreferredMode(preferred);
30 | });
31 | } catch (_) {}
32 | }
33 | return AdaptiveTheme(
34 | light: ThemeData.light(useMaterial3: true).copyWith(
35 | textTheme: Modular.get().useDefaultFont
36 | ? null
37 | : GoogleFonts.notoSerifHkTextTheme()),
38 | dark: ThemeData.dark(useMaterial3: true).copyWith(
39 | textTheme: Modular.get().useDefaultFont
40 | ? null
41 | : GoogleFonts.notoSerifHkTextTheme()),
42 | initial: AdaptiveThemeMode.light,
43 | builder: (theme, darkTheme) => MaterialApp.router(
44 | title: "KNKP Anime",
45 | theme: theme,
46 | darkTheme: darkTheme,
47 | //routeInformationParser: Modular.routeInformationParser,
48 | //routerDelegate: Modular.routerDelegate,
49 | routerConfig: Modular.routerConfig,
50 | builder: (context, child) => Overlay(
51 | initialEntries: [
52 | OverlayEntry(
53 | builder: (context) => Scaffold(
54 | body: SafeArea(
55 | child: Row(
56 | crossAxisAlignment: CrossAxisAlignment.start,
57 | children: [
58 | if (!Utils.isSmallScreen(context))
59 | const SideMenu(),
60 | Expanded(
61 | flex: 5,
62 | child: child!,
63 | )
64 | ],
65 | ),
66 | ),
67 | bottomNavigationBar: Utils.isSmallScreen(context)
68 | ? const BottomNavigation()
69 | : null,
70 | ))
71 | ],
72 | )));
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/lib/main.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_modular/flutter_modular.dart';
3 | import 'package:hive_flutter/adapters.dart';
4 | import 'package:knkpanime/app_module.dart';
5 | import 'package:knkpanime/app_widget.dart';
6 | import 'package:knkpanime/pages/settings/settings_controller.dart';
7 | import 'package:knkpanime/utils/storage.dart';
8 | import 'package:knkpanime/utils/utils.dart';
9 | import 'package:media_kit/media_kit.dart';
10 | import 'package:package_info_plus/package_info_plus.dart';
11 | import 'package:path_provider/path_provider.dart';
12 | import 'package:shared_preferences/shared_preferences.dart';
13 | import 'package:window_manager/window_manager.dart';
14 | import 'package:flutter/services.dart';
15 |
16 | late String version;
17 |
18 | void main() async {
19 | WidgetsFlutterBinding.ensureInitialized();
20 | SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle(
21 | statusBarColor: Colors.transparent,
22 | ));
23 | Modular.setInitialRoute('/search/bangumi');
24 | await Hive.initFlutter('${(await getApplicationSupportDirectory()).path}/v1');
25 | await SettingsController.init();
26 | await Storage.init();
27 | MediaKit.ensureInitialized();
28 | version = (await PackageInfo.fromPlatform()).version;
29 | if (Utils.isDesktop()) {
30 | await windowManager.ensureInitialized();
31 | final prefs = await SharedPreferences.getInstance();
32 | windowManager.setAlwaysOnTop(prefs.getBool('alwaysOnTop') ?? false);
33 | }
34 | runApp(ModularApp(module: AppModule(), child: const AppWidget()));
35 | }
36 |
--------------------------------------------------------------------------------
/lib/models/anime_info.dart:
--------------------------------------------------------------------------------
1 | import 'package:hive/hive.dart';
2 |
3 | part 'anime_info.g.dart';
4 |
5 | @HiveType(typeId: 4)
6 | class AnimeInfo {
7 | @HiveField(0)
8 | int id;
9 | @HiveField(1)
10 | String url;
11 | @HiveField(2)
12 | String nameCn;
13 | @HiveField(3)
14 | String nameJp;
15 | @HiveField(4)
16 | String summary;
17 | @HiveField(5)
18 | String airDate;
19 | @HiveField(6)
20 | Map? images;
21 |
22 | AnimeInfo(this.id, this.url, this.nameCn, this.nameJp, this.summary,
23 | this.airDate, this.images);
24 |
25 | String get name => nameCn.isNotEmpty ? nameCn : nameJp;
26 |
27 | @override
28 | String toString() {
29 | return 'id: $id\n'
30 | 'url: $url\n'
31 | 'Chinese name: $nameCn\n'
32 | 'Japanese name: $nameJp';
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/lib/models/anime_info.g.dart:
--------------------------------------------------------------------------------
1 | // GENERATED CODE - DO NOT MODIFY BY HAND
2 |
3 | part of 'anime_info.dart';
4 |
5 | // **************************************************************************
6 | // TypeAdapterGenerator
7 | // **************************************************************************
8 |
9 | class AnimeInfoAdapter extends TypeAdapter {
10 | @override
11 | final int typeId = 4;
12 |
13 | @override
14 | AnimeInfo read(BinaryReader reader) {
15 | final numOfFields = reader.readByte();
16 | final fields = {
17 | for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
18 | };
19 | return AnimeInfo(
20 | fields[0] as int,
21 | fields[1] as String,
22 | fields[2] as String,
23 | fields[3] as String,
24 | fields[4] as String,
25 | fields[5] as String,
26 | (fields[6] as Map?)?.cast(),
27 | );
28 | }
29 |
30 | @override
31 | void write(BinaryWriter writer, AnimeInfo obj) {
32 | writer
33 | ..writeByte(7)
34 | ..writeByte(0)
35 | ..write(obj.id)
36 | ..writeByte(1)
37 | ..write(obj.url)
38 | ..writeByte(2)
39 | ..write(obj.nameCn)
40 | ..writeByte(3)
41 | ..write(obj.nameJp)
42 | ..writeByte(4)
43 | ..write(obj.summary)
44 | ..writeByte(5)
45 | ..write(obj.airDate)
46 | ..writeByte(6)
47 | ..write(obj.images);
48 | }
49 |
50 | @override
51 | int get hashCode => typeId.hashCode;
52 |
53 | @override
54 | bool operator ==(Object other) =>
55 | identical(this, other) ||
56 | other is AnimeInfoAdapter &&
57 | runtimeType == other.runtimeType &&
58 | typeId == other.typeId;
59 | }
60 |
--------------------------------------------------------------------------------
/lib/models/danmaku.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:ns_danmaku/ns_danmaku.dart';
3 |
4 | class Danmaku {
5 | String content;
6 | double offset;
7 | // TODO: support danmaku position & color?
8 | DanmakuItemType position;
9 | Color color;
10 |
11 | Danmaku(this.offset, this.content, this.position, this.color);
12 | }
13 |
14 | class DanmakuAnimeInfo {
15 | int id;
16 | String name;
17 | int episodeCount;
18 |
19 | DanmakuAnimeInfo(this.id, this.name, this.episodeCount);
20 | }
21 |
--------------------------------------------------------------------------------
/lib/models/episode.dart:
--------------------------------------------------------------------------------
1 | import 'package:hive/hive.dart';
2 |
3 | part 'episode.g.dart';
4 |
5 | @HiveType(typeId: 2)
6 | class Episode {
7 | /// Adapter defined episode id, this will later be used to play the video
8 | @HiveField(0)
9 | String episodeId;
10 |
11 | /// This field must be the index of the episode, starting from 0
12 | /// This will be used to construct watching history
13 | @HiveField(1)
14 | int episode;
15 |
16 | /// Adapter defined episode name, will be displayed on the playlist.
17 | @HiveField(2)
18 | String? episodeName;
19 |
20 | String get name => episodeName ?? '第${episode + 1}集';
21 |
22 | Episode(this.episodeId, this.episode, [this.episodeName]);
23 |
24 | Episode.fromDynamicJson(dynamic json)
25 | : episodeId = json['episodeId']!,
26 | episode = json['episode']!,
27 | episodeName = json['episodeName'];
28 | }
29 |
--------------------------------------------------------------------------------
/lib/models/episode.g.dart:
--------------------------------------------------------------------------------
1 | // GENERATED CODE - DO NOT MODIFY BY HAND
2 |
3 | part of 'episode.dart';
4 |
5 | // **************************************************************************
6 | // TypeAdapterGenerator
7 | // **************************************************************************
8 |
9 | class EpisodeAdapter extends TypeAdapter {
10 | @override
11 | final int typeId = 2;
12 |
13 | @override
14 | Episode read(BinaryReader reader) {
15 | final numOfFields = reader.readByte();
16 | final fields = {
17 | for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
18 | };
19 | return Episode(
20 | fields[0] as String,
21 | fields[1] as int,
22 | fields[2] as String?,
23 | );
24 | }
25 |
26 | @override
27 | void write(BinaryWriter writer, Episode obj) {
28 | writer
29 | ..writeByte(3)
30 | ..writeByte(0)
31 | ..write(obj.episodeId)
32 | ..writeByte(1)
33 | ..write(obj.episode)
34 | ..writeByte(2)
35 | ..write(obj.episodeName);
36 | }
37 |
38 | @override
39 | int get hashCode => typeId.hashCode;
40 |
41 | @override
42 | bool operator ==(Object other) =>
43 | identical(this, other) ||
44 | other is EpisodeAdapter &&
45 | runtimeType == other.runtimeType &&
46 | typeId == other.typeId;
47 | }
48 |
--------------------------------------------------------------------------------
/lib/models/history.dart:
--------------------------------------------------------------------------------
1 | import 'package:hive/hive.dart';
2 | import 'package:knkpanime/models/episode.dart';
3 | import 'package:knkpanime/models/series.dart';
4 |
5 | part 'history.g.dart';
6 |
7 | @HiveType(typeId: 0)
8 | class History {
9 | @HiveField(0)
10 | Map progresses = {};
11 |
12 | @HiveField(1)
13 | int lastWatchEpisode;
14 |
15 | @HiveField(2)
16 | String adapterName;
17 |
18 | @HiveField(3)
19 | Series series;
20 |
21 | @HiveField(4)
22 | DateTime lastWatchTime;
23 |
24 | String get key => adapterName + series.seriesId;
25 |
26 | History(
27 | this.series, this.lastWatchEpisode, this.adapterName, this.lastWatchTime);
28 |
29 | static String getKey(String n, Series s) => n + s.seriesId;
30 |
31 | @override
32 | String toString() {
33 | return 'Adapter: $adapterName, anime: $series';
34 | }
35 | }
36 |
37 | @HiveType(typeId: 1)
38 | class Progress {
39 | @HiveField(0)
40 | Episode episode;
41 |
42 | @HiveField(1)
43 | int _progressInMilli;
44 |
45 | Duration get progress => Duration(milliseconds: _progressInMilli);
46 |
47 | set progress(Duration d) => _progressInMilli = d.inMilliseconds;
48 |
49 | Progress(this.episode, this._progressInMilli);
50 |
51 | @override
52 | String toString() {
53 | return 'Episode $episode, progress $progress';
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/lib/models/history.g.dart:
--------------------------------------------------------------------------------
1 | // GENERATED CODE - DO NOT MODIFY BY HAND
2 |
3 | part of 'history.dart';
4 |
5 | // **************************************************************************
6 | // TypeAdapterGenerator
7 | // **************************************************************************
8 |
9 | class HistoryAdapter extends TypeAdapter {
10 | @override
11 | final int typeId = 0;
12 |
13 | @override
14 | History read(BinaryReader reader) {
15 | final numOfFields = reader.readByte();
16 | final fields = {
17 | for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
18 | };
19 | return History(
20 | fields[3] as Series,
21 | fields[1] as int,
22 | fields[2] as String,
23 | fields[4] as DateTime,
24 | )..progresses = (fields[0] as Map).cast();
25 | }
26 |
27 | @override
28 | void write(BinaryWriter writer, History obj) {
29 | writer
30 | ..writeByte(5)
31 | ..writeByte(0)
32 | ..write(obj.progresses)
33 | ..writeByte(1)
34 | ..write(obj.lastWatchEpisode)
35 | ..writeByte(2)
36 | ..write(obj.adapterName)
37 | ..writeByte(3)
38 | ..write(obj.series)
39 | ..writeByte(4)
40 | ..write(obj.lastWatchTime);
41 | }
42 |
43 | @override
44 | int get hashCode => typeId.hashCode;
45 |
46 | @override
47 | bool operator ==(Object other) =>
48 | identical(this, other) ||
49 | other is HistoryAdapter &&
50 | runtimeType == other.runtimeType &&
51 | typeId == other.typeId;
52 | }
53 |
54 | class ProgressAdapter extends TypeAdapter