diff --git a/app/android/app/build.gradle b/app/android/app/build.gradle index 5d978c880157..f2160c8b2499 100644 --- a/app/android/app/build.gradle +++ b/app/android/app/build.gradle @@ -42,7 +42,7 @@ android { defaultConfig { applicationId "dev.linwood.butterfly" - minSdkVersion 21 + minSdkVersion 23 targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() versionName flutterVersionName diff --git a/app/lib/api/save.dart b/app/lib/api/save.dart index 3ec35f43dbd0..1698c07b4f8c 100644 --- a/app/lib/api/save.dart +++ b/app/lib/api/save.dart @@ -1,8 +1,5 @@ -import 'dart:io'; - import 'package:butterfly/helpers/asset.dart'; import 'package:butterfly_api/butterfly_api.dart'; -import 'package:device_info_plus/device_info_plus.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; @@ -77,10 +74,7 @@ Future exportData(BuildContext context, List bytes, Future writeClipboardData(ClipboardManager clipboardManager, AssetFileType type, Uint8List data) async { final clipboard = SystemClipboard.instance; - if (clipboard != null && - !kIsWeb && - (!Platform.isAndroid || - (await DeviceInfoPlugin().androidInfo).version.sdkInt >= 23)) { + if (clipboard != null) { final item = DataWriterItem(); final format = type.getClipboardFormats().first; item.add(format(data)); diff --git a/app/lib/cubits/settings.dart b/app/lib/cubits/settings.dart index 3b55b32772b6..0c095ed83096 100644 --- a/app/lib/cubits/settings.dart +++ b/app/lib/cubits/settings.dart @@ -23,11 +23,7 @@ part 'settings.g.dart'; const kDefaultIceServers = ['stunserver.stunprotocol.org:3478']; -const secureStorage = FlutterSecureStorage( - aOptions: AndroidOptions( - encryptedSharedPreferences: true, - ), -); +const secureStorage = FlutterSecureStorage(); const kRecentHistorySize = 5; enum ToolbarSize { diff --git a/app/lib/services/import.dart b/app/lib/services/import.dart index 35c15efccc9c..020b18283c42 100644 --- a/app/lib/services/import.dart +++ b/app/lib/services/import.dart @@ -1,13 +1,12 @@ import 'dart:async'; import 'dart:convert'; -import 'dart:io'; import 'dart:math'; import 'dart:ui' as ui; + import 'package:archive/archive.dart'; import 'package:butterfly/api/file_system.dart'; import 'package:butterfly/api/image.dart'; import 'package:butterfly/helpers/asset.dart'; -import 'package:device_info_plus/device_info_plus.dart'; import 'package:flutter/foundation.dart'; import 'package:image/image.dart' as img; import 'package:butterfly/bloc/document_bloc.dart'; @@ -174,10 +173,7 @@ class ImportService { Uint8List? data; AssetFileType? type; final clipboard = SystemClipboard.instance; - if (clipboard != null && - !kIsWeb && - (!Platform.isAndroid || - (await DeviceInfoPlugin().androidInfo).version.sdkInt >= 23)) { + if (clipboard != null) { final reader = await clipboard.read(); final result = AssetFileType.values .map((e) { diff --git a/app/lib/services/network.dart b/app/lib/services/network.dart index 88758f0d4020..ff6929959aff 100644 --- a/app/lib/services/network.dart +++ b/app/lib/services/network.dart @@ -5,7 +5,6 @@ import 'dart:math'; import 'package:butterfly/bloc/document_bloc.dart'; import 'package:butterfly_api/butterfly_api.dart'; -import 'package:device_info_plus/device_info_plus.dart'; import 'package:flutter/foundation.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:networker/networker.dart'; @@ -22,13 +21,9 @@ enum NetworkingSide { } enum NetworkingType { - webSocket, - webRtc; + webSocket; Future isCompatible() async => switch (this) { - NetworkingType.webRtc => kIsWeb || - !Platform.isAndroid || - (await DeviceInfoPlugin().androidInfo).version.sdkInt >= 28, NetworkingType.webSocket => !kIsWeb, }; } diff --git a/app/lib/visualizer/tool.dart b/app/lib/visualizer/tool.dart index 0e227f1384ab..099a4788afd7 100644 --- a/app/lib/visualizer/tool.dart +++ b/app/lib/visualizer/tool.dart @@ -7,7 +7,6 @@ import 'package:butterfly/visualizer/icon.dart'; import 'package:butterfly/visualizer/property.dart'; import 'package:butterfly_api/butterfly_api.dart'; import 'package:butterfly_api/butterfly_models.dart'; -import 'package:device_info_plus/device_info_plus.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; @@ -180,14 +179,9 @@ extension ImportTypeVisualizer on ImportType { }; Future isAvailable() async { - final androidVersion = !kIsWeb && Platform.isAndroid - ? (await DeviceInfoPlugin().androidInfo).version.sdkInt - : 0; return switch (this) { - ImportType.camera => kIsWeb || - Platform.isWindows || - (Platform.isAndroid && androidVersion >= 21) || - Platform.isIOS, + ImportType.camera => + kIsWeb || Platform.isWindows || Platform.isAndroid || Platform.isIOS, _ => true, }; } diff --git a/app/pubspec.lock b/app/pubspec.lock index cb78650bb150..6fd2831fd61b 100644 --- a/app/pubspec.lock +++ b/app/pubspec.lock @@ -327,7 +327,7 @@ packages: source: hosted version: "0.7.10" device_info_plus: - dependency: "direct main" + dependency: transitive description: name: device_info_plus sha256: "4fa68e53e26ab17b70ca39f072c285562cfc1589df5bb1e9295db90f6645f431" diff --git a/app/pubspec.yaml b/app/pubspec.yaml index 1585457a067f..927a945b691c 100644 --- a/app/pubspec.yaml +++ b/app/pubspec.yaml @@ -105,7 +105,6 @@ dependencies: dynamic_color: ^1.7.0 popover: ^0.3.0 markdown: ^7.2.2 - device_info_plus: ^11.1.0 image: ^4.1.7 one_dollar_unistroke_recognizer: ^1.2.0 super_clipboard: ^0.9.0-dev.4 diff --git a/metadata/en-US/changelogs/129.txt b/metadata/en-US/changelogs/129.txt index 2c4ae44eca74..c929be400d6a 100644 --- a/metadata/en-US/changelogs/129.txt +++ b/metadata/en-US/changelogs/129.txt @@ -1,5 +1,6 @@ * Fix export button in data settings not working * Fix export button for file view not visible * Update secure storage dependency +* Use minSdkVersion 23 instead of 21 (The minimum version of android is 6.0 (Marshmallow)) -Read more here: https://linwood.dev/butterfly/2.3.0-beta.0 \ No newline at end of file +Read more here: https://linwood.dev/butterfly/2.3.0-beta.1 \ No newline at end of file