refactor: clean install backup — dbi.config and prod.keys only
- Backup/restore DBI settings file instead of whole DBI folder - Remove Tinfoil folder backup/restore - Adjust deletion_lists_clean.h comments; UI strings in install_clean.c Made-with: Cursor
This commit is contained in:
@@ -24,17 +24,9 @@ int backup_user_data(void) {
|
||||
return res;
|
||||
}
|
||||
|
||||
// Backup DBI if it exists
|
||||
if (path_exists("sd:/switch/DBI")) {
|
||||
res = folder_copy("sd:/switch/DBI", TEMP_BACKUP_PATH);
|
||||
if (res != FR_OK) {
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
// Backup Tinfoil if it exists
|
||||
if (path_exists("sd:/switch/tinfoil")) {
|
||||
res = folder_copy("sd:/switch/tinfoil", TEMP_BACKUP_PATH);
|
||||
// Backup DBI settings file only (not .nro installers)
|
||||
if (path_exists(DBI_CONFIG_PATH)) {
|
||||
res = file_copy(DBI_CONFIG_PATH, TEMP_BACKUP_DBI_CONFIG);
|
||||
if (res != FR_OK) {
|
||||
return res;
|
||||
}
|
||||
@@ -61,25 +53,15 @@ int restore_user_data(void) {
|
||||
return res;
|
||||
}
|
||||
|
||||
// Restore DBI if backup exists
|
||||
if (path_exists("sd:/temp_backup/DBI")) {
|
||||
res = folder_copy("sd:/temp_backup/DBI", "sd:/switch");
|
||||
if (res == FR_OK) {
|
||||
// Delete old DBI .nro files
|
||||
f_unlink("sd:/switch/DBI/DBI_810_EN.nro");
|
||||
f_unlink("sd:/switch/DBI/DBI_810_DE.nro");
|
||||
f_unlink("sd:/switch/DBI/DBI_845_EN.nro");
|
||||
f_unlink("sd:/switch/DBI/DBI_845_DE.nro");
|
||||
f_unlink("sd:/switch/DBI/DBI.nro");
|
||||
// Restore DBI settings if backed up
|
||||
if (path_exists(TEMP_BACKUP_DBI_CONFIG)) {
|
||||
res = f_mkdir("sd:/switch/DBI");
|
||||
if (res != FR_OK && res != FR_EXIST) {
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
// Restore Tinfoil if backup exists
|
||||
if (path_exists("sd:/temp_backup/tinfoil")) {
|
||||
res = folder_copy("sd:/temp_backup/tinfoil", "sd:/switch");
|
||||
if (res == FR_OK) {
|
||||
// Delete old tinfoil.nro
|
||||
f_unlink("sd:/switch/tinfoil/tinfoil.nro");
|
||||
res = file_copy(TEMP_BACKUP_DBI_CONFIG, DBI_CONFIG_PATH);
|
||||
if (res != FR_OK) {
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user