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]
|
/// also see [encode]
|
||||||
/// throw when decoding failure
|
/// throw when decoding failure
|
||||||
ServerConfig.decode(String msg) {
|
ServerConfig.decode(String msg) {
|
||||||
final input = msg.split('').reversed.join('');
|
var json = {};
|
||||||
final bytes = base64Decode(base64.normalize(input));
|
try {
|
||||||
final json = jsonDecode(utf8.decode(bytes));
|
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'] ?? '';
|
idServer = json['host'] ?? '';
|
||||||
relayServer = json['relay'] ?? '';
|
relayServer = json['relay'] ?? '';
|
||||||
apiServer = json['api'] ?? '';
|
apiServer = json['api'] ?? '';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user