fixed a regression in the file browser that broke mod uploads. fixed the checking apk stall to show the correct message. improved some messaging

This commit is contained in:
Shane Harris
2021-08-16 10:10:41 +02:00
parent 6af4fa1dba
commit ae4e2b1556
5 changed files with 24 additions and 26 deletions
+7 -18
View File
@@ -513,34 +513,23 @@ export class AdbClientService {
} }
}) })
.then(r => { .then(r => {
task.status = name + 'APK file installed ok!!'; task.status = name + 'APK installed ok!!';
if (deleteAfter) { if (deleteAfter) {
this.appService.fs.unlink(filePath, err => {}); this.appService.fs.unlink(filePath, err => {});
} }
if (filePath.indexOf('com.weloveoculus.BMBF') > -1) { if (filePath.indexOf('com.weloveoculus.BMBF') > -1) {
return this.beatonService.setBeatOnPermission(this); return this.beatonService.setBeatOnPermission(this);
} }
if (filePath.toLowerCase().indexOf('sidequest.legends') > -1) {
return this.setPermission('com.sidequest.legends', 'android.permission.RECORD_AUDIO');
}
if (filePath.toLowerCase().indexOf('pavlov') > -1) {
return this.setPermission('com.vankrupt.pavlov', 'android.permission.RECORD_AUDIO')
.then(() => this.setPermission('com.vankrupt.pavlov', 'android.permission.READ_EXTERNAL_STORAGE'))
.then(() => this.setPermission('com.vankrupt.pavlov', 'android.permission.WRITE_EXTERNAL_STORAGE'))
.then(() =>
this.adbCommand('shell', {
serial: this.deviceSerial,
command: 'echo null > /sdcard/pavlov.name.txt',
})
);
}
}) })
.catch(async e => { .catch(async e => {
if (deleteAfter) { if (deleteAfter) {
this.appService.fs.unlink(filePath, err => {}); this.appService.fs.unlink(filePath, err => {});
} }
let er = e.message ? e.message : e.code ? e.code : e.reason ? e.reason : JSON.stringify(e); let er = e.message ? e.message : e.code ? e.code : e.reason ? e.reason : JSON.stringify(e);
if (er.indexOf('INSTALL_FAILED_UPDATE_INCOMPATIBLE') > -1 && er.indexOf('com.oculus.environment.prod.')) { if (
er.indexOf('INSTALL_FAILED_UPDATE_INCOMPATIBLE') > -1 &&
er.indexOf('com.oculus.environment.prod.') > -1
) {
let match = er.match(/([A-Za-z]*[A-Za-z\d_]*\.)+[A-Za-z][A-Za-z\d_]*/gm); let match = er.match(/([A-Za-z]*[A-Za-z\d_]*\.)+[A-Za-z][A-Za-z\d_]*/gm);
await this.adbCommand('uninstall', { serial: this.deviceSerial, packageName: match[0] }); await this.adbCommand('uninstall', { serial: this.deviceSerial, packageName: match[0] });
this.installAPK(filePath, isLocal, shouldUninstall, number, total, deleteAfter, name); this.installAPK(filePath, isLocal, shouldUninstall, number, total, deleteAfter, name);
@@ -647,7 +636,7 @@ export class AdbClientService {
} }
async restoreDataBackup(packageName: string, folderName: string) { async restoreDataBackup(packageName: string, folderName: string) {
return this.processService.addItem('restore_files', async task => { return this.processService.addItem('restore_files', async task => {
task.status = 'Restoring Files...'; task.status = 'Transferring Files...';
let packageBackupPath = this.appService.path.join(this.appService.backupPath, packageName, 'data', folderName, 'files'); let packageBackupPath = this.appService.path.join(this.appService.backupPath, packageName, 'data', folderName, 'files');
if (this.appService.fs.existsSync(packageBackupPath)) { if (this.appService.fs.existsSync(packageBackupPath)) {
this.localFiles = []; this.localFiles = [];
@@ -665,7 +654,7 @@ export class AdbClientService {
return this.uploadFile(this.localFiles.filter(f => f.__isFile), task); return this.uploadFile(this.localFiles.filter(f => f.__isFile), task);
}) })
.then(() => this.spinnerService.hideLoader()) .then(() => this.spinnerService.hideLoader())
.then(() => (task.status = 'Restored game data backup OK!! ' + packageName + ' | ' + folderName)); .then(() => (task.status = 'Files Transferred OK!! ' + packageName + ' | ' + folderName));
} }
let obbBackupPath = this.appService.path.join(this.appService.backupPath, packageName, 'data', folderName, 'obb'); let obbBackupPath = this.appService.path.join(this.appService.backupPath, packageName, 'data', folderName, 'obb');
if (this.appService.fs.existsSync(obbBackupPath)) { if (this.appService.fs.existsSync(obbBackupPath)) {
@@ -75,13 +75,13 @@
<mz-modal-content> <mz-modal-content>
Please enter a folder name. Please enter a folder name.
<div class="input-field "> <div class="input-field ">
<input id="devicePaste" type="text" [(ngModel)]="folderName" autofocus (keyup)="autoReturn($event, makeFolder.bind(this))"/> <input id="devicePaste" type="text" [(ngModel)]="folderName" autofocus (keyup)="autoReturn($event, makeFolder.bind(this, true))"/>
<label for="devicePaste">Folder Name</label> <label for="devicePaste">Folder Name</label>
</div> </div>
</mz-modal-content> </mz-modal-content>
<mz-modal-footer> <mz-modal-footer>
<button mz-button [flat]="true" mz-modal-close>Close</button> <button mz-button [flat]="true" mz-modal-close>Close</button>
<button mz-button class="pink-button" mz-modal-close (click)="makeFolder()">Make Folder</button> <button mz-button class="pink-button" mz-modal-close (click)="makeFolder(true)">Make Folder</button>
</mz-modal-footer> </mz-modal-footer>
</mz-modal> </mz-modal>
+7 -3
View File
@@ -55,7 +55,7 @@ export class FilesComponent implements OnInit {
ngOnInit() { ngOnInit() {
this.appService.setTitle('Headset Files'); this.appService.setTitle('Headset Files');
} }
async makeFolder() { async makeFolder(shouldOpen?: boolean) {
if ( if (
!!~this.files !!~this.files
.filter(f => f.icon === 'folder') .filter(f => f.icon === 'folder')
@@ -65,7 +65,11 @@ export class FilesComponent implements OnInit {
return this.statusService.showStatus('A folder already exists with that name!!', true); return this.statusService.showStatus('A folder already exists with that name!!', true);
} else { } else {
await this.adbService.makeDirectory(this.appService.path.posix.join(this.currentPath, this.folderName)).then(r => { await this.adbService.makeDirectory(this.appService.path.posix.join(this.currentPath, this.folderName)).then(r => {
if (shouldOpen) {
this.open(this.appService.path.posix.join(this.currentPath, this.folderName)); this.open(this.appService.path.posix.join(this.currentPath, this.folderName));
} else {
this.open(this.currentPath);
}
this.folderName = ''; this.folderName = '';
}); });
} }
@@ -173,7 +177,7 @@ export class FilesComponent implements OnInit {
setTimeout(() => { setTimeout(() => {
this.open(this.currentPath); this.open(this.currentPath);
}, 1500); }, 1500);
task.status = 'Upload complete!'; task.status = 'Transfer complete!';
}) })
.catch(e => this.statusService.showStatus(e.toString(), true)); .catch(e => this.statusService.showStatus(e.toString(), true));
}); });
@@ -236,7 +240,7 @@ export class FilesComponent implements OnInit {
return this.adbService return this.adbService
.adbCommand('pull', { serial: this.adbService.deviceSerial, path, savePath }, stats => { .adbCommand('pull', { serial: this.adbService.deviceSerial, path, savePath }, stats => {
task.status = task.status =
'File downloading: ' + 'File saving: ' +
this.appService.path.basename(savePath) + this.appService.path.basename(savePath) +
' - ' + ' - ' +
Math.round(stats.bytesTransferred / 1024 / 1024) + Math.round(stats.bytesTransferred / 1024 / 1024) +
+6 -1
View File
@@ -50,7 +50,11 @@ class ADB {
reject(error); reject(error);
} else { } else {
try { try {
resolve(JSON.parse(body).found); const found = JSON.parse(body).found;
if (!found) {
updateStatus('APK is not in the blacklist. Installing...');
}
resolve(found);
} catch (e) { } catch (e) {
reject(e); reject(e);
} }
@@ -179,6 +183,7 @@ class ADB {
return ecb('SAFESIDE'); return ecb('SAFESIDE');
} }
} }
scb('Transferring APK to device...');
let stream; let stream;
try { try {
stream = isLocal stream = isLocal
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "SideQuest", "name": "SideQuest",
"productName": "SideQuest", "productName": "SideQuest",
"version": "0.10.23", "version": "0.10.24",
"description": "A open app store for mobile android based VR devices such as the Levovo Mirage, Oculus Go, Oculus Quest, Vive Focus.", "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", "repository": "https://github.com/SideQuestVR/SideQuest.git",
"license": "UNLICENCED", "license": "UNLICENCED",