diff --git a/flutter/lib/common.dart b/flutter/lib/common.dart index ad3bbc9f6..e579db36a 100644 --- a/flutter/lib/common.dart +++ b/flutter/lib/common.dart @@ -2365,6 +2365,19 @@ List? urlLinkToCmdArgs(Uri uri) { id = uri.path.substring("/new/".length); } else if (uri.authority == "config") { if (isAndroid || isIOS) { + final allowDeepLinkServerSettings = + bind.mainGetBuildinOption(key: kOptionAllowDeepLinkServerSettings) == + 'Y'; + if (!allowDeepLinkServerSettings) { + debugPrint( + "Ignore rustdesk://config because $kOptionAllowDeepLinkServerSettings is not enabled."); + // Keep the user-facing error generic; detailed rejection reason is in debug logs. + // Delay toast to avoid missing overlay during cold-start deeplink handling. + Timer(Duration(seconds: 1), () { + showToast(translate('Failed')); + }); + return null; + } final config = uri.path.substring("/".length); // add a timer to make showToast work Timer(Duration(seconds: 1), () { @@ -2374,6 +2387,18 @@ List? urlLinkToCmdArgs(Uri uri) { return null; } else if (uri.authority == "password") { if (isAndroid || isIOS) { + final allowDeepLinkPassword = + bind.mainGetBuildinOption(key: kOptionAllowDeepLinkPassword) == 'Y'; + if (!allowDeepLinkPassword) { + debugPrint( + "Ignore rustdesk://password because $kOptionAllowDeepLinkPassword is not enabled."); + // Keep the user-facing error generic; detailed rejection reason is in debug logs. + // Delay toast to avoid missing overlay during cold-start deeplink handling. + Timer(Duration(seconds: 1), () { + showToast(translate('Failed')); + }); + return null; + } final password = uri.path.substring("/".length); if (password.isNotEmpty) { Timer(Duration(seconds: 1), () async { diff --git a/flutter/lib/consts.dart b/flutter/lib/consts.dart index b1112dd29..51c08cf33 100644 --- a/flutter/lib/consts.dart +++ b/flutter/lib/consts.dart @@ -187,6 +187,9 @@ const String kOptionDisableChangeId = "disable-change-id"; const String kOptionDisableUnlockPin = "disable-unlock-pin"; const kHideUsernameOnCard = "hide-username-on-card"; const String kOptionHideHelpCards = "hide-help-cards"; +const String kOptionAllowDeepLinkPassword = "allow-deep-link-password"; +const String kOptionAllowDeepLinkServerSettings = + "allow-deep-link-server-settings"; const String kOptionToggleViewOnly = "view-only"; const String kOptionToggleShowMyCursor = "show-my-cursor"; diff --git a/libs/hbb_common b/libs/hbb_common index 618922b2a..87b11a795 160000 --- a/libs/hbb_common +++ b/libs/hbb_common @@ -1 +1 @@ -Subproject commit 618922b2a77f7be44fc7b86e41f6cfba87d62193 +Subproject commit 87b11a795964b00deded250657a63626f2c1efa0