From 23af62d8d034f26977c096efac2247a63cc550f4 Mon Sep 17 00:00:00 2001 From: Sibo Van Gool Date: Thu, 20 Jan 2022 23:08:48 +0100 Subject: [PATCH] [fixes #825] Change update URLs --- .../openrocket/communication/Communicator.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/core/src/net/sf/openrocket/communication/Communicator.java b/core/src/net/sf/openrocket/communication/Communicator.java index ef31bc1c5..2e3d7656f 100644 --- a/core/src/net/sf/openrocket/communication/Communicator.java +++ b/core/src/net/sf/openrocket/communication/Communicator.java @@ -1,17 +1,15 @@ package net.sf.openrocket.communication; -import java.io.UnsupportedEncodingException; import java.net.HttpURLConnection; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; -import net.sf.openrocket.util.BugException; - public abstract class Communicator { protected static final String BUG_REPORT_URL; - protected static final String UPDATE_INFO_URL; + protected static final String UPDATE_URL; + protected static final String UPDATE_ADDITIONAL_URL; // Extra URL needed for the update checker static { String url; @@ -21,9 +19,14 @@ public abstract class Communicator { BUG_REPORT_URL = url; url = System.getProperty("openrocket.debug.updateurl"); - if (url == null) - url = "http://openrocket.sourceforge.net/actions/updates"; - UPDATE_INFO_URL = url; + if (url == null) { + url = "https://api.github.com/repos/openrocket/openrocket/releases"; + UPDATE_ADDITIONAL_URL = "https://api.github.com/repos/openrocket/openrocket/releases/latest"; + } + else { + UPDATE_ADDITIONAL_URL = null; + } + UPDATE_URL = url; }