mirror of
https://github.com/Universal-Debloater-Alliance/universal-android-debloater-next-generation.git
synced 2026-08-28 02:10:39 +02:00
Merge pull request #172 from lavafroth/backup-struct-aot
refactor: create a backup struct ahead of time
This commit is contained in:
commit
622ea98ce7
1 changed files with 10 additions and 15 deletions
|
|
@ -85,7 +85,14 @@ impl Settings {
|
|||
Command::none()
|
||||
}
|
||||
Message::LoadDeviceSettings => {
|
||||
let backups = list_available_backups(&BACKUP_DIR.join(phone.adb_id.clone()));
|
||||
let backups = list_available_backups(&BACKUP_DIR.join(&phone.adb_id));
|
||||
let backup = BackupSettings {
|
||||
backups: backups.clone(),
|
||||
selected: backups.first().cloned(),
|
||||
users: phone.user_list.clone(),
|
||||
selected_user: phone.user_list.first().copied(),
|
||||
backup_state: String::new(),
|
||||
};
|
||||
match Config::load_configuration_file()
|
||||
.devices
|
||||
.iter()
|
||||
|
|
@ -93,26 +100,14 @@ impl Settings {
|
|||
{
|
||||
Some(device) => {
|
||||
self.device = device.clone();
|
||||
self.device.backup = BackupSettings {
|
||||
backups: backups.clone(),
|
||||
selected: backups.first().cloned(),
|
||||
users: phone.user_list.clone(),
|
||||
selected_user: phone.user_list.first().copied(),
|
||||
backup_state: String::new(),
|
||||
};
|
||||
self.device.backup = backup;
|
||||
}
|
||||
None => {
|
||||
self.device = DeviceSettings {
|
||||
device_id: phone.adb_id.clone(),
|
||||
multi_user_mode: phone.android_sdk > 21,
|
||||
disable_mode: false,
|
||||
backup: BackupSettings {
|
||||
backups: backups.clone(),
|
||||
selected: backups.first().cloned(),
|
||||
users: phone.user_list.clone(),
|
||||
selected_user: phone.user_list.first().copied(),
|
||||
backup_state: String::new(),
|
||||
},
|
||||
backup,
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue