Skip to content

Commit

Permalink
ginkgo: Add unified script
Browse files Browse the repository at this point in the history
Change-Id: Id02d8f5755423dedd0f58b68db4ed7a29b1261b8
  • Loading branch information
mauronofrio authored and erwinabs committed Oct 2, 2021
1 parent 773b1cb commit 59006bd
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
11 changes: 11 additions & 0 deletions recovery/root/init.recovery.qcom.rc
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,14 @@ on fs
wait /dev/block/platform/soc/${ro.boot.bootdevice}
symlink /dev/block/platform/soc/${ro.boot.bootdevice} /dev/block/bootdevice
setprop prepdecrypt.setpatch true

service unified-script /system/bin/unified-script.sh
user root
group root
disabled
oneshot
seclabel u:r:recovery:s0

on boot
chmod 0777 /system/bin/unified-script.sh
start unified-script
Binary file added recovery/root/system/bin/resetprop
Binary file not shown.
44 changes: 44 additions & 0 deletions recovery/root/system/bin/unified-script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/system/bin/sh
# This script is needed to automatically set device props.


load_willow()
{
resetprop "ro.product.model" "Redmi Note 8T"
resetprop "ro.product.name" "willow"
resetprop "ro.build.product" "willow"
resetprop "ro.product.device" "willow"
resetprop "ro.vendor.product.device" "willow"
}

load_ginkgo()
{
resetprop "ro.product.model" "Redmi Note 8"
resetprop "ro.product.name" "ginkgo"
resetprop "ro.build.product" "ginkgo"
resetprop "ro.product.device" "ginkgo"
resetprop "ro.vendor.product.device" "ginkgo"
}

region=$(getprop ro.boot.hwc)
echo $region
hwversion=$(getprop ro.boot.hwversion)
echo $hwversion

case $region in
"Global_B")
case $hwversion in
"18.31.0"|"18.39.0"|"19.39.0")
load_willow
;;
*)
load_ginkgo
;;
esac
;;
*)
load_ginkgo
;;
esac

exit 0

0 comments on commit 59006bd

Please sign in to comment.