cordova-talsec-plugin-freerasp
Version:
Cordova plugin for improving app security and threat monitoring on Android and iOS mobile devices.
44 lines (37 loc) • 1.19 kB
text/typescript
import { Component, Input, OnInit } from '@angular/core';
import { SuspiciousAppInfo, Talsec } from 'cordova-talsec-plugin-freerasp';
declare var talsec: Talsec;
({
selector: 'app-malware-item',
templateUrl: './malware-item.component.html',
styleUrls: ['./malware-item.component.css', '../../../theme/variables.css'],
})
export class MalwareItemComponent implements OnInit {
() susApp!: SuspiciousAppInfo;
expanded = false;
ngOnInit(): void {
this.loadAppIcon();
}
async loadAppIcon(): Promise<void> {
this.susApp.packageInfo.appIcon = await talsec.getAppIcon(
this.susApp.packageInfo.packageName,
);
}
toggleExpanded() {
this.expanded = !this.expanded;
}
async appUninstall() {
alert('Implement yourself!');
}
async whitelistApp(packageName: string) {
try {
const whitelistResponse = await talsec.addToWhitelist(packageName);
console.info(
`Malware Whitelist response for ${this.susApp}: ${whitelistResponse}`,
);
alert('Restart app for whitelist to take effect');
} catch (error) {
console.info('Error while adding app to malware whitelist: ', error);
}
}
}