freerasp-react-native 5.3.0 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +82 -0
- package/README.md +2 -0
- package/android/build.gradle +3 -3
- package/android/proguard-rules.pro +3 -3
- package/android/src/main/AndroidManifest.xml +1 -1
- package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/FreeraspReactNativeModule.kt +177 -17
- package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/FreeraspReactNativePackage.kt +1 -1
- package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/PluginThreatHandler.kt +20 -7
- package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/ScreenProtector.kt +1 -1
- package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/dispatchers/ExecutionStateDispatcher.kt +3 -3
- package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/dispatchers/ThreatDispatcher.kt +23 -3
- package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/events/BaseRaspEvent.kt +1 -1
- package/android/src/main/java/app/talsec/rasp/reactnative/events/RaspExecutionStateEvent.kt +22 -0
- package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/events/ThreatEvent.kt +6 -3
- package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/exceptions/TalsecException.kt +1 -1
- package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/interfaces/PluginExecutionStateListener.kt +2 -2
- package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/interfaces/PluginThreatListener.kt +4 -2
- package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/models/RNSuspiciousAppInfo.kt +1 -1
- package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/utils/Extensions.kt +4 -4
- package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/utils/RandomGenerator.kt +1 -1
- package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/utils/Utils.kt +1 -1
- package/ios/FreeraspReactNative.swift +17 -8
- package/ios/TalsecRuntime.xcframework/_CodeSignature/CodeDirectory +0 -0
- package/ios/TalsecRuntime.xcframework/_CodeSignature/CodeResources +88 -88
- package/ios/TalsecRuntime.xcframework/_CodeSignature/CodeSignature +0 -0
- package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/CurlWrapper.h +1 -1
- package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/TalsecRuntime-Swift.h +2 -2
- package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/curl.h +292 -265
- package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/curlver.h +10 -11
- package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/easy.h +4 -6
- package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/header.h +9 -9
- package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/multi.h +147 -112
- package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/options.h +1 -1
- package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/system.h +14 -23
- package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/typecheck-gcc.h +420 -403
- package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/urlapi.h +29 -28
- package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/websockets.h +10 -10
- package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Info.plist +0 -0
- package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.abi.json +563 -312
- package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.private.swiftinterface +10 -3
- package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.swiftinterface +10 -3
- package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/TalsecRuntime +0 -0
- package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/_CodeSignature/CodeResources +35 -35
- package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/cacert.pem +483 -1088
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/CurlWrapper.h +1 -1
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/TalsecRuntime-Swift.h +4 -4
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/curl.h +292 -265
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/curlver.h +10 -11
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/easy.h +4 -6
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/header.h +9 -9
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/multi.h +147 -112
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/options.h +1 -1
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/system.h +14 -23
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/typecheck-gcc.h +420 -403
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/urlapi.h +29 -28
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/websockets.h +10 -10
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Info.plist +0 -0
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.abi.json +548 -297
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +10 -3
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.swiftinterface +10 -3
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.abi.json +548 -297
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +10 -3
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +10 -3
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/TalsecRuntime +0 -0
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/_CodeSignature/CodeResources +43 -43
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/cacert.pem +483 -1088
- package/ios/TalsecRuntimePackage/Package.swift +2 -2
- package/ios/dispatchers/ExecutionStateDispatcher.swift +4 -3
- package/ios/models/RaspExecutionStates.swift +10 -3
- package/ios/utils/EventIdentifiers.swift +2 -2
- package/lib/commonjs/api/listeners/raspExecutionState.js +13 -7
- package/lib/commonjs/api/listeners/raspExecutionState.js.map +1 -1
- package/lib/commonjs/api/listeners/threat.js +19 -8
- package/lib/commonjs/api/listeners/threat.js.map +1 -1
- package/lib/commonjs/api/methods/internal.js +20 -0
- package/lib/commonjs/api/methods/internal.js.map +1 -0
- package/lib/commonjs/api/methods/native.js +113 -21
- package/lib/commonjs/api/methods/native.js.map +1 -1
- package/lib/commonjs/api/methods/reactNative.js +38 -10
- package/lib/commonjs/api/methods/reactNative.js.map +1 -1
- package/lib/commonjs/channels/raspExecutionState.js +3 -3
- package/lib/commonjs/channels/raspExecutionState.js.map +1 -1
- package/lib/commonjs/channels/threat.js +4 -4
- package/lib/commonjs/channels/threat.js.map +1 -1
- package/lib/commonjs/index.js +23 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/models/raspExecutionState.js +4 -2
- package/lib/commonjs/models/raspExecutionState.js.map +1 -1
- package/lib/commonjs/models/threat.js +2 -1
- package/lib/commonjs/models/threat.js.map +1 -1
- package/lib/commonjs/types/errors.js +50 -0
- package/lib/commonjs/types/errors.js.map +1 -0
- package/lib/commonjs/types/types.js +4 -0
- package/lib/module/api/listeners/raspExecutionState.js +10 -4
- package/lib/module/api/listeners/raspExecutionState.js.map +1 -1
- package/lib/module/api/listeners/threat.js +16 -5
- package/lib/module/api/listeners/threat.js.map +1 -1
- package/lib/module/api/methods/internal.js +13 -0
- package/lib/module/api/methods/internal.js.map +1 -0
- package/lib/module/api/methods/native.js +106 -17
- package/lib/module/api/methods/native.js.map +1 -1
- package/lib/module/api/methods/reactNative.js +39 -12
- package/lib/module/api/methods/reactNative.js.map +1 -1
- package/lib/module/channels/raspExecutionState.js +1 -1
- package/lib/module/channels/raspExecutionState.js.map +1 -1
- package/lib/module/channels/threat.js +2 -2
- package/lib/module/channels/threat.js.map +1 -1
- package/lib/module/index.js +2 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/models/raspExecutionState.js +4 -2
- package/lib/module/models/raspExecutionState.js.map +1 -1
- package/lib/module/models/threat.js +2 -1
- package/lib/module/models/threat.js.map +1 -1
- package/lib/module/types/errors.js +41 -0
- package/lib/module/types/errors.js.map +1 -0
- package/lib/module/types/types.js +1 -1
- package/lib/typescript/src/api/listeners/raspExecutionState.d.ts.map +1 -1
- package/lib/typescript/src/api/listeners/threat.d.ts.map +1 -1
- package/lib/typescript/src/api/methods/internal.d.ts +7 -0
- package/lib/typescript/src/api/methods/internal.d.ts.map +1 -0
- package/lib/typescript/src/api/methods/native.d.ts +56 -7
- package/lib/typescript/src/api/methods/native.d.ts.map +1 -1
- package/lib/typescript/src/api/methods/reactNative.d.ts +11 -2
- package/lib/typescript/src/api/methods/reactNative.d.ts.map +1 -1
- package/lib/typescript/src/channels/threat.d.ts +1 -0
- package/lib/typescript/src/channels/threat.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +2 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/models/raspExecutionState.d.ts +3 -1
- package/lib/typescript/src/models/raspExecutionState.d.ts.map +1 -1
- package/lib/typescript/src/models/threat.d.ts +1 -0
- package/lib/typescript/src/models/threat.d.ts.map +1 -1
- package/lib/typescript/src/types/errors.d.ts +26 -0
- package/lib/typescript/src/types/errors.d.ts.map +1 -0
- package/lib/typescript/src/types/types.d.ts +61 -26
- package/lib/typescript/src/types/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/api/listeners/raspExecutionState.ts +9 -3
- package/src/api/listeners/threat.ts +29 -5
- package/src/api/methods/internal.ts +13 -0
- package/src/api/methods/native.ts +125 -21
- package/src/api/methods/reactNative.ts +46 -16
- package/src/channels/raspExecutionState.ts +1 -1
- package/src/channels/threat.ts +3 -3
- package/src/index.tsx +2 -0
- package/src/models/raspExecutionState.ts +8 -2
- package/src/models/threat.ts +2 -0
- package/src/types/errors.ts +57 -0
- package/src/types/types.ts +66 -26
- package/android/src/main/java/com/freeraspreactnative/events/RaspExecutionStateEvent.kt +0 -18
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getRaspExecutionStateCount","itemsHaveType","FreeraspReactNative","onInvalidCallback","RaspExecutionState","getRaspExecutionStateIdentifiers","identifiers","length","getRaspExecutionStateChannelData","dataLength","data","prepareRaspExecutionStateMapping","newValues","threats","getValues","map","threat","index","value"],"sourceRoot":"../../../src","sources":["channels/raspExecutionState.ts"],"mappings":"AAAA,SAASA,0BAA0B,EAAEC,aAAa,QAAQ,gBAAgB;AAC1E,SAASC,mBAAmB,QAAQ,sBAAsB;AAC1D,SAASC,iBAAiB,QAAQ,
|
|
1
|
+
{"version":3,"names":["getRaspExecutionStateCount","itemsHaveType","FreeraspReactNative","onInvalidCallback","RaspExecutionState","getRaspExecutionStateIdentifiers","identifiers","length","getRaspExecutionStateChannelData","dataLength","data","prepareRaspExecutionStateMapping","newValues","threats","getValues","map","threat","index","value"],"sourceRoot":"../../../src","sources":["channels/raspExecutionState.ts"],"mappings":"AAAA,SAASA,0BAA0B,EAAEC,aAAa,QAAQ,gBAAgB;AAC1E,SAASC,mBAAmB,QAAQ,sBAAsB;AAC1D,SAASC,iBAAiB,QAAQ,yBAAyB;AAC3D,SAASC,kBAAkB,QAAQ,8BAA8B;AAEjE,OAAO,MAAMC,gCAAgC,GAAG,MAAAA,CAAA,KAA+B;EAC7E,MAAMC,WAAW,GACf,MAAMJ,mBAAmB,CAACG,gCAAgC,CAAC,CAAC;EAC9D,IACEC,WAAW,CAACC,MAAM,KAAKP,0BAA0B,CAAC,CAAC,IACnD,CAACC,aAAa,CAACK,WAAW,EAAE,QAAQ,CAAC,EACrC;IACAH,iBAAiB,CAAC,CAAC;EACrB;EACA,OAAOG,WAAW;AACpB,CAAC;AAED,OAAO,MAAME,gCAAgC,GAAG,MAAAA,CAAA,KAE3C;EACH,MAAMC,UAAU,GAAG,CAAC;EACpB,MAAMC,IAAI,GAAG,MAAMR,mBAAmB,CAACM,gCAAgC,CAAC,CAAC;EACzE,IAAIE,IAAI,CAACH,MAAM,KAAKE,UAAU,IAAI,CAACR,aAAa,CAACS,IAAI,EAAE,QAAQ,CAAC,EAAE;IAChEP,iBAAiB,CAAC,CAAC;EACrB;EACA,OAAOO,IAAI;AACb,CAAC;AAED,OAAO,MAAMC,gCAAgC,GAAG,MAAAA,CAAA,KAA2B;EACzE,MAAMC,SAAS,GAAG,MAAMP,gCAAgC,CAAC,CAAC;EAC1D,MAAMQ,OAAO,GAAGT,kBAAkB,CAACU,SAAS,CAAC,CAAC;EAC9CD,OAAO,CAACE,GAAG,CAAC,CAACC,MAAM,EAAEC,KAAK,KAAK;IAC7BD,MAAM,CAACE,KAAK,GAAGN,SAAS,CAACK,KAAK,CAAE;EAClC,CAAC,CAAC;AACJ,CAAC","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getThreatCount, itemsHaveType } from '../utils/utils';
|
|
2
2
|
import { FreeraspReactNative } from '../api/nativeModules';
|
|
3
3
|
import { Threat } from '../models/threat';
|
|
4
|
-
import { onInvalidCallback } from '../api/methods/
|
|
4
|
+
import { onInvalidCallback } from '../api/methods/internal';
|
|
5
5
|
export const getThreatIdentifiers = async () => {
|
|
6
6
|
const identifiers = await FreeraspReactNative.getThreatIdentifiers();
|
|
7
7
|
if (identifiers.length !== getThreatCount() || !itemsHaveType(identifiers, 'number')) {
|
|
@@ -11,7 +11,7 @@ export const getThreatIdentifiers = async () => {
|
|
|
11
11
|
};
|
|
12
12
|
export const getThreatChannelData = async () => {
|
|
13
13
|
const data = await FreeraspReactNative.getThreatChannelData();
|
|
14
|
-
if (data.length !==
|
|
14
|
+
if (data.length !== 4 || !itemsHaveType(data, 'string')) {
|
|
15
15
|
onInvalidCallback();
|
|
16
16
|
}
|
|
17
17
|
return data;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getThreatCount","itemsHaveType","FreeraspReactNative","Threat","onInvalidCallback","getThreatIdentifiers","identifiers","length","getThreatChannelData","data","prepareThreatMapping","newValues","threats","getValues","map","threat","index","value"],"sourceRoot":"../../../src","sources":["channels/threat.ts"],"mappings":"AAAA,SAASA,cAAc,EAAEC,aAAa,QAAQ,gBAAgB;AAC9D,SAASC,mBAAmB,QAAQ,sBAAsB;AAC1D,SAASC,MAAM,QAAQ,kBAAkB;AACzC,SAASC,iBAAiB,QAAQ,
|
|
1
|
+
{"version":3,"names":["getThreatCount","itemsHaveType","FreeraspReactNative","Threat","onInvalidCallback","getThreatIdentifiers","identifiers","length","getThreatChannelData","data","prepareThreatMapping","newValues","threats","getValues","map","threat","index","value"],"sourceRoot":"../../../src","sources":["channels/threat.ts"],"mappings":"AAAA,SAASA,cAAc,EAAEC,aAAa,QAAQ,gBAAgB;AAC9D,SAASC,mBAAmB,QAAQ,sBAAsB;AAC1D,SAASC,MAAM,QAAQ,kBAAkB;AACzC,SAASC,iBAAiB,QAAQ,yBAAyB;AAE3D,OAAO,MAAMC,oBAAoB,GAAG,MAAAA,CAAA,KAA+B;EACjE,MAAMC,WAAW,GAAG,MAAMJ,mBAAmB,CAACG,oBAAoB,CAAC,CAAC;EACpE,IACEC,WAAW,CAACC,MAAM,KAAKP,cAAc,CAAC,CAAC,IACvC,CAACC,aAAa,CAACK,WAAW,EAAE,QAAQ,CAAC,EACrC;IACAF,iBAAiB,CAAC,CAAC;EACrB;EACA,OAAOE,WAAW;AACpB,CAAC;AAED,OAAO,MAAME,oBAAoB,GAAG,MAAAA,CAAA,KAE/B;EACH,MAAMC,IAAI,GAAG,MAAMP,mBAAmB,CAACM,oBAAoB,CAAC,CAAC;EAC7D,IAAIC,IAAI,CAACF,MAAM,KAAK,CAAC,IAAI,CAACN,aAAa,CAACQ,IAAI,EAAE,QAAQ,CAAC,EAAE;IACvDL,iBAAiB,CAAC,CAAC;EACrB;EACA,OAAOK,IAAI;AACb,CAAC;AAED,OAAO,MAAMC,oBAAoB,GAAG,MAAAA,CAAA,KAA2B;EAC7D,MAAMC,SAAS,GAAG,MAAMN,oBAAoB,CAAC,CAAC;EAC9C,MAAMO,OAAO,GAAGT,MAAM,CAACU,SAAS,CAAC,CAAC;EAClCD,OAAO,CAACE,GAAG,CAAC,CAACC,MAAM,EAAEC,KAAK,KAAK;IAC7BD,MAAM,CAACE,KAAK,GAAGN,SAAS,CAACK,KAAK,CAAE;EAClC,CAAC,CAAC;AACJ,CAAC","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export * from './types/types';
|
|
2
|
+
export { TalsecError } from './types/errors';
|
|
2
3
|
export * from './api/methods/native';
|
|
3
4
|
export * from './api/methods/reactNative';
|
|
4
5
|
export * from './api/listeners/threat';
|
|
5
6
|
export * from './api/listeners/raspExecutionState';
|
|
7
|
+
export { onInvalidCallback as abortApp } from './api/methods/internal';
|
|
6
8
|
//# sourceMappingURL=index.js.map
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"AAAA,cAAc,eAAe;AAC7B,cAAc,sBAAsB;AACpC,cAAc,2BAA2B;AACzC,cAAc,wBAAwB;AACtC,cAAc,oCAAoC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["TalsecError","onInvalidCallback","abortApp"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"AAAA,cAAc,eAAe;AAC7B,SAASA,WAAW,QAA8B,gBAAgB;AAClE,cAAc,sBAAsB;AACpC,cAAc,2BAA2B;AACzC,cAAc,wBAAwB;AACtC,cAAc,oCAAoC;AAClD,SAASC,iBAAiB,IAAIC,QAAQ,QAAQ,wBAAwB","ignoreList":[]}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
export class RaspExecutionState {
|
|
2
|
-
static
|
|
2
|
+
static FastChecksFinished = new RaspExecutionState(0);
|
|
3
|
+
static CriticalChecksFinished = new RaspExecutionState(0);
|
|
4
|
+
static PostponedChecksFinished = new RaspExecutionState(0);
|
|
3
5
|
constructor(value) {
|
|
4
6
|
this.value = value;
|
|
5
7
|
}
|
|
6
8
|
static getValues() {
|
|
7
|
-
return [this.
|
|
9
|
+
return [this.FastChecksFinished, this.CriticalChecksFinished, this.PostponedChecksFinished];
|
|
8
10
|
}
|
|
9
11
|
}
|
|
10
12
|
//# sourceMappingURL=raspExecutionState.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["RaspExecutionState","
|
|
1
|
+
{"version":3,"names":["RaspExecutionState","FastChecksFinished","CriticalChecksFinished","PostponedChecksFinished","constructor","value","getValues"],"sourceRoot":"../../../src","sources":["models/raspExecutionState.ts"],"mappings":"AAAA,OAAO,MAAMA,kBAAkB,CAAC;EAG9B,OAAOC,kBAAkB,GAAG,IAAID,kBAAkB,CAAC,CAAC,CAAC;EACrD,OAAOE,sBAAsB,GAAG,IAAIF,kBAAkB,CAAC,CAAC,CAAC;EACzD,OAAOG,uBAAuB,GAAG,IAAIH,kBAAkB,CAAC,CAAC,CAAC;EAE1DI,WAAWA,CAACC,KAAa,EAAE;IACzB,IAAI,CAACA,KAAK,GAAGA,KAAK;EACpB;EAEA,OAAOC,SAASA,CAAA,EAAyB;IACvC,OAAO,CACL,IAAI,CAACL,kBAAkB,EACvB,IAAI,CAACC,sBAAsB,EAC3B,IAAI,CAACC,uBAAuB,CAC7B;EACH;AACF","ignoreList":[]}
|
|
@@ -23,11 +23,12 @@ export class Threat {
|
|
|
23
23
|
static UnsecureWifi = new Threat(0);
|
|
24
24
|
static Automation = new Threat(0);
|
|
25
25
|
static Bootloader = new Threat(0);
|
|
26
|
+
static OngoingCall = new Threat(0);
|
|
26
27
|
constructor(value) {
|
|
27
28
|
this.value = value;
|
|
28
29
|
}
|
|
29
30
|
static getValues() {
|
|
30
|
-
return Platform.OS === 'android' ? [this.AppIntegrity, this.PrivilegedAccess, this.Debug, this.Hooks, this.Passcode, this.Simulator, this.SecureHardwareNotAvailable, this.SystemVPN, this.DeviceBinding, this.UnofficialStore, this.ObfuscationIssues, this.DevMode, this.Malware, this.ADBEnabled, this.Screenshot, this.ScreenRecording, this.MultiInstance, this.TimeSpoofing, this.LocationSpoofing, this.UnsecureWifi, this.Automation, this.Bootloader] : [this.AppIntegrity, this.PrivilegedAccess, this.Debug, this.Hooks, this.Passcode, this.Simulator, this.SecureHardwareNotAvailable, this.SystemVPN, this.DeviceBinding, this.DeviceID, this.UnofficialStore, this.Screenshot, this.ScreenRecording, this.TimeSpoofing];
|
|
31
|
+
return Platform.OS === 'android' ? [this.AppIntegrity, this.PrivilegedAccess, this.Debug, this.Hooks, this.Passcode, this.Simulator, this.SecureHardwareNotAvailable, this.SystemVPN, this.DeviceBinding, this.UnofficialStore, this.ObfuscationIssues, this.DevMode, this.Malware, this.ADBEnabled, this.Screenshot, this.ScreenRecording, this.MultiInstance, this.TimeSpoofing, this.LocationSpoofing, this.UnsecureWifi, this.Automation, this.Bootloader, this.OngoingCall] : [this.AppIntegrity, this.PrivilegedAccess, this.Debug, this.Hooks, this.Passcode, this.Simulator, this.SecureHardwareNotAvailable, this.SystemVPN, this.DeviceBinding, this.DeviceID, this.UnofficialStore, this.Screenshot, this.ScreenRecording, this.TimeSpoofing];
|
|
31
32
|
}
|
|
32
33
|
}
|
|
33
34
|
//# sourceMappingURL=threat.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Platform","Threat","AppIntegrity","PrivilegedAccess","Debug","Hooks","Passcode","Simulator","SecureHardwareNotAvailable","SystemVPN","DeviceBinding","DeviceID","UnofficialStore","ObfuscationIssues","DevMode","Malware","ADBEnabled","Screenshot","ScreenRecording","MultiInstance","TimeSpoofing","LocationSpoofing","UnsecureWifi","Automation","Bootloader","constructor","value","getValues","OS"],"sourceRoot":"../../../src","sources":["models/threat.ts"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,cAAc;AAEvC,OAAO,MAAMC,MAAM,CAAC;EAGlB,OAAOC,YAAY,GAAG,IAAID,MAAM,CAAC,CAAC,CAAC;EACnC,OAAOE,gBAAgB,GAAG,IAAIF,MAAM,CAAC,CAAC,CAAC;EACvC,OAAOG,KAAK,GAAG,IAAIH,MAAM,CAAC,CAAC,CAAC;EAC5B,OAAOI,KAAK,GAAG,IAAIJ,MAAM,CAAC,CAAC,CAAC;EAC5B,OAAOK,QAAQ,GAAG,IAAIL,MAAM,CAAC,CAAC,CAAC;EAC/B,OAAOM,SAAS,GAAG,IAAIN,MAAM,CAAC,CAAC,CAAC;EAChC,OAAOO,0BAA0B,GAAG,IAAIP,MAAM,CAAC,CAAC,CAAC;EACjD,OAAOQ,SAAS,GAAG,IAAIR,MAAM,CAAC,CAAC,CAAC;EAChC,OAAOS,aAAa,GAAG,IAAIT,MAAM,CAAC,CAAC,CAAC;EACpC,OAAOU,QAAQ,GAAG,IAAIV,MAAM,CAAC,CAAC,CAAC;EAC/B,OAAOW,eAAe,GAAG,IAAIX,MAAM,CAAC,CAAC,CAAC;EACtC,OAAOY,iBAAiB,GAAG,IAAIZ,MAAM,CAAC,CAAC,CAAC;EACxC,OAAOa,OAAO,GAAG,IAAIb,MAAM,CAAC,CAAC,CAAC;EAC9B,OAAOc,OAAO,GAAG,IAAId,MAAM,CAAC,CAAC,CAAC;EAC9B,OAAOe,UAAU,GAAG,IAAIf,MAAM,CAAC,CAAC,CAAC;EACjC,OAAOgB,UAAU,GAAG,IAAIhB,MAAM,CAAC,CAAC,CAAC;EACjC,OAAOiB,eAAe,GAAG,IAAIjB,MAAM,CAAC,CAAC,CAAC;EACtC,OAAOkB,aAAa,GAAG,IAAIlB,MAAM,CAAC,CAAC,CAAC;EACpC,OAAOmB,YAAY,GAAG,IAAInB,MAAM,CAAC,CAAC,CAAC;EACnC,OAAOoB,gBAAgB,GAAG,IAAIpB,MAAM,CAAC,CAAC,CAAC;EACvC,OAAOqB,YAAY,GAAG,IAAIrB,MAAM,CAAC,CAAC,CAAC;EACnC,OAAOsB,UAAU,GAAG,IAAItB,MAAM,CAAC,CAAC,CAAC;EACjC,OAAOuB,UAAU,GAAG,IAAIvB,MAAM,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"names":["Platform","Threat","AppIntegrity","PrivilegedAccess","Debug","Hooks","Passcode","Simulator","SecureHardwareNotAvailable","SystemVPN","DeviceBinding","DeviceID","UnofficialStore","ObfuscationIssues","DevMode","Malware","ADBEnabled","Screenshot","ScreenRecording","MultiInstance","TimeSpoofing","LocationSpoofing","UnsecureWifi","Automation","Bootloader","OngoingCall","constructor","value","getValues","OS"],"sourceRoot":"../../../src","sources":["models/threat.ts"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,cAAc;AAEvC,OAAO,MAAMC,MAAM,CAAC;EAGlB,OAAOC,YAAY,GAAG,IAAID,MAAM,CAAC,CAAC,CAAC;EACnC,OAAOE,gBAAgB,GAAG,IAAIF,MAAM,CAAC,CAAC,CAAC;EACvC,OAAOG,KAAK,GAAG,IAAIH,MAAM,CAAC,CAAC,CAAC;EAC5B,OAAOI,KAAK,GAAG,IAAIJ,MAAM,CAAC,CAAC,CAAC;EAC5B,OAAOK,QAAQ,GAAG,IAAIL,MAAM,CAAC,CAAC,CAAC;EAC/B,OAAOM,SAAS,GAAG,IAAIN,MAAM,CAAC,CAAC,CAAC;EAChC,OAAOO,0BAA0B,GAAG,IAAIP,MAAM,CAAC,CAAC,CAAC;EACjD,OAAOQ,SAAS,GAAG,IAAIR,MAAM,CAAC,CAAC,CAAC;EAChC,OAAOS,aAAa,GAAG,IAAIT,MAAM,CAAC,CAAC,C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AACC,SAAS,EACd,IAAI,CAACC,aAAa,EAClB,IAAI,CAACE,eAAe,EACpB,IAAI,CAACC,iBAAiB,EACtB,IAAI,CAACC,OAAO,EACZ,IAAI,CAACC,OAAO,EACZ,IAAI,CAACC,UAAU,EACf,IAAI,CAACC,UAAU,EACf,IAAI,CAACC,eAAe,EACpB,IAAI,CAACC,aAAa,EAClB,IAAI,CAACC,YAAY,EACjB,IAAI,CAACC,gBAAgB,EACrB,IAAI,CAACC,YAAY,EACjB,IAAI,CAACC,UAAU,EACf,IAAI,CAACC,UAAU,EACf,IAAI,CAACC,WAAW,CACjB,GACD,CACE,IAAI,CAACvB,YAAY,EACjB,IAAI,CAACC,gBAAgB,EACrB,IAAI,CAACC,KAAK,EACV,IAAI,CAACC,KAAK,EACV,IAAI,CAACC,QAAQ,EACb,IAAI,CAACC,SAAS,EACd,IAAI,CAACC,0BAA0B,EAC/B,IAAI,CAACC,SAAS,EACd,IAAI,CAACC,aAAa,EAClB,IAAI,CAACC,QAAQ,EACb,IAAI,CAACC,eAAe,EACpB,IAAI,CAACK,UAAU,EACf,IAAI,CAACC,eAAe,EACpB,IAAI,CAACE,YAAY,CAClB;EACP;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stable error codes shared with the other freeRASP plugins.
|
|
3
|
+
*
|
|
4
|
+
* - `talsec-failure` - a native call failed
|
|
5
|
+
* - `unsupported-platform` - the feature is not available on this platform
|
|
6
|
+
* - `configuration-exception` - the configuration is invalid
|
|
7
|
+
* - `external-id-failure` - storing or removing the external ID failed
|
|
8
|
+
* - `malware-failure` - a malware-detection call failed
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The only error freeRASP methods reject with.
|
|
13
|
+
*/
|
|
14
|
+
export class TalsecError extends Error {
|
|
15
|
+
constructor(code, message) {
|
|
16
|
+
super(message);
|
|
17
|
+
this.name = 'TalsecError';
|
|
18
|
+
this.code = code;
|
|
19
|
+
Object.setPrototypeOf(this, TalsecError.prototype);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Runs a native call and rethrows any failure as a {@link TalsecError}.
|
|
25
|
+
*/
|
|
26
|
+
export const wrapNative = async (code, fn) => {
|
|
27
|
+
try {
|
|
28
|
+
return await fn();
|
|
29
|
+
} catch (e) {
|
|
30
|
+
if (e instanceof TalsecError) {
|
|
31
|
+
throw e;
|
|
32
|
+
}
|
|
33
|
+
throw new TalsecError(code, (e === null || e === void 0 ? void 0 : e.message) ?? String(e));
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Rejects with an `unsupported-platform` error for Android-only features.
|
|
39
|
+
*/
|
|
40
|
+
export const androidOnly = feature => Promise.reject(new TalsecError('unsupported-platform', `${feature} is not available on iOS`));
|
|
41
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["TalsecError","Error","constructor","code","message","name","Object","setPrototypeOf","prototype","wrapNative","fn","e","String","androidOnly","feature","Promise","reject"],"sourceRoot":"../../../src","sources":["types/errors.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA;AACA;AACA;AACA,OAAO,MAAMA,WAAW,SAASC,KAAK,CAAC;EAGrCC,WAAWA,CAACC,IAAqB,EAAEC,OAAgB,EAAE;IACnD,KAAK,CAACA,OAAO,CAAC;IACd,IAAI,CAACC,IAAI,GAAG,aAAa;IACzB,IAAI,CAACF,IAAI,GAAGA,IAAI;IAChBG,MAAM,CAACC,cAAc,CAAC,IAAI,EAAEP,WAAW,CAACQ,SAAS,CAAC;EACpD;AACF;;AAEA;AACA;AACA;AACA,OAAO,MAAMC,UAAU,GAAG,MAAAA,CACxBN,IAAqB,EACrBO,EAAoB,KACL;EACf,IAAI;IACF,OAAO,MAAMA,EAAE,CAAC,CAAC;EACnB,CAAC,CAAC,OAAOC,CAAM,EAAE;IACf,IAAIA,CAAC,YAAYX,WAAW,EAAE;MAC5B,MAAMW,CAAC;IACT;IACA,MAAM,IAAIX,WAAW,CAACG,IAAI,EAAE,CAAAQ,CAAC,aAADA,CAAC,uBAADA,CAAC,CAAEP,OAAO,KAAIQ,MAAM,CAACD,CAAC,CAAC,CAAC;EACtD;AACF,CAAC;;AAED;AACA;AACA;AACA,OAAO,MAAME,WAAW,GAAIC,OAAe,IACzCC,OAAO,CAACC,MAAM,CACZ,IAAIhB,WAAW,CACb,sBAAsB,EACrB,GAAEc,OAAQ,0BACb,CACF,CAAC","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
export {};
|
|
2
2
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"raspExecutionState.d.ts","sourceRoot":"","sources":["../../../../../src/api/listeners/raspExecutionState.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAEV,8BAA8B,EAC/B,MAAM,mBAAmB,CAAC;AAe3B,eAAO,MAAM,6BAA6B,WAChC,8BAA8B,
|
|
1
|
+
{"version":3,"file":"raspExecutionState.d.ts","sourceRoot":"","sources":["../../../../../src/api/listeners/raspExecutionState.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAEV,8BAA8B,EAC/B,MAAM,mBAAmB,CAAC;AAe3B,eAAO,MAAM,6BAA6B,WAChC,8BAA8B,kBA2CvC,CAAC;AAEF,eAAO,MAAM,qCAAqC,QACtC,QAAQ,IAAI,CAOrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"threat.d.ts","sourceRoot":"","sources":["../../../../../src/api/listeners/threat.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"threat.d.ts","sourceRoot":"","sources":["../../../../../src/api/listeners/threat.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAGV,kBAAkB,EACnB,MAAM,mBAAmB,CAAC;AAuB3B,eAAO,MAAM,kBAAkB,WAAkB,kBAAkB,kBAsHlE,CAAC;AAEF,eAAO,MAAM,oBAAoB,QAAa,QAAQ,IAAI,CAOzD,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Terminates the app. Called when the native side sends data that freeRASP
|
|
3
|
+
* never sends, which indicates tampering. Exported publicly as `abortApp`.
|
|
4
|
+
*/
|
|
5
|
+
export declare const onInvalidCallback: () => void;
|
|
6
|
+
export declare const removeListenerForEvent: (channel: string) => Promise<string>;
|
|
7
|
+
//# sourceMappingURL=internal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../../../src/api/methods/internal.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,eAAO,MAAM,iBAAiB,QAAO,IAEpC,CAAC;AAEF,eAAO,MAAM,sBAAsB,YAAa,MAAM,KAAG,QAAQ,MAAM,CAEtE,CAAC"}
|
|
@@ -1,11 +1,60 @@
|
|
|
1
1
|
import type { TalsecConfig } from '../../types/types';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Starts freeRASP. Prefer the `useFreeRasp` hook, which also registers the
|
|
4
|
+
* listeners.
|
|
5
|
+
*/
|
|
6
|
+
export declare const talsecStart: (options: TalsecConfig) => Promise<void>;
|
|
7
|
+
/**
|
|
8
|
+
* Android only. Adds an app to the malware whitelist so it is not reported.
|
|
9
|
+
*/
|
|
10
|
+
export declare const addToWhitelist: (packageName: string) => Promise<void>;
|
|
11
|
+
/**
|
|
12
|
+
* Blocks or unblocks screenshots and screen recording of the app screen.
|
|
13
|
+
*/
|
|
14
|
+
export declare const blockScreenCapture: (enable: boolean) => Promise<void>;
|
|
15
|
+
/**
|
|
16
|
+
* Returns whether screen capture is blocked for the current screen.
|
|
17
|
+
*/
|
|
5
18
|
export declare const isScreenCaptureBlocked: () => Promise<boolean>;
|
|
6
|
-
|
|
7
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Android only. Prevents accessibility services from reading or controlling
|
|
21
|
+
* the app screen.
|
|
22
|
+
*/
|
|
23
|
+
export declare const blockScreenControl: (enable: boolean) => Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
* Android only. Returns whether screen control is blocked.
|
|
26
|
+
*/
|
|
27
|
+
export declare const isScreenControlBlocked: () => Promise<boolean>;
|
|
28
|
+
/**
|
|
29
|
+
* Android only. Hides overlay windows of other apps over the app screen.
|
|
30
|
+
* Requires Android 12+ and the `HIDE_OVERLAY_WINDOWS` permission.
|
|
31
|
+
*
|
|
32
|
+
* @returns whether the request was applied
|
|
33
|
+
*/
|
|
34
|
+
export declare const blockOverlayWindows: (enable: boolean) => Promise<boolean>;
|
|
35
|
+
/**
|
|
36
|
+
* Android only. Returns whether overlay windows of other apps are hidden.
|
|
37
|
+
*/
|
|
38
|
+
export declare const isOverlayWindowsBlocked: () => Promise<boolean>;
|
|
39
|
+
/**
|
|
40
|
+
* Android only. Starts the ongoing call (cellular and VoIP) detection.
|
|
41
|
+
* Call states are reported through the `ongoingCall` threat action.
|
|
42
|
+
*/
|
|
43
|
+
export declare const startOngoingCallDetection: () => Promise<void>;
|
|
44
|
+
/**
|
|
45
|
+
* Android only. Stops the ongoing call detection.
|
|
46
|
+
*/
|
|
47
|
+
export declare const stopOngoingCallDetection: () => Promise<void>;
|
|
48
|
+
/**
|
|
49
|
+
* Stores an external ID sent with freeRASP logs.
|
|
50
|
+
*/
|
|
51
|
+
export declare const storeExternalId: (data: string) => Promise<void>;
|
|
52
|
+
/**
|
|
53
|
+
* Removes the stored external ID.
|
|
54
|
+
*/
|
|
55
|
+
export declare const removeExternalId: () => Promise<void>;
|
|
56
|
+
/**
|
|
57
|
+
* Android only. Returns the icon of the given app as a base64-encoded PNG.
|
|
58
|
+
*/
|
|
8
59
|
export declare const getAppIcon: (packageName: string) => Promise<string>;
|
|
9
|
-
export declare const onInvalidCallback: () => void;
|
|
10
|
-
export declare const removeListenerForEvent: (channel: string) => Promise<string>;
|
|
11
60
|
//# sourceMappingURL=native.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native.d.ts","sourceRoot":"","sources":["../../../../../src/api/methods/native.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"native.d.ts","sourceRoot":"","sources":["../../../../../src/api/methods/native.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAItD;;;GAGG;AACH,eAAO,MAAM,WAAW,YAAmB,YAAY,KAAG,QAAQ,IAAI,CAIrE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,gBAAuB,MAAM,KAAG,QAAQ,IAAI,CAOtE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,WAAkB,OAAO,KAAG,QAAQ,IAAI,CAItE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,sBAAsB,QAAO,QAAQ,OAAO,CAIxD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,WAAkB,OAAO,KAAG,QAAQ,IAAI,CAOtE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,sBAAsB,QAAO,QAAQ,OAAO,CAOxD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,WAAY,OAAO,KAAG,QAAQ,OAAO,CAOpE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,uBAAuB,QAAO,QAAQ,OAAO,CAOzD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,yBAAyB,QAAa,QAAQ,IAAI,CAO9D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wBAAwB,QAAa,QAAQ,IAAI,CAO7D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,SAAgB,MAAM,KAAG,QAAQ,IAAI,CAIhE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,QAAa,QAAQ,IAAI,CAIrD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,gBAAiB,MAAM,KAAG,QAAQ,MAAM,CAO9D,CAAC"}
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
-
import type { ThreatEventActions, TalsecConfig, RaspExecutionStateEventActions } from '../../types/types';
|
|
2
|
-
|
|
1
|
+
import type { ThreatEventActions, TalsecConfig, RaspExecutionStateEventActions, FreeRaspStatus } from '../../types/types';
|
|
2
|
+
/**
|
|
3
|
+
* Registers the threat and RASP execution state listeners and starts freeRASP.
|
|
4
|
+
*
|
|
5
|
+
* freeRASP is started only once per app run; later mounts only re-register
|
|
6
|
+
* the listeners.
|
|
7
|
+
*
|
|
8
|
+
* @returns `started` once freeRASP runs, or the `TalsecError` that prevented
|
|
9
|
+
* the listeners from being registered or freeRASP from starting.
|
|
10
|
+
*/
|
|
11
|
+
export declare const useFreeRasp: (config: TalsecConfig, actions: ThreatEventActions, raspExecutionStateActions?: RaspExecutionStateEventActions) => FreeRaspStatus;
|
|
3
12
|
//# sourceMappingURL=reactNative.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactNative.d.ts","sourceRoot":"","sources":["../../../../../src/api/methods/reactNative.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,kBAAkB,EAClB,YAAY,EACZ,8BAA8B,
|
|
1
|
+
{"version":3,"file":"reactNative.d.ts","sourceRoot":"","sources":["../../../../../src/api/methods/reactNative.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,kBAAkB,EAClB,YAAY,EACZ,8BAA8B,EAC9B,cAAc,EACf,MAAM,mBAAmB,CAAC;AAa3B;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW,WACd,YAAY,WACX,kBAAkB,8BACC,8BAA8B,KACzD,cA0CF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"threat.d.ts","sourceRoot":"","sources":["../../../../src/channels/threat.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,oBAAoB,QAAa,QAAQ,MAAM,EAAE,CAS7D,CAAC;AAEF,eAAO,MAAM,oBAAoB,QAAa,QAC5C;IAAC,MAAM;IAAE,MAAM;IAAE,MAAM;CAAC,
|
|
1
|
+
{"version":3,"file":"threat.d.ts","sourceRoot":"","sources":["../../../../src/channels/threat.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,oBAAoB,QAAa,QAAQ,MAAM,EAAE,CAS7D,CAAC;AAEF,eAAO,MAAM,oBAAoB,QAAa,QAC5C;IAAC,MAAM;IAAE,MAAM;IAAE,MAAM;IAAE,MAAM;CAAC,CAOjC,CAAC;AAEF,eAAO,MAAM,oBAAoB,QAAa,QAAQ,IAAI,CAMzD,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export * from './types/types';
|
|
2
|
+
export { TalsecError, type TalsecErrorCode } from './types/errors';
|
|
2
3
|
export * from './api/methods/native';
|
|
3
4
|
export * from './api/methods/reactNative';
|
|
4
5
|
export * from './api/listeners/threat';
|
|
5
6
|
export * from './api/listeners/raspExecutionState';
|
|
7
|
+
export { onInvalidCallback as abortApp } from './api/methods/internal';
|
|
6
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,oCAAoC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACnE,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,oCAAoC,CAAC;AACnD,OAAO,EAAE,iBAAiB,IAAI,QAAQ,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export declare class RaspExecutionState {
|
|
2
2
|
value: number;
|
|
3
|
-
static
|
|
3
|
+
static FastChecksFinished: RaspExecutionState;
|
|
4
|
+
static CriticalChecksFinished: RaspExecutionState;
|
|
5
|
+
static PostponedChecksFinished: RaspExecutionState;
|
|
4
6
|
constructor(value: number);
|
|
5
7
|
static getValues(): RaspExecutionState[];
|
|
6
8
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"raspExecutionState.d.ts","sourceRoot":"","sources":["../../../../src/models/raspExecutionState.ts"],"names":[],"mappings":"AAAA,qBAAa,kBAAkB;IAC7B,KAAK,EAAE,MAAM,CAAC;IAEd,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"raspExecutionState.d.ts","sourceRoot":"","sources":["../../../../src/models/raspExecutionState.ts"],"names":[],"mappings":"AAAA,qBAAa,kBAAkB;IAC7B,KAAK,EAAE,MAAM,CAAC;IAEd,MAAM,CAAC,kBAAkB,qBAA6B;IACtD,MAAM,CAAC,sBAAsB,qBAA6B;IAC1D,MAAM,CAAC,uBAAuB,qBAA6B;gBAE/C,KAAK,EAAE,MAAM;IAIzB,MAAM,CAAC,SAAS,IAAI,kBAAkB,EAAE;CAOzC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"threat.d.ts","sourceRoot":"","sources":["../../../../src/models/threat.ts"],"names":[],"mappings":"AAEA,qBAAa,MAAM;IACjB,KAAK,EAAE,MAAM,CAAC;IAEd,MAAM,CAAC,YAAY,SAAiB;IACpC,MAAM,CAAC,gBAAgB,SAAiB;IACxC,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C,OAAO,SAAiB;IAC/B,MAAM,CAAC,UAAU,SAAiB;IAClC,MAAM,CAAC,UAAU,SAAiB;IAClC,MAAM,CAAC,eAAe,SAAiB;IACvC,MAAM,CAAC,aAAa,SAAiB;IACrC,MAAM,CAAC,YAAY,SAAiB;IACpC,MAAM,CAAC,gBAAgB,SAAiB;IACxC,MAAM,CAAC,YAAY,SAAiB;IACpC,MAAM,CAAC,UAAU,SAAiB;IAClC,MAAM,CAAC,UAAU,SAAiB;IAClC,MAAM,CAAC,WAAW,SAAiB;gBAEvB,KAAK,EAAE,MAAM;IAIzB,MAAM,CAAC,SAAS,IAAI,MAAM,EAAE;CA4C7B"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stable error codes shared with the other freeRASP plugins.
|
|
3
|
+
*
|
|
4
|
+
* - `talsec-failure` - a native call failed
|
|
5
|
+
* - `unsupported-platform` - the feature is not available on this platform
|
|
6
|
+
* - `configuration-exception` - the configuration is invalid
|
|
7
|
+
* - `external-id-failure` - storing or removing the external ID failed
|
|
8
|
+
* - `malware-failure` - a malware-detection call failed
|
|
9
|
+
*/
|
|
10
|
+
export type TalsecErrorCode = 'talsec-failure' | 'unsupported-platform' | 'configuration-exception' | 'external-id-failure' | 'malware-failure';
|
|
11
|
+
/**
|
|
12
|
+
* The only error freeRASP methods reject with.
|
|
13
|
+
*/
|
|
14
|
+
export declare class TalsecError extends Error {
|
|
15
|
+
readonly code: TalsecErrorCode;
|
|
16
|
+
constructor(code: TalsecErrorCode, message?: string);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Runs a native call and rethrows any failure as a {@link TalsecError}.
|
|
20
|
+
*/
|
|
21
|
+
export declare const wrapNative: <T>(code: TalsecErrorCode, fn: () => Promise<T>) => Promise<T>;
|
|
22
|
+
/**
|
|
23
|
+
* Rejects with an `unsupported-platform` error for Android-only features.
|
|
24
|
+
*/
|
|
25
|
+
export declare const androidOnly: (feature: string) => Promise<never>;
|
|
26
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../src/types/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,MAAM,eAAe,GACvB,gBAAgB,GAChB,sBAAsB,GACtB,yBAAyB,GACzB,qBAAqB,GACrB,iBAAiB,CAAC;AAEtB;;GAEG;AACH,qBAAa,WAAY,SAAQ,KAAK;IACpC,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;gBAEnB,IAAI,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,MAAM;CAMpD;AAED;;GAEG;AACH,eAAO,MAAM,UAAU,YACf,eAAe,MACjB,MAAM,QAAQ,CAAC,CAAC,KACnB,QAAQ,CAAC,CASX,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,YAAa,MAAM,KAAG,QAAQ,KAAK,CAMxD,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { TalsecError } from './errors';
|
|
1
2
|
export type TalsecConfig = {
|
|
2
3
|
androidConfig?: TalsecAndroidConfig;
|
|
3
4
|
iosConfig?: TalsecIosConfig;
|
|
@@ -26,7 +27,7 @@ export type TalsecAndroidConfig = {
|
|
|
26
27
|
suspiciousAppDetectionConfig?: SuspiciousAppDetectionConfig;
|
|
27
28
|
};
|
|
28
29
|
export type TalsecIosConfig = {
|
|
29
|
-
|
|
30
|
+
appBundleIds: string[];
|
|
30
31
|
appTeamId: string;
|
|
31
32
|
};
|
|
32
33
|
export type SuspiciousAppInfo = {
|
|
@@ -41,35 +42,69 @@ export type PackageInfo = {
|
|
|
41
42
|
appIcon?: string;
|
|
42
43
|
installerStore?: string;
|
|
43
44
|
};
|
|
45
|
+
/**
|
|
46
|
+
* State of an ongoing call reported by the ongoing call detection.
|
|
47
|
+
*
|
|
48
|
+
* - `STARTED` - a call started while the detection was running
|
|
49
|
+
* - `ONGOING` - a call was already in progress when the detection started
|
|
50
|
+
* - `STOPPED` - a previously reported call has ended
|
|
51
|
+
*/
|
|
52
|
+
export type CallState = 'STARTED' | 'ONGOING' | 'STOPPED';
|
|
44
53
|
export type ThreatEventActions = {
|
|
45
|
-
privilegedAccess?: () =>
|
|
46
|
-
debug?: () =>
|
|
47
|
-
simulator?: () =>
|
|
48
|
-
appIntegrity?: () =>
|
|
49
|
-
unofficialStore?: () =>
|
|
50
|
-
hooks?: () =>
|
|
51
|
-
deviceBinding?: () =>
|
|
52
|
-
deviceID?: () =>
|
|
53
|
-
passcode?: () =>
|
|
54
|
-
secureHardwareNotAvailable?: () =>
|
|
55
|
-
obfuscationIssues?: () =>
|
|
56
|
-
devMode?: () =>
|
|
57
|
-
systemVPN?: () =>
|
|
58
|
-
malware?: (suspiciousApps: SuspiciousAppInfo[]) =>
|
|
59
|
-
adbEnabled?: () =>
|
|
60
|
-
screenshot?: () =>
|
|
61
|
-
screenRecording?: () =>
|
|
62
|
-
multiInstance?: () =>
|
|
63
|
-
timeSpoofing?: () =>
|
|
64
|
-
locationSpoofing?: () =>
|
|
65
|
-
unsecureWifi?: () =>
|
|
66
|
-
automation?: () =>
|
|
67
|
-
bootloader?: () =>
|
|
54
|
+
privilegedAccess?: () => void;
|
|
55
|
+
debug?: () => void;
|
|
56
|
+
simulator?: () => void;
|
|
57
|
+
appIntegrity?: () => void;
|
|
58
|
+
unofficialStore?: () => void;
|
|
59
|
+
hooks?: () => void;
|
|
60
|
+
deviceBinding?: () => void;
|
|
61
|
+
deviceID?: () => void;
|
|
62
|
+
passcode?: () => void;
|
|
63
|
+
secureHardwareNotAvailable?: () => void;
|
|
64
|
+
obfuscationIssues?: () => void;
|
|
65
|
+
devMode?: () => void;
|
|
66
|
+
systemVPN?: () => void;
|
|
67
|
+
malware?: (suspiciousApps: SuspiciousAppInfo[]) => void;
|
|
68
|
+
adbEnabled?: () => void;
|
|
69
|
+
screenshot?: () => void;
|
|
70
|
+
screenRecording?: () => void;
|
|
71
|
+
multiInstance?: () => void;
|
|
72
|
+
timeSpoofing?: () => void;
|
|
73
|
+
locationSpoofing?: () => void;
|
|
74
|
+
unsecureWifi?: () => void;
|
|
75
|
+
automation?: () => void;
|
|
76
|
+
bootloader?: () => void;
|
|
77
|
+
/**
|
|
78
|
+
* Android only. Requires `startOngoingCallDetection()`.
|
|
79
|
+
*/
|
|
80
|
+
ongoingCall?: (state: CallState) => void;
|
|
68
81
|
};
|
|
69
82
|
export type NativeEvent = {
|
|
70
|
-
[key: string]: number | string[] | undefined;
|
|
83
|
+
[key: string]: number | string | string[] | undefined;
|
|
71
84
|
};
|
|
72
85
|
export type RaspExecutionStateEventActions = {
|
|
73
|
-
|
|
86
|
+
/**
|
|
87
|
+
* The fast (standard) checks have been completed. The postponed checks may
|
|
88
|
+
* still run afterwards.
|
|
89
|
+
*/
|
|
90
|
+
fastChecksFinished?: () => void;
|
|
91
|
+
/**
|
|
92
|
+
* The critical checks have been completed, before the non-critical checks.
|
|
93
|
+
*/
|
|
94
|
+
criticalChecksFinished?: () => void;
|
|
95
|
+
/**
|
|
96
|
+
* The postponed checks have been completed, which ends the initial
|
|
97
|
+
* evaluation.
|
|
98
|
+
*/
|
|
99
|
+
postponedChecksFinished?: () => void;
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* State returned by `useFreeRasp`.
|
|
103
|
+
*/
|
|
104
|
+
export type FreeRaspStatus = {
|
|
105
|
+
/** `true` once freeRASP has been started. */
|
|
106
|
+
started: boolean;
|
|
107
|
+
/** Error that prevented the listeners from being registered or freeRASP from starting. */
|
|
108
|
+
error: TalsecError | null;
|
|
74
109
|
};
|
|
75
110
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG;IACzB,aAAa,CAAC,EAAE,mBAAmB,CAAC;IACpC,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xB;;OAEG;IACH,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC;CACvD,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG;IAC3C;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;IAChC;;OAEG;IACH,sBAAsB,CAAC,EAAE,MAAM,IAAI,CAAC;IACpC;;;OAGG;IACH,uBAAuB,CAAC,EAAE,MAAM,IAAI,CAAC;CACtC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,6CAA6C;IAC7C,OAAO,EAAE,OAAO,CAAC;IACjB,0FAA0F;IAC1F,KAAK,EAAE,WAAW,GAAG,IAAI,CAAC;CAC3B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "freerasp-react-native",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.1.0",
|
|
4
4
|
"description": "React Native plugin for improving app security and threat monitoring on Android and iOS mobile devices.",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NativeEventEmitter, type EmitterSubscription } from 'react-native';
|
|
2
2
|
import { FreeraspReactNative } from '../nativeModules';
|
|
3
|
-
import { onInvalidCallback, removeListenerForEvent } from '../methods/
|
|
3
|
+
import { onInvalidCallback, removeListenerForEvent } from '../methods/internal';
|
|
4
4
|
import type {
|
|
5
5
|
NativeEvent,
|
|
6
6
|
RaspExecutionStateEventActions,
|
|
@@ -47,8 +47,14 @@ export const setRaspExecutionStateListener = async (
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
switch (event[executionStateKey]) {
|
|
50
|
-
case RaspExecutionState.
|
|
51
|
-
config.
|
|
50
|
+
case RaspExecutionState.FastChecksFinished.value:
|
|
51
|
+
config.fastChecksFinished?.();
|
|
52
|
+
break;
|
|
53
|
+
case RaspExecutionState.CriticalChecksFinished.value:
|
|
54
|
+
config.criticalChecksFinished?.();
|
|
55
|
+
break;
|
|
56
|
+
case RaspExecutionState.PostponedChecksFinished.value:
|
|
57
|
+
config.postponedChecksFinished?.();
|
|
52
58
|
break;
|
|
53
59
|
default:
|
|
54
60
|
onInvalidCallback();
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { NativeEventEmitter, type EmitterSubscription } from 'react-native';
|
|
2
2
|
import { FreeraspReactNative } from '../nativeModules';
|
|
3
|
-
import { onInvalidCallback, removeListenerForEvent } from '../methods/
|
|
3
|
+
import { onInvalidCallback, removeListenerForEvent } from '../methods/internal';
|
|
4
4
|
import { Threat } from '../../models/threat';
|
|
5
|
-
import type {
|
|
5
|
+
import type {
|
|
6
|
+
CallState,
|
|
7
|
+
NativeEvent,
|
|
8
|
+
ThreatEventActions,
|
|
9
|
+
} from '../../types/types';
|
|
6
10
|
import { parseMalwareData } from '../../utils/malware';
|
|
7
11
|
import {
|
|
8
12
|
getThreatChannelData,
|
|
@@ -15,6 +19,12 @@ let eventsListener: EmitterSubscription | null = null;
|
|
|
15
19
|
let threatChannel: string | null = null;
|
|
16
20
|
let threatKey: string | null = null;
|
|
17
21
|
let threatMalwareKey: string | null = null;
|
|
22
|
+
let threatCallStateKey: string | null = null;
|
|
23
|
+
|
|
24
|
+
const callStates: readonly string[] = ['STARTED', 'ONGOING', 'STOPPED'];
|
|
25
|
+
|
|
26
|
+
const isCallState = (value: unknown): value is CallState =>
|
|
27
|
+
typeof value === 'string' && callStates.includes(value);
|
|
18
28
|
|
|
19
29
|
let isMappingPrepared = false;
|
|
20
30
|
let isInitializing = false;
|
|
@@ -28,8 +38,14 @@ export const setThreatListeners = async (config: ThreatEventActions) => {
|
|
|
28
38
|
|
|
29
39
|
await removeThreatListener();
|
|
30
40
|
|
|
31
|
-
if (
|
|
32
|
-
|
|
41
|
+
if (
|
|
42
|
+
!threatChannel ||
|
|
43
|
+
!threatKey ||
|
|
44
|
+
!threatMalwareKey ||
|
|
45
|
+
!threatCallStateKey
|
|
46
|
+
) {
|
|
47
|
+
[threatChannel, threatKey, threatMalwareKey, threatCallStateKey] =
|
|
48
|
+
await getThreatChannelData();
|
|
33
49
|
}
|
|
34
50
|
|
|
35
51
|
if (!isMappingPrepared) {
|
|
@@ -38,7 +54,7 @@ export const setThreatListeners = async (config: ThreatEventActions) => {
|
|
|
38
54
|
}
|
|
39
55
|
|
|
40
56
|
const listener = async (event: NativeEvent) => {
|
|
41
|
-
if (!threatKey || !threatMalwareKey) {
|
|
57
|
+
if (!threatKey || !threatMalwareKey || !threatCallStateKey) {
|
|
42
58
|
onInvalidCallback();
|
|
43
59
|
return;
|
|
44
60
|
}
|
|
@@ -116,6 +132,14 @@ export const setThreatListeners = async (config: ThreatEventActions) => {
|
|
|
116
132
|
case Threat.Bootloader.value:
|
|
117
133
|
config.bootloader?.();
|
|
118
134
|
break;
|
|
135
|
+
case Threat.OngoingCall.value:
|
|
136
|
+
const callState = event[threatCallStateKey];
|
|
137
|
+
if (!isCallState(callState)) {
|
|
138
|
+
onInvalidCallback();
|
|
139
|
+
break;
|
|
140
|
+
}
|
|
141
|
+
config.ongoingCall?.(callState);
|
|
142
|
+
break;
|
|
119
143
|
default:
|
|
120
144
|
onInvalidCallback();
|
|
121
145
|
break;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FreeraspReactNative } from '../nativeModules';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Terminates the app. Called when the native side sends data that freeRASP
|
|
5
|
+
* never sends, which indicates tampering. Exported publicly as `abortApp`.
|
|
6
|
+
*/
|
|
7
|
+
export const onInvalidCallback = (): void => {
|
|
8
|
+
FreeraspReactNative.onInvalidCallback();
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const removeListenerForEvent = (channel: string): Promise<string> => {
|
|
12
|
+
return FreeraspReactNative.removeListenerForEvent(channel);
|
|
13
|
+
};
|