diff --git a/build-electron/app.jsc b/build-electron/app.jsc index 972bde0..3241528 100644 Binary files a/build-electron/app.jsc and b/build-electron/app.jsc differ diff --git a/build/uninstaller.nsh b/build/uninstaller.nsh new file mode 100644 index 0000000..d96227d --- /dev/null +++ b/build/uninstaller.nsh @@ -0,0 +1,14 @@ +!macro customUnInstall + MessageBox MB_YESNO "Delete app data and folder?" \ + /SD IDNO IDNO Skipped IDYES Accepted + + Accepted: + RMDir /r "$APPDATA\${APP_FILENAME}" + !ifdef APP_PRODUCT_FILENAME + RMDir /r "$APPDATA\${APP_PRODUCT_FILENAME}" + !endif + Goto done + Skipped: + Goto done + done: +!macroend \ No newline at end of file diff --git a/desktop-app/package.json b/desktop-app/package.json index ff8c5c5..d2ab95b 100644 --- a/desktop-app/package.json +++ b/desktop-app/package.json @@ -31,6 +31,7 @@ "ng2-dragula": "^2.1.1", "ngx-color-picker": "^8.0.1", "ngx-materialize": "^6.1.3", + "ngx-virtual-scroller": "3.0.3", "randomcolor": "^0.5.4", "rxjs": "^6.5.2", "rxjs-compat": "^6.5.2", diff --git a/desktop-app/src/app/app.module.ts b/desktop-app/src/app/app.module.ts index 774065c..bf45950 100644 --- a/desktop-app/src/app/app.module.ts +++ b/desktop-app/src/app/app.module.ts @@ -26,7 +26,7 @@ import { ColorPickerModule } from 'ngx-color-picker'; import { HttpClientModule } from '@angular/common/http'; import { CurrentTasksComponent } from './current-tasks/current-tasks.component'; import { CurrentTaskItemComponent } from './current-task-item/current-task-item.component'; - +import { VirtualScrollerModule } from 'ngx-virtual-scroller'; @NgModule({ declarations: [ AppComponent, @@ -59,6 +59,7 @@ import { CurrentTaskItemComponent } from './current-task-item/current-task-item. MzCheckboxModule, ColorPickerModule, BrowserAnimationsModule, + VirtualScrollerModule, ], providers: [], bootstrap: [AppComponent], diff --git a/desktop-app/src/app/drag-and-drop.service.ts b/desktop-app/src/app/drag-and-drop.service.ts index 5ae72dc..ffa3e0c 100644 --- a/desktop-app/src/app/drag-and-drop.service.ts +++ b/desktop-app/src/app/drag-and-drop.service.ts @@ -52,11 +52,18 @@ export class DragAndDropService { let file = e.dataTransfer.files[i] as any; let filepath = file.path; if (['.apk', '.obb'].includes(this.appService.path.extname(filepath))) { - if (this.appService.path.extname(filepath) === '.apk') { - await this.adbService.installAPK(filepath, true); - } else { - await this.adbService.installLocalObb(filepath); + this.adbService.savePath = this.appService.path.dirname(filepath); + let install = this.adbService.installMultiFile(filepath); + if (install) { + await install.catch(_e => { + this.statusService.showStatus(_e.toString(), true); + }); } + // if (this.appService.path.extname(filepath) === '.apk') { + // await this.adbService.installAPK(filepath, true); + // } else { + // await this.adbService.installLocalObb(filepath); + // } } else { this.statusService.showStatus('Unrecognised File: ' + filepath, true); } diff --git a/desktop-app/src/app/header/header.component.css b/desktop-app/src/app/header/header.component.css index 04fa26e..0bb5c9b 100644 --- a/desktop-app/src/app/header/header.component.css +++ b/desktop-app/src/app/header/header.component.css @@ -67,10 +67,18 @@ height: 90px; position:absolute; top: 55px; - left: 20px; + left: 3.5em; transition: 0.35s; } +virtual-scroller{ + width: 100%; + height: 400px; +} +.child-item{ + min-height: 20px; + width: 100%; +} #nav-mobile{ margin-left: 60px; } diff --git a/desktop-app/src/app/header/header.component.html b/desktop-app/src/app/header/header.component.html index b72c6d4..c8e9b5d 100644 --- a/desktop-app/src/app/header/header.component.html +++ b/desktop-app/src/app/header/header.component.html @@ -353,27 +353,35 @@ - - + + + +

ADB Logcat

Select your options and click start to begin receiving logcat messages. -

+
{{saveLogcatPath ? 'Saving to: ' + appService.path.join(saveLogcatPath,'logcat.log') : ''}} + + +
+
{{isStarted ? 'Waiting for messages...' : 'Click start to begin streaming logcat messages.'}}
-
-
-
{{logcat.date}}: {{priorities[logcat.priority]}}
-
{{logcat.tid}}/{{logcat.pid}} {{logcat.tag}}
-
+ +
+
+
{{logcat.date}}: {{priorities[logcat.priority]}}
+
{{logcat.tid}}/{{logcat.pid}} {{logcat.tag}}
+
+
-
+
@@ -412,7 +420,8 @@ WARNING: We have stopped this install because it may may harm your device.

- If you continue with the install you risk the following:

+ If you think this has happened in error, please contact us on Discord with a link to the apk file.

+ We have protected you from:

- Causing physical damage to your headset.
- Having your personal information stolen ( including tracking your movments in VR )
- Being banned from the Oculus platform.
diff --git a/desktop-app/src/app/header/header.component.ts b/desktop-app/src/app/header/header.component.ts index e8a242b..6645e67 100644 --- a/desktop-app/src/app/header/header.component.ts +++ b/desktop-app/src/app/header/header.component.ts @@ -44,6 +44,7 @@ export class HeaderComponent implements OnInit { replaceText: ReplaceText[] = []; adbCommandToRun: string; osPlatform: string; + saveLogcatPath: string; favourites: { browserFavourites: FavouriteItem[]; fileFavourites: FavouriteItem[]; @@ -192,16 +193,62 @@ export class HeaderComponent implements OnInit { if (this.logcatSearch) { if (!!~stats.message.indexOf(this.logcatSearch) || !!~stats.tag.indexOf(this.logcatSearch)) { this.currentLogCat.unshift(stats); + this.attemptToSaveLogcat(stats); } } else { this.currentLogCat.unshift(stats); + this.attemptToSaveLogcat(stats); } - if (this.currentLogCat.length > 200) { - this.currentLogCat.length = 200; + if (this.currentLogCat.length > 4000) { + this.currentLogCat.length = 4000; } } ); } + cancelLogcatOutput() { + this.saveLogcatPath = null; + } + selectLogcatOutput() { + this.appService.electron.remote.dialog.showOpenDialog( + { + properties: ['openDirectory'], + defaultPath: this.adbService.savePath, + }, + files => { + files.forEach(filepath => { + this.saveLogcatPath = filepath; + }); + } + ); + } + clearLogcatFile() { + if (this.saveLogcatPath) { + if (this.appService.fs.existsSync(this.saveLogcatPath)) { + this.appService.fs.writeFile(this.appService.path.join(this.saveLogcatPath, 'logcat.log'), '', () => {}); + } + } + } + attemptToSaveLogcat(logcat) { + if (this.saveLogcatPath) { + if (this.appService.fs.existsSync(this.saveLogcatPath)) { + this.appService.fs.appendFile( + this.appService.path.join(this.saveLogcatPath, 'logcat.log'), + logcat.date + + ':' + + this.priorities[logcat.priority] + + logcat.tid + + '/' + + logcat.pid + + ' ' + + logcat.tag + + '\n' + + logcat.message + + '\n', + () => {} + ); + } + } + } stopLogcat() { this.adbService.adbCommand('endLogcat'); diff --git a/desktop-app/src/app/packages/packages.component.html b/desktop-app/src/app/packages/packages.component.html index 2affa90..8d1fa6a 100644 --- a/desktop-app/src/app/packages/packages.component.html +++ b/desktop-app/src/app/packages/packages.component.html @@ -59,7 +59,7 @@
Version: {{currentPackage.versionCode}}


Game Data Backups

- Backup data files from your SD Card for this app/game.

+ Backup data files from your SD Card for this app/game. This will attempt to save game data and OBB files for the game from the SD Card and not the internal storage. Does not work for all games.

Backup Game Data

@@ -79,9 +79,7 @@

APK Backups

Backup your APK file from your device.

Backup APK File - Open Backups

+ (click)="backupApk(currentPackage.package.packageName)">Backup APK File

Force Close App

Clear App Data

Uninstall App

+ Open Backups -

+



Permissions

diff --git a/desktop-app/yarn.lock b/desktop-app/yarn.lock index 85ea4ac..9de3179 100644 --- a/desktop-app/yarn.lock +++ b/desktop-app/yarn.lock @@ -824,6 +824,11 @@ version "1.4.2" resolved "https://registry.yarnpkg.com/@simonwep/pickr/-/pickr-1.4.2.tgz#ed702a52c5b643fe61f5beddb3c68faa86eaeaa9" +"@tweenjs/tween.js@17.4.0": + version "17.4.0" + resolved "https://registry.yarnpkg.com/@tweenjs/tween.js/-/tween.js-17.4.0.tgz#2e9ab3f2111906b30dfe1ef3259a9781dd211d35" + integrity sha512-J3fzl1F6wvh8KXVVcIuHN12xi1ZDcPA/0Vix+ZcJYwZWVHUwfIqfvzYXXEw7ybeev6477KCTt9fKydU+ajUqcg== + "@types/dragula@^2.1.34": version "2.1.34" resolved "https://registry.yarnpkg.com/@types/dragula/-/dragula-2.1.34.tgz#48ecf8627860e6179efc222dd5390b37dbd42d9d" @@ -895,6 +900,11 @@ version "0.1.2" resolved "https://registry.yarnpkg.com/@types/source-list-map/-/source-list-map-0.1.2.tgz#0078836063ffaf17412349bba364087e0ac02ec9" +"@types/tween.js@17.2.0": + version "17.2.0" + resolved "https://registry.yarnpkg.com/@types/tween.js/-/tween.js-17.2.0.tgz#25f98311daecb165ab91ee2cd7f17a9b1e6cc30c" + integrity sha512-mOsqurEtFEzwgkVc/jDVE2XrjZBYTbrmDUyCr9GXmnfc6q5otokxFtKvSY/B21zgz9LVRIvRTawKczjKi57wrA== + "@types/webpack-sources@^0.1.5": version "0.1.5" resolved "https://registry.yarnpkg.com/@types/webpack-sources/-/webpack-sources-0.1.5.tgz#be47c10f783d3d6efe1471ff7f042611bd464a92" @@ -4656,6 +4666,15 @@ ngx-materialize@^6.1.3: materialize-css "^0.100.2" tslib "^1.9.0" +ngx-virtual-scroller@3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/ngx-virtual-scroller/-/ngx-virtual-scroller-3.0.3.tgz#904b2f0d9cddc5574518ddbe3ffbb5ba91d3d81d" + integrity sha512-00au5zpcPMzbci9VmM9QlOT6ZQ+NqgpWaXsM2Y7dg6SSlCDcFMW8nMxoMsogP2b2mrBLpIIEB91nVtwLnwWs4A== + dependencies: + "@tweenjs/tween.js" "17.4.0" + "@types/tween.js" "17.2.0" + tslib "^1.9.0" + nice-try@^1.0.4: version "1.0.5" resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" diff --git a/electron/app.ts b/electron/app.ts index f4138f3..d85c0c9 100644 --- a/electron/app.ts +++ b/electron/app.ts @@ -6,6 +6,7 @@ const { autoUpdater } = require('electron-updater'); const download = require('./download'); const extract = require('extract-zip'); +const Readable = require('stream').Readable; const adb = require('adbkit'); const fs = require('fs'); const exec = require('child_process').exec; @@ -167,8 +168,6 @@ class ADB { } async install(serial, apkpath, isLocal, cb, scb, ecb) { if (!this.client) return ecb('Not connected.'); - let outpath = isLocal ? apkpath : path.join(app.getPath('appData'), 'SideQuest', new Date().getTime() + '.apk'); - let promise; if (isLocal) { let found; try { @@ -180,52 +179,95 @@ class ADB { return ecb('SAFESIDE'); } } - promise = isLocal - ? Promise.resolve() - : new Promise(resolve => { - progress(request(apkpath), { - throttle: 60, - }) - .on('progress', state => { - scb(state); + let stream; + try { + stream = isLocal + ? fs.createReadStream(apkpath) + : new Readable().wrap( + progress(request(apkpath), { + throttle: 60, }) - .on('end', () => { - scb({ - percent: 1, - size: 1, - time: 1, - }); - resolve(); - }) - .on('error', () => { - ecb('Download error! Please try again!'); - }) - .pipe(fs.createWriteStream(outpath)); - }); - promise - .then( - () => - new Promise((resolve, reject) => { - console.log('"' + this.adbPath + '" -s ' + serial + ' install -r -d "' + outpath + '"'); - exec( - '"' + this.adbPath + '" -s ' + serial + ' install -r -d "' + outpath + '"', - {}, - (error, stdout, stderr) => { - if (error) { - reject(error.message ? error.message : error.toString()); - } else { - resolve(); - } - } - ); - }) - ) - .then(() => (isLocal ? null : fs.unlinkSync(outpath))) + .on('progress', state => { + scb(state); + }) + .on('end', () => { + scb({ + percent: 1, + }); + }) + ); + } catch (e) { + const isInvalidURI = e && typeof e.message === 'string' && e.message.startsWith('Invalid URI "'); + if (isInvalidURI) { + return ecb("Can't download file. Invalid URL:"); + } else { + throw e; + } + } + this.client + .install(serial, stream) .then(cb) - .catch(e => { - if (!isLocal) fs.unlinkSync(outpath); - ecb(e); - }); + .catch(e => ecb(e)); + + // let outpath = isLocal ? apkpath : path.join(app.getPath('appData'), 'SideQuest', new Date().getTime() + '.apk'); + // let promise; + // if (isLocal) { + // let found; + // try { + // found = await this.checkAPK(scb, apkpath); + // } catch (e) { + // return ecb(e); + // } + // if (found) { + // return ecb('SAFESIDE'); + // } + // } + // promise = isLocal + // ? Promise.resolve() + // : new Promise(resolve => { + // progress(request(apkpath), { + // throttle: 60, + // }) + // .on('progress', state => { + // scb(state); + // }) + // .on('end', () => { + // scb({ + // percent: 1, + // size: 1, + // time: 1, + // }); + // resolve(); + // }) + // .on('error', () => { + // ecb('Download error! Please try again!'); + // }) + // .pipe(fs.createWriteStream(outpath)); + // }); + // promise + // .then( + // () => + // new Promise((resolve, reject) => { + // console.log('"' + this.adbPath + '" -s ' + serial + ' install -r -d "' + outpath + '"'); + // exec( + // '"' + this.adbPath + '" -s ' + serial + ' install -r -d "' + outpath + '"', + // {}, + // (error, stdout, stderr) => { + // if (error) { + // reject(error.message ? error.message : error.toString()); + // } else { + // resolve(); + // } + // } + // ); + // }) + // ) + // .then(() => (isLocal ? null : fs.unlinkSync(outpath))) + // .then(cb) + // .catch(e => { + // if (!isLocal) fs.unlinkSync(outpath); + // ecb(e); + // }); } uninstall(serial, packageName, cb, ecb) { if (!this.client) return ecb('Not connected.'); diff --git a/package.json b/package.json index 82bf39e..0fddcb3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,7 @@ { "name": "SideQuest", - "version": "0.10.7", + "productName": "SideQuest", + "version": "0.10.8", "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/the-expanse/SideQuest.git", "license": "UNLICENCED", @@ -21,6 +22,7 @@ "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", @@ -48,7 +50,8 @@ "nsis": { "artifactName": "${productName} Setup ${version}-x64-${os}.${ext}", "oneClick": false, - "allowToChangeInstallationDirectory": true + "allowToChangeInstallationDirectory": true, + "include": "build/uninstaller.nsh" }, "files": [ "build/**/*",