Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

### Breaking Changes

- Move third-party-derived implementation classes to upstream-specific `io.sentry.vendor.*` packages. Code importing the old implementation packages must update its imports ([#6796](https://github.com/getsentry/sentry-java/pull/6796))
- Android: Narrow the SDK's consumer keep rules, so R8 can optimize more of your app ([#6787](https://github.com/getsentry/sentry-java/pull/6787))
- Members of `io.sentry` enums are no longer kept. Enum constants can be renamed or removed.
- Only the name and no-arg constructor of `SentryAndroidOptions` are kept, instead of every member of every `SentryOptions` subclass.
Expand Down
32 changes: 16 additions & 16 deletions THIRD_PARTY_NOTICES.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ limitations under the License.

### Scope

The Sentry Java SDK includes an adapted version of Square's Tape library, a file-based FIFO queue implementation used for reliable event storage. The code resides in the `io.sentry.cache.tape` package and includes `QueueFile`, `FileObjectQueue`, and `ObjectQueue`.
The Sentry Java SDK includes an adapted version of Square's Tape library, a file-based FIFO queue implementation used for reliable event storage. The code resides in the `io.sentry.vendor.tape` package and includes `QueueFile`, `FileObjectQueue`, and `ObjectQueue`.

Upstream was archived on 2024-10-25 and is no longer maintained. This copy is maintained in-tree and has diverged from the linked commit: it recovers from file corruption by recreating the file, bounds the queue to a maximum number of elements, and supports optional buffered writes flushed by an explicit `sync()`.

Expand Down Expand Up @@ -172,7 +172,7 @@ limitations under the License.

### Scope

The Sentry Java SDK includes an adapted version of Square's Seismic shake detection algorithm. The rolling sample window approach and `SampleQueue`/`SamplePool` data structures in `io.sentry.android.core.SentryShakeDetector` are based on Seismic's `ShakeDetector`.
The Sentry Java SDK includes an adapted version of Square's Seismic shake detection algorithm. The rolling sample window approach and `SampleQueue`/`SamplePool` data structures in `io.sentry.vendor.seismic.SentryShakeDetector` are based on Seismic's `ShakeDetector`.

```
Copyright 2010 Square, Inc.
Expand Down Expand Up @@ -200,7 +200,7 @@ limitations under the License.

### Scope

The Sentry Java SDK includes adapted versions of Square's Curtains library for null-safe `Window.Callback` handling and for tracking attached window roots. The code resides in `io.sentry.android.replay.util.FixedWindowCallback` and `io.sentry.android.replay.Windows`.
The Sentry Java SDK includes adapted versions of Square's Curtains library for null-safe `Window.Callback` handling and for tracking attached window roots. The code resides in the `io.sentry.vendor.curtains` package.

```
Copyright 2021 Square Inc.
Expand Down Expand Up @@ -228,7 +228,7 @@ limitations under the License.

### Scope

The Sentry Java SDK includes adapted versions of `CircularFifoQueue`, `SynchronizedCollection`, and `SynchronizedQueue` from Apache Commons Collections. The code resides in `io.sentry.CircularFifoQueue`, `io.sentry.SynchronizedCollection`, and `io.sentry.SynchronizedQueue`.
The Sentry Java SDK includes adapted versions of `CircularFifoQueue`, `SynchronizedCollection`, and `SynchronizedQueue` from Apache Commons Collections. The code resides in the `io.sentry.vendor.commons.collections` package.

```
Licensed to the Apache Software Foundation (ASF) under one or more
Expand Down Expand Up @@ -257,7 +257,7 @@ limitations under the License.

### Scope

The Sentry Java SDK includes an adapted version of `ReusableCountLatch` from the JavaFixes library for concurrent synchronization. The code resides in `io.sentry.transport.ReusableCountLatch`.
The Sentry Java SDK includes an adapted version of `ReusableCountLatch` from the JavaFixes library for concurrent synchronization. The code resides in `io.sentry.vendor.javafixes.concurrent.ReusableCountLatch`.

```
Copyright (C) 2016 Matej Tymes
Expand Down Expand Up @@ -285,7 +285,7 @@ limitations under the License.

### Scope

The Sentry Java SDK includes an adapted UUID generation implementation from the Dynamic-Datasource library. The code resides in `io.sentry.util.UUIDGenerator`.
The Sentry Java SDK includes an adapted UUID generation implementation from the Dynamic-Datasource library. The code resides in `io.sentry.vendor.dynamicdatasource.UUIDGenerator`.

```
Copyright © 2018 organization baomidou
Expand Down Expand Up @@ -313,7 +313,7 @@ limitations under the License.

### Scope

The Sentry Java SDK includes an adapted version of `FirstDrawDoneListener` from the Firebase Android SDK for detecting initial display time via `OnDrawListener`. The code resides in `io.sentry.android.core.internal.util.FirstDrawDoneListener`.
The Sentry Java SDK includes an adapted version of `FirstDrawDoneListener` from the Firebase Android SDK for detecting initial display time via `OnDrawListener`. The code resides in `io.sentry.vendor.firebase.FirstDrawDoneListener`.

```
Copyright 2022 Google LLC
Expand Down Expand Up @@ -341,7 +341,7 @@ limitations under the License.

### Scope

The Sentry Java SDK includes adapted thread state and stack trace parsing code from the Android Open Source Project's bugreport tools. The code resides in the `io.sentry.android.core.internal.threaddump` package and includes `ThreadDumpParser`, `Line`, and `Lines`.
The Sentry Java SDK includes adapted thread state and stack trace parsing code from the Android Open Source Project's bugreport tools. The code resides in the `io.sentry.vendor.aosp.threaddump` package and includes `ThreadDumpParser`, `Line`, and `Lines`.

```
Copyright (C) 2016 The Android Open Source Project
Expand Down Expand Up @@ -370,7 +370,7 @@ limitations under the License.

### Scope

The Sentry Android Replay SDK includes code adapted from Jetpack Compose UI, used to compute Compose node bounds while traversing the view hierarchy for masking. The code resides in `io.sentry.android.replay.util.Nodes`: the `boundsInWindow` extension function (a faster copy of `LayoutCoordinates.boundsInWindow`) and the `fastMinOf`, `fastMaxOf`, `fastCoerceIn`, `fastCoerceAtLeast`, and `fastCoerceAtMost` numeric helpers (copied from `androidx.compose.ui.util.MathHelpers`).
The Sentry Android Replay SDK includes code adapted from Jetpack Compose UI, used to compute Compose node bounds while traversing the view hierarchy for masking. The code resides in `io.sentry.vendor.androidx.compose.BoundsInWindow`: the `boundsInWindow` extension function (a faster copy of `LayoutCoordinates.boundsInWindow`) and the `fastMinOf`, `fastMaxOf`, `fastCoerceIn`, `fastCoerceAtLeast`, and `fastCoerceAtMost` numeric helpers (copied from `androidx.compose.ui.util.MathHelpers`).

```
Copyright (C) 2019, 2020 The Android Open Source Project
Expand Down Expand Up @@ -398,7 +398,7 @@ limitations under the License.

### Scope

The Sentry Java SDK build includes an adapted version of the AndroidX build's POM rewriting, which adds `<type>aar</type>` to dependencies on Android libraries in published POMs. The code resides in the build logic at `build-logic/src/main/kotlin/io/sentry/gradle/AarTypes.kt` and is not part of the published artifacts.
The Sentry Java SDK build includes an adapted version of the AndroidX build's POM rewriting, which adds `<type>aar</type>` to dependencies on Android libraries in published POMs. The code resides in the build logic at `build-logic/src/main/kotlin/io/sentry/vendor/androidx/maven/AarTypes.kt` and is not part of the published artifacts.

```
Copyright 2018 The Android Open Source Project
Expand Down Expand Up @@ -426,7 +426,7 @@ limitations under the License.

### Scope

The Sentry Java SDK includes an adapted version of `ThreadLocalContextStorage` from the OpenTelemetry Java SDK for thread-local context storage. The code resides in `io.sentry.opentelemetry.SentryOtelThreadLocalStorage`.
The Sentry Java SDK includes an adapted version of `ThreadLocalContextStorage` from the OpenTelemetry Java SDK for thread-local context storage. The code resides in `io.sentry.vendor.opentelemetry.SentryOtelThreadLocalStorage`.

```
Copyright The OpenTelemetry Authors
Expand Down Expand Up @@ -455,7 +455,7 @@ limitations under the License.

### Scope

The Sentry Java SDK includes an adapted version of the ANR-WatchDog library for Application Not Responding (ANR) detection on Android. The code resides in `io.sentry.android.core.ANRWatchDog` and `io.sentry.android.core.ApplicationNotResponding` (adapted from `ANRError`).
The Sentry Java SDK includes an adapted version of the ANR-WatchDog library for Application Not Responding (ANR) detection on Android. The code resides in `io.sentry.vendor.anrwatchdog.ANRWatchDog` and `io.sentry.vendor.anrwatchdog.ApplicationNotResponding` (adapted from `ANRError`).

```
MIT License
Expand Down Expand Up @@ -490,7 +490,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

### Scope

The Sentry Java SDK includes an adapted root detection implementation from the Ravencoin Android wallet (originally from breadwallet). The code resides in `io.sentry.android.core.internal.util.RootChecker`.
The Sentry Java SDK includes an adapted root detection implementation from the Ravencoin Android wallet (originally from breadwallet). The code resides in `io.sentry.vendor.breadwallet.RootChecker`.

```
MIT License
Expand Down Expand Up @@ -526,7 +526,7 @@ THE SOFTWARE.

### Scope

The Sentry Java SDK includes an adapted PCG-based random number generator from the pcg-java library for fast sampling. The code resides in `io.sentry.util.Random`.
The Sentry Java SDK includes an adapted PCG-based random number generator from the pcg-java library for fast sampling. The code resides in `io.sentry.vendor.pcg.Random`.

```
MIT License
Expand Down Expand Up @@ -562,7 +562,7 @@ SOFTWARE.

### Scope

The Sentry Java SDK includes adapted UUID string manipulation utilities. The code resides in `io.sentry.util.UUIDStringUtils`.
The Sentry Java SDK includes adapted UUID string manipulation utilities. The code resides in `io.sentry.vendor.fastuuid.UUIDStringUtils`.

```
MIT License
Expand Down Expand Up @@ -598,7 +598,7 @@ SOFTWARE.

### Scope

The Sentry Android Replay SDK includes adapted versions of the video encoding and muxing classes from the flutter_screen_recorder library, used to encode and mux replay video frames into an MP4 file. The code resides in the `io.sentry.android.replay.video` package and includes `SimpleFrameMuxer`, `SimpleMp4FrameMuxer`, and `SimpleVideoEncoder`.
The Sentry Android Replay SDK includes adapted versions of the video encoding and muxing classes from the flutter_screen_recorder library, used to encode and mux replay video frames into an MP4 file. The code resides in the `io.sentry.vendor.flutterscreenrecorder` package and includes `SimpleFrameMuxer`, `SimpleMp4FrameMuxer`, and `SimpleVideoEncoder`.

```
Copyright (c) 2021 fzyzcjy
Expand Down
49 changes: 2 additions & 47 deletions build-logic/src/main/kotlin/io/sentry/gradle/AarTypes.kt
Original file line number Diff line number Diff line change
@@ -1,25 +1,7 @@
/*
* Adapted from https://github.com/androidx/androidx/blob/c799cba927a71f01ea6b421a8f83c181682633fb/buildSrc/private/src/main/kotlin/androidx/build/MavenUploadHelper.kt#L524-L549
*
* Copyright 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.sentry.gradle

import com.vanniktech.maven.publish.MavenPublishBaseExtension
import groovy.util.Node
import io.sentry.vendor.androidx.maven.assignAarTypes

private val androidLibs =
setOf(
Expand All @@ -39,32 +21,5 @@ private val androidXLibs = listOf("androidx.core:core")

// Workaround for https://github.com/gradle/gradle/issues/3170
fun MavenPublishBaseExtension.assignAarTypes() {
pom {
withXml {
val dependencies =
asNode().children().find { it is Node && it.name().toString().endsWith("dependencies") }
as Node?

dependencies?.children()?.forEach { dep ->
if (dep !is Node) {
return@forEach
}
val group =
dep.children().firstOrNull { it is Node && it.name().toString().endsWith("groupId") }
as? Node
val groupValue = group?.children()?.firstOrNull() as? String

val artifactId =
dep.children().firstOrNull { it is Node && it.name().toString().endsWith("artifactId") }
as? Node
val artifactIdValue = artifactId?.children()?.firstOrNull() as? String

if (artifactIdValue in androidLibs) {
dep.appendNode("type", "aar")
} else if ("$groupValue:$artifactIdValue" in androidXLibs) {
dep.appendNode("type", "aar")
}
}
}
}
pom { withXml { asNode().assignAarTypes(androidLibs, androidXLibs) } }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* Adapted from https://github.com/androidx/androidx/blob/c799cba927a71f01ea6b421a8f83c181682633fb/buildSrc/private/src/main/kotlin/androidx/build/MavenUploadHelper.kt#L524-L549
*
* Copyright 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.sentry.vendor.androidx.maven

import groovy.util.Node

internal fun Node.assignAarTypes(androidLibs: Set<String>, androidXLibs: List<String>) {
val dependencies =
children().find { it is Node && it.name().toString().endsWith("dependencies") } as Node?

dependencies?.children()?.forEach { dep ->
if (dep !is Node) {
return@forEach
}
val group =
dep.children().firstOrNull { it is Node && it.name().toString().endsWith("groupId") } as? Node
val groupValue = group?.children()?.firstOrNull() as? String

val artifactId =
dep.children().firstOrNull { it is Node && it.name().toString().endsWith("artifactId") }
as? Node
val artifactIdValue = artifactId?.children()?.firstOrNull() as? String

if (artifactIdValue in androidLibs) {
dep.appendNode("type", "aar")
} else if ("$groupValue:$artifactIdValue" in androidXLibs) {
dep.appendNode("type", "aar")
}
}
}
90 changes: 72 additions & 18 deletions sentry-android-core/api/sentry-android-core.api
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,6 @@ public final class io/sentry/android/core/ApplicationExitInfoEventProcessor : io
public fun process (Lio/sentry/protocol/SentryTransaction;Lio/sentry/Hint;)Lio/sentry/protocol/SentryTransaction;
}

public final class io/sentry/android/core/ApplicationNotResponding : java/lang/RuntimeException {
public fun <init> (Ljava/lang/String;)V
public fun getThread ()Ljava/lang/Thread;
}

public final class io/sentry/android/core/BuildConfig {
public static final field BUILD_TYPE Ljava/lang/String;
public static final field DEBUG Z
Expand Down Expand Up @@ -325,6 +320,13 @@ public final class io/sentry/android/core/InternalSentrySdk {
public static fun updateSessionForDroppedEventNonTerminating (Z)V
}

public final class io/sentry/android/core/MainLooperHandler {
public fun <init> ()V
public fun <init> (Landroid/os/Looper;)V
public fun getThread ()Ljava/lang/Thread;
public fun post (Ljava/lang/Runnable;)V
}

public final class io/sentry/android/core/MemoryLimiterIntegration : io/sentry/Integration, java/io/Closeable {
public fun <init> (Landroid/content/Context;Lio/sentry/android/core/BuildInfoProvider;)V
public fun close ()V
Expand Down Expand Up @@ -555,19 +557,6 @@ public final class io/sentry/android/core/SentryScreenshotOptions : io/sentry/Se
public fun trackCustomMasking ()V
}

public final class io/sentry/android/core/SentryShakeDetector : android/hardware/SensorEventListener {
public fun <init> (Lio/sentry/ILogger;)V
public fun close ()V
public fun onAccuracyChanged (Landroid/hardware/Sensor;I)V
public fun onSensorChanged (Landroid/hardware/SensorEvent;)V
public fun start (Landroid/content/Context;Lio/sentry/android/core/SentryShakeDetector$Listener;)V
public fun stop ()V
}

public abstract interface class io/sentry/android/core/SentryShakeDetector$Listener {
public abstract fun onShake ()V
}

public final class io/sentry/android/core/SentryUserFeedbackForm : android/app/Dialog {
public fun onDetachedFromWindow ()V
public fun setCancelable (Z)V
Expand Down Expand Up @@ -902,3 +891,68 @@ public abstract interface class io/sentry/android/core/util/AndroidLazyEvaluator
public abstract fun evaluate (Landroid/content/Context;)Ljava/lang/Object;
}

public final class io/sentry/vendor/anrwatchdog/ANRWatchDog : java/lang/Thread {
public static fun create (Lio/sentry/android/core/SentryAndroidOptions;Lio/sentry/vendor/anrwatchdog/ANRWatchDog$ANRListener;Landroid/content/Context;)Lio/sentry/vendor/anrwatchdog/ANRWatchDog;
public fun run ()V
}

public abstract interface class io/sentry/vendor/anrwatchdog/ANRWatchDog$ANRListener {
public abstract fun onAppNotResponding (Lio/sentry/vendor/anrwatchdog/ApplicationNotResponding;)V
}

public final class io/sentry/vendor/anrwatchdog/ApplicationNotResponding : java/lang/RuntimeException {
public fun <init> (Ljava/lang/String;)V
public fun <init> (Ljava/lang/String;Ljava/lang/Thread;)V
public fun getThread ()Ljava/lang/Thread;
}

public final class io/sentry/vendor/aosp/threaddump/Line {
public field lineno I
public field text Ljava/lang/String;
public fun <init> (ILjava/lang/String;)V
}

public final class io/sentry/vendor/aosp/threaddump/Lines {
public field pos I
public fun <init> (Ljava/util/List;)V
public fun hasNext ()Z
public fun next ()Lio/sentry/vendor/aosp/threaddump/Line;
public static fun readLines (Ljava/io/BufferedReader;)Lio/sentry/vendor/aosp/threaddump/Lines;
public static fun readLines (Ljava/io/File;)Lio/sentry/vendor/aosp/threaddump/Lines;
public fun rewind ()V
}

public final class io/sentry/vendor/aosp/threaddump/ThreadDumpParser {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if we should exclude **vendor** from the public API dump? These were not here previously, but now they are here because we moved them from internal

public fun <init> (Lio/sentry/SentryOptions;Z)V
public fun getArtContext ()Lio/sentry/protocol/ArtContext;
public fun getDebugImages ()Ljava/util/List;
public fun getThreads ()Ljava/util/List;
public fun parse (Lio/sentry/vendor/aosp/threaddump/Lines;)V
}

public final class io/sentry/vendor/breadwallet/RootChecker {
public fun <init> (Landroid/content/Context;Lio/sentry/android/core/BuildInfoProvider;Lio/sentry/ILogger;)V
public fun isDeviceRooted ()Z
}

public final class io/sentry/vendor/firebase/FirstDrawDoneListener : android/view/ViewTreeObserver$OnDrawListener {
public fun onDraw ()V
public static fun registerForNextDraw (Landroid/app/Activity;Ljava/lang/Runnable;Lio/sentry/android/core/BuildInfoProvider;)V
public static fun registerForNextDraw (Landroid/view/View;Ljava/lang/Runnable;Lio/sentry/android/core/BuildInfoProvider;)V
}

public final class io/sentry/vendor/seismic/SentryShakeDetector : android/hardware/SensorEventListener {
public fun <init> (Lio/sentry/ILogger;)V
public fun close ()V
public fun init (Landroid/content/Context;Lio/sentry/ILogger;)V
public fun onAccuracyChanged (Landroid/hardware/Sensor;I)V
public fun onSensorChanged (Landroid/hardware/SensorEvent;)V
public fun reopen ()V
public fun start (Landroid/content/Context;Lio/sentry/vendor/seismic/SentryShakeDetector$Listener;)V
public fun stop ()V
}

public abstract interface class io/sentry/vendor/seismic/SentryShakeDetector$Listener {
public abstract fun onShake ()V
}

2 changes: 1 addition & 1 deletion sentry-android-core/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
# Sentry.init() checks this class by name, and OptionsContainer.create() instantiates it reflectively
-keep class io.sentry.android.core.SentryAndroidOptions { public <init>(); }

-keepnames class io.sentry.android.core.ApplicationNotResponding
-keepnames class io.sentry.vendor.anrwatchdog.ApplicationNotResponding


##---------------End: proguard configuration for android-core ----------
Expand Down
Loading
Loading