Compare commits

...

131 Commits

Author SHA1 Message Date
Damillora e067501cc5 Use tablet characteristics 2022-07-17 13:03:34 +07:00
Damillora 5e59ceff81 ouch 2022-07-17 13:01:43 +07:00
Damillora 9eefd61dcd add a bit more gapps 2022-07-17 13:01:43 +07:00
Damillora 16cb93485c switch wallpaper picker 2022-07-17 13:01:43 +07:00
Pierre-Hugues Husson bbc2268788 Enable DT2W on Tecno KD7 2022-07-07 12:13:57 -04:00
Pierre-Hugues HUSSON 6335412007
Merge pull request #317 from AndyCGYan/no-more-emulator-12
Overwrite the inherited "emulator" characteristics
2022-06-30 20:39:40 +02:00
Andy CrossGate Yan 88b1230dee Overwrite the inherited "emulator" characteristics 2022-06-30 13:41:53 +00:00
Pierre-Hugues HUSSON adad184263
Merge pull request #316 from ponces/android-12.0
Include vendor.xiaomi.hardware.displayfeature
2022-06-28 19:38:59 +02:00
Alberto Ponces d5610375c4 Include vendor.xiaomi.hardware.displayfeature
Needed to disable Xiaomi's Sunlight Mode which triggers some constrast/color issues on AOSP
2022-06-27 23:25:37 +01:00
Pierre-Hugues Husson b67b41a7e4 samsung - dt2w - Fix broken custom kernels sending KEY_POWER 2022-06-15 07:45:03 -04:00
Pierre-Hugues Husson a60d82afb0 Use standard Launcher3 rather than Launcher3Go on gapps-go variant 2022-06-15 07:45:03 -04:00
Pierre-Hugues HUSSON ceeeb076e3
Merge pull request #313 from Coxxs/patch-1
Add Netflix ID for Xiaomi Pad 5 Pro
2022-06-12 17:25:12 +02:00
Coxxs 1633ecfb93
Add Netflix ID for Xiaomi Pad 5 Pro 2022-06-12 23:18:32 +08:00
Pierre-Hugues HUSSON 85b2d3901f
Merge pull request #312 from haridhayal11/android-12.0
Fix fingerprint unlock delay
2022-06-09 20:26:33 +02:00
haridhayal11 2df56defaa Disable remote keyguard animation
Fixes slow post biometric auth screen wakeup.
2022-06-07 19:56:14 +05:30
Pierre-Hugues HUSSON cb0571e717
Merge pull request #311 from Kethen/android-12.0
allow deskclock to run in the background
2022-05-27 20:16:37 +02:00
Katharine Chui a08581af05 allow deskclock to run in the background
8dd096c4cf
2022-05-27 23:36:03 +08:00
Pierre-Hugues HUSSON e866a6a8cb
Merge pull request #310 from haridhayal11/android-12.0
Set persist.sys.phh.ultrasonic_udfps to true for S21(+/Ultra) (Exynos)
2022-05-25 09:24:04 +02:00
haridhayal11 63ba6b279c Set persist.sys.phh.ultrasonic_udfps to true for S21(+/Ultra) (Exynos) 2022-05-25 11:00:01 +05:30
Pierre-Hugues HUSSON 2d7f415cd1
Merge pull request #308 from AndyCGYan/logkit
Kill QCOM LogKit app
2022-05-17 12:08:03 +02:00
Andy CrossGate Yan 06fe9bb640 Kill QCOM LogKit app
Known to bootloop UMX U696CL, and is useless anyway

Change-Id: Ibc8ed1228e0c0b71825d889498f2b1b4ebd59fa6
2022-05-17 10:02:52 +00:00
Pierre-Hugues HUSSON abedbd4e09
Merge pull request #307 from Hakalle/android-12.0
a20s: Fix watchdog issue
2022-05-15 18:08:53 +02:00
Hakalle ca50009cbe
a20s: Fix watchdog issue
This commit fixes the Watchdog Timer Software problem by disabling it.

When the Watchdog Timer expires or crashes causes the device (in this case: Samsung Galaxy A20s) to reboot, and is fixed by just disabling it.

An example of kernel panic log:
[  115.680218] I[5:IntentService[D: 5621] Kernel panic - not syncing: Software Watchdog Timer expired
[  117.139710] I[5:IntentService[D: 5621] sec_debug_panic_handler :Software Watchdog Timer expired
[  117.141840] Causing a watchdog bite!

GSI used to test whether the problem has been fixed: https://sourceforge.net/projects/gsi-projects/files/v413/ArrowOS-12.1/ArrowOS-12.1-arm64_bgN-vndklite-Unofficial.img.xz/download
Screenshot: https://imgur.com/a/7eit2Le

Signed-off-by: Hakalle <hakalle@proton.me>
2022-05-15 12:51:26 -03:00
Pierre-Hugues Husson d815e2bd67 try harder to make system rw 2022-05-13 17:00:59 -04:00
Pierre-Hugues Husson 71f0000b6a For Redmi Note 10 5G, brightness range is 1-4095, even though /sys/.../brightness range is 1-2047 (/=2 done in lights HAL). So we need to manually set the range 2022-05-10 11:41:58 -04:00
Pierre-Hugues Husson 2f9ccbeab5 Include lightsctl-aidl in distrib 2022-05-09 17:37:15 -04:00
Pierre-Hugues Husson 90760ae5bd Exemplt treble app for suspension 2022-05-09 17:36:38 -04:00
Pierre-Hugues Husson be9a39aff4 Add lightsctl-aidl command to debug lights aidl hal 2022-05-04 12:43:33 -04:00
Pierre-Hugues HUSSON deaf416f56
Merge pull request #306 from rinmichi/android-12.0
Fix UI lags and Screen Cast on Redmi Note 10S
2022-05-03 08:46:09 +02:00
rinmichi 9a68ff5d63 Fix UI lags and Screen Cast on Redmi Note 10S 2022-05-03 12:51:58 +08:00
Pierre-Hugues HUSSON 91a71765eb
Merge pull request #305 from starfoxdot64/patch-1
Update rw-system.sh for Galaxy A11 watchdog quirk
2022-05-01 12:06:59 +02:00
Jay b4a09c8531
Update rw-system.sh for Galaxy A11 watchdog quirk
Fixes a panic 100 seconds into boot, caused by /dev/watchdog0 (/dev/watchdog1 was already accounted for). 
Works for the Samsung Galaxy A11, US model (SM-A115U1, a11que), so it's written to play it safe and apply only to the US vendor fingerprint.
2022-04-30 19:35:04 -07:00
Pierre-Hugues Husson 39d801473b [OTA] Retry stat-ing mapper device
See https://github.com/phhusson/treble_experimentations/issues/2289
2022-04-24 08:03:48 -04:00
Pierre-Hugues Husson 56295977db Additional sepolicy for OTA
See https://github.com/phhusson/treble_experimentations/issues/2289
2022-04-23 08:02:55 -04:00
Pierre-Hugues Husson d4520330a6 Add some samsung cmds 2022-04-23 08:02:55 -04:00
Pierre-Hugues HUSSON 817b1903e7
Merge pull request #304 from AndyCGYan/20220421
Revert "Disable ODM display overlay for OnePlus 10 Pro & Realme GT ME"
2022-04-21 17:54:34 +02:00
Andy CrossGate Yan 92b36d168f Revert "Disable ODM display overlay for OnePlus 10 Pro & Realme GT ME"
Change-Id: I53d804422ca853cff03958d398ada522ee388ce7
2022-04-21 14:51:47 +00:00
Pierre-Hugues HUSSON a0477a4836
Merge pull request #303 from ksdrar/android-12.0
[Motorola One Fusion+] Fix Assistant button
2022-04-18 16:52:06 +02:00
Jesús R eb74cd65ed
[Motorola One Fusion+] Fix Assistant button 2022-04-18 09:13:39 -05:00
Pierre-Hugues Husson 985778a03b Include AOSP a2dp sw config 2022-04-05 15:07:53 -04:00
Pierre-Hugues Husson 30985a7bef Add Samsung way to grab ro.telephony.default_network 2022-03-25 11:45:27 -04:00
Pierre-Hugues Husson d827035fd4 Add Samsung way to grab ro.telephony.default_network 2022-03-22 20:21:09 -04:00
Pierre-Hugues Husson 0048f513fd Change fingerprint manifest grep, because people are putting manifest anywhere 2022-03-21 19:02:59 -04:00
Pierre-Hugues Husson f85c88a1c7 Samsung now overrides recovery from vendor. We want to keep user's recovery 2022-03-21 18:47:09 -04:00
Victor Bo d192015aaf try to add support for RMX2195 2022-03-18 08:44:45 -04:00
Pierre-Hugues Husson 4c5d7dad33 Enable setupwizard (we keep the prop both in product and system, because gms adds it in system_ext and ordering might be inverted based on system/core patches) 2022-03-16 16:26:00 -04:00
Pierre-Hugues Husson 28f50a1557 Add again quickstep launcher, now that its fixed 2022-03-13 15:09:11 -04:00
Pierre-Hugues HUSSON 6c7bcae712
Merge pull request #302 from pjgowtham/patch-1
Update oplus fp manifest location for a12 vendor
2022-03-10 23:04:14 +01:00
pjgowtham 6ff9da18ad
Update oplus.hardware.biometrics.fingerprint manifest entry for android 12 vendors
https://dumps.tadiphone.dev/dumps/oplus/op516e/-/blob/qssi-user-12-SKQ1.211019.001-1646580650864-release-keys/odm/etc/vintf/manifest/manifest_oplus_fingerprint.xml
2022-03-10 10:44:19 +05:30
Pierre-Hugues Husson 791981193d Revert "[Q&D] Have FOD pressed Samsung touch even trigger WAKEUP. That is not exactly accurate, but good enough for the moment"
This reverts commit 44cdc6fa1a.

On S21 Ultra (because of broken screen?), key 455 is sent instanteously
after suspend. Also there is no fod_lp_mode command to disable it.
This leads to device never turning screen off
2022-03-08 12:31:39 -05:00
Pierre-Hugues Husson 7a017556af Hack: SearchLauncherQuickStep is broke in A12L. Disable it and use standard Quickstep instead 2022-03-08 05:13:47 -05:00
Pierre-Hugues Husson 44cdc6fa1a [Q&D] Have FOD pressed Samsung touch even trigger WAKEUP. That is not exactly accurate, but good enough for the moment 2022-03-04 10:10:05 -05:00
Pierre-Hugues Husson 9e8679d273 Fix Play Services crashing on Galaxy S21 Ultra
Samsung defines the presence of UWB framework in /vendor
This is wrong, because the UWB framework is hosted in /system
Which means that when booting a GSI, framework will say it has UWB
while it doesn't
2022-03-04 10:07:20 -05:00
Pierre-Hugues HUSSON 2818802996
Merge pull request #301 from ksdrar/android-12.0
[Motorola One Fusion+] Fix bluetooth audio
2022-03-04 15:54:02 +01:00
Jesús R af3ce8e62a
Add line after r_submix_audio_policy_configuration 2022-03-04 08:48:24 -06:00
Jesús R 95010d21fa
[Motorola One Fusion+] Fix bluetooth audio 2022-03-03 19:26:16 -06:00
Pierre-Hugues HUSSON 9b8c390698
Merge pull request #299 from CHIDILights/android-12.0
Disable fingerprint gestures for Stylo 7 4G variant
2022-02-28 20:52:43 +01:00
CHIDILights b37cfd9463 Disable fingerprint gestures for Stylo 7 4G variant 2022-02-28 00:12:32 +09:00
Pierre-Hugues HUSSON 62c5f674d5
Merge pull request #298 from ponces/dev-ota
Add prop to remove OTA files
2022-02-22 22:52:54 +01:00
Alberto Ponces 108d85334d Add prop to remove OTA files 2022-02-22 21:47:55 +00:00
Pierre-Hugues Husson 04cd1b8997 Give Sony shutter/focus on all Sony devices 2022-02-21 18:01:13 -05:00
Pierre-Hugues Husson c9638e910c Mark setupwizard as OPTIONAL. a64 target had it as DISABLED which we really dont want 2022-02-21 14:54:41 -05:00
Pierre-Hugues HUSSON 3d97cad8e0
Merge pull request #297 from ponces/dev-renoir
Overwrite media volume vendor values on Xiaomi Mi 11 Lite 5G
2022-02-21 15:04:12 +01:00
Alberto Ponces 9f28446abd Overwrite media volume vendor values on Xiaomi Mi 11 Lite 5G 2022-02-21 14:01:00 +00:00
Pierre-Hugues Husson 50903fde85 Disable fingerprint sensor input from Doogee S88 Pro
See https://github.com/phhusson/treble_experimentations/issues/2204
2022-02-21 05:27:55 -05:00
Pierre-Hugues Husson eb24d77380 Add MiPad5's Netflix L1 prop 2022-02-21 05:27:55 -05:00
Pierre-Hugues HUSSON 155fad8a06
Merge pull request #295 from AndyCGYan/fix-mona-hrr
Make high refresh rate show up for Xiaomi Civi
2022-02-19 16:06:28 +01:00
Andy CrossGate Yan 90e92a5655 Make high refresh rate show up for Xiaomi Civi
Some new Mi devices only reveal high refresh rate on `ro.product.manufacturer=Xiaomi`
Until the offending blob is pinpointed, fake the prop with copyprop
Feel free to experiment on other devices with similar symptom

Change-Id: I125cc55d6c3d57d7e62c65c997de086cca24abdd
2022-02-19 15:03:08 +00:00
Pierre-Hugues Husson 5874b86caf Fake MTK's ccci_rpcd props
On Mediatek devices, modem can request ro.product.device directly to
switch hardware configuration depending on the HW it is running on.

On AOSP GSI, if the ro.product.device is "generic", it'll switch to
ro.product.vendor.device, but not when it's "phhgsi.*".
Which leads to the device not loading the proper HW config, and failing
to modem altogether (notably on Redmi 9A)

To fix this, have ccci_rpcd report vendor props instead of system props
2022-02-19 09:29:46 -05:00
Quallenauge a4d6f5c8d3 Disable WPA3 by default (vendor overlays can still override it)
flo: wifi: Disable WPA2 -> WPA3 upgrade.

Our device doesn't simply support sae.

Change-Id: Ibf8b9e363b4677cf2ab9590cc2ea1ba2341e29ca
2022-02-10 05:16:41 -05:00
Pierre-Hugues HUSSON 6ec496b398
Merge pull request #294 from ponces/dev-renoir
Fix DT2W on Xiaomi Mi 11 Lite 5G by using xiaomi-touch
2022-02-09 22:09:37 +01:00
Alberto Ponces a66fa56752 Fix DT2W on Xiaomi Mi 11 Lite 5G by using xiaomi-touch
It may also fix for other Xiaomi devices
2022-02-09 21:07:02 +00:00
Pierre-Hugues Husson b962aa4bfd Rename our brand from "Phh" to "google", this helps bypass manual certification process 2022-02-08 18:21:53 -05:00
Pierre-Hugues Husson b3aad18611 Goodbye christmas animation. Put MY OTA json in my own specific file 2022-02-08 15:38:13 -05:00
Pierre-Hugues Husson 089c23d062 If vendor sets its own latch_unsignaled to 1, copy it on our side 2022-02-06 10:17:37 -05:00
Pierre-Hugues Husson e32ab4aff1 Add path to OTA infos 2022-02-05 16:46:22 -05:00
Pierre-Hugues Husson 329bbe82af [Moto One vision] Set eSCO size. See https://github.com/phhusson/treble_experimentations/issues/1939 2022-02-05 13:46:24 -05:00
Pierre-Hugues Husson 089dcc7bc0 WIP continue on ota 2022-02-01 19:22:27 -05:00
Pierre-Hugues Husson 59a5f1a447 Improve phh-ota, to be theorically usable without root 2022-01-31 16:12:35 -05:00
Pierre-Hugues HUSSON 617e2320fb
Merge pull request #293 from AndyCGYan/fix-op10pro-overlay
Disable ODM display overlay for OnePlus 10 Pro
2022-01-30 21:31:04 +01:00
Andy CrossGate Yan 5ae932aa76 Disable ODM display overlay for OnePlus 10 Pro
To whoever wrote these at OPlus - WTF?

Change-Id: Icd38941e86bf1e8ff743342507b5926708590ccf
2022-01-30 15:41:29 +00:00
Pierre-Hugues HUSSON 10a42e0e8c
Merge pull request #292 from ponces/renoir-dev
Remove Mi 11 Lite 5G (renoir) from the audio effects fix
2022-01-28 19:49:35 +01:00
Alberto Ponces f7060bda94 Remove Mi 11 Lite 5G (renoir) from the audio effects fix
This should be replaced by the sound volume fix on the Qualcomm page of the TrebleApp
2022-01-28 16:47:07 +00:00
Pierre-Hugues Husson 141780a2ac Upgrade ota.sh to use new my own ota mechanism 2022-01-22 14:36:55 -05:00
Pierre-Hugues HUSSON fdc8be8692
Merge pull request #291 from pessip/android-12.0
Add Netflix ID for Mi 11 lite 5G
2022-01-16 22:13:22 +01:00
Pessi Päivärinne 5dbc29cc18 Add Netflix ID for Mi 11 lite 5G
Add Netflix ID for Widevine L1 support in Netflix.
2022-01-16 21:22:06 +02:00
Pierre-Hugues HUSSON cef4fa61fd
Merge pull request #290 from ponces/android-12.0-smartpa_params
smartpa_params: Fix audio for Umidigi X and Gome U9
2021-12-29 22:14:36 +01:00
Alberto Ponces 95cdb160d5 smartpa_params: Fix audio for Umidigi X and Gome U9 2021-12-29 19:57:34 +00:00
Pierre-Hugues Husson 62216987bc Add xmas bootanim courtesy of @sepehrmoh81. `phh` rom variant 2021-12-22 15:24:58 -05:00
Pierre-Hugues Husson 230b6083b2 All devices support unprocessed audio source 2021-12-20 13:19:32 -05:00
Pierre-Hugues Husson 8c908a0f51 Upgrade selinux rights for oplus fingerprint access 2021-12-19 16:28:36 -05:00
Pierre-Hugues Husson 2a099c2c5a Update way to detect an Oplus device to set fod.bbk prop 2021-12-19 16:27:32 -05:00
Pierre-Hugues Husson 4b86b1ccb5 Be more flexible wrt when to fix Samsung backlight selinux context 2021-12-19 16:27:18 -05:00
Pierre-Hugues Husson bf333ce566 Fix headset buttons for Xiaomi Mi 11 Lite 5G 2021-12-18 07:40:03 -05:00
Pierre-Hugues HUSSON 63ef13a2f8
Merge pull request #289 from krapk/android-12.0
Disable FP gestures for Motorola One Fusion Plus
2021-12-09 23:03:12 +01:00
Jesús R 4babb2da95 Remove unnecessary if 2021-12-09 15:52:23 -06:00
Jesús R 9b9b7794e7 Disable FP gestures for Motorola One Fusion Plus 2021-12-09 13:32:53 -06:00
Pierre-Hugues HUSSON f96d4cb317
Merge pull request #288 from AndyCGYan/reverse-slider
Reverse slider
2021-12-09 17:41:42 +01:00
Andy CrossGate Yan fca972de6f Reverse oplus-alert-slider order
Change-Id: Ic968fa7a8822e133a6f56d28ef108a43edd9639c
2021-12-09 13:36:43 +00:00
Pierre-Hugues HUSSON 1e74ebda8d
Merge pull request #286 from ironydelerium/android-12.0
[Huawei P10] Extend the fingerprint for stopping aptouch
2021-12-08 20:20:02 +01:00
Sarah Vandomelen 8d11e629c4 [Huawei P10] Extend the fingerprint so that the stopping of 'aptouch' only applies to the P10. 2021-12-08 11:15:43 -08:00
Pierre-Hugues Husson 19533fb782 Typo, didnt mean to set latch_unsignaled to everyone 2021-12-08 13:38:12 -05:00
Pierre-Hugues Husson ee833b1d7d Fix speaker and touchscreen on Huawei P10 2021-12-08 13:36:39 -05:00
Pierre-Hugues Husson 3aad44c311 [oplus-alert-slider] Android AIDL moved, change the method id to change ringer mode 2021-12-07 05:56:11 -05:00
Pierre-Hugues HUSSON 723d9cb4f8
Merge pull request #285 from AndyCGYan/fix-fp-lgs75g
Disable FP gestures for LG Stylo 7 5G
2021-12-03 13:30:15 +01:00
Andy CrossGate Yan 826784b4ae Disable FP gestures for LG Stylo 7 5G
Change-Id: Ib1013963d41997e6ba5b6a645355beb8637d6f01
2021-12-03 12:26:36 +00:00
Pierre-Hugues HUSSON e9855ca82d
Merge pull request #284 from ponces/android-12.0-fix-distorted-audio
Disable soundvolume effect on Xiaomi Mi 11 Lite 5G
2021-12-02 22:53:13 +01:00
Alberto Ponces 66cc06b0a9 Disable soundvolume effect on Xiaomi Mi 11 Lite 5G
Fixes audio distorsion on this device and may fix on other Qualcomm devices
2021-12-02 21:45:07 +00:00
Pierre-Hugues HUSSON 06a00ae37c
Merge pull request #283 from AndyCGYan/fix-rmgtme-overlay
Disable ODM display overlay for Realme GT ME
2021-12-01 19:22:00 +01:00
Andy CrossGate Yan 7f627a4fe7 Disable ODM display overlay for Realme GT ME
Change-Id: Iba4c4d1e6e470593687285111efede3a93a8cfab
2021-12-01 18:18:10 +00:00
Pierre-Hugues Husson 2fa02fbf17 Launch oplus-alert-slider only once, there is no need to restart it, and it would end up restarting forever on non-oplus device 2021-11-26 10:39:53 -05:00
Pierre-Hugues Husson f179d6c320 Split lptools into vendor_lptools 2021-11-19 10:50:35 -05:00
Pierre-Hugues Husson b66b7aa968 Let treble app set ims props 2021-11-18 16:42:15 -05:00
Pierre-Hugues HUSSON 1aece75b52
Merge pull request #282 from Vgdn1942/android-12.0
Add keylayout and fix broken USB for Blackview BV9500Plus
2021-11-15 08:38:44 +01:00
vgdn1942 187b2ec484 Fix broken USB on Blackview BV9500Plus 2021-11-15 09:19:40 +03:00
vgdn1942 37373d808c Add keylayout for Blackview BV9500Plus 2021-11-15 09:00:07 +03:00
Pierre-Hugues Husson f2481fbc1d Upgrade securize for metadata + new no exec xbin
Use /metadata/phh/secure to store securize status
And if securized, remove apk and system/xbin
2021-11-03 17:43:25 -04:00
Pierre-Hugues Husson 09a83de001 Support multi-sim 2021-11-03 17:42:09 -04:00
Pierre-Hugues Husson 20171be647 Make a64 build on par with arm64 wrt disappearance of /dsp and /firmware 2021-11-02 03:25:09 -04:00
Pierre-Hugues Husson d6a1c9b772 Disable color management by default on non-12 vendors
Color management fixes flickering screen on mediatek devices

The comment in SurfaceFlinger.cpp says that color mangement was disabled
by default on Android <=11, so it's simply restoring old behavior
2021-10-28 14:28:18 -04:00
Pierre-Hugues Husson 9152974ac7 Allow rild access to more props. Help fix RIL on Pixel 1 2021-10-27 19:32:33 -04:00
Pierre-Hugues Husson 46d7d94e9f Allow more props reading from keymaster and gatekeeper 2021-10-27 14:38:43 -04:00
Pierre-Hugues Husson fc4969ac98 Keystore2 needs to call getpidcon 2021-10-20 09:55:33 -04:00
Pierre-Hugues Husson 1bb44a597e Merge keymaster into their group
This fixes issue of no-boot on Samsung Galaxy A71
which was caused by hal_keymaster_qti being typealias rather than type
2021-10-18 15:33:31 -04:00
Pierre-Hugues Husson c09b32e27b Include /persist sepolicy and /dsp and /firmware symlink on a64 build like generic_arm64 does 2021-10-15 13:01:10 -04:00
Pierre-Hugues Husson c21a8e5013 Don't create /persist => /mnt/vendor/persist symlink, some devices (Pixel 2) need it as a folder 2021-10-15 11:30:35 -04:00
Pierre-Hugues Husson 0ff308b3e7 Don't override keymaster key if we didnt extract a spl 2021-10-13 11:03:08 -04:00
Pierre-Hugues Husson 0050f8a5cd Force disable unflattened APEX
Android 12 - CAPEX relies on untested features of FS, and well, as one
could expect, it's broken.
Notably, it relies on O_DIRECT over FBE, which is an Android-specific
feature, and which is broken on a number of devices.
Notably, RedMagic 5G won't boot with CAPEX, blaming dm-verity issue on
apex

Thanks @c03d1 for the debug
2021-10-13 11:00:54 -04:00
Pierre-Hugues Husson 9e30f63a84 Fix build for Android 12 2021-10-13 11:00:32 -04:00
Pierre-Hugues Husson 6a1917d307 Keymaster need access to our ro.xxx properties 2021-10-13 10:48:35 -04:00
Pierre-Hugues Husson 6f2be782fb Ugly: mark `tkcore` as permissive. It requires accessing some props to boot 2021-10-07 17:35:05 -04:00
50 changed files with 847 additions and 452 deletions

37
base.mk
View File

@ -102,6 +102,7 @@ PRODUCT_PACKAGES += \
vendor.huawei.hardware.tp-V1.0-java \
vendor.qti.hardware.radio.am-V1.0-java \
vendor.qti.qcril.am-V1.0-java \
vendor.xiaomi.hardware.displayfeature-V1.0-java
PRODUCT_COPY_FILES += \
device/phh/treble/interfaces.xml:system/etc/permissions/interfaces.xml
@ -131,6 +132,9 @@ PRODUCT_COPY_FILES += \
device/phh/treble/files/zf6-goodixfp.kl:system/phh/zf6-goodixfp.kl \
device/phh/treble/files/zf6-googlekey_input.kl:system/phh/zf6-googlekey_input.kl \
device/phh/treble/files/teracube2e-mtk-kpd.kl:system/phh/teracube2e-mtk-kpd.kl \
device/phh/treble/files/bv9500plus-mtk-kpd.kl:system/phh/bv9500plus-mtk-kpd.kl \
device/phh/treble/files/moto-liber-gpio-keys.kl:system/phh/moto-liber-gpio-keys.kl \
device/phh/treble/files/tecno-touchpanel.kl:system/phh/tecno-touchpanel.kl \
SELINUX_IGNORE_NEVERALLOWS := true
@ -140,6 +144,7 @@ PRODUCT_PACKAGES += \
PRODUCT_PACKAGES += \
lightsctl \
lightsctl-aidl \
uevent
PRODUCT_COPY_FILES += \
@ -198,10 +203,42 @@ PRODUCT_PACKAGES += \
PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
debug.fdsan=warn_once \
ro.apex.updatable=false \
persist.sys.fflag.override.settings_provider_model=false \
ro.setupwizard.mode=OPTIONAL \
PRODUCT_PRODUCT_PROPERTIES += \
ro.setupwizard.mode=OPTIONAL \
# AOSP overlays
PRODUCT_PACKAGES += \
NavigationBarMode2ButtonOverlay
# ThemePicker
PRODUCT_PACKAGES += \
ThemePicker
PRODUCT_PACKAGES += \
oplus-alert-slider
PRODUCT_COPY_FILES += \
device/phh/treble/empty:system/etc/smartpa_params/empty \
device/phh/treble/proprietary-files/gome/fs16xx_01s_left.preset:system/phh/gome/fs16xx_01s_left.preset \
device/phh/treble/proprietary-files/gome/fs16xx_01s_mono.preset:system/phh/gome/fs16xx_01s_mono.preset \
device/phh/treble/proprietary-files/gome/fs16xx_01s_right.preset:system/phh/gome/fs16xx_01s_right.preset \
device/phh/treble/proprietary-files/umidigi/fs16xx_01s_mono.preset:system/phh/umidigi/fs16xx_01s_mono.preset
PRODUCT_PACKAGES += phh-ota
PRODUCT_PACKAGES += \
xiaomi-touch
PRODUCT_COPY_FILES += \
frameworks/av/services/audiopolicy/config/a2dp_audio_policy_configuration_7_0.xml:system/etc/a2dp_audio_policy_configuration_7_0.xml \
frameworks/av/services/audiopolicy/config/a2dp_audio_policy_configuration.xml:system/etc/a2dp_audio_policy_configuration.xml \
include build/make/target/product/gsi_release.mk
# Protect deskclock from power save
PRODUCT_COPY_FILES += \
device/phh/treble/files/com.android.deskclock_whitelist.xml:system/etc/sysconfig/com.android.deskclock_whitelist.xml

View File

@ -3,4 +3,7 @@ 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 += bt_firmware sec_storage efs
BOARD_ROOT_EXTRA_FOLDERS += bt_firmware sec_storage efs persist
BUILD_BROKEN_ELF_PREBUILT_PRODUCT_COPY_FILES := true
BOARD_ROOT_EXTRA_SYMLINKS := $(filter-out $(BOARD_ROOT_EXTRA_SYMLINKS),/mnt/vendor/persist:/persist)

BIN
bootanimation.zip Normal file

Binary file not shown.

View File

@ -183,71 +183,13 @@ cc_binary {
],
}
cc_binary {
name: "lptools",
cflags: [
"-Werror",
"-Wextra",
],
device_supported: true,
shared_libs: [
"libbase",
"liblog",
"liblp",
"libsparse",
"libfs_mgr",
"libutils",
"libcutils",
"android.hardware.boot@1.1",
"libhidlbase",
],
static_libs: [
"libdm",
],
srcs: [
"lptools.cc",
],
cppflags: [
"-D_FILE_OFFSET_BITS=64",
],
}
cc_binary {
name: "lptools_static",
cflags: [
"-Werror",
"-Wextra",
"-DLPTOOLS_STATIC",
],
device_supported: true,
shared_libs: [
"libcrypto",
],
static_libs: [
"libbase",
"liblog",
"liblp",
"libsparse",
"libfs_mgr",
"libutils",
"libcutils",
"libdm",
"libext4_utils",
],
srcs: [
"lptools.cc",
],
cppflags: [
"-D_FILE_OFFSET_BITS=64",
],
}
cc_binary {
name: "sec-camera-list",
srcs: [
"sec-camera-list.cpp",
],
shared_libs: [
"vendor.samsung.hardware.camera.provider@4.0",
"vendor.samsung.hardware.camera.provider@3.0",
"libutils",
"libhidlbase",
@ -263,3 +205,52 @@ cc_binary {
"oplus-alert-slider.rc",
],
}
cc_binary {
name: "xiaomi-touch",
srcs: [
"xiaomi-touch.cpp",
],
}
cc_binary {
name: "sec-ril",
srcs: [
"sec-ril.cpp",
],
shared_libs: [
"android.hardware.radio@1.6",
"vendor.samsung.hardware.radio@2.0",
"vendor.samsung.hardware.radio@2.1",
"vendor.samsung.hardware.radio@2.2",
"libutils",
"libhidlbase",
],
}
cc_binary {
name: "sec-torch",
srcs: [
"sec-torch.cpp",
],
shared_libs: [
"vendor.samsung.hardware.camera.provider@4.0",
"vendor.samsung.hardware.camera.provider@3.0",
"vendor.samsung.hardware.camera.device@5.0",
"libutils",
"libhidlbase",
],
}
cc_binary {
name: "lightsctl-aidl",
srcs: [
"lightsctl-aidl.cpp",
],
shared_libs: [
"android.hardware.light-V1-cpp",
"libutils",
"libhidlbase",
"libbinder",
],
}

View File

@ -3,6 +3,7 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
typedef struct {
int dir;
@ -27,4 +28,5 @@ int main(int argc, char **argv) {
cfg.speed = 4;
ioctl(fd, ASUS_MOTOR_DRV_MANUAL_MODE, &cfg);
close(fd);
}

71
cmds/lightsctl-aidl.cpp Normal file
View File

@ -0,0 +1,71 @@
#include <iostream>
#include <android/hardware/light/ILights.h>
#include <binder/IServiceManager.h>
using ::android::hardware::light::ILights;
using ::android::sp;
int main(int argc, char **argv) {
auto svc = android::waitForVintfService<ILights>();
std::vector<android::hardware::light::HwLight> lights;
svc->getLights(&lights);
for(const auto& l : lights) {
std::cout << "Got light " << l.id << std::endl;
std::cout << " " << l.ordinal << std::endl;
std::cout << " " << toString(l.type) << std::endl;
}
if(argc <= 1) return 0;
if(argc != 3 && argc != 6) return 1;
std::string typeArg(argv[1]);
android::hardware::light::LightType type;
if(typeArg == "BACKLIGHT")
type = android::hardware::light::LightType::BACKLIGHT;
if(typeArg == "KEYBOARD")
type = android::hardware::light::LightType::KEYBOARD;
if(typeArg == "BUTTONS")
type = android::hardware::light::LightType::BUTTONS;
if(typeArg == "BATTERY")
type = android::hardware::light::LightType::BATTERY;
if(typeArg == "NOTIFICATIONS")
type = android::hardware::light::LightType::NOTIFICATIONS;
if(typeArg == "ATTENTION")
type = android::hardware::light::LightType::ATTENTION;
if(typeArg == "BLUETOOTH")
type = android::hardware::light::LightType::BLUETOOTH;
if(typeArg == "WIFI")
type = android::hardware::light::LightType::WIFI;
std::cout << "Set request type " << toString(type) << std::endl;
int lightId = -1;
for(const auto& l : lights) {
if(l.type == type) {
lightId = l.id;
std::cout << "Got matching light " << l.id << std::endl;
std::cout << " " << l.ordinal << std::endl;
std::cout << " " << toString(l.type) << std::endl;
}
}
android::hardware::light::HwLightState state;
state.color = (uint32_t)strtoll(argv[2], NULL, 16);
state.flashMode = android::hardware::light::FlashMode::NONE;
state.brightnessMode = android::hardware::light::BrightnessMode::USER;
if(argc == 6) {
std::string flashArg(argv[3]);
if(flashArg == "NONE")
state.flashMode = android::hardware::light::FlashMode::NONE;
if(flashArg == "TIMED")
state.flashMode = android::hardware::light::FlashMode::TIMED;
if(flashArg == "HARDWARE")
state.flashMode = android::hardware::light::FlashMode::HARDWARE;
state.flashOnMs = atoi(argv[4]);
state.flashOffMs = atoi(argv[5]);
}
std::cout << "Set flash type to " << toString(state.flashMode) << std::endl;
auto ret = svc->setLightState(lightId, state);
std::cout << "Set light returned " << ret << std::endl;
}

View File

@ -1,309 +0,0 @@
/*
* Copyright (C) 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <getopt.h>
#include <inttypes.h>
#include <sys/mount.h>
#include <sys/stat.h>
#include <sys/statvfs.h>
#include <sys/types.h>
#include <sysexits.h>
#include <unistd.h>
#include <iostream>
#include <optional>
#include <regex>
#include <string>
#include <vector>
#include <chrono>
#include <android-base/parseint.h>
#include <android-base/properties.h>
#include <android-base/strings.h>
#include <cutils/android_get_control_file.h>
#include <fs_mgr.h>
#include <liblp/builder.h>
#include <liblp/liblp.h>
#include <fs_mgr_dm_linear.h>
#include <libdm/dm.h>
#ifndef LPTOOLS_STATIC
#include <android/hardware/boot/1.1/IBootControl.h>
#include <android/hardware/boot/1.1/types.h>
#endif
using namespace android;
using namespace android::fs_mgr;
class FileOrBlockDeviceOpener final : public PartitionOpener {
public:
android::base::unique_fd Open(const std::string& path, int flags) const override {
// Try a local file first.
android::base::unique_fd fd;
#ifdef __ANDROID__
fd.reset(android_get_control_file(path.c_str()));
if (fd >= 0) return fd;
#endif
fd.reset(open(path.c_str(), flags));
if (fd >= 0) return fd;
return PartitionOpener::Open(path, flags);
}
};
static FileOrBlockDeviceOpener opener;
std::unique_ptr<MetadataBuilder> makeBuilder() {
auto builder = MetadataBuilder::New(opener, "super", 0);
if(builder == nullptr) {
std::cout << "Failed creating super builder" << std::endl;
}
return builder;
}
void saveToDisk(std::unique_ptr<MetadataBuilder> builder) {
auto newMetadata = builder->Export();
int nSlots = 2;//pt->geometry.metadata_slot_count;
for(int slot=0; slot < nSlots; slot++) {
std::cout << "Saving the updated partition table " << UpdatePartitionTable(opener, "super", *newMetadata, slot) << " for slot " << slot << std::endl;
}
}
inline bool ends_with(std::string const & value, std::string const & ending)
{
if (ending.size() > value.size()) return false;
return std::equal(ending.rbegin(), ending.rend(), value.rbegin());
}
std::string findGroup(std::unique_ptr<MetadataBuilder>& builder) {
auto groups = builder->ListGroups();
auto partitionName = "system" + ::android::base::GetProperty("ro.boot.slot_suffix", "");
for(auto groupName: groups) {
auto partitions = builder->ListPartitionsInGroup(groupName);
for (const auto& partition : partitions) {
if(partition->name() == partitionName) {
return groupName;
}
}
}
std::string maxGroup = "";
uint64_t maxGroupSize = 0;
for(auto groupName: groups) {
auto group = builder->FindGroup(groupName);
if(group->maximum_size() > maxGroupSize) {
maxGroup = groupName;
maxGroupSize = group->maximum_size();
}
}
return maxGroup;
}
int main(int argc, char **argv) {
if(argc<=1) {
std::cerr << "Usage: " << argv[0] << " <create|remove|resize|rename>" << std::endl;
exit(1);
}
auto builder = makeBuilder();
auto group = findGroup(builder);
std::cout << "Best group seems to be " << group << std::endl;
if(strcmp(argv[1], "create") == 0) {
if(argc != 4) {
std::cerr << "Usage: " << argv[0] << " create <partition name> <partition size>" << std::endl;
exit(1);
}
auto partName = argv[2];
auto size = strtoll(argv[3], NULL, 0);
auto partition = builder->FindPartition(partName);
if(partition != nullptr) {
std::cerr << "Partition " << partName << " already exists." << std::endl;
exit(1);
}
partition = builder->AddPartition(partName, group, 0);
auto result = builder->ResizePartition(partition, size);
std::cout << "Growing partition " << result << std::endl;
if(!result) return 1;
saveToDisk(std::move(builder));
std::string dmPath;
CreateLogicalPartitionParams params {
.block_device = "/dev/block/by-name/super",
.metadata_slot = 0,
.partition_name = partName,
.timeout_ms = std::chrono::milliseconds(10000),
.force_writable = true,
};
auto dmCreateRes = android::fs_mgr::CreateLogicalPartition(params, &dmPath);
std::cout << "Creating dm partition for " << partName << " answered " << dmCreateRes << " at " << dmPath << std::endl;
exit(0);
} else if(strcmp(argv[1], "remove") == 0) {
if(argc != 3) {
std::cerr << "Usage: " << argv[0] << " remove <partition name>" << std::endl;
exit(1);
}
auto partName = argv[2];
auto dmState = android::dm::DeviceMapper::Instance().GetState(partName);
if(dmState == android::dm::DmDeviceState::ACTIVE) {
android::fs_mgr::DestroyLogicalPartition(partName);
}
builder->RemovePartition(partName);
saveToDisk(std::move(builder));
exit(0);
} else if(strcmp(argv[1], "resize") == 0) {
if(argc != 4) {
std::cerr << "Usage: " << argv[0] << " resize <partition name> <newsize>" << std::endl;
exit(1);
}
auto partName = argv[2];
auto size = strtoll(argv[3], NULL, 0);
auto partition = builder->FindPartition(partName);
std::cout << "Resizing partition " << builder->ResizePartition(partition, size) << std::endl;
saveToDisk(std::move(builder));
exit(0);
} else if(strcmp(argv[1], "replace") == 0) {
if(argc != 4) {
std::cerr << "Usage: " << argv[0] << " replace <original partition name> <new partition name>" << std::endl;
std::cerr << "This will delete <new partition name> and rename <original partition name> to <new partition name>" << std::endl;
exit(1);
}
auto src = argv[2];
auto dst = argv[3];
auto srcPartition = builder->FindPartition(src);
if(srcPartition == nullptr) {
srcPartition = builder->FindPartition(src + ::android::base::GetProperty("ro.boot.slot_suffix", ""));
}
auto dstPartition = builder->FindPartition(dst);
if(dstPartition == nullptr) {
dstPartition = builder->FindPartition(dst + ::android::base::GetProperty("ro.boot.slot_suffix", ""));
}
std::string dstPartitionName = dst;
if(dstPartition != nullptr) {
dstPartitionName = dstPartition->name();
}
std::vector<std::unique_ptr<Extent>> originalExtents;
const auto& extents = srcPartition->extents();
for(unsigned i=0; i<extents.size(); i++) {
const auto& extend = extents[i];
auto linear = extend->AsLinearExtent();
if(linear != nullptr) {
auto copyLinear = std::make_unique<LinearExtent>(linear->num_sectors(), linear->device_index(), linear->physical_sector());
originalExtents.push_back(std::move(copyLinear));
} else {
auto copyZero = std::make_unique<ZeroExtent>(extend->num_sectors());
originalExtents.push_back(std::move(copyZero));
}
}
builder->RemovePartition(srcPartition->name());
builder->RemovePartition(dstPartitionName);
auto newDstPartition = builder->AddPartition(dstPartitionName, group, 0);
for(auto&& extent: originalExtents) {
newDstPartition->AddExtent(std::move(extent));
}
saveToDisk(std::move(builder));
exit(0);
} else if(strcmp(argv[1], "map") == 0) {
if(argc != 3) {
std::cerr << "Usage: " << argv[0] << " map <partition name>" << std::endl;
exit(1);
}
auto partName = argv[2];
std::string dmPath;
CreateLogicalPartitionParams params {
.block_device = "/dev/block/by-name/super",
.metadata_slot = 0,
.partition_name = partName,
.timeout_ms = std::chrono::milliseconds(10000),
.force_writable = true,
};
auto dmCreateRes = android::fs_mgr::CreateLogicalPartition(params, &dmPath);
std::cout << "Creating dm partition for " << partName << " answered " << dmCreateRes << " at " << dmPath << std::endl;
exit(0);
} else if(strcmp(argv[1], "unmap") == 0) {
if(argc != 3) {
std::cerr << "Usage: " << argv[0] << " unmap <partition name>" << std::endl;
exit(1);
}
auto partName = argv[2];
auto dmState = android::dm::DeviceMapper::Instance().GetState(partName);
if(dmState == android::dm::DmDeviceState::ACTIVE) {
android::fs_mgr::DestroyLogicalPartition(partName);
}
exit(0);
} else if(strcmp(argv[1], "free") == 0) {
if(argc != 2) {
std::cerr << "Usage: " << argv[0] << " free" << std::endl;
exit(1);
}
auto groupO = builder->FindGroup(group);
uint64_t maxSize = groupO->maximum_size();
uint64_t total = 0;
auto partitions = builder->ListPartitionsInGroup(group);
for (const auto& partition : partitions) {
total += partition->BytesOnDisk();
}
uint64_t groupAllocatable = maxSize - total;
uint64_t superFreeSpace = builder->AllocatableSpace() - builder->UsedSpace();
if(groupAllocatable > superFreeSpace || maxSize == 0)
groupAllocatable = superFreeSpace;
printf("Free space: %" PRIu64 "\n", groupAllocatable);
exit(0);
} else if(strcmp(argv[1], "unlimited-group") == 0) {
builder->ChangeGroupSize(group, 0);
saveToDisk(std::move(builder));
return 0;
} else if(strcmp(argv[1], "clear-cow") == 0) {
#ifndef LPTOOLS_STATIC
// Ensure this is a V AB device, and that no merging is taking place (merging? in gsi? uh)
auto svc1_1 = ::android::hardware::boot::V1_1::IBootControl::tryGetService();
if(svc1_1 == nullptr) {
std::cerr << "Couldn't get a bootcontrol HAL. You can clear cow only on V AB devices" << std::endl;
return 1;
}
auto mergeStatus = svc1_1->getSnapshotMergeStatus();
if(mergeStatus != ::android::hardware::boot::V1_1::MergeStatus::NONE) {
std::cerr << "Merge status is NOT none, meaning a merge is pending. Clearing COW isn't safe" << std::endl;
return 1;
}
#endif
uint64_t superFreeSpace = builder->AllocatableSpace() - builder->UsedSpace();
std::cerr << "Super allocatable " << superFreeSpace << std::endl;
uint64_t total = 0;
auto partitions = builder->ListPartitionsInGroup("cow");
for (const auto& partition : partitions) {
std::cout << "Deleting partition? " << partition->name() << std::endl;
if(ends_with(partition->name(), "-cow")) {
std::cout << "Deleting partition " << partition->name() << std::endl;
builder->RemovePartition(partition->name());
}
}
saveToDisk(std::move(builder));
return 0;
}
return 0;
}

View File

@ -44,11 +44,11 @@ int main() {
}
printf("State %d\n", read_tristate());
if(state == 1) {
system("service call audio 31 i32 2 s16 android");
system("service call audio 32 i32 0 s16 android");
} else if(state == 2) {
system("service call audio 31 i32 1 s16 android");
system("service call audio 32 i32 1 s16 android");
} else if(state == 3) {
system("service call audio 31 i32 0 s16 android");
system("service call audio 32 i32 2 s16 android");
}
}
}

View File

@ -1,3 +1,4 @@
service phhoplus-alert-slider /system/bin/oplus-alert-slider
seclabel u:r:phhsu_daemon:s0
oneshot
class main

View File

@ -1,7 +1,7 @@
#include <iostream>
#include <vendor/samsung/hardware/camera/provider/3.0/ISehCameraProvider.h>
#include <vendor/samsung/hardware/camera/provider/4.0/ISehCameraProvider.h>
using ::vendor::samsung::hardware::camera::provider::V3_0::ISehCameraProvider;
using ::vendor::samsung::hardware::camera::provider::V4_0::ISehCameraProvider;
using ::android::sp;
int main(int argc, char **argv) {

37
cmds/sec-ril.cpp Normal file
View File

@ -0,0 +1,37 @@
#include <iostream>
#include <stdint.h>
#include <vector>
#include <vendor/samsung/hardware/radio/2.2/ISehRadio.h>
#include <android/hardware/radio/1.6/IRadio.h>
using ::vendor::samsung::hardware::radio::V2_2::ISehRadio;
using ::android::hardware::radio::V1_6::IRadio;
using ::android::sp;
int main(int argc, char **argv) {
auto svc = ISehRadio::getService(argv[1]);
//setNrMode
#if 0
android::hardware::hidl_vec<uint8_t> cmd = {
2, 131, 0, 5, (uint8_t)atoi(argv[2]),
};
svc->sendRequestRaw(5556, cmd);
svc->setNrMode(5555, atoi(argv[1]));
#endif
#if 0
//notifyRilConnected
android::hardware::hidl_vec<uint8_t> cmd = {
11,24,0,5,0,
};
svc->sendRequestRaw(5556, cmd);
#endif
svc->setNrMode_2_2(5555, atoi(argv[2]), true);
#if 0
auto svcRadio = IRadio::getService(argv[1]);
svcRadio->setAllowedNetworkTypesBitmap(4444, 0x1bfffe);
svcRadio->setPreferredNetworkTypeBitmap(4443, 0x1bfffe);
#endif
}

37
cmds/sec-torch.cpp Normal file
View File

@ -0,0 +1,37 @@
#include <iostream>
#include <vendor/samsung/hardware/camera/provider/4.0/ISehCameraProvider.h>
#include <vendor/samsung/hardware/camera/device/5.0/ISehCameraDevice.h>
using ::vendor::samsung::hardware::camera::provider::V4_0::ISehCameraProvider;
using ::android::sp;
int main(int argc, char **argv) {
auto svc = ISehCameraProvider::getService("legacy/0");
android::hardware::camera::common::V1_0::Status status;
android::sp<android::hardware::camera::device::V3_2::ICameraDevice> camera_old;
android::hardware::Return<void> ret = svc->getCameraDeviceInterface_V3_x(argv[3], [&status, &camera_old](android::hardware::camera::common::V1_0::Status s, android::sp<android::hardware::camera::device::V3_2::ICameraDevice> intf) {
status = s;
if(intf == nullptr) {
fprintf(stderr, "Failed getting camera intf\n");
}
camera_old = intf;
});
if(!ret.isOk())
fprintf(stderr, "Failed getting camera 0\n");
auto cameraResult = vendor::samsung::hardware::camera::device::V5_0::ISehCameraDevice::castFrom(camera_old);
android::sp<vendor::samsung::hardware::camera::device::V5_0::ISehCameraDevice> camera = cameraResult;
if(camera == nullptr) {
fprintf(stderr, "Coulnd't get sammy device\n");
}
if(camera != nullptr) {
fprintf(stderr, "Got sammy camera device\n");
if(strcmp(argv[1], "on") == 0) {
fprintf(stderr, "Truning torch mode on power %d\n", atoi(argv[2]));
camera->sehSetTorchModeStrength(android::hardware::camera::common::V1_0::TorchMode::ON, atoi(argv[2]));
} else {
camera->sehSetTorchModeStrength(android::hardware::camera::common::V1_0::TorchMode::OFF, 0);
}
}
}

48
cmds/xiaomi-touch.cpp Normal file
View File

@ -0,0 +1,48 @@
#include <iostream>
#include <unistd.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#define SET_CUR_VALUE 0
#define Touch_Game_Mode 0
#define Touch_Active_MODE 1
#define Touch_UP_THRESHOLD 2
#define Touch_Tolerance 3
#define Touch_Aim_Sensitivity 4
#define Touch_Tap_Stability 5
#define Touch_Expert_Mode 6
#define Touch_Edge_Filter 7
#define Touch_Panel_Orientation 8
#define Touch_Report_Rate 9
#define Touch_Fod_Enable 10
#define Touch_Aod_Enable 11
#define Touch_Resist_RF 12
#define Touch_Idle_Time 13
#define Touch_Doubletap_Mode 14
#define Touch_Grip_Mode 15
#define Touch_FodIcon_Enable 16
#define Touch_Nonui_Mode 17
#define Touch_Debug_Level 18
#define Touch_Power_Status 19
#define Touch_Mode_NUM 20
#define TOUCH_DEV_PATH "/dev/xiaomi-touch"
#define TOUCH_ID 0
#define TOUCH_MAGIC 0x5400
#define TOUCH_IOC_SETMODE TOUCH_MAGIC + SET_CUR_VALUE
int main(int argc, char **argv) {
if(argc != 3) {
fprintf(stderr, "Usage: %s <mode> <0|1>\n", argv[0]);
return -1;
}
int mode = atoi(argv[1]);
int enabled = atoi(argv[2]);
if (mode < 0 || mode > 20) return -1;
if (enabled != 0 && enabled != 1) return -1;
int fd = open(TOUCH_DEV_PATH, O_RDWR);
int arg[3] = {TOUCH_ID, mode, enabled};
ioctl(fd, TOUCH_IOC_SETMODE, &arg);
close(fd);
}

View File

@ -0,0 +1,5 @@
key 114 VOLUME_DOWN
key 115 VOLUME_UP
key 116 POWER
key 249 ASSIST
key 250 CAMERA

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2019-2020 The LineageOS Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<config>
<allow-in-power-save package="com.android.deskclock" />
</config>

View File

@ -0,0 +1,33 @@
# Copyright (c) 2013, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of The Linux Foundation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
key 115 VOLUME_UP
key 114 VOLUME_DOWN
key 102 HOME
key 217 ASSIST
key 528 FOCUS
key 766 CAMERA

View File

@ -1,6 +1,6 @@
#!/system/bin/sh
set -e
set -ex
if ! [ "$(getprop ro.boot.dynamic_partitions)" = true ];then
echo "OTA is supported only for devices with dynamic partitions!"
@ -8,21 +8,24 @@ if ! [ "$(getprop ro.boot.dynamic_partitions)" = true ];then
fi
flavor=$(getprop ro.product.product.name)
nextVersion=$(curl --silent -L https://raw.githubusercontent.com/phhusson/treble_experimentations/master/ota/roar/$flavor/date)
if [ -f /system/phh/secure ];then
flavor=${flavor}-secure
fi
nextVersion=$(curl --silent -L https://raw.githubusercontent.com/phhusson/treble_experimentations/master/ota/squeak/$flavor/date)
if [ -z "$nextVersion" ];then
echo "Couldn't find any OTA for $flavor"
exit 1
fi
url=$(curl --silent -L https://raw.githubusercontent.com/phhusson/treble_experimentations/master/ota/roar/$flavor/url)
size=$(curl --silent -L https://raw.githubusercontent.com/phhusson/treble_experimentations/master/ota/roar/$flavor/size)
url=$(curl --silent -L https://raw.githubusercontent.com/phhusson/treble_experimentations/master/ota/squeak/$flavor/url)
size=$(curl --silent -L https://raw.githubusercontent.com/phhusson/treble_experimentations/master/ota/squeak/$flavor/size)
if [ "$(getprop ro.product.build.date.utc)" = "$nextVersion" ];then
echo "Installing $nextVersion onto itself, aborting"
exit 1
fi
if ! curl --silent -L https://raw.githubusercontent.com/phhusson/treble_experimentations/master/ota/roar/$flavor/known_releases |grep -q $(getprop ro.product.build.date.utc);then
if ! curl --silent -L https://raw.githubusercontent.com/phhusson/treble_experimentations/master/ota/squeak/$flavor/known_releases |grep -q $(getprop ro.product.build.date.utc);then
echo "Warning! The build you are currently running is unknown. Type YES to confirm you want to apply OTA from $url"
read answer
if ! [ "$answer" = YES ];then
@ -39,34 +42,11 @@ if [ -b /dev/tmp-phh ] && ! tune2fs -l /dev/tmp-phh |grep 'Last mount time' |gr
fi
fi
lptools remove system_phh
free=$(lptools free |grep -oE '[0-9]+$')
if [ "$free" -le "$size" ];then
echo "Warning! There doesn't seem to be enough space on super partition."
echo "Do you want me to try to make more space? Type YES"
read answer
if ! [ "$answer" = YES ];then
exit 1
fi
lptools clear-cow || true
lptools unlimited-group || true
lptools remove product || true
lptools remove product$(getprop ro.boot.slot_suffix) || true
free=$(lptools free |grep -oE '[0-9]+$')
if [ "$free" -le "$size" ];then
echo "Sorry, there is still not enough space available. OTA requires $size, you have $free available"
exit 1
fi
fi
lptools create system_phh "$size"
lptools unmap system_phh
dmDevice=$(lptools map system_phh|grep -oE '/dev/block/[^ ]*')
echo "Flashing from ${url}..."
curl -L "$url" | busybox_phh xz -d -c | simg2img_simple > $dmDevice
dmDevice=$(phh-ota new-slot)
curl -L "$url" | busybox_phh xz -d -c > $dmDevice
phh-ota switch-slot
lptools replace system_phh system
reboot
exit 0

View File

@ -27,4 +27,5 @@
key 143 WAKEUP
key 172 WAKEUP
key 116 WAKEUP

View File

@ -0,0 +1 @@
key 183 WAKEUP

View File

@ -14,6 +14,9 @@ PRODUCT_COPY_FILES := $(call FILTER_OUT,google_go.xml:, $(PRODUCT_COPY_FILES))
PRODUCT_PACKAGES := $(filter-out CalendarGoogle, $(PRODUCT_PACKAGES))
PRODUCT_PACKAGES := $(filter-out GoogleContacts, $(PRODUCT_PACKAGES))
#Launcher3Go has no recents support...?
PRODUCT_PACKAGES := $(filter-out Launcher3Go, $(PRODUCT_PACKAGES))
PRODUCT_SHIPPING_API_LEVEL :=
PRODUCT_PACKAGES += \

View File

@ -4,14 +4,15 @@ ifneq ($(wildcard vendor/google)$(wildcard vendor/partner_gms),)
-include vendor/partner_gms/products/gms.mk
PRODUCT_SHIPPING_API_LEVEL :=
PRODUCT_PACKAGES := $(filter-out CalendarGoogle, $(PRODUCT_PACKAGES))
PRODUCT_PACKAGES := $(filter-out GoogleContacts, $(PRODUCT_PACKAGES))
#PRODUCT_PACKAGES := $(filter-out CalendarGoogle, $(PRODUCT_PACKAGES))
#PRODUCT_PACKAGES := $(filter-out GoogleContacts, $(PRODUCT_PACKAGES))
PRODUCT_PACKAGES += \
phh-gapps-overrides \
Chrome \
GoogleContactsSyncAdapter \
talkback \
Photos \
PRODUCT_SYSTEM_DEFAULT_PROPERTIES := $(filter-out ro.boot.vendor.overlay.theme=%,$(PRODUCT_SYSTEM_DEFAULT_PROPERTIES))
endif

View File

@ -79,7 +79,7 @@ for part in a ab;do
cat > ${target}.mk << EOF
TARGET_GAPPS_ARCH := ${baseArch}
\$(call inherit-product, device/phh/treble/base-pre.mk)
include build/make/target/product/aosp_${baseArch}_ab.mk
include build/make/target/product/aosp_${baseArch}.mk
\$(call inherit-product, device/phh/treble/base.mk)
$optional_base
$apps_script
@ -87,10 +87,13 @@ $rom_script
PRODUCT_NAME := $target
PRODUCT_DEVICE := phhgsi_${arch}_$part
PRODUCT_BRAND := Phh
PRODUCT_SYSTEM_BRAND := Phh
PRODUCT_BRAND := google
PRODUCT_SYSTEM_BRAND := google
PRODUCT_MODEL := Phh-Treble $apps_name
# Overwrite the inherited "emulator" characteristics
PRODUCT_CHARACTERISTICS := tablet
PRODUCT_PACKAGES += $extra_packages
EOF

View File

@ -12,4 +12,6 @@
file="/system/framework/vendor.huawei.hardware.tp-V1.0-java.jar" />
<library name="android.hardware.wifi.hostapd.V1_0"
file="/system/framework/android.hardware.wifi.hostapd-V1.0-java.jar" />
<library name="vendor.xiaomi.hardware.displayfeature.V1_0"
file="/system/framework/vendor.xiaomi.hardware.displayfeature-V1.0-java.jar" />
</permissions>

12
ota/Android.bp Normal file
View File

@ -0,0 +1,12 @@
cc_binary {
name: "phh-ota",
srcs: [
"phh-ota.cpp",
],
shared_libs: [
"libfs_mgr",
"libbase",
"liblp",
],
init_rc: ["phh-ota.rc"],
}

113
ota/phh-ota.cpp Normal file
View File

@ -0,0 +1,113 @@
#include <string>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/mount.h>
#include <sys/sysmacros.h>
#include <sys/xattr.h>
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <libfiemap/image_manager.h>
#include <android-base/file.h>
using namespace std::chrono_literals;
using namespace std::string_literals;
using android::fiemap::IImageManager;
int main(int argc, char **argv) {
mkdir("/metadata/gsi/phh", 0771);
chown("/metadata/gsi/phh", 0, 1000);
mkdir("/data/gsi/phh", 0771);
chown("/data/gsi/phh", 0, 1000);
auto imgManager = IImageManager::Open("phh", 0ms);
if(argc>=2 && strcmp(argv[1], "unmap") == 0) {
fprintf(stderr, "Unmapping backing image returned %s\n", imgManager->UnmapImageDevice("system_otaphh_a") ? "true" : "false");
fprintf(stderr, "Unmapping backing image returned %s\n", imgManager->UnmapImageDevice("system_otaphh_b") ? "true" : "false");
return 0;
}
if(argc>=2 && strcmp(argv[1], "switch-slot") == 0) {
std::string current_slot;
std::string next_slot;
if(!android::base::ReadFileToString("/metadata/phh/img", &current_slot)) {
next_slot = "a";
} else {
if(current_slot.c_str()[0] == 'a')
next_slot = "b";
}
mkdir("/metadata/phh", 0700);
android::base::WriteStringToFile(next_slot, "/metadata/phh/img");
return 0;
}
if(argc>=2 && strcmp(argv[1], "new-slot") == 0) {
std::string current_slot;
std::string next_slot;
if(!android::base::ReadFileToString("/metadata/phh/img", &current_slot)) {
next_slot = "a";
} else {
if(current_slot.c_str()[0] == 'a')
next_slot = "b";
}
std::string imageName = "system_otaphh_"s + next_slot;
fprintf(stderr, "Unmapping backing image returned %s\n", imgManager->UnmapImageDevice(imageName) ? "true" : "false");
fprintf(stderr, "Deleting backing image returned %s\n", imgManager->DeleteBackingImage(imageName) ? "true" : "false");
auto backRes = imgManager->CreateBackingImage(imageName, 4*1024*1024*1024LL, IImageManager::CREATE_IMAGE_DEFAULT, nullptr);
if(backRes.is_ok()) {
fprintf(stderr, "Creating system image succeeded\n");
} else {
fprintf(stderr, "Creating system image failed\n");
return -1;
}
std::string blockDev;
fprintf(stderr, "Mapping backing image returned %s\n", imgManager->MapImageDevice(imageName, 0ms, &blockDev) ? "true" : "false");
fprintf(stderr, "blockdev is %s\n", blockDev.c_str());
printf("%s\n", blockDev.c_str());
struct stat sb;
for(int i=0; i<10; i++) {
if(!stat(blockDev.c_str(), &sb)) break;
sleep(1);
}
if(!S_ISBLK(sb.st_mode)) {
fprintf(stderr, "blockDev wasn't block dev\n");
return -1;
}
unlink("/dev/phh-ota");
mknod("/dev/phh-ota", 0664 | S_IFBLK, makedev(major(sb.st_rdev), minor(sb.st_rdev)));
chmod("/dev/phh-ota", 0664);
// Allow system uid to write there
chown("/dev/phh-ota", 0, 1000);
const char *dstContext = "u:object_r:phhota_dev:s0";
setxattr("/dev/phh-ota", "security.selinux", dstContext, strlen(dstContext), 0);
return 0;
}
if(argc>=2 && strcmp(argv[1], "delete-other-slot") == 0) {
const char* current_slot = getenv("PHH_OTA_SLOT");
if(current_slot == NULL) {
imgManager->UnmapImageDevice("system_otaphh_a");
imgManager->DeleteBackingImage("system_otaphh_a");
imgManager->UnmapImageDevice("system_otaphh_b");
imgManager->DeleteBackingImage("system_otaphh_b");
return 0;
}
if(current_slot[0] == 'a') {
imgManager->UnmapImageDevice("system_otaphh_b");
imgManager->DeleteBackingImage("system_otaphh_b");
return 0;
}
if(current_slot[0] == 'b') {
imgManager->UnmapImageDevice("system_otaphh_a");
imgManager->DeleteBackingImage("system_otaphh_a");
return 0;
}
return 0;
}
return 1;
}

12
ota/phh-ota.rc Normal file
View File

@ -0,0 +1,12 @@
service phh-ota-make /system/bin/phh-ota new-slot
seclabel u:r:phhsu_daemon:s0
disabled
oneshot
service phh-ota-switch /system/bin/phh-ota switch-slot
seclabel u:r:phhsu_daemon:s0
disabled
oneshot
on property:sys.boot_completed=1
exec u:r:phhsu_daemon:s0 root -- /system/bin/phh-ota delete-other-slot

View File

@ -4,4 +4,9 @@
<string name="config_defaultAccessibilityService">com.google.android.marvin.talkback/.TalkBackService</string>
<string name="config_persistentDataPackageName">com.google.android.gms</string>
<string name="config_defaultNetworkRecommendationProviderPackage">com.google.android.gms</string>
<string-array name="config_packagesExemptFromSuspension" translatable="false">
<item>com.google.android.apps.wellbeing</item>
<item>me.phh.treble.app</item>
</string-array>
</resources>

View File

@ -22,7 +22,6 @@
<string name="config_icon_mask" translatable="false">"M50 0C77.6 0 100 22.4 100 50C100 77.6 77.6 100 50 100C22.4 100 0 77.6 0 50C0 22.4 22.4 0 50 0Z"</string>
<bool name="config_useRoundIcon">true</bool>
<string name="config_wallpaperCropperPackage">com.android.wallpaperpicker</string>
<bool name="config_unplugTurnsOnScreen">true</bool>
<integer name="config_multiuserMaximumUsers">5</integer>
<bool name="config_enableMultiUserUI">true</bool>
@ -50,4 +49,11 @@
<!-- ColorDisplayManager.COLOR_MODE_AUTOMATIC -->
<item>3</item>
</array>
<bool name="config_supportAudioSourceUnprocessed">true</bool>
<string-array name="config_packagesExemptFromSuspension" translatable="false">
<item>me.phh.treble.app</item>
</string-array>
</resources>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- Enable WPA2 to WPA3 auto-upgrade -->
<bool translatable="false" name="config_wifiSaeUpgradeEnabled">false</bool>
</resources>

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2019 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources>
<!-- Package name and fully-qualified class name for the wallpaper picker activity. -->
<string name="config_wallpaper_picker_package" translatable="false">com.android.wallpaper</string>
<string name="config_wallpaper_picker_class" translatable="false">com.android.customization.picker.CustomizationPickerActivity</string>
<!-- Fully-qualified class name for the styles & wallpaper picker activity. -->
<string name="config_styles_and_wallpaper_picker_class" translatable="false">com.android.customization.picker.CustomizationPickerActivity</string>
</resources>

View File

@ -52,6 +52,15 @@ xiaomi_toggle_dt2w_event_node() {
return 1
}
xiaomi_toggle_dt2w_ioctl() {
if [ -c "/dev/xiaomi-touch" ]; then
echo "Trying to set dt2w mode with ioctl on /dev/xiaomi-touch"
# 14 - Touch_Doubletap_Mode
xiaomi-touch 14 "$1"
return
fi
return 1
}
restartAudio() {
setprop ctl.restart audioserver
@ -66,11 +75,12 @@ if [ "$1" == "persist.sys.phh.xiaomi.dt2w" ]; 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 $?
xiaomi_toggle_dt2w_proc_node "$prop_value"
# Fallback to event node method
xiaomi_toggle_dt2w_event_node "$prop_value"
# Fallback to ioctl method
xiaomi_toggle_dt2w_ioctl "$prop_value"
exit
fi
if [ "$1" == "persist.sys.phh.oppo.dt2w" ]; then
@ -184,3 +194,19 @@ if [ "$1" == "persist.sys.phh.backlight.scale" ];then
fi
exit
fi
if [ "$1" == "persist.sys.phh.disable_soundvolume_effect" ];then
if [[ "$prop_value" != "0" && "$prop_value" != "1" ]]; then
exit 1
fi
if [[ "$prop_value" == 1 ]];then
mount /system/phh/empty /vendor/lib/soundfx/libvolumelistener.so
mount /system/phh/empty /vendor/lib64/soundfx/libvolumelistener.so
else
umount /vendor/lib/soundfx/libvolumelistener.so
umount /vendor/lib64/soundfx/libvolumelistener.so
fi
restartAudio
exit
fi

View File

@ -33,4 +33,6 @@ rm -Rf $SYSTEM/{app,priv-app}/me.phh.superuser/
rm -Rf /data/su || true
mount -o remount,ro $MOUNTPOINT
sync
mkdir /metadata/phh
touch /metadata/phh/secure
reboot

3
phh.mk Normal file
View File

@ -0,0 +1,3 @@
PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
ro.system.ota.json_url=https://raw.githubusercontent.com/phhusson/treble_experimentations/master/ota/squeak/ota.json

View File

@ -1,6 +1,9 @@
include build/make/target/board/generic_arm_ab/BoardConfig.mk
include build/make/target/board/generic/BoardConfig.mk
include device/phh/treble/board-base.mk
# Copy pasted from build/make/target/board/generic_arm64/BoardConfig.mk
BOARD_SEPOLICY_DIRS += build/make/target/board/generic_arm64/sepolicy
ifeq ($(BOARD_SYSTEMIMAGE_PARTITION_RESERVED_SIZE),)
BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1572864000
endif

View File

@ -1,4 +1,4 @@
include build/make/target/board/generic_arm64_ab/BoardConfig.mk
include build/make/target/board/generic_arm64/BoardConfig.mk
include device/phh/treble/board-base.mk
ifeq ($(BOARD_SYSTEMIMAGE_PARTITION_RESERVED_SIZE),)

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -60,7 +60,12 @@ if [ "$vndk" = 26 ];then
fi
setprop sys.usb.ffs.aio_compat true
setprop persist.adb.nonblocking_ffs false
if getprop ro.vendor.build.fingerprint | grep -q -i -e Blackview/BV9500Plus;then
setprop persist.adb.nonblocking_ffs true
else
setprop persist.adb.nonblocking_ffs false
fi
fixSPL() {
if [ "$(getprop ro.product.cpu.abi)" = "armeabi-v7a" ]; then
@ -73,8 +78,12 @@ fixSPL() {
if [ -n "$img" ]; then
#Rewrite SPL/Android version if needed
Arelease="$(getSPL "$img" android)"
spl="$(getSPL "$img" spl)"
setprop ro.keymaster.xxx.release "$Arelease"
setprop ro.keymaster.xxx.security_patch "$(getSPL "$img" spl)"
setprop ro.keymaster.xxx.security_patch "$spl"
if [ -z "$Arelease" ] || [ -z "$spl" ];then
return 0
fi
setprop ro.keymaster.brn Android
if getprop ro.vendor.build.fingerprint |grep -qiE 'samsung.*star.*lte';then
@ -118,6 +127,7 @@ fixSPL() {
}
changeKeylayout() {
mpk="/mnt/phh/keylayout"
cp -a /system/usr/keylayout /mnt/phh/keylayout
changed=false
if grep -q vendor.huawei.hardware.biometrics.fingerprint /vendor/etc/vintf/manifest.xml; then
@ -151,7 +161,6 @@ changeKeylayout() {
fi
if getprop ro.vendor.build.fingerprint | grep -iq -e xiaomi/daisy; then
mpk="/mnt/phh/keylayout"
cp /system/phh/daisy-buttonJack.kl ${mpk}/msm8953-snd-card-mtp_Button_Jack.kl
changed=true
if [ ! -f /mnt/phh/keylayout/uinput-goodix.kl ]; then
@ -165,6 +174,13 @@ changeKeylayout() {
chmod 0644 ${mpk}/uinput* ${mpk}/msm8953*
fi
if getprop ro.vendor.build.fingerprint | grep -iq -e xiaomi/renoir; then
mpk="/mnt/phh/keylayout"
cp /system/phh/daisy-buttonJack.kl ${mpk}/lahaina-shimaidp-snd-card_Button_Jack.kl
chmod 0644 ${mpk}/lahaina-shimaidp-snd-card_Button_Jack.kl
changed=true
fi
if getprop ro.vendor.build.fingerprint | grep -qi oneplus/oneplus6/oneplus6; then
cp /system/phh/oneplus6-synaptics_s3320.kl /mnt/phh/keylayout/synaptics_s3320.kl
chmod 0644 /mnt/phh/keylayout/synaptics_s3320.kl
@ -177,7 +193,7 @@ changeKeylayout() {
changed=true
fi
if getprop ro.vendor.build.fingerprint | grep -iq -E -e '^Sony/G834'; then
if getprop ro.vendor.build.fingerprint | grep -iq -E -e '^Sony/'; then
cp /system/phh/sony-gpio-keys.kl /mnt/phh/keylayout/gpio-keys.kl
chmod 0644 /mnt/phh/keylayout/gpio-keys.kl
changed=true
@ -253,6 +269,41 @@ changeKeylayout() {
changed=true
fi
if getprop ro.vendor.build.fingerprint | grep -q -i -e Blackview/BV9500Plus;then
cp /system/phh/bv9500plus-mtk-kpd.kl /mnt/phh/keylayout/mtk-kpd.kl
chmod 0644 /mnt/phh/keylayout/mtk-kpd.kl
changed=true
fi
if getprop ro.product.vendor.device |grep -qi -e mfh505glm -e fh50lm; then
cp /system/phh/empty /mnt/phh/keylayout/uinput-fpc.kl
chmod 0644 /mnt/phh/keylayout/uinput-fpc.kl
changed=true
fi
if getprop ro.vendor.build.fingerprint | grep -iq -e motorola/liber; then
cp /system/phh/moto-liber-gpio-keys.kl /mnt/phh/keylayout/gpio-keys.kl
chmod 0644 /mnt/phh/keylayout/gpio-keys.kl
cp /system/phh/empty /mnt/phh/keylayout/uinput_nav.kl
chmod 0644 /mnt/phh/keylayout/uinput_nav.kl
changed=true
fi
if getprop ro.vendor.build.fingerprint | grep -iq DOOGEE/S88Pro;then
cp /system/phh/empty /mnt/phh/keylayout/sf-keys.kl
chmod 0644 /mnt/phh/keylayout/sf-keys.kl
changed=true
fi
if getprop ro.vendor.build.fingerprint |grep -iq tecno/kd7;then
# Enable dt2w
echo cc1 > /proc/gesture_function
cp /system/phh/tecno-touchpanel.kl /mnt/phh/keylayout/mtk-tpd.kl
chmod 0644 /mnt/phh/keylayout/mtk-tpd.kl
changed=true
fi
if [ "$changed" = true ]; then
mount -o bind /mnt/phh/keylayout /system/usr/keylayout
restorecon -R /system/usr/keylayout
@ -271,11 +322,11 @@ fi
if mount -o remount,rw /system; then
resize2fs "$(grep ' /system ' /proc/mounts | cut -d ' ' -f 1)" || true
else
remount system
mount -o remount,rw /
major="$(stat -c '%D' /.|sed -E 's/^([0-9a-f]+)([0-9a-f]{2})$/\1/g')"
minor="$(stat -c '%D' /.|sed -E 's/^([0-9a-f]+)([0-9a-f]{2})$/\2/g')"
mknod /dev/tmp-phh b $((0x$major)) $((0x$minor))
blockdev --setrw /dev/tmp-phh
resize2fs /dev/root || true
resize2fs /dev/tmp-phh || true
fi
@ -306,15 +357,14 @@ if grep vendor.huawei.hardware.biometrics.fingerprint /vendor/manifest.xml; then
fi
foundFingerprint=false
for manifest in /vendor/manifest.xml /vendor/etc/vintf/manifest.xml /odm/etc/vintf/manifest.xml;do
if grep -q \
-e android.hardware.biometrics.fingerprint \
-e vendor.oppo.hardware.biometrics.fingerprint \
-e vendor.oplus.hardware.biometrics.fingerprint \
$manifest;
then
foundFingerprint=true
fi
for manifest in /vendor/manifest.xml /vendor/etc/vintf /odm/etc/vintf;do
if grep -q \
-e android.hardware.biometrics.fingerprint \
-e vendor.oppo.hardware.biometrics.fingerprint \
-e vendor.oplus.hardware.biometrics.fingerprint \
-r $manifest;then
foundFingerprint=true
fi
done
if [ "$foundFingerprint" = false ];then
@ -392,7 +442,8 @@ if getprop ro.build.overlay.deviceid |grep -q -e CPH1859 -e CPH1861 -e RMX1811 -
setprop persist.sys.qcom-brightness "$(cat /sys/class/leds/lcd-backlight/max_brightness)"
fi
if getprop ro.build.overlay.deviceid |grep -iq -e RMX2020 -e RMX2027 -e RMX2040 -e RMX2193 -e RMX2191;then
if getprop ro.build.overlay.deviceid |grep -iq -e RMX2020 -e RMX2027 -e RMX2040 -e RMX2193 \
-e RMX2193 -e RMX2191 -e RMX2195;then
setprop persist.sys.qcom-brightness 2047
setprop persist.sys.overlay.devinputjack true
setprop persist.sys.phh.fingerprint.nocleanup true
@ -406,7 +457,6 @@ if getprop ro.vendor.build.fingerprint | grep -iq \
-e motorola/hannah -e motorola/james -e motorola/pettyl -e xiaomi/cepheus \
-e xiaomi/grus -e xiaomi/cereus -e xiaomi/cactus -e xiaomi/raphael -e xiaomi/davinci \
-e xiaomi/ginkgo -e xiaomi/willow -e xiaomi/laurel_sprout -e xiaomi/andromeda \
-e iaomi/renoir \
-e redmi/curtana -e redmi/picasso \
-e bq/Aquaris_M10 ; then
mount -o bind /mnt/phh/empty_dir /vendor/lib64/soundfx
@ -531,6 +581,12 @@ if getprop ro.vendor.build.fingerprint | grep -iq -e Redmi/merlin; then
setprop debug.sf.enable_hwc_vds 0
fi
if getprop ro.vendor.build.fingerprint | grep -iq -e Redmi/rosemary \
-e Redmi/secret -e Redmi/maltose; then
setprop debug.sf.latch_unsignaled 1
setprop debug.sf.enable_hwc_vds 0
fi
if getprop ro.vendor.build.fingerprint | grep -iq -E -e 'huawei|honor' || getprop persist.sys.overlay.huawei | grep -iq -E -e 'true'; then
p=/product/etc/nfc/libnfc_nxp_*_*.conf
mount -o bind "$p" /system/etc/libnfc-nxp.conf ||
@ -662,14 +718,13 @@ fi
setprop ctl.stop console
dmesg -n 1
if [ -f /system/phh/secure ];then
copyprop() {
p="$(getprop "$2")"
if [ "$p" ]; then
resetprop_phh "$1" "$(getprop "$2")"
fi
}
copyprop() {
p="$(getprop "$2")"
if [ "$p" ]; then
resetprop_phh "$1" "$(getprop "$2")"
fi
}
if [ -f /system/phh/secure ] || [ -f /metadata/phh/secure ];then
copyprop ro.build.device ro.vendor.build.device
copyprop ro.system.build.fingerprint ro.vendor.build.fingerprint
copyprop ro.bootimage.build.fingerprint ro.vendor.build.fingerprint
@ -713,6 +768,21 @@ if [ -f /system/phh/secure ];then
resetprop_phh ro.adb.secure 1
setprop ctl.restart adbd
# Hide system/xbin/su
mount /mnt/phh/empty_dir /system/xbin
mount /mnt/phh/empty_dir /system/app/me.phh.superuser
mount /system/phh/empty /system/xbin/phh-su
else
mkdir /mnt/phh/xbin
chmod 0755 /mnt/phh/xbin
chcon u:object_r:system_file:s0 /mnt/phh/xbin
#phh-su will bind over this empty file to make a real su
touch /mnt/phh/xbin/su
chcon u:object_r:system_file:s0 /mnt/phh/xbin/su
mount -o bind /mnt/phh/xbin /system/xbin
fi
for abi in "" 64;do
@ -870,7 +940,7 @@ fi
if getprop ro.vendor.build.fingerprint |grep -qiE '^samsung/';then
for f in /sys/class/lcd/panel/actual_mask_brightness /sys/class/lcd/panel/mask_brightness /sys/class/lcd/panel/device/backlight/panel/brightness /sys/class/backlight/panel0-backlight/brightness;do
if [ "$(stat -c '%U' "$f")" == "root" ];then
if [ "$(stat -c '%U' "$f")" == "root" ] || [ "$(ls -lZ "$f" | grep -oE 'u:object_r:[^:]*:s0')" == "u:object_r:sysfs:s0" ];then
chcon u:object_r:sysfs_lcd_writable:s0 $f
chmod 0644 $f
chown system:system $f
@ -880,14 +950,21 @@ if getprop ro.vendor.build.fingerprint |grep -qiE '^samsung/';then
setprop persist.sys.phh.fod.samsung true
fi
if getprop ro.vendor.build.fingerprint |grep -qiE '^oneplus/';then
setprop persist.sys.phh.fod.bbk true
if getprop ro.vendor.build.fingerprint | grep -q -e samsung/o1s -e samsung/t2s -e samsung/p3s; then
setprop persist.sys.phh.ultrasonic_udfps true
fi
if getprop ro.build.overlay.deviceid |grep -qiE -e '^RMX' -e '^CPH';then
if getprop ro.vendor.build.fingerprint |grep -qiE -e ASUS_I006D -e ASUS_I003;then
setprop persist.sys.phh.fod.asus true
fi
if (getprop ro.vendor.build.fingerprint;getprop ro.odm.build.fingerprint) |grep -qiE '^oneplus/' ||
getprop ro.build.overlay.deviceid |grep -qiE -e '^RMX' -e '^CPH' ||
[ -n "$(getprop ro.separate.soft)" ];then
setprop persist.sys.phh.fod.bbk true
fi
if getprop ro.build.overlay.deviceid |grep -iq -e RMX1941 -e RMX1945 -e RMX1943 -e RMX1942;then
if getprop ro.build.overlay.deviceid |grep -iq -e RMX1941 -e RMX1945 -e RMX1943 -e RMX1942;then
setprop persist.sys.qcom-brightness "$(cat /sys/class/leds/lcd-backlight/max_brightness)"
setprop persist.sys.phh.mainkeys 0
fi
@ -898,14 +975,24 @@ fi
resetprop_phh ro.bluetooth.library_name libbluetooth.so
if getprop ro.vendor.build.fingerprint |grep -iq xiaomi/cepheus;then
if getprop ro.vendor.build.fingerprint |grep -iq xiaomi/cepheus -e xiaomi/nabu;then
setprop ro.netflix.bsp_rev Q855-16947-1
fi
if getprop ro.vendor.build.fingerprint |grep -iq xiaomi/elish;then
setprop ro.netflix.bsp_rev Q8250-19134-1
fi
if getprop ro.vendor.build.fingerprint |grep -qi redmi/curtana;then
setprop ro.netflix.bsp_rev Q6250-19132-1
fi
if getprop ro.vendor.build.fingerprint |grep -iq xiaomi/renoir;then
setprop ro.netflix.bsp_rev Q875-32774-1
resetprop_phh ro.config.media_vol_steps 25
resetprop_phh ro.config.media_vol_default 15
fi
# Set props for Vsmart Live's fod
if getprop ro.vendor.build.fingerprint |grep -q vsmart/V620A_open;then
setprop persist.sys.fp.fod.location.X_Y 447,1812
@ -932,9 +1019,7 @@ if [ "$vndk" -le 27 ];then
setprop persist.sys.phh.no_present_or_validate true
fi
if grep -q /mnt/vendor/persist /vendor/etc/fstab.qcom;then
mount /mnt/vendor/persist /persist
fi
[ -d /mnt/vendor/persist ] && mount /mnt/vendor/persist /persist
for f in $(find /sys -name fts_gesture_mode);do
setprop persist.sys.phh.focaltech_node "$f"
@ -946,3 +1031,81 @@ fi
# Disable secondary watchdogs
echo -n V > /dev/watchdog1
# Fix watchdog issue on Samsung Galaxy A20s
if getprop ro.vendor.build.fingerprint | grep -iq samsung/a20sub/a20s; then
echo -n V > /dev/watchdog0
fi
if getprop ro.vendor.build.fingerprint | grep -iq samsung/a11que;then
echo -n V > /dev/watchdog0
fi
if [ "$vndk" -le 30 ];then
# On older vendor the default behavior was to disable color management
# Don't override vendor value, merely add a fallback
setprop ro.surface_flinger.use_color_management false
fi
if [ "$(stat -c '%U' /dev/nxp_smartpa_dev)" == "root" ] &&
[ "$(stat -c '%G' /dev/nxp_smartpa_dev)" == "root" ];then
chown root:audio /dev/nxp_smartpa_dev
chmod 0660 /dev/nxp_smartpa_dev
fi
if getprop ro.odm.build.fingerprint |grep -q Huawei/Chicago/Chicago_VTR;then
setprop ctl.stop aptouch
fi
if getprop ro.vendor.build.fingerprint | grep -iq -e GOME/GOME_U9; then
cp -a /system/etc/smartpa_params /mnt/phh/smartpa_params
cp /system/phh/gome/fs16xx_01s_left.preset /mnt/phh/smartpa_params/fs16xx_01s_left.preset
cp /system/phh/gome/fs16xx_01s_mono.preset /mnt/phh/smartpa_params/fs16xx_01s_mono.preset
cp /system/phh/gome/fs16xx_01s_right.preset /mnt/phh/smartpa_params/fs16xx_01s_right.preset
chmod 0644 /mnt/phh/smartpa_params/fs16xx_01s_left.preset
chmod 0644 /mnt/phh/smartpa_params/fs16xx_01s_mono.preset
chmod 0644 /mnt/phh/smartpa_params/fs16xx_01s_right.preset
mount -o bind /mnt/phh/smartpa_params /system/etc/smartpa_params
restorecon -R /system/etc/smartpa_params
fi
if getprop ro.vendor.build.fingerprint | grep -iq -e UMIDIGI/UMIDIGI_X; then
cp -a /system/etc/smartpa_params /mnt/phh/smartpa_params
cp /system/phh/umidigi/fs16xx_01s_mono.preset /mnt/phh/smartpa_params/fs16xx_01s_mono.preset
chmod 0644 /mnt/phh/smartpa_params/fs16xx_01s_mono.preset
mount -o bind /mnt/phh/smartpa_params /system/etc/smartpa_params
restorecon -R /system/etc/smartpa_params
fi
if getprop ro.vendor.build.fingerprint |grep -iq motorola/kane;then
setprop persist.sys.bt.esco_transport_unit_size 16
fi
if [ -f /vendor/bin/ccci_rpcd ];then
setprop debug.phh.props.ccci_rpcd vendor
fi
if getprop ro.vendor.build.fingerprint | grep -qi -e iaomi/mona; then
copyprop ro.product.manufacturer ro.product.vendor.manufacturer
fi
if getprop ro.vendor.build.fingerprint | grep -iq -e motorola/liber; then
cp /vendor/etc/audio_policy_configuration.xml /mnt/phh/
sed -i '/r_submix_audio_policy_configuration/a \t<xi:include href="/vendor/etc/a2dp_audio_policy_configuration.xml"/>' /mnt/phh/audio_policy_configuration.xml
mount -o bind /mnt/phh/audio_policy_configuration.xml /vendor/etc/audio_policy_configuration.xml
chcon -h u:object_r:vendor_configs_file:s0 /vendor/etc/audio_policy_configuration.xml
chmod 644 /vendor/etc/audio_policy_configuration.xml
fi
mount /system/phh/empty /vendor/etc/permissions/samsung.hardware.uwb.xml
mount /system/phh/empty /vendor/bin/install-recovery.sh
if getprop ro.vendor.radio.default_network |grep -qE '[0-9]';then
setprop ro.telephony.default_network $(getprop ro.vendor.radio.default_network)
fi
if getprop ro.vendor.build.fingerprint |grep -iq redmi/camellia;then
setprop persist.sys.qcom-brightness 4095
fi
mount -o bind /mnt/phh/empty_dir /vendor/app/qti-logkit
mount -o bind /mnt/phh/empty_dir /vendor/app/qti-logkit-lite

View File

@ -5,6 +5,7 @@
/system/bin/phh-on-boot.sh u:object_r:phhsu_exec:s0
/system/bin/phh-on-data.sh u:object_r:phhsu_exec:s0
/system/bin/asus-motor u:object_r:phhsu_exec:s0
/system/bin/xiaomi-touch u:object_r:phhsu_exec:s0
#/system/bin/fsck\.exfat u:object_r:fsck_exec:s0
/system/bin/fsck\.ntfs u:object_r:fsck_exec:s0

7
sepolicy/keymaster.te Normal file
View File

@ -0,0 +1,7 @@
#Access to fake keymaster SPL/Android version props
get_prop(hal_keymaster, default_prop);
get_prop(hal_keymaster, system_prop);
get_prop(hal_gatekeeper, system_prop);

3
sepolicy/keystore.te Normal file
View File

@ -0,0 +1,3 @@
allow keystore domain:process getattr;
allow keystore domain:dir r_dir_perms;
allow keystore domain:file r_file_perms;

View File

@ -17,3 +17,10 @@ binder_call(hal_mms_server, {appdomain -isolated_app})
type mtk_hal_mms_hwservice, hwservice_manager_type;
allow { appdomain -isolated_app } mtk_hal_mms_hwservice:hwservice_manager find;
#denied { read } for comm="tkuinit" name="u:object_r:default_prop:s0" dev="tmpfs" ino=2029 scontext=u:r:tkcore:s0 tcontext=u:object_r:default_prop:s0 tclass=file permissive=1
#denied { open } for comm="tkuinit" path="/dev/__properties__/u:object_r:default_prop:s0" dev="tmpfs" ino=2029 scontext=u:r:tkcore:s0 tcontext=u:object_r:default_prop:s0 tclass=file permissive=1
#denied { getattr } for comm="tkuinit" path="/dev/__properties__/u:object_r:default_prop:s0" dev="tmpfs" ino=2029 scontext=u:r:tkcore:s0 tcontext=u:object_r:default_prop:s0 tclass=file permissive=1
type tkcore, domain;
permissive tkcore;

View File

@ -4,3 +4,7 @@ allow system_app sysfs_usb_supply:file rw_file_perms;
type hal_fingerprint_oplus, domain;
allow hal_fingerprint_oplus vendor_default_prop:property_service set;
get_prop(hal_fingerprint_oplus, default_prop);
get_prop(system_server, vendor_default_prop);

17
sepolicy/phh.te Normal file
View File

@ -0,0 +1,17 @@
type phhota_dev, dev_type, bdev_type;
typeattribute phhota_dev mlstrustedobject;
allow phhsu_daemon phhota_dev:blk_file rw_file_perms;
allow system_app phhota_dev:blk_file rw_file_perms;
allow kernel phhsu_daemon:fd use;
allow phhsu_daemon gsi_data_file:file ioctl;
allowxperm phhsu_daemon gsi_data_file:file ioctl { 0x660b };
allow phhsu_daemon loop_device:blk_file ioctl;
allowxperm phhsu_daemon loop_device:blk_file ioctl { 0x4c00 };
allow phhsu_daemon userdata_block_device:blk_file ioctl;
allowxperm phhsu_daemon userdata_block_device:blk_file ioctl { 0x1278 0x127a };
allow kernel gsi_data_file:file rw_file_perms;

View File

@ -28,3 +28,5 @@ allowxperm tee rpmb_device:blk_file ioctl { 0xb300-0xbfff };
attribute smcinvoke_device_29_0;
type smcinvoke_device, dev_type;
typeattribute smcinvoke_device smcinvoke_device_29_0;
get_prop(rild, default_prop);

View File

@ -28,7 +28,8 @@ allow system_app hal_tp_default:binder { call };
allow system_app vendor_default_prop:property_service { set };
set_prop(system_app, default_prop);
set_prop(system_app, exported3_default_prop);
#set_prop(system_app, exported3_default_prop);
set_prop(system_app, telephony_config_prop);
type mtk_hal_rild_hwservice, hwservice_manager_type;
allow system_app mtk_hal_rild_hwservice:hwservice_manager { find};

View File

@ -11,3 +11,6 @@ persist.sys.phh.mainkeys=0
fw.max_users=10
persist.sys.max_profiles=10
ro.boot.realme.lockstate=0
#Fixes fingerprint unlock delay
persist.wm.enable_remote_keyguard_animation=0

13
vndk.rc
View File

@ -47,6 +47,9 @@ on property:persist.sys.phh.vsmart.dt2w=*
on property:persist.sys.phh.backlight.scale=*
exec u:r:phhsu_daemon:s0 root -- /system/bin/phh-prop-handler.sh "persist.sys.phh.backlight.scale"
on property:persist.sys.phh.disable_soundvolume_effect=*
exec u:r:phhsu_daemon:s0 root -- /system/bin/phh-prop-handler.sh "persist.sys.phh.disable_soundvolume_effect"
on property:ro.sf.lcd_density=*
restart surfaceflinger
@ -70,3 +73,13 @@ on property:persist.sys.phh.restart_ril=true
restart vendor.qcrild
restart vendor.qcrild2
restart vendor.ril-daemon-mtk
on property:vendor.debug.sf.latch_unsignaled=1
setprop debug.sf.latch_unsignaled 1
on property:sys.phh.uninstall-ota=true
exec u:r:phhsu_daemon:s0 root -- /system/bin/rm /metadata/phh/img
on property:ro.vendor.radio.default_network=*
setprop ro.telephony.default_network ${ro.vendor.radio.default_network}