From a4e84b960db78cf3ab441e4c40affcdcac5c0cdc Mon Sep 17 00:00:00 2001 From: Stefan Niedermann Date: Thu, 18 Nov 2021 14:29:29 +0100 Subject: Catch SSO 0.6.0 - Files 3.17 issue Signed-off-by: Stefan Niedermann --- .../nextcloud/deck/ui/exception/tips/TipsAdapter.java | 18 ++++++++++++------ app/src/main/res/values/strings.xml | 3 ++- 2 files changed, 14 insertions(+), 7 deletions(-) (limited to 'app/src/main') diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/exception/tips/TipsAdapter.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/exception/tips/TipsAdapter.java index 6d0c3ff5e..5588c12dc 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/exception/tips/TipsAdapter.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/exception/tips/TipsAdapter.java @@ -79,7 +79,8 @@ public class TipsAdapter extends RecyclerView.Adapter { add(R.string.error_dialog_tip_clear_storage_might_help); add(R.string.error_dialog_tip_clear_storage, INTENT_APP_INFO); } else if (throwable instanceof NextcloudFilesAppNotSupportedException) { - add(R.string.error_dialog_tip_files_outdated); + add(R.string.error_dialog_min_version, new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=com.nextcloud.client")) + .putExtra(INTENT_EXTRA_BUTTON_TEXT, R.string.error_action_update_files_app)); } else if (throwable instanceof OfflineException) { add(R.string.error_dialog_tip_offline); add(R.string.error_dialog_tip_sync_only_on_wifi); @@ -169,12 +170,17 @@ public class TipsAdapter extends RecyclerView.Adapter { add(R.string.error_dialog_tip_clear_storage, INTENT_APP_INFO); } } else if (throwable instanceof UnknownErrorException) { - if (account != null) { - add(R.string.error_dialog_unknown_error, new Intent(Intent.ACTION_VIEW) - .putExtra(INTENT_EXTRA_BUTTON_TEXT, R.string.error_action_open_in_browser) - .setData(Uri.parse(account.getUrl()))); + if ("com.nextcloud.android.sso.QueryParam".equals(throwable.getMessage())) { + add(R.string.error_dialog_min_version, new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=com.nextcloud.client")) + .putExtra(INTENT_EXTRA_BUTTON_TEXT, R.string.error_action_update_files_app)); } else { - add(R.string.error_dialog_unknown_error); + if (account != null) { + add(R.string.error_dialog_unknown_error, new Intent(Intent.ACTION_VIEW) + .putExtra(INTENT_EXTRA_BUTTON_TEXT, R.string.error_action_open_in_browser) + .setData(Uri.parse(account.getUrl()))); + } else { + add(R.string.error_dialog_unknown_error); + } } } } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 0cf2eb534..57e865856 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -239,7 +239,6 @@ If the issue persists, try to clear the storage of both apps: Nextcloud and Nextcloud Deck to solve this issue. The upgrade of the database failed. Please report the issue and clear the storage to use the app normally. You can clear the storage by opening the app info and selecting Storage → Clear storage. - Your Nextcloud app seems to be outdated. Please visit the Play Store or F-Droid to get the latest version. It looks like you tried to trigger a synchronization without an internet connection. If you have enabled the "Sync only on Wi-Fi" setting, you can only synchronize when you are connected to a Wi-Fi. Something seems to be wrong with your Nextcloud app. Please try to force stop both, the Nextcloud app and the Nextcloud Deck app. @@ -260,6 +259,7 @@ Something seems to be wrong with the certificate of the server. Please check all the accounts in the Nextcloud app for further information. Please disable all battery optimizations for Nextcloud and the Deck app. Your Nextcloud instance seems to be not reachable. Please check your internet connection and whether you are able to connect to your instance via browser. + The Deck Android app requires the Nextcloud Android app to be at least version 3.18. Open App info Open Nextcloud app Network settings @@ -267,6 +267,7 @@ Open in browser Install Report + Update Server is in maintenance mode Server version %1$s not supported, please update to %2$s Share link -- cgit v1.2.3