生物特征提示类用于实现生物特征识别。
问题是,当屏幕在生物识别后切换时,应用程序会间歇性关闭。
问题是,没有崩溃日志了。
出现此问题时,如何调试它?
大多数情况下,首次安装应用程序时,错误经常发生。
@RequiresApi(Build.VERSION_CODES.P)
class BioMetricAuthentication (val context:Context, val authenticationListener: BioMetric.AuthenticationListener)
: BioMetric.Authentication, BiometricPrompt.AuthenticationCallback(), CancellationSignal.OnCancelListener {
var biometricPrompt:BiometricPrompt? = null
var cancellationSignal:CancellationSignal? = null
init {
biometricPrompt = BiometricPrompt.Builder(context)
.setDescription( context.getString(R.string.biometric_description) )
.setTitle( context.getString(R.string.biometric_title) )
.setSubtitle( context.getString(R.string.biometric_sub_title) )
.setNegativeButton(context.getString(R.string.dialog_button_cancel), context.mainExecutor, DialogInterface.OnClickListener { _, _ ->
authenticationListener.onFailed()
}).build()
}
override fun start() {
try {
// var KeyPairGenerator = createkey(RULE.AUTH_KEY_ALIAS, true)
// var signature = Signature.getInstance("SHA256withECDSA")
// signature.initSign(KeyPairGenerator!!.generateKeyPair().private)
//if (isAvailable() && signature != null) {
if (isAvailable()) {
cancellationSignal = CancellationSignal()
cancellationSignal!!.setOnCancelListener(this)
/*biometricPrompt!!.authenticate(
BiometricPrompt.CryptoObject(signature),
cancellationSignal!!,
context.mainExecutor,
this
)
*/
biometricPrompt!!.authenticate(
cancellationSignal!!,
context.mainExecutor,
this
)
} else {
authenticationListener.onFailed()
}
} catch (e: java.lang.Exception) {
CompassDialog.Build(context)
.message(e.message.toString())
.positiveButton(R.string.dialog_button_confirm) {
// TODO
}.show()
}
}
override fun onAuthenticationError(errorCode: Int, errString: CharSequence?) {
super.onAuthenticationError(errorCode, errString)
authenticationListener.onFailed()
}
override fun onAuthenticationSucceeded(result: BiometricPrompt.AuthenticationResult?) {
super.onAuthenticationSucceeded(result)
authenticationListener.onSuccessed()
}
override fun onAuthenticationFailed() {
super.onAuthenticationFailed()
authenticationListener.onFailed()
}
override fun onCancel() {
authenticationListener.onCancel()
}
override fun stop() {
cancellationSignal?.cancel()
cancellationSignal = null
}
override fun isAvailable(): Boolean {
var pm = context.packageManager
var fingerprintManager = context.getSystemService(FINGERPRINT_SERVICE) as FingerprintManager
val keyguardManager = context.getSystemService(KEYGUARD_SERVICE) as KeyguardManager
if( !pm.hasSystemFeature(PackageManager.FEATURE_FINGERPRINT)
&& !pm.hasSystemFeature(PackageManager.FEATURE_IRIS)
&& !pm.hasSystemFeature(PackageManager.FEATURE_FACE)) {
return false
}
if (!fingerprintManager.isHardwareDetected())
{
// Device doesn't support fingerprint authentication
return false;
}
if (ActivityCompat.checkSelfPermission(context, Manifest.permission.USE_FINGERPRINT) != PackageManager.PERMISSION_GRANTED)
{
return false;
}
if (!keyguardManager.isKeyguardSecure())
{
return false;
}
if (!fingerprintManager.hasEnrolledFingerprints())
{
return false;
}
return true
}
}
...
2021-07-26 12:05:49.890 1139-2071/? i/activitytaskmanager:从堆栈调用方=com.android.server.wm.activityrecord.destrocted:3508 com.android.server.wm.activityrecord.被毁:wm.activitytaskmanagerservice.ActivityDistrocted:2610 android.app.iactivitytaskmanager$stub.ontransact:2210android.os.binder.exectransact内部:1195 android.os.binder.exectransact:1159
2021-07-26 12:05:49.890 1035-1035/? i/layer:id=2448[1]销毁2044d7f com.example.biotest/com.example.biotest.view.duplicateactivity#0
2021-07-26 12:05:49.890 1035-1035/? i/layer:id=2449[1]com.example.biotest/com.example.biotest.view.duplicateactivity$_29617#0
2021-07-26 12:05:49.890 1139-2071/? d/surfacecontrol:release:surface(name=activityrecord{9ebc42c-u0-com.example.biotest/.view.duplicate-activity-t160})/@0x56a048a
2021-07-26 12:05:49.890 1139-2071/? i/surfacecontrol:nativerelease nativeobject s[-5476376661136455072]
2021-07-26 12:05:49.890 1139-2071/? i/surfacecontrol:nativerelease nativeobject e[-5476376661136455072]
2021-07-26 12:05:49.890 1139-2071/? d/surfacecontrol:release:surface(name=task=160)/@0x60a0815
2021-07-26 12:05:49.890 1139-2071/? i/surfacecontrol:nativerelease nativeobject s[-5476376661136978496]
2021-07-26 12:05:49.890 1139-2071/? i/surfacecontrol:nativerelease nativeobject e[-5476376661136978496]
2021-07-26 12:05:49.891 1035-1083/? i/层:id=2373从当前状态移除任务=160#0(70)
2021-07-26 12:05:49.892 1035-1083/? i/layer:id=2437从CurrentState activityrecord{9ebc42c u0 com.example.biotest/.view.duplicateactivity t160}#0(70)
2021-07-26 12:05:49.892 1035-1083/? i/layer:id=2437从CurrentState activityrecord{9ebc42c u0 com.example.biotest/.view.duplicateactivity t160}#0(70)
2021-07-26 12:05:49.892 25019-25019/? i/bss_系统管理员:handlemessage=9,2160
2021-07-26 12:05:49.892 25019-25019/? i/bss_系统管理员:handlemessage=9,2160
2021-07-26 12:05:49.892 1035-1083/? i/surfaceflinger:id=2373已删除任务=160#0(70)
2021-07-26 12:05:49.893 1035-1083/? i/surfaceflinger:id=2437删除的活动记录{9ebc42c u0 com.example.biotest/.view.duplicate活动t160}#0(70)
2021-07-26 12:05:49.893 1139-1464/? d/surfacecontrol:hide:surface(name=input consumer recents\u animation\u input\u consumer)/@0xd7ddcde
2021-07-26 12:05:49.893 1139-1464/? d/surfacecontrol:nativesetflags done:surface(name=input consumer recents\u animation\u input\u consumer)/@0xd7ddcde
2021-07-26 12:05:49.896 1139-1506/? d/sensormanager:type_灯(5):237.000000
2021-07-26 12:05:49.907 1139-2203/? i/pageboost:启动程序向上翻页
2021-07-26 12:05:49.907 1035-1035/? i/层:id=2373[1]已销毁任务=160#0
2021-07-26 12:05:49.907 1035-1035/? i/layer:id=2437[1]销毁的活动记录{9ebc42c u0 com.example.biotest/.view.duplicate活动t160}0
2021-07-26 12:05:49.909 1139-2203/? i/pageboost:io预取用于:com.hyundaipay.blocktour
2021-07-26 12:05:49.909 1139-2203/? i/pageboost:io预取用于:kr.co.busanbank.digitalvoucher
2021-07-26 12:05:49.909 1139-2203/? i/pageboost:io预取用于:com.kt.ktplaymobileapp
2021-07-26 12:05:49.910 3340-31307/? e/pageboostd:预回迁开始:应用程序Krcobusanbank数字凭证
2021-07-26 12:05:49.911 676-676/? i/io_统计数据:!@8,0 r 133318 7581180 w 45847 1950380 d 30056 1756596 f 26323 33617物联网57208 52674 th 102400 0 pt 0 inp 0 2266.798
2021-07-26 12:05:49.915 3340-3340/? e/pageboostd:收到回收命令代码3,0mb
2021-07-26 12:05:49.923 820-820/? e/audit:type=1400 audit(1627268749.918:3347):avc:denied{search}for pid=3340 comm=“pageboostd”name=“com.google.android.gms”dev=“sda37”ino=5971 scontext=u:r:pageboostd:s0 tcontext=u:object\r:privapp\u数据文件:s0:c512,c768 tclass=dir permissive=0 sepf sm-g988n\u11\u0007 audit
2021-07-26 12:05:49.923 820-820/? e/audit:type=1300 audit(1627268749.918:3347):arch=c00000b7 syscall=56 success=no exit=-13 a0=ffffff 9c a1=b4000074663a50 a2=0 a3=0 items=0 ppid=1 pid=3340 auid=4294967295 uid=1000 gid=1000 suid=1000 fsuid=1000 egid=1000 sgid=1000 fsgid=1000 tty=(none)ses=4294967295 comm=“pageboostd/system/bin/pagestd”subj=u:boor:std键=(空)
2021-07-26 12:05:49.923 820-820/? e/audit:type=1327 audit(1627268749.918:3347):proctitle=“/system/bin/pageboostd”
2021-07-26 12:05:49.925 3340-31307/? e/pageboostd:Krcobusanbank数字凭证,金额52797440 scnt 41 fcnt 18
2021-07-26 12:05:49.925 3340-31307/? e/pageboostd:预取结束:应用程序Krcobusanbank数字凭证数据\u金额52797440
2021-07-26 12:05:49.925 3340-31306/? e/pageboostd:预回迁开始:应用程序comhyundaipayblocktour
2021-07-26 12:05:49.926 820-820/? e/audit:type=1400 audit(1627268749.922:3348):avc:denied{search}for pid=3340 comm=“pageboostd”name=“com.google.android.gms”dev=“sda37”ino=2385 scontext=u:r:pageboostd:s0 tcontext=u:object\r:privapp\u数据文件:s0:c512,c768 tclass=dir permissive=0 sepf sm-g988n\u11\u0007 audit
2021-07-26 12:05:49.928 3340-31306/? e/pageboostd:comhyundaipayblocktour,美国东部43257856新元4新元12新元
2021-07-26 12:05:49.928 3340-31306/? e/pageboostd:预回迁结束:应用程序comhyundaipayblocktour数据\u金额43257856
2021-07-26 12:05:49.928 3340-31308/? e/pageboostd:预回迁开始:应用程序ComktPlayMobileApp
2021-07-26 12:05:49.932 3340-31308/? e/pageboostd:ComktPlayMobileApp,amt 60510208 scnt 22 fcnt 23
2021-07-26 12:05:49.932 3340-31308/? e/pageboostd:预取结束:应用程序COMKTPLAYMOBILEAP数据量60510208
2021-07-26 12:05:49.980 1139-2120/? d/mdniescenariocontrolservice:packagename:com.sec.android.app.launcher类名:com.android.launcher3.uioverrides.quicksteplauncher
2021-07-26 12:05:49.980 1139-2120/? v/mdniescenariocontrolservice:ui函数的setuimode(3)
2021-07-26 12:05:50.086 1259-31288/? i/bauth_tlc_通讯器:检查trustlet返回代码是否完成
2021-07-26 12:05:50.086 1259-31288/? i/bauth_fpbauthservice:fpbauthservice,6318
2021-07-26 12:05:50.086 1259-31288/? i/bauth\u fpbauthservice:检查操作码状态=2,操作码=0,函数返回值=0,函数状态=2,超时=0
2021-07-26 12:05:50.086 1259-31288/? i/bauth_fpbauthservice:fpbauthservice,6393
2021-07-26 12:05:50.086 1259-31288/? i/bauth_FPBauth服务:fpop:100023
2021-07-26 12:05:50.086 1259-31288/? i/bauth_tlc_通讯器:调用fp cmd 0xc(76)
2021-07-26 12:05:50.087 1139-1883/? i/指纹服务:手工要求:acquiredinfo=6,供应商=10004
2021-07-26 12:05:50.087 1259-31288/? i/bauth_tlc_通信器:检查输入数据参数buf addr=0x0,长度=0
2021-07-26 12:05:50.088 1259-1997/? i/bauth_fpbauthservice:pcf:0x1012,2,1,0,0,0,5.1.0.1
2021-07-26 12:05:50.088 1259-1997/? i/bauth_fpbauthservice:线程id:1,preenroll_标志:0,nd cnt:0,cso:0,et:0
2021-07-26 12:05:50.088 1259-1997/? i/bauth_fpbauthservice:fpbauthservice,11519
2021-07-26 12:05:50.094 1259-31288/? i/bauth_tlc_通讯器:检查trustlet返回代码是否完成
2021-07-26 12:05:50.094 1259-31288/? i/bauth_fpbauthservice:adlg:[s]163207-26-12-05-50-086
(一)
2021-07-26 12:05:50.094 1259-31288/? i/bauth_fpbauthservice:adlg:[000]28 05 49 00 ed 69 d0 30
2021-07-26 12:05:50.094 1259-31288/? i/bauth_fpbauthservice:adlg:[001]1d 3d 10 07 00 10 17
2021-07-26 12:05:50.094 1259-31288/? i/bauth_fpbauthservice:adlg:[002]59 59 41 00 1d 23 26 1c
2021-07-26 12:05:50.094 1259-31288/? i/bauth_fpbauth服务:adlg:[003]13 1a 16 20 11 0c 0d 00
2021-07-26 12:05:50.094 1259-31288/? i/bauth_FPBauth服务:adlg:[004]00 96 00 74
2021-07-26 12:05:50.094 1259-31288/? i/bauth_fpbauth服务:adlg:[005]84 00 00
2021-07-26 12:05:50.094 1259-31288/? i/bauth_fpbauth服务:adlg:[006]00 01 20 00 00
2021-07-26 12:05:50.094 1259-31288/? i/bauth_fpbauth服务:adlg:[007]01 00 00
2021-07-26 12:05:50.094 1259-31288/? i/bauth_fpbauth服务:adlg:[008]00
2021-07-26 12:05:50.094 1259-31288/? i/bauth_fpbauthservice:adlg:[009]00 28 07 45 00 ef 69 d0
2021-07-26 12:05:50.094 1259-31288/? i/bauth_fpbauthservice:adlg:[010]3027330070001
2021-07-26 12:05:50.094 1259-31288/? i/bauth_fpbauthservice:adlg:[011]00 01 00 71 01 90 0e fc
2021-07-26 12:05:50.094 1259-31288/? i/bauth_fpbauthservice:adlg:[012]08 00 04 4e 0e
2021-07-26 12:05:50.094 1259-31288/? i/bauth_fpbauthservice:adlg:[013]4c 01 00
2021-07-26 12:05:50.094 1259-31288/? i/bauth_fpbauth服务:adlg:[014]00
2021-07-26 12:05:50.094 1259-31288/? i/bauth_fpbauth服务:adlg:[015]00
2021-07-26 12:05:50.094 1259-31288/? i/bauth_fpbauth服务:adlg:[016]00
2021-07-26 12:05:50.094 1259-31288/? i/bauth_fpbauthservice:adlg:[017]002804
2021-07-26 12:05:50.094 1259-31288/? i/bauth_fpbauthservice:adlg:[018]1c 00 ef 69 d0 30 27 32
2021-07-26 12:05:50.094 1259-31288/? i/bauth_fpbauthservice:adlg:[019]00 07 00 01 11 01
2021-07-26 12:05:50.094 1259-31288/? i/bauth_FPBauth服务:adlg:[020]00
2021-07-26 12:05:50.094 1259-31288/? i/bauth_fpbauthservice:adlg:[021]00 00 28 0b 18 00 ef 69
2021-07-26 12:05:50.094 1259-31288/? i/bauth_fpbauthservice:adlg:[022]d0 30 27 32 00 07 00
2021-07-26 12:05:50.094 1259-31288/? i/bauth_fpbauthservice:adlg:[023]2743 b1 f0 11 00
2021-07-26 12:05:50.094 1259-31288/? i/bauth_fpbauthservice:adlg:[024]9c 00 28 08 35 00 f1 69
2021-07-26 12:05:50.094 1
暂无答案!
目前还没有任何答案,快来回答吧!