More bug fixes

This commit is contained in:
Nathanael Anderson
2024-04-25 08:22:44 -06:00
parent f35f630b55
commit d5c6d0867a
16 changed files with 121 additions and 4340 deletions
+1
View File
@@ -44,3 +44,4 @@ tmp
.DS_Store
**/.DS_Store
/build/experimental.apk
+29 -12
View File
@@ -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));
}
}
-2
View File
@@ -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();
}
@@ -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 {
@@ -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 (
@@ -50,6 +50,12 @@
<span>Default - Quest 2</span>
</label>
</p>
<p>
<label>
<input name="textureSize" type="radio" value="1680-1760" [(ngModel)]="textureSize" (click)="setSSO(SSO._Quest3)"/>
<span>Default - Quest 3</span>
</label>
</p>
<p>
<label>
<input name="textureSize" type="radio" value="512-563" [(ngModel)]="textureSize" (click)="setSSO(SSO._512)"/>
@@ -40,6 +40,7 @@ enum SSO {
_Go,
_Quest1,
_Quest2,
_Quest3,
}
enum CR {
_480,
@@ -430,6 +431,11 @@ export class HeadsetSettingsComponent implements OnInit {
value = 1440;
hvalue = 1584;
break;
case SSO._Quest3:
value = 1680;
hvalue = 1760;
break;
}
this.runAdbCommand('setprop debug.oculus.textureWidth ' + value)
+1 -2
View File
@@ -1,6 +1,5 @@
import { Injectable } from '@angular/core';
import { AppService } from './app.service';
import { Notification, StatusBarComponent, StatusType } from './status-bar/status-bar.component';
import { StatusBarComponent } from './status-bar/status-bar.component';
@Injectable({
providedIn: 'root',
@@ -8,35 +8,28 @@
color: white;
width: 100%;
}
.status-bar-inner{
padding: 10px;
padding-left: 15px;
padding-right: 80px;
.status-bar-inner {
padding: 10px 80px 10px 15px;
}
.status-bar-warning {
background-color: #ff9800;
}
.status{
.status {
background-color: #E51253;
position: fixed;
z-index: 9999;
bottom: -45px;
bottom: 0;
display: none;
left: 0;
color: white;
width: 100%;
transition: bottom 350ms;
}
.status-open{
bottom: 0px;
.status-open {
display: block;
}
$info-icon-background-color: rgba(114, 137, 218, 1);
$success-icon-background-color: rgba(97, 185, 72, 1);
$warning-icon-background-color: rgba(251, 176, 59, 1);
@@ -77,7 +70,7 @@ $error-shadow-color: rgba(229, 18, 83, 0.4);
.sq-toast--top-right {
bottom: -4px;
right: 0px;
right: 0;
}
.sq-toast__message {
@@ -1,4 +1,4 @@
import { Component, EventEmitter, OnInit, Output } from '@angular/core';
import { Component, OnInit } from '@angular/core';
import { StatusBarService } from '../status-bar.service';
import { animate, sequence, style, transition, trigger } from '@angular/animations';
+6 -6
View File
@@ -227,13 +227,13 @@ class ADB {
async install(serial, apkpath, isLocal, cb, scb, ecb) {
await this._clientSetup.promise;
console.log('installapk', apkpath, isLocal);
// console.log('installapk', apkpath, isLocal);
let stopUpdate;
installErrorCallback = e => {
stopUpdate = true;
ecb(e);
console.log(e, stopUpdate);
console.error(e, stopUpdate);
};
if (!this.client) return ecb('Not connected.');
@@ -307,7 +307,7 @@ class ADB {
); */
}
} catch (e) {
console.error(e)
console.error("Error", e);
const isInvalidURI = e && typeof e.message === 'string' && e.message.startsWith('Invalid URI "');
if (isInvalidURI) {
return ecb("Can't download file. Invalid URL:");
@@ -322,6 +322,7 @@ class ADB {
.then(cb)
.catch(e => { console.error("error installing", e); ecb(e) });
}
uninstall(serial, packageName, cb, ecb) {
this._clientSetup.promise.then(() => {
if (!this.client) return ecb('Not connected.');
@@ -822,9 +823,9 @@ function setupApp() {
});
app.on('ready', createWindow);
// Quit when all windows are closed.
app.on('window-all-closed', function() {
/* app.on('window-all-closed', function() {
if (process.platform !== 'darwin') app.quit();
});
}); */
// Kill the adb client when the app is definitely quitting, regardless of how it quit.
app.on('will-quit', () => {
@@ -960,7 +961,6 @@ function setupApp() {
try {
switch (arg.command) {
case 'installFromToken':
console.log("E-IFT", arg.settings.token)
adb.installFromToken(arg.settings.token, success, reject);
break;
case 'setupAdb':
-1
View File
@@ -2,7 +2,6 @@ require('./config');
export function getEnvCfg() {
const cfg = process.env['SQ_ENV_CFG'] || global.SQ_ENV_CFG;
console.log('SQ_ENV_CFG:', cfg);
switch (cfg) {
case 'test':
return {
+36 -42
View File
@@ -1,6 +1,6 @@
const os = require('os');
const path = require('path');
const __fs = require('fs');
const os = require('node:os');
const path = require('node:path');
const fs = require('node:fs');
const extract = require('extract-zip');
const download = require('./download');
const url = 'https://dl.google.com/android/repository/platform-tools-latest-';
@@ -17,52 +17,46 @@ switch (os.platform()) {
break;
}
console.log('Platform: ' + os.platform());
var outputPath = path.join(__dirname, '..', 'build', 'platform-tools');
if (!__fs.existsSync(outputPath)) {
__fs.mkdir(outputPath, { recursive: true }, function(err) {
if (err) console.log(err);
});
let outputPath = path.join(__dirname, '..', 'build', 'platform-tools');
if (!fs.existsSync(outputPath)) {
fs.mkdirSync(outputPath, { recursive: true });
console.log('Downloading platform tools...');
download(downloadUrl, path.join(__dirname, 'platform-tools.zip'), function(stats) {
// console.log(stats);
})
}, {})
.then(function() {
console.log('Downloaded platform tools.');
console.log('Extracting platform tools...');
setTimeout(() => {
extract(
path.join(__dirname, 'platform-tools.zip'),
{
dir: __dirname,
onEntry: function(entry) {
var stats = entry.fileName;
// console.log(stats);
},
}).catch(
(err) => {
if (err) {
return console.log(err);
}
console.log('Extracted platform tools.');
__fs.readdir(path.join(__dirname, 'platform-tools'), function(err, files) {
files.forEach(function(file) {
var curPath = path.join(__dirname, 'platform-tools', file);
if (
!__fs.lstatSync(curPath).isDirectory() &&
file !== 'make_f2fs.exe' &&
file !== 'make_f2fs_casefold.exe'
) {
__fs.rename(curPath, path.join(outputPath, file), function(err) {
if (err) console.log(err);
});
}
});
});
});
extract(
path.join(__dirname, 'platform-tools.zip'),
<any>{
dir: __dirname,
onEntry: function(entry) {
// console.log(entry.fileName);
},
}).then(() => {
const skipFiles = [
// Linux & Mac
"etc1tool", "fastboot", "hprof-conv", "make_f2fs", "make_f2fs_casefold", "mke_f2fs", "mke2fs", "mke2fs.conf", "sqlite3",
// Windows
"etc1tool.exe", "fastboot.exe", "hprof-conv.exe", "make_f2fs.exe", "make_f2fs_casefold.exe", "mke_f2fs.exe", "mke2fs.exe", "mke2fs.conf", "sqlite3"];
}, 5000);
console.log('Extracted platform tools.');
fs.readdir(path.join(__dirname, 'platform-tools'), function(err, files) {
files.forEach(function(file) {
const curPath = path.join(__dirname, 'platform-tools', file);
if (!fs.lstatSync(curPath).isDirectory() && skipFiles.indexOf(file) === -1) {
fs.rename(curPath, path.join(outputPath, file), function(err) {
if (err) console.log(err);
});
}
});
});
}).catch((err) => {
return console.error(err);
});
})
.catch(function(e) {
console.log(e);
.catch((e) => {
console.error(e);
});
}
+17 -7
View File
@@ -1,7 +1,7 @@
{
"name": "SideQuest",
"productName": "SideQuest",
"version": "0.10.40",
"version": "0.10.41",
"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",
@@ -19,10 +19,11 @@
"dist": "yarn electron-build && yarn platform-tools && yarn app-build && node build-electron/make-config && env-cmd --silent electron-builder --publish onTagOrDraft",
"build:win": "yarn electron-build && yarn platform-tools && yarn app-build && node build-electron/make-config && cross-env NODE_ENV=production electron-builder --win",
"build:linux": "yarn electron-build && yarn platform-tools && yarn app-build && node build-electron/make-config && cross-env NODE_ENV=production electron-builder --linux",
"dist-test": "yarn electron-build && yarn platform-tools && yarn app-build-test && node build-electron/make-config test && cross-env NODE_ENV=production SQ_ENV_CFG=test electron-builder",
"dist-sidetest": "yarn electron-build && yarn platform-tools && yarn app-build-test && node build-electron/make-config test && cross-env NODE_ENV=production SQ_ENV_CFG=test electron-builder",
"dist-fried": "yarn electron-build && yarn platform-tools && yarn app-build-fried && node build-electron/make-config fried && cross-env NODE_ENV=production SQ_ENV_CFG=fried electron-builder",
"dist-localhost": "yarn electron-build && yarn platform-tools && yarn app-build-localhost && node build-electron/make-config localhost && cross-env SQ_ENV_CFG=localhost electron-builder --linux",
"build:mac": "yarn electron-build && yarn platform-tools && yarn app-build && node build-electron/make-config && cross-env NODE_ENV=production electron-builder --mac",
"dist:test": "yarn electron-build && yarn platform-tools && yarn app-build-test && node build-electron/make-config test && cross-env NODE_ENV=production SQ_ENV_CFG=test electron-builder",
"dist:sidetest": "yarn electron-build && yarn platform-tools && yarn app-build-test && node build-electron/make-config test && cross-env NODE_ENV=production SQ_ENV_CFG=test electron-builder",
"dist:fried": "yarn electron-build && yarn platform-tools && yarn app-build-fried && node build-electron/make-config fried && cross-env NODE_ENV=production SQ_ENV_CFG=fried electron-builder",
"dist:localhost": "yarn electron-build && yarn platform-tools && yarn app-build-localhost && node build-electron/make-config localhost && cross-env SQ_ENV_CFG=localhost electron-builder --linux",
"angular": "cd desktop-app && ng serve --port 4205",
"angular:test": "cd desktop-app && ng serve -c test --port 4205",
"angular:test2": "cd desktop-app && ng serve -c test2 --port 4205",
@@ -141,12 +142,21 @@
"@electron/notarize": "^2.2.1",
"concurrently": "^8.2.2",
"cross-env": "^7.0.3",
"electron": "28.2.4",
"electron-builder": "24.12.0",
"electron": "29.3.1",
"electron-builder": "24.13.3",
"husky": "^9.0.11",
"prettier": "3.2.5",
"pretty-quick": "^4.0.0",
"ts-loader": "^9.5.1",
"typescript": "^5.3.3"
},
"resolutions": {
"nan": "2.19.0",
"node-abi": "3.57.0",
"node-gyp": "10.1.0",
"prebuild-install": "7.1.2",
"prebuild": "13.0.0"
},
"unused": {
}
}
-138
View File
@@ -1,138 +0,0 @@
{
"name": "SideQuest",
"productName": "SideQuest",
"version": "0.10.37",
"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",
"author": "Shane Harris",
"main": "build-electron/app.js",
"scripts": {
"concurrently": "concurrently",
"start": "concurrently \"yarn electron-build && yarn platform-tools && wait-on http-get://localhost:4205/ && cross-env NODE_ENV=dev electron .\" \"cd desktop-app && ng serve --port 4205\"",
"start:test": "concurrently \"yarn electron-build && yarn platform-tools && wait-on http-get://localhost:4205/ && cross-env NODE_ENV=dev SQ_ENV_CFG=test electron .\" \"cd desktop-app && ng serve -c test --port 4205\"",
"start:test2": "concurrently \"yarn electron-build && yarn platform-tools && wait-on http-get://localhost:4205/ && cross-env NODE_ENV=dev SQ_ENV_CFG=test2 electron .\" \"cd desktop-app && ng serve -c test2 --port 4205\"",
"start:local": "concurrently \"yarn electron-build && yarn platform-tools && wait-on http-get://localhost:4205/ && cross-env NODE_ENV=dev SQ_ENV_CFG=local electron .\" \"cd desktop-app && ng serve -c local --port 4205\"",
"postinstall": "electron-builder install-app-deps && cd desktop-app && yarn install",
"dist": "yarn electron-build && yarn platform-tools && yarn app-build && env-cmd --silent electron-builder --publish onTagOrDraft",
"dist-test": "yarn electron-build && yarn platform-tools && yarn app-build-test && cross-env SQ_ENV_CFG=test electron-builder",
"angular": "cd desktop-app && ng serve --port 4205",
"angular:test": "cd desktop-app && ng serve -c test --port 4205",
"angular:test2": "cd desktop-app && ng serve -c test2 --port 4205",
"angular:local": "cd desktop-app && ng serve -c local --port 4205",
"electron-dev": "yarn platform-tools && cross-env NODE_ENV=dev electron .",
"electron-dev:test": "yarn platform-tools && cross-env NODE_ENV=dev SQ_ENV_CFG=test electron .",
"electron-dev:test2": "yarn platform-tools && cross-env NODE_ENV=dev SQ_ENV_CFG=test2 electron .",
"electron-dev:local": "yarn platform-tools && cross-env NODE_ENV=dev SQ_ENV_CFG=local electron .",
"electron": "yarn electron-build && yarn electron-dev",
"app-build": "cd desktop-app && ng build --prod --aot && cd ..",
"app-build-test": "cd desktop-app && ng build -c test --aot && cd ..",
"platform-tools": "node build-electron/platform-tools.js",
"electron-build": "tsc",
"reset": "rm -rf node_modules && rm -rf desktop-app/node_modules && yarn install && cd desktop-app && yarn install"
},
"build": {
"productName": "SideQuest",
"appId": "com.sidequestvr.app",
"mac": {
"category": "public.app-category.utilities",
"target": {
"target": "dmg",
"arch": [
"arm64",
"x64"
]
}
},
"win": {
"artifactName": "${productName}-${version}-${arch}-${os}.${ext}",
"sign": "./build/windows-codesign.js",
"publish": ["github"],
"target": [
"nsis"
]
},
"linux": {
"target": [
"tar.xz"
]
},
"nsis": {
"artifactName": "${productName} Setup ${version}-x64-${os}.${ext}",
"oneClick": false,
"allowToChangeInstallationDirectory": true,
"include": "build/uninstaller.nsh"
},
"files": [
"build/**/*",
"node_modules/**/*",
"package.json",
"build-electron/app.js",
"build-electron/download.js",
"build-electron/setproperties.js",
"build-electron/state-storage.js",
"build-electron/window.js",
"build-electron/env-config.js",
"build-electron/external-urls.js"
],
"asarUnpack": [
"build/**/*"
],
"afterSign": "build/notarize.js"
},
"husky": {
"hooks": {
"pre-commit": "pretty-quick --staged --pattern \"**/*.*(js|jsx|ts|tsx)\"",
"post-commit": "git update-index -g",
"pre-push": "yarn dist"
}
},
"prettier": {
"tabWidth": 4,
"printWidth": 132,
"semi": true,
"jsxBracketSameLine": true,
"parser": "typescript",
"singleQuote": true,
"useTabs": false,
"trailingComma": "es5"
},
"dependencies": {
"@electron/remote": "^2.0.1",
"@types/electron": "^1.6.10",
"adbkit": "^2.11.1",
"adm-zip": "^0.4.14",
"bytenode": "^1.1.6",
"concurrently": "^4.1.0",
"cross-env": "^5.2.0",
"crypto": "^1.0.1",
"electron-updater": "^4.3.7",
"env-cmd": "^10.1.0",
"express": "^4.17.1",
"extract-zip": "^1.6.7",
"md5": "^2.2.1",
"mkdirp": "^1.0.3",
"node-fetch": "2.6.7",
"node-stream-zip": "^1.9.1",
"opn": "^6.0.0",
"ping": "^0.2.2",
"request": "^2.88.0",
"request-progress": "^3.0.0",
"semver": "^6.0.0",
"targz": "^1.0.1",
"usb-detection2": "git+https://github.com/SideQuestVR/node-usb-detection.git",
"wait-on": "^3.2.0",
"yauzl": "^2.10.0"
},
"devDependencies": {
"@angular/cli": "^8.0.3",
"electron": "13.5.1",
"electron-builder": "22.10.5",
"electron-notarize": "^0.1.1",
"husky": "^2.3.0",
"prettier": "1.17.1",
"pretty-quick": "^1.11.0",
"ts-loader": "^6.2.1",
"typescript": "^3.8.3"
}
}
-4112
View File
File diff suppressed because it is too large Load Diff