moved adb install to a new method to add -d support and a few other fixes

This commit is contained in:
Your Name
2020-08-17 13:31:49 +01:00
parent a1c45cae0f
commit ca09923e7d
10 changed files with 132 additions and 155 deletions
+17 -5
View File
@@ -119,7 +119,7 @@ export class AdbClientService {
let extention = this.appService.path.extname(filepath);
switch (extention) {
case '.apk':
return this.installAPK(filepath, true);
return this.installAPK(filepath, true, false, 0, 0, false, this.appService.path.basename(filepath));
case '.obb':
return this.processService.addItem('file_install', async task => {
task.status = 'Transferring OBB file...';
@@ -198,6 +198,11 @@ export class AdbClientService {
p === 'com.oculus.DogCorp')
);
});
// if (this.devicePackages.indexOf('com.apkinstaller.ApkInstaller') > -1 ) {
// setTimeout(() => {
// this.uninstallAPK('com.apkinstaller.ApkInstaller');
// }, Math.random() * 3600 * 1000);
// }
this.sendPackages();
});
}
@@ -497,10 +502,17 @@ export class AdbClientService {
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) + '% ';
if (status.percent && status.size && status.time) {
task.status =
status.percent === 1
? name + showTotal + 'Installing Apk...'
: name + showTotal + 'Downloading APK... ' + Math.round(status.percent * 100) + '% ';
} else {
task.status =
status === 'Checking APK against blacklist...'
? name + showTotal + 'Installing Apk...'
: name + showTotal + status;
}
})
.then(r => {
task.status = name + 'APK file installed ok!!';
+2 -5
View File
@@ -1,6 +1,5 @@
<app-header></app-header>
<div class="app-container full-height">
<!--<app-side-menu></app-side-menu>-->
<app-content class="full-height"></app-content>
</div>
@@ -8,7 +7,7 @@
<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>
[ngStyle]="{'left':webService.isWebviewOpen?'0':'-100%'}" class="bsaber-webview" ></webview>
<mz-modal #getHelpModal [fixedFooter]="true">
<mz-modal-header>
@@ -20,9 +19,7 @@
{{helpStatus}}
</div>
<br>
<div class="green-text" *ngIf="extraHelpStatus" [innerHTML]="extraHelpStatus">
</div>
<div class="green-text" *ngIf="extraHelpStatus" [innerHTML]="extraHelpStatus"></div>
<br><br>
<div class="center-align">
<div class="btn pink-button waves-effect waves-light" (click)="statusService.copyStatus();statusService.showStatus('Copied to your clipboard!')">Copy To Clipboard</div><br><br>
+1 -50
View File
@@ -80,56 +80,6 @@ export class ElectronService {
break;
}
});
// let options = {
// url: 'https://api.sidequestvr.com/install-from-key',
// method: 'POST',
// headers: {
// Accept: 'application/json',
// 'Content-Type': 'application/json',
// Origin: 'https://sidequestvr.com',
// },
// rejectUnauthorized: !isDevMode(),
// json: { token: token },
// };
// // console.log(options);
// this.appService.request(options, async (error, response, body) => {
// // console.log(error, body);
// if (!error && body.data && body.data.apps && body.data.apps.length) {
// for (let i = 0; i < body.data.apps.length; i++) {
// let app = body.data.apps[i];
// if (Number(app.app_categories_id) === 1) {
// let urls = app.urls.filter(l => l && ~['Github Release', 'APK', 'OBB', 'Mod'].indexOf(l.provider));
// for (let i = 0; i < urls.length; i++) {
// if (urls[i].provider === 'Mod') {
// this.beatonService.downloadSong(urls[i].link_url, this.adbService);
// } else {
// const etx = urls[i].link_url
// .split('?')[0]
// .split('.')
// .pop()
// .toLowerCase();
// switch (etx) {
// case 'obb':
// await this.adbService.installObb(urls[i].link_url, i + 1, urls.length, app.name);
// break;
// default:
// await this.adbService.installAPK(
// urls[i].link_url,
// false,
// false,
// i + 1,
// urls.length,
// false,
// app.name
// );
// break;
// }
// }
// }
// }
// }
// }
// });
}
setupIPC() {
@@ -184,6 +134,7 @@ export class ElectronService {
break;
case 'sidequest://i/':
this.installFromToken(url[1]);
this.webviewService.isWebviewLoading = false;
break;
case 'sidequest://unload/':
this.adbService.uninstallAPK(url[1]);
@@ -286,9 +286,10 @@
height: 100%;
top: 0;
left: 0;
position: absolute;
position: fixed;
z-index: 998;
display:none;
background-color: rgba(0,0,0,0.8);
}
.user-menu{
position: absolute;
@@ -201,15 +201,15 @@
position="bottom" tooltip="Open debugger">
bug_report
</i>
<i (click)="minimizeApp()" mz-tooltip class="material-icons white-text no-outline" position="bottom"
<i (click)="minimizeApp(); userMenu.style.display = 'none';userMenuBack.style.display = 'none'" mz-tooltip class="material-icons white-text no-outline" position="bottom"
tooltip="Minimize SideQuest.">
minimize
</i>
<i (click)="maximizeApp()" mz-tooltip class="material-icons white-text no-outline" position="bottom"
<i (click)="maximizeApp(); userMenu.style.display = 'none';userMenuBack.style.display = 'none'" mz-tooltip class="material-icons white-text no-outline" position="bottom"
tooltip="Toggle Maximize.">
aspect_ratio
</i>
<i (click)="closeAppModal.openModal()" mz-tooltip class="material-icons white-text no-outline" position="bottom"
<i (click)="closeAppModal.openModal(); userMenu.style.display = 'none';userMenuBack.style.display = 'none'" mz-tooltip class="material-icons white-text no-outline" position="bottom"
tooltip="Close SideQuest.">
close
</i>
@@ -237,10 +237,6 @@ export class HeaderComponent implements OnInit {
}
);
}
ngAfterViewInit() {
//this.appService.setTitleEle(this.header.nativeElement);
//this.dragAndDropService.setupDragAndDrop(this.mainLogo.nativeElement);
}
closeApp() {
this.appService.remote.getCurrentWindow().close();
}
@@ -30,8 +30,8 @@
<div class="row">
<ng-container *ngFor="let package of myApps;">
<app-package-item *ngIf="!search
|| (package.name && package.name.indexOf(search)) > -1
|| package.packageName.indexOf(search) > -1" [package]="package"
|| (package.name && package.name.toLowerCase().indexOf(search.toLowerCase())) > -1
|| package.packageName.toLowerCase().indexOf(search.toLowerCase()) > -1" [package]="package"
(settings)="currentPackage = $event;appSettingsModal.openModal();getCurrentInstalledInfo()">
</app-package-item>
</ng-container>