added cloud backup and other stuff
This commit is contained in:
@@ -29,6 +29,9 @@ export class PackagesComponent implements OnInit {
|
||||
search: string;
|
||||
savePath: string;
|
||||
perms: any;
|
||||
cloudBackupLoading: boolean;
|
||||
cloudBackupDone: boolean;
|
||||
cloudBackupStatus: string;
|
||||
constructor(
|
||||
public adbService: AdbClientService,
|
||||
public appService: AppService,
|
||||
@@ -90,6 +93,22 @@ export class PackagesComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
async triggerCloudBackup() {
|
||||
this.cloudBackupLoading = true;
|
||||
this.cloudBackupStatus = 'Starting backup...';
|
||||
await this.adbService.runAdbCommand('adb shell bmgr backup @pm@');
|
||||
await this.adbService.runAdbCommand('adb shell bmgr run');
|
||||
await this.adbService.runAdbCommand('adb shell cmd package list packages');
|
||||
let packages: any = this.adbService.adbResponse;
|
||||
packages = packages.split('\n').map(line => line.replace(/^package:/, ''));
|
||||
for (let i = 0; i < packages.length; i++) {
|
||||
this.cloudBackupStatus = `Backing up ${Math.round(((i + 1) / packages.length) * 100)}%`;
|
||||
await this.adbService.runAdbCommand('adb shell bmgr fullbackup ' + packages[i]).then(o => console.log(o));
|
||||
}
|
||||
this.cloudBackupLoading = false;
|
||||
this.cloudBackupDone = true;
|
||||
}
|
||||
|
||||
backupAll() {
|
||||
this.myApps
|
||||
.filter(d => d.backupAll)
|
||||
|
||||
Reference in New Issue
Block a user