latest
This commit is contained in:
Binary file not shown.
@@ -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) + '% ') +
|
||||
' <span style="font-style:italic">' +
|
||||
filePath +
|
||||
'</span>';
|
||||
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...';
|
||||
|
||||
@@ -353,7 +353,7 @@
|
||||
<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(); currentLogCat.length = 0; isStarted = false;">Stop Only</button>
|
||||
<button mz-button class="right" [flat]="true" (click)="stopLogcat(); isStarted = false;">Stop Only</button>
|
||||
<h4>ADB Logcat</h4>
|
||||
</mz-modal-header>
|
||||
<mz-modal-content>
|
||||
@@ -425,8 +425,7 @@
|
||||
Thank you and have a great day!
|
||||
</mz-modal-content>
|
||||
<mz-modal-footer>
|
||||
<button mz-button mz-modal-close [flat]="true" (click)="safeResolve('DoInstall')">Continue ( Not Recommended )</button>
|
||||
<button mz-button class="pink-button" mz-modal-close (click)="safeResolve('DontInstall')">Back to Safety</button>
|
||||
<button mz-button class="pink-button" mz-modal-close>Back to Safety</button>
|
||||
</mz-modal-footer>
|
||||
</mz-modal>
|
||||
|
||||
@@ -586,7 +585,6 @@
|
||||
</mz-modal-footer>
|
||||
</mz-modal>
|
||||
|
||||
|
||||
<mz-modal #manageFavs [fixedFooter]="true">
|
||||
<mz-modal-header>
|
||||
<button mz-button class="right pink-button" (click)="showAddFavourite = !showAddFavourite">{{showAddFavourite? 'Hide' : 'Add New'}}</button>
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -16,3 +16,6 @@
|
||||
#SearchPackage{
|
||||
color: white!important;
|
||||
}
|
||||
.backup-name{
|
||||
line-height: 30px;
|
||||
}
|
||||
|
||||
@@ -63,14 +63,14 @@
|
||||
<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">
|
||||
<div class="col s3 m2 l1">
|
||||
<div class="col s3">
|
||||
<div class="chip cursor restore-backup tooltipped" data-position="right" data-tooltip="Restore this backup"
|
||||
(click)="restoreBackup(showBackupFileName(backup))">
|
||||
<i class="material-icons">sync</i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col s6 s10 l11">
|
||||
<div class="chip">
|
||||
<div class="col s9">
|
||||
<div class="">
|
||||
<span class="backup-name">{{showBackupFileName(backup)}}</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -83,14 +83,14 @@
|
||||
<a class="waves-effect waves-light btn"
|
||||
(click)="appService.openFolder(folder.APP_BACKUP,currentPackage.package.packageName)">Open Backups</a><br><br>
|
||||
<div class="row" *ngFor="let backup of backups">
|
||||
<div class="col s1">
|
||||
<div class="col s3">
|
||||
<div class="chip cursor restore-backup tooltipped" data-position="right" data-tooltip="Restore this backup"
|
||||
(click)="installBackupApk(backup)">
|
||||
<i class="material-icons">sync</i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col s11">
|
||||
<div class="chip">
|
||||
<div class="col s9">
|
||||
<div class="">
|
||||
<span class="backup-name">{{showBackupFileName(backup)}}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -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 = [];
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user