Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
e40f655
build(deps): bump gradle/actions from 4.3.1 to 4.4.0
dependabot[bot] May 19, 2025
b7e6f4a
build(deps): bump github/codeql-action from 3.28.16 to 3.28.18
dependabot[bot] May 19, 2025
1f36865
build(deps): bump ossf/scorecard-action from 2.4.1 to 2.4.2
dependabot[bot] Jun 2, 2025
e17ebae
Merge pull request #2195 from bugsnag/main
lemnik Jun 4, 2025
92a5f2c
fix(release): fix the publishing repository
lemnik Jun 4, 2025
204f25f
Merge pull request #2196 from bugsnag/lemnik/release-fixes
lemnik Jun 4, 2025
bce6856
Merge pull request #2186 from bugsnag/dependabot/github_actions/gradl…
lemnik Jun 4, 2025
a719500
Merge pull request #2187 from bugsnag/dependabot/github_actions/githu…
lemnik Jun 4, 2025
9260f09
fix(exitinfo): move the optional call to `setProcessStateSummary` to …
lemnik Jun 5, 2025
984a528
Merge pull request #2193 from bugsnag/dependabot/github_actions/ossf/…
lemnik Jun 5, 2025
fa94e0e
Merge pull request #2197 from bugsnag/PLAT-14342/safe-setProcessState…
lemnik Jun 11, 2025
2f90458
build(deps): bump github/codeql-action from 3.28.18 to 3.29.0
dependabot[bot] Jun 17, 2025
88c6179
Merge pull request #2199 from bugsnag/dependabot/github_actions/githu…
lemnik Jun 20, 2025
a1adf80
build(deps): bump gradle/actions from 4.4.0 to 4.4.1 (#2200)
dependabot[bot] Jun 23, 2025
90f2638
fix(ndk): properly scope the build-id capturing in the stack_unwinder
lemnik Jun 24, 2025
d1fda76
Allow e2e test requests to be forwarded to Bugsnag and InsightHub
Jun 24, 2025
e3551de
Merge pull request #2203 from bugsnag/PLAT-14177/buildid-improvement
lemnik Jun 24, 2025
9958d9f
fix(startup): more startup processing to complete in the background
lemnik Jun 11, 2025
75693c8
fix(startup): allow the SessionTracker startup to complete later with…
lemnik Jun 11, 2025
31b6fcc
fix(root): add a process timeout to RootDetector
lemnik Jun 20, 2025
081cb1c
Merge pull request #2204 from bugsnag/tms/hub-repeater
twometresteve Jun 25, 2025
f7ef874
Merge pull request #2202 from bugsnag/PLAT-14377/fix-background-anr
lemnik Jun 27, 2025
0a1412e
refactor(ndk): generate JNI linker tables in Gradle, and RegisterNati…
lemnik Jun 27, 2025
7c25eea
chore(docs): renamed the link-table plugin to `bugsnag-jni-link-table…
lemnik Jun 30, 2025
85e9a4a
Merge pull request #2205 from bugsnag/PLAT-14323/jni-onload
lemnik Jun 30, 2025
24eb1c1
build(deps): bump github/codeql-action from 3.29.0 to 3.29.2 (#2207)
dependabot[bot] Jul 1, 2025
1999bab
release v6.15.0
YYChen01988 Jul 2, 2025
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
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@28deaeda66b76a05916b6923827895f2b14ab387 #v3.28.16
uses: github/codeql-action/init@181d5eefc20863364f96762470ba6f862bdef56b #v3.29.2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -83,6 +83,6 @@ jobs:
./gradlew --no-daemon assemble

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@28deaeda66b76a05916b6923827895f2b14ab387 #v3.28.16
uses: github/codeql-action/analyze@181d5eefc20863364f96762470ba6f862bdef56b #v3.29.2
with:
category: "/language:${{matrix.language}}"
6 changes: 3 additions & 3 deletions .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
persist-credentials: false

- name: "Run analysis"
uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1
uses: ossf/scorecard-action@05b42c624433fc40578a4040d5cf5e36ddca8cde # v2.4.2
with:
results_file: results.sarif
results_format: sarif
Expand Down Expand Up @@ -68,7 +68,7 @@ jobs:
# Upload the results to GitHub's code scanning dashboard (optional).
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@28deaeda66b76a05916b6923827895f2b14ab387 # v3.28.16
uses: github/codeql-action/upload-sarif@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
with:
sarif_file: results.sarif

Expand All @@ -77,4 +77,4 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: gradle/actions/wrapper-validation@06832c7b30a0129d7fb559bcc6e43d26f6374244 # v4.3.1
- uses: gradle/actions/wrapper-validation@ac638b010cf58a27ee6c972d7336334ccaf61c96 # v4.4.1
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Changelog

## 6.15.0 (2025-07-02)

### Enhancements

* `bugsnag-plugin-android-ndk` no longer exports the `Java_` JNI functions, and instead uses the JNI `RegisterNatives` API to register the native methods.
[#2205](https://github.com/bugsnag/bugsnag-android/pull/2205)

### Bug fixes

* The `bugsnag-plugin-android-exitinfo` plugin now calls `setProcessState` (if configured) on a background thread and swallows any rate-limiting errors, so that it does not block the main thread during startup
[#2197](https://github.com/bugsnag/bugsnag-android/pull/2197)
* Improve the scoping of the build-id capturing in `bugsnag-plugin-android-ndk` to more reliably capture the build-id from the correct `.so` file
[#2203](https://github.com/bugsnag/bugsnag-android/pull/2203)
* Fixed a background ANR that could occur during startup if processes do not launch or run quickly enough
[#2202](https://github.com/bugsnag/bugsnag-android/pull/2202)

## 6.14.0 (2025-06-04)

### Enhancements
Expand Down
3 changes: 2 additions & 1 deletion bugsnag-android-core/detekt-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<ID>CyclomaticComplexMethod:ConfigInternal.kt$ConfigInternal$fun getConfigDifferences(): Map&lt;String, Any></ID>
<ID>ImplicitDefaultLocale:Deliverable.kt$Deliverable$String.format("%02x", byte)</ID>
<ID>LongParameterList:App.kt$App$( /** * The architecture of the running application binary */ var binaryArch: String?, /** * The package name of the application */ var id: String?, /** * The release stage set in [Configuration.releaseStage] */ var releaseStage: String?, /** * The version of the application set in [Configuration.version] */ var version: String?, /** The revision ID from the manifest (React Native apps only) */ var codeBundleId: String?, /** * The unique identifier for the build of the application set in [Configuration.buildUuid] */ buildUuid: Provider&lt;String?>?, /** * The application type set in [Configuration#version] */ var type: String?, /** * The version code of the application set in [Configuration.versionCode] */ var versionCode: Number? )</ID>
<ID>LongParameterList:AppDataCollector.kt$AppDataCollector$( appContext: Context, private val packageManager: PackageManager?, private val config: ImmutableConfig, private val sessionTracker: SessionTracker, private val activityManager: ActivityManager?, private val launchCrashTracker: LaunchCrashTracker, private val memoryTrimState: MemoryTrimState )</ID>
<ID>LongParameterList:AppDataCollector.kt$AppDataCollector$( appContext: Context, private val packageManager: PackageManager?, private val config: ImmutableConfig, private val sessionTracker: Provider&lt;SessionTracker>, private val activityManager: ActivityManager?, private val launchCrashTracker: LaunchCrashTracker, private val memoryTrimState: MemoryTrimState )</ID>
<ID>LongParameterList:AppWithState.kt$AppWithState$( binaryArch: String?, id: String?, releaseStage: String?, version: String?, codeBundleId: String?, buildUuid: Provider&lt;String?>?, type: String?, versionCode: Number?, /** * The number of milliseconds the application was running before the event occurred */ var duration: Number?, /** * The number of milliseconds the application was running in the foreground before the * event occurred */ var durationInForeground: Number?, /** * Whether the application was in the foreground when the event occurred */ var inForeground: Boolean?, /** * Whether the application was launching when the event occurred */ var isLaunching: Boolean? )</ID>
<ID>LongParameterList:AppWithState.kt$AppWithState$( binaryArch: String?, id: String?, releaseStage: String?, version: String?, codeBundleId: String?, buildUuid: String?, type: String?, versionCode: Number?, /** * The number of milliseconds the application was running before the event occurred */ duration: Number?, /** * The number of milliseconds the application was running in the foreground before the * event occurred */ durationInForeground: Number?, /** * Whether the application was in the foreground when the event occurred */ inForeground: Boolean?, /** * Whether the application was launching when the event occurred */ isLaunching: Boolean? )</ID>
<ID>LongParameterList:AppWithState.kt$AppWithState$( config: ImmutableConfig, binaryArch: String?, id: String?, releaseStage: String?, version: String?, codeBundleId: String?, duration: Number?, durationInForeground: Number?, inForeground: Boolean?, isLaunching: Boolean? )</ID>
Expand Down Expand Up @@ -61,6 +61,7 @@
<ID>SwallowedException:ForegroundDetector.kt$ForegroundDetector$e: Exception</ID>
<ID>SwallowedException:JsonHelperTest.kt$JsonHelperTest$e: IllegalArgumentException</ID>
<ID>SwallowedException:PluginClient.kt$PluginClient$exc: ClassNotFoundException</ID>
<ID>SwallowedException:RootDetector.kt$RootDetector$ex: IllegalThreadStateException</ID>
<ID>SwallowedException:SharedPrefMigrator.kt$SharedPrefMigrator$e: RuntimeException</ID>
<ID>ThrowsCount:JsonHelper.kt$JsonHelper$fun jsonToLong(value: Any?): Long?</ID>
<ID>TooManyFunctions:ConfigInternal.kt$ConfigInternal : CallbackAwareMetadataAwareUserAwareFeatureFlagAware</ID>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.bugsnag.android

import android.content.Context
import android.os.SystemClock
import com.bugsnag.android.internal.dag.ValueProvider
import org.junit.Assert.assertEquals
import org.junit.Assert.assertTrue
import org.junit.Before
Expand Down Expand Up @@ -41,7 +42,7 @@ class AppDataCollectorForegroundTest {
appContext,
null,
config,
sessionTracker,
ValueProvider(sessionTracker),
null,
launchCrashTracker,
memoryTrimState
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import android.content.pm.PackageManager
import android.os.Build
import android.os.Process
import androidx.test.core.app.ApplicationProvider
import com.bugsnag.android.internal.dag.ValueProvider
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNull
import org.junit.Assert.assertTrue
Expand Down Expand Up @@ -49,7 +50,7 @@ class AppDataCollectorTest {
context,
context.packageManager,
client.immutableConfig,
client.sessionTracker,
ValueProvider(client.sessionTracker),
am,
client.launchCrashTracker,
client.memoryTrimState
Expand All @@ -70,7 +71,7 @@ class AppDataCollectorTest {
context,
context.packageManager,
client.immutableConfig,
client.sessionTracker,
ValueProvider(client.sessionTracker),
am,
client.launchCrashTracker,
client.memoryTrimState
Expand All @@ -93,7 +94,7 @@ class AppDataCollectorTest {
context,
context.packageManager,
client.immutableConfig,
client.sessionTracker,
ValueProvider(client.sessionTracker),
am,
client.launchCrashTracker,
client.memoryTrimState
Expand All @@ -115,7 +116,7 @@ class AppDataCollectorTest {
context,
packageManager,
client.immutableConfig,
client.sessionTracker,
ValueProvider(client.sessionTracker),
am,
client.launchCrashTracker,
client.memoryTrimState
Expand Down Expand Up @@ -144,7 +145,7 @@ class AppDataCollectorTest {
context,
packageManager,
client.immutableConfig,
client.sessionTracker,
ValueProvider(client.sessionTracker),
am,
client.launchCrashTracker,
client.memoryTrimState
Expand All @@ -171,7 +172,7 @@ class AppDataCollectorTest {
context,
packageManager,
client.immutableConfig,
client.sessionTracker,
ValueProvider(client.sessionTracker),
am,
client.launchCrashTracker,
client.memoryTrimState
Expand All @@ -198,7 +199,7 @@ class AppDataCollectorTest {
context,
packageManager,
client.immutableConfig,
client.sessionTracker,
ValueProvider(client.sessionTracker),
am,
client.launchCrashTracker,
client.memoryTrimState
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.bugsnag.android

import android.app.Application
import androidx.test.core.app.ApplicationProvider
import com.bugsnag.android.internal.dag.ValueProvider
import org.junit.Assert.assertEquals
import org.junit.Test
import org.junit.runner.RunWith
Expand Down Expand Up @@ -48,6 +49,6 @@ internal class CustomFileStore(
folder: File,
maxStoreCount: Int,
delegate: Delegate?
) : FileStore(folder, maxStoreCount, NoopLogger, delegate) {
) : FileStore(folder, maxStoreCount, NoopLogger, ValueProvider(delegate)) {
override fun getFilename(obj: Any?) = "foo.json"
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import android.os.Build.VERSION_CODES
import android.os.Process
import android.os.SystemClock
import com.bugsnag.android.internal.ImmutableConfig
import com.bugsnag.android.internal.dag.Provider

/**
* Collects various data on the application state
Expand All @@ -32,7 +33,7 @@ internal class AppDataCollector(
appContext: Context,
private val packageManager: PackageManager?,
private val config: ImmutableConfig,
private val sessionTracker: SessionTracker,
private val sessionTracker: Provider<SessionTracker>,
private val activityManager: ActivityManager?,
private val launchCrashTracker: LaunchCrashTracker,
private val memoryTrimState: MemoryTrimState
Expand All @@ -54,7 +55,7 @@ internal class AppDataCollector(
App(config, binaryArch, packageName, releaseStage, versionName, codeBundleId)

fun generateAppWithState(): AppWithState {
val inForeground = sessionTracker.isInForeground
val inForeground = sessionTracker.get().isInForeground
val durationInForeground = calculateDurationInForeground(inForeground)

return AppWithState(
Expand Down Expand Up @@ -118,7 +119,7 @@ internal class AppDataCollector(
fun getAppDataMetadata(): MutableMap<String, Any?> {
val map = HashMap<String, Any?>()
map["name"] = appName
map["activeScreen"] = sessionTracker.contextActivity
map["activeScreen"] = sessionTracker.get().contextActivity
map["lowMemory"] = memoryTrimState.isLowMemory
map["memoryTrimLevel"] = memoryTrimState.trimLevelDescription
map["processImportance"] = getProcessImportance()
Expand Down Expand Up @@ -168,15 +169,15 @@ internal class AppDataCollector(
*
* @return the duration in ms
*/
internal fun calculateDurationInForeground(inForeground: Boolean? = sessionTracker.isInForeground): Long? {
internal fun calculateDurationInForeground(inForeground: Boolean? = sessionTracker.get().isInForeground): Long? {
if (inForeground == null) {
return null
}

val nowMs = SystemClock.elapsedRealtime()
var durationMs: Long = 0

val sessionStartTimeMs: Long = sessionTracker.lastEnteredForegroundMs
val sessionStartTimeMs: Long = sessionTracker.get().lastEnteredForegroundMs

if (inForeground && sessionStartTimeMs != 0L) {
durationMs = nowMs - sessionStartTimeMs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ internal class DataCollectionModule(
ctx,
ctx.packageManager,
cfg,
trackerModule.sessionTracker.get(),
trackerModule.sessionTracker,
systemServiceModule.activityManager,
trackerModule.launchCrashTracker,
memoryTrimState
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ internal class EventStorageModule(
cfg.logger,
cfg,
systemServiceModule.storageManager,
dataCollectionModule.appDataCollector.get(),
dataCollectionModule.appDataCollector,
dataCollectionModule.deviceDataCollector,
trackerModule.sessionTracker.get(),
trackerModule.sessionTracker,
notifier,
bgTaskService
) else null
Expand All @@ -43,7 +43,7 @@ internal class EventStorageModule(
cfg.logger,
notifier,
bgTaskService,
delegate.getOrNull(),
delegate,
callbackState
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import com.bugsnag.android.internal.BackgroundTaskService
import com.bugsnag.android.internal.ForegroundDetector
import com.bugsnag.android.internal.ImmutableConfig
import com.bugsnag.android.internal.TaskType
import com.bugsnag.android.internal.dag.Provider
import java.io.File
import java.util.Calendar
import java.util.Date
Expand All @@ -27,7 +28,7 @@ internal class EventStore(
logger: Logger,
notifier: Notifier,
bgTaskService: BackgroundTaskService,
delegate: Delegate?,
delegate: Provider<out Delegate?>?,
callbackState: CallbackState
) : FileStore(
File(config.persistenceDirectory.value, "bugsnag/errors"),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.bugsnag.android

import com.bugsnag.android.JsonStream.Streamable
import com.bugsnag.android.internal.dag.Provider
import java.io.BufferedWriter
import java.io.File
import java.io.FileNotFoundException
Expand All @@ -15,7 +16,7 @@ internal abstract class FileStore(
val storageDir: File,
private val maxStoreCount: Int,
protected open val logger: Logger,
protected val delegate: Delegate?
protected val delegate: Provider<out Delegate?>?
) {
internal fun interface Delegate {
/**
Expand Down Expand Up @@ -66,7 +67,7 @@ internal abstract class FileStore(
out.write(content)
} catch (exc: Exception) {
val eventFile = File(filePath)
delegate?.onErrorIOFailure(exc, eventFile, "NDK Crash report copy")
delegate?.getOrNull()?.onErrorIOFailure(exc, eventFile, "NDK Crash report copy")
IOUtils.deleteFile(eventFile, logger)
} finally {
try {
Expand Down Expand Up @@ -100,7 +101,7 @@ internal abstract class FileStore(
logger.w("Ignoring FileNotFoundException - unable to create file", exc)
} catch (exc: Exception) {
val eventFile = File(filename)
delegate?.onErrorIOFailure(exc, eventFile, "Crash report serialization")
delegate?.getOrNull()?.onErrorIOFailure(exc, eventFile, "Crash report serialization")
IOUtils.deleteFile(eventFile, logger)
} finally {
IOUtils.closeQuietly(stream)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,20 @@ class InternalReportDelegate implements EventStore.Delegate {
@Nullable
final StorageManager storageManager;

final AppDataCollector appDataCollector;
final Provider<AppDataCollector> appDataCollector;
final Provider<DeviceDataCollector> deviceDataCollector;
final Context appContext;
final SessionTracker sessionTracker;
final Provider<SessionTracker> sessionTracker;
final Notifier notifier;
final BackgroundTaskService backgroundTaskService;

InternalReportDelegate(Context context,
Logger logger,
ImmutableConfig immutableConfig,
@Nullable StorageManager storageManager,
AppDataCollector appDataCollector,
Provider<AppDataCollector> appDataCollector,
Provider<DeviceDataCollector> deviceDataCollector,
SessionTracker sessionTracker,
Provider<SessionTracker> sessionTracker,
Notifier notifier,
BackgroundTaskService backgroundTaskService) {
this.logger = logger;
Expand Down Expand Up @@ -101,7 +101,7 @@ void recordStorageCacheBehavior(Event event) {
* This is intended for internal use only, and reports will not be visible to end-users.
*/
void reportInternalBugsnagError(@NonNull Event event) {
event.setApp(appDataCollector.generateAppWithState());
event.setApp(appDataCollector.get().generateAppWithState());
event.setDevice(deviceDataCollector.get().generateDeviceWithState(new Date().getTime()));

event.addMetadata(INTERNAL_DIAGNOSTICS_TAB, "notifierName", notifier.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import java.io.IOException
*/
class Notifier @JvmOverloads constructor(
var name: String = "Android Bugsnag Notifier",
var version: String = "6.14.0",
var version: String = "6.15.0",
var url: String = "https://bugsnag.com"
) : JsonStream.Streamable {

Expand Down
Loading
Loading