简体   繁体   English

哪些三星设备不支持Android的原生指纹API?

[英]Which Samsung devices do not support android's native fingerprint API?

I'm assuming that no phones with OS before marshmallow support the fingerprint API. 我假设在marshmallow支持指纹API之前没有带OS的手机。

My questions are: 我的问题是:

(a) Do all/any Samsung phones released with marshmallow support android fingerprint API (a)使用棉花糖发布的所有/任何三星手机都支持android指纹API

(b) Does any Samsung phones whose OS is upgraded to marshmallow support Android fingerprint API? (b)操作系统升级为棉花糖的三星手机是否支持Android指纹API?

I've read these: 我读过这些:

Fingerprint scanner not detected when using Android 6.0 Fingerprint API on Samsung S5 在Samsung S5上使用Android 6.0 Fingerprint API时未检测到指纹扫描程序

Samsung galaxy note 4 fingerprint not found 三星galaxy note 4指纹未找到

Android FingerPrint API isHardwareDetected returns false for Samsung Note 4 对于Samsung Note 4,Android FingerPrint API isHardwareDetected返回false

Devices with fingerprint sensor above 6.0 which are not using Android fingerprint SDK 指纹传感器6.0以上的设备未使用Android指纹SDK

but no definitive answers. 但没有明确的答案。 Also samsung's website mentions that all samsung devices support Pass SDK but doesn't mention android fingerprint API support 三星的网站还提到所有三星设备都支持Pass SDK,但没有提到android指纹API支持

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. Pass是负责三星设备指纹功能的SDK。 What you can do, you can check if device is using Pass SDK or not. 你可以做什么,你可以检查设备是否使用Pass SDK。

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. 将以下权限添加到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. 我希望这将有所帮助。

I can definitely tell you from my own experience that several Samsung phones continue to use Spass library even on Android M and over. 我可以从我自己的经验告诉你,即使在Android M及以上,几款三星手机仍继续使用Spass库。 For example right now I'm testing on Mobile OS: Android 6.0.1 (Galaxy Note 4 Edge). 例如,我现在正在测试移动操作系统:Android 6.0.1(Galaxy Note 4 Edge)。 I've wrote some code that prints output to the logs in this way: 我写了一些代码,以这种方式将输出打印到日志:

   /*
    * 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;
    }

And from the logs in the console I see that although Android Version on the devices is M(6.0.1) - the method 从控制台的日志中我看到,虽然设备上的Android版本是M(6.0.1) - 方法

manager.isHardwareDetected()

returns false and the method goes to Spass lib initialization and it suceeds. 返回false并且该方法进入Spass lib初始化并且它成功。 So the device definitely using Spass library on android M. 因此该设备肯定在Android M上使用Spass库。

From my small investigation a had found the following. 从我的小调查中发现了以下内容。 Pass API will help with Samsung devices, which had fingerprint api before android 6. It is devices of 2014 year with a fingerprint. Pass API将有助于三星设备,它们在Android 6之前有指纹api。它是带有指纹的2014年设备。 The list of devices can be found here. 可以在此处找到设备列表。 https://en.wikipedia.org/wiki/Samsung_Galaxy The main devices: https://en.wikipedia.org/wiki/Samsung_Galaxy主要设备:

  1. Samsung Galaxy s5 (and its modifications mini, plus) 三星Galaxy s5(及其改装mini,plus)
  2. Samsung Galaxy Note 4 (Note 4 edge) 三星Galaxy Note 4(注4边)

They do not support the standard Google FingerPrint Api even after updating android to 6 version. 即使将Android更新为6版本,它们也不支持标准的Google FingerPrint Api。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM