This commit is contained in:
rustdesk
2021-08-06 22:29:11 +08:00
parent 0f029545a4
commit 46e239dabe
3 changed files with 29 additions and 52 deletions

View File

@@ -714,32 +714,6 @@ Future<Map<String, dynamic>> getPreference(String id) async {
void removePreference(String id) async {
SharedPreferences prefs = await SharedPreferences.getInstance();
prefs.remove('peer' + id);
prefs.remove('peer' + id + '-password');
}
Future<String> getPassword(String id) async {
SharedPreferences prefs = await SharedPreferences.getInstance();
var p = prefs.getString('peer' + id + '-password');
if (p == null) return "";
return p;
}
void savePassword(String id, String password) async {
SharedPreferences prefs = await SharedPreferences.getInstance();
prefs.setString('peer' + id + '-password', password);
prefs.setString('peer' + id + '-autologin', password);
}
Future<bool> getAutoLogin(String id) async {
SharedPreferences prefs = await SharedPreferences.getInstance();
var p = prefs.getString('peer' + id + '-autologin');
if (p == null) return false;
return p != "";
}
void saveAutoLogin(String id, bool a) async {
SharedPreferences prefs = await SharedPreferences.getInstance();
prefs.setString('peer' + id + '-autologin', a ? 'Y' : '');
}
void initializeCursorAndCanvas() async {