diff --git a/build-electron/app.jsc b/build-electron/app.jsc index ede22c2..fe787ec 100644 Binary files a/build-electron/app.jsc and b/build-electron/app.jsc differ diff --git a/desktop-app/src/app/adb-client.service.ts b/desktop-app/src/app/adb-client.service.ts index c42471c..33ea70b 100644 --- a/desktop-app/src/app/adb-client.service.ts +++ b/desktop-app/src/app/adb-client.service.ts @@ -57,8 +57,7 @@ export class AdbClientService { private statusService: StatusBarService, private beatonService: BeatOnService, private webService: WebviewService, - public processService: ProcessBucketService, - public safeSideService: SafeSideService + public processService: ProcessBucketService ) { this.lastConnectionCheck = performance.now() - 4000; this.adbPath = appService.path.join(appService.appData, 'platform-tools'); @@ -122,11 +121,10 @@ export class AdbClientService { case '.apk': return this.installAPK(filepath, true); case '.obb': - if (this.appService.path.basename(filepath).match(/main.[0-9]{1,}.[a-z]{1,}.[A-z]{1,}.[A-z]{1,}.obb/)) { - return this.installLocalObb(filepath).then(() => this.spinnerService.hideLoader()); - } else { - return Promise.reject('Invalid OBB'); - } + return this.processService.addItem('file_install', async task => { + task.status = 'Transferring OBB file...'; + return this.installLocalObb(filepath, false, null, 0, 0, task); + }); case '.zip': return this.processService.addItem('file_install', async task => { return this.installLocalZip(filepath, false, () => this.spinnerService.hideLoader(), task, true); @@ -518,22 +516,19 @@ export class AdbClientService { task => { name = name ? name + ': ' : ''; if (this.deviceStatus !== ConnectionStatus.CONNECTED) { - return Promise.reject(name + 'Apk install failed - No device connected! ' + filePath); + return Promise.reject(name + 'Apk install failed - No device connected!'); } const showTotal = number && total ? '(' + number + '/' + total + ') ' : ''; task.app_name = name; task.status = name + showTotal + 'Installing Apk... '; return this.adbCommand('install', { serial: this.deviceSerial, path: filePath, isLocal: !!isLocal }, status => { task.status = - (status.percent === 1 - ? name + showTotal + 'Installing Apk... ' - : name + showTotal + 'Downloading APK... ' + Math.round(status.percent * 100) + '% ') + - ' ' + - filePath + - ''; + status.percent === 1 + ? name + showTotal + 'Installing Apk...' + : name + showTotal + 'Downloading APK... ' + Math.round(status.percent * 100) + '% '; }) .then(r => { - task.status = name + 'APK file installed ok!! ' + filePath; + task.status = name + 'APK file installed ok!!'; if (deleteAfter) { this.appService.fs.unlink(filePath, err => {}); } @@ -559,7 +554,11 @@ export class AdbClientService { if (deleteAfter) { this.appService.fs.unlink(filePath, err => {}); } - return Promise.reject(e.message ? e.message : e.code ? e.code : e.toString() + ' ' + filePath); + let er = e.message ? e.message : e.code ? e.code : e.toString(); + if (er === 'SAFESIDE') { + this.appService.headerComponent.safeModal.openModal(); + } + return Promise.reject(er); }); }, name @@ -905,7 +904,7 @@ export class AdbClientService { installLocalObb(filepath: string, dontCatchError = false, cb = null, number?: number, total?: number, task?, name?: string) { let filename = this.appService.path.basename(filepath); let packageId = filename.match(/main.[0-9]{1,}.([A-z0-9.]{1,}).obb/)[1]; - console.log(packageId); + name = name || packageId; const showTotal = number && total ? '(' + number + '/' + total + ') ' : ''; if (!task) this.spinnerService.showLoader(); let p = this.runAdbCommand('adb push "' + filepath + '" /sdcard/Android/obb/' + packageId + '/' + filename); @@ -914,7 +913,7 @@ export class AdbClientService { } p = p.then(() => { if (task) { - task.status = name + 'File transferred successfully! ' + filepath; + task.status = name + ' File transferred successfully! '; } else { this.statusService.showStatus('File transferred successfully!'); } @@ -923,7 +922,7 @@ export class AdbClientService { p = p.catch(e => { if (task) { task.failed = true; - task.status = name + 'Failed to transfer file!! - ' + filepath; + task.status = name + ' Failed to transfer file!!'; } else { this.spinnerService.hideLoader(); this.statusService.showStatus(e.toString(), true); @@ -940,7 +939,7 @@ export class AdbClientService { '.obb': filepath => { if (this.appService.path.basename(filepath).match(/main.[0-9]{1,}.[a-z]{1,}.[A-z]{1,}.[A-z]{1,}.obb/)) { this.processService.addItem('file_install', async task => { - return this.installLocalObb(filepath, false, null, 1, 1, task).then(() => { + return this.installLocalObb(filepath, false, null, 1, 1, task, '').then(() => { if (deleteAfter) { this.appService.fs.unlink(filepath, err => {}); } @@ -951,8 +950,6 @@ export class AdbClientService { } }, }; - - //this.cleanUpFolder(); return new Promise(resolve => { if (task) { task.status = 'Extracting zip file download...'; diff --git a/desktop-app/src/app/header/header.component.html b/desktop-app/src/app/header/header.component.html index 87282af..6bc1810 100644 --- a/desktop-app/src/app/header/header.component.html +++ b/desktop-app/src/app/header/header.component.html @@ -353,7 +353,7 @@ - +

ADB Logcat

@@ -425,8 +425,7 @@ Thank you and have a great day! - - +
@@ -586,7 +585,6 @@ - diff --git a/desktop-app/src/app/header/header.component.ts b/desktop-app/src/app/header/header.component.ts index 7f387ba..a6e2db4 100644 --- a/desktop-app/src/app/header/header.component.ts +++ b/desktop-app/src/app/header/header.component.ts @@ -39,11 +39,8 @@ export class HeaderComponent implements OnInit { @ViewChild('beatOnModal', { static: false }) beatOnModal; @ViewChild('mainLogo', { static: false }) mainLogo; @ViewChild('safeModal', { static: false }) safeModal; - safeResolve: any = val => val; folder = FolderType; - addrepoUrl: string = ''; - isAlive: boolean = true; - isAliveChecking: boolean = false; + isAlive = true; replaceText: ReplaceText[] = []; adbCommandToRun: string; osPlatform: string; @@ -97,11 +94,8 @@ export class HeaderComponent implements OnInit { public webService: WebviewService, public spinnerService: LoadingSpinnerService, public statusService: StatusBarService, - public repoService: RepoService, public beatonService: BeatOnService, public dragAndDropService: DragAndDropService, - // private dragulaService: DragulaService, - public router: Router, public processService: ProcessBucketService ) { this.osPlatform = this.appService.os.platform(); diff --git a/desktop-app/src/app/packages/packages.component.css b/desktop-app/src/app/packages/packages.component.css index dc0b27f..e68ab96 100644 --- a/desktop-app/src/app/packages/packages.component.css +++ b/desktop-app/src/app/packages/packages.component.css @@ -16,3 +16,6 @@ #SearchPackage{ color: white!important; } +.backup-name{ + line-height: 30px; +} diff --git a/desktop-app/src/app/packages/packages.component.html b/desktop-app/src/app/packages/packages.component.html index 40e995a..e678f83 100644 --- a/desktop-app/src/app/packages/packages.component.html +++ b/desktop-app/src/app/packages/packages.component.html @@ -63,14 +63,14 @@ Backup Game Data

-
+
sync
-
-
+
+
{{showBackupFileName(backup)}}
@@ -83,14 +83,14 @@ Open Backups

-
+
sync
-
-
+
+
{{showBackupFileName(backup)}}
diff --git a/desktop-app/src/app/process-bucket.service.ts b/desktop-app/src/app/process-bucket.service.ts index f570694..1fc483c 100644 --- a/desktop-app/src/app/process-bucket.service.ts +++ b/desktop-app/src/app/process-bucket.service.ts @@ -20,6 +20,7 @@ export interface ProcessTask { }) export class ProcessBucketService { tasks: ProcessTask[]; + currentTask: ProcessTask; is_running: boolean; left_length: number; failed_length: number; @@ -84,12 +85,14 @@ export class ProcessBucketService { if (objects.length) { this.is_running = true; let task = objects[0]; + this.currentTask = task; task.running = true; await task .resolve(task) .then(() => { task.running = false; task.succeeded = true; + this.currentTask = null; if (!task.cancelled) { return timeout.then(() => this.processBucket()); } @@ -99,6 +102,7 @@ export class ProcessBucketService { task.status = (task.app_name ? task.app_name + ': ' : '') + (e.message ? e.message : e.code ? e.code : e.toString()); task.failed = true; + this.currentTask = null; this.statusService.showStatus(task.status, true); if (!task.cancelled) { return timeout.then(() => this.processBucket()); @@ -151,6 +155,9 @@ export class ProcessBucketService { this.tasks = this.tasks.filter(t => !t.failed); } clearAll() { + if (this.currentTask) { + this.skipCurrent(this.currentTask); + } this.tasks = []; } } diff --git a/package.json b/package.json index 994bdb2..cae6504 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "main": "build-electron/boot.js", "scripts": { "concurrently": "concurrently", - "start": "concurrently \"yarn electron-build && wait-on http-get://localhost:4205/ && cross-env NODE_ENV=dev electron .\" \"cd desktop-app && ng serve --port 4205\"", + "start": "concurrently \"yarn electron-build && yarn platform-tools && wait-on http-get://localhost:4205/ && cross-env NODE_ENV=dev electron .\" \"cd desktop-app && ng serve --port 4205\"", "postinstall": "electron-builder install-app-deps && cd desktop-app && yarn install", "dist": "yarn electron-build && yarn platform-tools && yarn app-build && electron-builder", "angular": "cd desktop-app && ng serve --port 4205",