a few bug fixes and improved on the adb logcat interface
This commit is contained in:
Binary file not shown.
@@ -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
|
||||
@@ -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",
|
||||
|
||||
@@ -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],
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -353,27 +353,35 @@
|
||||
|
||||
<mz-modal #logcatModal [fixedFooter]="true" [options]="{dismissible: false}">
|
||||
<mz-modal-header>
|
||||
<button mz-button class="right" [flat]="true" mz-modal-close (click)="stopLogcat(); currentLogCat.length = 0; isStarted = false;">Stop & Close</button>
|
||||
<button mz-button class="right" [flat]="true" (click)="stopLogcat(); isStarted = false;">Stop Only</button>
|
||||
<button mz-button class="right red" mz-modal-close (click)="stopLogcat(); currentLogCat.length = 0; isStarted = false;">Close</button>
|
||||
<button mz-button class="right red margin-right" (click)="stopLogcat(); isStarted = false;">Stop</button>
|
||||
<button mz-button class="right margin-right" *ngIf="!saveLogcatPath" (click)="selectLogcatOutput();">Pick Output Folder</button>
|
||||
<button mz-button class="right red margin-right" *ngIf="saveLogcatPath" (click)="cancelLogcatOutput();">Cancel Output</button>
|
||||
<h4>ADB Logcat</h4>
|
||||
</mz-modal-header>
|
||||
<mz-modal-content>
|
||||
Select your options and click start to begin receiving logcat messages.
|
||||
<br><br>
|
||||
<div class="truncate">{{saveLogcatPath ? 'Saving to: ' + appService.path.join(saveLogcatPath,'logcat.log') : ''}}
|
||||
|
||||
<button mz-button class="red small-button margin-left" *ngIf="saveLogcatPath" (click)="clearLogcatFile();">Clear File</button>
|
||||
</div>
|
||||
<br>
|
||||
<div class="button-section">
|
||||
<div class="code logcat-block">
|
||||
<div *ngIf="!currentLogCat.length">
|
||||
{{isStarted ? 'Waiting for messages...' : 'Click start to begin streaming logcat messages.'}}
|
||||
</div>
|
||||
<div *ngFor="let logcat of currentLogCat">
|
||||
<div class="row no-margin">
|
||||
<div class="col s2 logcat-smaller green-text no-padding">{{logcat.date}}: {{priorities[logcat.priority]}}</div>
|
||||
<div class="col s2 logcat-smaller purple-text no-padding">{{logcat.tid}}/{{logcat.pid}} {{logcat.tag}} </div>
|
||||
<div class="col s8 logcat-small no-padding"
|
||||
[ngClass]="{'red-text': logcat.priority === 6, 'orange-text': logcat.priority === 5}" [innerHTML]="logcat.message">
|
||||
<!-- <virtual-scroller #scroll [items]="currentLogCat">-->
|
||||
<div class="child-item" *ngFor="let logcat of currentLogCat">
|
||||
<div class="row no-margin">
|
||||
<div class="col s2 logcat-smaller green-text no-padding">{{logcat.date}}: {{priorities[logcat.priority]}}</div>
|
||||
<div class="col s2 logcat-smaller purple-text no-padding">{{logcat.tid}}/{{logcat.pid}} {{logcat.tag}} </div>
|
||||
<div class="col s8 logcat-small no-padding"
|
||||
[ngClass]="{'red-text': logcat.priority === 6, 'orange-text': logcat.priority === 5}" [innerHTML]="logcat.message">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- </virtual-scroller>-->
|
||||
</div>
|
||||
</div>
|
||||
</mz-modal-content>
|
||||
@@ -412,7 +420,8 @@
|
||||
<img class="right margin-left" src="assets/images/bigman.gif" style="width: 430px"/>
|
||||
WARNING: We have stopped this install because it may may harm your device.
|
||||
<br><br>
|
||||
If you continue with the install you risk the following:<br><br>
|
||||
If you think this has happened in error, please contact us on Discord with a link to the apk file.<br><br>
|
||||
We have protected you from:<br><br>
|
||||
- Causing physical damage to your headset.<br>
|
||||
- Having your personal information stolen ( including tracking your movments in VR )<br>
|
||||
- Being banned from the Oculus platform.<br>
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
<div *ngIf="currentPackage.versionCode" class="small-text">Version: {{currentPackage.versionCode}}</div><br><br>
|
||||
|
||||
<h4>Game Data Backups</h4>
|
||||
Backup data files from your SD Card for this app/game.<br><br>
|
||||
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.<br><br>
|
||||
<a class="waves-effect waves-light btn backup-this-package"
|
||||
(click)="backupData(currentPackage.package.packageName)">Backup Game Data</a><br><br>
|
||||
<div class="row" *ngFor="let backup of dataBackups">
|
||||
@@ -79,9 +79,7 @@
|
||||
<h4>APK Backups</h4>
|
||||
Backup your APK file from your device.<br><br>
|
||||
<a class="waves-effect waves-light btn backup-this-package margin-right"
|
||||
(click)="backupApk(currentPackage.package.packageName)">Backup APK File</a>
|
||||
<a class="waves-effect waves-light btn"
|
||||
(click)="appService.openFolder(folder.APP_BACKUP,currentPackage.package.packageName)">Open Backups</a><br><br>
|
||||
(click)="backupApk(currentPackage.package.packageName)">Backup APK File</a><br><br>
|
||||
<div class="row" *ngFor="let backup of backups">
|
||||
<div class="col s3">
|
||||
<div class="chip cursor restore-backup tooltipped" data-position="right" data-tooltip="Restore this backup"
|
||||
@@ -104,8 +102,10 @@
|
||||
<a class="waves-effect waves-light btn orange " (click)="forceClose()">Force Close App</a><br><br>
|
||||
<a class="waves-effect waves-light btn orange " (click)="clearData()">Clear App Data</a><br><br>
|
||||
<a class="waves-effect waves-light btn red " (click)="uninstallApk()">Uninstall App</a><br><br>
|
||||
<a class="waves-effect waves-light btn"
|
||||
(click)="appService.openFolder(folder.APP_BACKUP,currentPackage.package.packageName)">Open Backups</a>
|
||||
|
||||
<br><br>
|
||||
<br><br><br><br>
|
||||
|
||||
|
||||
<h4>Permissions</h4>
|
||||
|
||||
@@ -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"
|
||||
|
||||
+88
-46
@@ -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.');
|
||||
|
||||
+5
-2
@@ -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/**/*",
|
||||
|
||||
Reference in New Issue
Block a user