to suppport old qr code, https://www.reddit.com/r/rustdesk/comments/11utfpf/qr_code/
This commit is contained in:
parent
e278a80e89
commit
83814e5842
@ -1817,10 +1817,14 @@ class ServerConfig {
|
||||
/// also see [encode]
|
||||
/// throw when decoding failure
|
||||
ServerConfig.decode(String msg) {
|
||||
final input = msg.split('').reversed.join('');
|
||||
final bytes = base64Decode(base64.normalize(input));
|
||||
final json = jsonDecode(utf8.decode(bytes));
|
||||
|
||||
var json = {};
|
||||
try {
|
||||
json = jsonDecode(msg);
|
||||
} catch (err) {
|
||||
final input = msg.split('').reversed.join('');
|
||||
final bytes = base64Decode(base64.normalize(input));
|
||||
json = jsonDecode(utf8.decode(bytes));
|
||||
}
|
||||
idServer = json['host'] ?? '';
|
||||
relayServer = json['relay'] ?? '';
|
||||
apiServer = json['api'] ?? '';
|
||||
|
Loading…
Reference in New Issue
Block a user