-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathnative.ts
More file actions
48 lines (39 loc) · 1.56 KB
/
Copy pathnative.ts
File metadata and controls
48 lines (39 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import { Platform } from 'react-native';
import { FreeraspReactNative } from '../nativeModules';
import type { TalsecConfig } from '../../types/types';
import { normalizeConfig } from '../../utils/config';
export const talsecStart = async (options: TalsecConfig): Promise<string> => {
return FreeraspReactNative.talsecStart(normalizeConfig(options));
};
export const addToWhitelist = async (packageName: string): Promise<boolean> => {
if (Platform.OS === 'ios') {
return Promise.reject('Malware detection not available on iOS');
}
return FreeraspReactNative.addToWhitelist(packageName);
};
export const blockScreenCapture = (enable: boolean): Promise<string> => {
return FreeraspReactNative.blockScreenCapture(enable);
};
export const isScreenCaptureBlocked = (): Promise<boolean> => {
return FreeraspReactNative.isScreenCaptureBlocked();
};
export const storeExternalId = (data: string): Promise<string> => {
return FreeraspReactNative.storeExternalId(data);
};
export const removeExternalId = (): Promise<string> => {
return FreeraspReactNative.removeExternalId();
};
export const getAppIcon = (packageName: string): Promise<string> => {
if (Platform.OS === 'ios') {
return Promise.reject(
'App icon retrieval for Malware detection not available on iOS'
);
}
return FreeraspReactNative.getAppIcon(packageName);
};
export const onInvalidCallback = (): void => {
FreeraspReactNative.onInvalidCallback();
};
export const removeListenerForEvent = (channel: string): Promise<string> => {
return FreeraspReactNative.removeListenerForEvent(channel);
};