freerasp-react-native 1.0.0 → 1.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/LICENSE +20 -20
- package/README.md +442 -413
- package/android/build.gradle +87 -87
- package/android/gradle.properties +4 -4
- package/android/src/main/AndroidManifest.xml +4 -4
- package/android/src/main/java/com/freeraspreactnative/FreeraspDeviceStateListener.kt +25 -0
- package/android/src/main/java/com/freeraspreactnative/FreeraspReactNativeModule.kt +113 -108
- package/android/src/main/java/com/freeraspreactnative/FreeraspReactNativePackage.kt +17 -17
- package/example/Gemfile +6 -6
- package/example/android/app/_BUCK +55 -55
- package/example/android/app/build.gradle +313 -313
- package/example/android/app/build_defs.bzl +19 -19
- package/example/android/app/proguard-rules.pro +10 -10
- package/example/android/app/src/debug/AndroidManifest.xml +13 -13
- package/example/android/app/src/debug/java/com/freeraspreactnativeexample/ReactNativeFlipper.java +73 -73
- package/example/android/app/src/main/AndroidManifest.xml +26 -26
- package/example/android/app/src/main/java/com/freeraspreactnativeexample/MainActivity.java +48 -48
- package/example/android/app/src/main/java/com/freeraspreactnativeexample/MainApplication.java +91 -91
- package/example/android/app/src/main/java/com/freeraspreactnativeexample/newarchitecture/MainApplicationReactNativeHost.java +116 -116
- package/example/android/app/src/main/java/com/freeraspreactnativeexample/newarchitecture/components/MainComponentsRegistry.java +36 -36
- package/example/android/app/src/main/java/com/freeraspreactnativeexample/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java +48 -48
- package/example/android/app/src/main/jni/CMakeLists.txt +7 -7
- package/example/android/app/src/main/jni/MainApplicationModuleProvider.cpp +32 -32
- package/example/android/app/src/main/jni/MainApplicationModuleProvider.h +16 -16
- package/example/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp +45 -45
- package/example/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h +38 -38
- package/example/android/app/src/main/jni/MainComponentsRegistry.cpp +65 -65
- package/example/android/app/src/main/jni/MainComponentsRegistry.h +32 -32
- package/example/android/app/src/main/jni/OnLoad.cpp +11 -11
- package/example/android/app/src/main/res/drawable/rn_edit_text_material.xml +36 -36
- package/example/android/app/src/main/res/values/strings.xml +3 -3
- package/example/android/app/src/main/res/values/styles.xml +9 -9
- package/example/android/build.gradle +53 -53
- package/example/android/gradle/wrapper/gradle-wrapper.properties +5 -5
- package/example/android/gradle.properties +40 -40
- package/example/android/gradlew +234 -234
- package/example/android/settings.gradle +11 -11
- package/example/app.json +3 -3
- package/example/assets/checkmark-circle-outline.png +0 -0
- package/example/assets/checkmark-circle-outline.svg +1 -0
- package/example/assets/close-circle-outline.png +0 -0
- package/example/assets/close-circle-outline.svg +1 -0
- package/example/assets/talsec-logo.png +0 -0
- package/example/babel.config.js +17 -17
- package/example/index.js +5 -5
- package/example/ios/File.swift +6 -6
- package/example/ios/FreeraspReactNativeExample/AppDelegate.h +8 -8
- package/example/ios/FreeraspReactNativeExample/AppDelegate.mm +133 -133
- package/example/ios/FreeraspReactNativeExample/Images.xcassets/AppIcon.appiconset/Contents.json +53 -53
- package/example/ios/FreeraspReactNativeExample/Images.xcassets/Contents.json +6 -6
- package/example/ios/FreeraspReactNativeExample/Info.plist +55 -55
- package/example/ios/FreeraspReactNativeExample/LaunchScreen.storyboard +47 -47
- package/example/ios/FreeraspReactNativeExample/main.m +10 -10
- package/example/ios/FreeraspReactNativeExample-Bridging-Header.h +3 -3
- package/example/ios/FreeraspReactNativeExample.xcodeproj/xcshareddata/xcschemes/FreeraspReactNativeExample.xcscheme +106 -106
- package/example/ios/FreeraspReactNativeExample.xcworkspace/contents.xcworkspacedata +10 -10
- package/example/ios/FreeraspReactNativeExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -8
- package/example/ios/FreeraspReactNativeExampleTests/FreeraspReactNativeExampleTests.m +66 -66
- package/example/ios/FreeraspReactNativeExampleTests/Info.plist +24 -24
- package/example/ios/Podfile +43 -43
- package/example/ios/Podfile.lock +590 -584
- package/example/metro.config.js +40 -40
- package/example/package.json +24 -21
- package/example/react-native.config.js +10 -10
- package/example/src/App.tsx +135 -89
- package/example/src/DemoApp.tsx +89 -0
- package/example/src/checks.ts +16 -0
- package/example/src/styles.ts +7 -0
- package/example/yarn.lock +4644 -4154
- package/freerasp-react-native.podspec +36 -36
- package/ios/Debug/TalsecRuntime.xcframework/Info.plist +40 -40
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/CryptoBridgingHeader.h +14 -14
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/CurlWrapper.h +25 -25
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/TalsecRuntime-Swift.h +222 -222
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/TalsecRuntime_iOS.h +23 -23
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/curl.h +3029 -3029
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/curlver.h +77 -77
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/easy.h +123 -123
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/mprintf.h +50 -50
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/multi.h +456 -456
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/options.h +68 -68
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/stdcheaders.h +33 -33
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/system.h +504 -504
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/urlapi.h +125 -125
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.swiftinterface +51 -51
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/module.modulemap +17 -17
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/TalsecRuntime +0 -0
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/cacert.pem +3154 -3154
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/module.modulemap +12 -12
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/CryptoBridgingHeader.h +14 -14
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/CurlWrapper.h +25 -25
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/TalsecRuntime-Swift.h +450 -450
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/TalsecRuntime_iOS.h +23 -23
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/curl.h +3029 -3029
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/curlver.h +77 -77
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/easy.h +123 -123
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/mprintf.h +50 -50
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/multi.h +456 -456
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/options.h +68 -68
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/stdcheaders.h +33 -33
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/system.h +504 -504
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/urlapi.h +125 -125
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.swiftinterface +51 -51
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +51 -51
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/module.modulemap +17 -17
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/TalsecRuntime +0 -0
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/_CodeSignature/CodeResources +344 -344
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/cacert.pem +3154 -3154
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/module.modulemap +12 -12
- package/ios/FreeraspReactNative-Bridging-Header.h +3 -3
- package/ios/FreeraspReactNative.m +14 -14
- package/ios/FreeraspReactNative.swift +57 -53
- package/ios/FreeraspReactNative.xcodeproj/xcshareddata/xcschemes/FreeraspReactNative.xcscheme +67 -67
- package/ios/Release/TalsecRuntime.xcframework/Info.plist +40 -40
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/CryptoBridgingHeader.h +14 -14
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/CurlWrapper.h +25 -25
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/TalsecRuntime-Swift.h +222 -222
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/TalsecRuntime_iOS.h +23 -23
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/curl.h +3029 -3029
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/curlver.h +77 -77
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/easy.h +123 -123
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/mprintf.h +50 -50
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/multi.h +456 -456
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/options.h +68 -68
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/stdcheaders.h +33 -33
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/system.h +504 -504
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/urlapi.h +125 -125
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.swiftinterface +51 -51
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/module.modulemap +17 -17
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/TalsecRuntime +0 -0
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/cacert.pem +3154 -3154
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/module.modulemap +12 -12
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/CryptoBridgingHeader.h +14 -14
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/CurlWrapper.h +25 -25
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/TalsecRuntime-Swift.h +450 -450
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/TalsecRuntime_iOS.h +23 -23
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/curl.h +3029 -3029
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/curlver.h +77 -77
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/easy.h +123 -123
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/mprintf.h +50 -50
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/multi.h +456 -456
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/options.h +68 -68
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/stdcheaders.h +33 -33
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/system.h +504 -504
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/urlapi.h +125 -125
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.swiftinterface +51 -51
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +51 -51
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/module.modulemap +17 -17
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/TalsecRuntime +0 -0
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/_CodeSignature/CodeResources +344 -344
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/cacert.pem +3154 -3154
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/module.modulemap +12 -12
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/index.d.ts +35 -35
- package/lib/typescript/index.d.ts.map +1 -1
- package/package.json +161 -161
- package/src/index.tsx +90 -90
- package/ios/TalsecRuntime.xcframework +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
framework module TalsecRuntime {
|
|
2
|
-
umbrella header "TalsecRuntime_iOS.h"
|
|
3
|
-
|
|
4
|
-
export *
|
|
5
|
-
module * { export * }
|
|
6
|
-
|
|
7
|
-
explicit module Private {
|
|
8
|
-
private header "CryptoBridgingHeader.h"
|
|
9
|
-
private header "CurlWrapper.h"
|
|
10
|
-
export *
|
|
11
|
-
}
|
|
12
|
-
}
|
|
1
|
+
framework module TalsecRuntime {
|
|
2
|
+
umbrella header "TalsecRuntime_iOS.h"
|
|
3
|
+
|
|
4
|
+
export *
|
|
5
|
+
module * { export * }
|
|
6
|
+
|
|
7
|
+
explicit module Private {
|
|
8
|
+
private header "CryptoBridgingHeader.h"
|
|
9
|
+
private header "CurlWrapper.h"
|
|
10
|
+
export *
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
#import <React/RCTBridgeModule.h>
|
|
2
|
-
#import <React/RCTViewManager.h>
|
|
3
|
-
#import <React/RCTEventEmitter.h>
|
|
1
|
+
#import <React/RCTBridgeModule.h>
|
|
2
|
+
#import <React/RCTViewManager.h>
|
|
3
|
+
#import <React/RCTEventEmitter.h>
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
#import <React/RCTBridgeModule.h>
|
|
2
|
-
#import <React/RCTViewManager.h>
|
|
3
|
-
#import <React/RCTEventEmitter.h>
|
|
4
|
-
|
|
5
|
-
@interface RCT_EXTERN_MODULE(FreeraspReactNative, RCTEventEmitter)
|
|
6
|
-
|
|
7
|
-
RCT_EXTERN_METHOD(talsecStart:(NSDictionary*)options)
|
|
8
|
-
|
|
9
|
-
+ (BOOL)requiresMainQueueSetup
|
|
10
|
-
{
|
|
11
|
-
return NO;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
@end
|
|
1
|
+
#import <React/RCTBridgeModule.h>
|
|
2
|
+
#import <React/RCTViewManager.h>
|
|
3
|
+
#import <React/RCTEventEmitter.h>
|
|
4
|
+
|
|
5
|
+
@interface RCT_EXTERN_MODULE(FreeraspReactNative, RCTEventEmitter)
|
|
6
|
+
|
|
7
|
+
RCT_EXTERN_METHOD(talsecStart:(NSDictionary*)options)
|
|
8
|
+
|
|
9
|
+
+ (BOOL)requiresMainQueueSetup
|
|
10
|
+
{
|
|
11
|
+
return NO;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@end
|
|
@@ -1,53 +1,57 @@
|
|
|
1
|
-
import Foundation
|
|
2
|
-
import TalsecRuntime
|
|
3
|
-
|
|
4
|
-
@objc(FreeraspReactNative)
|
|
5
|
-
class FreeraspReactNative: RCTEventEmitter {
|
|
6
|
-
|
|
7
|
-
public static var shared:FreeraspReactNative?
|
|
8
|
-
|
|
9
|
-
override init() {
|
|
10
|
-
super.init()
|
|
11
|
-
FreeraspReactNative.shared = self
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
@objc(talsecStart:)
|
|
15
|
-
func talsecStart(options: NSDictionary) -> Void {
|
|
16
|
-
do {
|
|
17
|
-
try initializeTalsec(talsecConfig: options)
|
|
18
|
-
}
|
|
19
|
-
catch let error as NSError {
|
|
20
|
-
self.sendEvent(withName: "initializationError", body: error.localizedDescription)
|
|
21
|
-
return
|
|
22
|
-
}
|
|
23
|
-
self.sendEvent(withName: "started", body: "started")
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
func initializeTalsec(talsecConfig: NSDictionary) throws {
|
|
27
|
-
guard let iosConfig = talsecConfig["iosConfig"] as? NSDictionary else {
|
|
28
|
-
throw NSError(domain: "Missing iosConfig parameter in Talsec Native Plugin", code: 1)
|
|
29
|
-
}
|
|
30
|
-
guard let appBundleIds = iosConfig["appBundleId"] as? String else {
|
|
31
|
-
throw NSError(domain: "Missing appBundleId parameter in Talsec Native Plugin", code: 2)
|
|
32
|
-
}
|
|
33
|
-
guard let appTeamId = iosConfig["appTeamId"] as? String else {
|
|
34
|
-
throw NSError(domain: "Missing appTeamId parameter in Talsec Native Plugin", code: 3)
|
|
35
|
-
}
|
|
36
|
-
guard let watcherMailAddress = talsecConfig["watcherMail"] as? String else {
|
|
37
|
-
throw NSError(domain: "Missing watcherMail parameter in Talsec Native Plugin", code: 4)
|
|
38
|
-
}
|
|
39
|
-
let config = TalsecConfig(appBundleIds: [appBundleIds], appTeamId: appTeamId, watcherMailAddress: watcherMailAddress)
|
|
40
|
-
Talsec.start(config: config)
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
override func supportedEvents() -> [String]! {
|
|
44
|
-
return ["initializationError", "started", "privilegedAccess", "debug", "simulator", "appIntegrity", "unofficialStore", "hooks", "device binding", "deviceID", "
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
extension SecurityThreatCenter: SecurityThreatHandler {
|
|
49
|
-
public func threatDetected(_ securityThreat: TalsecRuntime.SecurityThreat) {
|
|
50
|
-
// It is better to implement security reactions (e.g. killing the app) here.
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
1
|
+
import Foundation
|
|
2
|
+
import TalsecRuntime
|
|
3
|
+
|
|
4
|
+
@objc(FreeraspReactNative)
|
|
5
|
+
class FreeraspReactNative: RCTEventEmitter {
|
|
6
|
+
|
|
7
|
+
public static var shared:FreeraspReactNative?
|
|
8
|
+
|
|
9
|
+
override init() {
|
|
10
|
+
super.init()
|
|
11
|
+
FreeraspReactNative.shared = self
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@objc(talsecStart:)
|
|
15
|
+
func talsecStart(options: NSDictionary) -> Void {
|
|
16
|
+
do {
|
|
17
|
+
try initializeTalsec(talsecConfig: options)
|
|
18
|
+
}
|
|
19
|
+
catch let error as NSError {
|
|
20
|
+
self.sendEvent(withName: "initializationError", body: error.localizedDescription)
|
|
21
|
+
return
|
|
22
|
+
}
|
|
23
|
+
self.sendEvent(withName: "started", body: "started")
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
func initializeTalsec(talsecConfig: NSDictionary) throws {
|
|
27
|
+
guard let iosConfig = talsecConfig["iosConfig"] as? NSDictionary else {
|
|
28
|
+
throw NSError(domain: "Missing iosConfig parameter in Talsec Native Plugin", code: 1)
|
|
29
|
+
}
|
|
30
|
+
guard let appBundleIds = iosConfig["appBundleId"] as? String else {
|
|
31
|
+
throw NSError(domain: "Missing appBundleId parameter in Talsec Native Plugin", code: 2)
|
|
32
|
+
}
|
|
33
|
+
guard let appTeamId = iosConfig["appTeamId"] as? String else {
|
|
34
|
+
throw NSError(domain: "Missing appTeamId parameter in Talsec Native Plugin", code: 3)
|
|
35
|
+
}
|
|
36
|
+
guard let watcherMailAddress = talsecConfig["watcherMail"] as? String else {
|
|
37
|
+
throw NSError(domain: "Missing watcherMail parameter in Talsec Native Plugin", code: 4)
|
|
38
|
+
}
|
|
39
|
+
let config = TalsecConfig(appBundleIds: [appBundleIds], appTeamId: appTeamId, watcherMailAddress: watcherMailAddress)
|
|
40
|
+
Talsec.start(config: config)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
override func supportedEvents() -> [String]! {
|
|
44
|
+
return ["initializationError", "started", "privilegedAccess", "debug", "simulator", "appIntegrity", "unofficialStore", "hooks", "device binding", "deviceID", "secureHardwareNotAvailable", "passcodeChange", "passcode"]
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
extension SecurityThreatCenter: SecurityThreatHandler {
|
|
49
|
+
public func threatDetected(_ securityThreat: TalsecRuntime.SecurityThreat) {
|
|
50
|
+
// It is better to implement security reactions (e.g. killing the app) here.
|
|
51
|
+
if (securityThreat.rawValue == "missingSecureEnclave") {
|
|
52
|
+
FreeraspReactNative.shared!.sendEvent(withName: "secureHardwareNotAvailable", body: "secureHardwareNotAvailable")
|
|
53
|
+
} else {
|
|
54
|
+
FreeraspReactNative.shared!.sendEvent(withName: securityThreat.rawValue, body: securityThreat.rawValue)
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
package/ios/FreeraspReactNative.xcodeproj/xcshareddata/xcschemes/FreeraspReactNative.xcscheme
CHANGED
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<Scheme
|
|
3
|
-
LastUpgradeVersion = "1340"
|
|
4
|
-
version = "1.3">
|
|
5
|
-
<BuildAction
|
|
6
|
-
parallelizeBuildables = "YES"
|
|
7
|
-
buildImplicitDependencies = "YES">
|
|
8
|
-
<BuildActionEntries>
|
|
9
|
-
<BuildActionEntry
|
|
10
|
-
buildForTesting = "YES"
|
|
11
|
-
buildForRunning = "YES"
|
|
12
|
-
buildForProfiling = "YES"
|
|
13
|
-
buildForArchiving = "YES"
|
|
14
|
-
buildForAnalyzing = "YES">
|
|
15
|
-
<BuildableReference
|
|
16
|
-
BuildableIdentifier = "primary"
|
|
17
|
-
BlueprintIdentifier = "58B511DA1A9E6C8500147676"
|
|
18
|
-
BuildableName = "libFreeraspReactNative.a"
|
|
19
|
-
BlueprintName = "FreeraspReactNative"
|
|
20
|
-
ReferencedContainer = "container:FreeraspReactNative.xcodeproj">
|
|
21
|
-
</BuildableReference>
|
|
22
|
-
</BuildActionEntry>
|
|
23
|
-
</BuildActionEntries>
|
|
24
|
-
</BuildAction>
|
|
25
|
-
<TestAction
|
|
26
|
-
buildConfiguration = "Debug"
|
|
27
|
-
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
|
28
|
-
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
|
29
|
-
shouldUseLaunchSchemeArgsEnv = "YES">
|
|
30
|
-
<Testables>
|
|
31
|
-
</Testables>
|
|
32
|
-
</TestAction>
|
|
33
|
-
<LaunchAction
|
|
34
|
-
buildConfiguration = "Debug"
|
|
35
|
-
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
|
36
|
-
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
|
37
|
-
launchStyle = "0"
|
|
38
|
-
useCustomWorkingDirectory = "NO"
|
|
39
|
-
ignoresPersistentStateOnLaunch = "NO"
|
|
40
|
-
debugDocumentVersioning = "YES"
|
|
41
|
-
debugServiceExtension = "internal"
|
|
42
|
-
allowLocationSimulation = "YES">
|
|
43
|
-
</LaunchAction>
|
|
44
|
-
<ProfileAction
|
|
45
|
-
buildConfiguration = "Release"
|
|
46
|
-
shouldUseLaunchSchemeArgsEnv = "YES"
|
|
47
|
-
savedToolIdentifier = ""
|
|
48
|
-
useCustomWorkingDirectory = "NO"
|
|
49
|
-
debugDocumentVersioning = "YES">
|
|
50
|
-
<MacroExpansion>
|
|
51
|
-
<BuildableReference
|
|
52
|
-
BuildableIdentifier = "primary"
|
|
53
|
-
BlueprintIdentifier = "58B511DA1A9E6C8500147676"
|
|
54
|
-
BuildableName = "libFreeraspReactNative.a"
|
|
55
|
-
BlueprintName = "FreeraspReactNative"
|
|
56
|
-
ReferencedContainer = "container:FreeraspReactNative.xcodeproj">
|
|
57
|
-
</BuildableReference>
|
|
58
|
-
</MacroExpansion>
|
|
59
|
-
</ProfileAction>
|
|
60
|
-
<AnalyzeAction
|
|
61
|
-
buildConfiguration = "Debug">
|
|
62
|
-
</AnalyzeAction>
|
|
63
|
-
<ArchiveAction
|
|
64
|
-
buildConfiguration = "Release"
|
|
65
|
-
revealArchiveInOrganizer = "YES">
|
|
66
|
-
</ArchiveAction>
|
|
67
|
-
</Scheme>
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<Scheme
|
|
3
|
+
LastUpgradeVersion = "1340"
|
|
4
|
+
version = "1.3">
|
|
5
|
+
<BuildAction
|
|
6
|
+
parallelizeBuildables = "YES"
|
|
7
|
+
buildImplicitDependencies = "YES">
|
|
8
|
+
<BuildActionEntries>
|
|
9
|
+
<BuildActionEntry
|
|
10
|
+
buildForTesting = "YES"
|
|
11
|
+
buildForRunning = "YES"
|
|
12
|
+
buildForProfiling = "YES"
|
|
13
|
+
buildForArchiving = "YES"
|
|
14
|
+
buildForAnalyzing = "YES">
|
|
15
|
+
<BuildableReference
|
|
16
|
+
BuildableIdentifier = "primary"
|
|
17
|
+
BlueprintIdentifier = "58B511DA1A9E6C8500147676"
|
|
18
|
+
BuildableName = "libFreeraspReactNative.a"
|
|
19
|
+
BlueprintName = "FreeraspReactNative"
|
|
20
|
+
ReferencedContainer = "container:FreeraspReactNative.xcodeproj">
|
|
21
|
+
</BuildableReference>
|
|
22
|
+
</BuildActionEntry>
|
|
23
|
+
</BuildActionEntries>
|
|
24
|
+
</BuildAction>
|
|
25
|
+
<TestAction
|
|
26
|
+
buildConfiguration = "Debug"
|
|
27
|
+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
|
28
|
+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
|
29
|
+
shouldUseLaunchSchemeArgsEnv = "YES">
|
|
30
|
+
<Testables>
|
|
31
|
+
</Testables>
|
|
32
|
+
</TestAction>
|
|
33
|
+
<LaunchAction
|
|
34
|
+
buildConfiguration = "Debug"
|
|
35
|
+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
|
36
|
+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
|
37
|
+
launchStyle = "0"
|
|
38
|
+
useCustomWorkingDirectory = "NO"
|
|
39
|
+
ignoresPersistentStateOnLaunch = "NO"
|
|
40
|
+
debugDocumentVersioning = "YES"
|
|
41
|
+
debugServiceExtension = "internal"
|
|
42
|
+
allowLocationSimulation = "YES">
|
|
43
|
+
</LaunchAction>
|
|
44
|
+
<ProfileAction
|
|
45
|
+
buildConfiguration = "Release"
|
|
46
|
+
shouldUseLaunchSchemeArgsEnv = "YES"
|
|
47
|
+
savedToolIdentifier = ""
|
|
48
|
+
useCustomWorkingDirectory = "NO"
|
|
49
|
+
debugDocumentVersioning = "YES">
|
|
50
|
+
<MacroExpansion>
|
|
51
|
+
<BuildableReference
|
|
52
|
+
BuildableIdentifier = "primary"
|
|
53
|
+
BlueprintIdentifier = "58B511DA1A9E6C8500147676"
|
|
54
|
+
BuildableName = "libFreeraspReactNative.a"
|
|
55
|
+
BlueprintName = "FreeraspReactNative"
|
|
56
|
+
ReferencedContainer = "container:FreeraspReactNative.xcodeproj">
|
|
57
|
+
</BuildableReference>
|
|
58
|
+
</MacroExpansion>
|
|
59
|
+
</ProfileAction>
|
|
60
|
+
<AnalyzeAction
|
|
61
|
+
buildConfiguration = "Debug">
|
|
62
|
+
</AnalyzeAction>
|
|
63
|
+
<ArchiveAction
|
|
64
|
+
buildConfiguration = "Release"
|
|
65
|
+
revealArchiveInOrganizer = "YES">
|
|
66
|
+
</ArchiveAction>
|
|
67
|
+
</Scheme>
|
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
-
<plist version="1.0">
|
|
4
|
-
<dict>
|
|
5
|
-
<key>AvailableLibraries</key>
|
|
6
|
-
<array>
|
|
7
|
-
<dict>
|
|
8
|
-
<key>LibraryIdentifier</key>
|
|
9
|
-
<string>ios-arm64_x86_64-simulator</string>
|
|
10
|
-
<key>LibraryPath</key>
|
|
11
|
-
<string>TalsecRuntime.framework</string>
|
|
12
|
-
<key>SupportedArchitectures</key>
|
|
13
|
-
<array>
|
|
14
|
-
<string>arm64</string>
|
|
15
|
-
<string>x86_64</string>
|
|
16
|
-
</array>
|
|
17
|
-
<key>SupportedPlatform</key>
|
|
18
|
-
<string>ios</string>
|
|
19
|
-
<key>SupportedPlatformVariant</key>
|
|
20
|
-
<string>simulator</string>
|
|
21
|
-
</dict>
|
|
22
|
-
<dict>
|
|
23
|
-
<key>LibraryIdentifier</key>
|
|
24
|
-
<string>ios-arm64</string>
|
|
25
|
-
<key>LibraryPath</key>
|
|
26
|
-
<string>TalsecRuntime.framework</string>
|
|
27
|
-
<key>SupportedArchitectures</key>
|
|
28
|
-
<array>
|
|
29
|
-
<string>arm64</string>
|
|
30
|
-
</array>
|
|
31
|
-
<key>SupportedPlatform</key>
|
|
32
|
-
<string>ios</string>
|
|
33
|
-
</dict>
|
|
34
|
-
</array>
|
|
35
|
-
<key>CFBundlePackageType</key>
|
|
36
|
-
<string>XFWK</string>
|
|
37
|
-
<key>XCFrameworkFormatVersion</key>
|
|
38
|
-
<string>1.0</string>
|
|
39
|
-
</dict>
|
|
40
|
-
</plist>
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>AvailableLibraries</key>
|
|
6
|
+
<array>
|
|
7
|
+
<dict>
|
|
8
|
+
<key>LibraryIdentifier</key>
|
|
9
|
+
<string>ios-arm64_x86_64-simulator</string>
|
|
10
|
+
<key>LibraryPath</key>
|
|
11
|
+
<string>TalsecRuntime.framework</string>
|
|
12
|
+
<key>SupportedArchitectures</key>
|
|
13
|
+
<array>
|
|
14
|
+
<string>arm64</string>
|
|
15
|
+
<string>x86_64</string>
|
|
16
|
+
</array>
|
|
17
|
+
<key>SupportedPlatform</key>
|
|
18
|
+
<string>ios</string>
|
|
19
|
+
<key>SupportedPlatformVariant</key>
|
|
20
|
+
<string>simulator</string>
|
|
21
|
+
</dict>
|
|
22
|
+
<dict>
|
|
23
|
+
<key>LibraryIdentifier</key>
|
|
24
|
+
<string>ios-arm64</string>
|
|
25
|
+
<key>LibraryPath</key>
|
|
26
|
+
<string>TalsecRuntime.framework</string>
|
|
27
|
+
<key>SupportedArchitectures</key>
|
|
28
|
+
<array>
|
|
29
|
+
<string>arm64</string>
|
|
30
|
+
</array>
|
|
31
|
+
<key>SupportedPlatform</key>
|
|
32
|
+
<string>ios</string>
|
|
33
|
+
</dict>
|
|
34
|
+
</array>
|
|
35
|
+
<key>CFBundlePackageType</key>
|
|
36
|
+
<string>XFWK</string>
|
|
37
|
+
<key>XCFrameworkFormatVersion</key>
|
|
38
|
+
<string>1.0</string>
|
|
39
|
+
</dict>
|
|
40
|
+
</plist>
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
//
|
|
2
|
-
// CryptoBridgingHeader.h
|
|
3
|
-
// Talsec
|
|
4
|
-
//
|
|
5
|
-
// Created by Jakub Mejtský on 05/08/2019.
|
|
6
|
-
// Copyright © 2019 AHEAD iTec, s.r.o. All rights reserved.
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
#ifndef Crypto_h
|
|
10
|
-
#define Crypto_h
|
|
11
|
-
|
|
12
|
-
#import <CommonCrypto/CommonCrypto.h>
|
|
13
|
-
|
|
14
|
-
#endif /* Crypto_h */
|
|
1
|
+
//
|
|
2
|
+
// CryptoBridgingHeader.h
|
|
3
|
+
// Talsec
|
|
4
|
+
//
|
|
5
|
+
// Created by Jakub Mejtský on 05/08/2019.
|
|
6
|
+
// Copyright © 2019 AHEAD iTec, s.r.o. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#ifndef Crypto_h
|
|
10
|
+
#define Crypto_h
|
|
11
|
+
|
|
12
|
+
#import <CommonCrypto/CommonCrypto.h>
|
|
13
|
+
|
|
14
|
+
#endif /* Crypto_h */
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
//
|
|
2
|
-
// CurlWrapper.h
|
|
3
|
-
// Talsec
|
|
4
|
-
//
|
|
5
|
-
// Created by Jakub Mejtský on 23/07/2019.
|
|
6
|
-
// Copyright © 2019 AHEAD iTec, s.r.o. All rights reserved.
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
#ifndef CurlWrapper_h
|
|
10
|
-
#define CurlWrapper_h
|
|
11
|
-
|
|
12
|
-
#include "curl.h"
|
|
13
|
-
#include <stdio.h>
|
|
14
|
-
#include <stdlib.h>
|
|
15
|
-
#include <sys/sysctl.h>
|
|
16
|
-
#include <unistd.h>
|
|
17
|
-
#include <string.h>
|
|
18
|
-
|
|
19
|
-
struct DSWgsmUJiZMF {
|
|
20
|
-
char *memory;
|
|
21
|
-
size_t size;
|
|
22
|
-
CURLcode ret;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
#endif /* CurlWrapper_h */
|
|
1
|
+
//
|
|
2
|
+
// CurlWrapper.h
|
|
3
|
+
// Talsec
|
|
4
|
+
//
|
|
5
|
+
// Created by Jakub Mejtský on 23/07/2019.
|
|
6
|
+
// Copyright © 2019 AHEAD iTec, s.r.o. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#ifndef CurlWrapper_h
|
|
10
|
+
#define CurlWrapper_h
|
|
11
|
+
|
|
12
|
+
#include "curl.h"
|
|
13
|
+
#include <stdio.h>
|
|
14
|
+
#include <stdlib.h>
|
|
15
|
+
#include <sys/sysctl.h>
|
|
16
|
+
#include <unistd.h>
|
|
17
|
+
#include <string.h>
|
|
18
|
+
|
|
19
|
+
struct DSWgsmUJiZMF {
|
|
20
|
+
char *memory;
|
|
21
|
+
size_t size;
|
|
22
|
+
CURLcode ret;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
#endif /* CurlWrapper_h */
|