freerasp-react-native 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +20 -20
- package/README.md +442 -413
- package/android/build.gradle +87 -87
- package/android/gradle.properties +4 -4
- package/android/src/main/AndroidManifest.xml +4 -4
- package/android/src/main/java/com/freeraspreactnative/FreeraspDeviceStateListener.kt +25 -0
- package/android/src/main/java/com/freeraspreactnative/FreeraspReactNativeModule.kt +113 -108
- package/android/src/main/java/com/freeraspreactnative/FreeraspReactNativePackage.kt +17 -17
- package/example/Gemfile +6 -6
- package/example/android/app/_BUCK +55 -55
- package/example/android/app/build.gradle +313 -313
- package/example/android/app/build_defs.bzl +19 -19
- package/example/android/app/proguard-rules.pro +10 -10
- package/example/android/app/src/debug/AndroidManifest.xml +13 -13
- package/example/android/app/src/debug/java/com/freeraspreactnativeexample/ReactNativeFlipper.java +73 -73
- package/example/android/app/src/main/AndroidManifest.xml +26 -26
- package/example/android/app/src/main/java/com/freeraspreactnativeexample/MainActivity.java +48 -48
- package/example/android/app/src/main/java/com/freeraspreactnativeexample/MainApplication.java +91 -91
- package/example/android/app/src/main/java/com/freeraspreactnativeexample/newarchitecture/MainApplicationReactNativeHost.java +116 -116
- package/example/android/app/src/main/java/com/freeraspreactnativeexample/newarchitecture/components/MainComponentsRegistry.java +36 -36
- package/example/android/app/src/main/java/com/freeraspreactnativeexample/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java +48 -48
- package/example/android/app/src/main/jni/CMakeLists.txt +7 -7
- package/example/android/app/src/main/jni/MainApplicationModuleProvider.cpp +32 -32
- package/example/android/app/src/main/jni/MainApplicationModuleProvider.h +16 -16
- package/example/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp +45 -45
- package/example/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h +38 -38
- package/example/android/app/src/main/jni/MainComponentsRegistry.cpp +65 -65
- package/example/android/app/src/main/jni/MainComponentsRegistry.h +32 -32
- package/example/android/app/src/main/jni/OnLoad.cpp +11 -11
- package/example/android/app/src/main/res/drawable/rn_edit_text_material.xml +36 -36
- package/example/android/app/src/main/res/values/strings.xml +3 -3
- package/example/android/app/src/main/res/values/styles.xml +9 -9
- package/example/android/build.gradle +53 -53
- package/example/android/gradle/wrapper/gradle-wrapper.properties +5 -5
- package/example/android/gradle.properties +40 -40
- package/example/android/gradlew +234 -234
- package/example/android/settings.gradle +11 -11
- package/example/app.json +3 -3
- package/example/assets/checkmark-circle-outline.png +0 -0
- package/example/assets/checkmark-circle-outline.svg +1 -0
- package/example/assets/close-circle-outline.png +0 -0
- package/example/assets/close-circle-outline.svg +1 -0
- package/example/assets/talsec-logo.png +0 -0
- package/example/babel.config.js +17 -17
- package/example/index.js +5 -5
- package/example/ios/File.swift +6 -6
- package/example/ios/FreeraspReactNativeExample/AppDelegate.h +8 -8
- package/example/ios/FreeraspReactNativeExample/AppDelegate.mm +133 -133
- package/example/ios/FreeraspReactNativeExample/Images.xcassets/AppIcon.appiconset/Contents.json +53 -53
- package/example/ios/FreeraspReactNativeExample/Images.xcassets/Contents.json +6 -6
- package/example/ios/FreeraspReactNativeExample/Info.plist +55 -55
- package/example/ios/FreeraspReactNativeExample/LaunchScreen.storyboard +47 -47
- package/example/ios/FreeraspReactNativeExample/main.m +10 -10
- package/example/ios/FreeraspReactNativeExample-Bridging-Header.h +3 -3
- package/example/ios/FreeraspReactNativeExample.xcodeproj/xcshareddata/xcschemes/FreeraspReactNativeExample.xcscheme +106 -106
- package/example/ios/FreeraspReactNativeExample.xcworkspace/contents.xcworkspacedata +10 -10
- package/example/ios/FreeraspReactNativeExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -8
- package/example/ios/FreeraspReactNativeExampleTests/FreeraspReactNativeExampleTests.m +66 -66
- package/example/ios/FreeraspReactNativeExampleTests/Info.plist +24 -24
- package/example/ios/Podfile +43 -43
- package/example/ios/Podfile.lock +590 -584
- package/example/metro.config.js +40 -40
- package/example/package.json +24 -21
- package/example/react-native.config.js +10 -10
- package/example/src/App.tsx +135 -89
- package/example/src/DemoApp.tsx +89 -0
- package/example/src/checks.ts +16 -0
- package/example/src/styles.ts +7 -0
- package/example/yarn.lock +4644 -4154
- package/freerasp-react-native.podspec +36 -36
- package/ios/Debug/TalsecRuntime.xcframework/Info.plist +40 -40
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/CryptoBridgingHeader.h +14 -14
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/CurlWrapper.h +25 -25
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/TalsecRuntime-Swift.h +222 -222
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/TalsecRuntime_iOS.h +23 -23
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/curl.h +3029 -3029
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/curlver.h +77 -77
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/easy.h +123 -123
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/mprintf.h +50 -50
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/multi.h +456 -456
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/options.h +68 -68
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/stdcheaders.h +33 -33
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/system.h +504 -504
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/urlapi.h +125 -125
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.swiftinterface +51 -51
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/module.modulemap +17 -17
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/TalsecRuntime +0 -0
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/cacert.pem +3154 -3154
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/module.modulemap +12 -12
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/CryptoBridgingHeader.h +14 -14
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/CurlWrapper.h +25 -25
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/TalsecRuntime-Swift.h +450 -450
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/TalsecRuntime_iOS.h +23 -23
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/curl.h +3029 -3029
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/curlver.h +77 -77
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/easy.h +123 -123
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/mprintf.h +50 -50
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/multi.h +456 -456
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/options.h +68 -68
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/stdcheaders.h +33 -33
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/system.h +504 -504
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/urlapi.h +125 -125
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.swiftinterface +51 -51
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +51 -51
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/module.modulemap +17 -17
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/TalsecRuntime +0 -0
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/_CodeSignature/CodeResources +344 -344
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/cacert.pem +3154 -3154
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/module.modulemap +12 -12
- package/ios/FreeraspReactNative-Bridging-Header.h +3 -3
- package/ios/FreeraspReactNative.m +14 -14
- package/ios/FreeraspReactNative.swift +57 -53
- package/ios/FreeraspReactNative.xcodeproj/xcshareddata/xcschemes/FreeraspReactNative.xcscheme +67 -67
- package/ios/Release/TalsecRuntime.xcframework/Info.plist +40 -40
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/CryptoBridgingHeader.h +14 -14
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/CurlWrapper.h +25 -25
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/TalsecRuntime-Swift.h +222 -222
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/TalsecRuntime_iOS.h +23 -23
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/curl.h +3029 -3029
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/curlver.h +77 -77
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/easy.h +123 -123
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/mprintf.h +50 -50
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/multi.h +456 -456
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/options.h +68 -68
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/stdcheaders.h +33 -33
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/system.h +504 -504
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/urlapi.h +125 -125
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.swiftinterface +51 -51
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/module.modulemap +17 -17
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/TalsecRuntime +0 -0
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/cacert.pem +3154 -3154
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/module.modulemap +12 -12
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/CryptoBridgingHeader.h +14 -14
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/CurlWrapper.h +25 -25
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/TalsecRuntime-Swift.h +450 -450
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/TalsecRuntime_iOS.h +23 -23
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/curl.h +3029 -3029
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/curlver.h +77 -77
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/easy.h +123 -123
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/mprintf.h +50 -50
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/multi.h +456 -456
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/options.h +68 -68
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/stdcheaders.h +33 -33
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/system.h +504 -504
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/urlapi.h +125 -125
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.swiftinterface +51 -51
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +51 -51
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/module.modulemap +17 -17
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/TalsecRuntime +0 -0
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/_CodeSignature/CodeResources +344 -344
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/cacert.pem +3154 -3154
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/module.modulemap +12 -12
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/index.d.ts +35 -35
- package/lib/typescript/index.d.ts.map +1 -1
- package/package.json +161 -161
- package/src/index.tsx +90 -90
- package/ios/TalsecRuntime.xcframework +0 -1
package/android/build.gradle
CHANGED
|
@@ -1,87 +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
|
-
}
|
|
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
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
FreeraspReactNative_kotlinVersion=1.7.0
|
|
2
|
-
FreeraspReactNative_minSdkVersion=21
|
|
3
|
-
FreeraspReactNative_targetSdkVersion=31
|
|
4
|
-
FreeraspReactNative_compileSdkVersion=31
|
|
1
|
+
FreeraspReactNative_kotlinVersion=1.7.0
|
|
2
|
+
FreeraspReactNative_minSdkVersion=21
|
|
3
|
+
FreeraspReactNative_targetSdkVersion=31
|
|
4
|
+
FreeraspReactNative_compileSdkVersion=31
|
|
5
5
|
FreeraspReactNative_ndkversion=21.4.7075529
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
2
|
-
package="com.freeraspreactnative">
|
|
3
|
-
|
|
4
|
-
</manifest>
|
|
1
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
2
|
+
package="com.freeraspreactnative">
|
|
3
|
+
|
|
4
|
+
</manifest>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
package com.freeraspreactnative
|
|
2
|
+
|
|
3
|
+
import com.aheaditec.talsec_security.security.api.ThreatListener
|
|
4
|
+
|
|
5
|
+
internal object FreeraspDeviceStateListener: ThreatListener.DeviceState {
|
|
6
|
+
|
|
7
|
+
internal var listener: DeviceStateListener? = null
|
|
8
|
+
|
|
9
|
+
override fun onUnlockedDeviceDetected() {
|
|
10
|
+
"unlockedDevice".let {
|
|
11
|
+
listener?.deviceStateChangeDetected("passcode")
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
override fun onHardwareBackedKeystoreNotAvailableDetected() {
|
|
16
|
+
"hardwareBackedKeystoreNotAvailable".let {
|
|
17
|
+
listener?.deviceStateChangeDetected("secureHardwareNotAvailable")
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
internal interface DeviceStateListener {
|
|
22
|
+
fun deviceStateChangeDetected(threatType: String)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
}
|
|
@@ -1,108 +1,113 @@
|
|
|
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
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
val
|
|
95
|
-
val
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
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, FreeraspDeviceStateListener.DeviceStateListener {
|
|
16
|
+
|
|
17
|
+
private val listener = ThreatListener(this, FreeraspDeviceStateListener)
|
|
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
|
+
FreeraspDeviceStateListener.listener = this
|
|
31
|
+
listener.registerListener(reactContext)
|
|
32
|
+
Talsec.start(reactContext, config)
|
|
33
|
+
sendOngoingPluginResult("started", null)
|
|
34
|
+
|
|
35
|
+
} catch (e: Exception) {
|
|
36
|
+
val params = Arguments.createMap().apply {
|
|
37
|
+
putString("message", e.message)
|
|
38
|
+
}
|
|
39
|
+
sendOngoingPluginResult("initializationError", params)
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@ReactMethod
|
|
44
|
+
fun addListener(@Suppress("UNUSED_PARAMETER") eventName: String) {
|
|
45
|
+
// Set up any upstream listeners or background tasks as necessary
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@ReactMethod
|
|
49
|
+
fun removeListeners(@Suppress("UNUSED_PARAMETER") count: Int) {
|
|
50
|
+
// Remove upstream listeners, stop unnecessary background tasks
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
override fun onRootDetected() {
|
|
54
|
+
sendOngoingPluginResult("privilegedAccess", null)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
override fun onDebuggerDetected() {
|
|
58
|
+
sendOngoingPluginResult("debug", null)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
override fun onEmulatorDetected() {
|
|
62
|
+
sendOngoingPluginResult("simulator", null)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
override fun onTamperDetected() {
|
|
66
|
+
sendOngoingPluginResult("appIntegrity", null)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
override fun onUntrustedInstallationSourceDetected() {
|
|
70
|
+
sendOngoingPluginResult("unofficialStore", null)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
override fun onHookDetected() {
|
|
74
|
+
sendOngoingPluginResult("hooks", null)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
override fun onDeviceBindingDetected() {
|
|
78
|
+
sendOngoingPluginResult("device binding", null)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
override fun deviceStateChangeDetected(threatType: String) {
|
|
82
|
+
sendOngoingPluginResult(threatType, null)
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
private fun sendOngoingPluginResult(eventName: String, params: WritableMap?) {
|
|
86
|
+
reactContext
|
|
87
|
+
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java)
|
|
88
|
+
.emit(eventName, params)
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
private fun parseTalsecConfig(config: ReadableMap): TalsecConfig {
|
|
92
|
+
val androidConfig = config.getMap("androidConfig")!!
|
|
93
|
+
val packageName = androidConfig.getString("packageName")!!
|
|
94
|
+
val certificateHashes = mutableListOf<String>()
|
|
95
|
+
val hashes = androidConfig.getArray("certificateHashes")!!
|
|
96
|
+
for (i in 0 until hashes.size()) {
|
|
97
|
+
certificateHashes.add(hashes.getString(i))
|
|
98
|
+
}
|
|
99
|
+
val watcherMail = config.getString("watcherMail")
|
|
100
|
+
val alternativeStores = mutableListOf<String>()
|
|
101
|
+
if (androidConfig.hasKey("supportedAlternativeStores")) {
|
|
102
|
+
val stores = androidConfig.getArray("supportedAlternativeStores")!!
|
|
103
|
+
for (i in 0 until stores.size()) {
|
|
104
|
+
alternativeStores.add(stores.getString(i))
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return TalsecConfig(packageName, certificateHashes.toTypedArray(), watcherMail, alternativeStores.toTypedArray())
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
companion object {
|
|
111
|
+
const val NAME = "FreeraspReactNative"
|
|
112
|
+
}
|
|
113
|
+
}
|
|
@@ -1,17 +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
|
-
}
|
|
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
|
+
}
|
package/example/Gemfile
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
source 'https://rubygems.org'
|
|
2
|
-
|
|
3
|
-
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
|
|
4
|
-
ruby '2.7.5'
|
|
5
|
-
|
|
6
|
-
gem 'cocoapods', '~> 1.11', '>= 1.11.2'
|
|
1
|
+
source 'https://rubygems.org'
|
|
2
|
+
|
|
3
|
+
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
|
|
4
|
+
ruby '2.7.5'
|
|
5
|
+
|
|
6
|
+
gem 'cocoapods', '~> 1.11', '>= 1.11.2'
|
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
# To learn about Buck see [Docs](https://buckbuild.com/).
|
|
2
|
-
# To run your application with Buck:
|
|
3
|
-
# - install Buck
|
|
4
|
-
# - `npm start` - to start the packager
|
|
5
|
-
# - `cd android`
|
|
6
|
-
# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"`
|
|
7
|
-
# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck
|
|
8
|
-
# - `buck install -r android/app` - compile, install and run application
|
|
9
|
-
#
|
|
10
|
-
|
|
11
|
-
load(":build_defs.bzl", "create_aar_targets", "create_jar_targets")
|
|
12
|
-
|
|
13
|
-
lib_deps = []
|
|
14
|
-
|
|
15
|
-
create_aar_targets(glob(["libs/*.aar"]))
|
|
16
|
-
|
|
17
|
-
create_jar_targets(glob(["libs/*.jar"]))
|
|
18
|
-
|
|
19
|
-
android_library(
|
|
20
|
-
name = "all-libs",
|
|
21
|
-
exported_deps = lib_deps,
|
|
22
|
-
)
|
|
23
|
-
|
|
24
|
-
android_library(
|
|
25
|
-
name = "app-code",
|
|
26
|
-
srcs = glob([
|
|
27
|
-
"src/main/java/**/*.java",
|
|
28
|
-
]),
|
|
29
|
-
deps = [
|
|
30
|
-
":all-libs",
|
|
31
|
-
":build_config",
|
|
32
|
-
":res",
|
|
33
|
-
],
|
|
34
|
-
)
|
|
35
|
-
|
|
36
|
-
android_build_config(
|
|
37
|
-
name = "build_config",
|
|
38
|
-
package = "com.freeraspreactnativeexample",
|
|
39
|
-
)
|
|
40
|
-
|
|
41
|
-
android_resource(
|
|
42
|
-
name = "res",
|
|
43
|
-
package = "com.freeraspreactnativeexample",
|
|
44
|
-
res = "src/main/res",
|
|
45
|
-
)
|
|
46
|
-
|
|
47
|
-
android_binary(
|
|
48
|
-
name = "app",
|
|
49
|
-
keystore = "//android/keystores:debug",
|
|
50
|
-
manifest = "src/main/AndroidManifest.xml",
|
|
51
|
-
package_type = "debug",
|
|
52
|
-
deps = [
|
|
53
|
-
":app-code",
|
|
54
|
-
],
|
|
55
|
-
)
|
|
1
|
+
# To learn about Buck see [Docs](https://buckbuild.com/).
|
|
2
|
+
# To run your application with Buck:
|
|
3
|
+
# - install Buck
|
|
4
|
+
# - `npm start` - to start the packager
|
|
5
|
+
# - `cd android`
|
|
6
|
+
# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"`
|
|
7
|
+
# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck
|
|
8
|
+
# - `buck install -r android/app` - compile, install and run application
|
|
9
|
+
#
|
|
10
|
+
|
|
11
|
+
load(":build_defs.bzl", "create_aar_targets", "create_jar_targets")
|
|
12
|
+
|
|
13
|
+
lib_deps = []
|
|
14
|
+
|
|
15
|
+
create_aar_targets(glob(["libs/*.aar"]))
|
|
16
|
+
|
|
17
|
+
create_jar_targets(glob(["libs/*.jar"]))
|
|
18
|
+
|
|
19
|
+
android_library(
|
|
20
|
+
name = "all-libs",
|
|
21
|
+
exported_deps = lib_deps,
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
android_library(
|
|
25
|
+
name = "app-code",
|
|
26
|
+
srcs = glob([
|
|
27
|
+
"src/main/java/**/*.java",
|
|
28
|
+
]),
|
|
29
|
+
deps = [
|
|
30
|
+
":all-libs",
|
|
31
|
+
":build_config",
|
|
32
|
+
":res",
|
|
33
|
+
],
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
android_build_config(
|
|
37
|
+
name = "build_config",
|
|
38
|
+
package = "com.freeraspreactnativeexample",
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
android_resource(
|
|
42
|
+
name = "res",
|
|
43
|
+
package = "com.freeraspreactnativeexample",
|
|
44
|
+
res = "src/main/res",
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
android_binary(
|
|
48
|
+
name = "app",
|
|
49
|
+
keystore = "//android/keystores:debug",
|
|
50
|
+
manifest = "src/main/AndroidManifest.xml",
|
|
51
|
+
package_type = "debug",
|
|
52
|
+
deps = [
|
|
53
|
+
":app-code",
|
|
54
|
+
],
|
|
55
|
+
)
|