diff --git a/F-Droid/res/values/strings.xml b/F-Droid/res/values/strings.xml index ab9111cab..e6814af49 100644 --- a/F-Droid/res/values/strings.xml +++ b/F-Droid/res/values/strings.xml @@ -295,8 +295,10 @@ Root access denied 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 F-Droid as a privileged app, try disabling this setting! + Install error + Failed to install due to an unknown error + Uninstall error + Failed to uninstall due to an unknown error System permissions denied This option is only available when F-Droid is installed as a privileged app. Install as a privileged app diff --git a/F-Droid/src/org/fdroid/fdroid/AppDetails.java b/F-Droid/src/org/fdroid/fdroid/AppDetails.java index c0d7a3820..aa1a33028 100644 --- a/F-Droid/src/org/fdroid/fdroid/AppDetails.java +++ b/F-Droid/src/org/fdroid/fdroid/AppDetails.java @@ -1,5 +1,6 @@ /* * Copyright (C) 2010-12 Ciaran Gultnieks, ciaran@ciarang.com + * Copyright (C) 2013-15 Daniel Martí * Copyright (C) 2013 Stefan Völkel, bd@bc-bd.org * Copyright (C) 2015 Nico Alt, nicoalt@posteo.org * @@ -909,22 +910,36 @@ public class AppDetails extends AppCompatActivity implements ProgressListener, A onAppChanged(); } }); - } else { - runOnUiThread(new Runnable() { - @Override - public void run() { - onAppChanged(); - - Log.e(TAG, "Installer aborted with errorCode: " + errorCode); - - AlertDialog.Builder alertBuilder = new AlertDialog.Builder(AppDetails.this); - alertBuilder.setTitle(R.string.installer_error_title); - alertBuilder.setMessage(R.string.installer_error_title); - alertBuilder.setNeutralButton(android.R.string.ok, null); - alertBuilder.create().show(); - } - }); + return; } + final int title, body; + if (operation == InstallerCallback.OPERATION_INSTALL) { + title = R.string.install_error_title; + } else { + title = R.string.uninstall_error_title; + } + switch (errorCode) { + default: + if (operation == InstallerCallback.OPERATION_INSTALL) { + body = R.string.install_error_unknown; + } else { + body = R.string.uninstall_error_unknown; + } + } + runOnUiThread(new Runnable() { + @Override + public void run() { + onAppChanged(); + + Log.e(TAG, "Installer aborted with errorCode: " + errorCode); + + AlertDialog.Builder alertBuilder = new AlertDialog.Builder(AppDetails.this); + alertBuilder.setTitle(title); + alertBuilder.setMessage(body); + alertBuilder.setNeutralButton(android.R.string.ok, null); + alertBuilder.create().show(); + } + }); } };