游戏电视苹果数码历史美丽
投稿投诉
美丽时装
彩妆资讯
历史明星
乐活安卓
数码常识
驾车健康
苹果问答
网络发型
电视车载
室内电影
游戏科学
音乐整形

OpenHarmony上设置人脸认证

  本文主要简析OpenHarmony的用户鉴权管理。
  用户凭证管理
  pinauth(口令认证):模块支持用户口令的设置,删除和认证功能。
  与用户IAM子系统基础框架配合,也可以支持用户口令修改的功能;口令认证作为OpenHarmony最基础的用户身份认证执行器,按照协同认证定义的资源注册接口,将口令认证相关资源信息注册到协同认证框架,并根据协同认证框架的调度,完成口令的设置,删除和认证功能。
  faceauth(人脸认证):支持用户人脸的录入,删除和认证功能;人脸认证是OpenHarmony支持的一种生物认证执行器,按照协同认证定义的资源注册接口,将人脸认证相关资源信息注册到协同认证框架,并根据协同认证框架的调度,调用人脸认证HDI,完成人脸的录入,认证,删除等功能。
  userauthframework:主要包括三个模块,用户认证、凭据管理和执行器管理。
  用户认证模块对外提供统一用户身份认证功能,并且开放生物特征认证API给三方应用调用。
  凭据管理模块提供系统内统一的用户凭据管理(增删改查)接口,向下通过执行器管理模块,调用系统内的执行器资源,完成用户凭据的生命周期管理和安全存储。
  执行器管理模块提供系统内执行器资源的统一管理和协同调度能力,当前支持口令执行器和人脸执行器的管理。
  使用
  接口:importosAccountfromohos。account。osAccount
  凭证管理:UserIdentityManagerProvidestheabilitiesformanaginguseridentity。nameUserIdentityManagersyscapSystemCapability。Account。OsAccountsince8classUserIdentityManager{ConstructortogettheUserIdentityManagerclassinstance。returnsReturnstheUserIdentityManagerclassinstance。systemapiHidethisforinnersystemuse。since8constructor();Openssession。pStartanIDMoperationtoobtainchallengevalue。Achallengevalueof0indicatesthatopensessionfailed。permissionohos。permission。MANAGEUSERIDMreturnsReturnsachallengevalue。throws{BusinessError}201permissiondenied。throws{BusinessError}401theparametercheckfailed。throws{BusinessError}12300001systemserviceexception。systemapiHidethisforinnersystemuse。since8openSession(callback:AsyncCallbackUint8Array):void;openSession():PromiseUint8Array;Addscredential。pAddusercredentialinformation,passincredentialadditionmethodandcredentialinformation(credentialtype,subclass,ifaddingusersnonpasswordcredentials,passinpasswordauthenticationtoken),andgettheresultacquireinfocallback。permissionohos。permission。MANAGEUSERIDMparamcredentialInfoIndicatesthecredentialinformation。paramcallbackIndicatesthecallbacktogetresultsandacquireInfo。throws{BusinessError}201permissiondenied。throws{BusinessError}401theparametercheckfailed。throws{BusinessError}12300001systemserviceexception。throws{BusinessError}12300002invalidcredentialInfo。systemapiHidethisforinnersystemuse。since8addCredential(credentialInfo:CredentialInfo,callback:IIdmCallback):void;Updatescredential。permissionohos。permission。MANAGEUSERIDMparamcredentialInfoIndicatesthecredentialinformation。paramcallbackIndicatesthecallbacktogetresultsandacquireInfo。throws{BusinessError}201permissiondenied。throws{BusinessError}401theparametercheckfailed。throws{BusinessError}12300001systemserviceexception。throws{BusinessError}12300002invalidcredentialInfo。systemapiHidethisforinnersystemuse。since8updateCredential(credentialInfo:CredentialInfo,callback:IIdmCallback):void;Closessession。pEndanIDMoperation。permissionohos。permission。MANAGEUSERIDMsystemapiHidethisforinnersystemuse。since8closeSession():void;Cancelsentrywithachallengevalue。permissionohos。permission。MANAGEUSERIDMparamchallengeIndicatesthechallengevalue。throws{BusinessError}201permissiondenied。throws{BusinessError}401theparametercheckfailed。throws{BusinessError}12300001systemserviceexception。throws{BusinessError}12300002invalidchallenge。systemapiHidethisforinnersystemuse。since8cancel(challenge:Uint8Array):void;Deletestheuserwiththeauthenticationtoken。permissionohos。permission。MANAGEUSERIDMparamtokenIndicatestheauthenticationtoken。paramcallbackIndicatesthecallbacktogetthedeletionresult。throws{BusinessError}201permissiondenied。throws{BusinessError}401theparametercheckfailed。throws{BusinessError}12300001systemserviceexception。throws{BusinessError}12300002invalidtoken。systemapiHidethisforinnersystemuse。since8delUser(token:Uint8Array,callback:IIdmCallback):void;Deletestheusercredentialinformation。permissionohos。permission。MANAGEUSERIDMparamcredentialIdIndicatesthecredentialindex。paramtokenIndicatestheauthenticationtoken。paramcallbackIndicatesthecallbacktogetthedeletionresult。throws{BusinessError}201permissiondenied。throws{BusinessError}401theparametercheckfailed。throws{BusinessError}12300001systemserviceexception。throws{BusinessError}12300002invalidcredentialIdortoken。systemapiHidethisforinnersystemuse。since8delCred(credentialId:Uint8Array,token:Uint8Array,callback:IIdmCallback):void;Getsauthenticationinformation。permissionohos。permission。USEUSERIDMparamauthTypeIndicatestheauthenticationtype。paramcallbackIndicatesthecallbacktogetallregisteredcredentialinformationofthespecifiedtypeforthecurrentuser。throws{BusinessError}201permissiondenied。throws{BusinessError}401theparametercheckfailed。throws{BusinessError}12300001systemserviceexception。throws{BusinessError}12300002invalidauthType。throws{BusinessError}12300015theauthTypeisnotsupportedoncurrentdevice。throws{BusinessError}12300016authenticationtimeout。throws{BusinessError}12300017authenticationserviceisbusy。throws{BusinessError}12300018authenticationserviceislocked。throws{BusinessError}12300019thecredentialdoesnotexist。systemapiHidethisforinnersystemuse。since8getAuthInfo(callback:AsyncCallback):void;getAuthInfo(authType:AuthType,callback:AsyncCallback):void;getAuthInfo(authType?:AuthType):Promise;}
  口令管理:ProvidestheabilitiesforPincodeauthentication。namePINAuthsyscapSystemCapability。Account。OsAccountsince8classPINAuth{ConstructortogetthePINAuthclassinstance。returnsReturnsthePINAuthclassinstance。systemapiHidethisforinnersystemuse。since8constructor();Registerinputer。permissionohos。permission。ACCESSPINAUTHparaminputerIndicatesthepasswordinputboxcallbackthrows{BusinessError}201permissiondenied。throws{BusinessError}401theparametercheckfailed。throws{BusinessError}12300001systemserviceexception。throws{BusinessError}12300007PINinputerhasbeenregistered。systemapiHidethisforinnersystemuse。since8registerInputer(inputer:IInputer):void;Unregisterinputer。permissionohos。permission。ACCESSPINAUTHsystemapiHidethisforinnersystemuse。since8unregisterInputer():void;
  回调:IInputData,Inputer回调时带的参数,用来输入口令。Passworddatacallback。nameIInputDatasyscapSystemCapability。Account。OsAccountsystemapiHidethisforinnersystemuse。since8interfaceIInputData{Notifiestosetdata。parampinSubTypeIndicatesthecredentialsubtypeforauthentication。paramdataIndicatesthedatatoset。throws{BusinessError}401theparametercheckfailed。throws{BusinessError}12300002invalidpinSubType。systemapiHidethisforinnersystemuse。since8onSetData:(pinSubType:AuthSubType,data:Uint8Array)void;}
  回调:IInputer,regitsterInputer是传入的回调,在需要输口令时被调用。Passwordinputboxcallback。nameIInputersyscapSystemCapability。Account。OsAccountsystemapiHidethisforinnersystemuse。since8interfaceIInputer{Notifiestogetdata。parampinSubTypeIndicatesthecredentialsubtypeforauthentication。paramcallbackIndicatesthepassworddatacallback。systemapiHidethisforinnersystemuse。since8onGetData:(pinSubType:AuthSubType,callback:IInputData)void;}
  回调:IUserAuthCallback,auth,authUser的回调,用来接收auth的结果。Userauthenticationcallback。nameIUserAuthCallbacksyscapSystemCapability。Account。OsAccountsystemapiHidethisforinnersystemuse。since8interfaceIUserAuthCallback{Theauthenticationresultcodeisreturnedthroughthecallback。paramresultIndicatestheauthenticationresultcode。paramextraInfoIndicatesthespecificinformationfordifferentsituation。Iftheauthenticationispassed,theauthenticationtokenisreturnedinextrainfo,Iftheauthenticationfails,theremainingauthenticationtimesarereturnedinextrainfo,Iftheauthenticationexecutorislocked,thefreezingtimeisreturnedinextrainfo。systemapiHidethisforinnersystemuse。since8onResult:(result:number,extraInfo:AuthResult)void;Duringanauthentication,theTipsCodeisreturnedthroughthecallback。parammoduleIndicatestheexecutortypeforauthentication。paramacquireIndicatesthetipcodefordifferentauthenticationexecutor。paramextraInforeservedparameter。systemapiHidethisforinnersystemuse。since8onAcquireInfo?:(module:number,acquire:number,extraInfo:any)void;}
  回调:IIdmCallback,addCredential,updateCredential,delUser,delCred的回调,用来收听onResult是否成功。Identitymanagercallback。nameIIdmCallbacksyscapSystemCapability。Account。OsAccountsystemapiHidethisforinnersystemuse。since8interfaceIIdmCallback{Theauthenticationresultcodeisreturnedthroughthecallback。paramresultIndicatestheauthenticationresultcode。paramextraInfopassthespecificinformationfordifferentsituation。systemapiHidethisforinnersystemuse。since8onResult:(result:number,extraInfo:RequestResult)void;Duringanauthentication,theTipsCodeisreturnedthroughthecallback。parammoduleIndicatestheexecutortypeforauthentication。paramacquireIndicatesthetipcodefordifferentauthenticationexecutor。paramextraInforeservedparameter。systemapiHidethisforinnersystemuse。since8onAcquireInfo?:(module:number,acquire:number,extraInfo:any)void;}
  流程
  如下图:
  构建对象三个对象this。userIdentityManagernewosAccount。UserIdentityManager();this。pinAuthnewosAccount。PINAuth();this。userAuthnewosAccount。UserAuth();
  opensessionOpenSessionAchallengevalueof0indicatesthatopensessionfailedreturnschallengevalueopenSession(callback:(challenge:string)void):void{LogUtil。debug({this。TAG}openSessionin。);try{this。userIdentityManager。openSession()。then((data){callback(this。u8AToStr(data));LogUtil。info({this。TAG}openSessionsuccess);})。catch((err){LogUtil。error({this。TAG}openSessionfailedJSON。stringify(err));})}catch{LogUtil。error({this。TAG}openSessionfailed);callback(0);}LogUtil。debug({this。TAG}openSessionout。);}
  注册inputerRegisterInputerregisterInputer():boolean{LogUtil。debug({this。TAG}registerInputerin。);letresultfalse;try{resultthis。pinAuth。registerInputer({onGetData:(authSubType,inputData){letu8aPwdthis。encodeToU8A(this。password);LogUtil。info({this。TAG}beforesetdata,type:{this。pinSubType}。);inputData。onSetData(this。pinSubType,u8aPwd);}});if(!result){this。unregisterInputer();resultthis。pinAuth。registerInputer({onGetData:(authSubType,inputData){letu8aPwdthis。encodeToU8A(this。password);inputData。onSetData(this。pinSubType,u8aPwd);}});}}catch{LogUtil。error({this。TAG}registerInputerfailed);}LogUtil。info({this。TAG}registerInputerout。);returnresult;}
  createPasswordGetAuthInfoparamauthTypeCredentialtype。returnsReturnsallregisteredcredentialinformationofthistypeforthecurrentusergetPinAuthInfo(callback:(data:Array{authType:number;authSubType:number;})void):void{LogUtil。debug({this。TAG}getPinAuthInfoin。);try{this。userIdentityManager。getAuthInfo(AuthType。PIN)。then((data){LogUtil。info({this。TAG}getpinauthinfodata。);letarrCredInfo〔〕;try{for(leti0;idata。length;i){letcredInfo{authType:data〔i〕。authType,authSubType:data〔i〕。authSubType};if(credInfo。authTypeAuthType。PIN){this。pinSubTypecredInfo。authSubType;}arrCredInfo。push(credInfo);}}catch(e){LogUtil。info(faceDemopin。getAuthInfoerrore);}callback(arrCredInfo);LogUtil。info({this。TAG}getAuthInfosuccess。);})。catch((err){LogUtil。error({this。TAG}getAuthInfofailed。JSON。stringify(err));})}catch(e){LogUtil。error({this。TAG}getPinAuthInfofailed:e);}LogUtil。debug({this。TAG}getPinAuthInfoout。);}
  getAuthInfoGetAuthInfoparamauthTypeCredentialtype。returnsReturnsallregisteredcredentialinformationofthistypeforthecurrentusergetPinAuthInfo(callback:(data:Array{authType:number;authSubType:number;})void):void{LogUtil。debug({this。TAG}getPinAuthInfoin。);try{this。userIdentityManager。getAuthInfo(AuthType。PIN)。then((data){LogUtil。info({this。TAG}getpinauthinfodata。);letarrCredInfo〔〕;try{for(leti0;idata。length;i){letcredInfo{authType:data〔i〕。authType,authSubType:data〔i〕。authSubType};if(credInfo。authTypeAuthType。PIN){this。pinSubTypecredInfo。authSubType;}arrCredInfo。push(credInfo);}}catch(e){LogUtil。info(faceDemopin。getAuthInfoerrore);}callback(arrCredInfo);LogUtil。info({this。TAG}getAuthInfosuccess。);})。catch((err){LogUtil。error({this。TAG}getAuthInfofailed。JSON。stringify(err));})}catch(e){LogUtil。error({this。TAG}getPinAuthInfofailed:e);}LogUtil。debug({this。TAG}getPinAuthInfoout。);}
  autPinAuthparamchallengepassinchallengevalue。challenge是从openSession的回调得到parampasswordpasswordparamonResultReturnresultsthroughcallback。authPin(challenge:string,password:string,onResult:(result:number,extraInfo:{token?:string;remainTimes?:number;freezingTime?:number;})void):void{LogUtil。debug({this。TAG}authPinin。);this。passwordpassword;try{LogUtil。info({this。TAG}beforeuserAuthauthpin);this。userAuth。auth(this。strToU8A(challenge),AuthType。PIN,AuthTrustLevel。ATL4,{onResult:(result,extraInfo){try{if(resultResultCode。SUCCESS){LogUtil。debug({this。TAG}userAuth。authonResult:resultsuccess);}else{LogUtil。debug({this。TAG}userAuth。authfailedonResult:result{result});}letinfo{token:this。u8AToStr(extraInfo?。token),remainTimes:extraInfo。remainTimes,freezingTime:extraInfo。freezingTime}onResult(result,info)}catch(e){LogUtil。debug({this。TAG}userAuth。authonResulterror{JSON。stringify(e)});}},onAcquireInfo:(acquireModule,acquire,extraInfo){try{LogUtil。debug(this。TAGfaceDemopin。authonAcquireInfoacquireModuleacquireModule);LogUtil。debug(this。TAGfaceDemopin。authonAcquireInfoacquireacquire);}catch(e){LogUtil。error(this。TAGfaceDemopin。authonAcquireInfoerrore);}}})}catch(e){LogUtil。error({this。TAG}AuthPinfailed:e);}LogUtil。debug({this。TAG}authPinout。);}
  概述
  主干代码:1014日下载的。
  hilogbD:打开debug输出
  可能需要的权限:ohos。permission。MANAGEUSERIDMohos。permission。USEUSERIDMohos。permission。MANAGELOCALACCOUNTSohos。permission。ACCESSUSERAUTHINTERNALohos。permission。ACCESSPINAUTH
  运行settings,日志分析opensession112914:56:32。47328132813com。ohos。mysettingsIA00500〔Settings〕:SettingsPasswordModelopenSessionin。112914:56:32。47428132813com。ohos。mysettingsIA00500〔Settings〕:SettingsPasswordModelopenSessionout。registerInputer(不是系统hap,没有selinux权限,没打包设置)com。ohos。mysettingsIA00500〔Settings〕:SettingsPasswordModelregisterInputerin。com。ohos。mysettingsIC02441PINAUTHSDK:〔RegisterInputerpinauthregister。cpp:40〕startcom。ohos。mysettingsIC02441PINAUTHSDK:〔GetProxypinauthregister。cpp:70〕startaccesstokenserIC02f01AccessTokenManagerStub:〔OnRemoteRequest〕:OnRemoteRequestcalled,code:65296accesstokenserIC02f01PermissionManager:〔VerifyAccessToken〕:VerifyAccessTokencalled,tokenID:537131032,permissionName:ohos。permission。MANAGEUSERIDMaccesstokenserIC02f01AccessTokenManagerService:〔VerifyAccessToken〕:tokenID:537131032,permissionName:ohos。permission。MANAGEUSERIDM,res0samgrIC01800SAMGR:SystemAbilityManagerStub::OnReceived,code2,callerPid2813,flags0accountmgrIC02f01AccessTokenManagerProxy:〔VerifyAccessToken〕:resultfromserverdata0samgrIC01800SAMGR:SystemAbilityManagerStub::OnReceived,code2,callerPid571,flags0samgrEC02f02Selinux:avc:denied{get}forservice941pid2813scontextu:r:systemcorehap:s0tcontextu:objectr:sauseriampinauthservice:s0tclasssamgrclasspermissive0samgrEC01800SAMGR:CheckSystemAbilityInnerselinuxpermissiondenied!SA:941samgrIC01800SAMGR:foundservice:901。com。ohos。mysettingsEC01510BinderInvoker:125:SendRequest:handle0result1com。ohos。mysettingsEC02441PINAUTHSDK:〔GetProxypinauthregister。cpp:81〕getdistributedgallerymanagerservicefailcom。ohos。mysettingsEC02441PINAUTHSDK:〔RegisterInputerpinauthregister。cpp:47〕getproxyfailedcom。ohos。mysettingsEC01b00AccountIAM:〔RegisterInputer:89〕:Failedtoregisterinputercom。ohos。mysettingsEA00500〔Settings〕:SettingsPasswordModelregisterInputerfailedcom。ohos。mysettingsIA00500〔Settings〕:SettingsPasswordModelregisterInputerout。registerInputer(是系统hap,有分布式权限)com。ohos。settingsIC02441PINAUTHSDK:〔RegisterInputerpinauthregister。cpp:40〕startaccesstokenserIC02f01PermissionManager:〔VerifyAccessToken〕:VerifyAccessTokencalled,tokenID:537311758,permissionName:ohos。permission。MANAGEUSERIDMcom。ohos。settingsIC02441PINAUTHSDK:〔GetProxypinauthregister。cpp:70〕startaccesstokenserIC02f01AccessTokenManagerService:〔VerifyAccessToken〕:tokenID:537311758,permissionName:ohos。permission。MANAGEUSERIDM,res0samgrIC01800SAMGR:SystemAbilityManagerStub::OnReceived,code2,callerPid3279,flags0accountmgrIC02f01AccessTokenManagerProxy:〔VerifyAccessToken〕:resultfromserverdata0samgrIC01800SAMGR:SystemAbilityManagerStub::OnReceived,code2,callerPid571,flags0samgrIC01800SAMGR:foundservice:941。samgrIC01800SAMGR:foundservice:901。com。ohos。settingsIC02441PINAUTHSDK:〔GetProxypinauthregister。cpp:92〕succeedtoconnectdistributedgallerymanagerservicecom。ohos。settingsIC02441PINAUTHSDK:〔RegisterInputerpinauthproxy。cpp:30〕startcom。ohos。settingsIC02441PINAUTHSDK:〔SendRequestpinauthproxy。cpp:76〕code1accountmgrIC02401USERIDMSDK:〔SendRequestuseridmproxy。cpp:351〕code0pinauthIC02441PINAUTHSA:〔OnRemoteRequestpinauthstub。cpp:28〕cmd1,flags0pinauthIC02441PINAUTHSA:〔RegisterInputerStubpinauthstub。cpp:47〕startuseriamIC02421USERAUTHSA:〔OnRemoteRequestuseridmstub。cpp:32〕cmd0,flags0useriamIC02421USERAUTHSA:〔OpenSessionStubuseridmstub。cpp:66〕enteruseriamIC02421USERAUTHSA:〔OpenSessionuseridmservice。cpp:61〕startpinauthIC02441PINAUTHSA:〔RegisterInputerpinauthservice。cpp:112〕startpinauthIC02441PINAUTHSA:〔CheckPermissionpinauthservice。cpp:104〕startaccesstokenserIC02f01AccessTokenManagerStub:〔OnRemoteRequest〕:OnRemoteRequestcalled,code:65296accesstokenserIC02f01PermissionManager:〔VerifyAccessToken〕:VerifyAccessTokencalled,tokenID:537311758,permissionName:ohos。permission。MANAGEUSERIDMaccesstokenserIC02f01AccessTokenManagerService:〔VerifyAccessToken〕:tokenID:537311758,permissionName:ohos。permission。MANAGEUSERIDM,res0useriamIC02f01AccessTokenManagerProxy:〔VerifyAccessToken〕:resultfromserverdata0accesstokenserIC02f01AccessTokenManagerStub:〔OnRemoteRequest〕:OnRemoteRequestcalled,code:65296samgrIC01800SAMGR:SystemAbilityManagerStub::OnReceived,code12,callerPid924,flags0accesstokenserIC02f01PermissionManager:〔VerifyAccessToken〕:VerifyAccessTokencalled,tokenID:671961229,permissionName:ohos。permission。MANAGEUSERIDMaccesstokenserIC02f01AccessTokenManagerService:〔VerifyAccessToken〕:tokenID:671961229,permissionName:ohos。permission。MANAGEUSERIDM,res0useriamIC02f01AccessTokenManagerProxy:〔VerifyAccessToken〕:resultfromserverdata0samgrIC01800SAMGR:foundservice:3503。accesstokenserIC02f01AccessTokenManagerStub:〔OnRemoteRequest〕:OnRemoteRequestcalled,code:65316accesstokenserIC02f01AccessTokenManagerService:〔GetTokenType〕:called,tokenID:0x280ff12caccesstokenserIC02f01AccessTokenManagerService:〔GetNativeTokenInfo〕:called,tokenID:0x280d508duseriamIC02f01AccessTokenManagerProxy:〔GetNativeTokenInfo〕:resultfromserverdata0samgrIC01800SAMGR:SystemAbilityManagerStub::OnReceived,code12,callerPid483,flags0pinauthIC02f01AccessTokenManagerProxy:〔VerifyAccessToken〕:resultfromserverdata0pinauthIC02441PINAUTHSA:〔RegisterInputerpinauthmanager。cpp:29〕start,tokenId537311758pinauthIC02441PINAUTHSA:〔RegisterInputerpinauthmanager。cpp:47〕endcom。ohos。settingsIA00500〔Settings〕:SettingsPasswordModelregisterInputerout。getAuthInfo(找不到)com。ohos。mysettingsIA00500〔Settings〕:SettingsPasswordModelgetpinauthinfodata。com。ohos。mysettingsIA00500〔Settings〕:SettingsPasswordSettingControllergetListData(false,)incom。ohos。mysettingsIA00500〔Settings〕:SettingsPasswordSettingControllergetListData(false,)outundefinedcom。ohos。mysettingsIA00500〔Settings〕:SettingsPasswordModelgetAuthInfosuccess。getAuthInfo(找到)com。ohos。settingsIA00500〔Settings〕:SettingsPasswordModelgetpinauthinfodata。com。ohos。settingsIA00500〔Settings〕:SettingshgetListData(true,)incom。ohos。settingsIA00500〔Settings〕:SettingshgetListData(true,)outundefinedcom。ohos。settingsIA00500〔Settings〕:SettingsPasswordModelgetAuthInfosuccess。addCredential(添加口令失败,因为不是系统hap所以没有成功注册inputer)com。ohos。mysettingsIA00500〔Settings〕:SettingsPasswordInputControllerpasswordOnChangein。com。ohos。mysettingsIA00500〔Settings〕:SettingsPasswordInputControllercheckInputDigitsin。com。ohos。mysettingsIA00500〔Settings〕:SettingsPasswordCheckerisNumber6in。com。ohos。mysettingsIA00500〔Settings〕:SettingsPasswordModeladdPinCredentialin。com。ohos。mysettingsIA00500〔Settings〕:SettingsPasswordModeladdPinCredentialout。com。ohos。mysettingsIA00500〔Settings〕:SettingsPasswordInputControllerpasswordOnChangeout。useriamIC02f01AccessTokenManagerProxy:〔GetNativeTokenInfo〕:resultfromserverdata0useriamIC02421USERAUTHSA:〔Startbasecontext。cpp:56〕Context(type:Enroll,contextId:0xXXXX7702)startuseriamIC02421USERAUTHSA:〔OnStartenrollcontext。cpp:43〕Context(type:Enroll,contextId:0xXXXX7702)startsamgrIC01800SAMGR:SystemAbilityManagerStub::OnReceived,code12,callerPid483,flags0samgrIC01800SAMGR:foundservice:5100。hdfdevmgrIC02500devsvcmanagerstub:serviceuserauthinterfaceservicefounduserauthhost17userauthhostIC02421USERAUTHHDI:〔BeginEnrollmentuserauthinterfaceservice。cpp:374〕startuserauthhost17userauthhostIC02421USERAUTHHDI:〔CopyScheduleInfouserauthinterfaceservice。cpp:69〕startuseriamIC02421USERAUTHSA:〔Buildschedulenodebuilder。cpp:114〕scheduleNodebuilderstarttobuilduseriamIC02421USERAUTHSA:〔Schedulefinitestatemachineimpl。cpp:51〕fsmschedulenewscheduleeventinput:0useriamIC02421USERAUTHSA:〔OnStartenrollcontext。cpp:51〕Context(type:Enroll,contextId:0xXXXX7702)successuseriamIC02421USERAUTHSA:〔operator()useridmstub。cpp:158〕leaveuseriamIC02421USERAUTHSA:〔BeginExecuteresourcenodeimpl。cpp:138〕startuseriamIC02421USERAUTHSA:〔SendRequestexecutorcallbackproxy。cpp:195〕code2pinauthIC02421USERAUTHEXECUTOR:〔OnBeginExecuteInnerframeworkexecutorcallback。cpp:64〕ExecutorCallback(Id:1)startprocesscmd0pinauthIC02421USERAUTHEXECUTOR:〔StartProcessasynccommandbase。cpp:56〕Command(type:ENROLL,id:3,scheduleId:0xXXXX246e)startprocesspinauthIC02421USERAUTHEXECUTOR:〔AddCommandexecutor。cpp:105〕Executor(Id:0x00010001)startpinauthIC02421USERAUTHEXECUTOR:〔SendRequestenrollcommand。cpp:42〕Command(type:ENROLL,id:3,scheduleId:0xXXXX246e)sendrequeststartpinauthhost16pinauthhostIC02441PINAUTHIMPL:〔Enrollexecutorimpl。cpp:123〕startpinauthhost16pinauthhostIC02441PINAUTHIMPL:〔NewSaltexecutorimpl。cpp:290〕startpinauthhost16pinauthhostIC02441PINAUTHIMPL:〔NewSaltexecutorimpl。cpp:315〕EVPsha256successpinauthhost16pinauthhostIC02441PINAUTHIMPL:〔NewSaltexecutorimpl。cpp:326〕resultsizeis:〔32〕pinauthhost16pinauthhostIC02441PINAUTHIMPL:〔AddScheduleInfoexecutorimpl。cpp:333〕startpinauthIC02441PINAUTHSA:〔OnGetDatapinauthexecutorcallbackhdi。cpp:48〕StarttokenIdis537131032pinauthIC02441PINAUTHSA:〔getInputerLockpinauthmanager。cpp:65〕startpinauthEC02441PINAUTHSA:〔getInputerLockpinauthmanager。cpp:71〕pinAuthInputerisnotfoundpinauthEC02441PINAUTHSA:〔OnGetDatapinauthexecutorcallbackhdi。cpp:51〕inputerisnullptrpinauthEC02500executorcallbackstub:ExecutorCallbackStubOnGetDatafailed,errorcodeisprivatepinauthhost16pinauthhostEC01510BinderInvoker:125:SendRequest:handle3result1pinauthhost16pinauthhostEC02500executorcallbackproxy:OnGetDatafailed,errorcodeis1pinauthhost16pinauthhostEC02441PINAUTHIMPL:〔Enrollexecutorimpl。cpp:143〕EnrollPinfailed,failcode:1pinauthhost16pinauthhostIC02441PINAUTHIMPL:〔DeleteScheduleIdexecutorimpl。cpp:369〕startpinauthhost16pinauthhostIC02441PINAUTHIMPL:〔DeleteScheduleIdexecutorimpl。cpp:372〕DeletescheduleIdsuccpinauthhost16pinauthhostEC02500executorstub:ExecutorStubEnrollfailed,errorcodeisprivatecom。ohos。mysettingsIC01c00ImsaKit:line:483,function:OnConfigurationChange,InputMethodController::OnConfigurationChangecom。ohos。mysettingsWC03900Ace:〔rendertextfield。cpp(UpdateAccessibilityAttr)(0)〕RenderTextFieldaccessibilityNodeisnull。pinauthEC01510BinderInvoker:125:SendRequest:handle2result1pinauthEC02500executorproxy:Enrollfailed,errorcodeis1pinauthEC02441PINAUTHSA:〔ConvertResultCodepinauthexecutorhdi。cpp:317〕coverthdiresultcode1toframeworkresultcode1pinauthEC02441PINAUTHSA:〔Enrollpinauthexecutorhdi。cpp:131〕Enrollfailret1pinauthIC02421USERAUTHEXECUTOR:〔SendRequestenrollcommand。cpp:53〕Command(type:ENROLL,id:3,scheduleId:0xXXXX246e)enrollresult1pinauthEC02421USERAUTHEXECUTOR:〔StartProcessasynccommandbase。cpp:65〕Command(type:ENROLL,id:3,scheduleId:0xXXXX246e)sendrequestfailedpinauthIC02421USERAUTHEXECUTOR:〔EndProcessasynccommandbase。cpp:112〕Command(type:ENROLL,id:3,scheduleId:0xXXXX246e)endprocesspinauthIC02421USERAUTHEXECUTOR:〔RemoveCommandexecutor。cpp:113〕Executor(Id:0x00010001)startpinauthIC02421USERAUTHEXECUTOR:〔OnBeginExecuteInnerframeworkexecutorcallback。cpp:80〕commandid0ret1useriamEC02421USERAUTHSA:〔ProcessBeginVerifierschedulenodeimpl。cpp:281〕startverifyfaileduseriamIC02421USERAUTHSA:〔ScheduleInnerfinitestatemachineimpl。cpp:84〕fsmscheduleschedule〔state:0〕〔event:0〕〔nextState:1〕useriamIC02421USERAUTHSA:〔OnResultenrollcontext。cpp:57〕Context(type:Enroll,contextId:0xXXXX7702)receiveresultcode7useriamEC02421USERAUTHSA:〔UpdateScheduleResultenrollcontext。cpp:88〕(scheduleResultAttr!nullptr)checkfail,returnuseriamEC02421USERAUTHSA:〔OnResultenrollcontext。cpp:62〕Context(type:Enroll,contextId:0xXXXX7702)UpdateScheduleResultfailuseriamIC02421USERAUTHSA:〔OnResultuseridmcallbackproxy。cpp:29〕startuseriamIC02421USERAUTHSA:〔SendRequestuseridmcallbackproxy。cpp:87〕startaccountmgrEC01b00AccountMgrService:〔OnResult:138〕:failedtoaddcredentialcom。ohos。mysettingsIC03900NAPI:〔nativeapi。cpp(napicallfunction)〕engine:00F1D680,nativeRecv:CD18BAE0,nativeFunc:CD18BC18,nativeArgv:FF95C088com。ohos。mysettingsIA00500〔Settings〕:SettingsPasswordModelAddpincredential,result:7com。ohos。mysettingsIA00500〔Settings〕:SettingsPasswordInputControllercreatepasswordfailedaddCredential(添加口令成功)com。ohos。settingsIA00500〔Settings〕:SettingsPasswordInputControllerpasswordOnChangein。com。ohos。settingsIA00500〔Settings〕:SettingsPasswordInputControllercheckInputDigitsin。com。ohos。settingsIA00500〔Settings〕:SettingsPasswordCheckerisNumber6in。com。ohos。settingsIA00500〔Settings〕:SettingsPasswordModeladdPinCredentialin。com。ohos。settingsIA00500〔Settings〕:SettingsPasswordModeladdPinCredentialout。com。ohos。settingsIA00500〔Settings〕:SettingsPasswordInputControllerpasswordOnChangeout。进入服务层com。ohos。settingsIC02441PINAUTHSDK:〔OnRemoteRequestinputergetdatastub。cpp:29〕cmd1,flags0com。ohos。settingsIC02441PINAUTHSDK:〔OnGetDatainputergetdataservice。cpp:34〕start进入app层回调com。ohos。settingsDA00500〔Settings〕:SettingsPasswordModelencodeToU8Ain。com。ohos。settingsDA00500〔Settings〕:SettingsPasswordModelencodeToU8Aout。com。ohos。settingsIA00500〔Settings〕:SettingsPasswordModelbeforesetdata,type:10000。进入服务层com。ohos。settingsIC02441PINAUTHSDK:〔OnSetDatainputerdataimpl。cpp:37〕startanddatasizeis6com。ohos。settingsIC02441PINAUTHSDK:〔GetScryptscrypt。cpp:36〕startcom。ohos。settingsIC02441PINAUTHSDK:〔OnSetDatainputersetdataproxy。cpp:27〕startcom。ohos。settingsIC02441PINAUTHSDK:〔SendRequestinputersetdataproxy。cpp:51〕code1com。ohos。settingsIC02441PINAUTHSDK:〔OnSetDatainputersetdataproxy。cpp:45〕result0com。ohos。settingsIC02441PINAUTHSDK:〔OnRemoteRequestinputergetdatastub。cpp:29〕cmd1,flags0com。ohos。settingsIC02441PINAUTHSDK:〔OnGetDatainputergetdataservice。cpp:34〕starcom。ohos。settingsIC02441PINAUTHSDK:〔OnSetDatainputerdataimpl。cpp:37〕startanddatasizeis6com。ohos。settingsIC02441PINAUTHSDK:〔GetScryptscrypt。cpp:36〕startcom。ohos。settingsIC02441PINAUTHSDK:〔OnSetDatainputersetdataproxy。cpp:27〕startcom。ohos。settingsIC02441PINAUTHSDK:〔SendRequestinputersetdataproxy。cpp:51〕code1com。ohos。settingsIC02441PINAUTHSDK:〔OnSetDatainputersetdataproxy。cpp:45〕result0com。ohos。settingsDC02421USERAUTHSA:〔Implattributes。cpp:157〕emplacepairsuccess,typeis100025com。ohos。settingsIA00500〔Settings〕:SettingsPasswordModelAddpincredential,result:0com。ohos。settingsIA00500〔Settings〕:SettingsPasswordInputControllercreatepasswordsuccess
  小结用户鉴权(包括屏保)是以accountmgr服务为入口为应用层提供功能,以useridm为实现,完成具体的口令管理和人脸管理。PS:人脸管理目前还有欠缺,现在设置里的人脸认证需要先设置口令为123456,然后才开始人脸认证,但是经使用人脸认证时候虽然摄像头是好的但是没有图像,可能是应用的Bug吧。用户鉴权是系统级服务,要求:ohos。permission。MANAGEUSERIDMohos。permission。USEUSERIDMohos。permission。MANAGELOCALACCOUNTSohos。permission。ACCESSUSERAUTHINTERNALohos。permission。ACCESSPINAUTH权限selinux权限(富设备支持)
  作者:王石

创作者经济新纪元为什么音乐NFT会崛起深陷泥潭的音乐产业除了吃饭睡觉之外,人们身心放松的最重要方式,音乐应该算在Top3了。人类对音乐的喜爱几乎是刻进DNA的。从生物学角度讲,听音乐可以使大脑回路(如伏隔核,……PS5第三方独占新IP将在2022年全面开发除了收购工作室外,索尼还和最新成立的第三方工作室合作,为其开发独占PS5游戏,包括Haven工作室、Firewalk工作室和DeviationGames。对于Deviation……终于忍不住了!科尔不满汤普森连续两场3分犯规输球,这怎么赢库里在对阵凯尔特人意外受伤之后,如今已经两场比赛没有为勇士队出战了,而今天勇士队不敌东部倒数第二的魔术,包括对阵绿军这场比赛,勇士队已经迎来了3连败,这或许就是失去库里之后,勇……地铁跑酷通用兑换码2023年1月8日,地铁跑酷通用兑换码关注小编,领取每日地铁跑酷通用兑换码兑换码口令:FANBOOK地铁的周末福利有效期至:2023011600:00:00……喜迎2023年灼灼的岁序,恰似时光荏苒。一个回眸,秋去冬来;一个转身,2022年销声匿迹,2023年纷至沓来。流年似水,岁月如歌,一年的时光,已画上了句号。我们熬过了大疫三……不听劝?iPhone15Pro被曝价格会上调,网友离谱又合理在iPhone14系列采取差异化政策后,就遭到了很多消费者的吐槽,且iPhone14Plus系列也卖得不好。本以为苹果会吸取教训,从iPhone15系列上改过来,没想到库克并不……宝刀未老!保罗领衔,库里排第三,本赛季发挥最出色的十名控卫自从2014年肖华上任NBA总裁后,联盟为了增加比赛观赏性,通过对规则的修改鼓励球员进攻,各支球队为了追求高效的进攻,逐渐演变为如今攻防节奏快、三分球投射占比逐年上涨的小球时代……这道家常小炒,下饭必备,香辣味浓,口感滑嫩,我家一周做5次这道家常小炒,下饭必备,香辣味浓,口感滑嫩,我家一周做5次每天下班回到家里,最愁的一件事情就是就是吃什么,虽然菜市场里的蔬菜种类有很多,没有目标的话,很难买的。咱们……试管生娃的心路历程(六)取卵后的影响取卵当天,老公同步被叫到另一个房间取精子,男生的手续比较简单,全程不痛,他说房间还有小福利可看。而我的情况就严重多了,取完卵麻醉散去后,我突然就吐个不停,本来早餐没有吃,……3000元以内,冰箱怎么选?冰箱,对我们生活来说,可以说是必不可少了。无论你是想给食物保鲜,还是储藏食物,冰箱都是最好的选择。作为一个普通消费者,冰箱对于我们来说,其实很简单的,就是保鲜食物。要是认真选择……国家统计局2022年6月中旬流通领域重要生产资料市场价格变动央视网消息:国家统计局发布,据对全国流通领域9大类50种重要生产资料市场价格的监测显示,2022年6月中旬与6月上旬相比,18种产品价格上涨,30种下降,2种持平。附注……女人开始衰老时,4处会发出提示,女人心细就不难察觉对于衰老,是谁都不愿意面对的,尤其是作为女性朋友来说,更是想尽各种办法,让衰老来得更慢一些,但是,什么年龄就应该是什么样的状态,当身体给出一些提示时,就证明你已经开始慢慢在衰老……
被张艺谋说不漂亮,出道被嘲土的她,何以成为90花里最时髦的一时尚圈向来对金九银十奉若至宝,以时尚杂志为例,一般来说,只有五大女刊的九月、十月正刊封面才可以被称为金九银十。9月底了,把最具含金量的金九银十刊看了一圈,最让我惊喜的居然……2021年新生儿这十大名字是爆款1月24日,公安部户政管理研究中心发布《2021年全国姓名报告》,其中的新生儿姓名用字情况引起大家关注。南都记者整理发现,使用频率最高的50个字前5依次为泽、梓、子、宇、沐,与……BLG全力备战春季赛,Uzi训练效果不一般,或为了新赛季拼了对于热衷于LOL战役的观众们而言,进入了12月的最后一周后就显得特别枯燥,在LPL赛区,TES将FPX打败后就成功将LOL德玛西亚杯给捧起来,而从那开始,这个赛区再度进入了休赛……windows10平板电脑RJ45网口工业手持平板电脑平板电windows10平板电脑RJ45网口工业手持平板电脑平板电脑生产厂家视频加载中。。。工业平板电脑8英寸自带RJ45网口工业平板电脑8英寸自带RJ45网口……余承东诚挚推荐问界M5M7拥有超高品价比性价比【CNMO新闻】3月3日,华为常务董事、终端BGCEO、智能汽车解决方案BUCEO余承东发微博为问界M5、M7系列车型宣传。余承东真诚介绍称:作为一个曾开过多个豪华品牌车的人,……乔治受伤之意外惊喜,逼出豪华快船车轮战潜力在保罗乔治受伤后,几乎没有人看好快船与雷霆三天内的第二场对决。然而结果却大跌眼镜,快船收获了一场大胜,而替补上场的巴图姆、曼恩、海兰德正负值均超过了30,普拉姆利达到了28。……场均6分,自比库里,詹姆斯带不动!湖人渐入佳境,可你该离开了本赛季NBA常规赛进行过半,西部整体很混乱,可是在混乱之中,又出现一些新的趋势。比如缺少了布克的太阳,战绩一落千丈,保罗已经无力支撑这支缺兵少将的球队,确保稳定下限。再比如快船……OpenHarmony上设置人脸认证本文主要简析OpenHarmony的用户鉴权管理。用户凭证管理pinauth(口令认证):模块支持用户口令的设置,删除和认证功能。与用户IAM子系统基础框架配……百岁之好一言为定妙用温开水温开水是指烧开的水自然冷却至2530摄氏度,水被烧开后继续煮五分钟,不仅氯气等有害物质分解挥发了,还能保证人体必需的营养物质没有损耗;也指凉开水加热开水兑的,喝着不烫嘴,很舒服……LCK半决赛赛程20日GENvsLSB,21日T1vsDK决在昨日进行的2022LCK季后赛DKvsKT的比赛上,DK凭借一手偷家战术在BO5的关键决胜局中获胜,最终以3比2的比分击败KT,成功晋级下一轮的比赛。赛后,LCK官方也……年轻人消费看重性价比,黄金市场一夜大火,唯品会数据揭开实情最近,网上一个叫10个年轻人有7个花钱先看性价比的话题火了,让大量95后、00后产生了强烈共鸣,纷纷参与讨论。话题更是一度霸榜热搜,单日阅读量达1亿。确实,现在年轻人的消……深度大理自称最美尼姑庵的寂照庵,不耐烦地卖着赚大钱的斋饭每当我遇到不好的事,原本可以算了,但一想到我的较真,可能会推动社会波浪式前进,曲折式上升的速度稍微快一点,就觉得是某种使命,所以无论因此遇到怎样的诋毁,都泰然处之,因为因果不虚……
友情链接:易事利快生活快传网聚热点七猫云快好知快百科中准网快好找文好找中准网快软网