12

我假设在棉花糖之前没有操作系统的手机支持指纹 API。

我的问题是:

(a) 是否所有/任何带有棉花糖的三星手机都支持安卓指纹 API

(b) 升级到marshmallow 的三星手机是否支持Android 指纹API?

我读过这些:

在三星 S5 上使用 Android 6.0 指纹 API 时未检测到指纹扫描仪

找不到三星 Galaxy Note 4 指纹

Android FingerPrint API isHardwareDetected 为三星 Note 4 返回 false

指纹传感器高于 6.0 且未使用 Android 指纹 SDK 的设备

但没有明确的答案。三星的网站也提到所有三星设备都支持 Pass SDK,但没有提到 android 指纹 API 支持

4

3 回答 3

3

从我的小调查中发现了以下内容。Pass API 将有助于三星设备,在 android 6 之前有指纹 api。它是 2014 年有指纹的设备。可以在此处找到设备列表。 https://en.wikipedia.org/wiki/Samsung_Galaxy 主要设备:

  1. 三星 Galaxy s5(及其修改 mini,加号)
  2. 三星 Galaxy Note 4 (Note 4 edge)

即使将 android 更新到 6 版本,它们也不支持标准的 Google FingerPrint Api。

于 2018-10-09T09:31:53.183 回答
2

After understanding more clearly requirement from comment below my answer, here is updated answer

Pass is the SDK responsible for Fingerprint feature for Samsung devices. What you can do, you can check if device is using Pass SDK or not.

Below is code to check it:

    FingerprintManager fingerprintManager = (FingerprintManager) getApplicationContext().getSystemService(Context.FINGERPRINT_SERVICE);
    boolean isFingerprintSupported = fingerprintManager != null && fingerprintManager.isHardwareDetected();

    if (!isFingerprintSupported && SsdkVendorCheck.isSamsungDevice()) { // for samsung devices which doesn't support Native Android Fingerprint API
        Spass spass = new Spass();
        try {
            spass.initialize(context);
            isFingerprintSupported = spass.isFeatureEnabled(Spass.DEVICE_FINGERPRINT);
        } catch (SsdkUnsupportedException | UnsupportedOperationException e) {
            //Error handling here
        }
    } else {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { // for devices which doesn't support Pass SDK

            FingerprintManager fingerprintManager = (FingerprintManager) getApplicationContext().getSystemService(Context.FINGERPRINT_SERVICE);
            if (!fingerprintManager.isHardwareDetected()) {
                // This device is not supporting fingerprint authentication     
            } else if (!fingerprintManager.hasEnrolledFingerprints()) {
                // User hasn't enrolled any fingerprints to authenticate with 
            } else {
                // Everything is ready for fingerprint authentication 
            }
        }
    }

Add below permissions to AndroidManifest.xml.

<uses-permission android:name="android.permission.USE_FINGERPRINT" />
<uses-permission android:name="com.samsung.android.providers.context.permission.WRITE_USE_APP_FEATURE_SURVEY" />

I hope this will help.

于 2018-06-27T00:50:46.760 回答
1

根据我自己的经验,我可以肯定地告诉你,即使在 Android M 及以上版本上,几款三星手机也会继续使用 Spas 库。例如,现在我正在移动操作系统上进行测试:Android 6.0.1 (Galaxy Note 4 Edge)。我编写了一些代码,以这种方式将输出打印到日志:

   /*
    * This function evaluates which fingerprint helper should be instantiated (if any)
    */
    public static FingerprintHelper initializeFingerprintHelper(Context context){
        if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
            FingerprintManager manager = (FingerprintManager) context.getSystemService(Context.FINGERPRINT_SERVICE);

            if (manager != null) {
                logger.info("Android native fingerprint manager exists");
                if (manager.isHardwareDetected()) {
                    logger.info("Android native fingerprint manager detected hardware");
                    if (manager.hasEnrolledFingerprints()) {
                        logger.info("Android native fingerprint manager has enrolled fingerprints");
                    }else{
                        logger.info("Android native fingerprint manager has no enrolled fingerprints");
                    }
                    return new AndroidFingerprintHelper(context);
                }

            }
        }
        try{
            logger.info("Android native fingerprint manager is null, trying Samsung SPASS rollback");

            Spass spass = new Spass();
            spass.initialize(context);
            if(spass.isFeatureEnabled(Spass.DEVICE_FINGERPRINT)){
                return new SamsungFingerprintHelper(context);
            }
        } catch (SsdkUnsupportedException e) {
            logger.error("Spass library is missing on the device");
        }
        return null;
    }

从控制台中的日志我看到,虽然设备上的 Android 版本是 M(6.0.1) - 方法

manager.isHardwareDetected()

返回 false 并且该方法转到 Spas lib 初始化并且它成功。所以该设备肯定在 android M 上使用了 Spas 库。

于 2018-07-04T07:49:26.647 回答