diff --git a/app/src/main/java/org/schabi/newpipe/MainActivity.java b/app/src/main/java/org/schabi/newpipe/MainActivity.java
index 00f1a62afb6..6aa87b4bd69 100644
--- a/app/src/main/java/org/schabi/newpipe/MainActivity.java
+++ b/app/src/main/java/org/schabi/newpipe/MainActivity.java
@@ -27,6 +27,7 @@
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
+import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
@@ -203,6 +204,7 @@ protected void onCreate(final Bundle savedInstanceState) {
// We want every release build (nightly, nightly-refactor) to show the popup
if (!DEBUG) {
showKeepAndroidDialog();
+ showApi23RequirementDialog();
}
MigrationManager.showUserInfoIfPresent(this);
@@ -984,55 +986,76 @@ private boolean bottomSheetHiddenOrCollapsed() {
private void showKeepAndroidDialog() {
final var prefs = PreferenceManager.getDefaultSharedPreferences(this);
-
+ final var lastCheckKey = getString(R.string.kao_last_checked_key);
+ final var lastCheck = Instant.ofEpochMilli(prefs.getLong(lastCheckKey, 0));
final var now = Instant.now();
- final var kaoLastCheck = Instant.ofEpochMilli(prefs.getLong(
- getString(R.string.kao_last_checked_key),
- 0
- ));
- final var supportedLannguages = List.of("fr", "de", "ca", "es", "id", "it", "pl",
+ if (lastCheck.plus(30, ChronoUnit.DAYS).isBefore(now)) {
+ final String detailsUrl = getKeepAndroidOpenDetailsUrl();
+ final var solutionUrl = "https://github.com/woheller69/FreeDroidWarn#solutions";
+
+ final var dialog = new AlertDialog.Builder(this)
+ .setTitle("Keep Android Open")
+ .setCancelable(false)
+ .setMessage(R.string.kao_dialog_warning)
+ .setPositiveButton(android.R.string.ok, (d, w) -> prefs.edit()
+ .putLong(lastCheckKey, now.toEpochMilli())
+ .apply())
+ .setNeutralButton(R.string.kao_solution, null)
+ .setNegativeButton(R.string.kao_dialog_more_info, null)
+ .show();
+
+ // If we use setNeutralButton/setNegativeButton, dialog will close after pressing the
+ // buttons, but we want it to close only when positive button is pressed
+ dialog.getButton(AlertDialog.BUTTON_NEGATIVE)
+ .setOnClickListener(v -> ShareUtils.openUrlInBrowser(this, detailsUrl));
+ dialog.getButton(AlertDialog.BUTTON_NEUTRAL)
+ .setOnClickListener(v -> ShareUtils.openUrlInBrowser(this, solutionUrl));
+ }
+ }
+
+ @NonNull
+ private static String getKeepAndroidOpenDetailsUrl() {
+ final var supportedLanguages = List.of("fr", "de", "ca", "es", "id", "it", "pl",
"pt", "cs", "sk", "fa", "ar", "tr", "el", "th", "ru", "uk", "ko", "zh", "ja");
- final var locale = Localization.getAppLocale();
final String kaoBaseUrl = "https://keepandroidopen.org/";
- final String kaoURI;
- if (supportedLannguages.contains(locale.getLanguage())) {
+ final var locale = Localization.getAppLocale();
+ if (supportedLanguages.contains(locale.getLanguage())) {
if ("zh".equals(locale.getLanguage())) {
- kaoURI = kaoBaseUrl + ("TW".equals(locale.getCountry()) ? "zh-TW" : "zh-CN");
+ return kaoBaseUrl + ("TW".equals(locale.getCountry()) ? "zh-TW" : "zh-CN");
} else {
- kaoURI = kaoBaseUrl + locale.getLanguage();
+ return kaoBaseUrl + locale.getLanguage();
}
} else {
- kaoURI = kaoBaseUrl;
+ return kaoBaseUrl;
}
- final var solutionURI =
- "https://github.com/woheller69/FreeDroidWarn?tab=readme-ov-file#solutions";
+ }
- if (kaoLastCheck.plus(30, ChronoUnit.DAYS).isBefore(now)) {
- final var dialog = new AlertDialog.Builder(this)
- .setTitle("Keep Android Open")
- .setCancelable(false)
- .setMessage(this.getString(R.string.kao_dialog_warning))
- .setPositiveButton(this.getString(android.R.string.ok), (d, w) -> {
- prefs.edit()
- .putLong(
- getString(R.string.kao_last_checked_key),
- now.toEpochMilli()
- )
- .apply();
- })
- .setNeutralButton(this.getString(R.string.kao_solution), null)
- .setNegativeButton(this.getString(R.string.kao_dialog_more_info), null)
- .show();
+ private void showApi23RequirementDialog() {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
+ return; // only show dialog on the devices that will stop being supported
+ }
- // If we use setNeutralButton and etc. dialog will close after pressing the buttons,
- // but we want it to close only when positive button is pressed
- dialog.getButton(AlertDialog.BUTTON_NEGATIVE).setOnClickListener(v ->
- ShareUtils.openUrlInBrowser(this, kaoURI)
- );
- dialog.getButton(AlertDialog.BUTTON_NEUTRAL).setOnClickListener(v ->
- ShareUtils.openUrlInBrowser(this, solutionURI)
- );
+ final var prefs = PreferenceManager.getDefaultSharedPreferences(this);
+ final var shownKey = getString(R.string.api23_requirement_dialog_shown_key);
+ if (prefs.getBoolean(shownKey, false)) {
+ return; // dialog was already shown in the past, no need to show it again
}
+
+ final var dialog = new AlertDialog.Builder(this)
+ .setTitle(R.string.api23_requirement_dialog_title)
+ .setCancelable(false)
+ .setMessage(R.string.api23_requirement_dialog_message)
+ .setPositiveButton(android.R.string.ok, (d, w) -> prefs.edit()
+ .putBoolean(shownKey, true)
+ .apply())
+ .setNegativeButton(R.string.api23_requirement_dialog_blogpost, null)
+ .show();
+
+ // If we use setNegativeButton, dialog will close after pressing the button,
+ // but we want it to close only when positive button is pressed
+ final var blogpostUrl = "https://newpipe.net/blog/pinned/announcement/drop-android-5/";
+ dialog.getButton(AlertDialog.BUTTON_NEGATIVE)
+ .setOnClickListener(v -> ShareUtils.openUrlInBrowser(this, blogpostUrl));
}
}
diff --git a/app/src/main/res/values/settings_keys.xml b/app/src/main/res/values/settings_keys.xml
index f49ed3dad73..60ac20d0ac2 100644
--- a/app/src/main/res/values/settings_keys.xml
+++ b/app/src/main/res/values/settings_keys.xml
@@ -11,6 +11,7 @@
kao_last_checked
+ api23_requirement_dialog_shown
download_path
download_path_audio
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 3ec84bfffbb..6f8f96d4c1d 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -900,4 +900,7 @@
In August 2025, Google announced that as of September 2026, installing apps will require developer verification for all Android apps on certified devices, including those installed outside of the Play Store. Since the developers of NewPipe do not agree to this requirement, NewPipe will no longer work on certified Android devices after that time.
Details
Solution
+ NewPipe is dropping support for Android 5
+ Unfortunately NewPipe depends on a few libraries that recently dropped support for Android 5.0 and 5.1. The next NewPipe release will therefore only work on devices with Android 6 or higher, sadly. Read more in the blogpost.
+ Blogpost