Skip to content

基于自定义规则的番剧采集APP,支持流媒体在线观看,支持弹幕,支持实时超分辨率。

add android permission

Predidit438a3ad0c3a6
diff --git a/android/app/build.gradle b/android/app/build.gradle
index ca3d43b7..47db0a34 100644
--- a/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -42,7 +42,7 @@ android {
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
- applicationId "com.example.kazumi"
+ applicationId "com.predidit.kazumi"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion flutter.minSdkVersion
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index 3c113c2a..fa76abdf 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -1,6 +1,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application
- android:label="kazumi"
+ android:label="Kazumi"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<activity
@@ -30,6 +30,16 @@
android:name="flutterEmbedding"
android:value="2" />
</application>
+ <uses-permission android:name="android.permission.INTERNET" />
+ <uses-permission android:name="android.permission.READ_MEDIA_IMAGES"/>
+ <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
+ <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
+ <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
+ <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
+ <uses-permission android:name="android.permission.WAKE_LOCK"/>
+ <uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
+ <uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
+ <uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
<!-- Required to query activities that can process text, see:
https://developer.android.com/training/package-visibility?hl=en and
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.
diff --git a/lib/pages/info/info_page.dart b/lib/pages/info/info_page.dart
index f56312a1..8a65f502 100644
--- a/lib/pages/info/info_page.dart
+++ b/lib/pages/info/info_page.dart
@@ -67,82 +67,84 @@ class _InfoPageState extends State<InfoPage>
onPopInvoked: (bool didPop) {
onBackPressed(context);
},
- child: Scaffold(
- appBar: const SysAppBar(),
- body: Column(
- children: [
- BangumiInfoCardV(bangumiItem: infoController.bangumiItem),
- TabBar(
- isScrollable: true,
- tabAlignment: TabAlignment.center,
- controller: tabController,
- tabs: pluginsController.pluginList
- .map((plugin) => Observer(
- builder: (context) => Row(
- mainAxisSize: MainAxisSize.min,
- children: [
- Text(
- plugin.name,
- overflow: TextOverflow.ellipsis,
- ),
- const SizedBox(width: 5.0),
- Container(
- width: 8.0,
- height: 8.0,
- decoration: BoxDecoration(
- color: infoController
- .pluginSearchStatus[plugin.name] ==
- 'success'
- ? Colors.green
- : (infoController.pluginSearchStatus[
- plugin.name] ==
- 'pending')
- ? Colors.grey
- : Colors.red,
- // color: Colors.green,
- shape: BoxShape.circle,
+ child: SafeArea(
+ child: Scaffold(
+ appBar: const SysAppBar(),
+ body: Column(
+ children: [
+ BangumiInfoCardV(bangumiItem: infoController.bangumiItem),
+ TabBar(
+ isScrollable: true,
+ tabAlignment: TabAlignment.center,
+ controller: tabController,
+ tabs: pluginsController.pluginList
+ .map((plugin) => Observer(
+ builder: (context) => Row(
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ Text(
+ plugin.name,
+ overflow: TextOverflow.ellipsis,
),
- ),
- ],
- ),
- ))
- .toList(),
- ),
- Expanded(
- child: Observer(
- builder: (context) => TabBarView(
- controller: tabController,
- children: List.generate(pluginsController.pluginList.length,
- (pluginIndex) {
- var plugin = pluginsController.pluginList[pluginIndex];
- var cardList = <Widget>[];
- for (var searchResponse
- in infoController.pluginSearchResponseList) {
- if (searchResponse.pluginName == plugin.name) {
- for (var searchItem in searchResponse.data) {
- cardList.add(Card(
- child: ListTile(
- title: Text(searchItem.name),
- onTap: () async {
- SmartDialog.showLoading(msg: '获取中');
- videoPageController.currentPlugin = plugin;
- videoPageController.title = searchItem.name;
- await infoController.queryRoads(
- searchItem.src, plugin.name);
- SmartDialog.dismiss();
- Modular.to.pushNamed('/tab/video/');
- },
- ),
- ));
+ const SizedBox(width: 5.0),
+ Container(
+ width: 8.0,
+ height: 8.0,
+ decoration: BoxDecoration(
+ color: infoController
+ .pluginSearchStatus[plugin.name] ==
+ 'success'
+ ? Colors.green
+ : (infoController.pluginSearchStatus[
+ plugin.name] ==
+ 'pending')
+ ? Colors.grey
+ : Colors.red,
+ // color: Colors.green,
+ shape: BoxShape.circle,
+ ),
+ ),
+ ],
+ ),
+ ))
+ .toList(),
+ ),
+ Expanded(
+ child: Observer(
+ builder: (context) => TabBarView(
+ controller: tabController,
+ children: List.generate(pluginsController.pluginList.length,
+ (pluginIndex) {
+ var plugin = pluginsController.pluginList[pluginIndex];
+ var cardList = <Widget>[];
+ for (var searchResponse
+ in infoController.pluginSearchResponseList) {
+ if (searchResponse.pluginName == plugin.name) {
+ for (var searchItem in searchResponse.data) {
+ cardList.add(Card(
+ child: ListTile(
+ title: Text(searchItem.name),
+ onTap: () async {
+ SmartDialog.showLoading(msg: '获取中');
+ videoPageController.currentPlugin = plugin;
+ videoPageController.title = searchItem.name;
+ await infoController.queryRoads(
+ searchItem.src, plugin.name);
+ SmartDialog.dismiss();
+ Modular.to.pushNamed('/tab/video/');
+ },
+ ),
+ ));
+ }
}
}
- }
- return ListView(children: cardList);
- }),
+ return ListView(children: cardList);
+ }),
+ ),
),
- ),
- )
- ],
+ )
+ ],
+ ),
),
),
);
diff --git a/lib/pages/video/video_page.dart b/lib/pages/video/video_page.dart
index e56526ac..b64481ae 100644
--- a/lib/pages/video/video_page.dart
+++ b/lib/pages/video/video_page.dart
@@ -72,198 +72,196 @@ class _VideoPageState extends State<VideoPage>
}
});
return SafeArea(
- child: Observer(
- builder: (context) {
- return Scaffold(
- appBar: ((videoPageController.currentPlugin.useNativePlayer ||
- videoPageController.androidFullscreen)
- ? null
- : SysAppBar()),
- body: Column(
- children: [
- Container(
- color: Colors.black,
- height: MediaQuery.of(context).size.width * 9 / 16,
- width: MediaQuery.of(context).size.width,
- child: Stack(
- children: [
- Positioned.fill(
- child: Visibility(
- visible: videoPageController.loading,
- child: (!videoPageController.currentPlugin.useNativePlayer)
- ? Container(
- color: Colors.black,
- child: const Center(
- child: CircularProgressIndicator()))
- : Container(),
- )),
- Positioned.fill(
- child:
- (!videoPageController.currentPlugin.useNativePlayer ||
- playerController.loading)
- ? Container()
- : const PlayerItem(),
- ),
- Positioned(
- child: SizedBox(
- height: (videoPageController.loading ||
- videoPageController.currentPlugin.useNativePlayer)
- ? 0
- : null,
- child: Platform.isWindows
- ? const WebviewDesktopItem()
- : const WebviewItem(),
- ))
- ],
- ),
+ child: Observer(builder: (context) {
+ return Scaffold(
+ appBar: ((videoPageController.currentPlugin.useNativePlayer ||
+ videoPageController.androidFullscreen)
+ ? null
+ : SysAppBar()),
+ body: Column(
+ children: [
+ Container(
+ color: Colors.black,
+ height: MediaQuery.of(context).size.width * 9 / 16,
+ width: MediaQuery.of(context).size.width,
+ child: Stack(
+ children: [
+ Positioned.fill(
+ child: Visibility(
+ visible: videoPageController.loading,
+ child:
+ (!videoPageController.currentPlugin.useNativePlayer)
+ ? Container(
+ color: Colors.black,
+ child: const Center(
+ child: CircularProgressIndicator()))
+ : Container(),
+ )),
+ Positioned.fill(
+ child:
+ (!videoPageController.currentPlugin.useNativePlayer ||
+ playerController.loading)
+ ? Container()
+ : const PlayerItem(),
+ ),
+ Positioned(
+ child: SizedBox(
+ height: (videoPageController.loading ||
+ videoPageController.currentPlugin.useNativePlayer)
+ ? 0
+ : null,
+ child: Platform.isWindows
+ ? const WebviewDesktopItem()
+ : const WebviewItem(),
+ ))
+ ],
),
-
- videoPageController.androidFullscreen
- ? Container()
- : Expanded(
- child: Observer(
- builder: (context) => TabBarView(
- controller: tabController,
- children: List.generate(
- videoPageController.roadList.length, (roadIndex) {
- var cardList = <Widget>[];
- for (var road in videoPageController.roadList) {
- if (road.name == '播放列表${roadIndex + 1}') {
- int count = 1;
- for (var urlItem in road.data) {
- int _count = count;
- cardList.add(Container(
- margin: const EdgeInsets.only(
- bottom: 10), // 改为bottom间距
- child: Material(
- color: Theme.of(context)
- .colorScheme
- .onInverseSurface,
- borderRadius: BorderRadius.circular(6),
- clipBehavior: Clip.hardEdge,
- child: InkWell(
- onTap: () async {
- debugPrint('视频链接为 $urlItem');
- videoPageController.changeEpisode(
- _count,
- currentRoad: roadIndex);
- },
- child: Padding(
- padding: const EdgeInsets.symmetric(
- vertical: 8, horizontal: 10),
- child: Column(
- crossAxisAlignment:
- CrossAxisAlignment.start,
- children: <Widget>[
- Row(
- children: [
- if (_count ==
- (videoPageController
- .currentEspisode)) ...<Widget>[
- Image.asset(
- 'assets/images/live.png',
- color: Theme.of(context)
- .colorScheme
- .primary,
- height: 12,
- ),
- const SizedBox(width: 6)
- ],
- Text(
- '第$count话',
- style: TextStyle(
- fontSize: 13,
- color: _count ==
- (videoPageController
- .currentEspisode)
- ? Theme.of(context)
- .colorScheme
- .primary
- : Theme.of(context)
- .colorScheme
- .onSurface),
+ ),
+ videoPageController.androidFullscreen
+ ? Container()
+ : TabBar(
+ isScrollable: true,
+ tabAlignment: TabAlignment.center,
+ controller: tabController,
+ tabs: videoPageController.roadList
+ .map((road) => Observer(
+ builder: (context) => Row(
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ Text(
+ road.name,
+ overflow: TextOverflow.ellipsis,
+ ),
+ ],
+ ),
+ ))
+ .toList(),
+ ),
+ videoPageController.androidFullscreen
+ ? Container()
+ : Expanded(
+ child: Observer(
+ builder: (context) => TabBarView(
+ controller: tabController,
+ children: List.generate(
+ videoPageController.roadList.length, (roadIndex) {
+ var cardList = <Widget>[];
+ for (var road in videoPageController.roadList) {
+ if (road.name == '播放列表${roadIndex + 1}') {
+ int count = 1;
+ for (var urlItem in road.data) {
+ int _count = count;
+ cardList.add(Container(
+ margin: const EdgeInsets.only(
+ bottom: 10), // 改为bottom间距
+ child: Material(
+ color: Theme.of(context)
+ .colorScheme
+ .onInverseSurface,
+ borderRadius: BorderRadius.circular(6),
+ clipBehavior: Clip.hardEdge,
+ child: InkWell(
+ onTap: () async {
+ debugPrint('视频链接为 $urlItem');
+ videoPageController.changeEpisode(
+ _count,
+ currentRoad: roadIndex);
+ },
+ child: Padding(
+ padding: const EdgeInsets.symmetric(
+ vertical: 8, horizontal: 10),
+ child: Column(
+ crossAxisAlignment:
+ CrossAxisAlignment.start,
+ children: <Widget>[
+ Row(
+ children: [
+ if (_count ==
+ (videoPageController
+ .currentEspisode)) ...<Widget>[
+ Image.asset(
+ 'assets/images/live.png',
+ color: Theme.of(context)
+ .colorScheme
+ .primary,
+ height: 12,
),
- const SizedBox(width: 2),
+ const SizedBox(width: 6)
],
- ),
- const SizedBox(height: 3),
- ],
- ),
+ Text(
+ '第$count话',
+ style: TextStyle(
+ fontSize: 13,
+ color: _count ==
+ (videoPageController
+ .currentEspisode)
+ ? Theme.of(context)
+ .colorScheme
+ .primary
+ : Theme.of(context)
+ .colorScheme
+ .onSurface),
+ ),
+ const SizedBox(width: 2),
+ ],
+ ),
+ const SizedBox(height: 3),
+ ],
),
),
),
- ));
- count++;
- }
+ ),
+ ));
+ count++;
}
}
- // return ListView(children: cardList);
- return GridView.builder(
- scrollDirection: Axis.vertical,
- gridDelegate:
- SliverGridDelegateWithFixedCrossAxisCount(
- crossAxisCount: Platform.isWindows ||
- Platform.isLinux ||
- Platform.isMacOS
- ? 10
- : 3,
- crossAxisSpacing: 10,
- mainAxisSpacing: 5,
- childAspectRatio: 1.7,
- ),
- itemCount: cardList.length,
- itemBuilder: (context, index) {
- return cardList[index];
- },
- );
- }),
- ),
+ }
+ // return ListView(children: cardList);
+ return GridView.builder(
+ scrollDirection: Axis.vertical,
+ gridDelegate:
+ SliverGridDelegateWithFixedCrossAxisCount(
+ crossAxisCount: Platform.isWindows ||
+ Platform.isLinux ||
+ Platform.isMacOS
+ ? 10
+ : 3,
+ crossAxisSpacing: 10,
+ mainAxisSpacing: 5,
+ childAspectRatio: 1.7,
+ ),
+ itemCount: cardList.length,
+ itemBuilder: (context, index) {
+ return cardList[index];
+ },
+ );
+ }),
),
),
- videoPageController.androidFullscreen
- ? Container()
- : TabBar(
- isScrollable: true,
- tabAlignment: TabAlignment.center,
- controller: tabController,
- tabs: videoPageController.roadList
- .map((road) => Observer(
- builder: (context) => Row(
- mainAxisSize: MainAxisSize.min,
- children: [
- Text(
- road.name,
- overflow: TextOverflow.ellipsis,
- ),
- ],
- ),
- ))
- .toList(),
- ),
- // InkWell(
- // child: const Card(
- // child: ListTile(
- // title: Text('刮削测试'),
- // ),
- // ),
- // onTap: () async {
- // if (Platform.isWindows) {
- // final WebviewDesktopItemController
- // webviewDesktopItemController =
- // Modular.get<WebviewDesktopItemController>();
- // await webviewDesktopItemController.parseIframeUrl();
- // } else {
- // final WebviewItemController webviewItemController =
- // Modular.get<WebviewItemController>();
- // await webviewItemController.parseIframeUrl();
- // }
- // },
- // )
- ],
- ),
- );
- }
- ),
+ ),
+ // InkWell(
+ // child: const Card(
+ // child: ListTile(
+ // title: Text('刮削测试'),
+ // ),
+ // ),
+ // onTap: () async {
+ // if (Platform.isWindows) {
+ // final WebviewDesktopItemController
+ // webviewDesktopItemController =
+ // Modular.get<WebviewDesktopItemController>();
+ // await webviewDesktopItemController.parseIframeUrl();
+ // } else {
+ // final WebviewItemController webviewItemController =
+ // Modular.get<WebviewItemController>();
+ // await webviewItemController.parseIframeUrl();
+ // }
+ // },
+ // )
+ ],
+ ),
+ );
+ }),
);
}
}
diff --git a/pubspec.lock b/pubspec.lock
index 62c3973c..7a2dc617 100644
--- a/pubspec.lock
+++ b/pubspec.lock
@@ -1502,4 +1502,4 @@ packages:
version: "3.1.2"
sdks:
dart: ">=3.3.4 <4.0.0"
- flutter: ">=3.19.0"
+ flutter: ">=3.19.6"
diff --git a/pubspec.yaml b/pubspec.yaml
index a5bb596e..d6d1dae5 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -20,6 +20,7 @@ version: 1.0.0+1
environment:
sdk: '>=3.3.4 <4.0.0'
+ flutter: 3.19.6
# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions