From bb390e4c69c4b2a0e7babef9000074b4a3699a72 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Fri, 11 Sep 2026 17:28:49 +0200 Subject: [PATCH] fix(native): adapt to API changes in the Native SDK --- .../Switch/SentryStub~/sentry_native_stubs.c | 17 ----------------- src/Sentry.Unity.Native/SentryNativeBridge.cs | 13 +------------ 2 files changed, 1 insertion(+), 29 deletions(-) diff --git a/package-dev/Plugins/Switch/SentryStub~/sentry_native_stubs.c b/package-dev/Plugins/Switch/SentryStub~/sentry_native_stubs.c index 2d4554ebb..6786716c9 100644 --- a/package-dev/Plugins/Switch/SentryStub~/sentry_native_stubs.c +++ b/package-dev/Plugins/Switch/SentryStub~/sentry_native_stubs.c @@ -102,18 +102,6 @@ void sentry_options_set_attach_screenshot(void* options, int attach) (void)attach; } -void sentry_options_set_enable_metrics(void* options, int enable_metrics) -{ - (void)options; - (void)enable_metrics; -} - -void sentry_options_set_enable_logs(void* options, int enable_logs) -{ - (void)options; - (void)enable_logs; -} - void sentry_options_set_shutdown_timeout(void* options, uint64_t shutdown_timeout) { (void)options; @@ -343,11 +331,6 @@ int sentry_get_crashed_last_run(void) return 0; } -int sentry_clear_crashed_last_run(void) -{ - return 0; -} - int sentry_reinstall_backend(void) { /* Success, matching sentry-native's `int sentry_reinstall_backend(void)` */ diff --git a/src/Sentry.Unity.Native/SentryNativeBridge.cs b/src/Sentry.Unity.Native/SentryNativeBridge.cs index 8ebeaa840..46d5baca6 100644 --- a/src/Sentry.Unity.Native/SentryNativeBridge.cs +++ b/src/Sentry.Unity.Native/SentryNativeBridge.cs @@ -105,9 +105,6 @@ is RuntimePlatform.WindowsPlayer or RuntimePlatform.WindowsServer Logger?.LogDebug("Setting ShutdownTimeout: {0}ms", shutdownTimeoutMs); sentry_options_set_shutdown_timeout(cOptions, shutdownTimeoutMs); - Logger?.LogDebug("Setting EnableLogs: {0}", options.EnableLogs); - sentry_options_set_enable_logs(cOptions, options.EnableLogs ? 1 : 0); - if (options.UnityInfo.IL2CPP) { Logger?.LogDebug("Setting the native logger"); @@ -134,12 +131,10 @@ is RuntimePlatform.WindowsPlayer or RuntimePlatform.WindowsServer public static void Close() => sentry_close(); - // Call after native init() to check if the application has crashed in the previous run and clear the status. - // Because the file is removed, the result will change on subsequent calls so it must be cached for the current runtime. + // Call after native init(), which reads and clears the persisted crash marker. internal static bool HandleCrashedLastRun(SentryUnityOptions options) { var result = sentry_get_crashed_last_run() == 1; - sentry_clear_crashed_last_run(); return result; } @@ -197,9 +192,6 @@ internal static string GetDatabasePath(SentryUnityOptions options, IApplication? [DllImport(SentryLib)] private static extern void sentry_options_set_shutdown_timeout(IntPtr options, ulong shutdown_timeout); - [DllImport(SentryLib)] - private static extern void sentry_options_set_enable_logs(IntPtr options, int enable_logs); - [DllImport(SentryLib)] private static extern void sentry_options_set_enable_app_hang_tracking(IntPtr options, int enabled); @@ -368,9 +360,6 @@ private static void WithMarshalledStruct(T structure, Action action) [DllImport(SentryLib)] private static extern int sentry_get_crashed_last_run(); - [DllImport(SentryLib)] - private static extern int sentry_clear_crashed_last_run(); - [DllImport(SentryLib)] private static extern void sentry_reinstall_backend();