mirror of
https://github.com/rustdesk/rustdesk
synced 2026-04-21 13:27:19 +00:00
fix(mobile): deeplink, disable by default (#14824)
Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
parent
9f817714fe
commit
1e9c4d04f1
3 changed files with 29 additions and 1 deletions
|
|
@ -2365,6 +2365,19 @@ List<String>? urlLinkToCmdArgs(Uri uri) {
|
||||||
id = uri.path.substring("/new/".length);
|
id = uri.path.substring("/new/".length);
|
||||||
} else if (uri.authority == "config") {
|
} else if (uri.authority == "config") {
|
||||||
if (isAndroid || isIOS) {
|
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);
|
final config = uri.path.substring("/".length);
|
||||||
// add a timer to make showToast work
|
// add a timer to make showToast work
|
||||||
Timer(Duration(seconds: 1), () {
|
Timer(Duration(seconds: 1), () {
|
||||||
|
|
@ -2374,6 +2387,18 @@ List<String>? urlLinkToCmdArgs(Uri uri) {
|
||||||
return null;
|
return null;
|
||||||
} else if (uri.authority == "password") {
|
} else if (uri.authority == "password") {
|
||||||
if (isAndroid || isIOS) {
|
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);
|
final password = uri.path.substring("/".length);
|
||||||
if (password.isNotEmpty) {
|
if (password.isNotEmpty) {
|
||||||
Timer(Duration(seconds: 1), () async {
|
Timer(Duration(seconds: 1), () async {
|
||||||
|
|
|
||||||
|
|
@ -187,6 +187,9 @@ const String kOptionDisableChangeId = "disable-change-id";
|
||||||
const String kOptionDisableUnlockPin = "disable-unlock-pin";
|
const String kOptionDisableUnlockPin = "disable-unlock-pin";
|
||||||
const kHideUsernameOnCard = "hide-username-on-card";
|
const kHideUsernameOnCard = "hide-username-on-card";
|
||||||
const String kOptionHideHelpCards = "hide-help-cards";
|
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 kOptionToggleViewOnly = "view-only";
|
||||||
const String kOptionToggleShowMyCursor = "show-my-cursor";
|
const String kOptionToggleShowMyCursor = "show-my-cursor";
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
Subproject commit 618922b2a77f7be44fc7b86e41f6cfba87d62193
|
Subproject commit 87b11a795964b00deded250657a63626f2c1efa0
|
||||||
Loading…
Reference in a new issue