Skip to content

Commit c8bf3a4

Browse files
Remove android notification permission
1 parent 8a520fd commit c8bf3a4

File tree

7 files changed

+0
-208
lines changed

7 files changed

+0
-208
lines changed

macos/Flutter/GeneratedPluginRegistrant.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import biometric_storage
1111
import device_info_plus
1212
import file_picker
1313
import flutter_inappwebview_macos
14-
import flutter_local_notifications
1514
import flutter_secure_storage_macos
1615
import flutter_web_auth_2
1716
import hotkey_manager_macos
@@ -44,7 +43,6 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
4443
DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin"))
4544
FilePickerPlugin.register(with: registry.registrar(forPlugin: "FilePickerPlugin"))
4645
InAppWebViewFlutterPlugin.register(with: registry.registrar(forPlugin: "InAppWebViewFlutterPlugin"))
47-
FlutterLocalNotificationsPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalNotificationsPlugin"))
4846
FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin"))
4947
FlutterWebAuth2Plugin.register(with: registry.registrar(forPlugin: "FlutterWebAuth2Plugin"))
5048
HotkeyManagerMacosPlugin.register(with: registry.registrar(forPlugin: "HotkeyManagerMacosPlugin"))

pubspec.lock

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -637,30 +637,6 @@ packages:
637637
url: "https://pub.flutter-io.cn"
638638
source: hosted
639639
version: "4.0.0"
640-
flutter_local_notifications:
641-
dependency: "direct main"
642-
description:
643-
name: flutter_local_notifications
644-
sha256: "49eeef364fddb71515bc78d5a8c51435a68bccd6e4d68e25a942c5e47761ae71"
645-
url: "https://pub.flutter-io.cn"
646-
source: hosted
647-
version: "17.2.3"
648-
flutter_local_notifications_linux:
649-
dependency: transitive
650-
description:
651-
name: flutter_local_notifications_linux
652-
sha256: c49bd06165cad9beeb79090b18cd1eb0296f4bf4b23b84426e37dd7c027fc3af
653-
url: "https://pub.flutter-io.cn"
654-
source: hosted
655-
version: "4.0.1"
656-
flutter_local_notifications_platform_interface:
657-
dependency: transitive
658-
description:
659-
name: flutter_local_notifications_platform_interface
660-
sha256: "85f8d07fe708c1bdcf45037f2c0109753b26ae077e9d9e899d55971711a4ea66"
661-
url: "https://pub.flutter-io.cn"
662-
source: hosted
663-
version: "7.2.0"
664640
flutter_localizations:
665641
dependency: "direct main"
666642
description: flutter
@@ -2057,14 +2033,6 @@ packages:
20572033
url: "https://pub.flutter-io.cn"
20582034
source: hosted
20592035
version: "0.7.3"
2060-
timezone:
2061-
dependency: transitive
2062-
description:
2063-
name: timezone
2064-
sha256: "2236ec079a174ce07434e89fcd3fcda430025eb7692244139a9cf54fdcf1fc7d"
2065-
url: "https://pub.flutter-io.cn"
2066-
source: hosted
2067-
version: "0.9.4"
20682036
timing:
20692037
dependency: transitive
20702038
description:

pubspec.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ dependencies:
9292
hotkey_manager: ^0.2.3 # 热键
9393
responsive_builder: ^0.7.1 # 响应式布局
9494
flutter_displaymode: ^0.6.0 # 设置刷新率
95-
flutter_local_notifications: ^17.2.1+2 # 本地通知
9695
flutter_resizable_container: ^2.0.0 # 可调整大小的容器
9796
screen_protector: ^1.4.2+1
9897
flutter_windowmanager:

third-party/chewie/lib/awesome_chewie.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ export 'src/Utils/System/hive_util.dart';
4040
export 'src/Utils/System/import_util.dart';
4141
export 'src/Utils/System/locale_util.dart';
4242
export 'src/Utils/System/lottie_util.dart';
43-
export 'src/Utils/System/notification_util.dart';
4443
export 'src/Utils/System/route_util.dart';
4544
export 'src/Utils/System/uri_util.dart';
4645
export 'src/Utils/utils.dart';

third-party/chewie/lib/src/Utils/System/file_util.dart

Lines changed: 0 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import 'package:image_gallery_saver/image_gallery_saver.dart';
2020
import 'package:package_info_plus/package_info_plus.dart';
2121
import 'package:path/path.dart';
2222
import 'package:path_provider/path_provider.dart';
23-
import 'package:permission_handler/permission_handler.dart';
2423
import 'package:share_plus/share_plus.dart';
2524
import 'package:win32/win32.dart';
2625

@@ -30,7 +29,6 @@ import 'package:awesome_chewie/src/l10n/l10n.dart';
3029
import 'package:awesome_chewie/src/Utils/ilogger.dart';
3130
import 'package:awesome_chewie/src/Utils/itoast.dart';
3231
import 'hive_util.dart';
33-
import 'notification_util.dart';
3432

3533
enum WindowsVersion { installed, portable }
3634

@@ -424,84 +422,6 @@ class FileUtil {
424422
return extractFileNameFromUrl(imageUrl).split('.').last;
425423
}
426424

427-
static Future<void> downloadAndUpdate(
428-
BuildContext context,
429-
String apkUrl,
430-
String htmlUrl, {
431-
String? version,
432-
bool isUpdate = true,
433-
Function(double)? onReceiveProgress,
434-
}) async {
435-
await Permission.storage.onDeniedCallback(() {
436-
IToast.showTop("请授予文件存储权限");
437-
}).onGrantedCallback(() async {
438-
if (apkUrl.notNullOrEmpty) {
439-
double progressValue = 0.0;
440-
var appDocDir = await getTemporaryDirectory();
441-
String savePath =
442-
"${appDocDir.path}/${FileUtil.extractFileNameFromUrl(apkUrl)}";
443-
try {
444-
await Dio().download(
445-
apkUrl,
446-
savePath,
447-
onReceiveProgress: (count, total) {
448-
final value = count / total;
449-
if (progressValue != value) {
450-
if (progressValue < 1.0) {
451-
progressValue = count / total;
452-
} else {
453-
progressValue = 0.0;
454-
}
455-
NotificationUtil.sendProgressNotification(
456-
0,
457-
(progressValue * 100).toInt(),
458-
title: isUpdate
459-
? '正在下载新版本安装包...'
460-
: '正在下载版本${version ?? ""}的安装包...',
461-
payload: version ?? "",
462-
);
463-
onReceiveProgress?.call(progressValue);
464-
}
465-
},
466-
).then((response) async {
467-
if (response.statusCode == 200) {
468-
NotificationUtil.closeNotification(0);
469-
NotificationUtil.sendInfoNotification(
470-
1,
471-
"下载完成",
472-
isUpdate
473-
? "新版本安装包已经下载完成,点击立即安装"
474-
: "版本${version ?? ""}的安装包已经下载完成,点击立即安装",
475-
payload: savePath,
476-
);
477-
} else {
478-
UriUtil.openExternal(htmlUrl);
479-
}
480-
});
481-
} catch (e, t) {
482-
ILogger.error("Failed to download", e, t);
483-
NotificationUtil.closeNotification(0);
484-
NotificationUtil.sendInfoNotification(
485-
2,
486-
"下载失败,请重试",
487-
"新版本安装包下载失败,请重试",
488-
);
489-
}
490-
} else {
491-
UriUtil.openExternal(htmlUrl);
492-
}
493-
}).onPermanentlyDeniedCallback(() {
494-
IToast.showTop("已拒绝文件存储权限,将跳转到浏览器下载");
495-
UriUtil.openExternal(apkUrl);
496-
}).onRestrictedCallback(() {
497-
IToast.showTop("请授予文件存储权限");
498-
}).onLimitedCallback(() {
499-
IToast.showTop("请授予文件存储权限");
500-
}).onProvisionalCallback(() {
501-
IToast.showTop("请授予文件存储权限");
502-
}).request();
503-
}
504-
505425
static Future<ShareResultStatus> shareImage(
506426
BuildContext context,
507427
String imageUrl, {

third-party/chewie/lib/src/Utils/System/notification_util.dart

Lines changed: 0 additions & 91 deletions
This file was deleted.

third-party/chewie/pubspec.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ dependencies:
7979
window_manager: ^0.4.3
8080
restart_app: ^1.3.2
8181
local_notifier: ^0.1.6
82-
flutter_local_notifications: ^17.2.1+2
8382
screen_protector: ^1.4.2+1
8483
shell_executor: ^0.1.6
8584

0 commit comments

Comments
 (0)