diff --git a/.gitignore b/.gitignore index 6161be51..c6c3a491 100644 --- a/.gitignore +++ b/.gitignore @@ -44,3 +44,4 @@ tmp .DS_Store **/.DS_Store +/build/experimental.apk diff --git a/desktop-app/src/app/adb-client.service.ts b/desktop-app/src/app/adb-client.service.ts index 1d16e02a..6708a24b 100644 --- a/desktop-app/src/app/adb-client.service.ts +++ b/desktop-app/src/app/adb-client.service.ts @@ -653,11 +653,10 @@ This can sometimes be caused by changes to your hosts file. Don't make changes u deleteAfter?: boolean, name?: string ) { - console.log("Starting install of APK", filePath, isLocal, shouldUninstall, number, total, deleteAfter, name) + // console.log("Starting install of APK", filePath, isLocal, shouldUninstall, number, total, deleteAfter, name) return this.processService.addItem( 'apk_install', task => { - console.log("Task APK", filePath, isLocal, shouldUninstall, number, total, deleteAfter, name) if (this.deviceStatus !== ConnectionStatus.CONNECTED) { return Promise.reject(name + 'Apk install failed - No device connected!'); @@ -666,7 +665,6 @@ This can sometimes be caused by changes to your hosts file. Don't make changes u task.show_total = showTotal; task.app_name = name || ''; task.status = name + showTotal + 'Installing Apk... '; - console.log('Installing filePath', filePath, 'Name', name); return this.adbCommand('install', { serial: this.deviceSerial, path: filePath, isLocal: !!isLocal }, status => { if (status.percent && status.size && status.time) { task.status = @@ -682,17 +680,19 @@ This can sometimes be caused by changes to your hosts file. Don't make changes u } }) .then(r => { - task.status = name + 'APK installed ok!!'; if (deleteAfter) { this.appService.fs.unlink(filePath, err => {}); } if (filePath.indexOf('com.weloveoculus.BMBF') > -1) { return this.beatonService.setBeatOnPermission(this); } - if (filePath.indexOf('quest.side.vr') > -1) { + if (filePath.indexOf('quest.side.vr') > -1 || filePath.toLowerCase().indexOf("/sidequestvr-") > -1) { return this.addVRPermissions(); } - }) + //console.log("APK Installed", filePath) + }).then(() => { + task.status = name + 'APK installed ok!!'; + }) .catch(async e => { if (deleteAfter) { this.appService.fs.unlink(filePath, err => {}); @@ -1283,8 +1283,16 @@ This can sometimes be caused by changes to your hosts file. Don't make changes u } private async addVRPermissions() { - await this.adbCommand('shell "pm grant quest.side.vr android.permission.WRITE_SECURE_SETTINGS"', { serial: this.deviceSerial }); - await this.adbCommand('shell "pm grant quest.side.vr android.permission.READ_LOGS"', { serial: this.deviceSerial }); + console.log("Adding VR Permissions"); + + await this.adbCommand('shell', { + serial: this.deviceSerial, + command: "pm grant quest.side.vr android.permission.WRITE_SECURE_SETTINGS" + }); + await this.adbCommand('shell', { + command: "pm grant quest.side.vr android.permission.READ_LOGS", + serial: this.deviceSerial }); + try { const homedir = process.env.USERPROFILE || process.env.HOME; if (this.appService.fs.existsSync(homedir + '/.android/adbkey')) { @@ -1299,8 +1307,9 @@ This can sometimes be caused by changes to your hosts file. Don't make changes u if (rawCertificate && rawCertificate.length) { await this.adbCommand( - [ + 'shell', + { command: [ 'am', 'start', '-a', @@ -1310,7 +1319,7 @@ This can sometimes be caused by changes to your hosts file. Don't make changes u '--es', 'CERTIFICATE', rawCertificate, - ].join(' '), { serial: this.deviceSerial } + ].join(' '), serial: this.deviceSerial } ); } } @@ -1319,7 +1328,15 @@ This can sometimes be caused by changes to your hosts file. Don't make changes u } this.skipStatusUpdates = true; - await this.adbCommand('tcpip 5555', { serial: this.deviceSerial }); - setTimeout(() => { this.skipStatusUpdates = false; }, 3000); + await this.adbCommand('tcpip', {command: '5555', serial: this.deviceSerial }); + + await this.sleep(5000); + this.skipStatusUpdates = false; + return true; + } + + private sleep(ms) { + return new Promise(resolve => setTimeout(resolve, ms)); } + } diff --git a/desktop-app/src/app/app.component.ts b/desktop-app/src/app/app.component.ts index a6576f47..f9cd29fa 100644 --- a/desktop-app/src/app/app.component.ts +++ b/desktop-app/src/app/app.component.ts @@ -4,7 +4,6 @@ import { LoadingSpinnerService } from './loading-spinner.service'; import { StatusBarService } from './status-bar.service'; import { WebviewService } from './webview.service'; import { DragAndDropService } from './drag-and-drop.service'; -import { ElectronService } from './electron.service'; import { AdbClientService } from './adb-client.service'; import { environment } from '../environments/environment'; @@ -29,7 +28,6 @@ export class AppComponent implements OnInit, AfterViewInit { public appService: AppService, public webService: WebviewService, public dragService: DragAndDropService, - private electronService: ElectronService ) { this.devMode = isDevMode(); } diff --git a/desktop-app/src/app/header-banner/header-banner.component.ts b/desktop-app/src/app/header-banner/header-banner.component.ts index e523af9b..0091396b 100644 --- a/desktop-app/src/app/header-banner/header-banner.component.ts +++ b/desktop-app/src/app/header-banner/header-banner.component.ts @@ -28,6 +28,7 @@ export class HeaderBannerComponent implements OnInit { // the latest available version of the in-headset app private latestAppVersion: string | null = null; private appId: string | null = null; + private addedPerms = false; constructor(public appService: AppService, public adb: AdbClientService) {} ngOnInit() { @@ -44,6 +45,12 @@ export class HeaderBannerComponent implements OnInit { this.isOutOfDate = true; return; } + if (!this.addedPerms) { + this.adb.runAdbCommand('shell "pm grant quest.side.vr android.permission.WRITE_SECURE_SETTINGS"', true).then(() => { + this.adb.runAdbCommand('shell "pm grant quest.side.vr android.permission.READ_LOGS"', true); + }); + this.addedPerms = true; + } } this.isOutOfDate = false; } @@ -116,6 +123,7 @@ export class HeaderBannerComponent implements OnInit { // this.toast.show('SideQuest installed to headset!'); // this.showConfetti = true; this.adb.appVersionCode = await this.adb.getAppVersion(true); + await this.adb.runAdbCommand('shell "pm grant quest.side.vr android.permission.WRITE_SECURE_SETTINGS"', true); await this.adb.runAdbCommand('shell "pm grant quest.side.vr android.permission.READ_LOGS"', true); try { diff --git a/desktop-app/src/app/header/header.component.ts b/desktop-app/src/app/header/header.component.ts index ec877625..533190c8 100644 --- a/desktop-app/src/app/header/header.component.ts +++ b/desktop-app/src/app/header/header.component.ts @@ -108,14 +108,14 @@ export class HeaderComponent implements OnInit { private router: Router ) { this.osPlatform = this.appService.os.platform(); - console.log('Platform: ' + this.osPlatform); + //console.log('Platform: ' + this.osPlatform); this.resetFavourites('browserFavourites'); this.resetFavourites('fileFavourites'); this.resetFavourites('commandFavourites'); this.appService.headerComponent = this; this.headerClass = environment.header?.color || ""; this.headerText = environment.header?.text || ""; - console.log('Header: ' + this.headerClass + ' ' + this.headerText); + //console.log('Header: ' + this.headerClass + ' ' + this.headerText); } doBack() { if ( diff --git a/desktop-app/src/app/headset-settings/headset-settings.component.html b/desktop-app/src/app/headset-settings/headset-settings.component.html index 4908830a..9ee3a87d 100644 --- a/desktop-app/src/app/headset-settings/headset-settings.component.html +++ b/desktop-app/src/app/headset-settings/headset-settings.component.html @@ -50,6 +50,12 @@
Default Texture Size
Default - Quest 2

+

+ +