Compare commits

...

46 Commits

Author SHA1 Message Date
Pierre-Hugues HUSSON
09e6efa628
Merge pull request #185 from ponces/android-9.0
Fix exynos grep command to apply setprop correctly
2020-05-14 12:45:44 +02:00
Alberto Ponces
aca15ba77f Simplify the exynos grep command even further and remove some whitespace 2020-05-14 11:43:00 +01:00
Alberto Ponces
d5b3121548 Fix exynos grep command to apply setprop correctly 2020-05-13 17:59:21 +01:00
Pierre-Hugues HUSSON
7e2b58bf3c
Merge pull request #139 from cheah/fix-xiaomi-dt2w
[Pie] [xiaomi] Use persist.sys.phh.xiaomi.dt2w prop to control DT2W
2020-03-26 09:46:20 +01:00
Michael Cheah
58dd99657a
[xiaomi] Use persist.sys.phh.xiaomi.dt2w prop to control DT2W 2020-03-26 09:51:58 +08:00
Pierre-Hugues HUSSON
ce67941ebf
Merge pull request #151 from jumper047/patch-1
[Android 9][Begonia] Fix brightness and fingerprint on Redmi Note 8 Pro
2020-02-21 16:38:04 +01:00
jumper047
f29508b21c Fix typo 2020-02-20 21:17:20 +03:00
jumper047
d3b3d20716 Fix begonia fingerprint sensor behavior 2020-02-20 21:06:58 +03:00
jumper047
0e1cf0877a * rw-system.sh: simplify begonia regexp 2020-02-20 21:03:26 +03:00
Pierre-Hugues HUSSON
e60db7365b
Merge pull request #153 from myst33d/android-9.0
Properly delete superuser app
2020-02-20 14:41:42 +01:00
Myst33d
6a7718a60b
Properly delete superuser app 2020-02-20 19:38:35 +06:00
jumper047
c832c77d14
Fix regexp 2020-02-20 07:52:04 +03:00
jumper047
a67704f357
Fix brightness on Redmi Note 8 Pro 2020-02-19 22:46:08 +03:00
Pierre-Hugues HUSSON
90d64013c2
Merge pull request #150 from SamarV-121/patch-1
Enable latch_unsignaled on exynos devices
2020-02-19 15:18:42 +01:00
Sᴀᴍᴀʀ Vɪꜱᴘᴜᴛᴇ
f7eb2c6c16
Enable latch_unsignaled on exynos devices
ro.hardware=exynos* on some samsung devices
 eg. Samsung Galaxy M20
2020-02-19 19:03:48 +05:30
Pierre-Hugues HUSSON
93bec7ceaa
Merge pull request #148 from XavierWrz/patch-1
Add smoothness for Lenovo Moto E5 in Pie Builds
2020-02-07 08:56:02 +01:00
XavierWrz
0639e66ec0
Add smoothness for Lenovo Moto E5 in Pie Builds 2020-02-06 21:59:48 -03:00
Mehran Kholdi
06aaf84236 Add Redmi 7 - onc(lite) to fingerprint input events blacklist 2020-01-21 22:58:44 +01:00
washinson
73b20785b8 Fix dualsim for some Huawei phones (#143)
* Fix dualsim for some Huawei phones

Huawei P20 Lite doesn't have /odm/phone.prop, we must use /vendor/phone.prop
2020-01-14 11:03:35 +01:00
Pierre-Hugues HUSSON
656465ab76
Merge pull request #142 from DarkJoker360/android-9.0
Fix audio on Redmi Note 8T (willow)
2020-01-08 21:05:34 +01:00
DarkJoker360
4700841132 Fix audio on Redmi Note 8T (willow)
Signed-off-by: DarkJoker360 <simoespo159@gmail.com>
2020-01-08 19:44:20 +01:00
Pierre-Hugues HUSSON
e975ed9f89
Merge pull request #136 from lead4good/android-9.0
fix: mia3 brightness scale
2019-12-22 15:33:27 +01:00
lead4good
21655a0839 fix: mia3 brightness scale 2019-12-22 11:56:32 +01:00
Pierre-Hugues HUSSON
ba9d46f93a
Merge pull request #125 from eremitein/android-9.0
[daisy] revert camera in DnD fix
2019-12-11 14:21:18 +01:00
Pierre-Hugues HUSSON
344ff91898
Merge pull request #131 from lead4good/android-9.0
fix: add sound support for xiaomi a3
2019-12-09 08:50:37 +01:00
Frieder Paape
f41734ed8f
fix: add sound support for xiaomi a3 2019-12-09 08:39:27 +01:00
Pierre-Hugues Husson
8a6837d774 Add support for Huawei's phone.prop
Reference is https://github.com/LineageOS/android_device_huawei_kirin970-common/blob/lineage-16.0/init/init_kirin970.cpp
2019-12-09 00:57:46 +01:00
Pierre-Hugues Husson
897f17c554 SPL got from boot.img is safer than from vendor (there can be mismatch) 2019-12-08 21:08:02 +01:00
Pierre-Hugues Husson
39b0a00aba Detect whether vendor has an hostapd by checking manifest 2019-12-06 21:35:42 +01:00
Pierre-Hugues HUSSON
7329ffdc22
Merge pull request #128 from YaAlex3/android-9.0
Fix backlight on Redmi 7A (pine) [Pie]
2019-12-02 23:05:56 +01:00
Alexander
c0eb03ec69
Fix backlight on Redmi 7A (pine) 2019-12-03 00:39:49 +03:00
Pierre-Hugues Husson
dc8484b74f Fix fingerprint on Honor View 10 2019-11-30 22:42:42 +01:00
Pierre-Hugues HUSSON
7a6d88a308
Merge pull request #127 from redmi8a/android-9.0
Fix backlight on Redmi 8A (olivelite) [Pie]
2019-11-21 07:35:14 +01:00
Milan Kragujević
71eef45e2c
Fix backlight on Redmi 8A (olivelite) 2019-11-20 23:52:46 +01:00
Victor Bo
4bd3bbdd0b [daisy] revert camera in DnD fix
* camera works fine in DnD mode without this fix in v204 and in v121 too
    not need this fix for daisy anymore

	modified:   rw-system.sh
2019-11-20 04:09:36 +05:00
Pierre-Hugues HUSSON
214ee50feb
Merge pull request #123 from lead4good/android-9.0
fix sound for redmi note 8 (ginko)
2019-11-11 19:20:46 +01:00
lead4good
b560c366aa fix sound for redmi note 8 (ginko) 2019-11-11 18:20:21 +01:00
Pierre-Hugues Husson
954d2157da Support Nokia 4.2 assistant button 2019-10-26 21:06:58 +02:00
Pierre-Hugues HUSSON
5711a57dd4
Merge pull request #121 from AndyCGYan/ppw
Add privapp-permissions whitelist for PhhTrebleApp
2019-10-25 17:06:45 +02:00
Andy CrossGate Yan
9212d15274 Add privapp-permissions whitelist for PhhTrebleApp 2019-10-25 22:32:18 +08:00
Pierre-Hugues HUSSON
c325426906
Merge pull request #120 from kuba3351/patch-1
[device] Added "ro.audio.ignore_effects true" for davinci
2019-10-05 12:45:22 +02:00
kuba3351
40e7ecc90d
[device] Added "ro.audio.ignore_effects true" for davinci 2019-10-05 12:41:18 +02:00
Pierre-Hugues Husson
d73bb669e2 latch_unsignaled on mt6771 2019-09-14 13:22:05 +02:00
Pierre-Hugues HUSSON
eff02a1912
Merge pull request #118 from Dinolek/android-9.0
Add prop to disable incoming calls sed
2019-09-13 22:59:16 +02:00
Dinolek
64d8b7d900 Add prop to disable incoming calls sed 2019-09-13 22:53:28 +02:00
Pierre-Hugues Husson
b8e1d18b51 Actually we want to force samsung workaround off 2019-09-09 20:38:56 +02:00
10 changed files with 166 additions and 15 deletions

View File

@ -57,6 +57,7 @@ PRODUCT_PACKAGES += \
PRODUCT_COPY_FILES += \
device/phh/treble/rw-system.sh:system/bin/rw-system.sh \
device/phh/treble/phh-prop-handler.sh:system/bin/phh-prop-handler.sh \
device/phh/treble/fixSPL/getSPL.arm:system/bin/getSPL
PRODUCT_COPY_FILES += \
@ -107,7 +108,8 @@ PRODUCT_COPY_FILES += \
device/phh/treble/files/huawei-fingerprint.kl:system/phh/huawei/fingerprint.kl \
device/phh/treble/files/samsung-sec_e-pen.idc:system/usr/idc/sec_e-pen.idc \
device/phh/treble/files/samsung-9810-floating_feature.xml:system/ph/sam-9810-flo_feat.xml \
device/phh/treble/files/mimix3-gpio-keys.kl:system/phh/mimix3-gpio-keys.kl
device/phh/treble/files/mimix3-gpio-keys.kl:system/phh/mimix3-gpio-keys.kl \
device/phh/treble/files/nokia-soc_gpio_keys.kl:system/phh/nokia-soc_gpio_keys.kl
SELINUX_IGNORE_NEVERALLOWS := true
@ -138,3 +140,6 @@ PRODUCT_PACKAGES += \
PRODUCT_COPY_FILES += \
device/phh/treble/phh-securize.sh:system/bin/phh-securize.sh \
# Privapp-permissions whitelist for PhhTrebleApp
PRODUCT_COPY_FILES += \
device/phh/treble/privapp-permissions-me.phh.treble.app.xml:system/etc/permissions/privapp-permissions-me.phh.treble.app.xml

View File

@ -2,3 +2,5 @@ TARGET_SYSTEM_PROP := device/phh/treble/system.prop $(TARGET_SYSTEM_PROP)
BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := device/phh/treble/bluetooth
TARGET_EXFAT_DRIVER := exfat
DEVICE_FRAMEWORK_MANIFEST_FILE := device/phh/treble/framework_manifest.xml
BOARD_ROOT_EXTRA_FOLDERS += sec_storage

View File

@ -0,0 +1,6 @@
# SPDX-License-Identifier: Apache-2.0
key 114 VOLUME_DOWN
key 115 VOLUME_UP
key 116 POWER
key 236 ASSIST

60
phh-prop-handler.sh Normal file
View File

@ -0,0 +1,60 @@
#!/system/bin/sh
set -o pipefail
display_usage() {
echo -e "\nUsage:\n ./phh-prop-handler.sh [prop]\n"
}
if [ "$#" -ne 1 ]; then
display_usage
exit 1
fi
prop_value=$(getprop "$1")
xiaomi_toggle_dt2w_proc_node() {
DT2W_PROC_NODES=("/proc/touchpanel/wakeup_gesture"
"/proc/tp_wakeup_gesture"
"/proc/tp_gesture")
for node in "${DT2W_PROC_NODES[@]}"; do
[ ! -f "${node}" ] && continue
echo "Trying to set dt2w mode with /proc node: ${node}"
echo "$1" >"${node}"
[[ "$(cat "${node}")" -eq "$1" ]] # Check result
return
done
return 1
}
xiaomi_toggle_dt2w_event_node() {
for ev in $(
cd /sys/class/input || return
echo event*
); do
[ ! -f "/sys/class/input/${ev}/device/device/gesture_mask" ] &&
[ ! -f "/sys/class/input/${ev}/device/wake_gesture" ] && continue
echo "Trying to set dt2w mode with event node: /dev/input/${ev}"
if [ "$1" -eq 1 ]; then
# Enable
sendevent /dev/input/"${ev}" 0 1 5
return
else
# Disable
sendevent /dev/input/"${ev}" 0 1 4
return
fi
done
return 1
}
if [ "$1" == "persist.sys.phh.xiaomi.dt2w" ]; then
if [[ "$prop_value" -ne 0 && "$prop_value" -ne 1 ]]; then
exit 1
fi
if ! xiaomi_toggle_dt2w_proc_node "$prop_value"; then
# Fallback to event node method
xiaomi_toggle_dt2w_event_node "$prop_value"
fi
exit $?
fi

View File

@ -9,7 +9,7 @@ rm /system/xbin/su
rm /system/bin/phh-su
rm /system/etc/init/su.rc
rm /system/bin/phh-securize.sh
rm -Rf /system/bin/me.phh.superuser/
rm -Rf /system/app/me.phh.superuser/
mount -o remount,ro /
mount -o remount,ro /system
sync

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<permissions>
<privapp-permissions package="me.phh.treble.app">
<permission name="android.permission.INTERACT_ACROSS_USERS"/>
</privapp-permissions>
</permissions>

View File

@ -70,9 +70,9 @@ changeKeylayout() {
if getprop ro.vendor.build.fingerprint | grep -iq \
-e xiaomi/polaris -e xiaomi/sirius -e xiaomi/dipper \
-e xiaomi/wayne -e xiaomi/jasmine -e xiaomi/jasmine_sprout \
-e xiaomi/platina -e iaomi/perseus -e xiaomi/ysl \
-e xiaomi/platina -e iaomi/perseus -e xiaomi/ysl -e Redmi/begonia\
-e xiaomi/nitrogen -e xiaomi/daisy -e xiaomi/sakura \
-e xiaomi/whyred -e xiaomi/tulip; then
-e xiaomi/whyred -e xiaomi/tulip -e xiaomi/onc; then
if [ ! -f /mnt/phh/keylayout/uinput-goodix.kl ]; then
cp /system/phh/empty /mnt/phh/keylayout/uinput-goodix.kl
chmod 0644 /mnt/phh/keylayout/uinput-goodix.kl
@ -103,6 +103,12 @@ changeKeylayout() {
changed=true
fi
if getprop ro.vendor.build.fingerprint |grep -iq -E -e '^Nokia/Panther';then
cp /system/phh/nokia-soc_gpio_keys.kl /mnt/phh/keylayout/soc_gpio_keys.kl
chmod 0644 /mnt/phh/keylayout/soc_gpio_keys.kl
changed=true
fi
if [ "$changed" = true ]; then
mount -o bind /mnt/phh/keylayout /system/usr/keylayout
restorecon -R /system/usr/keylayout
@ -153,6 +159,12 @@ if getprop ro.vendor.build.fingerprint | grep -qE 'Sony/'; then
setprop persist.sys.qcom-brightness -1
fi
# Xiaomi MiA3 uses OLED display which works best with this setting
if getprop ro.vendor.build.fingerprint | grep -iq \
-e iaomi/laurel_sprout;then
setprop persist.sys.qcom-brightness -1
fi
if getprop ro.vendor.build.fingerprint | grep -qi oneplus/oneplus6/oneplus6; then
resize2fs /dev/block/platform/soc/1d84000.ufshc/by-name/userdata
fi
@ -177,11 +189,12 @@ fi
if getprop ro.vendor.build.fingerprint | grep -q -i \
-e xiaomi/clover -e xiaomi/wayne -e xiaomi/sakura \
-e xiaomi/nitrogen -e xiaomi/whyred -e xiaomi/platina \
-e xiaomi/ysl -e nubia/nx60 -e nubia/nx61 -e xiaomi/tulip -e xiaomi/lavender; then
-e xiaomi/ysl -e nubia/nx60 -e nubia/nx61 -e xiaomi/tulip \
-e xiaomi/lavender -e xiaomi/olivelite -e xiaomi/pine -e Redmi/begonia; then
setprop persist.sys.qcom-brightness "$(cat /sys/class/leds/lcd-backlight/max_brightness)"
fi
if getprop ro.vendor.product.device |grep -iq -e RMX1801 -e RMX1803 -e RMX1807;then
if getprop ro.vendor.product.device |grep -iq -e RMX1801 -e RMX1803 -e RMX1807;then
setprop persist.sys.qcom-brightness "$(cat /sys/class/leds/lcd-backlight/max_brightness)"
fi
@ -191,7 +204,8 @@ if getprop ro.vendor.build.fingerprint | grep -iq \
-e motorola/ali/ali -e iaomi/perseus/perseus -e iaomi/platina/platina \
-e iaomi/equuleus/equuleus -e motorola/nora -e xiaomi/nitrogen \
-e motorola/hannah -e motorola/james -e motorola/pettyl -e iaomi/cepheus \
-e iaomi/grus -e xiaomi/cereus -e iaomi/raphael;then
-e iaomi/grus -e xiaomi/cereus -e iaomi/raphael -e iaomi/davinci \
-e iaomi/ginkgo -e iaomi/laurel_sprout -e iaomi/willow;then
mount -o bind /mnt/phh/empty_dir /vendor/lib64/soundfx
mount -o bind /mnt/phh/empty_dir /vendor/lib/soundfx
setprop ro.audio.ignore_effects true
@ -228,6 +242,12 @@ fi
for f in /vendor/lib/mtk-ril.so /vendor/lib64/mtk-ril.so /vendor/lib/libmtk-ril.so /vendor/lib64/libmtk-ril.so; do
[ ! -f $f ] && continue
setprop persist.sys.phh.radio.force_cognitive true
setprop persist.sys.radio.ussd.fix true
if getprop persist.sys.mtk.disable.incoming.fix | grep -q 1; then break; fi
# shellcheck disable=SC2010
ctxt="$(ls -lZ "$f" | grep -oE 'u:object_r:[^:]*:s0')"
b="$(echo "$f" | tr / _)"
@ -238,9 +258,6 @@ for f in /vendor/lib/mtk-ril.so /vendor/lib64/mtk-ril.so /vendor/lib/libmtk-ril.
"/mnt/phh/$b"
chcon "$ctxt" "/mnt/phh/$b"
mount -o bind "/mnt/phh/$b" "$f"
setprop persist.sys.phh.radio.force_cognitive true
setprop persist.sys.radio.ussd.fix true
done
mount -o bind /system/phh/empty /vendor/overlay/SysuiDarkTheme/SysuiDarkTheme.apk || true
@ -266,11 +283,15 @@ if busybox_phh unzip -p /vendor/app/ims/ims.apk classes.dex | grep -qF -e Landro
mount -o bind /system/phh/empty /vendor/app/ims/ims.apk
fi
if getprop ro.hardware | grep -qF samsungexynos; then
if getprop ro.hardware | grep -q -e exynos -e mt6771; then
setprop debug.sf.latch_unsignaled 1
fi
if getprop ro.product.model | grep -qF ANE; then
if getprop ro.product.model | grep -qF -e ANE; then
setprop debug.sf.latch_unsignaled 1
fi
if getprop ro.vendor.product.device | grep -q -e nora -e rhannah; then
setprop debug.sf.latch_unsignaled 1
fi
@ -321,7 +342,7 @@ if getprop ro.vendor.build.fingerprint | grep -qiE '^samsung'; then
fi
fi
if getprop ro.vendor.build.fingerprint | grep -qE '^xiaomi/(daisy|wayne)/(daisy|wayne).*'; then
if getprop ro.vendor.build.fingerprint | grep -qE '^xiaomi/wayne/wayne.*'; then
# Fix camera on DND, ugly workaround but meh
setprop audio.camerasound.force true
fi
@ -349,7 +370,7 @@ if [ -n "$(getprop ro.boot.product.hardware.sku)" ] && [ -z "$(getprop ro.hw.oem
fi
if getprop ro.vendor.build.fingerprint | grep -qiE '^samsung/' && [ "$vndk" -ge 28 ];then
setprop persist.sys.phh.samsung_fingerprint -1
setprop persist.sys.phh.samsung_fingerprint 0
#obviously broken perms
if [ "$(stat -c '%A' /sys/class/sec/tsp/ear_detect_enable)" == "-rw-rw-r--" ] &&
[ "$(stat -c '%U' /sys/class/sec/tsp/ear_detect_enable)" == "root" ] &&
@ -397,8 +418,8 @@ if [ -f /system/phh/secure ];then
copyprop ro.build.product ro.product.vendor.model
copyprop ro.product.manufacturer ro.vendor.product.manufacturer
copyprop ro.product.manufacturer ro.product.vendor.manufacturer
copyprop ro.build.version.security_patch ro.keymaster.xxx.security_patch
copyprop ro.build.version.security_patch ro.vendor.build.security_patch
copyprop ro.build.version.security_patch ro.keymaster.xxx.security_patch
resetprop ro.build.tags release-keys
resetprop ro.boot.vbmeta.device_state locked
resetprop ro.boot.verifiedbootstate green
@ -414,3 +435,38 @@ if [ -f /system/phh/secure ];then
resetprop ro.adb.secure 1
setprop ctl.restart adbd
fi
if getprop ro.boot.boot_devices |grep -v , |grep -qE .;then
ln -s /dev/block/platform/$(getprop ro.boot.boot_devices) /dev/block/bootdevice
fi
if [ -c /dev/dsm ];then
chown system:system /dev/dsm
chmod 0660 /dev/dsm
mkdir -p /data/sec_storage_data
chown system:system /data/sec_storage_data
chcon u:object_r:teecd_data_file_system:s0 /data/sec_storage_data
mount /data/sec_storage_data /sec_storage
fi
has_hostapd=false
for i in odm oem vendor product;do
if grep -qF android.hardware.wifi.hostapd /$i/etc/vintf/manifest.xml;then
has_hostapd=true
fi
done
if [ "$has_hostapd" = false ];then
setprop persist.sys.phh.system_hostapd true
fi
#Weird /odm/phone.prop Huawei stuff
HW_PRODID="$(sed -nE 's/.*productid=([0-9xa-f]*).*/\1/p' /proc/cmdline)"
[ -z "$HW_PRODID" ] && HW_PRODID="0x$(od -A none -t x1 /sys/firmware/devicetree/base/hisi,modem_id | sed s/' '//g)"
for part in odm vendor;do
if [ -f /$part/phone.prop ];then
if [ -n "$HW_PRODID" ];then
eval "$(awk 'BEGIN { a=0 }; /\[.*\].*/ { a=0 }; tolower($0) ~ /.*'"$HW_PRODID"'.*/ { a=1 }; /.*=.*/ { if(a == 1) print $0 }' /$part/phone.prop |sed -nE 's/(.*)=(.*)/setprop \1 "\2";/p')"
fi
fi
done

View File

@ -6,3 +6,6 @@
/system/bin/fsck\.exfat u:object_r:fsck_exec:s0
/system/bin/fsck\.ntfs u:object_r:fsck_exec:s0
/sec_storage(/.*)? u:object_r:teecd_data_file:s0
/dev/dsm u:object_r:dmd_device:s0

View File

@ -1 +1,11 @@
allow ueventd proc:file r_file_perms;
type teecd_data_file, file_type;
type dmd_device, file_type;
allow hal_fingerprint_server dmd_device:chr_file rw_file_perms;
allow hal_fingerprint_server sysfs:file rw_file_perms;
type oeminfo_nvm, domain;
type oeminfo_nvm_device, file_type;
allowxperm oeminfo_nvm oeminfo_nvm_device:blk_file ioctl { 0x1260 };
allow ueventd dmd_device:chr_file create_file_perms;

View File

@ -15,3 +15,6 @@ on property:sys.boot_completed=1
on property:persist.sys.phh.mainkeys=*
setprop qemu.hw.mainkeys ${persist.sys.phh.mainkeys}
on property:persist.sys.phh.xiaomi.dt2w=*
exec_background u:r:phhsu_daemon:s0 root -- /system/bin/phh-prop-handler.sh "persist.sys.phh.xiaomi.dt2w"