@rejourneyco/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/android/build.gradle.kts +135 -0
- package/android/consumer-rules.pro +10 -0
- package/android/proguard-rules.pro +1 -0
- package/android/src/main/AndroidManifest.xml +15 -0
- package/android/src/main/java/com/rejourney/RejourneyModuleImpl.kt +2981 -0
- package/android/src/main/java/com/rejourney/capture/ANRHandler.kt +206 -0
- package/android/src/main/java/com/rejourney/capture/ActivityTracker.kt +98 -0
- package/android/src/main/java/com/rejourney/capture/CaptureEngine.kt +1553 -0
- package/android/src/main/java/com/rejourney/capture/CaptureHeuristics.kt +375 -0
- package/android/src/main/java/com/rejourney/capture/CrashHandler.kt +153 -0
- package/android/src/main/java/com/rejourney/capture/MotionEvent.kt +215 -0
- package/android/src/main/java/com/rejourney/capture/SegmentUploader.kt +512 -0
- package/android/src/main/java/com/rejourney/capture/VideoEncoder.kt +773 -0
- package/android/src/main/java/com/rejourney/capture/ViewHierarchyScanner.kt +633 -0
- package/android/src/main/java/com/rejourney/capture/ViewSerializer.kt +286 -0
- package/android/src/main/java/com/rejourney/core/Constants.kt +117 -0
- package/android/src/main/java/com/rejourney/core/Logger.kt +93 -0
- package/android/src/main/java/com/rejourney/core/Types.kt +124 -0
- package/android/src/main/java/com/rejourney/lifecycle/SessionLifecycleService.kt +162 -0
- package/android/src/main/java/com/rejourney/network/DeviceAuthManager.kt +747 -0
- package/android/src/main/java/com/rejourney/network/HttpClientProvider.kt +16 -0
- package/android/src/main/java/com/rejourney/network/NetworkMonitor.kt +272 -0
- package/android/src/main/java/com/rejourney/network/UploadManager.kt +1363 -0
- package/android/src/main/java/com/rejourney/network/UploadWorker.kt +492 -0
- package/android/src/main/java/com/rejourney/privacy/PrivacyMask.kt +645 -0
- package/android/src/main/java/com/rejourney/touch/GestureClassifier.kt +233 -0
- package/android/src/main/java/com/rejourney/touch/KeyboardTracker.kt +158 -0
- package/android/src/main/java/com/rejourney/touch/TextInputTracker.kt +181 -0
- package/android/src/main/java/com/rejourney/touch/TouchInterceptor.kt +591 -0
- package/android/src/main/java/com/rejourney/utils/EventBuffer.kt +284 -0
- package/android/src/main/java/com/rejourney/utils/OEMDetector.kt +154 -0
- package/android/src/main/java/com/rejourney/utils/PerfTiming.kt +235 -0
- package/android/src/main/java/com/rejourney/utils/Telemetry.kt +297 -0
- package/android/src/main/java/com/rejourney/utils/WindowUtils.kt +84 -0
- package/android/src/newarch/java/com/rejourney/RejourneyModule.kt +187 -0
- package/android/src/newarch/java/com/rejourney/RejourneyPackage.kt +40 -0
- package/android/src/oldarch/java/com/rejourney/RejourneyModule.kt +218 -0
- package/android/src/oldarch/java/com/rejourney/RejourneyPackage.kt +23 -0
- package/ios/Capture/RJANRHandler.h +42 -0
- package/ios/Capture/RJANRHandler.m +328 -0
- package/ios/Capture/RJCaptureEngine.h +275 -0
- package/ios/Capture/RJCaptureEngine.m +2062 -0
- package/ios/Capture/RJCaptureHeuristics.h +80 -0
- package/ios/Capture/RJCaptureHeuristics.m +903 -0
- package/ios/Capture/RJCrashHandler.h +46 -0
- package/ios/Capture/RJCrashHandler.m +313 -0
- package/ios/Capture/RJMotionEvent.h +183 -0
- package/ios/Capture/RJMotionEvent.m +183 -0
- package/ios/Capture/RJPerformanceManager.h +100 -0
- package/ios/Capture/RJPerformanceManager.m +373 -0
- package/ios/Capture/RJPixelBufferDownscaler.h +42 -0
- package/ios/Capture/RJPixelBufferDownscaler.m +85 -0
- package/ios/Capture/RJSegmentUploader.h +146 -0
- package/ios/Capture/RJSegmentUploader.m +778 -0
- package/ios/Capture/RJVideoEncoder.h +247 -0
- package/ios/Capture/RJVideoEncoder.m +1036 -0
- package/ios/Capture/RJViewControllerTracker.h +73 -0
- package/ios/Capture/RJViewControllerTracker.m +508 -0
- package/ios/Capture/RJViewHierarchyScanner.h +215 -0
- package/ios/Capture/RJViewHierarchyScanner.m +1464 -0
- package/ios/Capture/RJViewSerializer.h +119 -0
- package/ios/Capture/RJViewSerializer.m +498 -0
- package/ios/Core/RJConstants.h +124 -0
- package/ios/Core/RJConstants.m +88 -0
- package/ios/Core/RJLifecycleManager.h +85 -0
- package/ios/Core/RJLifecycleManager.m +308 -0
- package/ios/Core/RJLogger.h +61 -0
- package/ios/Core/RJLogger.m +211 -0
- package/ios/Core/RJTypes.h +176 -0
- package/ios/Core/RJTypes.m +66 -0
- package/ios/Core/Rejourney.h +64 -0
- package/ios/Core/Rejourney.mm +2495 -0
- package/ios/Network/RJDeviceAuthManager.h +94 -0
- package/ios/Network/RJDeviceAuthManager.m +967 -0
- package/ios/Network/RJNetworkMonitor.h +68 -0
- package/ios/Network/RJNetworkMonitor.m +267 -0
- package/ios/Network/RJRetryManager.h +73 -0
- package/ios/Network/RJRetryManager.m +325 -0
- package/ios/Network/RJUploadManager.h +267 -0
- package/ios/Network/RJUploadManager.m +2296 -0
- package/ios/Privacy/RJPrivacyMask.h +163 -0
- package/ios/Privacy/RJPrivacyMask.m +922 -0
- package/ios/Rejourney.h +63 -0
- package/ios/Touch/RJGestureClassifier.h +130 -0
- package/ios/Touch/RJGestureClassifier.m +333 -0
- package/ios/Touch/RJTouchInterceptor.h +169 -0
- package/ios/Touch/RJTouchInterceptor.m +772 -0
- package/ios/Utils/RJEventBuffer.h +112 -0
- package/ios/Utils/RJEventBuffer.m +358 -0
- package/ios/Utils/RJGzipUtils.h +33 -0
- package/ios/Utils/RJGzipUtils.m +89 -0
- package/ios/Utils/RJKeychainManager.h +48 -0
- package/ios/Utils/RJKeychainManager.m +111 -0
- package/ios/Utils/RJPerfTiming.h +209 -0
- package/ios/Utils/RJPerfTiming.m +264 -0
- package/ios/Utils/RJTelemetry.h +92 -0
- package/ios/Utils/RJTelemetry.m +320 -0
- package/ios/Utils/RJWindowUtils.h +66 -0
- package/ios/Utils/RJWindowUtils.m +133 -0
- package/lib/commonjs/NativeRejourney.js +40 -0
- package/lib/commonjs/components/Mask.js +79 -0
- package/lib/commonjs/index.js +1381 -0
- package/lib/commonjs/sdk/autoTracking.js +1259 -0
- package/lib/commonjs/sdk/constants.js +151 -0
- package/lib/commonjs/sdk/errorTracking.js +199 -0
- package/lib/commonjs/sdk/index.js +50 -0
- package/lib/commonjs/sdk/metricsTracking.js +204 -0
- package/lib/commonjs/sdk/navigation.js +151 -0
- package/lib/commonjs/sdk/networkInterceptor.js +412 -0
- package/lib/commonjs/sdk/utils.js +363 -0
- package/lib/commonjs/types/expo-router.d.js +2 -0
- package/lib/commonjs/types/index.js +2 -0
- package/lib/module/NativeRejourney.js +38 -0
- package/lib/module/components/Mask.js +72 -0
- package/lib/module/index.js +1284 -0
- package/lib/module/sdk/autoTracking.js +1233 -0
- package/lib/module/sdk/constants.js +145 -0
- package/lib/module/sdk/errorTracking.js +189 -0
- package/lib/module/sdk/index.js +12 -0
- package/lib/module/sdk/metricsTracking.js +187 -0
- package/lib/module/sdk/navigation.js +143 -0
- package/lib/module/sdk/networkInterceptor.js +401 -0
- package/lib/module/sdk/utils.js +342 -0
- package/lib/module/types/expo-router.d.js +2 -0
- package/lib/module/types/index.js +2 -0
- package/lib/typescript/NativeRejourney.d.ts +147 -0
- package/lib/typescript/components/Mask.d.ts +39 -0
- package/lib/typescript/index.d.ts +117 -0
- package/lib/typescript/sdk/autoTracking.d.ts +204 -0
- package/lib/typescript/sdk/constants.d.ts +120 -0
- package/lib/typescript/sdk/errorTracking.d.ts +32 -0
- package/lib/typescript/sdk/index.d.ts +9 -0
- package/lib/typescript/sdk/metricsTracking.d.ts +58 -0
- package/lib/typescript/sdk/navigation.d.ts +33 -0
- package/lib/typescript/sdk/networkInterceptor.d.ts +47 -0
- package/lib/typescript/sdk/utils.d.ts +148 -0
- package/lib/typescript/types/index.d.ts +624 -0
- package/package.json +102 -0
- package/rejourney.podspec +21 -0
- package/src/NativeRejourney.ts +165 -0
- package/src/components/Mask.tsx +80 -0
- package/src/index.ts +1459 -0
- package/src/sdk/autoTracking.ts +1373 -0
- package/src/sdk/constants.ts +134 -0
- package/src/sdk/errorTracking.ts +231 -0
- package/src/sdk/index.ts +11 -0
- package/src/sdk/metricsTracking.ts +232 -0
- package/src/sdk/navigation.ts +157 -0
- package/src/sdk/networkInterceptor.ts +440 -0
- package/src/sdk/utils.ts +369 -0
- package/src/types/expo-router.d.ts +7 -0
- package/src/types/index.ts +739 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
plugins {
|
|
2
|
+
id("com.android.library")
|
|
3
|
+
id("org.jetbrains.kotlin.android")
|
|
4
|
+
id("com.facebook.react")
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
// Read newArchEnabled from project properties (Gradle injects from root project's gradle.properties)
|
|
8
|
+
// This approach matches react-native-screens and other industry-standard RN libraries
|
|
9
|
+
fun isNewArchitectureEnabled(): Boolean {
|
|
10
|
+
// To opt-in for the New Architecture, you can either:
|
|
11
|
+
// - Set `newArchEnabled` to true inside the `gradle.properties` file
|
|
12
|
+
// - Invoke gradle with `-PnewArchEnabled=true`
|
|
13
|
+
// - Set an environment variable `ORG_GRADLE_PROJECT_newArchEnabled=true`
|
|
14
|
+
val newArchEnabled = project.hasProperty("newArchEnabled") &&
|
|
15
|
+
project.property("newArchEnabled").toString() == "true"
|
|
16
|
+
|
|
17
|
+
// Log the detection result for debugging
|
|
18
|
+
println("[Rejourney] New Architecture enabled: $newArchEnabled (project: ${project.name})")
|
|
19
|
+
|
|
20
|
+
return newArchEnabled
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
android {
|
|
24
|
+
namespace = "com.rejourney"
|
|
25
|
+
compileSdk = 35
|
|
26
|
+
|
|
27
|
+
// Enable BuildConfig generation (required for IS_NEW_ARCHITECTURE_ENABLED)
|
|
28
|
+
buildFeatures {
|
|
29
|
+
buildConfig = true
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
defaultConfig {
|
|
33
|
+
minSdk = 24
|
|
34
|
+
consumerProguardFiles("consumer-rules.pro")
|
|
35
|
+
|
|
36
|
+
// Pass new architecture flag to BuildConfig - read from root project (app)
|
|
37
|
+
val isNewArchEnabled = isNewArchitectureEnabled()
|
|
38
|
+
buildConfigField("boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchEnabled.toString())
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
buildTypes {
|
|
42
|
+
release {
|
|
43
|
+
isMinifyEnabled = false
|
|
44
|
+
proguardFiles(
|
|
45
|
+
getDefaultProguardFile("proguard-android-optimize.txt"),
|
|
46
|
+
"proguard-rules.pro"
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
compileOptions {
|
|
52
|
+
sourceCompatibility = JavaVersion.VERSION_17
|
|
53
|
+
targetCompatibility = JavaVersion.VERSION_17
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
kotlin {
|
|
57
|
+
jvmToolchain(17)
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Dual Architecture Support:
|
|
62
|
+
// - When newArchEnabled=true: compile newarch/ source set (TurboModules + codegen NativeRejourneySpec)
|
|
63
|
+
// - When newArchEnabled=false: compile oldarch/ source set (Bridge)
|
|
64
|
+
val isNewArchEnabled = isNewArchitectureEnabled()
|
|
65
|
+
|
|
66
|
+
android.sourceSets {
|
|
67
|
+
getByName("main") {
|
|
68
|
+
if (isNewArchEnabled) {
|
|
69
|
+
// New Architecture: include newarch sources
|
|
70
|
+
// Codegen generates NativeRejourneySpec.java in build/generated/source/codegen/java/
|
|
71
|
+
// which is automatically added by the React Native Gradle plugin
|
|
72
|
+
java.srcDirs("src/main/java", "src/newarch/java")
|
|
73
|
+
} else {
|
|
74
|
+
// Old Architecture: include oldarch sources
|
|
75
|
+
java.srcDirs("src/main/java", "src/oldarch/java")
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/*
|
|
81
|
+
// Ensure codegen directory exists before CMake runs
|
|
82
|
+
// This is a workaround until codegen runs automatically
|
|
83
|
+
tasks.register("ensureCodegenDirectory") {
|
|
84
|
+
doLast {
|
|
85
|
+
val codegenDir = file("build/generated/source/codegen/jni")
|
|
86
|
+
codegenDir.mkdirs()
|
|
87
|
+
// Create stub CMakeLists.txt if it doesn't exist
|
|
88
|
+
val cmakeFile = file("build/generated/source/codegen/jni/CMakeLists.txt")
|
|
89
|
+
if (!cmakeFile.exists()) {
|
|
90
|
+
cmakeFile.writeText("""
|
|
91
|
+
# Temporary stub CMakeLists.txt for codegen directory
|
|
92
|
+
# This file will be replaced when codegen runs and generates the actual bindings
|
|
93
|
+
cmake_minimum_required(VERSION 3.13)
|
|
94
|
+
# Create a stub library target that will be replaced by actual codegen output
|
|
95
|
+
add_library(react_codegen_RejourneySpec INTERFACE)
|
|
96
|
+
# This is a placeholder - actual codegen will generate the real implementation
|
|
97
|
+
message(STATUS "Using stub codegen for RejourneySpec - codegen should run to generate actual bindings")
|
|
98
|
+
""".trimIndent())
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// Run ensureCodegenDirectory before any build task
|
|
104
|
+
tasks.named("preBuild").configure {
|
|
105
|
+
dependsOn("ensureCodegenDirectory")
|
|
106
|
+
}
|
|
107
|
+
*/
|
|
108
|
+
|
|
109
|
+
dependencies {
|
|
110
|
+
// React Native
|
|
111
|
+
implementation("com.facebook.react:react-android")
|
|
112
|
+
|
|
113
|
+
// Kotlin Coroutines
|
|
114
|
+
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3")
|
|
115
|
+
|
|
116
|
+
// OkHttp for networking
|
|
117
|
+
implementation("com.squareup.okhttp3:okhttp:4.12.0")
|
|
118
|
+
|
|
119
|
+
// WorkManager for background uploads
|
|
120
|
+
implementation("androidx.work:work-runtime-ktx:2.9.0")
|
|
121
|
+
|
|
122
|
+
// Encrypted SharedPreferences for secure storage
|
|
123
|
+
implementation("androidx.security:security-crypto:1.1.0-alpha06")
|
|
124
|
+
|
|
125
|
+
// AndroidX Core
|
|
126
|
+
implementation("androidx.core:core-ktx:1.12.0")
|
|
127
|
+
implementation("androidx.appcompat:appcompat:1.6.1")
|
|
128
|
+
|
|
129
|
+
// RecyclerView for layout serialization
|
|
130
|
+
implementation("androidx.recyclerview:recyclerview:1.3.2")
|
|
131
|
+
|
|
132
|
+
// Lifecycle for ProcessLifecycleOwner (reliable app foreground/background detection)
|
|
133
|
+
implementation("androidx.lifecycle:lifecycle-process:2.7.0")
|
|
134
|
+
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.7.0")
|
|
135
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Consumer ProGuard rules for Rejourney SDK
|
|
2
|
+
# These rules will be applied to apps that use this library
|
|
3
|
+
|
|
4
|
+
-keep class com.rejourney.** { *; }
|
|
5
|
+
-keepclassmembers class com.rejourney.** { *; }
|
|
6
|
+
|
|
7
|
+
# Keep React Native bridge annotations
|
|
8
|
+
-keepclassmembers class * {
|
|
9
|
+
@com.facebook.react.bridge.ReactMethod *;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# ProGuard rules for Rejourney SDK
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
2
|
+
xmlns:tools="http://schemas.android.com/tools">
|
|
3
|
+
<uses-permission android:name="android.permission.INTERNET" />
|
|
4
|
+
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
|
5
|
+
|
|
6
|
+
<application>
|
|
7
|
+
<!-- Service to detect app termination when swiped away from recent apps -->
|
|
8
|
+
<!-- stopWithTask="false" is CRITICAL - allows onTaskRemoved() to fire when app is killed -->
|
|
9
|
+
<service
|
|
10
|
+
android:name="com.rejourney.lifecycle.SessionLifecycleService"
|
|
11
|
+
android:exported="false"
|
|
12
|
+
android:stopWithTask="false"
|
|
13
|
+
tools:node="merge" />
|
|
14
|
+
</application>
|
|
15
|
+
</manifest>
|