changed scrcpy path for adb on linux

This commit is contained in:
Your Name
2020-08-17 13:31:49 +01:00
parent 26be1764d2
commit a0d77146ae
8 changed files with 60 additions and 45 deletions
Binary file not shown.
-25
View File
@@ -399,31 +399,6 @@ export class AdbClientService {
return 'adb';
}
}
async downloadTools() {
let url = 'https://dl.google.com/android/repository/platform-tools-latest-';
this.spinnerService.showLoader();
let task = { status: 'Downloading/Extracting ADB...' };
this.spinnerService.setMessage('', task);
return new Promise((resolve, reject) => {
this.appService
.downloadFile(url + 'windows.zip', url + 'linux.zip', url + 'darwin.zip', url => this.adbPath + '.zip', task)
.then(path => {
task.status = 'Extracting ADB...';
this.appService.extract(path, { dir: this.appService.appData }, error => {
if (error) {
console.log(error);
reject(error);
} else {
this.appService.fs.unlink(path.toString(), err => {
if (err) return reject(err);
this.spinnerService.hideLoader();
return resolve();
});
}
});
});
}).catch(e => console.log(e));
}
getFilenameDate() {
return JSON.stringify(new Date())
.split('"')
+6 -2
View File
@@ -5,7 +5,7 @@
</div>
<app-loading-spinner #spinner></app-loading-spinner>
<app-status-bar #status (getHelp)="getHelpModal.openModal(); helpStatus = $event"></app-status-bar>
<app-status-bar #status (getHelp)="getHelpModal.openModal(); helpStatus = $event; setExterHelp()"></app-status-bar>
<webview id="mainWebView" #webview src="https://sidequestvr.com" allowpopups disablewebsecurity
useragent="Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; AS; rv:11.0) like Gecko electron/ SideQuestAgent"
[ngStyle]="{'left':webService.isWebviewOpen?'0':'-100%'}" class="bsaber-webview"></webview>
@@ -15,9 +15,13 @@
<h4>Get Help</h4>
</mz-modal-header>
<mz-modal-content>
We have a great community on discord and we have already faced most problems there. Please reach out on discord with the following error.<br><br>
We have a great community on discord and we have already faced most problems there. Please check our FAQ for info on the following error.<br><br>
<div class="code">
{{helpStatus}}
</div>
<br>
<div class="green-text" *ngIf="extraHelpStatus" [innerHTML]="extraHelpStatus">
</div>
<br><br>
<div class="center-align">
+27 -4
View File
@@ -1,4 +1,4 @@
import { Component, isDevMode, ViewChild } from '@angular/core';
import { AfterViewInit, Component, isDevMode, OnInit, ViewChild } from '@angular/core';
import { AppService } from './app.service';
import { LoadingSpinnerService } from './loading-spinner.service';
import { StatusBarService } from './status-bar.service';
@@ -11,11 +11,12 @@ import { AdbClientService } from './adb-client.service';
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
})
export class AppComponent {
export class AppComponent implements OnInit, AfterViewInit {
@ViewChild('spinner', { static: false }) spinner;
@ViewChild('status', { static: false }) status;
@ViewChild('webview', { static: false }) webview;
helpStatus: string;
extraHelpStatus: string;
devMode: boolean;
constructor(
private spinnerService: LoadingSpinnerService,
@@ -31,7 +32,7 @@ export class AppComponent {
ngOnInit() {
this.adbService
.setupAdb()
.then(() => this.appService.downloadScrCpyBinary())
.then(() => this.appService.downloadScrCpyBinary(this.adbService))
.then(() => this.adbService.connectedStatus())
.then(() => {
if (!localStorage.getItem('first_run')) {
@@ -40,7 +41,6 @@ export class AppComponent {
'Thanks for downloading SideQuest! Please click "Setup" on the top menu to begin and then "Sign Up" to get app updates, remote installing and more!'
);
}
this.dragService.setupDragAndDrop(this.webview.nativeElement);
});
}
@@ -49,4 +49,27 @@ export class AppComponent {
this.statusService.setStatus(this.status);
this.webService.setWebView(this.webview.nativeElement);
}
setExterHelp() {
let uninstall_instructions = `
<div class="card-panel grey lighten-2 z-depth-1">
<div class="row valign-wrapper">
<div class="col s2">
<img src="assets/images/app-icon.png" alt="" class="circle responsive-img">
</div>
<div class="col s10">
<span class="black-text">
SOLUTION: You may be able to resolve this issue by uninstalling the app first.<br><br>Click the <i class="material-icons vertical-align">apps</i> icon at the top, then click the <i class="material-icons vertical-align">settings</i> icon beside this app and finally click "Uninstall". You can then try to install this app again.
</span>
</div>
</div>
</div>`;
switch (true) {
case this.helpStatus.indexOf('INSTALL_FAILED_UPDATE_INCOMPATIBLE') > -1:
this.extraHelpStatus = uninstall_instructions;
break;
default:
this.extraHelpStatus = null;
break;
}
}
}
+2 -2
View File
@@ -363,7 +363,7 @@ export class AppService {
}
}
downloadScrCpyBinary() {
downloadScrCpyBinary(adbClientService) {
if (this.os.platform() === 'win32') {
this.spinnerService.showLoader();
let task = { status: 'Downloading/Extracting ScrCpy...' };
@@ -399,7 +399,7 @@ export class AppService {
});
});
} else {
this.scrcpyBinaryPath = 'scrcpy';
this.scrcpyBinaryPath = ' ADB=' + adbClientService.adbPath + ' scrcpy';
}
}
deleteFolderRecursive(path) {
+7 -4
View File
@@ -152,19 +152,22 @@ export class FilesComponent implements OnInit {
Math.round((stats.bytesTransferred / 1024 / 1024) * 100) / 100 +
'MB';
})
.then(() => setTimeout(() => this.uploadFile(files, task), 500));
.then(() => {
return new Promise(resolve => {
setTimeout(() => this.uploadFile(files, task).then(() => resolve()), 500);
});
});
}
uploadFilesFromList(files: string[]) {
if (files !== undefined && files.length) {
return this.processService.addItem('restore_files', async task => {
task.status = 'Starting Upload to ' + this.currentPath;
this.uploadFile(files, task)
return this.uploadFile(files, task)
.then(() => {
setTimeout(() => {
this.open(this.currentPath);
task.status = 'Upload complete! ' + this.currentPath;
this.statusService.showStatus('Files/Folders uploaded successfully!');
}, 1500);
task.status = 'Upload complete!';
})
.catch(e => this.statusService.showStatus(e.toString(), true));
});
+12 -1
View File
@@ -68,7 +68,18 @@
(click)="setGuardian(GU.OFF)">OFF</div>
</div>
<div class="section-title"
[ngClass]="{'text-dark-theme':appService.currentTheme === 'dark','text-light-theme':appService.currentTheme === 'light'}">
Full Rate Capture</div>
This will enable/disable the full rate capture for videos recorded i.e. 60/72fps rather than 30fps.
<div class="button-section">
<div class="waves-effect waves-light btn set-ca margin-bottom margin-right pink-button"
[ngClass]="{'button-dark-theme':appService.currentTheme === 'dark','button-light-theme':appService.currentTheme === 'light','waves-dark':true,'waves-light':false}"
(click)="setFullRate(GU.ON)">ON</div>
<div class="waves-effect waves-light btn set-ca margin-bottom margin-right pink-button"
[ngClass]="{'button-dark-theme':appService.currentTheme === 'dark','button-light-theme':appService.currentTheme === 'light','waves-dark':true,'waves-light':false}"
(click)="setFullRate(GU.OFF)">OFF</div>
</div>
<div class="section-title"
[ngClass]="{'text-dark-theme':appService.currentTheme === 'dark','text-light-theme':appService.currentTheme === 'light'}">
Paste Text to your device</div>
+6 -7
View File
@@ -66,6 +66,7 @@ export class ToolsComponent implements OnInit {
CA = CA;
CR = CR;
GPU = GPU;
FR = GU;
pavlovName;
constructor(
public appService: AppService,
@@ -111,6 +112,11 @@ export class ToolsComponent implements OnInit {
this.statusService.showStatus('CPU/GPU level set OK!!');
});
}
setFullRate(fullRate: GU) {
this.adbService.runAdbCommand('adb shell setprop debug.oculus.fullRateCapture ' + (fullRate === GU.ON ? 1 : 0)).then(() => {
this.statusService.showStatus('Guardian pause set OK!!');
});
}
setGuardian(guardian: GU) {
this.adbService.runAdbCommand('adb shell setprop debug.oculus.guardian_pause ' + (guardian === GU.ON ? 1 : 0)).then(() => {
this.statusService.showStatus('Guardian pause set OK!!');
@@ -250,11 +256,4 @@ export class ToolsComponent implements OnInit {
}
});
}
setHideNSFW() {
if (this.appService.hideNSFW) {
localStorage.setItem('hideNSFW', 'true');
} else {
localStorage.removeItem('hideNSFW');
}
}
}