Add crash hint for SSO 0.6.0 / Files < 3.18

Signed-off-by: Stefan Niedermann <info@niedermann.it>
This commit is contained in:
Stefan Niedermann 2021-11-18 13:59:07 +01:00
parent 088bac9975
commit 3f02439d0e
3 changed files with 14 additions and 8 deletions

View file

@ -91,13 +91,13 @@ dependencies {
annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
// Android X
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'androidx.appcompat:appcompat:1.4.0'
implementation 'androidx.fragment:fragment:1.3.6'
implementation 'androidx.preference:preference:1.1.1'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'androidx.recyclerview:recyclerview-selection:1.1.0'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
implementation 'androidx.work:work-runtime:2.7.0'
implementation 'androidx.work:work-runtime:2.7.1'
implementation 'com.google.android.material:material:1.4.0'
// Database
@ -118,7 +118,7 @@ dependencies {
testImplementation 'androidx.arch.core:core-testing:2.1.0'
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.mockito:mockito-core:4.0.0'
testImplementation 'org.robolectric:robolectric:4.7'
testImplementation 'org.robolectric:robolectric:4.7.1'
implementation fileTree(dir: 'libs', include: ['*.jar'])
}

View file

@ -1,13 +1,14 @@
package it.niedermann.owncloud.notes.exception.tips;
import static android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS;
import static it.niedermann.owncloud.notes.exception.ExceptionDialogFragment.INTENT_EXTRA_BUTTON_TEXT;
import android.content.Intent;
import android.net.Uri;
import android.os.Build.VERSION;
import android.os.Build.VERSION_CODES;
import android.provider.Settings;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
@ -20,6 +21,7 @@ import com.nextcloud.android.sso.exceptions.NextcloudApiNotRespondingException;
import com.nextcloud.android.sso.exceptions.NextcloudFilesAppNotSupportedException;
import com.nextcloud.android.sso.exceptions.NextcloudHttpRequestFailedException;
import com.nextcloud.android.sso.exceptions.TokenMismatchException;
import com.nextcloud.android.sso.exceptions.UnknownErrorException;
import org.json.JSONException;
@ -31,9 +33,6 @@ import java.util.List;
import it.niedermann.owncloud.notes.BuildConfig;
import it.niedermann.owncloud.notes.R;
import static android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS;
import static it.niedermann.owncloud.notes.exception.ExceptionDialogFragment.INTENT_EXTRA_BUTTON_TEXT;
public class TipsAdapter extends RecyclerView.Adapter<TipsViewHolder> {
@NonNull
@ -107,6 +106,11 @@ public class TipsAdapter extends RecyclerView.Adapter<TipsViewHolder> {
add(R.string.error_dialog_insufficient_storage);
break;
}
} else if (throwable instanceof UnknownErrorException) {
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));
}
}
}
notifyDataSetChanged();

View file

@ -196,6 +196,7 @@
<string name="error_dialog_server_app_enabled">Please make sure you have installed and enabled the "Notes" app on your server.</string>
<string name="error_dialog_redirect">Your server did respond with a HTTP 302 status code, which implies, that you do not have installed the Notes app on your server or something is misconfigured. This can be caused by custom overrides in a .htaccess-file or by Nextcloud apps like OID Client.</string>
<string name="error_dialog_tip_disable_battery_optimizations">Please disable all battery optimizations for Nextcloud and the Notes app.</string>
<string name="error_dialog_min_version">The Notes Android app requires the Nextcloud Android app to be at least version 3.18.</string>
<string name="added_content">Added "%1$s"</string>
<string name="shared_text_empty">Shared text was empty</string>
<string name="append_to_note">Append to note</string>
@ -321,6 +322,7 @@
<string name="error_action_open_battery_settings">Battery settings</string>
<string name="error_action_open_deck_info">Open App info</string>
<string name="error_action_open_network">Network settings</string>
<string name="error_action_update_files_app">Update</string>
<string name="no_account_configured_yet">No account configured yet</string>
<string name="no_other_accounts">You don\'t have configured any other accounts yet.</string>
<string name="choose_account">Choose account</string>