From 29622ec3e3cc5a8bb2a3b807b63b0bca71dd9fc3 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Mon, 30 Apr 2018 13:56:06 +0200 Subject: [PATCH] Mount bind Huawei's fingerprint.kl --- rw-system.sh | 52 ++++++++++++++++++++++++++++------------------------ 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/rw-system.sh b/rw-system.sh index cf45343..3cfb4ed 100644 --- a/rw-system.sh +++ b/rw-system.sh @@ -12,31 +12,35 @@ mount -o remount,ro / img="$(find /dev/block -type l |grep by-name |grep /kernel$(getprop ro.boot.slot_suffix) |head -n 1)" [ -z "$img" ] && img="$(find /dev/block -type l |grep by-name |grep /boot$(getprop ro.boot.slot_suffix) |head -n 1)" -[ -z "$img" ] && exit 0 +if [ -n "$img" ];then + #Rewrite SPL/Android version if needed + Arelease="$(getSPL $img android)" + setprop ro.keymaster.xxx.release $Arelease + setprop ro.keymaster.xxx.security_patch "$(getSPL $img spl)" -#Rewrite SPL/Android version if needed -Arelease="$(getSPL $img android)" -setprop ro.keymaster.xxx.release $Arelease -setprop ro.keymaster.xxx.security_patch "$(getSPL $img spl)" + #Only Android 8.0 needs this + if ! echo "$Arelease" |grep -qF 8.0;then + exit 0 + fi -#Only Android 8.0 needs this -if ! echo "$Arelease" |grep -qF 8.0;then - exit 0 + for f in /vendor/lib64/hw/android.hardware.keymaster@3.0-impl-qti.so /system/lib64/vndk-26/libsoftkeymasterdevice.so;do + [ ! -f $f ] && continue + b="$(basename "$f")" + + mkdir -p /dev/phh/ + cp $f /dev/phh/$b + sed -i -e 's/ro.build.version.release/ro.keymaster.xxx.release/g' -e 's/ro.build.version.security_patch/ro.keymaster.xxx.security_patch/g' /dev/phh/$b + if echo $f |grep vendor;then + chcon u:object_r:vendor_file:s0 /dev/phh/$b + else + chcon u:object_r:system_file:s0 /dev/phh/$b + fi + chmod 0644 /dev/phh/$b + mount -o bind /dev/phh/$b $f + done + setprop ctl.restart keymaster-3-0 fi -for f in /vendor/lib64/hw/android.hardware.keymaster@3.0-impl-qti.so /system/lib64/vndk-26/libsoftkeymasterdevice.so;do - [ ! -f $f ] && continue - b="$(basename "$f")" - - mkdir -p /dev/phh/ - cp $f /dev/phh/$b - sed -i -e 's/ro.build.version.release/ro.keymaster.xxx.release/g' -e 's/ro.build.version.security_patch/ro.keymaster.xxx.security_patch/g' /dev/phh/$b - if echo $f |grep vendor;then - chcon u:object_r:vendor_file:s0 /dev/phh/$b - else - chcon u:object_r:system_file:s0 /dev/phh/$b - fi - chmod 0644 /dev/phh/$b - mount -o bind /dev/phh/$b $f -done -setprop ctl.restart keymaster-3-0 +if grep vendor.huawei.hardware.biometrics.fingerprint /vendor/manifest.xml;then + mount -o bind system/phh/huawei/fingerprint.kl /vendor/usr/keylayout/fingerprint.kl +fi