diff --git a/example-new-architecture/android/app/build.gradle b/example-new-architecture/android/app/build.gradle index 046efcd33..226243bd6 100644 --- a/example-new-architecture/android/app/build.gradle +++ b/example-new-architecture/android/app/build.gradle @@ -96,7 +96,6 @@ android { dependencies { // The version of react-native is set by the React Native Gradle Plugin implementation("com.facebook.react:react-android") - implementation("com.facebook.react:flipper-integration") if (hermesEnabled.toBoolean()) { implementation("com.facebook.react:hermes-android") @@ -113,5 +112,3 @@ dependencies { } } } - -apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) diff --git a/example-new-architecture/android/build.gradle b/example-new-architecture/android/build.gradle index 01e5c6305..b1c32caf6 100644 --- a/example-new-architecture/android/build.gradle +++ b/example-new-architecture/android/build.gradle @@ -3,11 +3,11 @@ buildscript { ext { buildToolsVersion = "34.0.0" - minSdkVersion = 21 + minSdkVersion = 23 compileSdkVersion = 34 targetSdkVersion = 34 ndkVersion = "25.1.8937393" - kotlinVersion = "1.8.0" + kotlinVersion = "1.8.21" } repositories { google() diff --git a/example-new-architecture/android/gradle/wrapper/gradle-wrapper.jar b/example-new-architecture/android/gradle/wrapper/gradle-wrapper.jar index 41d9927a4..e6441136f 100644 Binary files a/example-new-architecture/android/gradle/wrapper/gradle-wrapper.jar and b/example-new-architecture/android/gradle/wrapper/gradle-wrapper.jar differ diff --git a/example-new-architecture/android/gradle/wrapper/gradle-wrapper.properties b/example-new-architecture/android/gradle/wrapper/gradle-wrapper.properties index d11cdd907..e7646dead 100644 --- a/example-new-architecture/android/gradle/wrapper/gradle-wrapper.properties +++ b/example-new-architecture/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/example-new-architecture/android/gradlew b/example-new-architecture/android/gradlew index 0adc8e1a5..1aa94a426 100755 --- a/example-new-architecture/android/gradlew +++ b/example-new-architecture/android/gradlew @@ -145,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -153,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -202,11 +202,11 @@ fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/example-new-architecture/android/gradlew.bat b/example-new-architecture/android/gradlew.bat index 6689b85be..7101f8e46 100644 --- a/example-new-architecture/android/gradlew.bat +++ b/example-new-architecture/android/gradlew.bat @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/example-new-architecture/android/settings.gradle b/example-new-architecture/android/settings.gradle index fcab53419..6d2886e8a 100644 --- a/example-new-architecture/android/settings.gradle +++ b/example-new-architecture/android/settings.gradle @@ -1,4 +1,3 @@ rootProject.name = 'DdSdkReactNativeExample' -apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) include ':app' includeBuild('../node_modules/@react-native/gradle-plugin') diff --git a/example-new-architecture/ios/Podfile.lock b/example-new-architecture/ios/Podfile.lock index 2d6433b72..96a8e7fbb 100644 --- a/example-new-architecture/ios/Podfile.lock +++ b/example-new-architecture/ios/Podfile.lock @@ -1,22 +1,22 @@ PODS: - boost (1.83.0) - - DatadogCore (2.14.2): - - DatadogInternal (= 2.14.2) - - DatadogCrashReporting (2.14.2): - - DatadogInternal (= 2.14.2) + - DatadogCore (2.16.0): + - DatadogInternal (= 2.16.0) + - DatadogCrashReporting (2.16.0): + - DatadogInternal (= 2.16.0) - PLCrashReporter (~> 1.11.2) - - DatadogInternal (2.14.2) - - DatadogLogs (2.14.2): - - DatadogInternal (= 2.14.2) - - DatadogRUM (2.14.2): - - DatadogInternal (= 2.14.2) + - DatadogInternal (2.16.0) + - DatadogLogs (2.16.0): + - DatadogInternal (= 2.16.0) + - DatadogRUM (2.16.0): + - DatadogInternal (= 2.16.0) - DatadogSDKReactNative (2.4.3): - - DatadogCore (~> 2.14.1) - - DatadogCrashReporting (~> 2.14.1) - - DatadogLogs (~> 2.14.1) - - DatadogRUM (~> 2.14.1) - - DatadogTrace (~> 2.14.1) - - DatadogWebViewTracking (~> 2.14.1) + - DatadogCore (~> 2.16.0) + - DatadogCrashReporting (~> 2.16.0) + - DatadogLogs (~> 2.16.0) + - DatadogRUM (~> 2.16.0) + - DatadogTrace (~> 2.16.0) + - DatadogWebViewTracking (~> 2.16.0) - DoubleConversion - glog - hermes-engine @@ -37,11 +37,11 @@ PODS: - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - Yoga - - DatadogTrace (2.14.2): - - DatadogInternal (= 2.14.2) + - DatadogTrace (2.16.0): + - DatadogInternal (= 2.16.0) - OpenTelemetrySwiftApi (= 1.6.0) - - DatadogWebViewTracking (2.14.2): - - DatadogInternal (= 2.14.2) + - DatadogWebViewTracking (2.16.0): + - DatadogInternal (= 2.16.0) - DoubleConversion (1.1.6) - FBLazyVector (0.74.3) - fmt (9.1.0) @@ -1398,14 +1398,14 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: boost: d3f49c53809116a5d38da093a8aa78bf551aed09 - DatadogCore: a3429f62b7da0e715e179833b3daa0203ba2a5ad - DatadogCrashReporting: 3b5e496c1f61971a93b9a1bff3312297be03f031 - DatadogInternal: 11798eea970f195ad720168f9a51712e71affe33 - DatadogLogs: 4192cc1979467ce0c2521d73ba92b6197e0c7f06 - DatadogRUM: f732009eba7a848d6e2df9ef12944e30f0e94ba2 - DatadogSDKReactNative: 91b9ecf292540bfec52c6c8bcfdc05cf475124a6 - DatadogTrace: 5687191622d91152f10616e206500fe5acd8a342 - DatadogWebViewTracking: cb818ee5943de63940b4f536320361c17af0f7b1 + DatadogCore: 4cf2a1fe0e60ebcb12a459328f652da6268de140 + DatadogCrashReporting: 380f559499c2d2171c40ddfbf9d4206f772fdca1 + DatadogInternal: 67742f9aac1b123f5bda9d6e3bb22ab1773fda0b + DatadogLogs: 1278623e6235c5fff7e68d0d4914cee11d828f8d + DatadogRUM: 4bac99a16de3c1ebebd9a1c3e6361cf1b13da83c + DatadogSDKReactNative: 504a6a06c57a0a91b48c5e6e053859a189e0caf1 + DatadogTrace: 7ac25fb96a022159f6cba44fa88c68569c984da8 + DatadogWebViewTracking: a8cac9ca5d3aa3c2ace3fbe6072dfd77425deae8 DoubleConversion: 76ab83afb40bddeeee456813d9c04f67f78771b5 FBLazyVector: 7e977dd099937dc5458851233141583abba49ff2 fmt: 4c2741a687cc09f0634a2e2c72a838b99f1ff120 diff --git a/example-new-architecture/package.json b/example-new-architecture/package.json index 4bceb709f..30b909c40 100644 --- a/example-new-architecture/package.json +++ b/example-new-architecture/package.json @@ -18,6 +18,7 @@ "@babel/runtime": "^7.20.0", "@react-native/babel-preset": "0.74.85", "@react-native/eslint-config": "0.74.85", + "@react-native/gradle-plugin": "^0.74.1", "@react-native/metro-config": "0.74.85", "@react-native/typescript-config": "0.74.85", "@types/react": "^18.2.6", diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 360d90754..dfef7b088 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -38,7 +38,7 @@ react { // bundleAssetName = "MyApplication.android.bundle" // // The entry file for bundle generation. Default is 'index.android.js' or 'index.js' - // entryFile = file("../js/MyApplication.android.js") + entryFile = file("../../index.tsx") // // A list of extra flags to pass to the 'bundle' commands. // See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle @@ -109,7 +109,6 @@ android { dependencies { // The version of react-native is set by the React Native Gradle Plugin implementation("com.facebook.react:react-android") - implementation("com.facebook.react:flipper-integration") if (hermesEnabled.toBoolean()) { implementation("com.facebook.react:hermes-android") diff --git a/example/android/build.gradle b/example/android/build.gradle index cb9d6232a..4ebd7d5d4 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -1,11 +1,11 @@ buildscript { ext { buildToolsVersion = "34.0.0" - minSdkVersion = 21 + minSdkVersion = 23 compileSdkVersion = 34 targetSdkVersion = 34 ndkVersion = "25.1.8937393" - kotlinVersion = "1.8.0" + kotlinVersion = "1.8.21" } repositories { google() diff --git a/example/android/gradle/wrapper/gradle-wrapper.jar b/example/android/gradle/wrapper/gradle-wrapper.jar index 41d9927a4..7f93135c4 100644 Binary files a/example/android/gradle/wrapper/gradle-wrapper.jar and b/example/android/gradle/wrapper/gradle-wrapper.jar differ diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 0b4752ee6..f94253c19 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -1,47 +1,47 @@ PODS: - boost (1.83.0) - - DatadogCore (2.14.2): - - DatadogInternal (= 2.14.2) - - DatadogCrashReporting (2.14.2): - - DatadogInternal (= 2.14.2) + - DatadogCore (2.18.0): + - DatadogInternal (= 2.18.0) + - DatadogCrashReporting (2.18.0): + - DatadogInternal (= 2.18.0) - PLCrashReporter (~> 1.11.2) - - DatadogInternal (2.14.2) - - DatadogLogs (2.14.2): - - DatadogInternal (= 2.14.2) - - DatadogRUM (2.14.2): - - DatadogInternal (= 2.14.2) + - DatadogInternal (2.18.0) + - DatadogLogs (2.18.0): + - DatadogInternal (= 2.18.0) + - DatadogRUM (2.18.0): + - DatadogInternal (= 2.18.0) - DatadogSDKReactNative (2.4.3): - - DatadogCore (~> 2.14.1) - - DatadogCrashReporting (~> 2.14.1) - - DatadogLogs (~> 2.14.1) - - DatadogRUM (~> 2.14.1) - - DatadogTrace (~> 2.14.1) - - DatadogWebViewTracking (~> 2.14.1) + - DatadogCore (~> 2.18.0) + - DatadogCrashReporting (~> 2.18.0) + - DatadogLogs (~> 2.18.0) + - DatadogRUM (~> 2.18.0) + - DatadogTrace (~> 2.18.0) + - DatadogWebViewTracking (~> 2.18.0) - React-Core - DatadogSDKReactNative/Tests (2.4.3): - - DatadogCore (~> 2.14.1) - - DatadogCrashReporting (~> 2.14.1) - - DatadogLogs (~> 2.14.1) - - DatadogRUM (~> 2.14.1) - - DatadogTrace (~> 2.14.1) - - DatadogWebViewTracking (~> 2.14.1) + - DatadogCore (~> 2.18.0) + - DatadogCrashReporting (~> 2.18.0) + - DatadogLogs (~> 2.18.0) + - DatadogRUM (~> 2.18.0) + - DatadogTrace (~> 2.18.0) + - DatadogWebViewTracking (~> 2.18.0) - React-Core - DatadogSDKReactNativeSessionReplay (2.4.3-alpha.0): - DatadogSDKReactNative - - DatadogSessionReplay (~> 2.14.1) + - DatadogSessionReplay (~> 2.18.0) - React-Core - DatadogSDKReactNativeSessionReplay/Tests (2.4.3-alpha.0): - DatadogSDKReactNative - - DatadogSessionReplay (~> 2.14.1) + - DatadogSessionReplay (~> 2.18.0) - React-Core - React-RCTText - - DatadogSessionReplay (2.14.2): - - DatadogInternal (= 2.14.2) - - DatadogTrace (2.14.2): - - DatadogInternal (= 2.14.2) + - DatadogSessionReplay (2.18.0): + - DatadogInternal (= 2.18.0) + - DatadogTrace (2.18.0): + - DatadogInternal (= 2.18.0) - OpenTelemetrySwiftApi (= 1.6.0) - - DatadogWebViewTracking (2.14.2): - - DatadogInternal (= 2.14.2) + - DatadogWebViewTracking (2.18.0): + - DatadogInternal (= 2.18.0) - DoubleConversion (1.1.6) - FBLazyVector (0.74.3) - fmt (9.1.0) @@ -1471,16 +1471,16 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: boost: d3f49c53809116a5d38da093a8aa78bf551aed09 - DatadogCore: a3429f62b7da0e715e179833b3daa0203ba2a5ad - DatadogCrashReporting: 3b5e496c1f61971a93b9a1bff3312297be03f031 - DatadogInternal: 11798eea970f195ad720168f9a51712e71affe33 - DatadogLogs: 4192cc1979467ce0c2521d73ba92b6197e0c7f06 - DatadogRUM: f732009eba7a848d6e2df9ef12944e30f0e94ba2 - DatadogSDKReactNative: f418f95923dc78ad7b4dcd1710804f1672d8abfa - DatadogSDKReactNativeSessionReplay: 5120a9df176bc6cf49d33237e078d99c8b1c3b24 - DatadogSessionReplay: a5df3975d9cd0acec876e98bbfc64dd85e21b888 - DatadogTrace: 5687191622d91152f10616e206500fe5acd8a342 - DatadogWebViewTracking: cb818ee5943de63940b4f536320361c17af0f7b1 + DatadogCore: 24f3bf4daa04949ef98b706ec4d4cb3cfde5443c + DatadogCrashReporting: 1a16f982c569f0d7058779a4540d4506002c89c6 + DatadogInternal: 4719225e5e3a5550a52196930cecdf2a589820b2 + DatadogLogs: 0365989aebbf3d0c7cb7346cf2bbb932c0eacc01 + DatadogRUM: 8461273acc87ddfe4a8bbc6e6672ae9542471f86 + DatadogSDKReactNative: 18393899c440460e72428b7bb70ceb6ce7b26ae6 + DatadogSDKReactNativeSessionReplay: be2fab2b7ae689cc9e4c3b0e7e6d11bce1bb99f3 + DatadogSessionReplay: c08f0df752e916639b04251eb3bf06dcda80591a + DatadogTrace: cc8ae210c274aa40658da83c9cc15de85bde405a + DatadogWebViewTracking: eeb8ea3fa13983752d2cc4dc0994664bf8388e15 DoubleConversion: 76ab83afb40bddeeee456813d9c04f67f78771b5 FBLazyVector: 7e977dd099937dc5458851233141583abba49ff2 fmt: 4c2741a687cc09f0634a2e2c72a838b99f1ff120 diff --git a/example/package.json b/example/package.json index 7a670a79d..8618e32ac 100644 --- a/example/package.json +++ b/example/package.json @@ -6,7 +6,8 @@ "scripts": { "android": "react-native run-android", "ios": "react-native run-ios", - "start": "react-native start" + "start": "react-native start", + "postinstall": "patch-package" }, "dependencies": { "@datadog/mobile-react-native": "workspace:packages/core", @@ -22,7 +23,7 @@ "react-native": "0.74.3", "react-native-crash-tester": "0.2.2", "react-native-gesture-handler": "^1.10.1", - "react-native-navigation": "7.38.2", + "react-native-navigation": "7.40.1", "react-native-safe-area-context": "4.10.8", "react-native-screens": "3.29.0" }, @@ -35,7 +36,9 @@ "@react-native/eslint-config": "0.74.85", "@react-native/metro-config": "0.74.85", "@react-native/typescript-config": "0.74.85", - "babel-plugin-module-resolver": "^4.0.0" + "@rnx-kit/metro-resolver-symlinks": "^0.1.36", + "babel-plugin-module-resolver": "^4.0.0", + "patch-package": "^8.0.0" }, "engines": { "node": ">=18" diff --git a/example/patches/react-native-navigation+7.40.1.patch b/example/patches/react-native-navigation+7.40.1.patch new file mode 100644 index 000000000..9f6fce4bd --- /dev/null +++ b/example/patches/react-native-navigation+7.40.1.patch @@ -0,0 +1,19 @@ +diff --git a/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/utils/ReactTypefaceUtils.java b/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/utils/ReactTypefaceUtils.java +index 834d734..7d90437 100644 +--- a/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/utils/ReactTypefaceUtils.java ++++ b/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/utils/ReactTypefaceUtils.java +@@ -96,12 +96,12 @@ public class ReactTypefaceUtils { + + int want = 0; + if ((weight == Typeface.BOLD) +- || ((oldStyle & Typeface.BOLD) != 0 && weight == ReactTextShadowNode.UNSET)) { ++ || ((oldStyle & Typeface.BOLD) != 0)) { + want |= Typeface.BOLD; + } + + if ((style == Typeface.ITALIC) +- || ((oldStyle & Typeface.ITALIC) != 0 && style == ReactTextShadowNode.UNSET)) { ++ || ((oldStyle & Typeface.ITALIC) != 0)) { + want |= Typeface.ITALIC; + } + diff --git a/packages/core/DatadogSDKReactNative.podspec b/packages/core/DatadogSDKReactNative.podspec index 63a459238..0b9e0fc13 100644 --- a/packages/core/DatadogSDKReactNative.podspec +++ b/packages/core/DatadogSDKReactNative.podspec @@ -19,14 +19,14 @@ Pod::Spec.new do |s| s.dependency "React-Core" # /!\ Remember to keep the versions in sync with DatadogSDKReactNativeSessionReplay.podspec - s.dependency 'DatadogCore', '~> 2.14.1' - s.dependency 'DatadogLogs', '~> 2.14.1' - s.dependency 'DatadogTrace', '~> 2.14.1' - s.dependency 'DatadogRUM', '~> 2.14.1' - s.dependency 'DatadogCrashReporting', '~> 2.14.1' + s.dependency 'DatadogCore', '~> 2.18.0' + s.dependency 'DatadogLogs', '~> 2.18.0' + s.dependency 'DatadogTrace', '~> 2.18.0' + s.dependency 'DatadogRUM', '~> 2.18.0' + s.dependency 'DatadogCrashReporting', '~> 2.18.0' # DatadogWebViewTracking is not available for tvOS - s.ios.dependency 'DatadogWebViewTracking', '~> 2.14.1' + s.ios.dependency 'DatadogWebViewTracking', '~> 2.18.0' s.test_spec 'Tests' do |test_spec| test_spec.source_files = 'ios/Tests/**/*.{swift,json}' diff --git a/packages/core/android/build.gradle b/packages/core/android/build.gradle index bbc25eb58..3883de8f5 100644 --- a/packages/core/android/build.gradle +++ b/packages/core/android/build.gradle @@ -12,7 +12,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.2.2' + classpath 'com.android.tools.build:gradle:7.3.1' // noinspection DifferentKotlinGradleVersion classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jlleitschuh.gradle:ktlint-gradle:11.5.1" @@ -98,15 +98,19 @@ def getExtOrIntegerDefault(name) { android { compileSdkVersion getExtOrIntegerDefault('compileSdkVersion') buildToolsVersion getExtOrDefault('buildToolsVersion') + def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION + if (agpVersion.tokenize('.')[0].toInteger() >= 7) { namespace = "com.datadog.reactnative" } + if (agpVersion.tokenize('.')[0].toInteger() >= 8) { buildFeatures { buildConfig = true } } + if (agpVersion.tokenize('.')[0].toInteger() < 8) { compileOptions { sourceCompatibility JavaVersion.VERSION_11 @@ -188,10 +192,10 @@ dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" compileOnly "com.squareup.okhttp3:okhttp:3.12.13" - implementation "com.datadoghq:dd-sdk-android-rum:2.11.0" - implementation "com.datadoghq:dd-sdk-android-logs:2.11.0" - implementation "com.datadoghq:dd-sdk-android-trace:2.11.0" - implementation "com.datadoghq:dd-sdk-android-webview:2.11.0" + implementation "com.datadoghq:dd-sdk-android-rum:2.14.0" + implementation "com.datadoghq:dd-sdk-android-logs:2.14.0" + implementation "com.datadoghq:dd-sdk-android-trace:2.14.0" + implementation "com.datadoghq:dd-sdk-android-webview:2.14.0" implementation "com.google.code.gson:gson:2.10.0" testImplementation "org.junit.platform:junit-platform-launcher:1.6.2" testImplementation "org.junit.jupiter:junit-jupiter-api:5.6.2" diff --git a/packages/core/android/gradle.properties b/packages/core/android/gradle.properties index ace79aead..bcf60b310 100644 --- a/packages/core/android/gradle.properties +++ b/packages/core/android/gradle.properties @@ -1,4 +1,4 @@ -DdSdkReactNative_kotlinVersion=1.7.21 +DdSdkReactNative_kotlinVersion=1.8.21 DdSdkReactNative_compileSdkVersion=33 DdSdkReactNative_buildToolsVersion=33.0.0 DdSdkReactNative_targetSdkVersion=33 diff --git a/packages/core/android/gradle/wrapper/gradle-wrapper.jar b/packages/core/android/gradle/wrapper/gradle-wrapper.jar index 62d4c0535..249e5832f 100644 Binary files a/packages/core/android/gradle/wrapper/gradle-wrapper.jar and b/packages/core/android/gradle/wrapper/gradle-wrapper.jar differ diff --git a/packages/core/android/gradle/wrapper/gradle-wrapper.properties b/packages/core/android/gradle/wrapper/gradle-wrapper.properties index 8cb39cca3..8fad3f5a9 100644 --- a/packages/core/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/core/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Fri Nov 20 08:39:09 CET 2020 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip diff --git a/packages/core/android/gradlew b/packages/core/android/gradlew index fbd7c5158..a69d9cb6c 100755 --- a/packages/core/android/gradlew +++ b/packages/core/android/gradlew @@ -1,7 +1,7 @@ -#!/usr/bin/env sh +#!/bin/sh # -# Copyright 2015 the original author or authors. +# Copyright © 2015-2021 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,67 +17,101 @@ # ############################################################################## -## -## Gradle start up script for UN*X -## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# ############################################################################## # Attempt to set APP_HOME + # Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` +APP_BASE_NAME=${0##*/} # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" +MAX_FD=maximum warn () { echo "$*" -} +} >&2 die () { echo echo "$*" echo exit 1 -} +} >&2 # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -87,9 +121,9 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD="$JAVA_HOME/bin/java" + JAVACMD=$JAVA_HOME/bin/java fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME @@ -98,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi else - JAVACMD="java" + JAVACMD=java which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the @@ -106,80 +140,101 @@ location of your Java installation." fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac fi -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. # For Cygwin or MSYS, switch paths to Windows format before running java -if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) fi - i=`expr $i + 1` + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg done - case $i in - 0) set -- ;; - 1) set -- "$args0" ;; - 2) set -- "$args0" "$args1" ;; - 3) set -- "$args0" "$args1" "$args2" ;; - 4) set -- "$args0" "$args1" "$args2" "$args3" ;; - 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac fi -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=`save "$@"` +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' exec "$JAVACMD" "$@" diff --git a/packages/core/android/gradlew.bat b/packages/core/android/gradlew.bat index 5093609d5..f127cfd49 100644 --- a/packages/core/android/gradlew.bat +++ b/packages/core/android/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,7 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init +if %ERRORLEVEL% equ 0 goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -54,7 +54,7 @@ goto fail set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe -if exist "%JAVA_EXE%" goto init +if exist "%JAVA_EXE%" goto execute echo. echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% @@ -64,21 +64,6 @@ echo location of your Java installation. goto fail -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - :execute @rem Setup the command line @@ -86,17 +71,19 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/packages/core/android/src/main/kotlin/com/datadog/reactnative/DdSdkImplementation.kt b/packages/core/android/src/main/kotlin/com/datadog/reactnative/DdSdkImplementation.kt index fc30d13ab..8f5020080 100644 --- a/packages/core/android/src/main/kotlin/com/datadog/reactnative/DdSdkImplementation.kt +++ b/packages/core/android/src/main/kotlin/com/datadog/reactnative/DdSdkImplementation.kt @@ -9,8 +9,9 @@ package com.datadog.reactnative import android.content.Context import android.util.Log import com.datadog.android.privacy.TrackingConsent -import com.datadog.android.rum.configuration.VitalsUpdateFrequency +import com.datadog.android.rum.GlobalRumMonitor import com.datadog.android.rum.RumPerformanceMetric +import com.datadog.android.rum.configuration.VitalsUpdateFrequency import com.facebook.react.bridge.LifecycleEventListener import com.facebook.react.bridge.Promise import com.facebook.react.bridge.ReactApplicationContext @@ -57,6 +58,8 @@ class DdSdkImplementation( } }) + configureSynthetics() + initialized.set(true) promise.resolve(null) @@ -156,6 +159,17 @@ class DdSdkImplementation( } } + private fun configureSynthetics() { + if (DdSdkSynthetics.testId.isNullOrBlank() || DdSdkSynthetics.resultId.isNullOrBlank()) { + return + } + + datadog.getRumMonitor()._getInternal()?.setSyntheticsAttribute( + DdSdkSynthetics.testId, + DdSdkSynthetics.resultId + ) + } + private fun buildVitalUpdateFrequency(vitalsUpdateFrequency: String?): VitalsUpdateFrequency { val vitalUpdateFrequencyLower = vitalsUpdateFrequency?.lowercase(Locale.US) return when (vitalUpdateFrequencyLower) { diff --git a/packages/core/android/src/main/kotlin/com/datadog/reactnative/DdSdkSynthetics.kt b/packages/core/android/src/main/kotlin/com/datadog/reactnative/DdSdkSynthetics.kt new file mode 100644 index 000000000..8ff756d83 --- /dev/null +++ b/packages/core/android/src/main/kotlin/com/datadog/reactnative/DdSdkSynthetics.kt @@ -0,0 +1,12 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2016-Present Datadog, Inc. + */ + +package com.datadog.reactnative + +internal object DdSdkSynthetics { + var testId: String? = null + var resultId: String? = null +} \ No newline at end of file diff --git a/packages/core/android/src/newarch/kotlin/com/datadog/reactnative/DdSdk.kt b/packages/core/android/src/newarch/kotlin/com/datadog/reactnative/DdSdk.kt index c004814a3..3680fea30 100644 --- a/packages/core/android/src/newarch/kotlin/com/datadog/reactnative/DdSdk.kt +++ b/packages/core/android/src/newarch/kotlin/com/datadog/reactnative/DdSdk.kt @@ -6,6 +6,8 @@ package com.datadog.reactnative +import android.app.Activity +import com.facebook.react.bridge.LifecycleEventListener import com.facebook.react.bridge.Promise import com.facebook.react.bridge.ReactApplicationContext import com.facebook.react.bridge.ReactMethod @@ -21,6 +23,23 @@ class DdSdk( override fun getName(): String = DdSdkImplementation.NAME + init { + reactContext.addLifecycleEventListener(object : LifecycleEventListener { + override fun onHostResume() { + val currentActivity: Activity? = currentActivity + if (currentActivity != null) { + val intent = currentActivity.intent + val extras = intent.extras + DdSdkSynthetics.testId = extras?.getString("_dd.synthetics.test_id") + DdSdkSynthetics.resultId = extras?.getString("_dd.synthetics.result_id") + } + } + + override fun onHostPause() {} + override fun onHostDestroy() {} + }) + } + /** * Initializes Datadog's features. * @param configuration The configuration to use. diff --git a/packages/core/android/src/oldarch/kotlin/com/datadog/reactnative/DdSdk.kt b/packages/core/android/src/oldarch/kotlin/com/datadog/reactnative/DdSdk.kt index c5e422d6e..47fc76ea3 100644 --- a/packages/core/android/src/oldarch/kotlin/com/datadog/reactnative/DdSdk.kt +++ b/packages/core/android/src/oldarch/kotlin/com/datadog/reactnative/DdSdk.kt @@ -6,6 +6,8 @@ package com.datadog.reactnative +import android.app.Activity +import com.facebook.react.bridge.LifecycleEventListener import com.facebook.react.bridge.Promise import com.facebook.react.bridge.ReactApplicationContext import com.facebook.react.bridge.ReactContextBaseJavaModule @@ -22,6 +24,23 @@ class DdSdk( override fun getName(): String = DdSdkImplementation.NAME + init { + reactContext.addLifecycleEventListener(object : LifecycleEventListener { + override fun onHostResume() { + val currentActivity: Activity? = currentActivity + if (currentActivity != null) { + val intent = currentActivity.intent + val extras = intent.extras + DdSdkSynthetics.testId = extras?.getString("_dd.synthetics.test_id") + DdSdkSynthetics.resultId = extras?.getString("_dd.synthetics.result_id") + } + } + + override fun onHostPause() {} + override fun onHostDestroy() {} + }) + } + /** * Initializes Datadog's features. * @param configuration The configuration to use. diff --git a/packages/core/android/src/test/kotlin/com/datadog/reactnative/DdSdkTest.kt b/packages/core/android/src/test/kotlin/com/datadog/reactnative/DdSdkTest.kt index 46bffe029..071b9ee7c 100644 --- a/packages/core/android/src/test/kotlin/com/datadog/reactnative/DdSdkTest.kt +++ b/packages/core/android/src/test/kotlin/com/datadog/reactnative/DdSdkTest.kt @@ -2293,6 +2293,23 @@ internal class DdSdkTest { .hasFieldEqualTo("customEndpointUrl", customTraceEndpoint) } + @Test + fun `𝕄 initialize native SDK 𝕎 initialize() {synthethics attributes}`() { + // Given + fakeConfiguration = fakeConfiguration.copy(nativeCrashReportEnabled = false, site = null) + DdSdkSynthetics.testId = "unit-test-test-id" + DdSdkSynthetics.resultId = "unit-test-result-id" + + // When + testedBridgeSdk.initialize(fakeConfiguration.toReadableJavaOnlyMap(), mockPromise) + + // Then + verify(mockRumInternalProxy).setSyntheticsAttribute( + "unit-test-test-id", + "unit-test-result-id" + ) + } + @Test fun `𝕄 clear all data 𝕎 clearAllData()`() { // When diff --git a/packages/core/android/src/test/kotlin/com/datadog/tools/unit/MockRumMonitor.kt b/packages/core/android/src/test/kotlin/com/datadog/tools/unit/MockRumMonitor.kt index ba97ac996..a2e79d630 100644 --- a/packages/core/android/src/test/kotlin/com/datadog/tools/unit/MockRumMonitor.kt +++ b/packages/core/android/src/test/kotlin/com/datadog/tools/unit/MockRumMonitor.kt @@ -6,6 +6,7 @@ package com.datadog.tools.unit +import com.datadog.android.rum.ExperimentalRumApi import com.datadog.android.rum.RumActionType import com.datadog.android.rum.RumErrorSource import com.datadog.android.rum.RumMonitor @@ -48,6 +49,9 @@ class MockRumMonitor : RumMonitor { override fun addTiming(name: String) {} + @ExperimentalRumApi + override fun addViewLoadingTime(overwrite: Boolean) {} + override fun clearAttributes() {} override fun getAttributes(): Map { diff --git a/packages/core/android/src/test/kotlin/com/datadog/tools/unit/forge/TelemetryConfigurationEventForgeryFactory.kt b/packages/core/android/src/test/kotlin/com/datadog/tools/unit/forge/TelemetryConfigurationEventForgeryFactory.kt index 8e1601546..10e894e6e 100644 --- a/packages/core/android/src/test/kotlin/com/datadog/tools/unit/forge/TelemetryConfigurationEventForgeryFactory.kt +++ b/packages/core/android/src/test/kotlin/com/datadog/tools/unit/forge/TelemetryConfigurationEventForgeryFactory.kt @@ -45,78 +45,78 @@ internal class TelemetryConfigurationEventForgeryFactory : dd = TelemetryConfigurationEvent.Dd(), telemetry = TelemetryConfigurationEvent.Telemetry( configuration = TelemetryConfigurationEvent.Configuration( - forge.aNullable { aLong() }, - forge.aNullable { aLong() }, - forge.aNullable { aLong() }, - forge.aNullable { aLong() }, - forge.aNullable { aLong() }, - forge.aNullable { + sessionSampleRate = forge.aNullable { aLong() }, + telemetrySampleRate = forge.aNullable { aLong() }, + telemetryConfigurationSampleRate = forge.aNullable { aLong() }, + telemetryUsageSampleRate = forge.aNullable { aLong() }, + traceSampleRate = forge.aNullable { aLong() }, + traceContextInjection = forge.aNullable { aValueFrom( TelemetryConfigurationEvent.TraceContextInjection::class.java ) }, - forge.aNullable { aLong() }, - forge.aNullable { aLong() }, - forge.aNullable { aLong() }, - forge.aNullable { + premiumSampleRate = forge.aNullable { aLong() }, + replaySampleRate = forge.aNullable { aLong() }, + sessionReplaySampleRate = forge.aNullable { aLong() }, + trackingConsent = forge.aNullable { aValueFrom( TelemetryConfigurationEvent.TrackingConsent::class.java ) }, - forge.aNullable { aBool() }, - forge.aNullable { aBool() }, - forge.aNullable { aBool() }, - forge.aNullable { aBool() }, - forge.aNullable { aBool() }, - forge.aNullable { aBool() }, - forge.aNullable { aBool() }, - forge.aNullable { aBool() }, - forge.aNullable { aBool() }, - forge.aNullable { aBool() }, - forge.aNullable { aBool() }, - forge.aNullable { aBool() }, - forge.aNullable { aBool() }, - forge.aNullable { aString() }, - forge.aNullable { aBool() }, - forge.aNullable { aBool() }, - forge.aNullable { + startSessionReplayRecordingManually = forge.aNullable { aBool() }, + useProxy = forge.aNullable { aBool() }, + useBeforeSend = forge.aNullable { aBool() }, + silentMultipleInit = forge.aNullable { aBool() }, + trackSessionAcrossSubdomains = forge.aNullable { aBool() }, + trackResources = forge.aNullable { aBool() }, + trackLongTask = forge.aNullable { aBool() }, + useCrossSiteSessionCookie = forge.aNullable { aBool() }, + usePartitionedCrossSiteSessionCookie = forge.aNullable { aBool() }, + useSecureSessionCookie = forge.aNullable { aBool() }, + allowFallbackToLocalStorage = forge.aNullable { aBool() }, + storeContextsAcrossPages = forge.aNullable { aBool() }, + allowUntrustedEvents = forge.aNullable { aBool() }, + actionNameAttribute = forge.aNullable { aString() }, + useAllowedTracingOrigins = forge.aNullable { aBool() }, + useAllowedTracingUrls = forge.aNullable { aBool() }, + selectedTracingPropagators = forge.aNullable { aList { aValueFrom( TelemetryConfigurationEvent.SelectedTracingPropagator::class.java ) } }, - forge.aNullable { aString() }, - forge.aNullable { aBool() }, - forge.aNullable { aBool() }, - forge.aNullable { aBool() }, - forge.aNullable { aBool() }, - forge.aNullable { aBool() }, + defaultPrivacyLevel = forge.aNullable { aString() }, + enablePrivacyForActionName = forge.aNullable { aBool() }, + useExcludedActivityUrls = forge.aNullable { aBool() }, + useWorkerUrl = forge.aNullable { aBool() }, + compressIntakeRequests = forge.aNullable { aBool() }, + trackFrustrations = forge.aNullable { aBool() }, - forge.aNullable { aBool() }, - forge.aNullable { aBool() }, - forge.aNullable { aBool() }, - forge.aNullable { aBool() }, - forge.aNullable { aList { aString() } }, - forge.aNullable { aList { aString() } }, - forge.aNullable { aBool() }, - forge.aNullable { + trackViewsManually = forge.aNullable { aBool() }, + trackInteractions = forge.aNullable { aBool() }, + trackUserInteractions = forge.aNullable { aBool() }, + forwardErrorsToLogs = forge.aNullable { aBool() }, + forwardConsoleLogs = forge.aNullable { aList { aString() } }, + forwardReports = forge.aNullable { aList { aString() } }, + useLocalEncryption = forge.aNullable { aBool() }, + viewTrackingStrategy = forge.aNullable { aValueFrom(TelemetryConfigurationEvent.ViewTrackingStrategy::class.java) }, - forge.aNullable { aBool() }, - forge.aNullable { aLong() }, - forge.aNullable { aBool() }, - forge.aNullable { aBool() }, - forge.aNullable { aBool() }, - forge.aNullable { aBool() }, - forge.aNullable { aBool() }, - forge.aNullable { aBool() }, - forge.aNullable { aBool() }, - forge.aNullable { aBool() }, - forge.aNullable { aString() }, - forge.aNullable { aBool() }, - forge.aNullable { aLong() }, - forge.aNullable { aLong() } + trackBackgroundEvents = forge.aNullable { aBool() }, + mobileVitalsUpdatePeriod = forge.aNullable { aLong() }, + trackErrors = forge.aNullable { aBool() }, + trackNetworkRequests = forge.aNullable { aBool() }, + useTracing = forge.aNullable { aBool() }, + trackNativeViews = forge.aNullable { aBool() }, + trackNativeErrors = forge.aNullable { aBool() }, + trackNativeLongTasks = forge.aNullable { aBool() }, + trackCrossPlatformLongTasks = forge.aNullable { aBool() }, + useFirstPartyHosts = forge.aNullable { aBool() }, + initializationType = forge.aNullable { aString() }, + trackFlutterPerformance = forge.aNullable { aBool() }, + batchSize = forge.aNullable { aLong() }, + batchUploadFrequency = forge.aNullable { aLong() } ) ) ) diff --git a/packages/core/ios/Tests/DdSdkNativeInitializationTests.swift b/packages/core/ios/Tests/DdSdkNativeInitializationTests.swift index 3d7151812..e09df5d17 100644 --- a/packages/core/ios/Tests/DdSdkNativeInitializationTests.swift +++ b/packages/core/ios/Tests/DdSdkNativeInitializationTests.swift @@ -9,6 +9,8 @@ import XCTest @testable import DatadogInternal class DdSdkNativeInitializationTests: XCTestCase { + var consoleMessage = "" + override func setUp() { super.setUp() } @@ -95,18 +97,22 @@ class DdSdkNativeInitializationTests: XCTestCase { func testPrintsMessageWithIncorrectFile() { let originalConsolePrint = consolePrint - defer { consolePrint = originalConsolePrint } - - var printedMessage = "" - consolePrint = { (msg, level) in printedMessage += msg } + defer { + consolePrint = originalConsolePrint + self.consoleMessage = "" + } + consolePrint = { [weak self] (msg, level) in + self?.consoleMessage += msg + } + let mockJSONFileReader = MockJSONFileReader(mockResourceFilePath: "Fixtures/malformed-configuration") let nativeInitialization = DdSdkNativeInitialization( jsonFileReader: mockJSONFileReader ) XCTAssertNil(nativeInitialization.getConfigurationFromJSONFile()) - XCTAssertEqual(printedMessage, "Error parsing datadog-configuration.json file: 🔥 Datadog SDK usage error: JSON configuration file is missing top-level \"configuration\" key.") + XCTAssertEqual(self.consoleMessage, "Error parsing datadog-configuration.json file: 🔥 Datadog SDK usage error: JSON configuration file is missing top-level \"configuration\" key.") } } diff --git a/packages/core/ios/Tests/DdSdkTests.swift b/packages/core/ios/Tests/DdSdkTests.swift index 12e717797..a48376c65 100644 --- a/packages/core/ios/Tests/DdSdkTests.swift +++ b/packages/core/ios/Tests/DdSdkTests.swift @@ -28,6 +28,8 @@ final class DispatchQueueMock: DispatchQueueType { } internal class DdSdkTests: XCTestCase { + var consoleMessage = "" + private func mockResolve(args: Any?) {} private func mockReject(args: String?, arg: String?, err: Error?) {} @@ -39,10 +41,14 @@ internal class DdSdkTests: XCTestCase { func testSDKInitialization() { let originalConsolePrint = consolePrint - defer { consolePrint = originalConsolePrint } + defer { + consolePrint = originalConsolePrint + self.consoleMessage = "" + } - var printedMessage = "" - consolePrint = { (msg, level) in printedMessage += msg } + consolePrint = { [weak self] (msg, level) in + self?.consoleMessage += msg + } DdSdkImplementation( mainDispatchQueue: DispatchQueueMock(), @@ -52,7 +58,7 @@ internal class DdSdkTests: XCTestCase { RUMMonitorInternalProvider: { nil } ).initialize(configuration: .mockAny(), resolve: mockResolve, reject: mockReject) - XCTAssertEqual(printedMessage, "") + XCTAssertEqual(self.consoleMessage, "") DdSdkImplementation( mainDispatchQueue: DispatchQueueMock(), @@ -62,7 +68,7 @@ internal class DdSdkTests: XCTestCase { RUMMonitorInternalProvider: { nil } ).initialize(configuration: .mockAny(), resolve: mockResolve, reject: mockReject) - XCTAssertEqual(printedMessage, "Datadog SDK is already initialized, skipping initialization.") + XCTAssertEqual(self.consoleMessage, "Datadog SDK is already initialized, skipping initialization.") } func testResolvesPromiseAfterInitializationIsDone() throws { diff --git a/packages/internal-testing-tools/android/build.gradle b/packages/internal-testing-tools/android/build.gradle index a86759cee..22b4be9c2 100644 --- a/packages/internal-testing-tools/android/build.gradle +++ b/packages/internal-testing-tools/android/build.gradle @@ -12,7 +12,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.2.2' + classpath 'com.android.tools.build:gradle:7.3.1' // noinspection DifferentKotlinGradleVersion classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jlleitschuh.gradle:ktlint-gradle:11.5.1" @@ -93,15 +93,19 @@ def getExtOrIntegerDefault(name) { android { compileSdkVersion getExtOrIntegerDefault('compileSdkVersion') buildToolsVersion getExtOrDefault('buildToolsVersion') + def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION + if (agpVersion.tokenize('.')[0].toInteger() >= 7) { namespace = "com.datadog.reactnative.internaltesting" } + if (agpVersion.tokenize('.')[0].toInteger() >= 8) { buildFeatures { buildConfig = true } } + if (agpVersion.tokenize('.')[0].toInteger() < 8) { compileOptions { sourceCompatibility JavaVersion.VERSION_11 @@ -147,10 +151,6 @@ android { lintOptions { disable 'GradleCompatible' } - compileOptions { - sourceCompatibility JavaVersion.VERSION_11 - targetCompatibility JavaVersion.VERSION_11 - } } repositories { diff --git a/packages/internal-testing-tools/android/gradle.properties b/packages/internal-testing-tools/android/gradle.properties index 1b1b4525a..ca1c8f02c 100644 --- a/packages/internal-testing-tools/android/gradle.properties +++ b/packages/internal-testing-tools/android/gradle.properties @@ -1,4 +1,4 @@ -DatadogInternalTesting_kotlinVersion=1.7.21 +DatadogInternalTesting_kotlinVersion=1.8.21 DatadogInternalTesting_compileSdkVersion=33 DatadogInternalTesting_buildToolsVersion=33.0.0 DatadogInternalTesting_targetSdkVersion=33 diff --git a/packages/internal-testing-tools/android/gradle/wrapper/gradle-wrapper.jar b/packages/internal-testing-tools/android/gradle/wrapper/gradle-wrapper.jar index 62d4c0535..249e5832f 100644 Binary files a/packages/internal-testing-tools/android/gradle/wrapper/gradle-wrapper.jar and b/packages/internal-testing-tools/android/gradle/wrapper/gradle-wrapper.jar differ diff --git a/packages/internal-testing-tools/android/gradle/wrapper/gradle-wrapper.properties b/packages/internal-testing-tools/android/gradle/wrapper/gradle-wrapper.properties index 8cb39cca3..8fad3f5a9 100644 --- a/packages/internal-testing-tools/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/internal-testing-tools/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Fri Nov 20 08:39:09 CET 2020 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip diff --git a/packages/internal-testing-tools/android/gradlew b/packages/internal-testing-tools/android/gradlew index fbd7c5158..a69d9cb6c 100755 --- a/packages/internal-testing-tools/android/gradlew +++ b/packages/internal-testing-tools/android/gradlew @@ -1,7 +1,7 @@ -#!/usr/bin/env sh +#!/bin/sh # -# Copyright 2015 the original author or authors. +# Copyright © 2015-2021 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,67 +17,101 @@ # ############################################################################## -## -## Gradle start up script for UN*X -## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# ############################################################################## # Attempt to set APP_HOME + # Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` +APP_BASE_NAME=${0##*/} # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" +MAX_FD=maximum warn () { echo "$*" -} +} >&2 die () { echo echo "$*" echo exit 1 -} +} >&2 # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -87,9 +121,9 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD="$JAVA_HOME/bin/java" + JAVACMD=$JAVA_HOME/bin/java fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME @@ -98,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi else - JAVACMD="java" + JAVACMD=java which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the @@ -106,80 +140,101 @@ location of your Java installation." fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac fi -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. # For Cygwin or MSYS, switch paths to Windows format before running java -if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) fi - i=`expr $i + 1` + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg done - case $i in - 0) set -- ;; - 1) set -- "$args0" ;; - 2) set -- "$args0" "$args1" ;; - 3) set -- "$args0" "$args1" "$args2" ;; - 4) set -- "$args0" "$args1" "$args2" "$args3" ;; - 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac fi -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=`save "$@"` +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' exec "$JAVACMD" "$@" diff --git a/packages/internal-testing-tools/android/gradlew.bat b/packages/internal-testing-tools/android/gradlew.bat index 5093609d5..f127cfd49 100644 --- a/packages/internal-testing-tools/android/gradlew.bat +++ b/packages/internal-testing-tools/android/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,7 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init +if %ERRORLEVEL% equ 0 goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -54,7 +54,7 @@ goto fail set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe -if exist "%JAVA_EXE%" goto init +if exist "%JAVA_EXE%" goto execute echo. echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% @@ -64,21 +64,6 @@ echo location of your Java installation. goto fail -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - :execute @rem Setup the command line @@ -86,17 +71,19 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/packages/internal-testing-tools/android/src/test/kotlin/com/datadog/reactnative/internaltesting/DdInternalTestingImplementationTest.kt b/packages/internal-testing-tools/android/src/test/kotlin/com/datadog/reactnative/internaltesting/DdInternalTestingImplementationTest.kt index b0d3910bf..6c278026a 100644 --- a/packages/internal-testing-tools/android/src/test/kotlin/com/datadog/reactnative/internaltesting/DdInternalTestingImplementationTest.kt +++ b/packages/internal-testing-tools/android/src/test/kotlin/com/datadog/reactnative/internaltesting/DdInternalTestingImplementationTest.kt @@ -13,6 +13,7 @@ import com.datadog.android.api.feature.FeatureScope import com.datadog.android.api.storage.EventBatchWriter import com.datadog.android.api.storage.EventType import com.datadog.android.api.storage.RawBatchEvent +import com.datadog.android.api.storage.datastore.DataStoreHandler import com.datadog.android.core.InternalSdkCore import com.datadog.reactnative.DatadogSDKWrapperStorage import com.facebook.react.bridge.Promise @@ -23,6 +24,7 @@ import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith import org.junit.jupiter.api.extension.Extensions import org.mockito.Mock +import org.mockito.Mockito.mock import org.mockito.junit.jupiter.MockitoExtension import org.mockito.junit.jupiter.MockitoSettings import org.mockito.kotlin.doReturn @@ -90,6 +92,8 @@ internal class DdInternalTestingImplementationTest { } internal class MockFeatureScope(private val feature: Feature) : FeatureScope { + override val dataStore: DataStoreHandler = mock() + override fun sendEvent(event: Any) {} override fun unwrap(): T { diff --git a/packages/react-native-session-replay/DatadogSDKReactNativeSessionReplay.podspec b/packages/react-native-session-replay/DatadogSDKReactNativeSessionReplay.podspec index c9dad3b1d..067b637d9 100644 --- a/packages/react-native-session-replay/DatadogSDKReactNativeSessionReplay.podspec +++ b/packages/react-native-session-replay/DatadogSDKReactNativeSessionReplay.podspec @@ -19,7 +19,7 @@ Pod::Spec.new do |s| s.dependency "React-Core" # /!\ Remember to keep the version in sync with DatadogSDKReactNative.podspec - s.dependency 'DatadogSessionReplay', '~> 2.14.1' + s.dependency 'DatadogSessionReplay', '~> 2.18.0' s.dependency 'DatadogSDKReactNative' s.test_spec 'Tests' do |test_spec| diff --git a/packages/react-native-session-replay/android/build.gradle b/packages/react-native-session-replay/android/build.gradle index d0059a6d5..8d833e098 100644 --- a/packages/react-native-session-replay/android/build.gradle +++ b/packages/react-native-session-replay/android/build.gradle @@ -12,7 +12,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.2.2' + classpath 'com.android.tools.build:gradle:7.3.1' // noinspection DifferentKotlinGradleVersion classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jlleitschuh.gradle:ktlint-gradle:11.5.1" @@ -96,15 +96,19 @@ def getExtOrIntegerDefault(name) { android { compileSdkVersion getExtOrIntegerDefault('compileSdkVersion') buildToolsVersion getExtOrDefault('buildToolsVersion') + def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION + if (agpVersion.tokenize('.')[0].toInteger() >= 7) { namespace = "com.datadog.reactnative.sessionreplay" } + if (agpVersion.tokenize('.')[0].toInteger() >= 8) { buildFeatures { buildConfig = true } } + if (agpVersion.tokenize('.')[0].toInteger() < 8) { compileOptions { sourceCompatibility JavaVersion.VERSION_11 @@ -150,10 +154,6 @@ android { lintOptions { disable 'GradleCompatible' } - compileOptions { - sourceCompatibility JavaVersion.VERSION_11 - targetCompatibility JavaVersion.VERSION_11 - } } repositories { @@ -188,7 +188,7 @@ dependencies { api "com.facebook.react:react-android:$reactNativeVersion" } implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - implementation "com.datadoghq:dd-sdk-android-session-replay:2.11.0" + implementation "com.datadoghq:dd-sdk-android-session-replay:2.14.0" implementation project(path: ':datadog_mobile-react-native') testImplementation "org.junit.platform:junit-platform-launcher:1.6.2" diff --git a/packages/react-native-session-replay/android/gradle.properties b/packages/react-native-session-replay/android/gradle.properties index 397e8a6d4..08f6247a6 100644 --- a/packages/react-native-session-replay/android/gradle.properties +++ b/packages/react-native-session-replay/android/gradle.properties @@ -1,4 +1,4 @@ -DatadogSDKReactNativeSessionReplay_kotlinVersion=1.7.21 +DatadogSDKReactNativeSessionReplay_kotlinVersion=1.8.21 DatadogSDKReactNativeSessionReplay_compileSdkVersion=33 DatadogSDKReactNativeSessionReplay_buildToolsVersion=33.0.0 DatadogSDKReactNativeSessionReplay_targetSdkVersion=33 diff --git a/packages/react-native-session-replay/android/gradle/wrapper/gradle-wrapper.jar b/packages/react-native-session-replay/android/gradle/wrapper/gradle-wrapper.jar index 62d4c0535..249e5832f 100644 Binary files a/packages/react-native-session-replay/android/gradle/wrapper/gradle-wrapper.jar and b/packages/react-native-session-replay/android/gradle/wrapper/gradle-wrapper.jar differ diff --git a/packages/react-native-session-replay/android/gradle/wrapper/gradle-wrapper.properties b/packages/react-native-session-replay/android/gradle/wrapper/gradle-wrapper.properties index 8cb39cca3..8fad3f5a9 100644 --- a/packages/react-native-session-replay/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/react-native-session-replay/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Fri Nov 20 08:39:09 CET 2020 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip diff --git a/packages/react-native-session-replay/android/gradlew b/packages/react-native-session-replay/android/gradlew index fbd7c5158..a69d9cb6c 100755 --- a/packages/react-native-session-replay/android/gradlew +++ b/packages/react-native-session-replay/android/gradlew @@ -1,7 +1,7 @@ -#!/usr/bin/env sh +#!/bin/sh # -# Copyright 2015 the original author or authors. +# Copyright © 2015-2021 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,67 +17,101 @@ # ############################################################################## -## -## Gradle start up script for UN*X -## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# ############################################################################## # Attempt to set APP_HOME + # Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` +APP_BASE_NAME=${0##*/} # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" +MAX_FD=maximum warn () { echo "$*" -} +} >&2 die () { echo echo "$*" echo exit 1 -} +} >&2 # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -87,9 +121,9 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD="$JAVA_HOME/bin/java" + JAVACMD=$JAVA_HOME/bin/java fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME @@ -98,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi else - JAVACMD="java" + JAVACMD=java which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the @@ -106,80 +140,101 @@ location of your Java installation." fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac fi -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. # For Cygwin or MSYS, switch paths to Windows format before running java -if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) fi - i=`expr $i + 1` + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg done - case $i in - 0) set -- ;; - 1) set -- "$args0" ;; - 2) set -- "$args0" "$args1" ;; - 3) set -- "$args0" "$args1" "$args2" ;; - 4) set -- "$args0" "$args1" "$args2" "$args3" ;; - 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac fi -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=`save "$@"` +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' exec "$JAVACMD" "$@" diff --git a/packages/react-native-session-replay/android/gradlew.bat b/packages/react-native-session-replay/android/gradlew.bat index 5093609d5..f127cfd49 100644 --- a/packages/react-native-session-replay/android/gradlew.bat +++ b/packages/react-native-session-replay/android/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,7 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init +if %ERRORLEVEL% equ 0 goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -54,7 +54,7 @@ goto fail set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe -if exist "%JAVA_EXE%" goto init +if exist "%JAVA_EXE%" goto execute echo. echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% @@ -64,21 +64,6 @@ echo location of your Java installation. goto fail -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - :execute @rem Setup the command line @@ -86,17 +71,19 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/packages/react-native-session-replay/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/DdSessionReplayImplementation.kt b/packages/react-native-session-replay/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/DdSessionReplayImplementation.kt index 907ef7bc1..bf16e6581 100644 --- a/packages/react-native-session-replay/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/DdSessionReplayImplementation.kt +++ b/packages/react-native-session-replay/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/DdSessionReplayImplementation.kt @@ -6,10 +6,11 @@ package com.datadog.reactnative.sessionreplay -import com.datadog.android.Datadog import com.datadog.android.api.feature.FeatureSdkCore +import com.datadog.android.sessionreplay.ImagePrivacy import com.datadog.android.sessionreplay.SessionReplayConfiguration -import com.datadog.android.sessionreplay.SessionReplayPrivacy +import com.datadog.android.sessionreplay.TextAndInputPrivacy +import com.datadog.android.sessionreplay.TouchPrivacy import com.datadog.reactnative.DatadogSDKWrapperStorage import com.facebook.react.bridge.Promise import com.facebook.react.bridge.ReactContext @@ -34,7 +35,7 @@ class DdSessionReplayImplementation( val sdkCore = DatadogSDKWrapperStorage.getSdkCore() as FeatureSdkCore val logger = sdkCore.internalLogger val configuration = SessionReplayConfiguration.Builder(replaySampleRate.toFloat()) - .setPrivacy(buildPrivacy(defaultPrivacyLevel)) + .configurePrivacy(defaultPrivacyLevel) .addExtensionSupport(ReactNativeSessionReplayExtensionSupport(reactContext, logger)) if (customEndpoint != "") { @@ -45,16 +46,30 @@ class DdSessionReplayImplementation( promise.resolve(null) } - private fun buildPrivacy(defaultPrivacyLevel: String): SessionReplayPrivacy { - return when (defaultPrivacyLevel?.lowercase(Locale.US)) { - "mask" -> SessionReplayPrivacy.MASK - "mask_user_input" -> SessionReplayPrivacy.MASK_USER_INPUT - "allow" -> SessionReplayPrivacy.ALLOW - else -> { - SessionReplayPrivacy.MASK + @Deprecated("Privacy should be set with separate properties mapped to " + + "`setImagePrivacy`, `setTouchPrivacy`, `setTextAndInputPrivacy`, but they are" + + " currently unavailable.") + private fun SessionReplayConfiguration.Builder.configurePrivacy( + defaultPrivacyLevel: String + ): SessionReplayConfiguration.Builder { + when (defaultPrivacyLevel.lowercase(Locale.US)) { + "mask" -> { + this.setTextAndInputPrivacy(TextAndInputPrivacy.MASK_ALL) + this.setImagePrivacy(ImagePrivacy.MASK_ALL) + this.setTouchPrivacy(TouchPrivacy.HIDE) + } + "mask_user_input" -> { + this.setTextAndInputPrivacy(TextAndInputPrivacy.MASK_ALL_INPUTS) + this.setImagePrivacy(ImagePrivacy.MASK_NONE) + this.setTouchPrivacy(TouchPrivacy.HIDE) + } + "allow" -> { + this.setTextAndInputPrivacy(TextAndInputPrivacy.MASK_SENSITIVE_INPUTS) + this.setImagePrivacy(ImagePrivacy.MASK_NONE) + this.setTouchPrivacy(TouchPrivacy.SHOW) } } - + return this } companion object { diff --git a/packages/react-native-session-replay/android/src/test/kotlin/com/datadog/reactnative/sessionreplay/DdSessionReplayImplementationTest.kt b/packages/react-native-session-replay/android/src/test/kotlin/com/datadog/reactnative/sessionreplay/DdSessionReplayImplementationTest.kt index 7ad2b7a71..b4d54a130 100644 --- a/packages/react-native-session-replay/android/src/test/kotlin/com/datadog/reactnative/sessionreplay/DdSessionReplayImplementationTest.kt +++ b/packages/react-native-session-replay/android/src/test/kotlin/com/datadog/reactnative/sessionreplay/DdSessionReplayImplementationTest.kt @@ -6,17 +6,20 @@ package com.datadog.reactnative.sessionreplay +import com.datadog.android.sessionreplay.ImagePrivacy import com.datadog.android.sessionreplay.SessionReplayConfiguration import com.datadog.android.sessionreplay.SessionReplayPrivacy +import com.datadog.android.sessionreplay.TextAndInputPrivacy +import com.datadog.android.sessionreplay.TouchPrivacy import com.datadog.tools.unit.GenericAssert.Companion.assertThat import com.facebook.react.bridge.NativeModule import com.facebook.react.bridge.Promise import com.facebook.react.bridge.ReactContext import com.facebook.react.uimanager.UIManagerModule import fr.xgouchet.elmyr.annotation.DoubleForgery -import fr.xgouchet.elmyr.annotation.Forgery import fr.xgouchet.elmyr.annotation.StringForgery import fr.xgouchet.elmyr.junit5.ForgeExtension +import java.util.Locale import org.junit.jupiter.api.AfterEach import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test @@ -67,10 +70,33 @@ internal class DdSessionReplayImplementationTest { } @Test - fun `M enable session replay W enable()`( + fun `M enable session replay W privacy = ALLOW`( @DoubleForgery(min = 0.0, max = 100.0) replaySampleRate: Double, - @Forgery privacy: SessionReplayPrivacy, @StringForgery(regex = ".+") customEndpoint: String + ) { + testSessionReplayEnable("ALLOW", replaySampleRate, customEndpoint) + } + + @Test + fun `M enable session replay W privacy = MASK`( + @DoubleForgery(min = 0.0, max = 100.0) replaySampleRate: Double, + @StringForgery(regex = ".+") customEndpoint: String + ) { + testSessionReplayEnable("MASK", replaySampleRate, customEndpoint) + } + + @Test + fun `M enable session replay W privacy = MASK_USER_INPUT`( + @DoubleForgery(min = 0.0, max = 100.0) replaySampleRate: Double, + @StringForgery(regex = ".+") customEndpoint: String + ) { + testSessionReplayEnable("MASK_USER_INPUT", replaySampleRate, customEndpoint) + } + + private fun testSessionReplayEnable( + privacy: String, + replaySampleRate: Double, + customEndpoint: String ) { // Given val sessionReplayConfigCaptor = argumentCaptor() @@ -78,7 +104,7 @@ internal class DdSessionReplayImplementationTest { // When testedSessionReplay.enable( replaySampleRate, - privacy.toString(), + privacy, customEndpoint, mockPromise ) @@ -87,8 +113,31 @@ internal class DdSessionReplayImplementationTest { verify(mockSessionReplay).enable(sessionReplayConfigCaptor.capture(), any()) assertThat(sessionReplayConfigCaptor.firstValue) .hasFieldEqualTo("sampleRate", replaySampleRate.toFloat()) - .hasFieldEqualTo("privacy", privacy) .hasFieldEqualTo("customEndpointUrl", customEndpoint) + + when (privacy.lowercase(Locale.US)) { + "mask_user_input" -> { + assertThat(sessionReplayConfigCaptor.firstValue) + .hasFieldEqualTo("textAndInputPrivacy", TextAndInputPrivacy.MASK_ALL_INPUTS) + .hasFieldEqualTo("imagePrivacy", ImagePrivacy.MASK_NONE) + .hasFieldEqualTo("touchPrivacy", TouchPrivacy.HIDE) + } + "allow" -> { + assertThat(sessionReplayConfigCaptor.firstValue) + .hasFieldEqualTo( + "textAndInputPrivacy", + TextAndInputPrivacy.MASK_SENSITIVE_INPUTS + ) + .hasFieldEqualTo("imagePrivacy", ImagePrivacy.MASK_NONE) + .hasFieldEqualTo("touchPrivacy", TouchPrivacy.SHOW) + } + else -> { + assertThat(sessionReplayConfigCaptor.firstValue) + .hasFieldEqualTo("textAndInputPrivacy", TextAndInputPrivacy.MASK_ALL) + .hasFieldEqualTo("imagePrivacy", ImagePrivacy.MASK_ALL) + .hasFieldEqualTo("touchPrivacy", TouchPrivacy.HIDE) + } + } } @Test diff --git a/packages/react-native-session-replay/ios/Sources/RCTTextViewRecorder.swift b/packages/react-native-session-replay/ios/Sources/RCTTextViewRecorder.swift index 89476ff20..f92fafad5 100644 --- a/packages/react-native-session-replay/ios/Sources/RCTTextViewRecorder.swift +++ b/packages/react-native-session-replay/ios/Sources/RCTTextViewRecorder.swift @@ -11,7 +11,7 @@ import React internal class RCTTextViewRecorder: SessionReplayNodeRecorder { internal var textObfuscator: (SessionReplayViewTreeRecordingContext) -> SessionReplayTextObfuscating = { context in - return context.recorder.privacy.staticTextObfuscator + return context.recorder.textAndInputPrivacy.staticTextObfuscator } internal var identifier = UUID() diff --git a/packages/react-native-session-replay/ios/Tests/RCTTextViewRecorderTests.swift b/packages/react-native-session-replay/ios/Tests/RCTTextViewRecorderTests.swift index a93c13fd9..cf8fa5a31 100644 --- a/packages/react-native-session-replay/ios/Tests/RCTTextViewRecorderTests.swift +++ b/packages/react-native-session-replay/ios/Tests/RCTTextViewRecorderTests.swift @@ -27,7 +27,14 @@ internal class RCTTextViewRecorderTests: XCTestCase { ) let mockAllowContext = SessionReplayViewTreeRecordingContext( - recorder: .init(privacy: .allow, applicationID: "app_id", sessionID: "session_id", viewID: "view_id", viewServerTimeOffset: nil), + recorder: .init(textAndInputPrivacy: .maskSensitiveInputs, + imagePrivacy: .maskNone, + touchPrivacy: .show, + applicationID: "app_id", + sessionID: "session_id", + viewID: "view_id", + viewServerTimeOffset: nil + ), coordinateSpace: UIView(), ids: .init(), webViewCache: .init()) @@ -132,7 +139,14 @@ internal class RCTTextViewRecorderTests: XCTestCase { func testReturnsBuilderWithCorrectInformationWhenTextIsObfuscated() throws { let mockMaskContext = SessionReplayViewTreeRecordingContext( - recorder: .init(privacy: .mask, applicationID: "app_id", sessionID: "session_id", viewID: "view_id", viewServerTimeOffset: nil), + recorder: .init( + textAndInputPrivacy: .maskAll, + imagePrivacy: .maskAll, + touchPrivacy: .hide, + applicationID: "app_id", + sessionID: "session_id", + viewID: "view_id", + viewServerTimeOffset: nil), coordinateSpace: UIView(), ids: .init(), webViewCache: .init() diff --git a/yarn.lock b/yarn.lock index dca20675e..eb73005c9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4757,6 +4757,13 @@ __metadata: languageName: node linkType: hard +"@react-native/gradle-plugin@npm:^0.74.1": + version: 0.74.87 + resolution: "@react-native/gradle-plugin@npm:0.74.87" + checksum: b524e51b33a0ae4faf826928974390da164394b2f95fb203c903ff20ce2c66ef825bf8a0ae228c37b9c5e417e7af66070e97ea6590d3ce3a933599cde8f8ba7e + languageName: node + linkType: hard + "@react-native/js-polyfills@npm:0.73.1": version: 0.73.1 resolution: "@react-native/js-polyfills@npm:0.73.1" @@ -5070,6 +5077,41 @@ __metadata: languageName: node linkType: hard +"@rnx-kit/console@npm:^1.0.0": + version: 1.1.0 + resolution: "@rnx-kit/console@npm:1.1.0" + checksum: fcef1fff6e6b66cbbfaddb8af26a298b1f506194bcedde473485f5d467ad9f5ab897c57a9d302e0541d8a86a315df261bdfa0b9c9c24435541f465c20eaaae66 + languageName: node + linkType: hard + +"@rnx-kit/metro-resolver-symlinks@npm:^0.1.36": + version: 0.1.36 + resolution: "@rnx-kit/metro-resolver-symlinks@npm:0.1.36" + dependencies: + "@rnx-kit/console": ^1.0.0 + "@rnx-kit/tools-node": ^2.1.0 + "@rnx-kit/tools-react-native": ^1.3.4 + enhanced-resolve: ^5.8.3 + checksum: 0eb189c28f2adf2f95b784da3c6677e7f75467e7648ac431957090a256c4f1172e26110906308012356d7c79f089983aa5c2d105158e971f837b705a7d17b15a + languageName: node + linkType: hard + +"@rnx-kit/tools-node@npm:^2.0.1, @rnx-kit/tools-node@npm:^2.1.0": + version: 2.1.2 + resolution: "@rnx-kit/tools-node@npm:2.1.2" + checksum: d5d882299adb9ad8d427fadc719191f4c55d64bc88a2d5e46490bb2010ee7ca45728498094c1e3aef6912f1a62095ddf04c1af893bc6d783de1b8b668b0acd1a + languageName: node + linkType: hard + +"@rnx-kit/tools-react-native@npm:^1.3.4": + version: 1.4.2 + resolution: "@rnx-kit/tools-react-native@npm:1.4.2" + dependencies: + "@rnx-kit/tools-node": ^2.0.1 + checksum: 94af27d673c02d3c380363f84528a450084f4803a7e0d69fefc02d2182d80d99d554aba5e9f25638de79354e28673b21a985bd07b354b22c4db2a37a02777884 + languageName: node + linkType: hard + "@sentry-internal/tracing@npm:7.118.0": version: 7.118.0 resolution: "@sentry-internal/tracing@npm:7.118.0" @@ -6626,6 +6668,7 @@ __metadata: "@datadog/mobile-react-native": "workspace:packages/core" "@react-native/babel-preset": 0.74.85 "@react-native/eslint-config": 0.74.85 + "@react-native/gradle-plugin": ^0.74.1 "@react-native/metro-config": 0.74.85 "@react-native/typescript-config": 0.74.85 "@types/react": ^18.2.6 @@ -7147,6 +7190,13 @@ __metadata: languageName: node linkType: hard +"at-least-node@npm:^1.0.0": + version: 1.0.0 + resolution: "at-least-node@npm:1.0.0" + checksum: 463e2f8e43384f1afb54bc68485c436d7622acec08b6fad269b421cb1d29cebb5af751426793d0961ed243146fe4dc983402f6d5a51b720b277818dbf6f2e49e + languageName: node + linkType: hard + "available-typed-arrays@npm:^1.0.7": version: 1.0.7 resolution: "available-typed-arrays@npm:1.0.7" @@ -7713,7 +7763,7 @@ __metadata: languageName: node linkType: hard -"ci-info@npm:^3.2.0": +"ci-info@npm:^3.2.0, ci-info@npm:^3.7.0": version: 3.9.0 resolution: "ci-info@npm:3.9.0" checksum: 6b19dc9b2966d1f8c2041a838217299718f15d6c4b63ae36e4674edd2bee48f780e94761286a56aa59eb305a85fbea4ddffb7630ec063e7ec7e7e5ad42549a87 @@ -8433,13 +8483,15 @@ __metadata: "@react-navigation/bottom-tabs": ^6.3.1 "@react-navigation/native": ^6.1.18 "@react-navigation/stack": ^6.2.1 + "@rnx-kit/metro-resolver-symlinks": ^0.1.36 axios: ^1.6.8 babel-plugin-module-resolver: ^4.0.0 + patch-package: ^8.0.0 react: 18.2.0 react-native: 0.74.3 react-native-crash-tester: 0.2.2 react-native-gesture-handler: ^1.10.1 - react-native-navigation: 7.38.2 + react-native-navigation: 7.40.1 react-native-safe-area-context: 4.10.8 react-native-screens: 3.29.0 languageName: unknown @@ -8980,6 +9032,16 @@ __metadata: languageName: node linkType: hard +"enhanced-resolve@npm:^5.8.3": + version: 5.17.1 + resolution: "enhanced-resolve@npm:5.17.1" + dependencies: + graceful-fs: ^4.2.4 + tapable: ^2.2.0 + checksum: 4bc38cf1cea96456f97503db7280394177d1bc46f8f87c267297d04f795ac5efa81e48115a2f5b6273c781027b5b6bfc5f62b54df629e4d25fa7001a86624f59 + languageName: node + linkType: hard + "enquirer@npm:~2.3.6": version: 2.3.6 resolution: "enquirer@npm:2.3.6" @@ -10026,6 +10088,15 @@ __metadata: languageName: node linkType: hard +"find-yarn-workspace-root@npm:^2.0.0": + version: 2.0.0 + resolution: "find-yarn-workspace-root@npm:2.0.0" + dependencies: + micromatch: ^4.0.2 + checksum: fa5ca8f9d08fe7a54ce7c0a5931ff9b7e36f9ee7b9475fb13752bcea80ec6b5f180fa5102d60b376d5526ce924ea3fc6b19301262efa0a5d248dd710f3644242 + languageName: node + linkType: hard + "flat-cache@npm:^3.0.4": version: 3.2.0 resolution: "flat-cache@npm:3.2.0" @@ -10200,6 +10271,18 @@ __metadata: languageName: node linkType: hard +"fs-extra@npm:^9.0.0": + version: 9.1.0 + resolution: "fs-extra@npm:9.1.0" + dependencies: + at-least-node: ^1.0.0 + graceful-fs: ^4.2.0 + jsonfile: ^6.0.1 + universalify: ^2.0.0 + checksum: ba71ba32e0faa74ab931b7a0031d1523c66a73e225de7426e275e238e312d07313d2da2d33e34a52aa406c8763ade5712eb3ec9ba4d9edce652bcacdc29e6b20 + languageName: node + linkType: hard + "fs-minipass@npm:^2.0.0": version: 2.1.0 resolution: "fs-minipass@npm:2.1.0" @@ -12540,6 +12623,18 @@ __metadata: languageName: node linkType: hard +"json-stable-stringify@npm:^1.0.2": + version: 1.1.1 + resolution: "json-stable-stringify@npm:1.1.1" + dependencies: + call-bind: ^1.0.5 + isarray: ^2.0.5 + jsonify: ^0.0.1 + object-keys: ^1.1.1 + checksum: e1ba06600fd278767eeff53f28e408e29c867e79abf564e7aadc3ce8f31f667258f8db278ef28831e45884dd687388fa1910f46e599fc19fb94c9afbbe3a4de8 + languageName: node + linkType: hard + "json-stringify-nice@npm:^1.1.4": version: 1.1.4 resolution: "json-stringify-nice@npm:1.1.4" @@ -12606,6 +12701,13 @@ __metadata: languageName: node linkType: hard +"jsonify@npm:^0.0.1": + version: 0.0.1 + resolution: "jsonify@npm:0.0.1" + checksum: 027287e1c0294fce15f18c0ff990cfc2318e7f01fb76515f784d5cd0784abfec6fc5c2355c3a2f2cb0ad7f4aa2f5b74ebbfe4e80476c35b2d13cabdb572e1134 + languageName: node + linkType: hard + "jsonparse@npm:^1.2.0, jsonparse@npm:^1.3.1": version: 1.3.1 resolution: "jsonparse@npm:1.3.1" @@ -12688,6 +12790,15 @@ __metadata: languageName: node linkType: hard +"klaw-sync@npm:^6.0.0": + version: 6.0.0 + resolution: "klaw-sync@npm:6.0.0" + dependencies: + graceful-fs: ^4.1.11 + checksum: 0da397f8961313c3ef8f79fb63af9002cde5a8fb2aeb1a37351feff0dd6006129c790400c3f5c3b4e757bedcabb13d21ec0a5eaef5a593d59515d4f2c291e475 + languageName: node + linkType: hard + "kleur@npm:^3.0.3": version: 3.0.3 resolution: "kleur@npm:3.0.3" @@ -13457,6 +13568,16 @@ __metadata: languageName: node linkType: hard +"micromatch@npm:^4.0.2": + version: 4.0.8 + resolution: "micromatch@npm:4.0.8" + dependencies: + braces: ^3.0.3 + picomatch: ^2.3.1 + checksum: 79920eb634e6f400b464a954fcfa589c4e7c7143209488e44baf627f9affc8b1e306f41f4f0deedde97e69cb725920879462d3e750ab3bd3c1aed675bb3a8966 + languageName: node + linkType: hard + "micromatch@npm:^4.0.4": version: 4.0.7 resolution: "micromatch@npm:4.0.7" @@ -14363,7 +14484,7 @@ __metadata: languageName: node linkType: hard -"open@npm:^7.0.3": +"open@npm:^7.0.3, open@npm:^7.4.2": version: 7.4.2 resolution: "open@npm:7.4.2" dependencies: @@ -14742,6 +14863,31 @@ __metadata: languageName: node linkType: hard +"patch-package@npm:^8.0.0": + version: 8.0.0 + resolution: "patch-package@npm:8.0.0" + dependencies: + "@yarnpkg/lockfile": ^1.1.0 + chalk: ^4.1.2 + ci-info: ^3.7.0 + cross-spawn: ^7.0.3 + find-yarn-workspace-root: ^2.0.0 + fs-extra: ^9.0.0 + json-stable-stringify: ^1.0.2 + klaw-sync: ^6.0.0 + minimist: ^1.2.6 + open: ^7.4.2 + rimraf: ^2.6.3 + semver: ^7.5.3 + slash: ^2.0.0 + tmp: ^0.0.33 + yaml: ^2.2.2 + bin: + patch-package: index.js + checksum: d23cddc4d1622e2d8c7ca31b145c6eddb24bd271f69905e766de5e1f199f0b9a5479a6a6939ea857288399d4ed249285639d539a2c00fbddb7daa39934b007a2 + languageName: node + linkType: hard + "path-exists@npm:^3.0.0": version: 3.0.0 resolution: "path-exists@npm:3.0.0" @@ -15448,9 +15594,9 @@ __metadata: languageName: node linkType: hard -"react-native-navigation@npm:7.38.2": - version: 7.38.2 - resolution: "react-native-navigation@npm:7.38.2" +"react-native-navigation@npm:7.40.1": + version: 7.40.1 + resolution: "react-native-navigation@npm:7.40.1" dependencies: hoist-non-react-statics: 3.x.x lodash: 4.17.x @@ -15466,7 +15612,7 @@ __metadata: optional: true bin: rnn-link: autolink/postlink/run.js - checksum: ae9aafa3748580a6bf0a49b2ee6eb70bbdd2fbcc36ab83e9d816e1ec356a557c320308b9ea2de4e7418d68468978747a30727bdc26bbff789c9596d4989424d3 + checksum: 3c4425d9f89fcb055e6b40c2bc92eb7eb9f5672b0b8914262413d66209ed5f789d45032b9ac74c87fb0a7bb1f7aeeebbe306949ec3b932f6bbfdf04c46d12ef6 languageName: node linkType: hard @@ -16103,6 +16249,17 @@ __metadata: languageName: node linkType: hard +"rimraf@npm:^2.6.3": + version: 2.7.1 + resolution: "rimraf@npm:2.7.1" + dependencies: + glob: ^7.1.3 + bin: + rimraf: ./bin.js + checksum: cdc7f6eacb17927f2a075117a823e1c5951792c6498ebcce81ca8203454a811d4cf8900314154d3259bb8f0b42ab17f67396a8694a54cae3283326e57ad250cd + languageName: node + linkType: hard + "rimraf@npm:^3.0.2": version: 3.0.2 resolution: "rimraf@npm:3.0.2" @@ -16526,6 +16683,13 @@ __metadata: languageName: node linkType: hard +"slash@npm:^2.0.0": + version: 2.0.0 + resolution: "slash@npm:2.0.0" + checksum: 512d4350735375bd11647233cb0e2f93beca6f53441015eea241fe784d8068281c3987fbaa93e7ef1c38df68d9c60013045c92837423c69115297d6169aa85e6 + languageName: node + linkType: hard + "slice-ansi@npm:^2.0.0": version: 2.1.0 resolution: "slice-ansi@npm:2.1.0" @@ -17148,6 +17312,13 @@ __metadata: languageName: node linkType: hard +"tapable@npm:^2.2.0": + version: 2.2.1 + resolution: "tapable@npm:2.2.1" + checksum: 3b7a1b4d86fa940aad46d9e73d1e8739335efd4c48322cb37d073eb6f80f5281889bf0320c6d8ffcfa1a0dd5bfdbd0f9d037e252ef972aca595330538aac4d51 + languageName: node + linkType: hard + "tar-stream@npm:~2.2.0": version: 2.2.0 resolution: "tar-stream@npm:2.2.0" @@ -18258,6 +18429,15 @@ __metadata: languageName: node linkType: hard +"yaml@npm:^2.2.2": + version: 2.5.1 + resolution: "yaml@npm:2.5.1" + bin: + yaml: bin.mjs + checksum: 31275223863fbd0b47ba9d2b248fbdf085db8d899e4ca43fff8a3a009497c5741084da6871d11f40e555d61360951c4c910b98216c1325d2c94753c0036d8172 + languageName: node + linkType: hard + "yamux-js@npm:0.1.2": version: 0.1.2 resolution: "yamux-js@npm:0.1.2"