Browse Source

Remove fingerprint authentication

Hari 7 years ago
parent
commit
a832abd87e

+ 0 - 1
src/main/AndroidManifest.xml

@@ -241,7 +241,6 @@
         <service android:name=".media.MediaService" />
 
         <activity android:name=".ui.activity.PassCodeActivity" />
-        <activity android:name=".ui.activity.FingerprintActivity"/>
         <activity android:name=".ui.activity.RequestCredentialsActivity" />
         <activity android:name=".ui.activity.ConflictsResolveActivity"/>
         <activity android:name=".ui.activity.GenericExplanationActivity"/>

+ 10 - 18
src/main/java/com/owncloud/android/authentication/PassCodeManager.java

@@ -29,7 +29,6 @@ import android.preference.PreferenceManager;
 import android.view.WindowManager;
 
 import com.owncloud.android.MainApp;
-import com.owncloud.android.ui.activity.FingerprintActivity;
 import com.owncloud.android.ui.activity.PassCodeActivity;
 import com.owncloud.android.ui.activity.Preferences;
 import com.owncloud.android.ui.activity.RequestCredentialsActivity;
@@ -43,10 +42,9 @@ public class PassCodeManager {
     private static final Set<Class> exemptOfPasscodeActivities;
 
     static {
-        exemptOfPasscodeActivities = new HashSet<>();
+        exemptOfPasscodeActivities = new HashSet<Class>();
         exemptOfPasscodeActivities.add(PassCodeActivity.class);
-        exemptOfPasscodeActivities.add(FingerprintActivity.class);
-        sExemptOfPasscodeActivites.add(RequestCredentialsActivity.class);
+        exemptOfPasscodeActivities.add(RequestCredentialsActivity.class);
         // other activities may be exempted, if needed
     }
 
@@ -68,7 +66,7 @@ public class PassCodeManager {
     protected PassCodeManager() {}
 
     public void onActivityCreated(Activity activity) {
-        if (passCodeIsEnabled() || fingerprintIsEnabled()) {
+        if (passCodeIsEnabled() || deviceCredentialsAreEnabled()) {
             activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
         } else {
             activity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_SECURE);
@@ -84,15 +82,6 @@ public class PassCodeManager {
             activity.startActivity(i);
         }
 
-        if (!exemptOfPasscodeActivities.contains(activity.getClass()) &&
-                Build.VERSION.SDK_INT >= Build.VERSION_CODES.M &&
-                fingerprintShouldBeRequested() && FingerprintActivity.isFingerprintReady(MainApp.getAppContext())) {
-
-            Intent i = new Intent(MainApp.getAppContext(), FingerprintActivity.class);
-            i.setAction(PassCodeActivity.ACTION_CHECK);
-            i.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
-            activity.startActivity(i);
-        }
 
         if (!sExemptOfPasscodeActivites.contains(activity.getClass()) && Build.VERSION.SDK_INT >=
                 Build.VERSION_CODES.M && deviceCredentialsShouldBeRequested() &&
@@ -111,7 +100,7 @@ public class PassCodeManager {
         }
         setUnlockTimestamp();
         PowerManager powerMgr = (PowerManager) activity.getSystemService(Context.POWER_SERVICE);
-        if ((passCodeIsEnabled() || fingerprintIsEnabled())&& powerMgr != null && !powerMgr.isScreenOn()) {
+        if ((passCodeIsEnabled() || deviceCredentialsAreEnabled())&& powerMgr != null && !powerMgr.isScreenOn()) {
             activity.moveTaskToBack(true);
         }
     }
@@ -129,8 +118,11 @@ public class PassCodeManager {
         return (appPrefs.getBoolean(PassCodeActivity.PREFERENCE_SET_PASSCODE, false));
     }
 
-    private boolean fingerprintShouldBeRequested() {
-        return (fingerprintIsEnabled() && hasAuthenticationTimeoutExpired());
+    private boolean deviceCredentialsShouldBeRequested() {
+        if ((System.currentTimeMillis() - mTimestamp) > PASS_CODE_TIMEOUT && visibleActivitiesCounter <= 0) {
+            return deviceCredentialsAreEnabled();
+        }
+        return false;
     }
 
     private boolean hasAuthenticationTimeoutExpired() {
@@ -143,7 +135,7 @@ public class PassCodeManager {
                 appPrefs.getBoolean(Preferences.PREFERENCE_USE_FINGERPRINT, false);
     }
 
-    private boolean deviceCredentialsShouldBeRequested() {
+    private boolean deviceCredentialsAreEnabled() {
         SharedPreferences appPrefs = PreferenceManager
                 .getDefaultSharedPreferences(MainApp.getAppContext());
         return (appPrefs.getBoolean(Preferences.PREFERENCE_USE_DEVICE_CREDENTIALS, false));

+ 0 - 341
src/main/java/com/owncloud/android/ui/activity/FingerprintActivity.java

@@ -1,341 +0,0 @@
-/*
- *   Nextcloud Android client application
- *
- *   @author Florian Lentz
- *   Copyright (C) 2017 Florian Lentz
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
- *   License as published by the Free Software Foundation; either
- *   version 3 of the License, or any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU AFFERO GENERAL PUBLIC LICENSE for more details.
- *
- *   You should have received a copy of the GNU Affero General Public
- *   License along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-package com.owncloud.android.ui.activity;
-
-import android.Manifest;
-import android.app.KeyguardManager;
-import android.content.Context;
-import android.content.Intent;
-import android.content.pm.PackageManager;
-import android.content.res.ColorStateList;
-import android.graphics.Color;
-import android.graphics.drawable.ColorDrawable;
-import android.graphics.drawable.Drawable;
-import android.hardware.fingerprint.FingerprintManager;
-import android.os.Build;
-import android.os.Bundle;
-import android.os.CancellationSignal;
-import android.security.keystore.KeyGenParameterSpec;
-import android.security.keystore.KeyPermanentlyInvalidatedException;
-import android.security.keystore.KeyProperties;
-import android.support.annotation.RequiresApi;
-import android.support.v4.app.ActivityCompat;
-import android.support.v4.graphics.drawable.DrawableCompat;
-import android.support.v7.app.AppCompatActivity;
-import android.support.v7.widget.Toolbar;
-import android.view.KeyEvent;
-import android.widget.ImageView;
-import android.widget.TextView;
-import android.widget.Toast;
-
-import com.owncloud.android.MainApp;
-import com.owncloud.android.R;
-import com.owncloud.android.lib.common.utils.Log_OC;
-import com.owncloud.android.utils.ThemeUtils;
-
-import java.io.IOException;
-import java.security.InvalidAlgorithmParameterException;
-import java.security.InvalidKeyException;
-import java.security.KeyStore;
-import java.security.KeyStoreException;
-import java.security.NoSuchAlgorithmException;
-import java.security.NoSuchProviderException;
-import java.security.UnrecoverableKeyException;
-import java.security.cert.CertificateException;
-
-import javax.crypto.Cipher;
-import javax.crypto.KeyGenerator;
-import javax.crypto.NoSuchPaddingException;
-import javax.crypto.SecretKey;
-
-/**
- * Activity to handle access to the app based on the fingerprint.
- */
-@RequiresApi(Build.VERSION_CODES.M)
-public class FingerprintActivity extends AppCompatActivity {
-
-    private static final String TAG = FingerprintActivity.class.getSimpleName();
-
-    public final static String KEY_CHECK_RESULT = "KEY_CHECK_RESULT";
-
-    public static final String ANDROID_KEY_STORE = "AndroidKeyStore";
-
-    private KeyStore keyStore;
-    // Variable used for storing the key in the Android Keystore container
-    private static final String KEY_NAME = "Nextcloud";
-    private Cipher cipher;
-
-    private CancellationSignal cancellationSignal;
-
-    /**
-     * Initializes the activity.
-     *
-     * @param savedInstanceState    Previously saved state - irrelevant in this case
-     */
-    protected void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        setContentView(R.layout.fingerprintlock);
-
-        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
-            getWindow().setStatusBarColor(ThemeUtils.primaryDarkColor(this));
-        }
-
-        Toolbar toolbar = findViewById(R.id.toolbar);
-        toolbar.setTitleTextColor(ThemeUtils.fontColor(this));
-        toolbar.setBackground(new ColorDrawable(ThemeUtils.primaryColor(this, false)));
-    }
-
-    private void startFingerprint() {
-        TextView fingerprintTextView = findViewById(R.id.scanfingerprinttext);
-
-        FingerprintManager fingerprintManager =
-                (FingerprintManager) MainApp.getAppContext().getSystemService(Context.FINGERPRINT_SERVICE);
-
-        if (ActivityCompat.checkSelfPermission(this, Manifest.permission.USE_FINGERPRINT)
-                != PackageManager.PERMISSION_GRANTED) {
-            return;
-        }
-        KeyguardManager keyguardManager = (KeyguardManager) getSystemService(KEYGUARD_SERVICE);
-
-        if (keyguardManager.isKeyguardSecure()) {
-            generateKey();
-
-            if (cipherInit()) {
-                FingerprintManager.CryptoObject cryptoObject = new FingerprintManager.CryptoObject(cipher);
-                FingerprintHandler.Callback callback = new FingerprintHandler.Callback() {
-                    @Override
-                    public void onAuthenticated() {
-                        fingerprintResult(true);
-                    }
-
-                    @Override
-                    public void onFailed(String error) {
-                        Toast.makeText(MainApp.getAppContext(), error, Toast.LENGTH_LONG).show();
-                        ImageView imageView = findViewById(R.id.fingerprinticon);
-                        int[][] states = new int[][]{
-                                new int[]{android.R.attr.state_activated},
-                                new int[]{-android.R.attr.state_activated}
-                        };
-                        int[] colors = new int[]{Color.parseColor("#FF0000"), Color.RED};
-                        ColorStateList csl = new ColorStateList(states, colors);
-                        Drawable drawable = DrawableCompat.wrap(imageView.getDrawable());
-                        DrawableCompat.setTintList(drawable, csl);
-                        imageView.setImageDrawable(drawable);
-                    }
-                };
-
-                FingerprintHandler helper = new FingerprintHandler(fingerprintTextView, callback);
-                cancellationSignal = new CancellationSignal();
-                if (ActivityCompat.checkSelfPermission(MainApp.getAppContext(), Manifest.permission.USE_FINGERPRINT)
-                        != PackageManager.PERMISSION_GRANTED) {
-                    return;
-                }
-                fingerprintManager.authenticate(cryptoObject, cancellationSignal, 0, helper, null);
-            }
-        }
-    }
-
-    @Override
-    public void onResume(){
-        super.onResume();
-        startFingerprint();
-        ImageView imageView = findViewById(R.id.fingerprinticon);
-        imageView.setImageDrawable(ThemeUtils.tintDrawable(R.drawable.ic_fingerprint, ThemeUtils.primaryColor(this)));
-    }
-
-    @Override
-    public void onStop(){
-        super.onStop();
-        if(cancellationSignal != null) {
-            cancellationSignal.cancel();
-        }
-    }
-
-    /**
-     * Overrides click on the BACK arrow to prevent fingerprint from being worked around.
-     *
-     * @param keyCode Key code of the key that triggered the down event.
-     * @param event   Event triggered.
-     * @return 'True' when the key event was processed by this method.
-     */
-    @Override
-    public boolean onKeyDown(int keyCode, KeyEvent event) {
-        return keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0 || super.onKeyDown(keyCode, event);
-    }
-
-    protected void generateKey() {
-        try {
-            keyStore = KeyStore.getInstance(ANDROID_KEY_STORE);
-        } catch (Exception e) {
-            Log_OC.e(TAG, "Error getting KeyStore", e);
-        }
-
-        KeyGenerator keyGenerator;
-        try {
-            keyGenerator = KeyGenerator.getInstance(KeyProperties.KEY_ALGORITHM_AES, ANDROID_KEY_STORE);
-
-            keyStore.load(null);
-            keyGenerator.init(
-                    new KeyGenParameterSpec.Builder(
-                            KEY_NAME, KeyProperties.PURPOSE_ENCRYPT | KeyProperties.PURPOSE_DECRYPT
-                    )
-                            .setBlockModes(KeyProperties.BLOCK_MODE_CBC)
-                            .setUserAuthenticationRequired(true)
-                            .setEncryptionPaddings(KeyProperties.ENCRYPTION_PADDING_PKCS7)
-                            .build());
-            keyGenerator.generateKey();
-        } catch (NoSuchAlgorithmException | InvalidAlgorithmParameterException | CertificateException | IOException |
-                NoSuchProviderException e) {
-            Log_OC.e(TAG, "Exception: " + e.getMessage());
-        }
-    }
-
-    public boolean cipherInit() {
-        try {
-            cipher = Cipher.getInstance(
-                    KeyProperties.KEY_ALGORITHM_AES + "/"
-                            + KeyProperties.BLOCK_MODE_CBC + "/"
-                            + KeyProperties.ENCRYPTION_PADDING_PKCS7);
-        } catch (NoSuchAlgorithmException | NoSuchPaddingException e) {
-            return false;
-        }
-
-        try {
-            keyStore.load(null);
-            SecretKey key = (SecretKey) keyStore.getKey(KEY_NAME, null);
-            cipher.init(Cipher.ENCRYPT_MODE, key);
-            return true;
-        } catch (KeyPermanentlyInvalidatedException e) {
-            return false;
-        } catch (KeyStoreException
-                | CertificateException
-                | UnrecoverableKeyException
-                | IOException
-                | NoSuchAlgorithmException
-                | InvalidKeyException e) {
-            return false;
-        }
-    }
-
-    private void fingerprintResult(boolean fingerOk) {
-        if (fingerOk) {
-            Intent resultIntent = new Intent();
-            resultIntent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
-            resultIntent.putExtra(KEY_CHECK_RESULT, true);
-            setResult(RESULT_OK, resultIntent);
-            finish();
-        } else {
-            showErrorAndRestart(R.string.fingerprint_unknown);
-        }
-    }
-
-    private void showErrorAndRestart(int errorMessage) {
-        CharSequence errorSeq = getString(errorMessage);
-        Toast.makeText(this, errorSeq, Toast.LENGTH_LONG).show();
-    }
-
-    @RequiresApi(api = Build.VERSION_CODES.M)
-    static public boolean isFingerprintCapable(Context context) {
-        try {
-            FingerprintManager fingerprintManager =
-                    (FingerprintManager) context.getSystemService(Context.FINGERPRINT_SERVICE);
-
-            if (ActivityCompat.checkSelfPermission(context, Manifest.permission.USE_FINGERPRINT)
-                    != PackageManager.PERMISSION_GRANTED) {
-                return false;
-            }
-            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
-                return fingerprintManager.isHardwareDetected();
-            }
-        } catch (Exception e) {
-            return false;
-        }
-        return false;
-    }
-
-    static public boolean isFingerprintReady(Context context) {
-        try {
-            FingerprintManager fingerprintManager =
-                    (FingerprintManager) context.getSystemService(Context.FINGERPRINT_SERVICE);
-
-            return ActivityCompat.checkSelfPermission(context, Manifest.permission.USE_FINGERPRINT) ==
-                    PackageManager.PERMISSION_GRANTED && fingerprintManager.isHardwareDetected() &&
-                    fingerprintManager.hasEnrolledFingerprints();
-        } catch (Exception e) {
-            return false;
-        }
-    }
-}
-
-@RequiresApi(api = Build.VERSION_CODES.M)
-class FingerprintHandler extends FingerprintManager.AuthenticationCallback {
-
-    private TextView text;
-    private Callback callback;
-
-    // Constructor
-    FingerprintHandler(TextView mText, Callback mCallback) {
-        text = mText;
-        callback = mCallback;
-    }
-
-    @Override
-    public void onAuthenticationError(int errMsgId, CharSequence errString) {
-        // this.update(String.valueOf(errString), false);
-    }
-
-    @Override
-    public void onAuthenticationHelp(int helpMsgId, CharSequence helpString) {
-        this.update(String.valueOf(helpString), false);
-    }
-
-    @Override
-    public void onAuthenticationFailed() {
-        this.update(MainApp.getAppContext().getString(R.string.fingerprint_unknown), false);
-    }
-
-    @Override
-    public void onAuthenticationSucceeded(FingerprintManager.AuthenticationResult result) {
-        this.update("Fingerprint Authentication succeeded.", true);
-    }
-
-    public void update(final String e, Boolean success) {
-        if(success) {
-            text.postDelayed(new Runnable() {
-                @Override
-                public void run() {
-                    callback.onAuthenticated();
-                }
-            }, 0);
-        } else {
-            text.postDelayed(new Runnable() {
-                @Override
-                public void run() {
-                    callback.onFailed(e);
-                }
-            }, 0);
-        }
-    }
-
-    interface Callback {
-        void onAuthenticated();
-        void onFailed(String error);
-    }
-}

+ 10 - 63
src/main/java/com/owncloud/android/ui/activity/Preferences.java

@@ -87,8 +87,6 @@ public class Preferences extends PreferenceActivity
 
     private static final String TAG = Preferences.class.getSimpleName();
 
-    public final static String PREFERENCE_USE_FINGERPRINT = "use_fingerprint";
-
     public final static String PREFERENCE_USE_DEVICE_CREDENTIALS= "use_device_credentials";
 
     public static final String PREFERENCE_EXPERT_MODE = "expert_mode";
@@ -109,7 +107,6 @@ public class Preferences extends PreferenceActivity
     private Uri mUri;
 
     private SwitchPreference pCode;
-    private SwitchPreference fPrint;
     private SwitchPreference mShowHiddenFiles;
     private SwitchPreference mExpertMode;
     private AppCompatDelegate mDelegate;
@@ -372,6 +369,7 @@ public class Preferences extends PreferenceActivity
         if (pFeedback != null) {
             if (feedbackEnabled) {
                 pFeedback.setOnPreferenceClickListener(new OnPreferenceClickListener() {
+
                     @Override
                     public boolean onPreferenceClick(Preference preference) {
                         String feedbackMail = getString(R.string.mail_feedback);
@@ -507,29 +505,28 @@ public class Preferences extends PreferenceActivity
                 accentColor));
 
         boolean fPassCodeEnabled = getResources().getBoolean(R.bool.passcode_enabled);
-        boolean fPrintEnabled = getResources().getBoolean(R.bool.fingerprint_enabled);
         boolean fDeviceCredentialsEnabled = getResources().getBoolean(R.bool.device_credentials);
         boolean fShowHiddenFilesEnabled = getResources().getBoolean(R.bool.show_hidden_files_enabled);
+        boolean fSyncedFolderLightEnabled = getResources().getBoolean(R.bool.syncedFolder_light);
 
         setupPasscodePreference(preferenceCategoryDetails, fPassCodeEnabled);
 
-        setupFingerprintPreference(preferenceCategoryDetails, fPrintEnabled);
-
         setupDeviceCredentialsPreference(preferenceCategoryDetails, fDeviceCredentialsEnabled);
 
         setupHiddenFilesPreference(preferenceCategoryDetails, fShowHiddenFilesEnabled);
 
-        setupExpertModePreference(preferenceCategoryDetails);
+        setupExpertModePreference(preferenceCategoryDetails, fSyncedFolderLightEnabled);
 
-        if (!fShowHiddenFilesEnabled && !fPrintEnabled && !fPassCodeEnabled) {
+        if (!fPassCodeEnabled && !fDeviceCredentialsEnabled && !fShowHiddenFilesEnabled && fSyncedFolderLightEnabled) {
             preferenceScreen.removePreference(preferenceCategoryDetails);
         }
     }
 
-    private void setupExpertModePreference(PreferenceCategory preferenceCategoryDetails) {
+    private void setupExpertModePreference(PreferenceCategory preferenceCategoryDetails,
+                                           boolean fSyncedFolderLightEnabled) {
         mExpertMode = (SwitchPreference) findPreference(PREFERENCE_EXPERT_MODE);
 
-        if (getResources().getBoolean(R.bool.syncedFolder_light)) {
+        if (fSyncedFolderLightEnabled) {
             preferenceCategoryDetails.removePreference(mExpertMode);
         } else {
             mExpertMode = (SwitchPreference) findPreference(PREFERENCE_EXPERT_MODE);
@@ -577,66 +574,16 @@ public class Preferences extends PreferenceActivity
         }
     }
 
-    private void setupFingerprintPreference(PreferenceCategory preferenceCategoryDetails, boolean fPrintEnabled) {
-        fPrint = (SwitchPreference) findPreference(PREFERENCE_USE_FINGERPRINT);
-        if (fPrint != null) {
-            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
-                if (FingerprintActivity.isFingerprintCapable(MainApp.getAppContext()) && fPrintEnabled) {
-                    final Activity activity = this;
-                    fPrint.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
-                        @Override
-                        public boolean onPreferenceChange(Preference preference, Object newValue) {
-                            Boolean incoming = (Boolean) newValue;
-
-                            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
-                                if (FingerprintActivity.isFingerprintReady(MainApp.getAppContext())) {
-                                    SharedPreferences appPrefs =
-                                            PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
-                                    SharedPreferences.Editor editor = appPrefs.edit();
-                                    editor.putBoolean(PREFERENCE_USE_FINGERPRINT, incoming);
-                                    editor.apply();
-                                    return true;
-                                } else {
-                                    if (incoming) {
-                                        DisplayUtils.showSnackMessage(activity, R.string.prefs_fingerprint_notsetup);
-                                        fPrint.setChecked(false);
-                                    }
-                                    SharedPreferences appPrefs =
-                                            PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
-                                    SharedPreferences.Editor editor = appPrefs.edit();
-                                    editor.putBoolean(PREFERENCE_USE_FINGERPRINT, false);
-                                    editor.apply();
-                                    return false;
-                                }
-                            } else {
-                                return false;
-                            }
-                        }
-                    });
-                    if (!FingerprintActivity.isFingerprintReady(MainApp.getAppContext())) {
-                        fPrint.setChecked(false);
-                    }
-
-                } else {
-                    preferenceCategoryDetails.removePreference(fPrint);
-                }
-            } else {
-                preferenceCategoryDetails.removePreference(fPrint);
-            }
-        }
-    }
-
     private void setupDeviceCredentialsPreference(PreferenceCategory preferenceCategoryDetails,
-                                                  boolean fDeviceCredentialsEnabled) {
+                                                  boolean deviceCredentialsEnabled) {
         SwitchPreference useDeviceCredentials = (SwitchPreference) findPreference(PREFERENCE_USE_DEVICE_CREDENTIALS);
-        if (useDeviceCredentials != null && fDeviceCredentialsEnabled && Build.VERSION.SDK_INT >=
+        if (useDeviceCredentials != null && deviceCredentialsEnabled && Build.VERSION.SDK_INT >=
                 Build.VERSION_CODES.M) {
             if (!DeviceCredentialUtils.areCredentialsAvailable(getApplicationContext())) {
                 DisplayUtils.showSnackMessage(this, R.string.prefs_device_credentials_not_setup);
                 useDeviceCredentials.setChecked(false);
             } else {
-                useDeviceCredentials.setOnPreferenceChangeListener(
-                        new OnPreferenceChangeListener() {
+                useDeviceCredentials.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
                     @Override
                     public boolean onPreferenceChange(Preference preference, Object newValue) {
                         Boolean incoming = (Boolean) newValue;

+ 0 - 65
src/main/res/layout/fingerprintlock.xml

@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-  Nextcloud Android client application
-
-  Copyright (C) 2017 Florian Lentz
-
-  This program is free software; you can redistribute it and/or
-  modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
-  License as published by the Free Software Foundation; either
-  version 3 of the License, or any later version.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-  GNU AFFERO GENERAL PUBLIC LICENSE for more details.
-
-  You should have received a copy of the GNU Affero General Public
-  License along with this program. If not, see <http://www.gnu.org/licenses/>.
--->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-              xmlns:app="http://schemas.android.com/apk/res-auto"
-              android:layout_width="fill_parent"
-              android:layout_height="fill_parent"
-              android:gravity="center_horizontal"
-              android:orientation="vertical">
-
-    <android.support.v7.widget.Toolbar
-        android:id="@+id/toolbar"
-        android:layout_width="match_parent"
-        android:layout_height="?attr/actionBarSize"
-        android:background="?attr/colorPrimary"
-        app:layout_scrollFlags="scroll|enterAlways|snap"
-        app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
-        app:title="@string/app_name"
-        app:titleTextColor="@color/white"/>
-
-    <LinearLayout
-        android:layout_width="fill_parent"
-        android:layout_height="fill_parent"
-        android:gravity="center_horizontal"
-        android:orientation="vertical"
-        android:padding="@dimen/standard_padding">
-
-        <TextView
-            android:id="@+id/scanfingerprinttext"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:gravity="center_horizontal"
-            android:padding="@dimen/standard_half_padding"
-            android:text="@string/fingerprint_scan_finger"
-            android:textColor="@android:color/black"
-            android:textSize="@dimen/scan_fingerprint_text_size"/>
-
-        <ImageView
-            android:id="@+id/fingerprinticon"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:padding="@dimen/standard_padding"
-            android:scaleType="fitCenter"
-            android:src="@drawable/ic_fingerprint"
-            android:tint="@color/primary"
-            android:contentDescription="@string/fingerprint_icon"/>
-
-    </LinearLayout>
-</LinearLayout>

+ 1 - 2
src/main/res/values/setup.xml

@@ -89,9 +89,8 @@
     <bool name="bottom_toolbar_enabled">false</bool>
 
     <!-- Help, imprint and feedback, and other things -->
-    <bool name="fingerprint_enabled">true</bool>
     <bool name="passcode_enabled">true</bool>
-    <bool name="device_credentials">true</bool>
+    <bool name="device_credentials_enabled">true</bool>
     <bool name="show_hidden_files_enabled">true</bool>
     <bool name="davdroid_integration_enabled">true</bool>
     <bool name="help_enabled">true</bool>

+ 0 - 5
src/main/res/values/strings.xml

@@ -40,8 +40,6 @@
     <string name="prefs_category_more">More</string>
     <string name="prefs_manage_accounts">Manage accounts</string>
     <string name="prefs_passcode">Passcode lock</string>
-    <string name="prefs_fingerprint">Fingerprint lock</string>
-    <string name="prefs_fingerprint_notsetup">No fingerprints have been set up.</string>
     <string name="prefs_use_device_credentials">Lock using device credentials</string>
     <string name="prefs_device_credentials_not_setup">No device credentials have been set up.</string>
     <string name="prefs_expert_mode">Expert mode</string>
@@ -619,9 +617,6 @@
 
     <string name="whats_new_skip">Skip</string>
 
-    <string name="fingerprint_scan_finger">Please scan your finger</string>
-    <string name="fingerprint_unknown">Finger not recognized</string>
-
     <!-- User information -->
     <string name="user_info_email">E-mail</string>
     <string name="user_info_phone">Phone number</string>

+ 0 - 3
src/main/res/xml/preferences.xml

@@ -42,9 +42,6 @@
 		<com.owncloud.android.ui.ThemeableSwitchPreference
 			android:title="@string/prefs_passcode"
 			android:key="set_pincode"/>
-		<com.owncloud.android.ui.ThemeableSwitchPreference
-			android:title="@string/prefs_fingerprint"
-			android:key="use_fingerprint"/>
 		<com.owncloud.android.ui.ThemeableSwitchPreference
 			android:title="@string/prefs_use_device_credentials"
 			android:key="use_device_credentials"/>