react-native-malwarelytics
Version:
Malwarelytics for React Native protects your banking or fintech app from a broad range of mobile security threats with an industry-leading mobile threat intelligence solution.
137 lines • 5.77 kB
TypeScript
import { EventHelper } from "./internal/EventHelper";
import { SmartProtectionResult } from "./model/antivirus/SmartProtectionResult";
import { ApkThreat, ThreatIndex } from "./model/antivirus/ApkThreat";
import { ApkInfo } from "./model/antivirus/Apk";
import { ObservedUpdateInfo } from "./model/antivirus/update/ObservedUpdateInfo";
import { UpdateInfo } from "./model/antivirus/update/UpdateInfo";
/**
* The `MalwarelyticsAntivirus` class provides antivirus functionality from Malwarelytics for Android SDK.
* Be aware that you must evaluate whether the funcionality is supported on the platform, by getting
* `isSupported` property. All other methods from the class fails with error if antivirus is not supported
* on the platform.
*/
export declare class MalwarelyticsAntivirus {
constructor(eventHelper: EventHelper);
/**
* Determine whether the Antivirus module is supported on the platform.
*/
readonly isSupported: boolean;
/**
* Instance of EventHelper shared with Malwarelytics class.
*/
private readonly eventHelper;
/**
* Instance of native module interface.
*/
private readonly module?;
/**
* Object representing a subscription to update events.
*/
private updateEventSubscription;
/**
* Object representing a subscription to apk threat events.
*/
private apkThreatEventSubscription;
/**
* Test whether antivirus is enabled.
*/
isEnabled(): Promise<boolean>;
/**
* Set custom localization to be used when a UI is shown.
* This overrides system settings. Use ISO 639-1 language code or `undefined`.
* Undefined value will reset the custom setting and the system settings will be used again
*/
setCustomLocalization(languageCode: string | undefined): Promise<void>;
/**
* Get custom localization currently in use by antivirus.
*/
getCustomLocalization(): Promise<string | undefined>;
/**
* Schedules a job that will execute smart protection run. Note that this is asynchronous and
* can take some time.
*
* Note that you can call this function with multiple times, but you'll get the result once the internal
* evaluation is finished.
*
* @param performOnlineUpdate Optional argument to indicate that online update is not desired. If false only local data will be used.
*/
triggerSmartProtection(performOnlineUpdate?: boolean): Promise<SmartProtectionResult>;
/**
* Get information whether smart protection evaluation is already running.
*/
isSmartProtectionTriggered(): Promise<boolean>;
/**
* Returns list of all applications with the malware evaluation.
*/
getThreatList(): Promise<ApkThreat[]>;
/**
* Returns list of all applications with the malware evaluation higher or equal than specified.
* @param minThreatIndex Minimal threat index.
* @returns List of all applications with the malware evaluation higher or equal than specified.
*/
getFilteredThreatList(minThreatIndex: ThreatIndex): Promise<ApkThreat[]>;
/**
* Gets more information for the package name of the application.
*
* @param packageName Package name of the application
* @returns Information about package or `undefined` when no such information is available.
*/
getApkInfo(packageName: string): Promise<ApkInfo | undefined>;
/**
* Get information about the last updates.
*
* Primarily intended for troubleshooting.
*
* @returns Information about latest update successes and failures.
*/
getLastUpdateInfo(): Promise<UpdateInfo>;
/** Set listener that is triggered when a suggestion update completes. */
setUpdateListener(listener: MalwarelyticsAndroidUpdateListener): Promise<void>;
/** Remove listener for suggestion updates. */
removeUpdateListener(): void;
/** Set listener that is triggered whan an app is installed/updated/uninstall. */
setApkThreatListener(listener: MalwarelyticsAndroidApkThreatListener): Promise<void>;
/** Remove listgener for app installs/updates/uninstall. */
removeApkThreatListener(): void;
/**
* Execute closure with action with properly acquired instnace to native module.
* @param action Action to execute.
* @returns Result returned from the action.
*/
private withModule;
}
/** Listener for update results. */
export interface MalwarelyticsAndroidUpdateListener {
/**
* Called when an update was finished regardless of a success or a failure.
*
* Returned data indicated the update result:
* - Successful update:
* @see ObservedUpdateInfo.failureReason is null
* - Partially successful update:
* @see ObservedUpdateInfo.failureReason is not null
* and @see ObservedUpdateInfo.updatedApps is not empty
* - Failed update:
* and @see ObservedUpdateInfo.failureReason is not null
* and @see ObservedUpdateInfo.updatedApps is empty */
onSuggestionUpdated(observedUpdateInfo: ObservedUpdateInfo): void;
}
/** Listener for updates to the apps on the device. */
export interface MalwarelyticsAndroidApkThreatListener {
/**
* Called whan an app install is detected.
* @param apkThread The new threat.
*/
onInstallDetected(apkThreat: ApkThreat): void;
/**
* Called when an app update is detected.
* @param apkThread The changed threat.
*/
onUpdateDetected(apkThreat: ApkThreat): void;
/**
* Called when an app uninstall is detected.
* @param packageName The package name of the deleted threat.
*/
onUninstallDetected(packageName: string): void;
}
//# sourceMappingURL=MalwarelyticsAntivirus.d.ts.map