diff --git a/flutter_hbb/build_ios.sh b/flutter_hbb/build_ios.sh new file mode 100755 index 000000000..6d0d627ac --- /dev/null +++ b/flutter_hbb/build_ios.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +flutter build ipa --release --obfuscate --split-debug-info=./split-debug-info diff --git a/flutter_hbb/ios/Runner.xcodeproj/project.pbxproj b/flutter_hbb/ios/Runner.xcodeproj/project.pbxproj index 253550635..5bcdd6260 100644 --- a/flutter_hbb/ios/Runner.xcodeproj/project.pbxproj +++ b/flutter_hbb/ios/Runner.xcodeproj/project.pbxproj @@ -42,6 +42,7 @@ 7E078EE826BAB4710036E738 /* liblibrustdesk.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = liblibrustdesk.a; path = "../../target/aarch64-apple-ios/release/liblibrustdesk.a"; sourceTree = ""; }; 7E078EEA26BABB100036E738 /* ffi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi.h; sourceTree = ""; }; 7E078EEB26BADB3D0036E738 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; + 7E0A73A826CAB3C100FF94B3 /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = ""; }; 94AF76B3E95A41AD3421FB7B /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; @@ -110,6 +111,7 @@ 97C146F01CF9000F007C117D /* Runner */ = { isa = PBXGroup; children = ( + 7E0A73A826CAB3C100FF94B3 /* Runner.entitlements */, 97C146FA1CF9000F007C117D /* Main.storyboard */, 97C146FD1CF9000F007C117D /* Assets.xcassets */, 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, @@ -364,6 +366,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; DEVELOPMENT_TEAM = HZF9JMC8YN; ENABLE_BITCODE = NO; @@ -495,6 +498,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; DEVELOPMENT_TEAM = HZF9JMC8YN; ENABLE_BITCODE = NO; @@ -520,6 +524,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; DEVELOPMENT_TEAM = HZF9JMC8YN; ENABLE_BITCODE = NO; diff --git a/flutter_hbb/ios/Runner/Runner.entitlements b/flutter_hbb/ios/Runner/Runner.entitlements new file mode 100644 index 000000000..ba21fbdaf --- /dev/null +++ b/flutter_hbb/ios/Runner/Runner.entitlements @@ -0,0 +1,8 @@ + + + + + com.apple.developer.networking.wifi-info + + + diff --git a/flutter_hbb/lib/remote_page.dart b/flutter_hbb/lib/remote_page.dart index 08c07e0d1..99349a041 100644 --- a/flutter_hbb/lib/remote_page.dart +++ b/flutter_hbb/lib/remote_page.dart @@ -8,6 +8,7 @@ import 'package:tuple/tuple.dart'; import 'package:wakelock/wakelock.dart'; import 'common.dart'; import 'model.dart'; +import 'dart:io'; final initText = '\1' * 1024; @@ -37,7 +38,7 @@ class _RemotePageState extends State { var _more = true; var _fn = false; final FocusNode _focusNode = FocusNode(); - var _showEdit = true; + var _showEdit = false; var _reconnects = 1; @override @@ -172,6 +173,8 @@ class _RemotePageState extends State { @override Widget build(BuildContext context) { final pi = Provider.of(context).pi; + final hideKeyboard = Platform.isIOS && _showEdit; + final showActionButton = !_showBar || hideKeyboard; EasyLoading.instance.loadingStyle = EasyLoadingStyle.light; return WillPopScope( onWillPop: () async { @@ -179,14 +182,21 @@ class _RemotePageState extends State { return false; }, child: Scaffold( - floatingActionButton: _showBar + floatingActionButton: !showActionButton ? null : FloatingActionButton( - mini: true, - child: Icon(Icons.expand_less), + mini: !hideKeyboard, + child: Icon( + hideKeyboard ? Icons.expand_more : Icons.expand_less), backgroundColor: MyTheme.accent50, onPressed: () { - setState(() => _showBar = !_showBar); + setState(() { + if (hideKeyboard) { + _showEdit = !_showEdit; + } else { + _showBar = !_showBar; + } + }); }), bottomNavigationBar: _showBar && pi.displays != null ? BottomAppBar( @@ -337,18 +347,19 @@ class _RemotePageState extends State { } Widget getHelpTools() { - final keyboard = _bottom >= 100; + final keyboard = _showEdit; if (!_mouseTools && !keyboard) { return SizedBox(); } + final size = MediaQuery.of(context).size; var wrap = (String text, void Function() onPressed, [bool active, IconData icon]) { return TextButton( style: TextButton.styleFrom( minimumSize: Size(0, 0), padding: EdgeInsets.symmetric( - vertical: icon != null ? 3 : 6, - horizontal: 6), //adds padding inside the button + vertical: 10, + horizontal: 9.75), //adds padding inside the button tapTargetSize: MaterialTapTargetSize .shrinkWrap, //limits the touch area to the button area shape: RoundedRectangleBorder( @@ -394,22 +405,22 @@ class _RemotePageState extends State { final pi = FFI.ffiModel.pi; final isMac = pi.platform == "Mac OS"; final modifiers = [ - wrap('Ctrl', () { + wrap('Ctrl ', () { setState(() => FFI.ctrl = !FFI.ctrl); }, FFI.ctrl), - wrap('Alt', () { + wrap(' Alt ', () { setState(() => FFI.alt = !FFI.alt); }, FFI.alt), wrap('Shift', () { setState(() => FFI.shift = !FFI.shift); }, FFI.shift), - wrap(isMac ? 'Cmd' : 'Win', () { + wrap(isMac ? ' Cmd ' : ' Win ', () { setState(() => FFI.command = !FFI.command); }, FFI.command), ]; final keys = [ wrap( - 'Fn', + ' Fn ', () => setState( () { _fn = !_fn; @@ -420,7 +431,7 @@ class _RemotePageState extends State { ), _fn), wrap( - '...', + ' ... ', () => setState( () { _more = !_more; @@ -460,7 +471,7 @@ class _RemotePageState extends State { wrap('PgUp', () { FFI.inputKey('VK_PRIOR'); }), - wrap('PgDown', () { + wrap('PgDn', () { FFI.inputKey('VK_NEXT'); }), SizedBox(width: 9999), @@ -486,13 +497,14 @@ class _RemotePageState extends State { sendPrompt(isMac, 'VK_S'); }), ]; + final space = size.width > 320 ? 4.0 : 2.0; return Container( color: Color(0xAA000000), padding: EdgeInsets.only( - top: keyboard ? 24 : 4, left: 8, right: 8, bottom: 8), + top: keyboard ? 24 : 4, left: 0, right: 0, bottom: 8), child: Wrap( - spacing: 4, - runSpacing: 4, + spacing: space, + runSpacing: space, children: [SizedBox(width: 9999)] + (keyboard ? modifiers + keys + (_fn ? fn : []) + (_more ? more : []) diff --git a/flutter_hbb/pubspec.yaml b/flutter_hbb/pubspec.yaml index 4ae6a3f11..da3cb00b0 100644 --- a/flutter_hbb/pubspec.yaml +++ b/flutter_hbb/pubspec.yaml @@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.1.7+9 +version: 1.1.7+10 environment: sdk: ">=2.7.0 <3.0.0"