react-native-security-suite 0.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.
Files changed (37) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +27 -0
  3. package/android/.gradle/6.8/fileChanges/last-build.bin +0 -0
  4. package/android/.gradle/6.8/fileHashes/fileHashes.lock +0 -0
  5. package/android/.gradle/6.8/gc.properties +0 -0
  6. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  7. package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
  8. package/android/.gradle/checksums/checksums.lock +0 -0
  9. package/android/.gradle/checksums/sha1-checksums.bin +0 -0
  10. package/android/.gradle/configuration-cache/gc.properties +0 -0
  11. package/android/.gradle/vcs-1/gc.properties +0 -0
  12. package/android/.idea/gradle.xml +14 -0
  13. package/android/.idea/misc.xml +9 -0
  14. package/android/.idea/modules/android.iml +18 -0
  15. package/android/.idea/modules.xml +8 -0
  16. package/android/.idea/vcs.xml +6 -0
  17. package/android/build.gradle +60 -0
  18. package/android/local.properties +8 -0
  19. package/android/src/main/AndroidManifest.xml +4 -0
  20. package/android/src/main/java/com/reactnativesecuritysuite/SecuritySuiteModule.java +38 -0
  21. package/android/src/main/java/com/reactnativesecuritysuite/SecuritySuitePackage.java +28 -0
  22. package/ios/SecuritySuite-Bridging-Header.h +2 -0
  23. package/ios/SecuritySuite.m +12 -0
  24. package/ios/SecuritySuite.swift +15 -0
  25. package/ios/SecuritySuite.xcodeproj/project.pbxproj +293 -0
  26. package/ios/SecuritySuite.xcodeproj/project.xcworkspace/contents.xcworkspacedata +4 -0
  27. package/ios/SecuritySuite.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  28. package/ios/SecuritySuite.xcodeproj/project.xcworkspace/xcuserdata/Navabi.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  29. package/ios/SecuritySuite.xcodeproj/xcuserdata/Navabi.xcuserdatad/xcschemes/xcschememanagement.plist +14 -0
  30. package/lib/commonjs/index.js +28 -0
  31. package/lib/commonjs/index.js.map +1 -0
  32. package/lib/module/index.js +16 -0
  33. package/lib/module/index.js.map +1 -0
  34. package/lib/typescript/index.d.ts +3 -0
  35. package/package.json +153 -0
  36. package/react-native-security-suite.podspec +20 -0
  37. package/src/index.tsx +24 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Mohammad Navabi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,27 @@
1
+ # react-native-security-suite
2
+
3
+ Security suite for React Native
4
+
5
+ ## Installation
6
+
7
+ ```sh
8
+ npm install react-native-security-suite
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```js
14
+ import { deviceHasSecurityRisk } from 'react-native-security-suite';
15
+
16
+ // ...
17
+
18
+ const result = await deviceHasSecurityRisk();
19
+ ```
20
+
21
+ ## Contributing
22
+
23
+ See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
24
+
25
+ ## License
26
+
27
+ MIT
File without changes
@@ -0,0 +1,2 @@
1
+ #Tue Sep 20 14:17:34 IRDT 2022
2
+ gradle.version=6.8
File without changes
@@ -0,0 +1,14 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="GradleMigrationSettings" migrationVersion="1" />
4
+ <component name="GradleSettings">
5
+ <option name="linkedExternalProjectsSettings">
6
+ <GradleProjectSettings>
7
+ <option name="testRunner" value="GRADLE" />
8
+ <option name="distributionType" value="DEFAULT_WRAPPED" />
9
+ <option name="externalProjectPath" value="$PROJECT_DIR$" />
10
+ <option name="resolveModulePerSourceSet" value="false" />
11
+ </GradleProjectSettings>
12
+ </option>
13
+ </component>
14
+ </project>
@@ -0,0 +1,9 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectRootManager" version="2" project-jdk-name="Android Studio default JDK" project-jdk-type="JavaSDK">
4
+ <output url="file://$PROJECT_DIR$/build/classes" />
5
+ </component>
6
+ <component name="ProjectType">
7
+ <option name="id" value="Android" />
8
+ </component>
9
+ </project>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module external.linked.project.id=":" external.linked.project.path="$MODULE_DIR$/../.." external.root.project.path="$MODULE_DIR$/../.." external.system.id="GRADLE" type="JAVA_MODULE" version="4">
3
+ <component name="FacetManager">
4
+ <facet type="android-gradle" name="Android-Gradle">
5
+ <configuration>
6
+ <option name="GRADLE_PROJECT_PATH" value=":" />
7
+ <option name="LAST_SUCCESSFUL_SYNC_AGP_VERSION" />
8
+ <option name="LAST_KNOWN_AGP_VERSION" />
9
+ </configuration>
10
+ </facet>
11
+ </component>
12
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
13
+ <exclude-output />
14
+ <content url="file://$MODULE_DIR$/../.." />
15
+ <orderEntry type="inheritedJdk" />
16
+ <orderEntry type="sourceFolder" forTests="false" />
17
+ </component>
18
+ </module>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/modules/android.iml" filepath="$PROJECT_DIR$/.idea/modules/android.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="$PROJECT_DIR$/.." vcs="Git" />
5
+ </component>
6
+ </project>
@@ -0,0 +1,60 @@
1
+ buildscript {
2
+ if (project == rootProject) {
3
+ repositories {
4
+ google()
5
+ mavenCentral()
6
+ jcenter()
7
+ }
8
+
9
+ dependencies {
10
+ classpath 'com.android.tools.build:gradle:3.5.3'
11
+ }
12
+ }
13
+ }
14
+
15
+ apply plugin: 'com.android.library'
16
+
17
+ def safeExtGet(prop, fallback) {
18
+ rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
19
+ }
20
+
21
+ android {
22
+ compileSdkVersion safeExtGet('SecuritySuite_compileSdkVersion', 29)
23
+ defaultConfig {
24
+ minSdkVersion safeExtGet('SecuritySuite_minSdkVersion', 16)
25
+ targetSdkVersion safeExtGet('SecuritySuite_targetSdkVersion', 29)
26
+ versionCode 1
27
+ versionName "1.0"
28
+
29
+ }
30
+
31
+ buildTypes {
32
+ release {
33
+ minifyEnabled false
34
+ }
35
+ }
36
+ lintOptions {
37
+ disable 'GradleCompatible'
38
+ }
39
+ compileOptions {
40
+ sourceCompatibility JavaVersion.VERSION_1_8
41
+ targetCompatibility JavaVersion.VERSION_1_8
42
+ }
43
+ }
44
+
45
+ repositories {
46
+ mavenLocal()
47
+ maven {
48
+ // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
49
+ url("$rootDir/../node_modules/react-native/android")
50
+ }
51
+ google()
52
+ mavenCentral()
53
+ jcenter()
54
+ }
55
+
56
+ dependencies {
57
+ //noinspection GradleDynamicVersion
58
+ implementation "com.facebook.react:react-native:+" // From node_modules
59
+ implementation "com.scottyab:rootbeer-lib:0.1.0"
60
+ }
@@ -0,0 +1,8 @@
1
+ ## This file must *NOT* be checked into Version Control Systems,
2
+ # as it contains information specific to your local configuration.
3
+ #
4
+ # Location of the SDK. This is only used by Gradle.
5
+ # For customization when using a Version Control System, please read the
6
+ # header note.
7
+ #Tue Sep 20 14:13:42 IRDT 2022
8
+ sdk.dir=/Users/Navabi/Library/Android/sdk
@@ -0,0 +1,4 @@
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
+ package="com.reactnativesecuritysuite">
3
+
4
+ </manifest>
@@ -0,0 +1,38 @@
1
+ package com.reactnativesecuritysuite;
2
+
3
+ import androidx.annotation.NonNull;
4
+
5
+ import com.facebook.react.bridge.Promise;
6
+ import com.facebook.react.bridge.ReactApplicationContext;
7
+ import com.facebook.react.bridge.ReactContextBaseJavaModule;
8
+ import com.facebook.react.bridge.ReactMethod;
9
+ import com.facebook.react.module.annotations.ReactModule;
10
+ import com.scottyab.rootbeer.RootBeer;
11
+
12
+ @ReactModule(name = SecuritySuiteModule.NAME)
13
+ public class SecuritySuiteModule extends ReactContextBaseJavaModule {
14
+ public static final String NAME = "SecuritySuite";
15
+ private ReactApplicationContext context;
16
+
17
+ public SecuritySuiteModule(ReactApplicationContext reactContext) {
18
+ super(reactContext);
19
+ context = reactContext;
20
+ }
21
+
22
+ @Override
23
+ @NonNull
24
+ public String getName() {
25
+ return NAME;
26
+ }
27
+
28
+
29
+ // Example method
30
+ // See https://reactnative.dev/docs/native-modules-android
31
+ @ReactMethod
32
+ public void deviceHasSecurityRisk(Promise promise) {
33
+ RootBeer rootBeer = new RootBeer(context);
34
+ promise.resolve(rootBeer.isRooted());
35
+ }
36
+
37
+ public static native int nativeMultiply(int a, int b);
38
+ }
@@ -0,0 +1,28 @@
1
+ package com.reactnativesecuritysuite;
2
+
3
+ import androidx.annotation.NonNull;
4
+
5
+ import com.facebook.react.ReactPackage;
6
+ import com.facebook.react.bridge.NativeModule;
7
+ import com.facebook.react.bridge.ReactApplicationContext;
8
+ import com.facebook.react.uimanager.ViewManager;
9
+
10
+ import java.util.ArrayList;
11
+ import java.util.Collections;
12
+ import java.util.List;
13
+
14
+ public class SecuritySuitePackage implements ReactPackage {
15
+ @NonNull
16
+ @Override
17
+ public List<NativeModule> createNativeModules(@NonNull ReactApplicationContext reactContext) {
18
+ List<NativeModule> modules = new ArrayList<>();
19
+ modules.add(new SecuritySuiteModule(reactContext));
20
+ return modules;
21
+ }
22
+
23
+ @NonNull
24
+ @Override
25
+ public List<ViewManager> createViewManagers(@NonNull ReactApplicationContext reactContext) {
26
+ return Collections.emptyList();
27
+ }
28
+ }
@@ -0,0 +1,2 @@
1
+ #import <React/RCTBridgeModule.h>
2
+ #import <React/RCTViewManager.h>
@@ -0,0 +1,12 @@
1
+ #import <React/RCTBridgeModule.h>
2
+
3
+ @interface RCT_EXTERN_MODULE(SecuritySuite, NSObject)
4
+
5
+ RCT_EXTERN_METHOD(deviceHasSecurityRisk:(RCTPromiseResolveBlock)resolve withRejecter:(RCTPromiseRejectBlock)reject)
6
+
7
+ + (BOOL)requiresMainQueueSetup
8
+ {
9
+ return NO;
10
+ }
11
+
12
+ @end
@@ -0,0 +1,15 @@
1
+ import IOSSecuritySuite
2
+
3
+ @objc(SecuritySuite)
4
+ class SecuritySuite: NSObject {
5
+
6
+ @objc(deviceHasSecurityRisk:withRejecter:)
7
+ func deviceHasSecurityRisk(resolve:RCTPromiseResolveBlock, reject:RCTPromiseRejectBlock) -> Void {
8
+ do {
9
+ let jailbreakStatus = IOSSecuritySuite.amIJailbrokenWithFailMessage()
10
+ resolve(jailbreakStatus.jailbroken)
11
+ } catch {
12
+ reject("ERROR", nil, nil)
13
+ }
14
+ }
15
+ }
@@ -0,0 +1,293 @@
1
+ // !$*UTF8*$!
2
+ {
3
+ archiveVersion = 1;
4
+ classes = {
5
+ };
6
+ objectVersion = 46;
7
+ objects = {
8
+
9
+ /* Begin PBXBuildFile section */
10
+
11
+ 5E555C0D2413F4C50049A1A2 /* SecuritySuite.m in Sources */ = {isa = PBXBuildFile; fileRef = B3E7B5891CC2AC0600A0062D /* SecuritySuite.m */; };
12
+ F4FF95D7245B92E800C19C63 /* SecuritySuite.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4FF95D6245B92E800C19C63 /* SecuritySuite.swift */; };
13
+
14
+ /* End PBXBuildFile section */
15
+
16
+ /* Begin PBXCopyFilesBuildPhase section */
17
+ 58B511D91A9E6C8500147676 /* CopyFiles */ = {
18
+ isa = PBXCopyFilesBuildPhase;
19
+ buildActionMask = 2147483647;
20
+ dstPath = "include/$(PRODUCT_NAME)";
21
+ dstSubfolderSpec = 16;
22
+ files = (
23
+ );
24
+ runOnlyForDeploymentPostprocessing = 0;
25
+ };
26
+ /* End PBXCopyFilesBuildPhase section */
27
+
28
+ /* Begin PBXFileReference section */
29
+ 134814201AA4EA6300B7C361 /* libSecuritySuite.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libSecuritySuite.a; sourceTree = BUILT_PRODUCTS_DIR; };
30
+
31
+ B3E7B5891CC2AC0600A0062D /* SecuritySuite.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SecuritySuite.m; sourceTree = "<group>"; };
32
+ F4FF95D5245B92E700C19C63 /* SecuritySuite-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SecuritySuite-Bridging-Header.h"; sourceTree = "<group>"; };
33
+ F4FF95D6245B92E800C19C63 /* SecuritySuite.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecuritySuite.swift; sourceTree = "<group>"; };
34
+
35
+ /* End PBXFileReference section */
36
+
37
+ /* Begin PBXFrameworksBuildPhase section */
38
+ 58B511D81A9E6C8500147676 /* Frameworks */ = {
39
+ isa = PBXFrameworksBuildPhase;
40
+ buildActionMask = 2147483647;
41
+ files = (
42
+ );
43
+ runOnlyForDeploymentPostprocessing = 0;
44
+ };
45
+ /* End PBXFrameworksBuildPhase section */
46
+
47
+ /* Begin PBXGroup section */
48
+ 134814211AA4EA7D00B7C361 /* Products */ = {
49
+ isa = PBXGroup;
50
+ children = (
51
+ 134814201AA4EA6300B7C361 /* libSecuritySuite.a */,
52
+ );
53
+ name = Products;
54
+ sourceTree = "<group>";
55
+ };
56
+ 58B511D21A9E6C8500147676 = {
57
+ isa = PBXGroup;
58
+ children = (
59
+
60
+ F4FF95D6245B92E800C19C63 /* SecuritySuite.swift */,
61
+ B3E7B5891CC2AC0600A0062D /* SecuritySuite.m */,
62
+ F4FF95D5245B92E700C19C63 /* SecuritySuite-Bridging-Header.h */,
63
+
64
+ 134814211AA4EA7D00B7C361 /* Products */,
65
+ );
66
+ sourceTree = "<group>";
67
+ };
68
+ /* End PBXGroup section */
69
+
70
+ /* Begin PBXNativeTarget section */
71
+ 58B511DA1A9E6C8500147676 /* SecuritySuite */ = {
72
+ isa = PBXNativeTarget;
73
+ buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "SecuritySuite" */;
74
+ buildPhases = (
75
+ 58B511D71A9E6C8500147676 /* Sources */,
76
+ 58B511D81A9E6C8500147676 /* Frameworks */,
77
+ 58B511D91A9E6C8500147676 /* CopyFiles */,
78
+ );
79
+ buildRules = (
80
+ );
81
+ dependencies = (
82
+ );
83
+ name = SecuritySuite;
84
+ productName = RCTDataManager;
85
+ productReference = 134814201AA4EA6300B7C361 /* libSecuritySuite.a */;
86
+ productType = "com.apple.product-type.library.static";
87
+ };
88
+ /* End PBXNativeTarget section */
89
+
90
+ /* Begin PBXProject section */
91
+ 58B511D31A9E6C8500147676 /* Project object */ = {
92
+ isa = PBXProject;
93
+ attributes = {
94
+ LastUpgradeCheck = 0920;
95
+ ORGANIZATIONNAME = Facebook;
96
+ TargetAttributes = {
97
+ 58B511DA1A9E6C8500147676 = {
98
+ CreatedOnToolsVersion = 6.1.1;
99
+ };
100
+ };
101
+ };
102
+ buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "SecuritySuite" */;
103
+ compatibilityVersion = "Xcode 3.2";
104
+ developmentRegion = English;
105
+ hasScannedForEncodings = 0;
106
+ knownRegions = (
107
+ English,
108
+ en,
109
+ );
110
+ mainGroup = 58B511D21A9E6C8500147676;
111
+ productRefGroup = 58B511D21A9E6C8500147676;
112
+ projectDirPath = "";
113
+ projectRoot = "";
114
+ targets = (
115
+ 58B511DA1A9E6C8500147676 /* SecuritySuite */,
116
+ );
117
+ };
118
+ /* End PBXProject section */
119
+
120
+ /* Begin PBXSourcesBuildPhase section */
121
+ 58B511D71A9E6C8500147676 /* Sources */ = {
122
+ isa = PBXSourcesBuildPhase;
123
+ buildActionMask = 2147483647;
124
+ files = (
125
+
126
+ F4FF95D7245B92E800C19C63 /* SecuritySuite.swift in Sources */,
127
+ B3E7B58A1CC2AC0600A0062D /* SecuritySuite.m in Sources */,
128
+
129
+ );
130
+ runOnlyForDeploymentPostprocessing = 0;
131
+ };
132
+ /* End PBXSourcesBuildPhase section */
133
+
134
+ /* Begin XCBuildConfiguration section */
135
+ 58B511ED1A9E6C8500147676 /* Debug */ = {
136
+ isa = XCBuildConfiguration;
137
+ buildSettings = {
138
+ ALWAYS_SEARCH_USER_PATHS = NO;
139
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
140
+ CLANG_CXX_LIBRARY = "libc++";
141
+ CLANG_ENABLE_MODULES = YES;
142
+ CLANG_ENABLE_OBJC_ARC = YES;
143
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
144
+ CLANG_WARN_BOOL_CONVERSION = YES;
145
+ CLANG_WARN_COMMA = YES;
146
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
147
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
148
+ CLANG_WARN_EMPTY_BODY = YES;
149
+ CLANG_WARN_ENUM_CONVERSION = YES;
150
+ CLANG_WARN_INFINITE_RECURSION = YES;
151
+ CLANG_WARN_INT_CONVERSION = YES;
152
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
153
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
154
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
155
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
156
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
157
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
158
+ CLANG_WARN_UNREACHABLE_CODE = YES;
159
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
160
+ COPY_PHASE_STRIP = NO;
161
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
162
+ ENABLE_TESTABILITY = YES;
163
+ GCC_C_LANGUAGE_STANDARD = gnu99;
164
+ GCC_DYNAMIC_NO_PIC = NO;
165
+ GCC_NO_COMMON_BLOCKS = YES;
166
+ GCC_OPTIMIZATION_LEVEL = 0;
167
+ GCC_PREPROCESSOR_DEFINITIONS = (
168
+ "DEBUG=1",
169
+ "$(inherited)",
170
+ );
171
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
172
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
173
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
174
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
175
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
176
+ GCC_WARN_UNUSED_FUNCTION = YES;
177
+ GCC_WARN_UNUSED_VARIABLE = YES;
178
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
179
+ MTL_ENABLE_DEBUG_INFO = YES;
180
+ ONLY_ACTIVE_ARCH = YES;
181
+ SDKROOT = iphoneos;
182
+ };
183
+ name = Debug;
184
+ };
185
+ 58B511EE1A9E6C8500147676 /* Release */ = {
186
+ isa = XCBuildConfiguration;
187
+ buildSettings = {
188
+ ALWAYS_SEARCH_USER_PATHS = NO;
189
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
190
+ CLANG_CXX_LIBRARY = "libc++";
191
+ CLANG_ENABLE_MODULES = YES;
192
+ CLANG_ENABLE_OBJC_ARC = YES;
193
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
194
+ CLANG_WARN_BOOL_CONVERSION = YES;
195
+ CLANG_WARN_COMMA = YES;
196
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
197
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
198
+ CLANG_WARN_EMPTY_BODY = YES;
199
+ CLANG_WARN_ENUM_CONVERSION = YES;
200
+ CLANG_WARN_INFINITE_RECURSION = YES;
201
+ CLANG_WARN_INT_CONVERSION = YES;
202
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
203
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
204
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
205
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
206
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
207
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
208
+ CLANG_WARN_UNREACHABLE_CODE = YES;
209
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
210
+ COPY_PHASE_STRIP = YES;
211
+ ENABLE_NS_ASSERTIONS = NO;
212
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
213
+ GCC_C_LANGUAGE_STANDARD = gnu99;
214
+ GCC_NO_COMMON_BLOCKS = YES;
215
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
216
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
217
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
218
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
219
+ GCC_WARN_UNUSED_FUNCTION = YES;
220
+ GCC_WARN_UNUSED_VARIABLE = YES;
221
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
222
+ MTL_ENABLE_DEBUG_INFO = NO;
223
+ SDKROOT = iphoneos;
224
+ VALIDATE_PRODUCT = YES;
225
+ };
226
+ name = Release;
227
+ };
228
+ 58B511F01A9E6C8500147676 /* Debug */ = {
229
+ isa = XCBuildConfiguration;
230
+ buildSettings = {
231
+ HEADER_SEARCH_PATHS = (
232
+ "$(inherited)",
233
+ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
234
+ "$(SRCROOT)/../../../React/**",
235
+ "$(SRCROOT)/../../react-native/React/**",
236
+ );
237
+ LIBRARY_SEARCH_PATHS = "$(inherited)";
238
+ OTHER_LDFLAGS = "-ObjC";
239
+ PRODUCT_NAME = SecuritySuite;
240
+ SKIP_INSTALL = YES;
241
+
242
+ SWIFT_OBJC_BRIDGING_HEADER = "SecuritySuite-Bridging-Header.h";
243
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
244
+ SWIFT_VERSION = 5.0;
245
+
246
+ };
247
+ name = Debug;
248
+ };
249
+ 58B511F11A9E6C8500147676 /* Release */ = {
250
+ isa = XCBuildConfiguration;
251
+ buildSettings = {
252
+ HEADER_SEARCH_PATHS = (
253
+ "$(inherited)",
254
+ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
255
+ "$(SRCROOT)/../../../React/**",
256
+ "$(SRCROOT)/../../react-native/React/**",
257
+ );
258
+ LIBRARY_SEARCH_PATHS = "$(inherited)";
259
+ OTHER_LDFLAGS = "-ObjC";
260
+ PRODUCT_NAME = SecuritySuite;
261
+ SKIP_INSTALL = YES;
262
+
263
+ SWIFT_OBJC_BRIDGING_HEADER = "SecuritySuite-Bridging-Header.h";
264
+ SWIFT_VERSION = 5.0;
265
+
266
+ };
267
+ name = Release;
268
+ };
269
+ /* End XCBuildConfiguration section */
270
+
271
+ /* Begin XCConfigurationList section */
272
+ 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "SecuritySuite" */ = {
273
+ isa = XCConfigurationList;
274
+ buildConfigurations = (
275
+ 58B511ED1A9E6C8500147676 /* Debug */,
276
+ 58B511EE1A9E6C8500147676 /* Release */,
277
+ );
278
+ defaultConfigurationIsVisible = 0;
279
+ defaultConfigurationName = Release;
280
+ };
281
+ 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "SecuritySuite" */ = {
282
+ isa = XCConfigurationList;
283
+ buildConfigurations = (
284
+ 58B511F01A9E6C8500147676 /* Debug */,
285
+ 58B511F11A9E6C8500147676 /* Release */,
286
+ );
287
+ defaultConfigurationIsVisible = 0;
288
+ defaultConfigurationName = Release;
289
+ };
290
+ /* End XCConfigurationList section */
291
+ };
292
+ rootObject = 58B511D31A9E6C8500147676 /* Project object */;
293
+ }
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Workspace
3
+ version = "1.0">
4
+ </Workspace>
@@ -0,0 +1,8 @@
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>IDEDidComputeMac32BitWarning</key>
6
+ <true/>
7
+ </dict>
8
+ </plist>
@@ -0,0 +1,14 @@
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>SchemeUserState</key>
6
+ <dict>
7
+ <key>SecuritySuite.xcscheme_^#shared#^_</key>
8
+ <dict>
9
+ <key>orderHint</key>
10
+ <integer>0</integer>
11
+ </dict>
12
+ </dict>
13
+ </dict>
14
+ </plist>
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ exports.deviceHasSecurityRisk = deviceHasSecurityRisk;
8
+
9
+ var _reactNative = require("react-native");
10
+
11
+ const LINKING_ERROR = `The package 'react-native-security-suite' doesn't seem to be linked. Make sure: \n\n` + _reactNative.Platform.select({
12
+ ios: "- You have run 'pod install'\n",
13
+ default: ''
14
+ }) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo managed workflow\n';
15
+ const SecuritySuite = _reactNative.NativeModules.SecuritySuite ? _reactNative.NativeModules.SecuritySuite : new Proxy({}, {
16
+ get() {
17
+ throw new Error(LINKING_ERROR);
18
+ }
19
+
20
+ });
21
+
22
+ function deviceHasSecurityRisk() {
23
+ return SecuritySuite.deviceHasSecurityRisk();
24
+ }
25
+
26
+ var _default = SecuritySuite;
27
+ exports.default = _default;
28
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["LINKING_ERROR","Platform","select","ios","default","SecuritySuite","NativeModules","Proxy","get","Error","deviceHasSecurityRisk"],"sources":["index.tsx"],"sourcesContent":["import { NativeModules, Platform } from 'react-native';\n\nconst LINKING_ERROR =\n `The package 'react-native-security-suite' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo managed workflow\\n';\n\nconst SecuritySuite = NativeModules.SecuritySuite\n ? NativeModules.SecuritySuite\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n \nexport function deviceHasSecurityRisk(): Promise<boolean> {\n return SecuritySuite.deviceHasSecurityRisk();\n}\n\nexport default SecuritySuite;"],"mappings":";;;;;;;;AAAA;;AAEA,MAAMA,aAAa,GAChB,sFAAD,GACAC,qBAAA,CAASC,MAAT,CAAgB;EAAEC,GAAG,EAAE,gCAAP;EAAyCC,OAAO,EAAE;AAAlD,CAAhB,CADA,GAEA,sDAFA,GAGA,6CAJF;AAMA,MAAMC,aAAa,GAAGC,0BAAA,CAAcD,aAAd,GAClBC,0BAAA,CAAcD,aADI,GAElB,IAAIE,KAAJ,CACE,EADF,EAEE;EACEC,GAAG,GAAG;IACJ,MAAM,IAAIC,KAAJ,CAAUT,aAAV,CAAN;EACD;;AAHH,CAFF,CAFJ;;AAWO,SAASU,qBAAT,GAAmD;EACxD,OAAOL,aAAa,CAACK,qBAAd,EAAP;AACD;;eAEcL,a"}
@@ -0,0 +1,16 @@
1
+ import { NativeModules, Platform } from 'react-native';
2
+ const LINKING_ERROR = `The package 'react-native-security-suite' doesn't seem to be linked. Make sure: \n\n` + Platform.select({
3
+ ios: "- You have run 'pod install'\n",
4
+ default: ''
5
+ }) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo managed workflow\n';
6
+ const SecuritySuite = NativeModules.SecuritySuite ? NativeModules.SecuritySuite : new Proxy({}, {
7
+ get() {
8
+ throw new Error(LINKING_ERROR);
9
+ }
10
+
11
+ });
12
+ export function deviceHasSecurityRisk() {
13
+ return SecuritySuite.deviceHasSecurityRisk();
14
+ }
15
+ export default SecuritySuite;
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NativeModules","Platform","LINKING_ERROR","select","ios","default","SecuritySuite","Proxy","get","Error","deviceHasSecurityRisk"],"sources":["index.tsx"],"sourcesContent":["import { NativeModules, Platform } from 'react-native';\n\nconst LINKING_ERROR =\n `The package 'react-native-security-suite' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo managed workflow\\n';\n\nconst SecuritySuite = NativeModules.SecuritySuite\n ? NativeModules.SecuritySuite\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n \nexport function deviceHasSecurityRisk(): Promise<boolean> {\n return SecuritySuite.deviceHasSecurityRisk();\n}\n\nexport default SecuritySuite;"],"mappings":"AAAA,SAASA,aAAT,EAAwBC,QAAxB,QAAwC,cAAxC;AAEA,MAAMC,aAAa,GAChB,sFAAD,GACAD,QAAQ,CAACE,MAAT,CAAgB;EAAEC,GAAG,EAAE,gCAAP;EAAyCC,OAAO,EAAE;AAAlD,CAAhB,CADA,GAEA,sDAFA,GAGA,6CAJF;AAMA,MAAMC,aAAa,GAAGN,aAAa,CAACM,aAAd,GAClBN,aAAa,CAACM,aADI,GAElB,IAAIC,KAAJ,CACE,EADF,EAEE;EACEC,GAAG,GAAG;IACJ,MAAM,IAAIC,KAAJ,CAAUP,aAAV,CAAN;EACD;;AAHH,CAFF,CAFJ;AAWA,OAAO,SAASQ,qBAAT,GAAmD;EACxD,OAAOJ,aAAa,CAACI,qBAAd,EAAP;AACD;AAED,eAAeJ,aAAf"}
@@ -0,0 +1,3 @@
1
+ declare const SecuritySuite: any;
2
+ export declare function deviceHasSecurityRisk(): Promise<boolean>;
3
+ export default SecuritySuite;
package/package.json ADDED
@@ -0,0 +1,153 @@
1
+ {
2
+ "name": "react-native-security-suite",
3
+ "version": "0.1.0",
4
+ "description": "Security suite for React Native",
5
+ "main": "lib/commonjs/index",
6
+ "module": "lib/module/index",
7
+ "types": "lib/typescript/index.d.ts",
8
+ "react-native": "src/index",
9
+ "source": "src/index",
10
+ "files": [
11
+ "src",
12
+ "lib",
13
+ "android",
14
+ "ios",
15
+ "cpp",
16
+ "react-native-security-suite.podspec",
17
+ "!lib/typescript/example",
18
+ "!android/build",
19
+ "!ios/build",
20
+ "!**/__tests__",
21
+ "!**/__fixtures__",
22
+ "!**/__mocks__"
23
+ ],
24
+ "scripts": {
25
+ "test": "jest",
26
+ "typescript": "tsc --noEmit",
27
+ "lint": "eslint \"**/*.{js,ts,tsx}\"",
28
+ "prepare": "bob build",
29
+ "release": "release-it",
30
+ "example": "yarn --cwd example",
31
+ "pods": "cd example && pod-install --quiet",
32
+ "bootstrap": "yarn example && yarn && yarn pods"
33
+ },
34
+ "keywords": [
35
+ "react-native",
36
+ "ios",
37
+ "android"
38
+ ],
39
+ "repository": {
40
+ "type": "git",
41
+ "url": "https://mohammadnavabi.ir"
42
+ },
43
+ "author": "Mohammad Navabi <navabifar@gmail.com> (https://mohammadnavabi.ir)",
44
+ "license": "MIT",
45
+ "bugs": {
46
+ "url": "https://mohammadnavabi.ir/issues"
47
+ },
48
+ "homepage": "https://mohammadnavabi.ir#readme",
49
+ "publishConfig": {
50
+ "registry": "https://registry.npmjs.org/"
51
+ },
52
+ "devDependencies": {
53
+ "@commitlint/config-conventional": "^11.0.0",
54
+ "@react-native-community/eslint-config": "^2.0.0",
55
+ "@release-it/conventional-changelog": "^2.0.0",
56
+ "@types/jest": "^26.0.0",
57
+ "@types/react": "^16.9.19",
58
+ "@types/react-native": "0.62.13",
59
+ "commitlint": "^11.0.0",
60
+ "eslint": "^7.2.0",
61
+ "eslint-config-prettier": "^7.0.0",
62
+ "eslint-plugin-prettier": "^3.1.3",
63
+ "husky": "^6.0.0",
64
+ "jest": "^26.0.1",
65
+ "pod-install": "^0.1.0",
66
+ "prettier": "^2.0.5",
67
+ "react": "16.13.1",
68
+ "react-native": "0.63.4",
69
+ "react-native-builder-bob": "^0.18.3",
70
+ "release-it": "^14.2.2",
71
+ "typescript": "^4.1.3"
72
+ },
73
+ "peerDependencies": {
74
+ "react": "*",
75
+ "react-native": "*"
76
+ },
77
+ "jest": {
78
+ "preset": "react-native",
79
+ "modulePathIgnorePatterns": [
80
+ "<rootDir>/example/node_modules",
81
+ "<rootDir>/lib/"
82
+ ]
83
+ },
84
+ "commitlint": {
85
+ "extends": [
86
+ "@commitlint/config-conventional"
87
+ ]
88
+ },
89
+ "release-it": {
90
+ "git": {
91
+ "commitMessage": "chore: release ${version}",
92
+ "tagName": "v${version}"
93
+ },
94
+ "npm": {
95
+ "publish": true
96
+ },
97
+ "github": {
98
+ "release": true
99
+ },
100
+ "plugins": {
101
+ "@release-it/conventional-changelog": {
102
+ "preset": "angular"
103
+ }
104
+ }
105
+ },
106
+ "eslintConfig": {
107
+ "root": true,
108
+ "extends": [
109
+ "@react-native-community",
110
+ "prettier"
111
+ ],
112
+ "rules": {
113
+ "prettier/prettier": [
114
+ "error",
115
+ {
116
+ "quoteProps": "consistent",
117
+ "singleQuote": true,
118
+ "tabWidth": 2,
119
+ "trailingComma": "es5",
120
+ "useTabs": false
121
+ }
122
+ ]
123
+ }
124
+ },
125
+ "eslintIgnore": [
126
+ "node_modules/",
127
+ "lib/"
128
+ ],
129
+ "prettier": {
130
+ "quoteProps": "consistent",
131
+ "singleQuote": true,
132
+ "tabWidth": 2,
133
+ "trailingComma": "es5",
134
+ "useTabs": false
135
+ },
136
+ "react-native-builder-bob": {
137
+ "source": "src",
138
+ "output": "lib",
139
+ "targets": [
140
+ "commonjs",
141
+ "module",
142
+ [
143
+ "typescript",
144
+ {
145
+ "project": "tsconfig.build.json"
146
+ }
147
+ ]
148
+ ]
149
+ },
150
+ "directories": {
151
+ "example": "example"
152
+ }
153
+ }
@@ -0,0 +1,20 @@
1
+ require "json"
2
+
3
+ package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4
+
5
+ Pod::Spec.new do |s|
6
+ s.name = "react-native-security-suite"
7
+ s.version = package["version"]
8
+ s.summary = package["description"]
9
+ s.homepage = package["homepage"]
10
+ s.license = package["license"]
11
+ s.authors = package["author"]
12
+
13
+ s.platforms = { :ios => "10.0" }
14
+ s.source = { :git => "https://mohammadnavabi.ir.git", :tag => "#{s.version}" }
15
+
16
+ s.source_files = "ios/**/*.{h,m,mm,swift}"
17
+
18
+ s.dependency "React-Core"
19
+ s.dependency "IOSSecuritySuite"
20
+ end
package/src/index.tsx ADDED
@@ -0,0 +1,24 @@
1
+ import { NativeModules, Platform } from 'react-native';
2
+
3
+ const LINKING_ERROR =
4
+ `The package 'react-native-security-suite' doesn't seem to be linked. Make sure: \n\n` +
5
+ Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
6
+ '- You rebuilt the app after installing the package\n' +
7
+ '- You are not using Expo managed workflow\n';
8
+
9
+ const SecuritySuite = NativeModules.SecuritySuite
10
+ ? NativeModules.SecuritySuite
11
+ : new Proxy(
12
+ {},
13
+ {
14
+ get() {
15
+ throw new Error(LINKING_ERROR);
16
+ },
17
+ }
18
+ );
19
+
20
+ export function deviceHasSecurityRisk(): Promise<boolean> {
21
+ return SecuritySuite.deviceHasSecurityRisk();
22
+ }
23
+
24
+ export default SecuritySuite;