chore(GmsCore support): Use more generic message

This commit is contained in:
inotia00 2024-12-21 11:46:10 +09:00
parent 42e73cbfce
commit db792e3920
3 changed files with 18 additions and 11 deletions

View File

@ -59,18 +59,21 @@ public class GmsCoreSupport {
private static void showBatteryOptimizationDialog(Activity context,
String dialogMessageRef,
String positiveButtonStringRef,
String positiveButtonTextRef,
DialogInterface.OnClickListener onPositiveClickListener) {
// Use a delay to allow the activity to finish initializing.
// Otherwise, if device is in dark mode the dialog is shown with wrong color scheme.
Utils.runOnMainThreadDelayed(() -> new AlertDialog.Builder(context)
.setIconAttribute(android.R.attr.alertDialogIcon)
.setTitle(str("gms_core_dialog_title"))
.setMessage(str(dialogMessageRef))
.setPositiveButton(str(positiveButtonStringRef), onPositiveClickListener)
// Allow using back button to skip the action, just in case the check can never be satisfied.
.setCancelable(true)
.show(), 100);
Utils.runOnMainThreadDelayed(() ->
// Do not set cancelable to false, to allow using back button to skip the action,
// just in case the battery change can never be satisfied.
new AlertDialog.Builder(context)
.setIconAttribute(android.R.attr.alertDialogIcon)
.setTitle(str("gms_core_dialog_title"))
.setMessage(str(dialogMessageRef))
.setPositiveButton(str(positiveButtonTextRef), onPositiveClickListener)
.show(),
100
);
}
/**

View File

@ -443,7 +443,9 @@ This is required for the app to work."</string>
<string name="gms_core_dialog_open_website_text">Open website</string>
<string name="gms_core_dialog_not_whitelisted_using_battery_optimizations_message">"GmsCore battery optimizations must be disabled to prevent issues.
Tap on the continue button and disable battery optimizations."</string>
Disabling battery optimizations for GmsCore will not negatively affect battery usage.
Tap the continue button and allow optimization changes."</string>
<string name="gms_core_dialog_continue_text">Continue</string>
<string name="revanced_spoof_client_title">Spoof client</string>

View File

@ -1852,7 +1852,9 @@ This is required for the app to work."</string>
<string name="gms_core_dialog_open_website_text">Open website</string>
<string name="gms_core_dialog_not_whitelisted_using_battery_optimizations_message">"GmsCore battery optimizations must be disabled to prevent issues.
Tap on the continue button and disable battery optimizations."</string>
Disabling battery optimizations for GmsCore will not negatively affect battery usage.
Tap the continue button and allow optimization changes."</string>
<string name="gms_core_dialog_continue_text">Continue</string>
<string name="revanced_sanitize_sharing_links_title">Sanitize sharing links</string>