Store `user_mac_key` in keychain and not in plaintext preference file

This commit is contained in:
ePirat 2012-11-23 23:45:42 +01:00
parent 555e7cca3c
commit c4fdb2b5cd
7 changed files with 66 additions and 9 deletions

View file

@ -10,6 +10,23 @@ define(function() {
controller.setStringForKey(string, key);
}
}
HostApp.setSecret = function(string) {
if (OS_TYPE == "mac") {
controller.setSecret_(string);
} else {
controller.setStringForKey(string, "user_mac_key");
}
}
HostApp.secret = function() {
if (OS_TYPE == "mac") {
return controller.secret();
} else {
return controller.stringForKey("user_mac_key");
}
}
HostApp.stringForKey = function(key) {