From dc8a1d147a317c11568c2d4461ce02f48ece8352 Mon Sep 17 00:00:00 2001 From: Shane Harris Date: Fri, 28 Jan 2022 10:33:57 +0100 Subject: [PATCH] added cloud backup and other stuff --- desktop-app/src/app/adb-client.service.ts | 17 +++++- desktop-app/src/app/files/files.component.css | 4 +- .../src/app/files/files.component.html | 14 +++-- desktop-app/src/app/files/files.component.ts | 15 ++++- .../src/app/packages/packages.component.html | 31 ++++++++++- .../src/app/packages/packages.component.ts | 19 +++++++ .../src/app/tools/tools.component.html | 55 +++++++++---------- desktop-app/src/app/tools/tools.component.ts | 9 +++ 8 files changed, 122 insertions(+), 42 deletions(-) diff --git a/desktop-app/src/app/adb-client.service.ts b/desktop-app/src/app/adb-client.service.ts index 67eeeb0..fa26c28 100644 --- a/desktop-app/src/app/adb-client.service.ts +++ b/desktop-app/src/app/adb-client.service.ts @@ -50,6 +50,11 @@ export class AdbClientService { deviceName: string; connectionCss: any; obbRegex = /[a-z]{4,5}.[0-9]{1,}.([A-z0-9.]{1,}).obb/; + freespace = { + available: '', + total: '', + percent: '', + }; constructor( public appService: AppService, private spinnerService: LoadingSpinnerService, @@ -265,7 +270,7 @@ export class AdbClientService { this.deviceStatusMessage = this.deviceName + ' ' + + ' position="bottom" tooltip="Wifi">' + ' wifi' + ' ' + (this.deviceIp || 'Not found...') + @@ -276,7 +281,6 @@ export class AdbClientService { ' ' + this.batteryLevel + '% '; - // this.beatonService.checkIsBeatOnRunning(this); } catch (e) { const isBadConnection = e && e.message === "Failure: 'closed'" && e.name === 'FailError'; if (isBadConnection) { @@ -1054,7 +1058,14 @@ This can sometimes be caused by changes to your hosts file. Don't make changes u return perms; }); } - + async getFreeSpace() { + return this.adbCommand('shell', { serial: this.deviceSerial, command: 'df -h' }).then(data => { + data = data.split(' ').filter(d => d); + this.freespace.available = data[data.length - 3]; + this.freespace.total = data[data.length - 5]; + this.freespace.percent = data[data.length - 2]; + }); + } async getBatteryLevel() { return this.adbCommand('shell', { serial: this.deviceSerial, command: 'dumpsys battery' }).then(data => { let batteryObject = {}; diff --git a/desktop-app/src/app/files/files.component.css b/desktop-app/src/app/files/files.component.css index 67dc92a..2b6e3a9 100644 --- a/desktop-app/src/app/files/files.component.css +++ b/desktop-app/src/app/files/files.component.css @@ -12,7 +12,9 @@ line-height: 3rem; vertical-align: middle; } - +.filename-padding-top{ + padding-top: 10px; +} .selected{ background: #e93c96; border-radius: 10px; diff --git a/desktop-app/src/app/files/files.component.html b/desktop-app/src/app/files/files.component.html index 13825aa..fa5b3fe 100644 --- a/desktop-app/src/app/files/files.component.html +++ b/desktop-app/src/app/files/files.component.html @@ -1,6 +1,6 @@
-
-
+
+ Cloud Backup
+
Backup/Restore All
+ + +

Cloud Backup

+
+ +


+ + Trigger apps on your headset to run a cloud backup now in-case you want to do a factory reset.

+ WARNING: Not all apps support cloud backup - this is not guaranteed to work for all apps.

+

+
+ + Cloud backup complete.

Check cloud backup status here: https://secure.oculus.com/my/cloud-backup/

+

+
+ + {{cloudBackupStatus}}

+ +
+
+
+ + + +
+ +

Set the save location for backup data.

diff --git a/desktop-app/src/app/packages/packages.component.ts b/desktop-app/src/app/packages/packages.component.ts index fa60e31..1be7adf 100644 --- a/desktop-app/src/app/packages/packages.component.ts +++ b/desktop-app/src/app/packages/packages.component.ts @@ -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) diff --git a/desktop-app/src/app/tools/tools.component.html b/desktop-app/src/app/tools/tools.component.html index bb8c7d6..25e6786 100644 --- a/desktop-app/src/app/tools/tools.component.html +++ b/desktop-app/src/app/tools/tools.component.html @@ -26,6 +26,16 @@
+
+ Proximity Sensor
+ This disables the proximity sensor effectively keeping your quest awake when not on your head ( requires restart to disable ). +
+
Disable
+
+
Experimental Mode
@@ -60,17 +70,6 @@ [ngClass]="{'button-dark-theme':appService.currentTheme === 'dark','button-light-theme':appService.currentTheme === 'light','waves-dark':true,'waves-light':false}" (click)="setRR(RR._120)">120Hz -
- Pavlov Settings
-
-
Grant Pavlov Permissions
     -
Change Pavlov Name
     -
Chromatic Aberration
@@ -285,22 +284,22 @@ - - -

Change Pavlov Name

-
- - Enter a name to set in Pavlov -
-
- - -
+ + + + + + + + + + + -
- - - - -
+ + + + + + diff --git a/desktop-app/src/app/tools/tools.component.ts b/desktop-app/src/app/tools/tools.component.ts index 17a2c7b..86b3f42 100644 --- a/desktop-app/src/app/tools/tools.component.ts +++ b/desktop-app/src/app/tools/tools.component.ts @@ -123,6 +123,15 @@ export class ToolsComponent implements OnInit { this.statusService.showStatus(e, true); }); } + disableProximity() { + this.runAdbCommand('adb shell am broadcast -a com.oculus.vrpowermanager.prox_close') + .then(() => { + this.statusService.showStatus('Disable proximity message sent OK!!'); + }) + .catch(e => { + this.statusService.showStatus(e, true); + }); + } runAdbCommand(command: string) { return this.adbService.runAdbCommand(command); }