From bb003b8ce3fbb1350abad5cc29e7b3bdd57683a0 Mon Sep 17 00:00:00 2001 From: Mike Audi Date: Sun, 2 May 2021 21:29:01 -0400 Subject: [PATCH 1/3] fixed permissions issues need to forcibly disable everything for iOS & manually check camera when scanning. --- ios/Podfile | 17 +++++++++++++++++ ios/Podfile.lock | 2 +- .../keys_restore_screen.dart | 1 - .../keys_restore_screen_scan.dart | 10 +++++++--- 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/ios/Podfile b/ios/Podfile index 9411102b..5c533a56 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -37,5 +37,22 @@ end post_install do |installer| installer.pods_project.targets.each do |target| flutter_additional_ios_build_settings(target) + target.build_configurations.each do |config| + config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [ + '$(inherited)', + 'PERMISSION_EVENTS=0', + 'PERMISSION_REMINDERS=0', + 'PERMISSION_CONTACTS=0', + #'PERMISSION_CAMERA=0', + 'PERMISSION_MICROPHONE=0', + 'PERMISSION_SPEECH_RECOGNIZER=0', + 'PERMISSION_PHOTOS=0', + 'PERMISSION_LOCATION=0', + 'PERMISSION_NOTIFICATIONS=0', + 'PERMISSION_MEDIA_LIBRARY=0', + 'PERMISSION_SENSORS=0', + 'PERMISSION_BLUETOOTH=0' + ] + end end end diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 35598a82..35b24a6e 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -149,6 +149,6 @@ SPEC CHECKSUMS: SwiftProtobuf: 4e16842b83c6fda06b10fac50d73b3f1fce8ab7b url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef -PODFILE CHECKSUM: fe0e1ee7f3d1f7d00b11b474b62dd62134535aea +PODFILE CHECKSUM: 369a5dd265c3a98e02ffc0493427fc70d9c648fc COCOAPODS: 1.10.1 diff --git a/lib/src/features/keys/keys_restore_screen/keys_restore_screen.dart b/lib/src/features/keys/keys_restore_screen/keys_restore_screen.dart index a84ccb2d..3dea4c89 100644 --- a/lib/src/features/keys/keys_restore_screen/keys_restore_screen.dart +++ b/lib/src/features/keys/keys_restore_screen/keys_restore_screen.dart @@ -115,7 +115,6 @@ class KeysRestoreScreen extends PlatformScaffold { margin: EdgeInsets.only(top: _marginTopSubmit), child: KeysRestoreScreenSubmit()) ])) - //UISecurityRestore((keys) => _onLoadComplete(context, keys))*/ ]), ); } diff --git a/lib/src/features/keys/keys_restore_screen/keys_restore_screen_scan.dart b/lib/src/features/keys/keys_restore_screen/keys_restore_screen_scan.dart index dca84a55..a7ebbdec 100644 --- a/lib/src/features/keys/keys_restore_screen/keys_restore_screen_scan.dart +++ b/lib/src/features/keys/keys_restore_screen/keys_restore_screen_scan.dart @@ -6,10 +6,12 @@ import 'package:app/src/config/config_color.dart'; import 'package:app/src/features/keys/keys_restore_screen/keys_restore_screen_bloc.dart'; import 'package:app/src/utils/helper/helper_image.dart'; +import 'package:app/src/utils/helper/helper_permission.dart'; import 'package:app/src/utils/platform/platform_relative_size.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:permission_handler/permission_handler.dart'; class KeysRestoreScreenScan extends StatelessWidget { static const String _text = "SCAN"; @@ -44,9 +46,11 @@ class KeysRestoreScreenScan extends StatelessWidget { alignment: Alignment.centerRight, child: HelperImage("icon-qr-code")) ])), - onPressed: () { - BlocProvider.of(context) - .add(KeysRestoreScreenScanned()); + onPressed: () async { + if (await HelperPermission.request(Permission.camera)) { + BlocProvider.of(context) + .add(KeysRestoreScreenScanned()); + } }); } } From c7dd45ac3c95556aade395d493c8f5351702cdf2 Mon Sep 17 00:00:00 2001 From: Mike Audi Date: Sun, 2 May 2021 21:55:23 -0400 Subject: [PATCH 2/3] add flush image write for good luck it seems to get hung if i write the file via a dev app then try and overwrite with prod app. --- .../keys_new_screen_download/keys_new_screen_download_bloc.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/features/keys/keys_new_screen_download/keys_new_screen_download_bloc.dart b/lib/src/features/keys/keys_new_screen_download/keys_new_screen_download_bloc.dart index 7e1d810a..ed21aaaa 100644 --- a/lib/src/features/keys/keys_new_screen_download/keys_new_screen_download_bloc.dart +++ b/lib/src/features/keys/keys_new_screen_download/keys_new_screen_download_bloc.dart @@ -60,7 +60,7 @@ class KeysNewScreenDownloadBloc String path = documents.path + '/' + fileName; File imgFile = new File(path); - await imgFile.writeAsBytes(pngBytes); + await imgFile.writeAsBytes(pngBytes, flush: true); yield KeysNewScreenDownloadSuccess(rendered.shouldShare, path); } } From e99317fc246367dae17a0d5f9b21bec40dbb710a Mon Sep 17 00:00:00 2001 From: Mike Audi Date: Sun, 2 May 2021 22:15:17 -0400 Subject: [PATCH 3/3] We dont currently use this --- ios/Runner/Info.plist | 2 -- 1 file changed, 2 deletions(-) diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index d517d5ac..1ddce163 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -55,8 +55,6 @@ NSCameraUsageDescription Restore a user account from backup QR code - NSPhotoLibraryUsageDescription - Restore a user account from backup QR code UIFileSharingEnabled UILaunchStoryboardName