繁体   English   中英

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

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

我假设在marshmallow支持指纹API之前没有带OS的手机。

我的问题是:

(a)使用棉花糖发布的所有/任何三星手机都支持android指纹API

(b)操作系统升级为棉花糖的三星手机是否支持Android指纹API?

我读过这些:

在Samsung S5上使用Android 6.0 Fingerprint API时未检测到指纹扫描程序

三星galaxy note 4指纹未找到

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

指纹传感器6.0以上的设备未使用Android指纹SDK

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

在我的回答下面的评论更清楚地了解要求后,这里是更新的答案

Pass是负责三星设备指纹功能的SDK。 你可以做什么,你可以检查设备是否使用Pass SDK。

以下是检查它的代码:

    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 
            }
        }
    }

将以下权限添加到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" />

我希望这将有所帮助。

我可以从我自己的经验告诉你,即使在Android M及以上,几款三星手机仍继续使用Spass库。 例如,我现在正在测试移动操作系统: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并且该方法进入Spass lib初始化并且它成功。 因此该设备肯定在Android M上使用Spass库。

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

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

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

暂无
暂无

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

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