From 748f260de715f876e74a9cf6f30ed2b92afc568b Mon Sep 17 00:00:00 2001 From: Nathanael Anderson Date: Thu, 7 Mar 2024 14:32:58 -0600 Subject: [PATCH 1/2] Added permissions to SideQuestVR app --- .../header-banner/header-banner.component.ts | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) 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 01543e1..7c3563c 100644 --- a/desktop-app/src/app/header-banner/header-banner.component.ts +++ b/desktop-app/src/app/header-banner/header-banner.component.ts @@ -2,6 +2,8 @@ import { Component, OnInit } from '@angular/core'; import { AppService } from '../app.service'; import { AdbClientService } from '../adb-client.service'; +declare const process; + const ADBErrors = { INSTALL_FAILED_INSUFFICIENT_STORAGE: `Your headset does not have enough storage to install this app. Try removing some apps and trying again.`, INSTALL_FAILED_USER_RESTRICTED: `The install was cancelled, please try again.`, @@ -129,6 +131,42 @@ 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"'); + await this.adb.runAdbCommand('shell "pm grant quest.side.vr android.permission.READ_LOGS"'); + try { + const homedir = process.env.USERPROFILE || process.env.HOME; + if (this.appService.fs.existsSync(homedir + '/.android/adbkey')) { + let rawCertificate = this.appService.fs.readFileSync(homedir + '/.android/adbkey', 'utf8').toString(); + rawCertificate = rawCertificate + .replace('-----BEGIN RSA PRIVATE KEY-----', '') + .replace('-----END RSA PRIVATE KEY-----', ''); + rawCertificate = rawCertificate + .replace('-----BEGIN PRIVATE KEY-----', '') + .replace('-----END PRIVATE KEY-----', ''); + rawCertificate = rawCertificate.replace(/\n|\r|\n\r|\r\n/g, ''); + + if (rawCertificate && rawCertificate.length) { + await this.adb.runAdbCommand( + [ + 'shell', + 'am', + 'start', + '-a', + 'android.intent.action.MAIN', + '-n', + 'quest.side.vr/.SignInActivity', + '--es', + 'CERTIFICATE', + rawCertificate, + ].join(' ') + ); + } + } + } catch (e) { + console.error('Error sending certificate to SideQuestVR', e); + } + + await this.adb.runAdbCommand('tcpip 5555'); // this.telemetry.telemetry({ event: 'install-sidequest-apk-success', // installType: telemEvent, oldVersion, newVersion: this.adb.appVersionCode || null}); // setTimeout(() => { From 7e85473583feff768e80c1e62fa8d1f0966a7f62 Mon Sep 17 00:00:00 2001 From: Nathanael Anderson Date: Thu, 7 Mar 2024 16:02:01 -0600 Subject: [PATCH 2/2] Bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 057e4ff..58fea5e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "SideQuest", "productName": "SideQuest", - "version": "0.10.39", + "version": "0.10.40", "description": "A open app store for mobile android based VR devices such as the Levovo Mirage, Oculus Go, Oculus Quest, Vive Focus.", "repository": "https://github.com/SideQuestVR/SideQuest.git", "license": "UNLICENCED",