From f1d40f89632d9aa9c53c36ae9c430882f9be6dc2 Mon Sep 17 00:00:00 2001 From: FineFindus Date: Thu, 1 Aug 2024 14:07:38 +0200 Subject: [PATCH 1/2] fix(Tacking): check if uri is hierarchical Checks if the given uri is hierarchical, as otherwise the `getQueryParameterNames` function will throw an exception. --- .../src/main/java/org/joinmastodon/android/utils/Tracking.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/utils/Tracking.java b/mastodon/src/main/java/org/joinmastodon/android/utils/Tracking.java index 93fb6aab21..4edbe37983 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/utils/Tracking.java +++ b/mastodon/src/main/java/org/joinmastodon/android/utils/Tracking.java @@ -64,7 +64,7 @@ public class Tracking{ @NonNull public static String removeTrackingParameters(@NonNull String url){ Uri uri=Uri.parse(url); - if(uri==null) + if(uri==null || !uri.isHierarchical()) return url; Uri.Builder uriBuilder=uri.buildUpon().clearQuery(); From 44473705b9d2b679e7e892fe95dbc98fbe0bc4d6 Mon Sep 17 00:00:00 2001 From: FineFindus Date: Thu, 1 Aug 2024 14:07:54 +0200 Subject: [PATCH 2/2] feat(Settings/About): hide pre-release option in nightly --- .../android/fragments/settings/SettingsAboutAppFragment.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/settings/SettingsAboutAppFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/settings/SettingsAboutAppFragment.java index a37875a607..87078c1101 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/settings/SettingsAboutAppFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/settings/SettingsAboutAppFragment.java @@ -94,7 +94,7 @@ public void onCreate(Bundle savedInstanceState){ copyCrashLogItem=new ListItem<>(getString(R.string.sk_settings_copy_crash_log), lastModified, 0, this::onCopyCrashLog) )); - if(GithubSelfUpdater.needSelfUpdating()){ + if(GithubSelfUpdater.needSelfUpdating() && !BuildConfig.BUILD_TYPE.equals("nightly") ){ items.add(enablePreReleasesItem=new CheckableListItem<>(R.string.sk_updater_enable_pre_releases, 0, CheckableListItem.Style.SWITCH, GlobalUserPreferences.enablePreReleases, i->toggleCheckableItem(enablePreReleasesItem))); }