summaryrefslogtreecommitdiffstats
path: root/browser/components/backup/resources/CredentialsAndSecurityBackupResource.sys.mjs
diff options
context:
space:
mode:
Diffstat (limited to 'browser/components/backup/resources/CredentialsAndSecurityBackupResource.sys.mjs')
-rw-r--r--browser/components/backup/resources/CredentialsAndSecurityBackupResource.sys.mjs36
1 files changed, 36 insertions, 0 deletions
diff --git a/browser/components/backup/resources/CredentialsAndSecurityBackupResource.sys.mjs b/browser/components/backup/resources/CredentialsAndSecurityBackupResource.sys.mjs
index 89069de826..03a0267f33 100644
--- a/browser/components/backup/resources/CredentialsAndSecurityBackupResource.sys.mjs
+++ b/browser/components/backup/resources/CredentialsAndSecurityBackupResource.sys.mjs
@@ -16,6 +16,42 @@ export class CredentialsAndSecurityBackupResource extends BackupResource {
return true;
}
+ async backup(stagingPath, profilePath = PathUtils.profileDir) {
+ const simpleCopyFiles = [
+ "pkcs11.txt",
+ "logins.json",
+ "logins-backup.json",
+ "autofill-profiles.json",
+ "signedInUser.json",
+ ];
+ await BackupResource.copyFiles(profilePath, stagingPath, simpleCopyFiles);
+
+ const sqliteDatabases = ["cert9.db", "key4.db", "credentialstate.sqlite"];
+ await BackupResource.copySqliteDatabases(
+ profilePath,
+ stagingPath,
+ sqliteDatabases
+ );
+
+ return null;
+ }
+
+ async recover(_manifestEntry, recoveryPath, destProfilePath) {
+ const files = [
+ "pkcs11.txt",
+ "logins.json",
+ "logins-backup.json",
+ "autofill-profiles.json",
+ "signedInUser.json",
+ "cert9.db",
+ "key4.db",
+ "credentialstate.sqlite",
+ ];
+ await BackupResource.copyFiles(recoveryPath, destProfilePath, files);
+
+ return null;
+ }
+
async measure(profilePath = PathUtils.profileDir) {
const securityFiles = ["cert9.db", "pkcs11.txt"];
let securitySize = 0;