add password to --connect command in flutter, --connect id [passord]

This commit is contained in:
rustdesk
2023-03-20 00:16:06 +08:00
parent 7009d4fa7b
commit 4d827708c3
7 changed files with 35 additions and 15 deletions

View File

@ -1523,6 +1523,11 @@ bool checkArguments() {
}
String? id =
kBootArgs.length < connectIndex + 1 ? null : kBootArgs[connectIndex + 1];
String? password =
kBootArgs.length < connectIndex + 2 ? null : kBootArgs[connectIndex + 2];
if (password != null && password.startsWith("--")) {
password = null;
}
final switchUuidIndex = kBootArgs.indexOf("--switch_uuid");
String? switchUuid = kBootArgs.length < switchUuidIndex + 1
? null
@ -1536,7 +1541,8 @@ bool checkArguments() {
kBootArgs.removeAt(connectIndex);
// fallback to peer id
Future.delayed(Duration.zero, () {
rustDeskWinManager.newRemoteDesktop(id, switch_uuid: switchUuid);
rustDeskWinManager.newRemoteDesktop(id,
password: password, switch_uuid: switchUuid);
});
return true;
}