An open-source cross-platform alternative to AirDrop
fix(android): use classic mode on Android 8.1 and older
Tien Do Nam3d76e9eee7b1
diff --git a/app/lib/util/native/file_picker.dart b/app/lib/util/native/file_picker.dartindex a1cb75d1..efa11014 100644--- a/app/lib/util/native/file_picker.dart+++ b/app/lib/util/native/file_picker.dart@@ -8,6 +8,7 @@ import 'package:flutter/material.dart';import 'package:flutter/services.dart';import 'package:localsend_app/gen/strings.g.dart';import 'package:localsend_app/pages/apk_picker_page.dart';+import 'package:localsend_app/provider/device_info_provider.dart';import 'package:localsend_app/provider/selection/selected_sending_files_provider.dart';import 'package:localsend_app/theme.dart';import 'package:localsend_app/util/determine_image_type.dart';@@ -192,7 +193,8 @@ Future<void> _pickFolder(BuildContext context, Ref ref) async {);await sleepAsync(200); // Wait for the dialog to be showntry {- if (defaultTargetPlatform == TargetPlatform.android) {+ if (defaultTargetPlatform == TargetPlatform.android && (ref.read(deviceRawInfoProvider).androidSdkInt ?? 0) >= 28) {+ // Android 8 and above have more predictable content URIs that we can parse.final result = await pickDirectoryAndroid();if (result != null) {await ref.redux(selectedSendingFilesProvider).dispatchAsync(AddAndroidDirectoryAction(result));