device_phh_treble/vndk-detect

47 lines
1.2 KiB
Plaintext
Raw Normal View History

#!/system/bin/sh
grep -oE 'init_[0-9_]+' /vendor/etc/selinux/nonplat_sepolicy.cil | \
uniq | \
sort -n | \
head -n 1 | \
sed -E 's/.*init_([0-9]+).*/\1/g' | \
while read version;do
setprop persist.sys.vndk $version
done
if [ -d /sys/module/five ];then
mount -o bind /system/phh/empty /sbin/adbd
setprop sys.phh.five true
else
mount -o bind /system/bin/adbd /sbin/adbd
fi
if ( getprop ro.hardware | grep -qE '(kirin970|hi3660|hi6250|hi3670)' );then
FOUND_HUAWEI=1
fi
if getprop ro.vendor.build.fingerprint |grep -qiE '(huawei|honor|hi3660)';then
FOUND_HUAWEI=1
fi
if [ -n "$FOUND_HUAWEI" ];then
setprop persist.sys.overlay.huawei true
setprop persist.sys.bt_acl_bypass true
setprop persist.sys.camera.huawei true
2018-11-17 18:47:03 +00:00
setprop persist.sys.radio.ussd.fix true
2019-02-17 12:18:57 +00:00
setprop persist.sys.radio.huawei true
setprop debug.hwui.profile true
fi
2018-12-21 17:18:01 +00:00
if getprop ro.hardware |grep -qiE -e qcom -e judyln -e judypn;then
FOUND_QCOM=1
if getprop ro.vendor.build.fingerprint |grep -qiE '^samsung';then
setprop persist.sys.overlay.devinputjack false
else
setprop persist.sys.overlay.devinputjack true
fi
fi
2018-11-17 18:47:03 +00:00
if getprop Build.BRAND | grep -qiE -e MTK;then
setprop persist.sys.radio.ussd.fix true
fi