Update app.service.ts

This commit is contained in:
SideQuest
2021-02-17 09:35:25 +00:00
committed by GitHub
parent 8d9bfdfae4
commit 21c4c5a7b0
+39 -39
View File
@@ -363,45 +363,45 @@ export class AppService {
} }
} }
// downloadScrCpyBinary(adbClientService) { downloadScrCpyBinary(adbClientService) {
// if (this.os.platform() === 'win32') { if (this.os.platform() === 'win32') {
// this.spinnerService.showLoader(); this.spinnerService.showLoader();
// let task = { status: 'Downloading/Extracting ScrCpy...' }; let task = { status: 'Downloading/Extracting ScrCpy...' };
// this.spinnerService.setMessage('', task); this.spinnerService.setMessage('', task);
// let url = 'https://github.com/Genymobile/scrcpy/releases/download/v1.11/scrcpy-win64-v1.11.zip'; let url = 'https://github.com/Genymobile/scrcpy/releases/download/v1.11/scrcpy-win64-v1.11.zip';
// let downloadPath = this.path.join(this.appData, 'scrcpy', 'scrcpy.exe'); let downloadPath = this.path.join(this.appData, 'scrcpy', 'scrcpy.exe');
// if (this.doesFileExist(downloadPath)) { if (this.doesFileExist(downloadPath)) {
// this.scrcpyBinaryPath = downloadPath; this.scrcpyBinaryPath = downloadPath;
// this.spinnerService.hideLoader(); this.spinnerService.hideLoader();
// return Promise.resolve(); return Promise.resolve();
// } }
// return new Promise<void>((resolve, reject) => { return new Promise<void>((resolve, reject) => {
// this.downloadFile( this.downloadFile(
// url, url,
// url, url,
// url, url,
// () => { () => {
// return this.path.join(this.appData, 'scrcpy.zip'); return this.path.join(this.appData, 'scrcpy.zip');
// }, },
// task task
// ).then((path: any) => { ).then((path: any) => {
// let callback = error => { let callback = error => {
// if (error) return reject(error); if (error) return reject(error);
// this.fs.unlink(path, err => { this.fs.unlink(path, err => {
// // if(err) return reject(err); // if(err) return reject(err);
// this.spinnerService.hideLoader(); this.spinnerService.hideLoader();
// resolve(path.split('.')[0]); resolve(path.split('.')[0]);
// }); });
// }; };
//
// this.extract(path, { dir: this.path.join(this.appData, 'scrcpy') }, callback); this.extract(path, { dir: this.path.join(this.appData, 'scrcpy') }, callback);
// this.scrcpyBinaryPath = downloadPath; this.scrcpyBinaryPath = downloadPath;
// }); });
// }); });
// } else { } else {
// this.scrcpyBinaryPath = 'ADB=' + adbClientService.adbPath + ' scrcpy'; this.scrcpyBinaryPath = 'ADB=' + adbClientService.adbPath + ' scrcpy';
// } }
// } }
deleteFolderRecursive(path) { deleteFolderRecursive(path) {
if (this.fs.existsSync(path)) { if (this.fs.existsSync(path)) {
this.fs.readdirSync(path).forEach(file => { this.fs.readdirSync(path).forEach(file => {