freerasp-react-native 3.13.0 → 3.14.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.
Files changed (123) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/README.md +4 -2
  3. package/android/build.gradle +3 -3
  4. package/android/gradle.properties +2 -2
  5. package/android/proguard-rules.pro +8 -0
  6. package/android/src/main/java/com/freeraspreactnative/FreeraspReactNativeModule.kt +59 -10
  7. package/android/src/main/java/com/freeraspreactnative/FreeraspThreatHandler.kt +8 -0
  8. package/android/src/main/java/com/freeraspreactnative/ScreenProtector.kt +164 -0
  9. package/android/src/main/java/com/freeraspreactnative/Threat.kt +5 -1
  10. package/android/src/main/java/com/freeraspreactnative/utils/Extensions.kt +1 -1
  11. package/example/Gemfile +6 -2
  12. package/example/Gemfile.lock +121 -0
  13. package/example/android/app/build.gradle +64 -265
  14. package/example/android/app/src/debug/AndroidManifest.xml +1 -5
  15. package/example/android/app/src/main/AndroidManifest.xml +5 -3
  16. package/example/android/app/src/main/java/com/freerasp/rn/example/MainActivity.kt +22 -0
  17. package/example/android/app/src/main/java/com/freerasp/rn/example/MainApplication.kt +44 -0
  18. package/example/android/app/src/main/res/drawable/rn_edit_text_material.xml +3 -2
  19. package/example/android/app/src/main/res/values/strings.xml +1 -1
  20. package/example/android/build.gradle +16 -45
  21. package/example/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  22. package/example/android/gradle/wrapper/gradle-wrapper.properties +3 -1
  23. package/example/android/gradle.properties +5 -6
  24. package/example/android/gradlew +30 -13
  25. package/example/android/gradlew.bat +21 -16
  26. package/example/android/settings.gradle +5 -10
  27. package/example/app.json +3 -3
  28. package/example/index.js +4 -0
  29. package/example/ios/FreeraspRNExample/AppDelegate.swift +30 -0
  30. package/example/ios/{FreeraspReactNativeExample → FreeraspRNExample}/Info.plist +8 -12
  31. package/example/ios/{FreeraspReactNativeExample → FreeraspRNExample}/LaunchScreen.storyboard +1 -1
  32. package/example/ios/FreeraspRNExample/PrivacyInfo.xcprivacy +37 -0
  33. package/example/ios/FreeraspRNExample.xcodeproj/project.pbxproj +488 -0
  34. package/example/ios/{FreeraspReactNativeExample.xcodeproj/xcshareddata/xcschemes/FreeraspReactNativeExample.xcscheme → FreeraspRNExample.xcodeproj/xcshareddata/xcschemes/FreeraspRNExample.xcscheme} +12 -12
  35. package/example/ios/{FreeraspReactNativeExample.xcworkspace → FreeraspRNExample.xcworkspace}/contents.xcworkspacedata +1 -1
  36. package/example/ios/Podfile +19 -32
  37. package/example/metro.config.js +13 -14
  38. package/example/package.json +23 -12
  39. package/example/src/App.tsx +18 -0
  40. package/example/src/DemoApp.tsx +181 -79
  41. package/example/src/MalwareModal.tsx +2 -12
  42. package/example/src/checks.ts +2 -0
  43. package/example/yarn.lock +3825 -1613
  44. package/ios/FreeraspReactNative.swift +6 -2
  45. package/ios/TalsecRuntime.xcframework/Info.plist +5 -5
  46. package/ios/TalsecRuntime.xcframework/_CodeSignature/CodeDirectory +0 -0
  47. package/ios/TalsecRuntime.xcframework/_CodeSignature/CodeRequirements-1 +0 -0
  48. package/ios/TalsecRuntime.xcframework/_CodeSignature/CodeResources +87 -87
  49. package/ios/TalsecRuntime.xcframework/_CodeSignature/CodeSignature +0 -0
  50. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/CurlWrapper.h +1 -1
  51. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/TalsecRuntime-Swift.h +1 -1
  52. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/curl.h +7 -7
  53. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/multi.h +4 -4
  54. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/options.h +1 -1
  55. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/urlapi.h +1 -1
  56. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Info.plist +0 -0
  57. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.abi.json +316 -178
  58. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.private.swiftinterface +2 -0
  59. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  60. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.swiftinterface +2 -0
  61. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/TalsecRuntime +0 -0
  62. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/CurlWrapper.h +1 -1
  63. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/TalsecRuntime-Swift.h +2 -2
  64. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/curl.h +7 -7
  65. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/multi.h +4 -4
  66. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/options.h +1 -1
  67. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/urlapi.h +1 -1
  68. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Info.plist +0 -0
  69. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.abi.json +316 -178
  70. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +2 -0
  71. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  72. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.swiftinterface +2 -0
  73. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.abi.json +316 -178
  74. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +2 -0
  75. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  76. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +2 -0
  77. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/TalsecRuntime +0 -0
  78. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/_CodeSignature/CodeResources +33 -33
  79. package/lib/commonjs/index.js +25 -3
  80. package/lib/commonjs/index.js.map +1 -1
  81. package/lib/commonjs/threat.js +3 -1
  82. package/lib/commonjs/threat.js.map +1 -1
  83. package/lib/module/index.js +19 -1
  84. package/lib/module/index.js.map +1 -1
  85. package/lib/module/threat.js +3 -1
  86. package/lib/module/threat.js.map +1 -1
  87. package/lib/typescript/src/index.d.ts +2 -0
  88. package/lib/typescript/src/index.d.ts.map +1 -1
  89. package/lib/typescript/src/threat.d.ts +2 -0
  90. package/lib/typescript/src/threat.d.ts.map +1 -1
  91. package/lib/typescript/src/types.d.ts +2 -0
  92. package/lib/typescript/src/types.d.ts.map +1 -1
  93. package/package.json +1 -1
  94. package/src/index.tsx +24 -0
  95. package/src/threat.ts +6 -0
  96. package/src/types.ts +2 -0
  97. package/example/android/app/_BUCK +0 -55
  98. package/example/android/app/build_defs.bzl +0 -19
  99. package/example/android/app/src/debug/java/com/freeraspreactnativeexample/ReactNativeFlipper.java +0 -73
  100. package/example/android/app/src/main/java/com/freeraspreactnativeexample/MainActivity.java +0 -48
  101. package/example/android/app/src/main/java/com/freeraspreactnativeexample/MainApplication.java +0 -91
  102. package/example/android/app/src/main/java/com/freeraspreactnativeexample/newarchitecture/MainApplicationReactNativeHost.java +0 -116
  103. package/example/android/app/src/main/java/com/freeraspreactnativeexample/newarchitecture/components/MainComponentsRegistry.java +0 -36
  104. package/example/android/app/src/main/java/com/freeraspreactnativeexample/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java +0 -48
  105. package/example/android/app/src/main/jni/CMakeLists.txt +0 -7
  106. package/example/android/app/src/main/jni/MainApplicationModuleProvider.cpp +0 -32
  107. package/example/android/app/src/main/jni/MainApplicationModuleProvider.h +0 -16
  108. package/example/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp +0 -45
  109. package/example/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h +0 -38
  110. package/example/android/app/src/main/jni/MainComponentsRegistry.cpp +0 -65
  111. package/example/android/app/src/main/jni/MainComponentsRegistry.h +0 -32
  112. package/example/android/app/src/main/jni/OnLoad.cpp +0 -11
  113. package/example/ios/File.swift +0 -6
  114. package/example/ios/FreeraspReactNativeExample/AppDelegate.h +0 -8
  115. package/example/ios/FreeraspReactNativeExample/AppDelegate.mm +0 -133
  116. package/example/ios/FreeraspReactNativeExample/main.m +0 -10
  117. package/example/ios/FreeraspReactNativeExample-Bridging-Header.h +0 -3
  118. package/example/ios/FreeraspReactNativeExample.xcodeproj/project.pbxproj +0 -729
  119. package/example/ios/FreeraspReactNativeExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  120. package/example/ios/FreeraspReactNativeExampleTests/FreeraspReactNativeExampleTests.m +0 -66
  121. package/example/ios/FreeraspReactNativeExampleTests/Info.plist +0 -24
  122. /package/example/ios/{FreeraspReactNativeExample → FreeraspRNExample}/Images.xcassets/AppIcon.appiconset/Contents.json +0 -0
  123. /package/example/ios/{FreeraspReactNativeExample → FreeraspRNExample}/Images.xcassets/Contents.json +0 -0
@@ -1,65 +0,0 @@
1
- #include "MainComponentsRegistry.h"
2
-
3
- #include <CoreComponentsRegistry.h>
4
- #include <fbjni/fbjni.h>
5
- #include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
6
- #include <react/renderer/components/rncore/ComponentDescriptors.h>
7
- #include <rncli.h>
8
-
9
- namespace facebook {
10
- namespace react {
11
-
12
- MainComponentsRegistry::MainComponentsRegistry(ComponentFactory *delegate) {}
13
-
14
- std::shared_ptr<ComponentDescriptorProviderRegistry const>
15
- MainComponentsRegistry::sharedProviderRegistry() {
16
- auto providerRegistry = CoreComponentsRegistry::sharedProviderRegistry();
17
-
18
- // Autolinked providers registered by RN CLI
19
- rncli_registerProviders(providerRegistry);
20
-
21
- // Custom Fabric Components go here. You can register custom
22
- // components coming from your App or from 3rd party libraries here.
23
- //
24
- // providerRegistry->add(concreteComponentDescriptorProvider<
25
- // AocViewerComponentDescriptor>());
26
- return providerRegistry;
27
- }
28
-
29
- jni::local_ref<MainComponentsRegistry::jhybriddata>
30
- MainComponentsRegistry::initHybrid(
31
- jni::alias_ref<jclass>,
32
- ComponentFactory *delegate) {
33
- auto instance = makeCxxInstance(delegate);
34
-
35
- auto buildRegistryFunction =
36
- [](EventDispatcher::Weak const &eventDispatcher,
37
- ContextContainer::Shared const &contextContainer)
38
- -> ComponentDescriptorRegistry::Shared {
39
- auto registry = MainComponentsRegistry::sharedProviderRegistry()
40
- ->createComponentDescriptorRegistry(
41
- {eventDispatcher, contextContainer});
42
-
43
- auto mutableRegistry =
44
- std::const_pointer_cast<ComponentDescriptorRegistry>(registry);
45
-
46
- mutableRegistry->setFallbackComponentDescriptor(
47
- std::make_shared<UnimplementedNativeViewComponentDescriptor>(
48
- ComponentDescriptorParameters{
49
- eventDispatcher, contextContainer, nullptr}));
50
-
51
- return registry;
52
- };
53
-
54
- delegate->buildRegistryFunction = buildRegistryFunction;
55
- return instance;
56
- }
57
-
58
- void MainComponentsRegistry::registerNatives() {
59
- registerHybrid({
60
- makeNativeMethod("initHybrid", MainComponentsRegistry::initHybrid),
61
- });
62
- }
63
-
64
- } // namespace react
65
- } // namespace facebook
@@ -1,32 +0,0 @@
1
- #pragma once
2
-
3
- #include <ComponentFactory.h>
4
- #include <fbjni/fbjni.h>
5
- #include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
6
- #include <react/renderer/componentregistry/ComponentDescriptorRegistry.h>
7
-
8
- namespace facebook {
9
- namespace react {
10
-
11
- class MainComponentsRegistry
12
- : public facebook::jni::HybridClass<MainComponentsRegistry> {
13
- public:
14
- // Adapt it to the package you used for your Java class.
15
- constexpr static auto kJavaDescriptor =
16
- "Lcom/freeraspreactnativeexample/newarchitecture/components/MainComponentsRegistry;";
17
-
18
- static void registerNatives();
19
-
20
- MainComponentsRegistry(ComponentFactory *delegate);
21
-
22
- private:
23
- static std::shared_ptr<ComponentDescriptorProviderRegistry const>
24
- sharedProviderRegistry();
25
-
26
- static jni::local_ref<jhybriddata> initHybrid(
27
- jni::alias_ref<jclass>,
28
- ComponentFactory *delegate);
29
- };
30
-
31
- } // namespace react
32
- } // namespace facebook
@@ -1,11 +0,0 @@
1
- #include <fbjni/fbjni.h>
2
- #include "MainApplicationTurboModuleManagerDelegate.h"
3
- #include "MainComponentsRegistry.h"
4
-
5
- JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) {
6
- return facebook::jni::initialize(vm, [] {
7
- facebook::react::MainApplicationTurboModuleManagerDelegate::
8
- registerNatives();
9
- facebook::react::MainComponentsRegistry::registerNatives();
10
- });
11
- }
@@ -1,6 +0,0 @@
1
- //
2
- // File.swift
3
- // FreeraspReactNativeExample
4
- //
5
-
6
- import Foundation
@@ -1,8 +0,0 @@
1
- #import <React/RCTBridgeDelegate.h>
2
- #import <UIKit/UIKit.h>
3
-
4
- @interface AppDelegate : UIResponder <UIApplicationDelegate, RCTBridgeDelegate>
5
-
6
- @property (nonatomic, strong) UIWindow *window;
7
-
8
- @end
@@ -1,133 +0,0 @@
1
- #import "AppDelegate.h"
2
-
3
- #import <React/RCTBridge.h>
4
- #import <React/RCTBundleURLProvider.h>
5
- #import <React/RCTRootView.h>
6
-
7
- #import <React/RCTAppSetupUtils.h>
8
-
9
- #if RCT_NEW_ARCH_ENABLED
10
- #import <React/CoreModulesPlugins.h>
11
- #import <React/RCTCxxBridgeDelegate.h>
12
- #import <React/RCTFabricSurfaceHostingProxyRootView.h>
13
- #import <React/RCTSurfacePresenter.h>
14
- #import <React/RCTSurfacePresenterBridgeAdapter.h>
15
- #import <ReactCommon/RCTTurboModuleManager.h>
16
-
17
- #import <react/config/ReactNativeConfig.h>
18
-
19
- static NSString *const kRNConcurrentRoot = @"concurrentRoot";
20
-
21
- @interface AppDelegate () <RCTCxxBridgeDelegate, RCTTurboModuleManagerDelegate> {
22
- RCTTurboModuleManager *_turboModuleManager;
23
- RCTSurfacePresenterBridgeAdapter *_bridgeAdapter;
24
- std::shared_ptr<const facebook::react::ReactNativeConfig> _reactNativeConfig;
25
- facebook::react::ContextContainer::Shared _contextContainer;
26
- }
27
- @end
28
- #endif
29
-
30
- @implementation AppDelegate
31
-
32
- - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
33
- {
34
- RCTAppSetupPrepareApp(application);
35
-
36
- RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
37
-
38
- #if RCT_NEW_ARCH_ENABLED
39
- _contextContainer = std::make_shared<facebook::react::ContextContainer const>();
40
- _reactNativeConfig = std::make_shared<facebook::react::EmptyReactNativeConfig const>();
41
- _contextContainer->insert("ReactNativeConfig", _reactNativeConfig);
42
- _bridgeAdapter = [[RCTSurfacePresenterBridgeAdapter alloc] initWithBridge:bridge contextContainer:_contextContainer];
43
- bridge.surfacePresenter = _bridgeAdapter.surfacePresenter;
44
- #endif
45
-
46
- NSDictionary *initProps = [self prepareInitialProps];
47
- UIView *rootView = RCTAppSetupDefaultRootView(bridge, @"FreeraspReactNativeExample", initProps);
48
-
49
- if (@available(iOS 13.0, *)) {
50
- rootView.backgroundColor = [UIColor systemBackgroundColor];
51
- } else {
52
- rootView.backgroundColor = [UIColor whiteColor];
53
- }
54
-
55
- self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
56
- UIViewController *rootViewController = [UIViewController new];
57
- rootViewController.view = rootView;
58
- self.window.rootViewController = rootViewController;
59
- [self.window makeKeyAndVisible];
60
- return YES;
61
- }
62
-
63
- /// This method controls whether the `concurrentRoot`feature of React18 is turned on or off.
64
- ///
65
- /// @see: https://reactjs.org/blog/2022/03/29/react-v18.html
66
- /// @note: This requires to be rendering on Fabric (i.e. on the New Architecture).
67
- /// @return: `true` if the `concurrentRoot` feture is enabled. Otherwise, it returns `false`.
68
- - (BOOL)concurrentRootEnabled
69
- {
70
- // Switch this bool to turn on and off the concurrent root
71
- return true;
72
- }
73
-
74
- - (NSDictionary *)prepareInitialProps
75
- {
76
- NSMutableDictionary *initProps = [NSMutableDictionary new];
77
-
78
- #ifdef RCT_NEW_ARCH_ENABLED
79
- initProps[kRNConcurrentRoot] = @([self concurrentRootEnabled]);
80
- #endif
81
-
82
- return initProps;
83
- }
84
-
85
- - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
86
- {
87
- #if DEBUG
88
- return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
89
- #else
90
- return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
91
- #endif
92
- }
93
-
94
- #if RCT_NEW_ARCH_ENABLED
95
-
96
- #pragma mark - RCTCxxBridgeDelegate
97
-
98
- - (std::unique_ptr<facebook::react::JSExecutorFactory>)jsExecutorFactoryForBridge:(RCTBridge *)bridge
99
- {
100
- _turboModuleManager = [[RCTTurboModuleManager alloc] initWithBridge:bridge
101
- delegate:self
102
- jsInvoker:bridge.jsCallInvoker];
103
- return RCTAppSetupDefaultJsExecutorFactory(bridge, _turboModuleManager);
104
- }
105
-
106
- #pragma mark RCTTurboModuleManagerDelegate
107
-
108
- - (Class)getModuleClassFromName:(const char *)name
109
- {
110
- return RCTCoreModulesClassProvider(name);
111
- }
112
-
113
- - (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:(const std::string &)name
114
- jsInvoker:(std::shared_ptr<facebook::react::CallInvoker>)jsInvoker
115
- {
116
- return nullptr;
117
- }
118
-
119
- - (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:(const std::string &)name
120
- initParams:
121
- (const facebook::react::ObjCTurboModule::InitParams &)params
122
- {
123
- return nullptr;
124
- }
125
-
126
- - (id<RCTTurboModule>)getModuleInstanceFromClass:(Class)moduleClass
127
- {
128
- return RCTAppSetupDefaultModuleFromClass(moduleClass);
129
- }
130
-
131
- #endif
132
-
133
- @end
@@ -1,10 +0,0 @@
1
- #import <UIKit/UIKit.h>
2
-
3
- #import "AppDelegate.h"
4
-
5
- int main(int argc, char *argv[])
6
- {
7
- @autoreleasepool {
8
- return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
9
- }
10
- }
@@ -1,3 +0,0 @@
1
- //
2
- // Use this file to import your target's public headers that you would like to expose to Swift.
3
- //