
*** All commands need to be executed under root permission and ATV10 ***
*** userdebug FW is needed to change as root ***
*** After setting up is complete, the device needs to be restarted ***

Change as root: "adb root"

1. Choose a Device ID from keylist_SKB168 and write it to BFX-AT100 (e.g. BFX-AT100_2019_002497673)
  1.1 adb shell
  1.2 echo deviceid > /sys/class/unifykeys/name
  1.3 echo $deviceid > /sys/class/unifykeys/write

2. For wvkey, get corresponding wv keys from keylist_SK168 file (e.g. 4246582...b47ec3b3)
  2.2 echo widevinekeybox > /sys/class/unifykeys/name
  2.3 echo $wv_key | xxd -p -r > /sys/class/unifykeys/write

3. For Attestaionkey
  3.1 adb push writeAttestaionkey /data
  3.2 adb push BFX-AT100_2019_002400001.keybox /data
  3.3 adb shell 
  3.4 chmod 777 /data/writeAttestaionkey
  3.5 /data/writeAttestaionkey /data/BFX-AT100_2019_002400001.keybox

4.Verify whether the written Device ID is correct
  4.1 adb shell
  4.2 getprop | grep deviceid

5.Verify whether the written wvkey is correct
  5.1 adb shell
  5.2 echo widevinekeybox > /sys/class/unifykeys/name
  5.3 var=`busybox hexdump -e '16/1 "%02x"' /sys/class/unifykeys/read`
  5.4 echo "$var"
  5.5 sha_src=`echo $wvkey | xxd -p -r | sha256sum | awk '{print $1}'`
  5.6 echo "SRC WVKEY sha256sum=$sha_src"
  5.7 Compare the output of echo "$var" with echo "SRC WVKEY sha256sum=$sha_src".If they are the same, it indicates that the wvkey has been set successfully


