react-native-security-suite 0.9.21 → 1.0.0-rc.1
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/README.md +233 -65
- package/android/build.gradle +11 -0
- package/android/gradle.properties +1 -1
- package/android/src/main/java/com/securitysuite/CryptoConfig.java +158 -0
- package/android/src/main/java/com/securitysuite/CryptoUtils.java +152 -0
- package/android/src/main/java/com/securitysuite/EcdhKeyStore.java +60 -0
- package/android/src/main/java/com/securitysuite/HeaderSanitizer.java +75 -0
- package/android/src/main/java/com/securitysuite/JWSGenerator.java +237 -32
- package/android/src/main/java/com/securitysuite/JwsFetchPayload.java +81 -0
- package/android/src/main/java/com/securitysuite/Obfuscation.java +57 -0
- package/android/src/main/java/com/securitysuite/SecureStorageNative.java +211 -0
- package/android/src/main/java/com/securitysuite/SecureView.java +2 -10
- package/android/src/main/java/com/securitysuite/SecureWindowHelper.java +30 -0
- package/android/src/main/java/com/securitysuite/SecuritySuiteModule.java +310 -102
- package/android/src/main/java/com/securitysuite/Sslpinning.java +219 -106
- package/android/src/main/java/com/securitysuite/security/AppIntegrityChecker.java +133 -0
- package/android/src/main/java/com/securitysuite/security/EmulatorDetector.java +145 -0
- package/android/src/main/java/com/securitysuite/security/RuntimeDetector.java +234 -0
- package/android/src/test/java/com/securitysuite/JWSGeneratorTest.java +153 -0
- package/android/src/test/java/com/securitysuite/SecureStorageNativeTest.java +37 -0
- package/ios/CryptoConfig.swift +124 -0
- package/ios/JWSGenerator.swift +288 -0
- package/ios/JWSGeneratorTests.swift +168 -0
- package/ios/KeychainHelper.swift +104 -0
- package/ios/Obfuscation.swift +42 -0
- package/ios/SecureStorageNative.swift +84 -0
- package/ios/Security/AppIntegrityChecker.swift +85 -0
- package/ios/Security/EmulatorDetector.swift +45 -0
- package/ios/Security/RuntimeDetector.swift +107 -0
- package/ios/SecuritySuite.mm +28 -4
- package/ios/SecuritySuite.swift +407 -131
- package/ios/SslPinning.swift +242 -263
- package/lib/commonjs/clipboard/index.js +3 -0
- package/lib/commonjs/clipboard/index.js.map +1 -0
- package/lib/commonjs/crypto/index.js +39 -0
- package/lib/commonjs/crypto/index.js.map +1 -0
- package/lib/commonjs/device/index.js +40 -0
- package/lib/commonjs/device/index.js.map +1 -0
- package/lib/commonjs/errors.js +62 -0
- package/lib/commonjs/errors.js.map +1 -0
- package/lib/commonjs/index.js +220 -151
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/integrity/index.js +40 -0
- package/lib/commonjs/integrity/index.js.map +1 -0
- package/lib/commonjs/jws.js +141 -0
- package/lib/commonjs/jws.js.map +1 -0
- package/lib/commonjs/legacy/cryptoOptions.js +20 -0
- package/lib/commonjs/legacy/cryptoOptions.js.map +1 -0
- package/lib/commonjs/native/bridge.js +23 -0
- package/lib/commonjs/native/bridge.js.map +1 -0
- package/lib/commonjs/network/index.js +3 -0
- package/lib/commonjs/network/index.js.map +1 -0
- package/lib/commonjs/risk/score.js +36 -0
- package/lib/commonjs/risk/score.js.map +1 -0
- package/lib/commonjs/runtime/index.js +31 -0
- package/lib/commonjs/runtime/index.js.map +1 -0
- package/lib/commonjs/screen/index.js +13 -0
- package/lib/commonjs/screen/index.js.map +1 -0
- package/lib/commonjs/securitySuite/index.js +42 -0
- package/lib/commonjs/securitySuite/index.js.map +1 -0
- package/lib/commonjs/storage/index.js +3 -0
- package/lib/commonjs/storage/index.js.map +1 -0
- package/lib/commonjs/types/detection.js +2 -0
- package/lib/commonjs/types/detection.js.map +1 -0
- package/lib/module/clipboard/index.js +3 -0
- package/lib/module/clipboard/index.js.map +1 -0
- package/lib/module/crypto/index.js +35 -0
- package/lib/module/crypto/index.js.map +1 -0
- package/lib/module/device/index.js +36 -0
- package/lib/module/device/index.js.map +1 -0
- package/lib/module/errors.js +55 -0
- package/lib/module/errors.js.map +1 -0
- package/lib/module/index.js +147 -148
- package/lib/module/index.js.map +1 -1
- package/lib/module/integrity/index.js +36 -0
- package/lib/module/integrity/index.js.map +1 -0
- package/lib/module/jws.js +127 -0
- package/lib/module/jws.js.map +1 -0
- package/lib/module/legacy/cryptoOptions.js +16 -0
- package/lib/module/legacy/cryptoOptions.js.map +1 -0
- package/lib/module/native/bridge.js +19 -0
- package/lib/module/native/bridge.js.map +1 -0
- package/lib/module/network/index.js +3 -0
- package/lib/module/network/index.js.map +1 -0
- package/lib/module/risk/score.js +32 -0
- package/lib/module/risk/score.js.map +1 -0
- package/lib/module/runtime/index.js +27 -0
- package/lib/module/runtime/index.js.map +1 -0
- package/lib/module/screen/index.js +5 -0
- package/lib/module/screen/index.js.map +1 -0
- package/lib/module/securitySuite/index.js +38 -0
- package/lib/module/securitySuite/index.js.map +1 -0
- package/lib/module/storage/index.js +3 -0
- package/lib/module/storage/index.js.map +1 -0
- package/lib/module/types/detection.js +2 -0
- package/lib/module/types/detection.js.map +1 -0
- package/lib/typescript/commonjs/docs/api-v1-proposal.d.ts +215 -0
- package/lib/typescript/commonjs/docs/api-v1-proposal.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/SecureView.d.ts +1 -1
- package/lib/typescript/commonjs/src/SecureView.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/clipboard/index.d.ts +2 -0
- package/lib/typescript/commonjs/src/clipboard/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/crypto/index.d.ts +15 -0
- package/lib/typescript/commonjs/src/crypto/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/device/index.d.ts +11 -0
- package/lib/typescript/commonjs/src/device/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/errors.d.ts +17 -0
- package/lib/typescript/commonjs/src/errors.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/helpers.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/index.d.ts +77 -24
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/integrity/index.d.ts +6 -0
- package/lib/typescript/commonjs/src/integrity/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/jws.d.ts +44 -0
- package/lib/typescript/commonjs/src/jws.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/legacy/cryptoOptions.d.ts +35 -0
- package/lib/typescript/commonjs/src/legacy/cryptoOptions.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/native/bridge.d.ts +12 -0
- package/lib/typescript/commonjs/src/native/bridge.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/network/index.d.ts +2 -0
- package/lib/typescript/commonjs/src/network/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/risk/score.d.ts +12 -0
- package/lib/typescript/commonjs/src/risk/score.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/runtime/index.d.ts +6 -0
- package/lib/typescript/commonjs/src/runtime/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/screen/index.d.ts +3 -0
- package/lib/typescript/commonjs/src/screen/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/securitySuite/index.d.ts +6 -0
- package/lib/typescript/commonjs/src/securitySuite/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/storage/index.d.ts +2 -0
- package/lib/typescript/commonjs/src/storage/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/detection.d.ts +41 -0
- package/lib/typescript/commonjs/src/types/detection.d.ts.map +1 -0
- package/lib/typescript/module/docs/api-v1-proposal.d.ts +215 -0
- package/lib/typescript/module/docs/api-v1-proposal.d.ts.map +1 -0
- package/lib/typescript/module/src/SecureView.d.ts +1 -1
- package/lib/typescript/module/src/SecureView.d.ts.map +1 -1
- package/lib/typescript/module/src/clipboard/index.d.ts +2 -0
- package/lib/typescript/module/src/clipboard/index.d.ts.map +1 -0
- package/lib/typescript/module/src/crypto/index.d.ts +15 -0
- package/lib/typescript/module/src/crypto/index.d.ts.map +1 -0
- package/lib/typescript/module/src/device/index.d.ts +11 -0
- package/lib/typescript/module/src/device/index.d.ts.map +1 -0
- package/lib/typescript/module/src/errors.d.ts +17 -0
- package/lib/typescript/module/src/errors.d.ts.map +1 -0
- package/lib/typescript/module/src/helpers.d.ts.map +1 -1
- package/lib/typescript/module/src/index.d.ts +77 -24
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/integrity/index.d.ts +6 -0
- package/lib/typescript/module/src/integrity/index.d.ts.map +1 -0
- package/lib/typescript/module/src/jws.d.ts +44 -0
- package/lib/typescript/module/src/jws.d.ts.map +1 -0
- package/lib/typescript/module/src/legacy/cryptoOptions.d.ts +35 -0
- package/lib/typescript/module/src/legacy/cryptoOptions.d.ts.map +1 -0
- package/lib/typescript/module/src/native/bridge.d.ts +12 -0
- package/lib/typescript/module/src/native/bridge.d.ts.map +1 -0
- package/lib/typescript/module/src/network/index.d.ts +2 -0
- package/lib/typescript/module/src/network/index.d.ts.map +1 -0
- package/lib/typescript/module/src/risk/score.d.ts +12 -0
- package/lib/typescript/module/src/risk/score.d.ts.map +1 -0
- package/lib/typescript/module/src/runtime/index.d.ts +6 -0
- package/lib/typescript/module/src/runtime/index.d.ts.map +1 -0
- package/lib/typescript/module/src/screen/index.d.ts +3 -0
- package/lib/typescript/module/src/screen/index.d.ts.map +1 -0
- package/lib/typescript/module/src/securitySuite/index.d.ts +6 -0
- package/lib/typescript/module/src/securitySuite/index.d.ts.map +1 -0
- package/lib/typescript/module/src/storage/index.d.ts +2 -0
- package/lib/typescript/module/src/storage/index.d.ts.map +1 -0
- package/lib/typescript/module/src/types/detection.d.ts +41 -0
- package/lib/typescript/module/src/types/detection.d.ts.map +1 -0
- package/package.json +2 -4
- package/src/clipboard/index.ts +1 -0
- package/src/crypto/index.ts +49 -0
- package/src/device/index.ts +47 -0
- package/src/errors.ts +84 -0
- package/src/index.tsx +293 -195
- package/src/integrity/index.ts +46 -0
- package/src/jws.ts +213 -0
- package/src/legacy/cryptoOptions.ts +49 -0
- package/src/native/bridge.ts +37 -0
- package/src/network/index.ts +1 -0
- package/src/risk/score.ts +49 -0
- package/src/runtime/index.ts +43 -0
- package/src/screen/index.ts +2 -0
- package/src/securitySuite/index.ts +45 -0
- package/src/storage/index.ts +1 -0
- package/src/types/detection.ts +46 -0
- package/android/src/main/java/com/securitysuite/StorageEncryption.java +0 -52
- package/ios/StorageEncryption.swift +0 -89
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import Foundation
|
|
2
|
+
import Security
|
|
3
|
+
|
|
4
|
+
enum AppIntegrityChecker {
|
|
5
|
+
static func verify() -> [String: Any] {
|
|
6
|
+
let bundleId = Bundle.main.bundleIdentifier ?? ""
|
|
7
|
+
let debuggable = isDebugBuild()
|
|
8
|
+
let buildType = resolveBuildType(debuggable: debuggable)
|
|
9
|
+
let validSignature = validateCodeSignature()
|
|
10
|
+
let suspiciousLibraries = scanInjectedDylibs()
|
|
11
|
+
let tampered = !validSignature || !suspiciousLibraries.isEmpty
|
|
12
|
+
|
|
13
|
+
var result: [String: Any] = [
|
|
14
|
+
"validSignature": validSignature,
|
|
15
|
+
"debuggable": debuggable,
|
|
16
|
+
"tampered": tampered,
|
|
17
|
+
"buildType": buildType,
|
|
18
|
+
"bundleIdentifier": bundleId,
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
if debuggable {
|
|
22
|
+
result["installerTrusted"] = true
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return result
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
private static func validateCodeSignature() -> Bool {
|
|
29
|
+
guard let bundleURL = Bundle.main.bundleURL as CFURL? else {
|
|
30
|
+
return false
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
var staticCode: SecStaticCode?
|
|
34
|
+
let createStatus = SecStaticCodeCreateWithPath(bundleURL, [], &staticCode)
|
|
35
|
+
guard createStatus == errSecSuccess, let code = staticCode else {
|
|
36
|
+
return false
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
let verifyStatus = SecStaticCodeCheckValidity(code, [], nil)
|
|
40
|
+
return verifyStatus == errSecSuccess
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
private static func scanInjectedDylibs() -> [String] {
|
|
44
|
+
let suspiciousKeywords = ["frida", "substrate", "cycript", "libhooker", "substitute", "ellekit"]
|
|
45
|
+
var matches: [String] = []
|
|
46
|
+
let imageCount = _dyld_image_count()
|
|
47
|
+
|
|
48
|
+
for index in 0..<imageCount {
|
|
49
|
+
guard let imageName = _dyld_get_image_name(index) else {
|
|
50
|
+
continue
|
|
51
|
+
}
|
|
52
|
+
let path = String(cString: imageName).lowercased()
|
|
53
|
+
guard path.hasPrefix("/var/") || path.contains("/mobilesubstrate/") else {
|
|
54
|
+
continue
|
|
55
|
+
}
|
|
56
|
+
for keyword in suspiciousKeywords where path.contains(keyword) {
|
|
57
|
+
matches.append(String(cString: imageName))
|
|
58
|
+
break
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return matches
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
private static func isDebugBuild() -> Bool {
|
|
66
|
+
#if DEBUG
|
|
67
|
+
return true
|
|
68
|
+
#else
|
|
69
|
+
return false
|
|
70
|
+
#endif
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
private static func resolveBuildType(debuggable: Bool) -> String {
|
|
74
|
+
if debuggable {
|
|
75
|
+
return "debug"
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if let receiptURL = Bundle.main.appStoreReceiptURL,
|
|
79
|
+
receiptURL.lastPathComponent == "sandboxReceipt" {
|
|
80
|
+
return "testflight"
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return "release"
|
|
84
|
+
}
|
|
85
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import Foundation
|
|
2
|
+
import IOSSecuritySuite
|
|
3
|
+
|
|
4
|
+
enum EmulatorDetector {
|
|
5
|
+
static func detect() -> [String: Any] {
|
|
6
|
+
var indicators: [String] = []
|
|
7
|
+
|
|
8
|
+
#if targetEnvironment(simulator)
|
|
9
|
+
indicators.append("TARGET_OS_SIMULATOR")
|
|
10
|
+
#endif
|
|
11
|
+
|
|
12
|
+
if IOSSecuritySuite.amIRunInEmulator() {
|
|
13
|
+
indicators.append("IOSSecuritySuite.amIRunInEmulator")
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
if let model = hardwareModel()?.lowercased() {
|
|
17
|
+
if model.contains("simulator") || model.contains("x86_64") || model.contains("i386") {
|
|
18
|
+
indicators.append("hw.model:\(model)")
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
let isSimulator = !indicators.isEmpty
|
|
23
|
+
|
|
24
|
+
return [
|
|
25
|
+
"isEmulator": false,
|
|
26
|
+
"isSimulator": isSimulator,
|
|
27
|
+
"indicators": indicators,
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
private static func hardwareModel() -> String? {
|
|
32
|
+
var size: size_t = 0
|
|
33
|
+
sysctlbyname("hw.model", nil, &size, nil, 0)
|
|
34
|
+
guard size > 0 else {
|
|
35
|
+
return nil
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
var model = [CChar](repeating: 0, count: size)
|
|
39
|
+
let result = sysctlbyname("hw.model", &model, &size, nil, 0)
|
|
40
|
+
guard result == 0 else {
|
|
41
|
+
return nil
|
|
42
|
+
}
|
|
43
|
+
return String(cString: model)
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import Foundation
|
|
2
|
+
import IOSSecuritySuite
|
|
3
|
+
import Darwin
|
|
4
|
+
|
|
5
|
+
enum RuntimeDetector {
|
|
6
|
+
private static let fridaPorts: [UInt16] = [27042, 27043]
|
|
7
|
+
private static let suspiciousKeywords = [
|
|
8
|
+
"frida", "substrate", "cycript", "libhooker", "ellekit", "substitute", "xposed", "lsposed"
|
|
9
|
+
]
|
|
10
|
+
|
|
11
|
+
static func detect() -> [String: Any] {
|
|
12
|
+
let suspiciousLibraries = scanLoadedLibraries()
|
|
13
|
+
let suspiciousPorts = scanFridaPorts()
|
|
14
|
+
let reverseEngineered = IOSSecuritySuite.amIReverseEngineered()
|
|
15
|
+
let fridaDetected = hasDyldInsert()
|
|
16
|
+
|| reverseEngineered
|
|
17
|
+
|| !suspiciousLibraries.isEmpty
|
|
18
|
+
|| !suspiciousPorts.isEmpty
|
|
19
|
+
|| canConnectToFrida()
|
|
20
|
+
let debuggerAttached = isDebuggerAttached()
|
|
21
|
+
let substrateDetected = suspiciousLibraries.contains(where: {
|
|
22
|
+
$0.lowercased().contains("substrate")
|
|
23
|
+
|| $0.lowercased().contains("substitute")
|
|
24
|
+
|| $0.lowercased().contains("ellekit")
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
return [
|
|
28
|
+
"debuggerAttached": debuggerAttached,
|
|
29
|
+
"fridaDetected": fridaDetected,
|
|
30
|
+
"substrateDetected": substrateDetected,
|
|
31
|
+
"suspiciousLibraries": suspiciousLibraries,
|
|
32
|
+
"suspiciousPorts": suspiciousPorts,
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
private static func hasDyldInsert() -> Bool {
|
|
37
|
+
if let env = getenv("DYLD_INSERT_LIBRARIES") {
|
|
38
|
+
let value = String(cString: env)
|
|
39
|
+
return !value.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty
|
|
40
|
+
}
|
|
41
|
+
return false
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
private static func scanLoadedLibraries() -> [String] {
|
|
45
|
+
var matches: [String] = []
|
|
46
|
+
let imageCount = _dyld_image_count()
|
|
47
|
+
for index in 0..<imageCount {
|
|
48
|
+
guard let imageName = _dyld_get_image_name(index) else {
|
|
49
|
+
continue
|
|
50
|
+
}
|
|
51
|
+
let name = String(cString: imageName).lowercased()
|
|
52
|
+
for keyword in suspiciousKeywords where name.contains(keyword) {
|
|
53
|
+
matches.append(String(cString: imageName))
|
|
54
|
+
break
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return matches
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
private static func scanFridaPorts() -> [Int] {
|
|
61
|
+
fridaPorts.compactMap { port in
|
|
62
|
+
canConnect(to: port) ? Int(port) : nil
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
private static func canConnectToFrida() -> Bool {
|
|
67
|
+
fridaPorts.contains(where: canConnect)
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
private static func canConnect(to port: UInt16) -> Bool {
|
|
71
|
+
var addr = sockaddr_in()
|
|
72
|
+
addr.sin_len = UInt8(MemoryLayout<sockaddr_in>.size)
|
|
73
|
+
addr.sin_family = sa_family_t(AF_INET)
|
|
74
|
+
addr.sin_port = port.bigEndian
|
|
75
|
+
addr.sin_addr = in_addr(s_addr: inet_addr("127.0.0.1"))
|
|
76
|
+
|
|
77
|
+
let socketFd = socket(AF_INET, SOCK_STREAM, 0)
|
|
78
|
+
if socketFd < 0 {
|
|
79
|
+
return false
|
|
80
|
+
}
|
|
81
|
+
defer { close(socketFd) }
|
|
82
|
+
|
|
83
|
+
let result = withUnsafePointer(to: &addr) {
|
|
84
|
+
$0.withMemoryRebound(to: sockaddr.self, capacity: 1) {
|
|
85
|
+
connect(socketFd, $0, socklen_t(MemoryLayout<sockaddr_in>.size))
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return result == 0
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
private static func isDebuggerAttached() -> Bool {
|
|
92
|
+
if IOSSecuritySuite.amIDebugged() {
|
|
93
|
+
return true
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
var info = kinfo_proc()
|
|
97
|
+
var mib: [Int32] = [CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid()]
|
|
98
|
+
var size = MemoryLayout<kinfo_proc>.stride
|
|
99
|
+
let result = mib.withUnsafeMutableBufferPointer { buffer -> Int32 in
|
|
100
|
+
sysctl(buffer.baseAddress, u_int(buffer.count), &info, &size, nil, 0)
|
|
101
|
+
}
|
|
102
|
+
if result != 0 {
|
|
103
|
+
return false
|
|
104
|
+
}
|
|
105
|
+
return (info.kp_proc.p_flag & P_TRACED) != 0
|
|
106
|
+
}
|
|
107
|
+
}
|
package/ios/SecuritySuite.mm
CHANGED
|
@@ -5,22 +5,46 @@
|
|
|
5
5
|
|
|
6
6
|
RCT_EXTERN_METHOD(getPublicKey:(RCTPromiseResolveBlock)resolve withRejecter:(RCTPromiseRejectBlock)reject)
|
|
7
7
|
|
|
8
|
-
RCT_EXTERN_METHOD(getSharedKey:(NSString)serverPK withResolver:(RCTPromiseResolveBlock)resolve withRejecter:(RCTPromiseRejectBlock)reject)
|
|
8
|
+
RCT_EXTERN_METHOD(getSharedKey:(NSString)serverPK withOptions:(NSDictionary *)options withResolver:(RCTPromiseResolveBlock)resolve withRejecter:(RCTPromiseRejectBlock)reject)
|
|
9
9
|
|
|
10
|
-
RCT_EXTERN_METHOD(
|
|
10
|
+
RCT_EXTERN_METHOD(establishSharedKey:(NSString)serverPK withOptions:(NSDictionary *)options withResolver:(RCTPromiseResolveBlock)resolve withRejecter:(RCTPromiseRejectBlock)reject)
|
|
11
11
|
|
|
12
|
-
RCT_EXTERN_METHOD(
|
|
12
|
+
RCT_EXTERN_METHOD(encrypt:(NSString)input withOptions:(NSDictionary *)options withResolver:(RCTPromiseResolveBlock)resolve withRejecter:(RCTPromiseRejectBlock)reject)
|
|
13
13
|
|
|
14
|
-
RCT_EXTERN_METHOD(
|
|
14
|
+
RCT_EXTERN_METHOD(decrypt:(NSString)input withOptions:(NSDictionary *)options withResolver:(RCTPromiseResolveBlock)resolve withRejecter:(RCTPromiseRejectBlock)reject)
|
|
15
|
+
|
|
16
|
+
RCT_EXTERN_METHOD(generateJWS:(NSDictionary)options withResolver:(RCTPromiseResolveBlock)resolve withRejecter:(RCTPromiseRejectBlock)reject)
|
|
17
|
+
|
|
18
|
+
RCT_EXTERN_METHOD(obfuscate:(NSString)input withSecret:(NSString)secret withResolver:(RCTPromiseResolveBlock)resolve withRejecter:(RCTPromiseRejectBlock)reject)
|
|
19
|
+
|
|
20
|
+
RCT_EXTERN_METHOD(deobfuscate:(NSString)input withSecret:(NSString)secret withResolver:(RCTPromiseResolveBlock)resolve withRejecter:(RCTPromiseRejectBlock)reject)
|
|
15
21
|
|
|
16
22
|
RCT_EXTERN_METHOD(storageEncrypt:(NSString)input withSecretKey:(NSString*)secretKey withHardEncryption:(BOOL)hardEncryption withCallback:(RCTResponseSenderBlock)callback)
|
|
17
23
|
|
|
18
24
|
RCT_EXTERN_METHOD(storageDecrypt:(NSString)input withSecretKey:(NSString*)secretKey withHardEncryption:(BOOL)hardEncryption withCallback:(RCTResponseSenderBlock)callback)
|
|
19
25
|
|
|
26
|
+
RCT_EXTERN_METHOD(secureStorageSetItem:(NSString)key withValue:(NSString)value withResolver:(RCTPromiseResolveBlock)resolve withRejecter:(RCTPromiseRejectBlock)reject)
|
|
27
|
+
|
|
28
|
+
RCT_EXTERN_METHOD(secureStorageGetItem:(NSString)key withResolver:(RCTPromiseResolveBlock)resolve withRejecter:(RCTPromiseRejectBlock)reject)
|
|
29
|
+
|
|
30
|
+
RCT_EXTERN_METHOD(secureStorageRemoveItem:(NSString)key withResolver:(RCTPromiseResolveBlock)resolve withRejecter:(RCTPromiseRejectBlock)reject)
|
|
31
|
+
|
|
32
|
+
RCT_EXTERN_METHOD(secureStorageClear:(RCTPromiseResolveBlock)resolve withRejecter:(RCTPromiseRejectBlock)reject)
|
|
33
|
+
|
|
34
|
+
RCT_EXTERN_METHOD(secureStorageGetAllKeys:(RCTPromiseResolveBlock)resolve withRejecter:(RCTPromiseRejectBlock)reject)
|
|
35
|
+
|
|
36
|
+
RCT_EXTERN_METHOD(getDeviceId:(RCTResponseSenderBlock)callback)
|
|
37
|
+
|
|
20
38
|
RCT_EXTERN_METHOD(fetch:(NSString)url withData:(NSDictionary)data withCallback:(RCTResponseSenderBlock)callback)
|
|
21
39
|
|
|
22
40
|
RCT_EXTERN_METHOD(deviceHasSecurityRisk:(RCTPromiseResolveBlock)resolve withRejecter:(RCTPromiseRejectBlock)reject)
|
|
23
41
|
|
|
42
|
+
RCT_EXTERN_METHOD(runtimeDetect:(RCTPromiseResolveBlock)resolve withRejecter:(RCTPromiseRejectBlock)reject)
|
|
43
|
+
|
|
44
|
+
RCT_EXTERN_METHOD(appIntegrityVerify:(RCTPromiseResolveBlock)resolve withRejecter:(RCTPromiseRejectBlock)reject)
|
|
45
|
+
|
|
46
|
+
RCT_EXTERN_METHOD(deviceGetEnvironment:(RCTPromiseResolveBlock)resolve withRejecter:(RCTPromiseRejectBlock)reject)
|
|
47
|
+
|
|
24
48
|
+ (BOOL)requiresMainQueueSetup
|
|
25
49
|
{
|
|
26
50
|
return NO;
|