From f763304c6e86c1db362c8135c292d0a06e2f9d93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcell=20T=C3=B3th?= Date: Fri, 8 Aug 2025 15:29:32 +0200 Subject: [PATCH] ed-odyssey-materials-helper: remove sentry --- .../ed-odyssey-materials-helper/package.nix | 8 ++- .../remove-sentry.patch | 53 +++++++++++++++++++ 2 files changed, 56 insertions(+), 5 deletions(-) create mode 100644 pkgs/by-name/ed/ed-odyssey-materials-helper/remove-sentry.patch diff --git a/pkgs/by-name/ed/ed-odyssey-materials-helper/package.nix b/pkgs/by-name/ed/ed-odyssey-materials-helper/package.nix index 3af3d8a97c6c..d19ad7a38dfd 100644 --- a/pkgs/by-name/ed/ed-odyssey-materials-helper/package.nix +++ b/pkgs/by-name/ed/ed-odyssey-materials-helper/package.nix @@ -40,6 +40,9 @@ stdenv.mkDerivation rec { # so this removes 1) the popup about it when you first start the program, 2) the option in the settings # and makes the program always know that it is set up ./remove-urlscheme-settings.patch + + # Upstream requested that sentry is only to be used with official builds, remove it so it doesn't complain about the lack of DSN + ./remove-sentry.patch ]; postPatch = '' # oslib doesn't seem to do releases and hasn't had a change since 2021, so always use commit d6ee6549bb @@ -71,11 +74,6 @@ stdenv.mkDerivation rec { gradleBuildTask = "application:jpackage"; - env = { - # The source no longer contains this, so this has been extracted from the binary releases - SENTRY_DSN = "https://1aacf97280717f749dfc93a1713f9551@o4507814449774592.ingest.de.sentry.io/4507814504759376"; - }; - installPhase = '' runHook preInstall diff --git a/pkgs/by-name/ed/ed-odyssey-materials-helper/remove-sentry.patch b/pkgs/by-name/ed/ed-odyssey-materials-helper/remove-sentry.patch new file mode 100644 index 000000000000..16da10edb102 --- /dev/null +++ b/pkgs/by-name/ed/ed-odyssey-materials-helper/remove-sentry.patch @@ -0,0 +1,53 @@ +diff --git a/application/src/main/java/nl/jixxed/eliteodysseymaterials/Main.java b/application/src/main/java/nl/jixxed/eliteodysseymaterials/Main.java +index 04b101f0..2e589e12 100644 +--- a/application/src/main/java/nl/jixxed/eliteodysseymaterials/Main.java ++++ b/application/src/main/java/nl/jixxed/eliteodysseymaterials/Main.java +@@ -51,48 +51,6 @@ public class Main { + System.exit(0); + } + log.info("launching app with java version: " + getVersion()); +- if (System.getProperty("sentry.dsn") == null || System.getProperty("sentry.dsn").isBlank() || System.getProperty("sentry.dsn").equals("null")) { +- log.error("Sentry DSN is not set. Please set the DSN."); +- } +- Sentry.init(options -> { +- +- final String buildVersion = getBuildVersion(); +- options.setDsn(System.getProperty("sentry.dsn")); +- options.setEnvironment(getEnvironment(buildVersion)); +- options.setRelease("edomh-app@" + buildVersion); +- options.setEnabled(!buildVersion.equals("dev")); +- options.setBeforeSend((event, hint) -> { +- if (!VersionService.isLatestVersion()) { +- return null; // Returning null prevents the event from being sent to Sentry +- } +- if (Duration.between(lastSentTime, Instant.now()).getSeconds() < 30) { +- return null; // Throttle if less than 30 seconds have passed +- } +- lastSentTime = Instant.now(); +- String supportFile = ""; +- try { +- supportFile = SupportService.createSupportPackage(); +- } catch (Exception e) { +- log.error("Failed to create support package", e); +- } +- if (!supportFile.isBlank()) { +- Attachment attachment = new Attachment(supportFile); +- hint.addAttachment(attachment); +- } +- OperatingSystem os = new OperatingSystem(); +- os.setName(System.getProperty("os.name")); +- os.setVersion(System.getProperty("os.version")); +- os.setBuild(System.getProperty("os.arch")); +- event.getContexts().setOperatingSystem(os); +- if (APPLICATION_STATE.getFileheader() != null) { +- event.setTag("game.version", APPLICATION_STATE.getFileheader().getGameversion()); +- event.setTag("game.build", APPLICATION_STATE.getFileheader().getBuild()); +- event.setTag("game.language", APPLICATION_STATE.getFileheader().getLanguage()); +- event.setTag("game.odyssey", String.valueOf(APPLICATION_STATE.getFileheader().getOdyssey())); +- } +- return event; +- }); +- }); + FXApplication.launchFx(args); + } + }