From fc631c878181530182b3685d2dd8c99e0d004f2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Wed, 20 May 2015 22:50:42 +0200 Subject: [PATCH] Better strings for system installer, cleanup --- F-Droid/res/values/strings.xml | 33 ++++++++++--------- .../InstallIntoSystemDialogActivity.java | 13 +++----- 2 files changed, 21 insertions(+), 25 deletions(-) diff --git a/F-Droid/res/values/strings.xml b/F-Droid/res/values/strings.xml index 6c8c27318..59776bc9e 100644 --- a/F-Droid/res/values/strings.xml +++ b/F-Droid/res/values/strings.xml @@ -25,10 +25,10 @@ Notify when updates are available Update history Days to consider apps new or recent: %s - Install using system-permissions - Use system permissions to install, update, and remove packages - Uninstall F-Droid - Uninstall F-Droid when installed as a system-app. + Enable privileged F-Droid + Use privileged permissions to install, update, and remove packages + Uninstall privileged F-Droid + Uninstall F-Droid when installed as a privileged app Broadcast Local Repo Advertise your local repo using Bonjour (mDNS) Name of your Local Repo @@ -292,21 +292,22 @@ Either your Android device is not rooted or you have denied root access for F-Droid. Update all (De-)Installation Error - The (de-)installation failed. If you are using root access, try disabling this setting! + The (de-)installation failed. If you are using F-Droid as a privileged app, try disabling this setting! System permissions denied - This option is only available when F-Droid is installed as a system-app. - Install as system-app - Install F-Droid as a system-app? - Looks like you have root access on your device. You could install F-Droid as a system-app to enable extended features, such as automatic app updates.\nYou can also do this later from F-Droid\'s preferences. - Successful installation as system-app - Installation as system-app failed - F-Droid has been successfully installed into the system partition. This enables extended features, such as automatic app updates. - The installation of F-Droid into the system partition failed. The installation method is not supported by all Android distributions, please consult the F-Droid bug tracker for more information. + This option is only available when F-Droid is installed as a privileged app. + Install as a privileged app + Install privileged F-Droid? + Click here for more information. + Click here to install F-Droid as a privileged app, tightly coupled with the Android operating system. This enables extended features, such as automatic app updates.\nYou can also do this later from F-Droid\'s preferences. + Successful installation as a privileged app + Installation as a privileged app failed + F-Droid has been successfully installed as a privileged app. This enables extended features, such as automatic app updates. + The installation of F-Droid as a privileged app failed. The installation method is not supported by all Android distributions, please consult the F-Droid bug tracker for more information. installing… uninstalling… - Do you want to install F-Droid as a system-app?\nThis takes up to 10 seconds where <b>no user interface</b> is shown. - Do you want to install F-Droid as a system-app?\nThis takes up to 10 seconds where <b>no user interface</b> is shown and the device will be <b>rebooted</b> afterwards. - Looks like you have root access on your device. You could install F-Droid as a system-app to enable extended features, such as automatic app updates. + Do you want to install F-Droid as a privileged app?\nThis takes up to 10 seconds where <b>no user interface</b> is shown. + Do you want to install F-Droid as a privileged app?\nThis takes up to 10 seconds where <b>no user interface</b> is shown and the device will be <b>rebooted</b> afterwards. + Looks like you have root access on your device. You can now install F-Droid as a privileged app, tightly coupled with the Android operating system. This enables extended features, such as automatic app updates. Do you want to uninstall F-Droid? This will uninstall F-Droid completely. Uninstall diff --git a/F-Droid/src/org/fdroid/fdroid/installer/InstallIntoSystemDialogActivity.java b/F-Droid/src/org/fdroid/fdroid/installer/InstallIntoSystemDialogActivity.java index e856f64f9..a15dc9550 100644 --- a/F-Droid/src/org/fdroid/fdroid/installer/InstallIntoSystemDialogActivity.java +++ b/F-Droid/src/org/fdroid/fdroid/installer/InstallIntoSystemDialogActivity.java @@ -85,7 +85,7 @@ public class InstallIntoSystemDialogActivity extends FragmentActivity { public static void firstTime(final Context context) { if (Preferences.get().isFirstTime()) { Preferences.get().setFirstTime(false); - + if (Installer.hasSystemPermissions(context, context.getPackageManager())) { Preferences.get().setSystemInstallerEnabled(true); } else { @@ -111,9 +111,6 @@ public class InstallIntoSystemDialogActivity extends FragmentActivity { if (probablyRoot) { // looks like we have root, at least su has a version number and is present - // final int icon = Build.VERSION.SDK_INT >= 11 ? R.drawable.ic_stat_notify_updates : R.drawable.ic_launcher; - final int icon = R.drawable.ic_launcher; - Intent installIntent = new Intent(context, InstallIntoSystemDialogActivity.class); installIntent.setAction(InstallIntoSystemDialogActivity.ACTION_FIRST_TIME); installIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); @@ -126,14 +123,12 @@ public class InstallIntoSystemDialogActivity extends FragmentActivity { PendingIntent.FLAG_UPDATE_CURRENT ); - String msg = context.getString(R.string.system_install_first_time_notification_message); - NotificationCompat.Builder builder = new NotificationCompat.Builder(context) .setContentIntent(resultPendingIntent) - .setSmallIcon(icon) + .setSmallIcon(R.drawable.ic_launcher) .setContentTitle(context.getString(R.string.system_install_first_time_notification)) - .setContentText(msg) + .setContentText(context.getString(R.string.system_install_first_time_notification_message_short)) .setDefaults(Notification.DEFAULT_ALL) .setAutoCancel(true) /* @@ -144,7 +139,7 @@ public class InstallIntoSystemDialogActivity extends FragmentActivity { * pre-4.1 devices. */ .setStyle(new NotificationCompat.BigTextStyle() - .bigText(msg)); + .bigText(context.getString(R.string.system_install_first_time_notification_message))); NotificationManager nm = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); nm.notify(42, builder.build());