Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

关于OPPO R9指纹 #12

Closed
QuincySx opened this issue May 24, 2017 · 8 comments
Closed

关于OPPO R9指纹 #12

QuincySx opened this issue May 24, 2017 · 8 comments

Comments

@QuincySx
Copy link

FingerprintManagerCompat.class
static {
final int version = Build.VERSION.SDK_INT;
if (version >= 23) {
IMPL = new Api23FingerprintManagerCompatImpl();
} else {
IMPL = new LegacyFingerprintManagerCompatImpl();
}
}

这个类还需要改一改,因为OPPO R9 是Android 5.1,可能需要单独判断一下

@uccmawei
Copy link
Owner

@QuincySx
如果是这样的话,我觉得都没必要判断版本号了,直接调用,拿得到就拿得到,拿不到就是不支持,简单粗暴?
但是这样的话可能会引出魅族的SDK的一个问题,根据魅族官方的说明,他们主类如果能获取到实例,就说明是支持指纹识别的,然后再判断已经录入的指纹个数就可以。
但是,在个别的非魅族的设备系统上,魅族的SDK的主类,也能获取到实例,这样就会误判为设备是支持指纹的,但是没有录入指纹。

@QuincySx
Copy link
Author

我现在是这样做的
static {
final int version = Build.VERSION.SDK_INT;
if (version >= 23 || isAdapter()) {
IMPL = new Api23FingerprintManagerCompatImpl();
} else {
IMPL = new LegacyFingerprintManagerCompatImpl();
}
}

private static boolean isAdapter() {
    String model = Build.MODEL;
    List<String> phoneModels = //单独优化的设备列表 如 “OPPO R9”
    for (String m : phoneModels) {
        if (model.indexOf(m) != -1) {
            return true;
        }
    }
    return false;
}

@uccmawei
Copy link
Owner

根据Build.MODEL来判断的话,纯在一定的稳定性,有些设备不一定能从这里区分出来。
所以我觉得与其判断全部设备,是否直接在魅族的适配入口做些单独适配更好?

@QuincySx
Copy link
Author

在个别的非魅族的设备系统上,能获得实例,获取不了录入指纹个数,其实也就可以是说不支持呗

@uccmawei
Copy link
Owner

但是如果真的是魅族手机没录入指纹,这样就也会被误判为不支持了,所以我觉得需要去问下魅族那边的相关技术人员,或者说直接在魅族的指纹SDK调用部分,识别一下魅族的机型吧。

@uccmawei
Copy link
Owner

因为,“不支持指纹”和“支持指纹但是没录入指纹”这两种状态,是可以用于不同的业务情景的。

@QuincySx
Copy link
Author

在调用魅族指纹SDK前判断一下 品牌 这个靠谱

@uccmawei
Copy link
Owner

好,那就改为不限制版本号,直接调用,去到魅族的就识别下魅族的设备。
我晚点处理这个问题,谢谢了。

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants