From 0ac4030b5f0bbf6b5b57d9f0201da74a8fd3f02e Mon Sep 17 00:00:00 2001 From: Austin Huang Date: Fri, 21 Aug 2020 21:12:26 -0400 Subject: [PATCH] fix updater, me dumb --- .../awais/instagrabber/utils/FlavorTown.java | 44 ++++++++++--------- .../metadata/android/en-US/changelogs/46.txt | 1 + 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/app/src/main/java/awais/instagrabber/utils/FlavorTown.java b/app/src/main/java/awais/instagrabber/utils/FlavorTown.java index 70e35055..52c47e61 100755 --- a/app/src/main/java/awais/instagrabber/utils/FlavorTown.java +++ b/app/src/main/java/awais/instagrabber/utils/FlavorTown.java @@ -29,27 +29,29 @@ public final class FlavorTown { public static void updateCheck(@NonNull final Context context) { Resources res = context.getResources(); new UpdateChecker(version -> { - new AlertDialog.Builder(context) - .setTitle(res.getString(R.string.update_available, version)) - .setMessage(R.string.update_notice) - .setNeutralButton(R.string.cancel, null) - .setNegativeButton(R.string.action_github, (dialog, which) -> { - try { - context.startActivity(new Intent(Intent.ACTION_VIEW).setData( - Uri.parse("https://github.com/austinhuang0131/instagrabber/releases/latest"))); - } catch (final ActivityNotFoundException e) { - // do nothing - } - }) - .setPositiveButton(R.string.action_fdroid, (dialog, which) -> { - try { - context.startActivity(new Intent(Intent.ACTION_VIEW).setData( - Uri.parse("https://f-droid.org/packages/me.austinhuang.instagrabber/"))); - } catch (final ActivityNotFoundException e) { - // do nothing - } - }) - .show(); + if (version != BuildConfig.VERSION_NAME && !BuildConfig.DEBUG) { + new AlertDialog.Builder(context) + .setTitle(res.getString(R.string.update_available, version)) + .setMessage(R.string.update_notice) + .setNeutralButton(R.string.cancel, null) + .setNegativeButton(R.string.action_github, (dialog, which) -> { + try { + context.startActivity(new Intent(Intent.ACTION_VIEW).setData( + Uri.parse("https://github.com/austinhuang0131/instagrabber/releases/latest"))); + } catch (final ActivityNotFoundException e) { + // do nothing + } + }) + .setPositiveButton(R.string.action_fdroid, (dialog, which) -> { + try { + context.startActivity(new Intent(Intent.ACTION_VIEW).setData( + Uri.parse("https://f-droid.org/packages/me.austinhuang.instagrabber/"))); + } catch (final ActivityNotFoundException e) { + // do nothing + } + }) + .show(); + } }).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); } diff --git a/fastlane/metadata/android/en-US/changelogs/46.txt b/fastlane/metadata/android/en-US/changelogs/46.txt index 552c8781..d1fabc42 100644 --- a/fastlane/metadata/android/en-US/changelogs/46.txt +++ b/fastlane/metadata/android/en-US/changelogs/46.txt @@ -3,3 +3,4 @@ * You can now unsend messages * Adding favourite button on profile views * Enforcing a limit of 100 posts per download +* Fix updater \ No newline at end of file