freerasp-react-native 1.0.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 -0
- package/README.md +413 -0
- package/android/build.gradle +87 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +4 -0
- package/android/src/main/java/com/freeraspreactnative/FreeraspReactNativeModule.kt +108 -0
- package/android/src/main/java/com/freeraspreactnative/FreeraspReactNativePackage.kt +17 -0
- package/example/Gemfile +6 -0
- package/example/android/app/_BUCK +55 -0
- package/example/android/app/build.gradle +313 -0
- package/example/android/app/build_defs.bzl +19 -0
- package/example/android/app/debug.keystore +0 -0
- package/example/android/app/proguard-rules.pro +10 -0
- package/example/android/app/src/debug/AndroidManifest.xml +13 -0
- package/example/android/app/src/debug/java/com/freeraspreactnativeexample/ReactNativeFlipper.java +73 -0
- package/example/android/app/src/main/AndroidManifest.xml +26 -0
- package/example/android/app/src/main/java/com/freeraspreactnativeexample/MainActivity.java +48 -0
- package/example/android/app/src/main/java/com/freeraspreactnativeexample/MainApplication.java +91 -0
- package/example/android/app/src/main/java/com/freeraspreactnativeexample/newarchitecture/MainApplicationReactNativeHost.java +116 -0
- package/example/android/app/src/main/java/com/freeraspreactnativeexample/newarchitecture/components/MainComponentsRegistry.java +36 -0
- package/example/android/app/src/main/java/com/freeraspreactnativeexample/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java +48 -0
- package/example/android/app/src/main/jni/CMakeLists.txt +7 -0
- package/example/android/app/src/main/jni/MainApplicationModuleProvider.cpp +32 -0
- package/example/android/app/src/main/jni/MainApplicationModuleProvider.h +16 -0
- package/example/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp +45 -0
- package/example/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h +38 -0
- package/example/android/app/src/main/jni/MainComponentsRegistry.cpp +65 -0
- package/example/android/app/src/main/jni/MainComponentsRegistry.h +32 -0
- package/example/android/app/src/main/jni/OnLoad.cpp +11 -0
- package/example/android/app/src/main/res/drawable/rn_edit_text_material.xml +36 -0
- package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/values/strings.xml +3 -0
- package/example/android/app/src/main/res/values/styles.xml +9 -0
- package/example/android/build.gradle +53 -0
- package/example/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/example/android/gradle/wrapper/gradle-wrapper.properties +5 -0
- package/example/android/gradle.properties +40 -0
- package/example/android/gradlew +234 -0
- package/example/android/gradlew.bat +89 -0
- package/example/android/settings.gradle +11 -0
- package/example/app.json +4 -0
- package/example/babel.config.js +17 -0
- package/example/index.js +5 -0
- package/example/ios/File.swift +6 -0
- package/example/ios/FreeraspReactNativeExample/AppDelegate.h +8 -0
- package/example/ios/FreeraspReactNativeExample/AppDelegate.mm +133 -0
- package/example/ios/FreeraspReactNativeExample/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
- package/example/ios/FreeraspReactNativeExample/Images.xcassets/Contents.json +6 -0
- package/example/ios/FreeraspReactNativeExample/Info.plist +55 -0
- package/example/ios/FreeraspReactNativeExample/LaunchScreen.storyboard +47 -0
- package/example/ios/FreeraspReactNativeExample/main.m +10 -0
- package/example/ios/FreeraspReactNativeExample-Bridging-Header.h +3 -0
- package/example/ios/FreeraspReactNativeExample.xcodeproj/project.pbxproj +712 -0
- package/example/ios/FreeraspReactNativeExample.xcodeproj/xcshareddata/xcschemes/FreeraspReactNativeExample.xcscheme +106 -0
- package/example/ios/FreeraspReactNativeExample.xcworkspace/contents.xcworkspacedata +10 -0
- package/example/ios/FreeraspReactNativeExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/example/ios/FreeraspReactNativeExampleTests/FreeraspReactNativeExampleTests.m +66 -0
- package/example/ios/FreeraspReactNativeExampleTests/Info.plist +24 -0
- package/example/ios/Podfile +43 -0
- package/example/ios/Podfile.lock +584 -0
- package/example/metro.config.js +40 -0
- package/example/package.json +21 -0
- package/example/react-native.config.js +10 -0
- package/example/src/App.tsx +89 -0
- package/example/yarn.lock +4154 -0
- package/freerasp-react-native.podspec +36 -0
- package/ios/Debug/TalsecRuntime.xcframework/Info.plist +40 -0
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/CryptoBridgingHeader.h +14 -0
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/CurlWrapper.h +25 -0
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/TalsecRuntime-Swift.h +222 -0
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/TalsecRuntime_iOS.h +23 -0
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/curl.h +3029 -0
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/curlver.h +77 -0
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/easy.h +123 -0
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/mprintf.h +50 -0
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/multi.h +456 -0
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/options.h +68 -0
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/stdcheaders.h +33 -0
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/system.h +504 -0
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/urlapi.h +125 -0
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Info.plist +0 -0
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.swiftinterface +51 -0
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/module.modulemap +17 -0
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/TalsecRuntime +0 -0
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/cacert.pem +3154 -0
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/module.modulemap +12 -0
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/CryptoBridgingHeader.h +14 -0
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/CurlWrapper.h +25 -0
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/TalsecRuntime-Swift.h +450 -0
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/TalsecRuntime_iOS.h +23 -0
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/curl.h +3029 -0
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/curlver.h +77 -0
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/easy.h +123 -0
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/mprintf.h +50 -0
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/multi.h +456 -0
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/options.h +68 -0
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/stdcheaders.h +33 -0
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/system.h +504 -0
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/urlapi.h +125 -0
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Info.plist +0 -0
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.swiftinterface +51 -0
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +51 -0
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/module.modulemap +17 -0
- 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 -0
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/cacert.pem +3154 -0
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/module.modulemap +12 -0
- package/ios/FreeraspReactNative-Bridging-Header.h +3 -0
- package/ios/FreeraspReactNative.m +14 -0
- package/ios/FreeraspReactNative.swift +53 -0
- package/ios/FreeraspReactNative.xcodeproj/project.pbxproj +291 -0
- package/ios/FreeraspReactNative.xcodeproj/xcshareddata/xcschemes/FreeraspReactNative.xcscheme +67 -0
- package/ios/Release/TalsecRuntime.xcframework/Info.plist +40 -0
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/CryptoBridgingHeader.h +14 -0
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/CurlWrapper.h +25 -0
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/TalsecRuntime-Swift.h +222 -0
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/TalsecRuntime_iOS.h +23 -0
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/curl.h +3029 -0
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/curlver.h +77 -0
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/easy.h +123 -0
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/mprintf.h +50 -0
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/multi.h +456 -0
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/options.h +68 -0
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/stdcheaders.h +33 -0
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/system.h +504 -0
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/urlapi.h +125 -0
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Info.plist +0 -0
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.swiftinterface +51 -0
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/module.modulemap +17 -0
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/TalsecRuntime +0 -0
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/cacert.pem +3154 -0
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/module.modulemap +12 -0
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/CryptoBridgingHeader.h +14 -0
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/CurlWrapper.h +25 -0
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/TalsecRuntime-Swift.h +450 -0
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/TalsecRuntime_iOS.h +23 -0
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/curl.h +3029 -0
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/curlver.h +77 -0
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/easy.h +123 -0
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/mprintf.h +50 -0
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/multi.h +456 -0
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/options.h +68 -0
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/stdcheaders.h +33 -0
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/system.h +504 -0
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/urlapi.h +125 -0
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Info.plist +0 -0
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.swiftinterface +51 -0
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +51 -0
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/module.modulemap +17 -0
- 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 -0
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/cacert.pem +3154 -0
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/module.modulemap +12 -0
- package/ios/TalsecRuntime.xcframework +1 -0
- package/lib/commonjs/index.js +47 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/module/index.js +36 -0
- package/lib/module/index.js.map +1 -0
- package/lib/typescript/index.d.ts +36 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/package.json +161 -0
- package/src/index.tsx +90 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 Talsec
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
in the Software without restriction, including without limitation the rights
|
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
furnished to do so, subject to the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,413 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
   
|
|
6
|
+
# freeRASP for React Native
|
|
7
|
+
|
|
8
|
+
freeRASP for React Native is a mobile in-app protection and security monitoring plugin. It aims to cover the main aspects of RASP (Runtime App Self Protection) and application shielding.
|
|
9
|
+
|
|
10
|
+
# :notebook_with_decorative_cover: Table of contents
|
|
11
|
+
|
|
12
|
+
- [Overview](#overview)
|
|
13
|
+
- [Usage](#usage)
|
|
14
|
+
* [(Optional) Create a new React Native demo application](#optional-create-a-new-react-native-demo-application)
|
|
15
|
+
* [Step 1: Install the plugin](#step-1-install-the-plugin)
|
|
16
|
+
* [Step 2: Set up the dependencies](#step-2-set-up-the-dependencies)
|
|
17
|
+
* [Step 3: Dev vs Release version](#step-3-dev-vs-release-version)
|
|
18
|
+
* [Step 4: Import freeRASP into the app](#step-4-import-freerasp-into-the-app)
|
|
19
|
+
* [Step 5: Setup the configuration, callbacks and initialize freeRASP](#step-5-setup-the-configuration-callbacks-and-initialize-freerasp)
|
|
20
|
+
* [Step 6: User Data Policies](#step-6-user-data-policies)
|
|
21
|
+
- [Security Report](#security-report)
|
|
22
|
+
- [Enterprise Services](#bar_chart-enterprise-services)
|
|
23
|
+
* [Plans Comparison](#plans-comparison)
|
|
24
|
+
|
|
25
|
+
# Overview
|
|
26
|
+
|
|
27
|
+
The freeRASP is available for Flutter, Cordova, React Native, Android, and iOS developers. We encourage community contributions, investigations of attack cases, joint data research, and other activities aiming to make better app security and app safety for end-users.
|
|
28
|
+
|
|
29
|
+
freeRASP plugin is designed to combat
|
|
30
|
+
|
|
31
|
+
* Reverse engineering attempts
|
|
32
|
+
* Re-publishing or tampering with the apps
|
|
33
|
+
* Running application in a compromised OS environment
|
|
34
|
+
* Malware, fraudsters, and cybercriminal activities
|
|
35
|
+
|
|
36
|
+
Key features are the detection and prevention of
|
|
37
|
+
|
|
38
|
+
* Root/Jailbreak (e.g., unc0ver, check1rain)
|
|
39
|
+
* Hooking framework (e.g., Frida, Shadow)
|
|
40
|
+
* Untrusted installation method
|
|
41
|
+
* App/Device (un)binding
|
|
42
|
+
|
|
43
|
+
Additional freeRASP features include low latency, easy integration and a weekly [Security Report](#security-report) containing detailed information about detected incidents and potential threats, summarizing the state of your app security.
|
|
44
|
+
|
|
45
|
+
The commercial version provides a top-notch protection level, extra features, support and maintenance. One of the most valued commercial features is AppiCrypt® - App Integrity Cryptogram.
|
|
46
|
+
|
|
47
|
+
It allows easy to implement API protection and App Integrity verification on the backend to prevent API abuse:
|
|
48
|
+
|
|
49
|
+
* Bruteforce attacks
|
|
50
|
+
* Botnets
|
|
51
|
+
* Session-hijacking
|
|
52
|
+
* DDoS
|
|
53
|
+
|
|
54
|
+
It is a unified solution that works across all mobile platforms without dependency on external web services (i.e., without extra latency, an additional point of failure, and maintenance costs).
|
|
55
|
+
|
|
56
|
+
Learn more about commercial features at [https://talsec.app](https://talsec.app).
|
|
57
|
+
|
|
58
|
+
Learn more about freemium freeRASP features at [GitHub main repository](https://github.com/talsec/Free-RASP-Community).
|
|
59
|
+
|
|
60
|
+
# Usage
|
|
61
|
+
|
|
62
|
+
We will guide you step-by-step, but you can always check the expected result in the example.
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
## (Optional) Create a new React Native demo application
|
|
66
|
+
Create a new React Native project:
|
|
67
|
+
|
|
68
|
+
$ npx react-native init AwesomeProject
|
|
69
|
+
|
|
70
|
+
## Step 1: Install the plugin
|
|
71
|
+
|
|
72
|
+
$ npm install https://github.com/talsec/Free-RASP-ReactNative.git
|
|
73
|
+
|
|
74
|
+
or
|
|
75
|
+
|
|
76
|
+
$ yarn add https://github.com/talsec/Free-RASP-ReactNative.git
|
|
77
|
+
|
|
78
|
+
## Step 2: Set up the dependencies
|
|
79
|
+
### Android
|
|
80
|
+
freeRASP needs to have access to the maven repository containing freeRASP. Add following lines into the `android/build.gradle` file, in the `allprojects.repositories` section:
|
|
81
|
+
```gradle
|
|
82
|
+
allprojects {
|
|
83
|
+
repositories {
|
|
84
|
+
google()
|
|
85
|
+
mavenCentral()
|
|
86
|
+
... your repositories
|
|
87
|
+
maven{url = uri("https://nexus3-public.monetplus.cz/repository/ahead-talsec-free-rasp")}
|
|
88
|
+
maven{url = uri("https://developer.huawei.com/repo/")}
|
|
89
|
+
maven{url = uri("https://jitpack.io")}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### iOS
|
|
95
|
+
freeRASP React Native plugin uses Pods. Navigate to the `ios` folder and run:
|
|
96
|
+
|
|
97
|
+
$ pod install
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
## Step 3: Dev vs Release version
|
|
101
|
+
The Dev version is used to not complicate the development process of the application, e.g. if you would implement killing of the application on the debugger callback. It disables some checks which won't be triggered during the development process:
|
|
102
|
+
|
|
103
|
+
* Emulator-usage (simulator)
|
|
104
|
+
* Debugging (debug)
|
|
105
|
+
* Signing (appIntegrity)
|
|
106
|
+
* Unofficial store (unofficialStore)
|
|
107
|
+
|
|
108
|
+
Which version of freeRASP is used is tied to the application's development stage - more precisely, how the application is compiled.
|
|
109
|
+
|
|
110
|
+
### Android
|
|
111
|
+
Android implementation of the React Native plugin detects selected development stage and automatically applies the suitable version of the library.
|
|
112
|
+
|
|
113
|
+
* `npx react-native run-android` (debug) -> uses dev version of freeRASP
|
|
114
|
+
* `npx react-native run-android --variant release` (release) -> uses release version of freeRASP
|
|
115
|
+
|
|
116
|
+
### iOS
|
|
117
|
+
For the iOS implemtation, it's neccesary to add script into the Xcode environment, that automatically switches between the library dev/release versions according to selected development stage. Then, it is necessary to embedd a symlink to correct TalsecRuntime.xcframework.
|
|
118
|
+
|
|
119
|
+
1. Add pre-built script for changing the Debug and Release versions of the framework:
|
|
120
|
+
* Open up the **.xcworkspace** file
|
|
121
|
+
* Go to **Product** -> **Scheme** -> **Edit Scheme...** -> **Build (dropdown arrow)** -> **Pre-actions**
|
|
122
|
+
* Hit **+** and then **New Run Script Action**
|
|
123
|
+
* Set **Provide build setting from** to your application
|
|
124
|
+
* Copy-paste following script:
|
|
125
|
+
```shell
|
|
126
|
+
cd "${SRCROOT}/../node_modules/freerasp-react-native/ios"
|
|
127
|
+
if [ "${CONFIGURATION}" = "Release" ]; then
|
|
128
|
+
rm -rf ./TalsecRuntime.xcframework
|
|
129
|
+
ln -s ./Release/TalsecRuntime.xcframework/ TalsecRuntime.xcframework
|
|
130
|
+
else
|
|
131
|
+
rm -rf ./TalsecRuntime.xcframework
|
|
132
|
+
ln -s ./Debug/TalsecRuntime.xcframework/ TalsecRuntime.xcframework
|
|
133
|
+
fi
|
|
134
|
+
```
|
|
135
|
+
* **Close**
|
|
136
|
+
3. Add dependency on the symlink
|
|
137
|
+
* Go to your **Target** -> **Build Phases** -> **Link Binary With Libraries**
|
|
138
|
+
* Add dependency (drag & drop right after **libPods**) on the symlink on the following location:
|
|
139
|
+
*AwesomeProject/node_modules/freerasp-react-native/ios/TalsecRuntime.xcframework*
|
|
140
|
+
* If there is no symlink, try to create it manually in that folder by the following command:
|
|
141
|
+
* $ ln -s ./Debug/TalsecRuntime.xcframework/ TalsecRuntime.xcframework
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
Followingly:
|
|
145
|
+
* `npx react-native run-ios` (debug) -> uses dev version of freeRASP
|
|
146
|
+
* `npx react-native run-ios --configuration Release` (release) -> uses release version of freeRASP
|
|
147
|
+
|
|
148
|
+
## Step 4: Import freeRASP into the app
|
|
149
|
+
|
|
150
|
+
We provide a custom hook that handles all required logic as registration of freeRASP, mounting and unmounting of listeners for you. Import the hook into your app:
|
|
151
|
+
|
|
152
|
+
```ts
|
|
153
|
+
import { useFreeRasp } from 'freerasp-react-native';
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## Step 5: Setup the configuration, callbacks and initialize freeRASP
|
|
157
|
+
First, the configuration and callbacks will be explained. Then the **Initialization** chapter shows the implementation.
|
|
158
|
+
### Configuration
|
|
159
|
+
You need to provide configuration for freeRASP to work properly and initialize it. The freeRASP configuration contains configs for both Android and iOS. You must fill all the required values for the plugin to work.
|
|
160
|
+
|
|
161
|
+
For Android:
|
|
162
|
+
- `packageName` - package name of your app you chose when you created it
|
|
163
|
+
- `certificateHashes` - hash of the certificate of the key which was used to sign the application. **Hash which is passed here must be encoded in Base64 form.** If you are not sure how to get your certificate hash, you can check out the guide on our [Github wiki](https://github.com/talsec/Free-RASP-Community/wiki/Getting-your-signing-certificate-hash-of-app). Multiple hashes are supported, e.g. if you are using a different one for the Huawei App Gallery.
|
|
164
|
+
- `supportedAlternativeStores` _(optional)_ - If you publish on the Google Play Store and/or Huawei AppGallery, you **don't have to assign anything** there as those are supported out of the box.
|
|
165
|
+
|
|
166
|
+
For iOS similarly to Android, `appBundleId` and `appTeamId` are required.
|
|
167
|
+
|
|
168
|
+
Lastly, pass a mail address to `watcherMail` to be able to get reports. Mail has a strict form `name@domain.com` which is passed as String.
|
|
169
|
+
|
|
170
|
+
### Callbacks
|
|
171
|
+
|
|
172
|
+
freeRASP executes periodical checks when the application is running. Handle the detected threats in the **listeners**. For example, you can log the event, show a window to the user or kill the application. Visit our [wiki](https://github.com/talsec/Free-RASP-Community/wiki/Threat-detection) to learn more details about the performed checks and their importance for app security.
|
|
173
|
+
|
|
174
|
+
### Initialization
|
|
175
|
+
|
|
176
|
+
You should initialize the freeRASP in the entry point to your app, which is usually in `App.jsx` or `App.tsx`. Just copy & paste this code inside your root component / function, then setup the configuration and reactions to listeners:
|
|
177
|
+
|
|
178
|
+
```ts
|
|
179
|
+
// app configuration
|
|
180
|
+
const config = {
|
|
181
|
+
androidConfig: {
|
|
182
|
+
packageName: 'com.awesomeproject',
|
|
183
|
+
certificateHashes: ['your_signing_certificate_hash_base64'],
|
|
184
|
+
// supportedAlternativeStores: ['storeOne', 'storeTwo'],
|
|
185
|
+
},
|
|
186
|
+
iosConfig: {
|
|
187
|
+
appBundleId: 'com.awesomeproject',
|
|
188
|
+
appTeamId: 'your_team_ID',
|
|
189
|
+
},
|
|
190
|
+
watcherMail: 'your_email_address@example.com',
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
// reactions for detected threats
|
|
194
|
+
const actions = {
|
|
195
|
+
// Android & iOS
|
|
196
|
+
'privilegedAccess': () => {
|
|
197
|
+
console.log('privilegedAccess');
|
|
198
|
+
},
|
|
199
|
+
// Android & iOS
|
|
200
|
+
'debug': () => {
|
|
201
|
+
console.log('debug');
|
|
202
|
+
},
|
|
203
|
+
// Android & iOS
|
|
204
|
+
'simulator': () => {
|
|
205
|
+
console.log('simulator');
|
|
206
|
+
},
|
|
207
|
+
// Android & iOS
|
|
208
|
+
'appIntegrity': () => {
|
|
209
|
+
console.log('appIntegrity');
|
|
210
|
+
},
|
|
211
|
+
// Android & iOS
|
|
212
|
+
'unofficialStore': () => {
|
|
213
|
+
console.log('unofficialStore');
|
|
214
|
+
},
|
|
215
|
+
// Android & iOS
|
|
216
|
+
'hooks': () => {
|
|
217
|
+
console.log('hooks');
|
|
218
|
+
},
|
|
219
|
+
// Android & iOS
|
|
220
|
+
'device binding': () => {
|
|
221
|
+
console.log('device binding');
|
|
222
|
+
},
|
|
223
|
+
// iOS only
|
|
224
|
+
'deviceID': () => {
|
|
225
|
+
console.log('deviceID');
|
|
226
|
+
},
|
|
227
|
+
// iOS only
|
|
228
|
+
'missingSecureEnclave': () => {
|
|
229
|
+
console.log('missingSecureEnclave');
|
|
230
|
+
},
|
|
231
|
+
// iOS only
|
|
232
|
+
'passcodeChange': () => {
|
|
233
|
+
console.log('passcodeChange');
|
|
234
|
+
},
|
|
235
|
+
// iOS only
|
|
236
|
+
'passcode': () => {
|
|
237
|
+
console.log('passcode');
|
|
238
|
+
},
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
useFreeRasp(config, actions);
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
When freeRASP initializes correctly, you should see `freeRASP initialized` message in logs. Otherwise, you'll see warning with description of what went wrong.
|
|
245
|
+
|
|
246
|
+
_You can override this default behavior by extending the `actions` object with `'started'` key (to change action after successful initialization), and `'initializationError'` key (to set up action after unsuccessful initialization)_
|
|
247
|
+
|
|
248
|
+
## Step 6: User Data Policies
|
|
249
|
+
|
|
250
|
+
Google Play [requires](https://support.google.com/googleplay/android-developer/answer/10787469?hl=en) all app publishers to declare how they collect and handle user data for the apps they publish on Google Play. They should inform users properly of the data collected by the apps and how the data is shared and processed. Therefore, Google will reject the apps which do not comply with the policy.
|
|
251
|
+
|
|
252
|
+
Apple has a [similar approach](https://developer.apple.com/app-store/app-privacy-details/) and specifies the types of collected data.
|
|
253
|
+
|
|
254
|
+
You should also visit our [Android](https://github.com/talsec/Free-RASP-Android) and [iOS](https://github.com/talsec/Free-RASP-iOS) submodules to learn more about their respective data policies.
|
|
255
|
+
|
|
256
|
+
And you're done 🎉!
|
|
257
|
+
|
|
258
|
+
If you encounter any other issues, you can see the list of solved issues [here](https://github.com/talsec/Free-RASP-ReactNative/issues?q=is%3Aissue+is%3Aclosed), or open up a [new one](https://github.com/talsec/Free-RASP-ReactNative/issues?q=is%3Aissue+is%3Aopen).
|
|
259
|
+
|
|
260
|
+
# Security Report
|
|
261
|
+
|
|
262
|
+
The Security Report is a weekly summary describing the application's security state and characteristics of the devices it runs on in a practical and easy-to-understand way.
|
|
263
|
+
|
|
264
|
+
The report provides a quick overview of the security incidents, their dynamics, app integrity, and reverse engineering attempts. It contains info about the security of devices, such as OS version or the ratio of devices with screen locks and biometrics. Each visualization also comes with a concise explanation.
|
|
265
|
+
|
|
266
|
+
To receive Security Reports, fill out the _watcherMail_ field in [config](#step-3-setup-the-configuration-for-your-app).
|
|
267
|
+
|
|
268
|
+

|
|
269
|
+
|
|
270
|
+
# :bar_chart: Enterprise Services
|
|
271
|
+
We provide app security hardening SDK: i.e. AppiCrypt®, Customer Data Encryption (local storage), End-to-end encryption, Strings protection (e.g. API keys) and Dynamic Certificate Pinning to our commercial customers as well. To get the most advanced protection compliant with PSD2 RT and eIDAS and support from our experts, contact us at [talsec.app](https://talsec.app).
|
|
272
|
+
|
|
273
|
+
## Commercial version
|
|
274
|
+
The commercial version provides a top-notch protection level, extra features, support, and maintenance. One of the most valued commercial features is [AppiCrypt®](https://www.talsec.app/appicrypt) - App Integrity Cryptogram.
|
|
275
|
+
|
|
276
|
+
It allows easy to implement API protection and App Integrity verification on the backend to prevent API abuse:
|
|
277
|
+
|
|
278
|
+
- Bruteforce attacks
|
|
279
|
+
- Botnets
|
|
280
|
+
- Session-hijacking
|
|
281
|
+
- DDoS
|
|
282
|
+
|
|
283
|
+
It is a unified solution that works across all mobile platforms without dependency on external web services (i.e., without extra latency, an additional point of failure, and maintenance costs).
|
|
284
|
+
|
|
285
|
+
Learn more about commercial features at [https://talsec.app](https://talsec.app/).
|
|
286
|
+
|
|
287
|
+
**TIP:** You can try freeRASP and then upgrade easily to an enterprise service.
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
## Plans Comparison
|
|
291
|
+
|
|
292
|
+
<table>
|
|
293
|
+
<thead>
|
|
294
|
+
<tr>
|
|
295
|
+
<th></th>
|
|
296
|
+
<th>freeRASP</th>
|
|
297
|
+
<th>Business RASP+</th>
|
|
298
|
+
</tr>
|
|
299
|
+
</thead>
|
|
300
|
+
<tbody>
|
|
301
|
+
<tr>
|
|
302
|
+
<td colspan=5><strong>Runtime App Self Protection (RASP, app shielding)</strong></td>
|
|
303
|
+
</tr>
|
|
304
|
+
<tr>
|
|
305
|
+
<td>Advanced root/jailbreak protections</td>
|
|
306
|
+
<td>basic</td>
|
|
307
|
+
<td>advanced</td>
|
|
308
|
+
</tr>
|
|
309
|
+
<tr>
|
|
310
|
+
<td>Runtime reverse engineering controls
|
|
311
|
+
<ul>
|
|
312
|
+
<li>Debug</li>
|
|
313
|
+
<li>Emulator</li>
|
|
314
|
+
<li>Hooking protections (e.g. Frida)</li>
|
|
315
|
+
</ul>
|
|
316
|
+
</td>
|
|
317
|
+
<td>basic</td>
|
|
318
|
+
<td>advanced</td>
|
|
319
|
+
</tr>
|
|
320
|
+
<tr>
|
|
321
|
+
<td>Runtime integrity controls
|
|
322
|
+
<ul>
|
|
323
|
+
<li>Tamper protection</li>
|
|
324
|
+
<li>Repackaging / Cloning protection</li>
|
|
325
|
+
<li>Device binding protection</li>
|
|
326
|
+
<li>Unofficial store detection</li>
|
|
327
|
+
</ul>
|
|
328
|
+
</td>
|
|
329
|
+
<td>basic</td>
|
|
330
|
+
<td>advanced</td>
|
|
331
|
+
</tr>
|
|
332
|
+
<tr>
|
|
333
|
+
<td>Device OS security status check
|
|
334
|
+
<ul>
|
|
335
|
+
<li>HW security module control</li>
|
|
336
|
+
<li>Screen lock control</li>
|
|
337
|
+
</ul>
|
|
338
|
+
</td>
|
|
339
|
+
<td>yes</td>
|
|
340
|
+
<td>yes</td>
|
|
341
|
+
</tr>
|
|
342
|
+
<tr>
|
|
343
|
+
<td>UI protection
|
|
344
|
+
<ul>
|
|
345
|
+
<li>Overlay protection</li>
|
|
346
|
+
<li>Accessibility services protection</li>
|
|
347
|
+
</ul>
|
|
348
|
+
</td>
|
|
349
|
+
<td>no</td>
|
|
350
|
+
<td>yes</td>
|
|
351
|
+
</tr>
|
|
352
|
+
<tr>
|
|
353
|
+
<td colspan=5><strong>Hardening suite</strong></td>
|
|
354
|
+
</tr>
|
|
355
|
+
<tr>
|
|
356
|
+
<td>Security hardening suite
|
|
357
|
+
<ul>
|
|
358
|
+
<li>Customer Data Encryption (local storage)</li>
|
|
359
|
+
<li>End-to-end encryption</li>
|
|
360
|
+
<li>Strings protection (e.g. API keys)</li>
|
|
361
|
+
<li>Dynamic certificate pinning</li>
|
|
362
|
+
</ul>
|
|
363
|
+
</td>
|
|
364
|
+
<td>no</td>
|
|
365
|
+
<td>yes</td>
|
|
366
|
+
</tr>
|
|
367
|
+
<tr>
|
|
368
|
+
<td colspan=5><strong>AppiCrypt® - App Integrity Cryptogram</strong></td>
|
|
369
|
+
</tr>
|
|
370
|
+
<tr>
|
|
371
|
+
<td>API protection by mobile client integrity check, online risk scoring, online fraud prevention, client App integrity check. The cryptographic proof of app & device integrity.</td>
|
|
372
|
+
<td>no</td>
|
|
373
|
+
<td>yes</td>
|
|
374
|
+
</tr>
|
|
375
|
+
<tr>
|
|
376
|
+
<td colspan=5><strong>Monitoring</strong></td>
|
|
377
|
+
</tr>
|
|
378
|
+
<tr>
|
|
379
|
+
<td>AppSec regular email reporting</td>
|
|
380
|
+
<td>yes (up to 100k devices)</td>
|
|
381
|
+
<td>yes</td>
|
|
382
|
+
</tr>
|
|
383
|
+
<tr>
|
|
384
|
+
<td>Data insights and auditing portal</td>
|
|
385
|
+
<td>no</td>
|
|
386
|
+
<td>yes</td>
|
|
387
|
+
</tr>
|
|
388
|
+
<tr>
|
|
389
|
+
<td>Embed code to integrate with portal</td>
|
|
390
|
+
<td>no</td>
|
|
391
|
+
<td>yes</td>
|
|
392
|
+
</tr>
|
|
393
|
+
<tr>
|
|
394
|
+
<td>API data access</td>
|
|
395
|
+
<td>no</td>
|
|
396
|
+
<td>yes</td>
|
|
397
|
+
</tr>
|
|
398
|
+
<td colspan=5><strong>Fair usage policy</strong></td>
|
|
399
|
+
</tr>
|
|
400
|
+
<tr>
|
|
401
|
+
<td>Mentioning of the app name in Talsec marketing communication (e.g. "Trusted by Talsec section" on social media)</td>
|
|
402
|
+
<td>over 100k downloads</td>
|
|
403
|
+
<td>no</td>
|
|
404
|
+
</tr>
|
|
405
|
+
<tr>
|
|
406
|
+
<td>Threat signals data collection to Talsec database for processing and product improvement</td>
|
|
407
|
+
<td>yes</td>
|
|
408
|
+
<td>no</td>
|
|
409
|
+
</tr>
|
|
410
|
+
</tbody>
|
|
411
|
+
</table>
|
|
412
|
+
|
|
413
|
+
For further comparison details (and planned features), follow our [discussion](https://github.com/talsec/Free-RASP-Community/discussions/5).
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
buildscript {
|
|
2
|
+
// Buildscript is evaluated before everything else so we can't use getExtOrDefault
|
|
3
|
+
def kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : project.properties["FreeraspReactNative_kotlinVersion"]
|
|
4
|
+
|
|
5
|
+
repositories {
|
|
6
|
+
google()
|
|
7
|
+
mavenCentral()
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
dependencies {
|
|
11
|
+
classpath "com.android.tools.build:gradle:7.2.1"
|
|
12
|
+
// noinspection DifferentKotlinGradleVersion
|
|
13
|
+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
def isNewArchitectureEnabled() {
|
|
18
|
+
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
apply plugin: "com.android.library"
|
|
22
|
+
apply plugin: "kotlin-android"
|
|
23
|
+
|
|
24
|
+
if (isNewArchitectureEnabled()) {
|
|
25
|
+
apply plugin: "com.facebook.react"
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
def getExtOrDefault(name) {
|
|
29
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["FreeraspReactNative_" + name]
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
def getExtOrIntegerDefault(name) {
|
|
33
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["FreeraspReactNative_" + name]).toInteger()
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
android {
|
|
37
|
+
compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
|
|
38
|
+
|
|
39
|
+
defaultConfig {
|
|
40
|
+
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
|
|
41
|
+
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
|
|
42
|
+
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
|
|
43
|
+
}
|
|
44
|
+
buildTypes {
|
|
45
|
+
release {
|
|
46
|
+
minifyEnabled false
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
lintOptions {
|
|
51
|
+
disable "GradleCompatible"
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
compileOptions {
|
|
55
|
+
sourceCompatibility JavaVersion.VERSION_1_8
|
|
56
|
+
targetCompatibility JavaVersion.VERSION_1_8
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
repositories {
|
|
62
|
+
mavenCentral()
|
|
63
|
+
google()
|
|
64
|
+
maven{url = uri("https://nexus3-public.monetplus.cz/repository/ahead-talsec-free-rasp")}
|
|
65
|
+
maven{url = uri("https://developer.huawei.com/repo/")}
|
|
66
|
+
maven{url = uri("https://jitpack.io")}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
def kotlin_version = getExtOrDefault("kotlinVersion")
|
|
70
|
+
|
|
71
|
+
dependencies {
|
|
72
|
+
// For < 0.71, this will be from the local maven repo
|
|
73
|
+
// For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin
|
|
74
|
+
//noinspection GradleDynamicVersion
|
|
75
|
+
implementation "com.facebook.react:react-native"
|
|
76
|
+
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
77
|
+
debugImplementation "com.aheaditec.talsec.security:TalsecSecurity-Community-ReactNative:6.0.0-dev"
|
|
78
|
+
releaseImplementation "com.aheaditec.talsec.security:TalsecSecurity-Community-ReactNative:6.0.0-release"
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (isNewArchitectureEnabled()) {
|
|
82
|
+
react {
|
|
83
|
+
jsRootDir = file("../src/")
|
|
84
|
+
libraryName = "FreeraspReactNative"
|
|
85
|
+
codegenJavaPackageName = "com.freeraspreactnative"
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
package com.freeraspreactnative
|
|
2
|
+
|
|
3
|
+
import com.aheaditec.talsec_security.security.api.Talsec
|
|
4
|
+
import com.aheaditec.talsec_security.security.api.TalsecConfig
|
|
5
|
+
import com.aheaditec.talsec_security.security.api.ThreatListener
|
|
6
|
+
import com.facebook.react.bridge.Arguments
|
|
7
|
+
import com.facebook.react.bridge.ReactApplicationContext
|
|
8
|
+
import com.facebook.react.bridge.ReactContextBaseJavaModule
|
|
9
|
+
import com.facebook.react.bridge.ReactMethod
|
|
10
|
+
import com.facebook.react.bridge.WritableMap
|
|
11
|
+
import com.facebook.react.bridge.ReadableMap
|
|
12
|
+
import com.facebook.react.modules.core.DeviceEventManagerModule
|
|
13
|
+
|
|
14
|
+
class FreeraspReactNativeModule(val reactContext: ReactApplicationContext) :
|
|
15
|
+
ReactContextBaseJavaModule(reactContext), ThreatListener.ThreatDetected {
|
|
16
|
+
|
|
17
|
+
private val listener = ThreatListener(this)
|
|
18
|
+
|
|
19
|
+
override fun getName(): String {
|
|
20
|
+
return NAME
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@ReactMethod
|
|
24
|
+
fun talsecStart(
|
|
25
|
+
options: ReadableMap
|
|
26
|
+
) {
|
|
27
|
+
|
|
28
|
+
try {
|
|
29
|
+
val config = parseTalsecConfig(options)
|
|
30
|
+
listener.registerListener(reactContext)
|
|
31
|
+
Talsec.start(reactContext, config)
|
|
32
|
+
sendOngoingPluginResult("started", null)
|
|
33
|
+
|
|
34
|
+
} catch (e: Exception) {
|
|
35
|
+
val params = Arguments.createMap().apply {
|
|
36
|
+
putString("message", e.message)
|
|
37
|
+
}
|
|
38
|
+
sendOngoingPluginResult("initializationError", params)
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@ReactMethod
|
|
43
|
+
fun addListener(@Suppress("UNUSED_PARAMETER") eventName: String) {
|
|
44
|
+
// Set up any upstream listeners or background tasks as necessary
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@ReactMethod
|
|
48
|
+
fun removeListeners(@Suppress("UNUSED_PARAMETER") count: Int) {
|
|
49
|
+
// Remove upstream listeners, stop unnecessary background tasks
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
override fun onRootDetected() {
|
|
53
|
+
sendOngoingPluginResult("privilegedAccess", null)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
override fun onDebuggerDetected() {
|
|
57
|
+
sendOngoingPluginResult("debug", null)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
override fun onEmulatorDetected() {
|
|
61
|
+
sendOngoingPluginResult("simulator", null)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
override fun onTamperDetected() {
|
|
65
|
+
sendOngoingPluginResult("appIntegrity", null)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
override fun onUntrustedInstallationSourceDetected() {
|
|
69
|
+
sendOngoingPluginResult("unofficialStore", null)
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
override fun onHookDetected() {
|
|
73
|
+
sendOngoingPluginResult("hooks", null)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
override fun onDeviceBindingDetected() {
|
|
77
|
+
sendOngoingPluginResult("device binding", null)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
private fun sendOngoingPluginResult(eventName: String, params: WritableMap?) {
|
|
81
|
+
reactContext
|
|
82
|
+
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java)
|
|
83
|
+
.emit(eventName, params)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
private fun parseTalsecConfig(config: ReadableMap): TalsecConfig {
|
|
87
|
+
val androidConfig = config.getMap("androidConfig")!!
|
|
88
|
+
val packageName = androidConfig.getString("packageName")!!
|
|
89
|
+
val certificateHashes = mutableListOf<String>()
|
|
90
|
+
val hashes = androidConfig.getArray("certificateHashes")!!
|
|
91
|
+
for (i in 0 until hashes.size()) {
|
|
92
|
+
certificateHashes.add(hashes.getString(i))
|
|
93
|
+
}
|
|
94
|
+
val watcherMail = config.getString("watcherMail")
|
|
95
|
+
val alternativeStores = mutableListOf<String>()
|
|
96
|
+
if (androidConfig.hasKey("supportedAlternativeStores")) {
|
|
97
|
+
val stores = androidConfig.getArray("supportedAlternativeStores")!!
|
|
98
|
+
for (i in 0 until stores.size()) {
|
|
99
|
+
alternativeStores.add(stores.getString(i))
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return TalsecConfig(packageName, certificateHashes.toTypedArray(), watcherMail, alternativeStores.toTypedArray())
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
companion object {
|
|
106
|
+
const val NAME = "FreeraspReactNative"
|
|
107
|
+
}
|
|
108
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
package com.freeraspreactnative
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.ReactPackage
|
|
4
|
+
import com.facebook.react.bridge.NativeModule
|
|
5
|
+
import com.facebook.react.bridge.ReactApplicationContext
|
|
6
|
+
import com.facebook.react.uimanager.ViewManager
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class FreeraspReactNativePackage : ReactPackage {
|
|
10
|
+
override fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> {
|
|
11
|
+
return listOf(FreeraspReactNativeModule(reactContext))
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> {
|
|
15
|
+
return emptyList()
|
|
16
|
+
}
|
|
17
|
+
}
|