[Android GMS 認證] keystore/keymaster/Attestation的問題
首先確定寫入key,操作如下:
檢查 /persist/data/sfs 目錄下是否有key檔案存在
adb shell ls -la /persist/data/sfs
做過key provision的機器重新寫key,參照如下步驟:
1)燒userdebug版本,重新寫key需要在userdebug版本上才能做
2)執行下面命令擦除rpmb分割槽
MODEL1:/ # qseecom_sample_client v smplap64 15 1
Note: Command line arguments do not belong to legacy test
---------------------------------------------------------------
WARNING!!! You are about to erase the entire RPMB partition.
----------------------------------------------------------------
Do you want to proceed (y/n)? y
RPMB partition erase completed
3)重啟機器,檢查機器處於lock狀態和rpmb key已經provision
adb reboot bootloader
執行下面命令檢視locked狀態
fastboot oem lock
(bootloader) Device already : locked!
OKAY [ 0.006s]
Finished. Total time: 0.007s
執行下面命令,若返回-1表示已經provision過rpmb key
MODEL1:/ # qseecom_sample_client v smplap64 14 1
Note: Command line arguments do not belong to legacy test
-------------------------------------------------------
WARNING!!! You are about to provision the RPMB key.
This is a ONE time operation and CANNOT be reversed.
-------------------------------------------------------
0 -> Provision Production key
1 -> Provision Test key
2 -> Check RPMB key provision status
-------------------------------------------------------
Select an option to proceed: 1
RPMB key provisioning failed (-1)
4) 後面就可以進行attestation key provison了
adb push keybox.xml /data/local/tmp
adb shell LD_LIBRARY_PATH=/vendor/lib64/hw KmInstallKeybox /data/local/tmp/keybox.xml your_key_file_product_id true
5)在user版本上測試時注意不要刷persist image,因為attestation key是寫在persist分割槽的。
widevine要用到的話,也得先合入。可以參考 kba-160918225319_3_how_to_integrate_widevine_on_android.pdf,Integrate Widevine - GMS Help.pdf等文件。
然後,絕大部分問題都是高通的問題……很多都是閉源的,無能為力。