Compare commits

...

154 Commits

Author SHA1 Message Date
1d8311df96 disable sms and voice because i'm building this for my wifi-only device 2022-06-23 16:00:25 +00:00
Pierre-Hugues HUSSON
e96c8929e0
Merge pull request #309 from AndyCGYan/logkit-11
Kill QCOM LogKit app
2022-05-17 12:37:56 +02:00
Andy CrossGate Yan
4865734e0d Kill QCOM LogKit app
Known to bootloop UMX U696CL, and is useless anyway

Change-Id: Ibc8ed1228e0c0b71825d889498f2b1b4ebd59fa6
2022-05-17 10:11:40 +00:00
Andy CrossGate Yan
e549a28273 Disable FP gestures for LG Stylo 7 5G
Change-Id: Ib1013963d41997e6ba5b6a645355beb8637d6f01
2021-12-03 13:31:50 +01:00
Pierre-Hugues Husson
7071ee8fbf 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 16:40:54 +01:00
Pierre-Hugues HUSSON
26d58a8562
Merge pull request #279 from Vgdn1942/patch-2
Use name instead device
2021-10-07 20:21:22 +02:00
Василий Ковалёв
f514e1c231
Use name instead device
On some devices, device and name use different values, which prevents the safetynet test from passing
2021-10-07 20:56:42 +03:00
Pierre-Hugues HUSSON
d0355b6dd5
Merge pull request #278 from notmyst33d/android-11.0
Fix screen recoder on Redmi Note 9
2021-09-04 22:25:59 +02:00
Myst33d
043a42433b Fix screen recoder on Redmi Note 9 2021-09-04 21:58:39 +06:00
Pierre-Hugues HUSSON
e02d5eeb46
Merge pull request #277 from DarkJoker360/11-willow-hax
Audio fixes for Redmi Note 8/8T + cleanup
2021-09-03 12:53:02 +02:00
DarkJoker360
29b13b352a Cleanup audio hacks for Redmi Note 8/8T
* Already done by previous audio hacks.

Signed-off-by: DarkJoker360 <simoespo159@gmail.com>
2021-09-03 12:49:32 +02:00
DarkJoker360
8f61607113 Enable audio fixes for Redmi Note 8T
Signed-off-by: DarkJoker360 <simoespo159@gmail.com>
2021-09-03 12:49:00 +02:00
Pierre-Hugues HUSSON
5c1dae99cf
Merge pull request #272 from DarkJoker360/cheryl-bt-11
Fix bluetooth on cheryl
2021-08-26 14:21:36 +02:00
DarkJoker360
d8d6d29f36 Fix bluetooth on cheryl
Signed-off-by: DarkJoker360 <simoespo159@gmail.com>
2021-08-26 13:48:14 +02:00
Pierre-Hugues HUSSON
dfd02ff557
Merge pull request #271 from notmyst33d/android-11.0
Fix UI lags on Redmi Note 9
2021-08-20 19:41:16 +02:00
Myst33d
81af8dbf47
Fix UI lags on Redmi Note 9
Tested on MIUI 12.5.1.0 vendor
2021-08-20 17:36:52 +06:00
Pierre-Hugues Husson
a76bab59db Forgot to request oplus alert slider code to be compiled 2021-08-11 11:09:13 +02:00
Pierre-Hugues Husson
642749e3a2 Add oppo-touchpanel for OnePlus Nord2 2021-08-10 19:09:11 -04:00
Pierre-Hugues Husson
c117a13dad Oplus fingerprint HAL needs to set some persist.vendor properties
On stock rom, those properties' SELinux context is set in /system
To prevent SELinux conflicts, just allow all vendor props
2021-08-10 17:23:50 -04:00
Pierre-Hugues Husson
2fc868bc4a New Oplus way to get project number 2021-08-10 17:23:42 -04:00
Pierre-Hugues Husson
2b6440d5ac Need to set selinux context for oplus hal too 2021-08-10 16:11:03 -04:00
Pierre-Hugues HUSSON
5beb9d0966
Merge pull request #270 from hwti/patch-2
Make phh-securize.sh work with current Magisk
2021-08-09 20:14:12 +02:00
Pierre-Hugues Husson
2d96bc5545 Add ugly support for OnePlus alert slider (tested on OP Nord2) 2021-08-09 19:50:29 +02:00
Loïc Yhuel
b0ddecfc39
Make phh-securize.sh work with current Magisk
Magisk 21.0 changed the mount path, we have to get it with "magisk --path" now.
This is used to get where the system partition is mounted.

The phh-su bind-mount is on /system/xbin/su, even with Magisk.
But we still have to unmount it, in order to remove the empty "su" file on the system partition.
2021-08-09 05:01:46 +02:00
Pierre-Hugues Husson
f0cac6df49 Add MTK IMS services 2021-08-08 21:37:14 +02:00
Pierre-Hugues Husson
17976104b2 Typo, fixup of 90fe6e4b, Thanks Sarthak 2021-08-08 20:22:34 +02:00
Pierre-Hugues Husson
90fe6e4b62 Include new OPPO Hal s/vendor.oppo/vendor.oplus/g 2021-08-08 20:15:33 +02:00
Pierre-Hugues HUSSON
1d31a4c127
Merge pull request #269 from FlokoROM-GSI/android-11.0-renoir
Fix sound for Xiaomi Mi 11 Lite 5G
2021-07-31 17:55:33 +02:00
AndroPlus
663cbedfee Fix sound for Xiaomi Mi 11 Lite 5G 2021-07-31 18:29:47 +09:00
Pierre-Hugues HUSSON
c9d731c0f1
Merge pull request #267 from bibarub/android-11.0
use 'a2dp' audio module instead of 'bluetooth_qti' when needed
2021-07-05 20:44:41 +02:00
bibarub
417839ab4a
use 'a2dp' audio module instead of 'bluetooth_qti' when needed 2021-07-05 21:39:10 +03:00
Pierre-Hugues Husson
e9d96cc60e Alternate audio policy for Samsung devicese 2021-06-07 13:43:33 -04:00
Pierre-Hugues Husson
0669df7523 When selecting alternate audio policy, check if we can grab the policy made for QSSI 2021-06-07 13:41:21 -04:00
Pierre-Hugues Husson
5e6061d5fd On ZF8, take stock rom audio policy, rather than the worse ones intended for GSI or QSSI 2021-06-07 12:47:49 -04:00
Pierre-Hugues Husson
2f79cf8662 Don't empty /vendor/etc/audio when very full, when prop is changed too 2021-06-07 12:33:35 -04:00
Pierre-Hugues Husson
475de0067d Some devices have a lot of stuff in /vendor/etc/audio, not just a CAF audio policy, like ZF8 has their whole vendor audio configuration there. Dont empty this dir in that case 2021-06-03 16:44:44 -04:00
Pierre-Hugues Husson
7a9ce0e848 Add support for treble app to control HCT touchscreen gestures HAL 2021-06-03 16:09:38 -04:00
Pierre-Hugues HUSSON
4f6b0d28a7
Merge pull request #264 from eremitein/treble-app-call
add treble app to the allow-in-power-save list
2021-05-30 23:00:52 +02:00
Victor Bo
2eb8896467 add treble app to the allow-in-power-save list 2021-05-30 16:57:31 -04:00
Pierre-Hugues HUSSON
438255bb25
Merge pull request #250 from sarthakroy2002/patch-1
Fix Brightness, FP and Headphone jack issue of Realme Narzo 20 and Re…
2021-05-13 10:07:09 +02:00
Sarthak Roy
d06e747b50
Fix Brightness, FP and Headphone jack issue of Realme Narzo 20 and Realme X7 Pro 5G 2021-05-13 12:16:42 +05:30
Pierre-Hugues HUSSON
e5c0da0939
Merge pull request #249 from R0rt1z2/patch-1
BQ Aquaris M10 HD fixes
2021-05-11 19:19:09 +02:00
Roger Ortiz
57d109cbf2 freezerhd: fix screen orientation 2021-05-11 20:01:31 +02:00
Roger Ortiz
3fbee899b6
freezerhd: ignore audio effects as well 2021-05-11 17:58:54 +01:00
Pierre-Hugues Husson
07e17110ca On some Oppo devices, we can NOT load firmware. Oppo engineers realized that and kept the line in rc script, but simply commented it out. so check this 2021-05-11 06:20:40 -04:00
Pierre-Hugues HUSSON
80281b21ab
Merge pull request #248 from TTTT555/patch-2
begonia: Drop deprecated props
2021-05-02 18:46:09 +02:00
TTTT555
815a378701
begonia: Drop deprecated props
* these fixes are not needed since A10/A11 vendor (and only cause errors)
2021-05-02 18:15:07 +02:00
Pierre-Hugues Husson
659278a853 Stop whitelisting Xiaomi devices manually. The kl name is pretty explicit about fingerprint sensor, we should be safe 2021-05-01 14:17:43 +02:00
Pierre-Hugues HUSSON
aef3ba2919
Merge pull request #246 from gsuzeda/patch-2
Update rw-system.sh
2021-04-30 10:11:56 +02:00
Uzeda
cebf48f92f
Update rw-system.sh 2021-04-30 03:50:36 -03:00
Pierre-Hugues Husson
8d45b8ea38 [teracube2e] Add support for dt2w 2021-04-16 13:27:41 +02:00
Pierre-Hugues HUSSON
24c3a48b98
Merge pull request #243 from 00p513-dev/android-11.0
Add amyROM makefile
2021-04-15 16:24:58 +02:00
Pierre-Hugues HUSSON
d02b16585a
Merge pull request #242 from KaMyKaSii/patch-1
Poco M3 fix fingerprint gesture
2021-04-09 20:20:15 +02:00
Pierre-Hugues HUSSON
9a7fdc991b
Merge pull request #244 from PeterCxy/patch-unihertz-keylayout
add keylayout for Unihertz devices
2021-04-08 21:47:19 +02:00
Peter Cai
aa0d782b8c add keylayout for Unihertz devices
* Unihertz devices have a dedicated PTT button, which I mapped to
  CAMERA, making it useful (kind of) by default and remappable via
  third-party apps.
* Additionally, declare capacitive buttons as VIRTUAL so that vibration
  is applied when they are pressed.
2021-04-08 20:21:57 +08:00
Amy Grace
e8d7cb9255 Add amyROM makefile 2021-04-07 09:17:24 +01:00
Pierre-Hugues Husson
91783c3bde Clean up ota.sh for better lifecycle (supports exclusively dynamic partitions) 2021-03-28 18:57:44 +02:00
Pierre-Hugues Husson
d9140dbd8d [lptools] partition was freed, thus name was zero-ed, leading to a partition with an empty name rather than expected dst name 2021-03-28 18:57:09 +02:00
Pierre-Hugues Husson
00d5b05ee9 Samsung has another path for alternate audio policy 2021-03-28 18:56:14 +02:00
Pierre-Hugues Husson
6d5747d010 Add a fake audio policy 2021-03-28 18:55:25 +02:00
Pierre-Hugues Husson
29480cdbb8 Declare all color modes available, they dont seem to depend much on hardware capabilities 2021-03-21 22:56:46 +01:00
Pierre-Hugues Husson
926613d464 [simg2img_simple] Abandon splice if it's too slow. 2021-03-20 21:55:07 +01:00
Pierre-Hugues Husson
abec25d226 Pump up lptools
- Add `free` command to know how big a partition can be created
- `create` command now properly return errors
- Add lptools_static, suitable for use from recovery
- Add clear-cow and unlimited-group to help expand current group's
  beyond original expectations
2021-03-20 19:59:15 +01:00
Pierre-Hugues Husson
29154150b0 Change brand name. This works around Samsung limitations on sensor hal 2021-03-20 19:59:15 +01:00
KaMyKaSii
dcbc76966a
Poco M3 fix fingerprint gesture 2021-03-19 15:49:08 -03:00
Pierre-Hugues HUSSON
03b1c9d3d8
Merge pull request #241 from notsyncing/android-11.0
NX669J: Use audio config from QSSI
2021-03-16 17:29:59 +01:00
notsyncing
d190d02990 NX669J: Use audio config from QSSI
AOSP doesn't care about QSSI, and it will always try to load from
/vendor/etc/audio/sku_{ro.boot.product.vendor.sku}, while the stock ROM
loads from /vendor/etc/audio/sku_{ro.boot.product.vendor.sku}_qssi.

This fixes speaker and headphone audio for Nubia Red Magic 6.
2021-03-16 19:40:45 +08:00
Pierre-Hugues Husson
2057f5d25a Disable fdsan for real. Setting it to 0 won't disable it, because setting it to 0 will set it to DEFAULT value, which is fatal in userdebug. So best we can do to disable it is to set it to warn_once. See bionic's android_fdsan_set_error_level_from_property 2021-03-11 16:26:52 +01:00
Pierre-Hugues Husson
04ee9f055e Remove wrongly included debugging stuff 2021-03-08 18:39:54 +01:00
Pierre-Hugues HUSSON
23baa924dc
Merge pull request #239 from VDavid003/android-11.0
Fix vendor hostapd detection for manifest fragments
2021-03-08 13:48:13 +01:00
VDavid003
a3f96351d7
Fix vendor hostapd detection for manifest fragments
This fixes tethering on phones that have hostapd defined in a manifest fragment
2021-03-08 13:32:33 +01:00
Pierre-Hugues HUSSON
f7e7a1607c
Merge pull request #238 from DarkJoker360/11-2btnnav
Build NavigationBarMode2ButtonOverlay
2021-03-06 11:13:57 +01:00
DarkJoker360
f8ff2ea2ad Build NavigationBarMode2ButtonOverlay
This got removed from PRODUCT_PACKAGES in frameworks/base, but it seems
like it still exists.

Change-Id: I8fe80c9c5a386ae1877f7c117ddc76ff366304a3
2021-03-06 09:33:22 +01:00
Pierre-Hugues HUSSON
d341ec23ff
Merge pull request #236 from sarthakroy2002/android-11.0
Fixed Bugs of Realme 7, Realme 6i(EU) and Realme Narzo 10
2021-03-05 15:51:16 +01:00
Sarthak Roy
6b93fc5f03
Fixed Bugs of Realme 7, Realme 6i(EU) and Realme Narzo 10 2021-03-05 19:19:56 +05:30
Pierre-Hugues Husson
a52cbb93d5 Revert "Fix not booting on A6+"
This reverts commit 33d1b1c196.
2021-03-05 14:34:49 +01:00
Pierre-Hugues Husson
b0b0b7cfe2 Revert "typo"
This reverts commit c1ef009983.
2021-03-05 14:34:35 +01:00
Pierre-Hugues Husson
c1ef009983 typo 2021-03-05 14:19:55 +01:00
Pierre-Hugues HUSSON
45a730c9c3
Merge pull request #235 from roynatech2544/android-11.0
Fix not booting on A6+
2021-03-04 08:59:28 +01:00
roynatech2544
33d1b1c196
Fix not booting on A6+ 2021-03-04 16:57:50 +09:00
Pierre-Hugues HUSSON
27d759a485
Merge pull request #233 from DarkJoker360/11-emui9-fp2
Address more Huawei fp denials
2021-03-01 10:22:02 +01:00
DarkJoker360
9e81647de7 Address more Huawei fp denials 2021-03-01 09:58:41 +01:00
Pierre-Hugues Husson
61d163657a Disable secondary watchdogs.
AOSP's watchdogd doesn't support multiple watchdogs.
This shouldn't be an issue, since AOSP GSI obviously doesn't support it
and AOSP GSI is part of certification.
HOWEVER, some people use modified kernel/vendors that may break such
assumptions. Anyway we can just disable it.

See https://github.com/phhusson/treble_experimentations/issues/1730#issuecomment-784222396
2021-02-23 15:00:54 +01:00
Pierre-Hugues Husson
b74ad8ea7e Rename all calls to resetprop to resetprop_phh to prevent conflict with Magisk, see d8056f8032 2021-02-22 10:04:28 +01:00
Pierre-Hugues HUSSON
f87c653336
Merge pull request #232 from eremitein/fixgms
fix gapps build
2021-02-16 08:33:44 +01:00
Victor Bo
1057669e03 fix gapps build
remove commit trash after
  b2eea56e6c

  FAILED:
  build/make/core/aapt2.mk:33: error: overriding commands for target
  `out/target/common/obj/APPS/SettingsProvider__auto_generated_rro_product_intermediates/flat-res/vendor/partner_gms/overlay/gms_overlay/frameworks/base/packages/SettingsProvider/res/values_defaults.arsc.flat',
  previously defined at build/make/core/aapt2.mk:27
  23:03:05 ckati failed with: exit status 1
2021-02-16 00:37:28 -05:00
Pierre-Hugues HUSSON
57bec6f2ca
Merge pull request #231 from eremitein/adb_selinux
Adb selinux
2021-02-15 19:00:33 +01:00
Victor Bo
d6aed01c48 sepolicy/init: fix adb in some cases
logs:
  02-06 17:28:44.560     1     1 I auditd  : type=1400
  audit(0.0:11): avc: denied { read } for comm="init"
  name="adbd" dev="mmcblk0p31" ino=11 scontext=u:r:init:s0
  tcontext=u:object_r:adbd_exec:s0 tclass=lnk_file permissive=0

  thanks HamiDo for hotfix
2021-02-15 12:54:48 -05:00
Victor Bo
19d8a296fa sepolicy/treble_app: add rule fix cam2api option
logs:
      17 00:47:48.796     1     1 W /system/bin/init: type=1107
      audit(0.0:357): uid=0 auid=4294967295 ses=4294967295
      subj=u:r:init:s0 msg='avc: denied { set } for
      property=persist.vendor.camera.eis.enable pid=4411 uid=1000
      gid=1000 scontext=u:r:system_app:s0
      tcontext=u:object_r:vendor_default_prop:s0 tclass=property_service
      permissive=0'

      01-17 00:47:48.796     1     1 W /system/bin/init: type=1107
      audit(0.0:356): uid=0 auid=4294967295 ses=4294967295
      subj=u:r:init:s0 msg='avc: denied { set } for
      property=persist.vendor.camera.HAL3.enabled pid=4411 uid=1000
      gid=1000 scontext=u:r:system_app:s0
      tcontext=u:object_r:vendor_default_prop:s0 tclass=property_service
      permissive=0'
2021-02-15 12:53:43 -05:00
Pierre-Hugues HUSSON
9868877f23
Merge pull request #229 from nitanmarcel/patch-1
Add Redmi/joyeuse to changeKeyLayout
2021-02-11 11:15:46 +01:00
Pierre-Hugues Husson
b2eea56e6c Include usb.host package feature. This shouldnt arm devices without actual hardware support 2021-02-09 16:01:58 +01:00
Nitan Alexandru Marcel
e936f0b83a
Add Redmi/joyeuse to changeKeyLayout
Fixes random touches on Redmi Note 9 Pro `joyeuse` when fingerprint is pressed
2021-02-09 12:36:12 +02:00
Pierre-Hugues Husson
7afda0d79f Fix build for s/google/partner_gms/ 2021-02-05 11:39:34 -05:00
Pierre-Hugues Husson
3d054e214d Add olive and angelica for Xiaomi fingerprint uinput blocklist 2021-02-02 22:04:42 +01:00
Pierre-Hugues Husson
9e6e2b6556 Mute console for everyone, not just secure usecase 2021-02-02 22:03:11 +01:00
Pierre-Hugues Husson
72c62260b9 Fix backlight on some Samsung devices
Some Samsung Q vendor devices have HWC rather than lights hal control.
In those cases, backlight is controlled through another SELinux context.
We used to correct this SELinux context for all devices, however this is
no longer needed, and actually breaks those devices.

So, change SELinux context, only if uid/gid is wrong
2021-01-30 22:59:23 +01:00
Pierre-Hugues HUSSON
c7438a5be6
Merge pull request #227 from kzubec/patch-2
Update rw-system.sh
2021-01-22 15:40:38 +01:00
kzubec
36881fc8a6
Update rw-system.sh 2021-01-22 16:45:55 +03:00
Pierre-Hugues HUSSON
09baacad99
Merge pull request #225 from DarkJoker360/11-emui9-fp
Address Huawei fingerprint denials
2021-01-22 10:53:15 +01:00
DarkJoker360
49a4d5ce06 Address Huawei fingerprint denials
* Fixes fingerprint enrollment issues on P vendor devices.
2021-01-22 10:46:46 +01:00
Pierre-Hugues Husson
43f324824a Fix video crashing on apps targetting Android 11, on some Mediatek devices (like Redmi 9) 2021-01-21 10:00:15 -05:00
Pierre-Hugues Husson
aae160672f Add a totally manual ADB, triggerable using /cache/phh-adb. This should help debugging early startup issues 2021-01-19 23:46:40 +01:00
Pierre-Hugues Husson
e444a5f575 Disable fdsan by default. This is already disabled by default on user build. Some HALs do not work properly with fdsan 2021-01-10 22:26:15 +01:00
Pierre-Hugues HUSSON
43f0b25585
Merge pull request #220 from JensBee/patch-1
Scan in /odm/etc/vintf for fingerprint sensor data
2021-01-08 13:12:49 +01:00
Pierre-Hugues Husson
0a0d3a10b2 Add persist.sys.phh.restart_ril to automatically restart MTK RIL. Also toggling it on will restart QC RIL 2020-12-29 20:27:25 +01:00
Jens Bertram
a853420626
Scan in /odm/etc/vintf for fingerprint sensor data
The manifest.xml for specifying the fingerprint sensor for the Fairphone 3 (SW-version 8901.3.A.0066.20201119) is located at /odm/etc/vintf/. This path is currently not scanned for manifest files. This proposed change includes this missing path an enables to use the fingerprint sensor on the FP3.
2020-12-17 21:55:49 +01:00
Pierre-Hugues HUSSON
e63e4d7cd9
Merge pull request #218 from PeterCxy/patch-qin-2-pro-sensors
rw-system: disable sensor direct report for Qin 2 Pro
2020-12-16 14:03:07 +01:00
Peter Cai
d93e046538 rw-system: disable sensor direct report on SPRD Pie vendor 2020-12-16 21:01:15 +08:00
Pierre-Hugues HUSSON
8e6f252902
Merge pull request #219 from PeterCxy/patch-sprd-ims
sepolicy: add spreadtrum IMS services
2020-12-16 13:47:48 +01:00
Peter Cai
70950fd8ee sepolicy: add spreadtrum IMS services 2020-12-16 19:42:09 +08:00
Pierre-Hugues HUSSON
93019de565
Merge pull request #216 from siddhrsh/patch-2
Added Realme C3 brightness& audio jack
2020-12-12 11:02:37 +01:00
Pierre-Hugues HUSSON
a19ac6062f
Merge pull request #215 from siddhrsh/patch-1
Realme C2 Headphones jack fix
2020-12-12 11:01:30 +01:00
Siddhesh Koyande
d07aa9e60c
Added Realme C3 brightness& audio jack 2020-12-12 10:49:49 +05:30
Siddhesh Koyande
c756d26c2b
Realme C2 Headphones jack fix 2020-12-12 08:27:23 +05:30
Pierre-Hugues Husson
8ff15241fd Disable root console on uart, and kernel logs on uart when secure 2020-12-11 14:51:01 +01:00
Pierre-Hugues Husson
843c0ec80a Add persist.sys.phh.backlight.scale to control brightness scale from treble app 2020-12-06 00:58:01 +01:00
Pierre-Hugues Husson
30071d0420 Use ext4 share duplicate blocks, it is sadly needed to attain acceptable partition size, because of duplication made by apexes 2020-12-05 22:21:06 +01:00
Pierre-Hugues Husson
5607a9be21 Use dev/input for jack detection on Realme C11 2020-11-30 11:00:38 +01:00
Pierre-Hugues Husson
f121aba763 Allow more blockdev --setrw 2020-11-30 11:00:38 +01:00
Pierre-Hugues Husson
30b84072fc Allow treble_app to set persist.vendor.vilte_support (to 0) 2020-11-29 09:36:05 -05:00
Pierre-Hugues Husson
147dca859c Realme C11 has same quirks for dt2w and brightness as previous Realme MTK devices 2020-11-29 08:08:50 -05:00
Pierre-Hugues Husson
3489a71cf2 Allow init to create system_file symlinks for A-only, see https://github.com/phhusson/treble_experimentations/issues/1553 2020-11-08 13:13:10 +01:00
Pierre-Hugues Husson
6ce1b9108d Galaxy S9 is stupid and still dont understand that android version/spl isnt relevant, so cheat android version/spl for them 2020-11-08 00:36:09 +01:00
Pierre-Hugues Husson
28b4d559a6 Set a property to find focaltech gesture node 2020-10-26 22:46:16 +01:00
Pierre-Hugues Husson
d1a638f4f8 Allow treble_app to access mediatek radio hal to detect it 2020-10-26 22:45:37 +01:00
Pierre-Hugues Husson
0ed42b1d02 Allow treble app to set more props 2020-10-25 21:11:27 +01:00
Pierre-Hugues Husson
018f36087d uevent cmd: allow filtering events 2020-10-25 21:11:27 +01:00
Pierre-Hugues Husson
1450230c31 Make rw-system debug easier, but just having to create /cache/phh-log (obviously works only if device has a cache partition), and having perms make it accessible from system app (treble app) 2020-10-25 21:11:27 +01:00
Pierre-Hugues HUSSON
1edc6980c7
Merge pull request #212 from tboy1991/android-11.0
Add redmi9 lancelot/galahad brightness and fingerprint fix
2020-10-18 21:41:07 +02:00
tboy1991
0b075d62bf Update rw-system.sh 2020-10-17 16:34:18 +02:00
Pierre-Hugues Husson
c67aa14ca5 Add android.software.controls to get controls in power long-press 2020-10-14 17:51:01 +02:00
tboy1991
dd952c5f1b Update rw-system.sh
Adds redmi9 lancelot/galahad brightness and fingerprint as enter fix
2020-10-13 18:48:21 +02:00
Pierre-Hugues Husson
2515e7d58a Fix CAF audio policy on non-boot 2020-10-13 17:19:48 +02:00
Pierre-Hugues Husson
ab62dcf481 On Allview V3 Viper, mnld (who handles GPS) crashes with double-mutex unlock. Fix this by forcing it to older SDK 2020-10-06 19:55:11 +02:00
Pierre-Hugues Husson
95bcf66d67 Some devices require their vendor mounted to /persist even if fstab says otherwise
See https://github.com/phhusson/treble_experimentations/issues/668
2020-10-05 22:13:44 +02:00
Pierre-Hugues HUSSON
bfa3c9b7dc
Merge pull request #207 from dev-harsh1998/android-11.0
treble: vndk: restart the surfaceflinger
2020-10-04 10:19:16 +02:00
Harshit Jain
dcf70913db
treble: vndk: restart the surfaceflinger
* not surfacecflinger
2020-10-04 12:30:36 +05:30
Pierre-Hugues Husson
78f5247606 Fix A2DP on some Qualcomm Q vendors by disable A2DP offload harder
Also there is a mismatch between framework which expects property to be
false/true and treble app setting it to 0/1
2020-10-02 20:04:12 +02:00
Pierre-Hugues Husson
7435a2a66e Mark fingerprint sensor as a secure biometric auth, so that fingerprint sensor can be used in apps 2020-10-02 11:56:34 +02:00
Pierre-Hugues Husson
7662a1675c Disable HWC presentOrValidate on vndk 26/27 2020-09-30 22:38:44 +02:00
Pierre-Hugues HUSSON
7f176889ee
Merge pull request #206 from SamarV-121/k
rw-system: Update extra vndk dir path
2020-09-30 11:57:22 +02:00
ѕαмαя νιѕρυтє
b79124f41b rw-system: Update extra vndk dir path
Signed-off-by: SamarV-121 <samarvispute121@gmail.com>
2020-09-30 09:55:09 +00:00
Pierre-Hugues Husson
41f0817f3f Up vendor minijail override, using vndk v28 minijail 2020-09-29 10:45:45 +02:00
Pierre-Hugues Husson
bbee56d39f ROG Phone III has an additional C2 in vendor. It requires updated seccomp policy 2020-09-27 20:12:39 +02:00
Pierre-Hugues Husson
c18b157a8d libsoftkeymasterdevice.so is a new path for vndk v26 2020-09-27 20:12:09 +02:00
Pierre-Hugues Husson
0ced2d3486 Fix dynamic ro.sf.lcd_density being ignored
On Qualcomm devices, ro.sf.lcd_density is set by a shell script in
/vendor, which will be called after surfaceflinger is started.
Thus surfaceflinger won't read any value, and will consider the default
value which is 213.

To fix this, restart surfaceflinger when ro.sf.lcd_density is changed.
2020-09-27 20:00:44 +02:00
Pierre-Hugues Husson
e08b947cc2 [twrp.sh] List usb controlers instead of fixing address 2020-09-27 19:58:40 +02:00
Pierre-Hugues Husson
6acd9f4763 Fix oppo-fp build 2020-09-27 19:57:46 +02:00
Pierre-Hugues Husson
510e08cefd Fix lptools build for Android 11 2020-09-27 19:57:32 +02:00
Pierre-Hugues Husson
5bcb2e09a8 Now an android.hardware.healthd is required. Include healthd which provides a backup implementation 2020-09-27 19:57:19 +02:00
Pierre-Hugues Husson
8bbe19ca57 Now overlays are done as RRO. DEVICE overlay will be in /vendor/overlay which we dont control. Change this to PRODUCT overlay so our overlay is taken into account 2020-09-27 19:56:20 +02:00
Pierre-Hugues Husson
1c3f1d6e4e in-tree VNDK integration is dead, it will be out-of-tree 2020-09-27 19:55:23 +02:00
Pierre-Hugues Husson
7c0c6c918c Disable EXT4 Share "feature" (this was already disabled in Android 10, but not on Android 11) 2020-09-11 10:33:49 +02:00
Pierre-Hugues Husson
0ce5feb194 This flag was added by mistake it's not needed (since it works on other targets) and prevents building Android 11 2020-09-11 10:33:20 +02:00
43 changed files with 1204 additions and 171 deletions

1
amyROM.mk Normal file
View File

@ -0,0 +1 @@
$(call inherit-product, vendor/amy/config/common.mk)

26
base.mk
View File

@ -6,13 +6,14 @@ PRODUCT_COPY_FILES := \
frameworks/native/data/etc/android.hardware.telephony.ims.xml:system/etc/permissions/android.hardware.telephony.ims.xml \
frameworks/native/data/etc/android.hardware.bluetooth.xml:system/etc/permissions/android.hardware.bluetooth.xml \
frameworks/native/data/etc/android.hardware.bluetooth_le.xml:system/etc/permissions/android.hardware.bluetooth_le.xml \
frameworks/native/data/etc/android.hardware.usb.host.xml:system/etc/permissions/android.hardware.usb.host.xml \
#Use a more decent APN config
PRODUCT_COPY_FILES += \
device/sample/etc/apns-full-conf.xml:system/etc/apns-conf.xml
BOARD_PLAT_PRIVATE_SEPOLICY_DIR += device/phh/treble/sepolicy
DEVICE_PACKAGE_OVERLAYS += device/phh/treble/overlay
PRODUCT_PACKAGE_OVERLAYS += device/phh/treble/overlay
$(call inherit-product, vendor/hardware_overlay/overlay.mk)
$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
@ -42,7 +43,8 @@ PRODUCT_COPY_FILES += \
#USB Audio
PRODUCT_COPY_FILES += \
frameworks/av/services/audiopolicy/config/usb_audio_policy_configuration.xml:system/etc/usb_audio_policy_configuration.xml
frameworks/av/services/audiopolicy/config/usb_audio_policy_configuration.xml:system/etc/usb_audio_policy_configuration.xml \
device/phh/treble/files/fake_audio_policy_volume.xml:system/etc/fake_audio_policy_volume.xml \
# NFC:
# Provide default libnfc-nci.conf file for devices that does not have one in
@ -122,8 +124,13 @@ PRODUCT_COPY_FILES += \
device/phh/treble/files/daisy-uinput-fpc.kl:system/phh/daisy-uinput-fpc.kl \
device/phh/treble/files/daisy-uinput-goodix.kl:system/phh/daisy-uinput-goodix.kl \
device/phh/treble/files/nubia-nubia_synaptics_dsx.kl:system/phh/nubia-nubia_synaptics_dsx.kl \
device/phh/treble/files/unihertz-mtk-kpd.kl:system/phh/unihertz-mtk-kpd.kl \
device/phh/treble/files/unihertz-mtk-tpd.kl:system/phh/unihertz-mtk-tpd.kl \
device/phh/treble/files/unihertz-mtk-tpd-kpd.kl:system/phh/unihertz-mtk-tpd-kpd.kl \
device/phh/treble/files/unihertz-fingerprint_key.kl:system/phh/unihertz-fingerprint_key.kl \
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 \
SELINUX_IGNORE_NEVERALLOWS := true
@ -151,7 +158,8 @@ PRODUCT_PACKAGES += \
Stk
PRODUCT_PACKAGES += \
resetprop
resetprop_phh
PRODUCT_COPY_FILES += \
device/phh/treble/phh-securize.sh:system/bin/phh-securize.sh \
device/phh/treble/files/ota.sh:system/bin/ota.sh \
@ -161,6 +169,7 @@ PRODUCT_COPY_FILES += \
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.software.secure_lock_screen.xml:system/etc/permissions/android.software.secure_lock_screen.xml \
device/phh/treble/files/android.software.controls.xml:system/etc/permissions/android.software.controls.xml \
PRODUCT_COPY_FILES += \
device/phh/treble/ld.config.26.txt:system/etc/ld.config.26.txt \
@ -180,8 +189,19 @@ PRODUCT_COPY_FILES += \
PRODUCT_PACKAGES += \
android.hardware.biometrics.fingerprint@2.1-service.oppo.compat \
android.hardware.biometrics.fingerprint@2.1-service.oplus.compat \
PRODUCT_PACKAGES += \
vr_hwc \
curl \
healthd \
PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
debug.fdsan=warn_once \
# AOSP overlays
PRODUCT_PACKAGES += \
NavigationBarMode2ButtonOverlay
PRODUCT_PACKAGES += \
oplus-alert-slider

View File

@ -198,6 +198,8 @@ cc_binary {
"libfs_mgr",
"libutils",
"libcutils",
"android.hardware.boot@1.1",
"libhidlbase",
],
static_libs: [
"libdm",
@ -210,6 +212,36 @@ cc_binary {
],
}
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: [
@ -221,3 +253,13 @@ cc_binary {
"libhidlbase",
],
}
cc_binary {
name: "oplus-alert-slider",
srcs: [
"oplus-alert-slider.cpp",
],
init_rc: [
"oplus-alert-slider.rc",
],
}

View File

@ -40,6 +40,11 @@
#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;
@ -62,7 +67,6 @@ public:
static FileOrBlockDeviceOpener opener;
std::unique_ptr<MetadataBuilder> makeBuilder() {
MetadataBuilder::OverrideABForTesting(false);
auto builder = MetadataBuilder::New(opener, "super", 0);
if(builder == nullptr) {
std::cout << "Failed creating super builder" << std::endl;
@ -78,8 +82,25 @@ void saveToDisk(std::unique_ptr<MetadataBuilder> builder) {
}
}
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) {
@ -117,15 +138,20 @@ int main(int argc, char **argv) {
exit(1);
}
partition = builder->AddPartition(partName, group, 0);
std::cout << "Growing partition " << builder->ResizePartition(partition, size) << std::endl;
auto result = builder->ResizePartition(partition, size);
std::cout << "Growing partition " << result << std::endl;
if(!result) return 1;
saveToDisk(std::move(builder));
std::string dmPath;
auto dmCreateRes = android::fs_mgr::CreateLogicalPartition(
"/dev/block/by-name/super",
0, partName,
true,
std::chrono::milliseconds(10000), &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) {
@ -136,7 +162,7 @@ int main(int argc, char **argv) {
auto partName = argv[2];
auto dmState = android::dm::DeviceMapper::Instance().GetState(partName);
if(dmState == android::dm::DmDeviceState::ACTIVE) {
android::fs_mgr::DestroyLogicalPartition(partName, std::chrono::milliseconds(2000));
android::fs_mgr::DestroyLogicalPartition(partName);
}
builder->RemovePartition(partName);
saveToDisk(std::move(builder));
@ -161,13 +187,23 @@ int main(int argc, char **argv) {
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();
std::cerr << (linear != nullptr) << std::endl;
if(linear != nullptr) {
auto copyLinear = std::make_unique<LinearExtent>(linear->num_sectors(), linear->device_index(), linear->physical_sector());
originalExtents.push_back(std::move(copyLinear));
@ -176,9 +212,9 @@ int main(int argc, char **argv) {
originalExtents.push_back(std::move(copyZero));
}
}
builder->RemovePartition(src);
builder->RemovePartition(dst);
auto newDstPartition = builder->AddPartition(dst, group, 0);
builder->RemovePartition(srcPartition->name());
builder->RemovePartition(dstPartitionName);
auto newDstPartition = builder->AddPartition(dstPartitionName, group, 0);
for(auto&& extent: originalExtents) {
newDstPartition->AddExtent(std::move(extent));
}
@ -191,11 +227,14 @@ int main(int argc, char **argv) {
}
auto partName = argv[2];
std::string dmPath;
auto dmCreateRes = android::fs_mgr::CreateLogicalPartition(
"/dev/block/by-name/super",
0, partName,
true,
std::chrono::milliseconds(10000), &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) {
@ -206,9 +245,64 @@ int main(int argc, char **argv) {
auto partName = argv[2];
auto dmState = android::dm::DeviceMapper::Instance().GetState(partName);
if(dmState == android::dm::DmDeviceState::ACTIVE) {
android::fs_mgr::DestroyLogicalPartition(partName, std::chrono::milliseconds(2000));
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

@ -0,0 +1,54 @@
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <linux/input.h>
int read_tristate() {
int fd = open("/proc/tristatekey/tri_state", O_RDONLY);
char p[16];
int ret = read(fd, p, sizeof(p) - 1);
p[ret] = 0;
return atoi(p);
}
int main() {
int fd = -1;
for(int i=0; i<255; i++) {
char path[256];
snprintf(path, 256, "/dev/input/event%d", i);
fd = open(path, O_RDWR);
if(fd == -1) continue;
char name[256];
ioctl(fd, EVIOCGNAME(256), name);
printf("Got input name %s\n", name);
if(strcmp(name, "oplus,hall_tri_state_key") == 0) {
break;
}
close(fd);
fd = -1;
}
if(fd == -1) return 0;
ioctl(fd, EVIOCGRAB, 1);
struct input_event ev;
while(read(fd, &ev, sizeof(ev)) != 0) {
if(!(ev.code == 61 && ev.value == 0)) continue;
int state = read_tristate();
if(state == 1) {
}
printf("State %d\n", read_tristate());
if(state == 1) {
system("service call audio 31 i32 2 s16 android");
} else if(state == 2) {
system("service call audio 31 i32 1 s16 android");
} else if(state == 3) {
system("service call audio 31 i32 0 s16 android");
}
}
}

View File

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

View File

@ -41,10 +41,17 @@ typedef struct chunk_header {
* For a CRC32 chunk, it's 4 bytes of CRC32
*/
static int disable_splice = 0;
void nsendfile(int out_fd, int in_fd, size_t count) {
char buf[1024*1024];
while(count) {
ssize_t res = splice(in_fd, NULL, out_fd, NULL, count, 0);
ssize_t res = -1;
if(!disable_splice) {
res = splice(in_fd, NULL, out_fd, NULL, count, 0);
}
if(count > 16*1024 && res < 1024)
disable_splice = 1;
if(res==-1) {
ssize_t sizeToRead = sizeof(buf);
if(count < sizeToRead) sizeToRead = count;

View File

@ -44,6 +44,11 @@ int main(int argc, char **argv, char **envp) {
if (buflen<0) {
exit(1);
}
if(argc>=2) {
if(!strstr(buffer, argv[1])) continue;
}
printf("%s\n", buffer);
char *pos = buffer + strlen(buffer);
char *end = buffer + buflen;

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<permissions>
<feature name="android.software.controls" />
</permissions>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<audioPolicyConfiguration version="1.0" xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="/vendor/etc/audio_policy_volumes.xml"/>
<xi:include href="/vendor/etc/default_volume_tables.xml"/>
</audioPolicyConfiguration>

View File

@ -1,65 +1,72 @@
#!/bin/bash
#!/system/bin/sh
set -e
latestVersion=$(curl -L --silent https://api.github.com/repos/phhusson/treble_experimentations/releases |grep -oE 'v2[0-9]*' |sort -V |sort -u |tail -n 1)
if [ -n "$1" ];then
echo "Forcing dl of version $1 instead of $latestVersion"
latestVersion="$1"
if ! [ "$(getprop ro.boot.dynamic_partitions)" = true ];then
echo "OTA is supported only for devices with dynamic partitions!"
exit 1
fi
flavor=$(getprop ro.build.flavor)
fileName=""
fileName="system-quack"
if echo "$flavor" |grep -E '^treble_arm64';then
fileName="${fileName}-arm64"
elif echo "$flavor" | grep -E '^treble_arm_';then
fileName="${fileName}-arm"
elif echo "$flavor" | grep -E '^treble_a64_';then
fileName="${fileName}-arm32_binder64"
flavor=$(getprop ro.product.product.name)
nextVersion=$(curl --silent -L https://raw.githubusercontent.com/phhusson/treble_experimentations/master/ota/roar/$flavor/date)
if [ -z "$nextVersion" ];then
echo "Couldn't find any OTA for $flavor"
exit 1
fi
if echo "$flavor" |grep -E '^treble_[^_]*_b';then
fileName="${fileName}-ab"
elif echo "$flavor" |grep -E '^treble_[^_]*_a';then
fileName="${fileName}-aonly"
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)
if [ "$(getprop ro.product.build.date.utc)" = "$nextVersion" ];then
echo "Installing $nextVersion onto itself, aborting"
exit 1
fi
if echo "$flavor" |grep -E '^treble_[^_]*_.g';then
fileName="${fileName}-gapps"
elif echo "$flavor" |grep -E '^treble_[^_]*_.o';then
fileName="${fileName}-go"
elif echo "$flavor" |grep -E '^treble_[^_]*_.f';then
fileName="${fileName}-floss"
elif echo "$flavor" |grep -E '^treble_[^_]*_.v';then
fileName="${fileName}-floss"
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
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
exit 1
fi
fi
fileName="${fileName}.img.xz"
url=https://github.com/phhusson/treble_experimentations/releases/download/"$latestVersion"/"${fileName}"
echo "Downloading from ${url}..."
#This path is really NOT ideal.
out=/sdcard/sys.img.xz
curl -L "$url" > $out
if [ "$(getprop ro.boot.dynamic_partitions)" = true ];then
#Having to decompress twice is pretty stupid, but how do I get the size otherwise?
size=$(busybox_phh xz -d -c < $out | simg2img_simple |wc -c)
lptools remove system_phh
lptools create system_phh "$size"
lptools unmap system_phh
dmDevice=$(lptools map system_phh|grep -oE '/dev/block/[^ ]*')
busybox_phh xz -d -c < $out | simg2img_simple > $dmDevice
lptools replace system_phh system
reboot
exit 0
else
#Use twrp.sh
mkdir -p /cache/phh
uncrypt /data/media/0/sys.img.xz /cache/phh/block.map
touch /cache/phh/flash
reboot
exit 0
if [ -b /dev/tmp-phh ] && ! tune2fs -l /dev/tmp-phh |grep 'Last mount time' |grep -q n/a;then
echo "Warning! It looks like you modified your system image! Flashing this OTA will revert this!"
echo "Type YES to acknowledge"
read answer
if ! [ "$answer" = YES ];then
exit 1
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
lptools replace system_phh system
reboot
exit 0

View File

@ -0,0 +1,4 @@
key 114 VOLUME_DOWN
key 115 VOLUME_UP
key 116 POWER
key 456 WAKEUP

View File

@ -0,0 +1,3 @@
# Key layout for Unihertz devices with fingerprint sensor
# For Atom {,L,XL}: fingerprint sensor as home
key 172 HOME VIRTUAL

13
files/unihertz-mtk-kpd.kl Normal file
View File

@ -0,0 +1,13 @@
# Keylayout for Unihertz devices with a dedicated PTT button
# Volume buttons
key 115 VOLUME_UP
key 114 VOLUME_DOWN
# Power button
key 116 POWER
# PTT - Remap to camera by default
# CAMERA is delivered to apps, so remapping via
# third-party apps is possible
key 249 CAMERA
key 250 CAMERA

View File

@ -0,0 +1,6 @@
# Keylayout for Unihertz devices with capacitive keys
# Capacitive navigation
key 172 HOME VIRTUAL
key 580 APP_SWITCH VIRTUAL
key 158 BACK VIRTUAL

View File

@ -0,0 +1,6 @@
# Keylayout for Unihertz devices with capacitive keys
# Capacitive navigation
key 172 HOME VIRTUAL
key 580 APP_SWITCH VIRTUAL
key 158 BACK VIRTUAL

View File

@ -1,6 +1,7 @@
BUILD_GMS := yes
#include not inherit, because we must edit some values
include vendor/google/products/gms_go.mk
-include vendor/google/products/gms_go.mk
-include vendor/partner_gms/products/gms_go.mk
FILTER_OUT = $(foreach v,$(2),$(if $(findstring $(1),$(v)),,$(v)))

View File

@ -1,6 +1,7 @@
BUILD_GMS := yes
ifneq ($(wildcard vendor/google),)
ifneq ($(wildcard vendor/google)$(wildcard vendor/partner_gms),)
-include vendor/google/products/gms.mk
-include vendor/partner_gms/products/gms.mk
PRODUCT_SHIPPING_API_LEVEL :=
PRODUCT_PACKAGES := $(filter-out CalendarGoogle, $(PRODUCT_PACKAGES))
@ -22,7 +23,7 @@ PRODUCT_COPY_FILES += \
device/phh/treble/empty-permission.xml:system/etc/permissions/com.google.android.camera.experimental2016.xml \
device/phh/treble/empty-permission.xml:system/etc/permissions/com.google.android.camera.experimental2017.xml
DEVICE_PACKAGE_OVERLAYS += device/phh/treble/overlay-gapps
PRODUCT_PACKAGE_OVERLAYS += device/phh/treble/overlay-gapps
GAPPS_VARIANT := pico
DONT_DEXPREOPT_PREBUILTS := true
WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY := true

View File

@ -80,7 +80,6 @@ for part in a ab;do
TARGET_GAPPS_ARCH := ${baseArch}
\$(call inherit-product, device/phh/treble/base-pre.mk)
include build/make/target/product/aosp_${baseArch}_ab.mk
\$(call inherit-product, vendor/vndk/${vndk})
\$(call inherit-product, device/phh/treble/base.mk)
$optional_base
$apps_script
@ -88,7 +87,8 @@ $rom_script
PRODUCT_NAME := $target
PRODUCT_DEVICE := phhgsi_${arch}_$part
PRODUCT_BRAND := Android
PRODUCT_BRAND := Phh
PRODUCT_SYSTEM_BRAND := Phh
PRODUCT_MODEL := Phh-Treble $apps_name
PRODUCT_PACKAGES += $extra_packages

23
hal/oplus-fp/Android.bp Normal file
View File

@ -0,0 +1,23 @@
cc_binary {
name: "android.hardware.biometrics.fingerprint@2.1-service.oplus.compat",
defaults: ["hidl_defaults"],
init_rc: ["android.hardware.biometrics.fingerprint@2.1-service.oplus.rc"],
relative_install_path: "hw",
srcs: [
"BiometricsFingerprint.cpp",
"service.cpp",
],
cflags: [
"-Wno-unused-parameter",
],
shared_libs: [
"libcutils",
"liblog",
"libhidlbase",
"libhardware",
"libutils",
"libbase",
"android.hardware.biometrics.fingerprint@2.1",
"vendor.oplus.hardware.biometrics.fingerprint@2.1",
],
}

View File

@ -0,0 +1,267 @@
/*
* Copyright (C) 2017 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.
*/
#define LOG_TAG "android.hardware.biometrics.fingerprint@2.1-service.oplus.compat"
#define LOG_VERBOSE "android.hardware.biometrics.fingerprint@2.1-service.oplus.compat"
#include <hardware/hardware.h>
#include <hardware/fingerprint.h>
#include "BiometricsFingerprint.h"
#include <inttypes.h>
#include <unistd.h>
#include <utils/Log.h>
#include <thread>
namespace android {
namespace hardware {
namespace biometrics {
namespace fingerprint {
namespace V2_1 {
namespace implementation {
BiometricsFingerprint::BiometricsFingerprint() {
for(int i=0; i<10; i++) {
mOplusBiometricsFingerprint = vendor::oplus::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprint::tryGetService();
if(mOplusBiometricsFingerprint != nullptr) break;
sleep(10);
}
if(mOplusBiometricsFingerprint == nullptr) exit(0);
}
static bool receivedCancel;
static bool receivedEnumerate;
static uint64_t myDeviceId;
static std::vector<uint32_t> knownFingers;
class OplusClientCallback : public vendor::oplus::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprintClientCallback {
public:
sp<android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprintClientCallback> mClientCallback;
OplusClientCallback(sp<android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprintClientCallback> clientCallback) : mClientCallback(clientCallback) {}
Return<void> onEnrollResult(uint64_t deviceId, uint32_t fingerId,
uint32_t groupId, uint32_t remaining) {
ALOGE("onEnrollResult %" PRIu64 " %u %u %u", deviceId, fingerId, groupId, remaining);
if(mClientCallback != nullptr)
mClientCallback->onEnrollResult(deviceId, fingerId, groupId, remaining);
return Void();
}
Return<void> onAcquired(uint64_t deviceId, vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo acquiredInfo,
int32_t vendorCode) {
ALOGE("onAcquired %" PRIu64 " %d", deviceId, vendorCode);
if(mClientCallback != nullptr)
mClientCallback->onAcquired(deviceId, OplusToAOSPFingerprintAcquiredInfo(acquiredInfo), vendorCode);
return Void();
}
Return<void> onAuthenticated(uint64_t deviceId, uint32_t fingerId, uint32_t groupId,
const hidl_vec<uint8_t>& token) {
ALOGE("onAuthenticated %" PRIu64 " %u %u", deviceId, fingerId, groupId);
if(mClientCallback != nullptr)
mClientCallback->onAuthenticated(deviceId, fingerId, groupId, token);
return Void();
}
Return<void> onError(uint64_t deviceId, vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintError error, int32_t vendorCode) {
ALOGE("onError %" PRIu64 " %d", deviceId, vendorCode);
if(error == vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_CANCELED) {
receivedCancel = true;
}
if(mClientCallback != nullptr)
mClientCallback->onError(deviceId, OplusToAOSPFingerprintError(error), vendorCode);
return Void();
}
Return<void> onRemoved(uint64_t deviceId, uint32_t fingerId, uint32_t groupId,
uint32_t remaining) {
ALOGE("onRemoved %" PRIu64 " %" PRIu32, deviceId, fingerId);
if(mClientCallback != nullptr)
mClientCallback->onRemoved(deviceId, fingerId, groupId, remaining);
return Void();
}
Return<void> onEnumerate(uint64_t deviceId, uint32_t fingerId, uint32_t groupId,
uint32_t remaining) {
receivedEnumerate = true;
ALOGE("onEnumerate %" PRIu64 " %u %u %u", deviceId, fingerId, groupId, remaining);
if(mClientCallback != nullptr)
mClientCallback->onEnumerate(deviceId, fingerId, groupId, remaining);
return Void();
}
Return<void> onTouchUp(uint64_t deviceId) { return Void(); }
Return<void> onTouchDown(uint64_t deviceId) { return Void(); }
Return<void> onSyncTemplates(uint64_t deviceId, const hidl_vec<uint32_t>& fingerId, uint32_t remaining) {
ALOGE("onSyncTemplates %" PRIu64 " %zu %" PRIu32, deviceId, fingerId.size(), remaining);
myDeviceId = deviceId;
for(auto fid : fingerId) {
ALOGE("\t- %u", fid);
}
knownFingers = fingerId;
return Void();
}
Return<void> onFingerprintCmd(int32_t deviceId, const hidl_vec<uint32_t>& groupId, uint32_t remaining) { return Void(); }
Return<void> onImageInfoAcquired(uint32_t type, uint32_t quality, uint32_t match_score) { return Void(); }
Return<void> onMonitorEventTriggered(uint32_t type, const hidl_string& data) { return Void(); }
Return<void> onEngineeringInfoUpdated(uint32_t length, const hidl_vec<uint32_t>& keys, const hidl_vec<hidl_string>& values) { return Void(); }
Return<void> onUIReady(int64_t deviceId) { return Void(); }
private:
Return<android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo> OplusToAOSPFingerprintAcquiredInfo(vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo info) {
switch(info) {
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_GOOD: return android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_GOOD;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_PARTIAL: return android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_PARTIAL;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_INSUFFICIENT: return android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_INSUFFICIENT;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_IMAGER_DIRTY: return android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_IMAGER_DIRTY;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_TOO_SLOW: return android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_TOO_SLOW;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_TOO_FAST: return android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_TOO_FAST;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_VENDOR: return android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_VENDOR;
default:
return android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_GOOD;
}
}
Return<android::hardware::biometrics::fingerprint::V2_1::FingerprintError> OplusToAOSPFingerprintError(vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintError error) {
switch(error) {
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_NO_ERROR: return android::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_NO_ERROR;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_HW_UNAVAILABLE: return android::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_HW_UNAVAILABLE;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_UNABLE_TO_PROCESS: return android::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_UNABLE_TO_PROCESS;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_TIMEOUT: return android::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_TIMEOUT;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_NO_SPACE: return android::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_NO_SPACE;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_CANCELED: return android::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_CANCELED;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_UNABLE_TO_REMOVE: return android::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_UNABLE_TO_REMOVE;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_LOCKOUT: return android::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_LOCKOUT;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_VENDOR: return android::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_VENDOR;
default:
return android::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_NO_ERROR;
}
}
};
Return<uint64_t> BiometricsFingerprint::setNotify(
const sp<IBiometricsFingerprintClientCallback>& clientCallback) {
ALOGE("setNotify");
mOplusClientCallback = new OplusClientCallback(clientCallback);
return mOplusBiometricsFingerprint->setNotify(mOplusClientCallback);
}
Return<RequestStatus> BiometricsFingerprint::OplusToAOSPRequestStatus(vendor::oplus::hardware::biometrics::fingerprint::V2_1::RequestStatus req) {
switch(req) {
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_UNKNOWN: return RequestStatus::SYS_UNKNOWN;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_OK: return RequestStatus::SYS_OK;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_ENOENT: return RequestStatus::SYS_ENOENT;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_EINTR: return RequestStatus::SYS_EINTR;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_EIO: return RequestStatus::SYS_EIO;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_EAGAIN: return RequestStatus::SYS_EAGAIN;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_ENOMEM: return RequestStatus::SYS_ENOMEM;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_EACCES: return RequestStatus::SYS_EACCES;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_EFAULT: return RequestStatus::SYS_EFAULT;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_EBUSY: return RequestStatus::SYS_EBUSY;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_EINVAL: return RequestStatus::SYS_EINVAL;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_ENOSPC: return RequestStatus::SYS_ENOSPC;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_ETIMEDOUT: return RequestStatus::SYS_ETIMEDOUT;
default:
return RequestStatus::SYS_UNKNOWN;
}
}
Return<uint64_t> BiometricsFingerprint::preEnroll() {
ALOGE("preEnroll");
return mOplusBiometricsFingerprint->preEnroll();
}
Return<RequestStatus> BiometricsFingerprint::enroll(const hidl_array<uint8_t, 69>& hat,
uint32_t gid, uint32_t timeoutSec) {
ALOGE("enroll");
return OplusToAOSPRequestStatus(mOplusBiometricsFingerprint->enroll(hat, gid, timeoutSec));
}
Return<RequestStatus> BiometricsFingerprint::postEnroll() {
ALOGE("postEnroll");
return OplusToAOSPRequestStatus(mOplusBiometricsFingerprint->postEnroll());
}
Return<uint64_t> BiometricsFingerprint::getAuthenticatorId() {
ALOGE("getAuthId");
return mOplusBiometricsFingerprint->getAuthenticatorId();
}
Return<RequestStatus> BiometricsFingerprint::cancel() {
receivedCancel = false;
RequestStatus ret = OplusToAOSPRequestStatus(mOplusBiometricsFingerprint->cancel());
ALOGE("CANCELING");
if(!receivedCancel) {
ALOGE("Sending cancel error");
mOplusClientCallback->mClientCallback->onError(
myDeviceId,
android::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_CANCELED,
0);
}
return ret;
}
Return<RequestStatus> BiometricsFingerprint::enumerate() {
receivedEnumerate = false;
RequestStatus ret = OplusToAOSPRequestStatus(mOplusBiometricsFingerprint->enumerate());
ALOGE("ENUMERATING");
if(ret == RequestStatus::SYS_OK && !receivedEnumerate) {
size_t nFingers = knownFingers.size();
ALOGE("received fingers, sending our own %zu", nFingers);
if(nFingers > 0) {
for(auto finger: knownFingers) {
mOplusClientCallback->mClientCallback->onEnumerate(
myDeviceId,
finger,
0,
--nFingers);
}
} else {
mOplusClientCallback->mClientCallback->onEnumerate(
myDeviceId,
0,
0,
0);
}
}
return ret;
}
Return<RequestStatus> BiometricsFingerprint::remove(uint32_t gid, uint32_t fid) {
ALOGE("remove");
return OplusToAOSPRequestStatus(mOplusBiometricsFingerprint->remove(gid, fid));
}
Return<RequestStatus> BiometricsFingerprint::setActiveGroup(uint32_t gid,
const hidl_string& storePath) {
ALOGE("setActiveGroup");
return OplusToAOSPRequestStatus(mOplusBiometricsFingerprint->setActiveGroup(gid, storePath));
}
Return<RequestStatus> BiometricsFingerprint::authenticate(uint64_t operationId, uint32_t gid) {
ALOGE("auth");
return OplusToAOSPRequestStatus(mOplusBiometricsFingerprint->authenticate(operationId, gid));
}
} // namespace implementation
} // namespace V2_1
} // namespace fingerprint
} // namespace biometrics
} // namespace hardware
} // namespace android

View File

@ -0,0 +1,78 @@
/*
* Copyright (C) 2017 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.
*/
#ifndef ANDROID_HARDWARE_BIOMETRICS_FINGERPRINT_V2_1_BIOMETRICSFINGERPRINT_H
#define ANDROID_HARDWARE_BIOMETRICS_FINGERPRINT_V2_1_BIOMETRICSFINGERPRINT_H
#include <log/log.h>
#include <android/log.h>
#include <hardware/hardware.h>
#include <hardware/fingerprint.h>
#include <hidl/MQDescriptor.h>
#include <hidl/Status.h>
#include <android/hardware/biometrics/fingerprint/2.1/IBiometricsFingerprint.h>
#include <android/hardware/biometrics/fingerprint/2.1/types.h>
#include <vendor/oplus/hardware/biometrics/fingerprint/2.1/IBiometricsFingerprint.h>
namespace android {
namespace hardware {
namespace biometrics {
namespace fingerprint {
namespace V2_1 {
namespace implementation {
using ::android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprint;
using ::android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprintClientCallback;
using ::android::hardware::biometrics::fingerprint::V2_1::RequestStatus;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::hardware::hidl_vec;
using ::android::hardware::hidl_string;
using ::android::OK;
using ::android::sp;
using ::android::status_t;
class OplusClientCallback;
struct BiometricsFingerprint : public IBiometricsFingerprint {
public:
BiometricsFingerprint();
// Methods from ::android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprint follow.
Return<uint64_t> setNotify(const sp<IBiometricsFingerprintClientCallback>& clientCallback) override;
Return<uint64_t> preEnroll() override;
Return<RequestStatus> enroll(const hidl_array<uint8_t, 69>& hat, uint32_t gid, uint32_t timeoutSec) override;
Return<RequestStatus> postEnroll() override;
Return<uint64_t> getAuthenticatorId() override;
Return<RequestStatus> cancel() override;
Return<RequestStatus> enumerate() override;
Return<RequestStatus> remove(uint32_t gid, uint32_t fid) override;
Return<RequestStatus> setActiveGroup(uint32_t gid, const hidl_string& storePath) override;
Return<RequestStatus> authenticate(uint64_t operationId, uint32_t gid) override;
private:
sp<vendor::oplus::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprint> mOplusBiometricsFingerprint;
sp<OplusClientCallback> mOplusClientCallback;
static Return<RequestStatus> OplusToAOSPRequestStatus(vendor::oplus::hardware::biometrics::fingerprint::V2_1::RequestStatus req);
};
} // namespace implementation
} // namespace V2_1
} // namespace fingerprint
} // namespace biometrics
} // namespace hardware
} // namespace android
#endif // ANDROID_HARDWARE_BIOMETRICS_FINGERPRINT_V2_1_BIOMETRICSFINGERPRINT_H

View File

@ -0,0 +1,9 @@
service fps_hal.oplus.compat /system/bin/hw/android.hardware.biometrics.fingerprint@2.1-service.oplus.compat
# "class hal" causes a race condition on some devices due to files created
# in /data. As a workaround, postpone startup until later in boot once
# /data is mounted.
class late_start
user system
group system input uhid
writepid /dev/cpuset/system-background/tasks
oneshot

61
hal/oplus-fp/service.cpp Normal file
View File

@ -0,0 +1,61 @@
/*
* Copyright (C) 2017 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.
*/
#define LOG_TAG "android.hardware.biometrics.fingerprint@2.1-service.realme_sdm710"
#include <android-base/logging.h>
#include <hidl/HidlTransportSupport.h>
#include "BiometricsFingerprint.h"
using android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprint;
using android::hardware::biometrics::fingerprint::V2_1::implementation::BiometricsFingerprint;
using android::hardware::configureRpcThreadpool;
using android::hardware::joinRpcThreadpool;
using android::OK;
using android::sp;
using android::status_t;
int main() {
sp<BiometricsFingerprint> biometricsFingerprint;
status_t status;
LOG(INFO) << "Fingerprint HAL Adapter service is starting.";
biometricsFingerprint = new BiometricsFingerprint();
if (biometricsFingerprint == nullptr) {
LOG(ERROR) << "Can not create an instance of Fingerprint HAL Adapter BiometricsFingerprint Iface, exiting.";
goto shutdown;
}
configureRpcThreadpool(1, true /*callerWillJoin*/);
status = biometricsFingerprint->registerAsService();
if (status != OK) {
LOG(ERROR) << "Could not register service for Fingerprint HAL Adapter BiometricsFingerprint Iface ("
<< status << ")";
goto shutdown;
}
LOG(INFO) << "Fingerprint HAL Adapter service is ready.";
joinRpcThreadpool();
// Should not pass this line
shutdown:
// In normal operation, we don't expect the thread pool to shutdown
LOG(ERROR) << "Fingerprint HAL Adapter service is shutting down.";
return 1;
}

View File

@ -14,7 +14,6 @@ cc_binary {
"libcutils",
"liblog",
"libhidlbase",
"libhidltransport",
"libhardware",
"libutils",
"libbase",

View File

@ -26,6 +26,11 @@
<bool name="config_unplugTurnsOnScreen">true</bool>
<integer name="config_multiuserMaximumUsers">5</integer>
<bool name="config_enableMultiUserUI">true</bool>
<!-- This device is data-only. -->
<bool name="config_voice_capable">false</bool>
<!-- This device does not allow sms service. -->
<bool name="config_sms_capable">false</bool>
<string name="config_dozeComponent">com.android.systemui/com.android.systemui.doze.DozeService</string>
<bool name="config_swipe_up_gesture_setting_available">true</bool>
@ -34,4 +39,20 @@
<dimen name="config_buttonCornerRadius">4.0dip</dimen>
<bool name="config_cellBroadcastAppLinks">true</bool>
<string-array name="config_biometric_sensors" translatable="false" >
<!-- ID0:Fingerprint:Strong -->
<item>0:2:15</item>
</string-array>
<array name="config_availableColorModes">
<!-- ColorDisplayManager.COLOR_MODE_NATURAL -->
<item>0</item>
<!-- ColorDisplayManager.COLOR_MODE_BOOSTED -->
<item>1</item>
<!-- ColorDisplayManager.COLOR_MODE_SATURATED -->
<item>2</item>
<!-- ColorDisplayManager.COLOR_MODE_AUTOMATIC -->
<item>3</item>
</array>
</resources>

View File

@ -36,18 +36,20 @@ setprop ctl.stop storageproxyd
sleep 10
minijailSrc=/system/system_ext/apex/com.android.vndk.v28/lib/libminijail.so
minijailSrc64=/system/system_ext/apex/com.android.vndk.v28/lib64/libminijail.so
if [ "$vndk" = 27 ];then
mount /system/lib64/vndk-27/libminijail.so /vendor/lib64/libminijail_vendor.so
mount /system/lib/vndk-27/libminijail.so /vendor/lib/libminijail_vendor.so
mount $minijailSrc64 /vendor/lib64/libminijail_vendor.so
mount $minijailSrc /vendor/lib/libminijail_vendor.so
fi
if [ "$vndk" = 28 ];then
mount /system/lib64/vndk-27/libminijail.so /vendor/lib64/libminijail_vendor.so
mount /system/lib/vndk-27/libminijail.so /vendor/lib/libminijail_vendor.so
mount /system/lib64/vndk-27/libminijail.so /system/lib64/vndk-28/libminijail.so
mount /system/lib/vndk-27/libminijail.so /system/lib/vndk-28/libminijail.so
mount /system/lib64/vndk-27/libminijail.so /vendor/lib64/libminijail.so
mount /system/lib/vndk-27/libminijail.so /vendor/lib/libminijail.so
mount $minijailSrc64 /vendor/lib64/libminijail_vendor.so
mount $minijailSrc /vendor/lib/libminijail_vendor.so
mount $minijailSrc64 /system/lib64/vndk-28/libminijail.so
mount $minijailSrc /system/lib/vndk-28/libminijail.so
mount $minijailSrc64 /vendor/lib64/libminijail.so
mount $minijailSrc /vendor/lib/libminijail.so
fi
#Clear looping services

View File

@ -14,16 +14,18 @@ if getprop persist.sys.phh.caf.media_profile |grep -q true;then
fi
minijailSrc=/system/system_ext/apex/com.android.vndk.v28/lib/libminijail.so
minijailSrc64=/system/system_ext/apex/com.android.vndk.v28/lib64/libminijail.so
if [ "$vndk" = 27 ];then
mount /system/lib64/vndk-27/libminijail.so /vendor/lib64/libminijail_vendor.so
mount /system/lib/vndk-27/libminijail.so /vendor/lib/libminijail_vendor.so
mount $minijailSrc64 /vendor/lib64/libminijail_vendor.so
mount $minijailSrc /vendor/lib/libminijail_vendor.so
fi
if [ "$vndk" = 28 ];then
mount /system/lib64/vndk-27/libminijail.so /vendor/lib64/libminijail_vendor.so
mount /system/lib/vndk-27/libminijail.so /vendor/lib/libminijail_vendor.so
mount /system/lib64/vndk-27/libminijail.so /system/lib64/vndk-28/libminijail.so
mount /system/lib/vndk-27/libminijail.so /system/lib/vndk-28/libminijail.so
mount /system/lib64/vndk-27/libminijail.so /vendor/lib64/libminijail.so
mount /system/lib/vndk-27/libminijail.so /vendor/lib/libminijail.so
mount $minijailSrc64 /vendor/lib64/libminijail_vendor.so
mount $minijailSrc /vendor/lib/libminijail_vendor.so
mount $minijailSrc64 /system/lib64/vndk-28/libminijail.so
mount $minijailSrc /system/lib/vndk-28/libminijail.so
mount $minijailSrc64 /vendor/lib64/libminijail.so
mount $minijailSrc /vendor/lib/libminijail.so
fi

View File

@ -106,9 +106,9 @@ if [ "$1" == "persist.sys.phh.disable_audio_effects" ];then
fi
if [[ "$prop_value" == 1 ]];then
resetprop ro.audio.ignore_effects true
resetprop_phh ro.audio.ignore_effects true
else
resetprop --delete ro.audio.ignore_effects
resetprop_phh --delete ro.audio.ignore_effects
fi
restartAudio
exit
@ -119,12 +119,37 @@ if [ "$1" == "persist.sys.phh.caf.audio_policy" ];then
exit 1
fi
sku="$(getprop ro.boot.product.vendor.sku)"
if [[ "$prop_value" == 1 ]];then
umount /vendor/etc/audio
mount /vendor/etc/audio/audio_policy_configuration.xml /vendor/etc/audio_policy_configuration.xml
umount /vendor/etc/audio
if [ -f /vendor/etc/audio_policy_configuration_sec.xml ];then
mount /vendor/etc/audio_policy_configuration_sec.xml /vendor/etc/audio_policy_configuration.xml
elif [ -f /vendor/etc/audio/sku_${sku}_qssi/audio_policy_configuration.xml ] && [ -f /vendor/etc/audio/sku_$sku/audio_policy_configuration.xml ];then
umount /vendor/etc/audio
mount /vendor/etc/audio/sku_${sku}_qssi/audio_policy_configuration.xml /vendor/etc/audio/sku_$sku/audio_policy_configuration.xml
elif [ -f /vendor/etc/audio/audio_policy_configuration.xml ];then
mount /vendor/etc/audio/audio_policy_configuration.xml /vendor/etc/audio_policy_configuration.xml
elif [ -f /vendor/etc/audio_policy_configuration_base.xml ];then
mount /vendor/etc/audio_policy_configuration_base.xml /vendor/etc/audio_policy_configuration.xml
fi
if [ -f /vendor/lib/hw/audio.bluetooth_qti.default.so ];then
cp /vendor/etc/a2dp_audio_policy_configuration.xml /mnt/phh
sed -i 's/bluetooth_qti/a2dp/' /mnt/phh/a2dp_audio_policy_configuration.xml
mount /mnt/phh/a2dp_audio_policy_configuration.xml /vendor/etc/a2dp_audio_policy_configuration.xml
chcon -h u:object_r:vendor_configs_file:s0 /vendor/etc/a2dp_audio_policy_configuration.xml
chmod 644 /vendor/etc/a2dp_audio_policy_configuration.xml
fi
else
umount /vendor/etc/audio_policy_configuration.xml
mount /mnt/phh/empty_dir /vendor/etc/audio
umount /vendor/etc/audio/sku_$sku/audio_policy_configuration.xml
umount /vendor/etc/a2dp_audio_policy_configuration.xml
rm /mnt/phh/a2dp_audio_policy_configuration.xml
if [ $(find /vendor/etc/audio -type f |wc -l) -le 3 ];then
mount /mnt/phh/empty_dir /vendor/etc/audio
fi
fi
restartAudio
exit
@ -142,3 +167,20 @@ if [ "$1" == "persist.sys.phh.vsmart.dt2w" ];then
fi
exit
fi
if [ "$1" == "persist.sys.phh.backlight.scale" ];then
if [[ "$prop_value" != "0" && "$prop_value" != "1" ]]; then
exit 1
fi
if [[ "$prop_value" == 1 ]];then
if [ -f /sys/class/leds/lcd-backlight/max_brightness ];then
setprop persist.sys.qcom-brightness "$(cat /sys/class/leds/lcd-backlight/max_brightness)"
elif [ -f /sys/class/backlight/panel0-backlight/max_brightness ];then
setprop persist.sys.qcom-brightness "$(cat /sys/class/backlight/panel0-backlight/max_brightness)"
fi
else
setprop persist.sys.qcom-brightness -1
fi
exit
fi

View File

@ -1,13 +1,22 @@
#!/system/bin/sh
SYSTEM=/system
[ -d /sbin/.magisk/mirror/system ] && SYSTEM=/sbin/.magisk/mirror/system
if [ -e /system/bin/magisk ]
then
# remove bind-mount of phh-su overriding /system/bin/su -> ./magisk
umount -l /system/bin/magisk
# we need to modify the real system partition
MAGISK_MIRROR="$(magisk --path)/.magisk/mirror"
SYSTEM=$MAGISK_MIRROR/system
MOUNTPOINT_LIST="$MAGISK_MIRROR/system_root $MAGISK_MIRROR/system"
else
SYSTEM=/system
MOUNTPOINT_LIST="/system /"
fi
for MOUNTPOINT in \
/sbin/.magisk/mirror/system_root \
/sbin/.magisk/mirror/system \
/system \
/
# remove bind-mount of phh-su (preventing $SYSTEM/xbin/su to be removed)
umount -l /system/xbin/su
for MOUNTPOINT in $MOUNTPOINT_LIST
do
[ -d $MOUNTPOINT ] && mountpoint -q $MOUNTPOINT && break
done
@ -16,7 +25,6 @@ mount -o remount,rw $MOUNTPOINT
remount
touch $SYSTEM/phh/secure
umount -l $SYSTEM/xbin/su
rm $SYSTEM/xbin/su
rm $SYSTEM/bin/phh-su
rm $SYSTEM/etc/init/su.rc

View File

@ -6,5 +6,3 @@ BOARD_SYSTEMIMAGE_PARTITION_SIZE := 2147483648
else
BOARD_SYSTEMIMAGE_PARTITION_RESERVED_SIZE := 33554432
endif
BUILD_BROKEN_PHONY_TARGETS := true

View File

@ -3,4 +3,6 @@
<privapp-permissions package="me.phh.treble.app">
<permission name="android.permission.INTERACT_ACROSS_USERS"/>
</privapp-permissions>
<!-- fix voice channels in calls (stop unloading treble-app) -->
<allow-in-power-save package="me.phh.treble.app" />
</permissions>

View File

@ -1,16 +1,62 @@
#!/system/bin/sh
#Uncomment me to output sh -x of this script to /cache/phh/logs
#if [ -z "$debug" ];then
# mkdir -p /cache/phh
# debug=1 exec sh -x "$(readlink -f -- "$0")" > /cache/phh/logs 2>&1
#fi
if [ -z "$debug" ] && [ -f /cache/phh-log ];then
mkdir -p /cache/phh
debug=1 exec sh -x "$(readlink -f -- "$0")" > /cache/phh/logs 2>&1
else
# Allow accessing logs from system app
# Protected via SELinux for other apps
chmod 0755 /cache/phh
chmod 0644 /cache/phh/logs
fi
if [ -f /cache/phh-adb ];then
setprop ctl.stop adbd
setprop ctl.stop adbd_apex
mount -t configfs none /config
rm -Rf /config/usb_gadget
mkdir -p /config/usb_gadget/g1
echo 0x12d1 > /config/usb_gadget/g1/idVendor
echo 0x103A > /config/usb_gadget/g1/idProduct
mkdir -p /config/usb_gadget/g1/strings/0x409
echo phh > /config/usb_gadget/g1/strings/0x409/serialnumber
echo phh > /config/usb_gadget/g1/strings/0x409/manufacturer
echo phh > /config/usb_gadget/g1/strings/0x409/product
mkdir /config/usb_gadget/g1/functions/ffs.adb
mkdir /config/usb_gadget/g1/functions/mtp.gs0
mkdir /config/usb_gadget/g1/functions/ptp.gs1
mkdir /config/usb_gadget/g1/configs/c.1/
mkdir /config/usb_gadget/g1/configs/c.1/strings/0x409
echo 'ADB MTP' > /config/usb_gadget/g1/configs/c.1/strings/0x409/configuration
mkdir /dev/usb-ffs
chmod 0770 /dev/usb-ffs
chown shell:shell /dev/usb-ffs
mkdir /dev/usb-ffs/adb/
chmod 0770 /dev/usb-ffs/adb
chown shell:shell /dev/usb-ffs/adb
mount -t functionfs -o uid=2000,gid=2000 adb /dev/usb-ffs/adb
/apex/com.android.adbd/bin/adbd &
sleep 1
echo none > /config/usb_gadget/g1/UDC
ln -s /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/c.1/f1
ls /sys/class/udc |head -n 1 > /config/usb_gadget/g1/UDC
sleep 2
echo 2 > /sys/devices/virtual/android_usb/android0/port_mode
fi
vndk="$(getprop persist.sys.vndk)"
[ -z "$vndk" ] && vndk="$(getprop ro.vndk.version |grep -oE '^[0-9]+')"
if [ "$vndk" = 26 ];then
resetprop ro.vndk.version 26
resetprop_phh ro.vndk.version 26
fi
setprop sys.usb.ffs.aio_compat true
@ -22,8 +68,8 @@ fixSPL() {
else
setprop ro.keymaster.mod 'AOSP on ARM64'
fi
img="$(find /dev/block -type l -name kernel"$(getprop ro.boot.slot_suffix)" | grep by-name | head -n 1)"
[ -z "$img" ] && img="$(find /dev/block -type l -name boot"$(getprop ro.boot.slot_suffix)" | grep by-name | head -n 1)"
img="$(find /dev/block -type l -iname kernel"$(getprop ro.boot.slot_suffix)" | grep by-name | head -n 1)"
[ -z "$img" ] && img="$(find /dev/block -type l -iname boot"$(getprop ro.boot.slot_suffix)" | grep by-name | head -n 1)"
if [ -n "$img" ]; then
#Rewrite SPL/Android version if needed
Arelease="$(getSPL "$img" android)"
@ -31,16 +77,22 @@ fixSPL() {
setprop ro.keymaster.xxx.security_patch "$(getSPL "$img" spl)"
setprop ro.keymaster.brn Android
getprop ro.vendor.build.fingerprint | grep -qiE '^samsung/' && return 0
if getprop ro.vendor.build.fingerprint |grep -qiE 'samsung.*star.*lte';then
additional="/apex/com.android.vndk.v28/lib64/libsoftkeymasterdevice.so /apex/com.android.vndk.v29/lib64/libsoftkeymasterdevice.so"
else
getprop ro.vendor.build.fingerprint | grep -qiE '^samsung/' && return 0
fi
for f in \
/vendor/lib64/hw/android.hardware.keymaster@3.0-impl-qti.so /vendor/lib/hw/android.hardware.keymaster@3.0-impl-qti.so \
/system/lib64/vndk-26/libsoftkeymasterdevice.so /vendor/bin/teed \
/apex/com.android.vndk.v26/lib/libsoftkeymasterdevice.so \
/apex/com.android.vndk.v26/lib64/libsoftkeymasterdevice.so \
/system/lib64/vndk/libsoftkeymasterdevice.so /system/lib/vndk/libsoftkeymasterdevice.so \
/system/lib/vndk-26/libsoftkeymasterdevice.so \
/system/lib/vndk-27/libsoftkeymasterdevice.so /system/lib64/vndk-27/libsoftkeymasterdevice.so \
/vendor/lib/libkeymaster3device.so /vendor/lib64/libkeymaster3device.so \
/vendor/lib/libMcTeeKeymaster.so /vendor/lib64/libMcTeeKeymaster.so \
/vendor/lib/hw/libMcTeeKeymaster.so /vendor/lib64/hw/libMcTeeKeymaster.so ; do
/vendor/lib/hw/libMcTeeKeymaster.so /vendor/lib64/hw/libMcTeeKeymaster.so $additional; do
[ ! -f "$f" ] && continue
# shellcheck disable=SC2010
ctxt="$(ls -lZ "$f" | grep -oE 'u:object_r:[^:]*:s0')"
@ -85,12 +137,7 @@ changeKeylayout() {
fi
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 Redmi/begonia\
-e xiaomi/nitrogen -e xiaomi/sakura -e xiaomi/andromeda \
-e xiaomi/whyred -e xiaomi/tulip -e xiaomi/onc \
-e redmi/curtana -e redmi/picasso; then
-e poco/ -e redmi/ -e xiaomi/ ; 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
@ -150,7 +197,9 @@ changeKeylayout() {
changed=true
fi
if getprop ro.build.overlay.deviceid |grep -q -e RMX1931 -e RMX1941 -e CPH1859 -e CPH1861;then
if ( getprop ro.build.overlay.deviceid |grep -q -e RMX1931 -e RMX1941 -e CPH1859 -e CPH1861 -e RMX2185) ||
( grep -q OnePlus /odm/etc/$(getprop ro.boot.prjname)/*.prop);then
echo 1 > /proc/touchpanel/double_tap_enable
cp /system/phh/oppo-touchpanel.kl /mnt/phh/keylayout/touchpanel.kl
cp /system/phh/oppo-touchpanel.kl /mnt/phh/keylayout/mtk-tpd.kl
chmod 0644 /mnt/phh/keylayout/touchpanel.kl
@ -178,6 +227,12 @@ changeKeylayout() {
changed=true
fi
if getprop ro.vendor.build.fingerprint |grep -q -i -e Teracube/Teracube_2e;then
cp /system/phh/teracube2e-mtk-kpd.kl /mnt/phh/keylayout/mtk-kpd.kl
chmod 0644 /mnt/phh/keylayout/mtk-kpd.kl
changed=true
fi
if getprop ro.vendor.asus.build.fp |grep -q ASUS_I01WD;then
cp /system/phh/zf6-goodixfp.kl /mnt/phh/keylayout/goodixfp.kl
cp /system/phh/zf6-googlekey_input.kl /mnt/phh/keylayout/googlekey_input.kl
@ -186,6 +241,24 @@ changeKeylayout() {
changed=true
fi
if getprop ro.vendor.build.fingerprint | grep -q -e Unihertz/;then
cp /system/phh/unihertz-mtk-kpd.kl /mnt/phh/keylayout/mtk-kpd.kl
cp /system/phh/unihertz-mtk-tpd.kl /mnt/phh/keylayout/mtk-tpd.kl
cp /system/phh/unihertz-mtk-tpd-kpd.kl /mnt/phh/keylayout/mtk-tpd-kpd.kl
cp /system/phh/unihertz-fingerprint_key.kl /mnt/phh/keylayout/fingerprint_key.kl
chmod 0644 /mnt/phh/keylayout/mtk-kpd.kl
chmod 0644 /mnt/phh/keylayout/mtk-tpd.kl
chmod 0644 /mnt/phh/keylayout/mtk-tpd-kpd.kl
chmod 0644 /mnt/phh/keylayout/fingerprint_key.kl
changed=true
fi
if getprop ro.product.vendor.device |grep -qi mfh505glm; then
cp /system/phh/empty /mnt/phh/keylayout/uinput-fpc.kl
chmod 0644 /mnt/phh/keylayout/uinput-fpc.kl
changed=true
fi
if [ "$changed" = true ]; then
mount -o bind /mnt/phh/keylayout /system/usr/keylayout
restorecon -R /system/usr/keylayout
@ -239,8 +312,13 @@ 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;do
if grep -q -e android.hardware.biometrics.fingerprint -e vendor.oppo.hardware.biometrics.fingerprint $manifest;then
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
done
@ -300,13 +378,14 @@ 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 Redmi/begonia\
-e xiaomi/lavender -e xiaomi/olive -e xiaomi/olivelite -e xiaomi/pine; then
-e xiaomi/ysl -e nubia/nx60 -e nubia/nx61 -e xiaomi/tulip \
-e xiaomi/lavender -e xiaomi/olive -e xiaomi/olivelite -e xiaomi/pine \
-e Redmi/lancelot -e Redmi/galahad; then
setprop persist.sys.qcom-brightness "$(cat /sys/class/leds/lcd-backlight/max_brightness)"
fi
#Realme 6
if getprop ro.vendor.product.device |grep -iq -e RMX2001;then
if getprop ro.vendor.product.device |grep -iq -e RMX2001 -e RMX2151 -e RMX2111 -e RMX2111L1;then
setprop persist.sys.phh.fingerprint.nocleanup true
setprop persist.sys.qcom-brightness "$(cat /sys/class/leds/lcd-backlight/max_brightness)"
fi
@ -315,10 +394,16 @@ if getprop ro.vendor.product.device |grep -iq -e RMX1801 -e RMX1803 -e RMX1807;t
setprop persist.sys.qcom-brightness "$(cat /sys/class/leds/lcd-backlight/max_brightness)"
fi
if getprop ro.build.overlay.deviceid |grep -q -e CPH1859 -e CPH1861 -e RMX1811;then
if getprop ro.build.overlay.deviceid |grep -q -e CPH1859 -e CPH1861 -e RMX1811 -e RMX2185;then
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
setprop persist.sys.qcom-brightness 2047
setprop persist.sys.overlay.devinputjack true
setprop persist.sys.phh.fingerprint.nocleanup true
fi
if getprop ro.vendor.build.fingerprint | grep -iq \
-e xiaomi/beryllium/beryllium -e xiaomi/sirius/sirius \
-e xiaomi/dipper/dipper -e xiaomi/ursa/ursa -e xiaomi/polaris/polaris \
@ -326,13 +411,20 @@ if getprop ro.vendor.build.fingerprint | grep -iq \
-e xiaomi/equuleus/equuleus -e motorola/nora -e xiaomi/nitrogen \
-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/laurel_sprout -e xiaomi/andromeda \
-e redmi/curtana -e redmi/picasso ; then
-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
mount -o bind /mnt/phh/empty_dir /vendor/lib/soundfx
setprop ro.audio.ignore_effects true
fi
if getprop ro.vendor.build.fingerprint | grep -iq \
-e bq/Aquaris_M10 ; then
setprop ro.surface_flinger.primary_display_orientation ORIENTATION_90
fi
if getprop ro.build.fingerprint | grep -iq \
-e motorola/channel; then
mount -o bind /mnt/phh/empty_dir /vendor/lib64/soundfx
@ -387,16 +479,11 @@ for f in /vendor/lib/mtk-ril.so /vendor/lib64/mtk-ril.so /vendor/lib/libmtk-ril.
setprop persist.sys.radio.ussd.fix true
done
if getprop ro.vendor.build.fingerprint | grep -iq -e iaomi/cactus -e iaomi/cereus \
-e Redmi/begonia; then
if getprop ro.vendor.build.fingerprint | grep -iq -e iaomi/cactus -e iaomi/cereus; then
setprop debug.stagefright.omx_default_rank.sw-audio 1
setprop debug.stagefright.omx_default_rank 0
fi
if getprop ro.vendor.build.fingerprint | grep -iq -e xiaomi/ginkgo -e xiaomi/willow; then
mount -o bind /system/phh/empty /vendor/lib/soundfx/libvolumelistener.so
fi
mount -o bind /system/phh/empty /vendor/lib/libpdx_default_transport.so
mount -o bind /system/phh/empty /vendor/lib64/libpdx_default_transport.so
@ -445,6 +532,11 @@ if getprop ro.vendor.build.fingerprint | grep -iq -e xiaomi/daisy; then
setprop debug.sf.enable_hwc_vds 1
fi
if getprop ro.vendor.build.fingerprint | grep -iq -e Redmi/merlin; 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 ||
@ -478,6 +570,8 @@ fi
# This matches both Razer Phone 1 & 2
if getprop ro.vendor.build.fingerprint |grep -qE razer/cheryl;then
setprop ro.audio.monitorRotation true
mount -o bind /system/phh/empty /vendor/overlay/BluetoothResCommon.apk
mount -o bind /system/phh/empty /vendor/overlay/RazerCherylBluetoothRes.apk
fi
if getprop ro.vendor.build.fingerprint | grep -qiE '^samsung'; then
@ -497,7 +591,9 @@ if getprop ro.vendor.build.fingerprint | grep -qE '^xiaomi/wayne/wayne.*'; then
setprop audio.camerasound.force true
fi
mount -o bind /mnt/phh/empty_dir /vendor/etc/audio || true
if [ $(find /vendor/etc/audio -type f |wc -l) -le 3 ];then
mount -o bind /mnt/phh/empty_dir /vendor/etc/audio || true
fi
for f in /vendor/lib{,64}/hw/com.qti.chi.override.so /vendor/lib{,64}/libVD*;do
[ ! -f $f ] && continue
@ -556,11 +652,27 @@ if getprop ro.vendor.build.fingerprint | grep -qiE '^samsung/' && [ "$vndk" -ge
fi
fi
# For Nubia Red Magic 6 audio policy configuration
if getprop ro.vendor.build.fingerprint | grep -q -e nubia/NX669; then
umount /vendor/etc/audio
sku="$(getprop ro.boot.product.vendor.sku)"
mount /vendor/etc/audio/sku_${sku}_qssi/audio_policy_configuration.xml /vendor/etc/audio/sku_$sku/audio_policy_configuration.xml
fi
# For ZF8, the "best" audio policy isn't the one for QSSI
if getprop ro.vendor.build.fingerprint |grep -q -e /ASUS_I006D:;then
umount /vendor/etc/audio
sku="$(getprop ro.boot.product.vendor.sku)"
mount /vendor/etc/audio/ZS590KS/audio_policy_configuration_ZS590KS.xml /vendor/etc/audio/sku_$sku/audio_policy_configuration.xml
fi
setprop ctl.stop console
dmesg -n 1
if [ -f /system/phh/secure ];then
copyprop() {
p="$(getprop "$2")"
if [ "$p" ]; then
resetprop "$1" "$(getprop "$2")"
resetprop_phh "$1" "$(getprop "$2")"
fi
}
@ -575,8 +687,8 @@ if [ -f /system/phh/secure ];then
copyprop ro.product.device ro.product.vendor.device
copyprop ro.product.system.name ro.vendor.product.name
copyprop ro.product.name ro.vendor.product.name
copyprop ro.product.system.name ro.product.vendor.device
copyprop ro.product.name ro.product.vendor.device
copyprop ro.product.system.name ro.product.vendor.name
copyprop ro.product.name ro.product.vendor.name
copyprop ro.system.product.brand ro.vendor.product.brand
copyprop ro.product.brand ro.vendor.product.brand
copyprop ro.product.system.model ro.vendor.product.model
@ -590,22 +702,22 @@ if [ -f /system/phh/secure ];then
copyprop ro.system.product.manufacturer ro.product.vendor.manufacturer
copyprop ro.product.manufacturer ro.product.vendor.manufacturer
(getprop ro.vendor.build.security_patch; getprop ro.keymaster.xxx.security_patch) |sort |tail -n 1 |while read v;do
[ -n "$v" ] && resetprop ro.build.version.security_patch "$v"
[ -n "$v" ] && resetprop_phh ro.build.version.security_patch "$v"
done
resetprop ro.build.tags release-keys
resetprop ro.boot.vbmeta.device_state locked
resetprop ro.boot.verifiedbootstate green
resetprop ro.boot.flash.locked 1
resetprop ro.boot.veritymode enforcing
resetprop ro.boot.warranty_bit 0
resetprop ro.warranty_bit 0
resetprop ro.debuggable 0
resetprop ro.secure 1
resetprop ro.build.type user
resetprop ro.build.selinux 0
resetprop_phh ro.build.tags release-keys
resetprop_phh ro.boot.vbmeta.device_state locked
resetprop_phh ro.boot.verifiedbootstate green
resetprop_phh ro.boot.flash.locked 1
resetprop_phh ro.boot.veritymode enforcing
resetprop_phh ro.boot.warranty_bit 0
resetprop_phh ro.warranty_bit 0
resetprop_phh ro.debuggable 0
resetprop_phh ro.secure 1
resetprop_phh ro.build.type user
resetprop_phh ro.build.selinux 0
resetprop ro.adb.secure 1
resetprop_phh ro.adb.secure 1
setprop ctl.restart adbd
fi
@ -613,7 +725,7 @@ for abi in "" 64;do
f=/vendor/lib$abi/libstagefright_foundation.so
if [ -f "$f" ];then
for vndk in 26 27 28 29;do
mount "$f" /system/lib$abi/vndk-$vndk/libstagefright_foundation.so
mount "$f" /system/system_ext/apex/com.android.vndk.v$vndk/lib$abi/libstagefright_foundation.so
done
fi
done
@ -657,6 +769,11 @@ 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
for j in /$i/etc/vintf/manifest/*;do
if grep -qF android.hardware.wifi.hostapd $j;then
has_hostapd=true
fi
done
done
if [ "$has_hostapd" = false ];then
@ -687,6 +804,11 @@ if [ -e /dev/sprd-adf-dev ];then
setprop ro.config.avoid_gfx_accel true
fi
# Fix sensor services crashing on SPRD devices with Pie vendor
if getprop ro.hardware.keystore | grep -iq sprd && [ "$vndk" -le 28 ]; then
setprop persist.sys.phh.disable_sensor_direct_report true
fi
# Fix manual network selection with old modem
# https://github.com/LineageOS/android_hardware_ril/commit/e3d006fa722c02fc26acdfcaa43a3f3a1378eba9
if getprop ro.vendor.build.fingerprint | grep -iq \
@ -695,7 +817,7 @@ if getprop ro.vendor.build.fingerprint | grep -iq \
fi
if getprop ro.build.overlay.deviceid |grep -qE '^RMX';then
resetprop ro.vendor.gsi.build.flavor byPass
resetprop_phh ro.vendor.gsi.build.flavor byPass
setprop oppo.camera.packname com.oppo.engineermode.camera
setprop sys.phh.xx.brand realme
fi
@ -708,8 +830,14 @@ if [ -f /proc/oppoVersion/prjVersion ];then
setprop ro.separate.soft $(cat /proc/oppoVersion/prjVersion)
fi
if grep -q -F ro.separate.soft /odm/build.prop;then
setprop ro.separate.soft "$(sed -nE 's/^ro.separate.soft=(.*)/\1/p' /odm/build.prop)"
fi
echo 1 > /proc/tfa98xx/oppo_tfa98xx_fw_update
echo 1 > /proc/touchpanel/tp_fw_update
if ! grep -q -E -e '.*#write .*tp_fw_update' /vendor/etc/init/hw/*touch*;then
echo 1 > /proc/touchpanel/tp_fw_update
fi
if getprop ro.build.overlay.deviceid |grep -qE '^RMX';then
chmod 0660 /sys/devices/platform/soc/soc:fpc_fpc1020/{irq,irq_enable,wakelock_enable}
@ -735,7 +863,7 @@ if getprop ro.vendor.build.fingerprint |grep -qiE \
-e razer/cheryl ; then
setprop media.settings.xml "/vendor/etc/media_profiles_vendor.xml"
fi
resetprop service.adb.root 0
resetprop_phh service.adb.root 0
# This is for Samsung Galaxy devices with HBM FOD
# On those devices, a magic Layer usageBits switches to "mask_brightness"
@ -748,9 +876,11 @@ 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
chcon u:object_r:sysfs_lcd_writable:s0 $f
chmod 0644 $f
chown system:system $f
if [ "$(stat -c '%U' "$f")" == "root" ];then
chcon u:object_r:sysfs_lcd_writable:s0 $f
chmod 0644 $f
chown system:system $f
fi
done
setprop persist.sys.phh.fod.samsung true
@ -768,7 +898,11 @@ if getprop ro.build.overlay.deviceid |grep -iq -e RMX1941 -e RMX1945 -e RMX1943
setprop persist.sys.phh.mainkeys 0
fi
resetprop ro.bluetooth.library_name libbluetooth.so
if getprop ro.build.overlay.deviceid |grep -iq -e RMX2185 -e RMX1941 -e RMX1945 -e RMX1943 -e RMX1942;then
setprop persist.sys.overlay.devinputjack true
fi
resetprop_phh ro.bluetooth.library_name libbluetooth.so
if getprop ro.vendor.build.fingerprint |grep -iq xiaomi/cepheus;then
setprop ro.netflix.bsp_rev Q855-16947-1
@ -787,9 +921,37 @@ fi
setprop vendor.display.res_switch_en 1
if getprop ro.bionic.cpu_variant |grep -q kryo300;then
resetprop ro.bionic.cpu_variant cortex-a75
resetprop_phh ro.bionic.cpu_variant cortex-a75
setprop dalvik.vm.isa.arm64.variant cortex-a75
setprop dalvik.vm.isa.arm64.features runtime
fi
resetprop ro.control_privapp_permissions log
resetprop_phh ro.control_privapp_permissions log
if [ -f /vendor/etc/init/vendor.ozoaudio.media.c2@1.0-service.rc ];then
if [ "$vndk" -le 29 ]; then
mount /system/etc/seccomp_policy/mediacodec.policy /vendor/etc/seccomp_policy/codec2.vendor.base.policy
fi
fi
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
for f in $(find /sys -name fts_gesture_mode);do
setprop persist.sys.phh.focaltech_node "$f"
done
if [ "$vndk" -le 27 ] && [ -f /vendor/bin/mnld ];then
setprop persist.sys.phh.sdk_override /vendor/bin/mnld=26
fi
# Disable secondary watchdogs
echo -n V > /dev/watchdog1
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

@ -15,6 +15,7 @@
/dev/dsm u:object_r:dmd_device:s0
/system/bin/hw/android.hardware.biometrics.fingerprint@2.1-service.oppo.compat u:object_r:hal_fingerprint_oppo_compat_exec:s0
/system/bin/hw/android.hardware.biometrics.fingerprint@2.1-service.oplus.compat u:object_r:hal_fingerprint_oppo_compat_exec:s0
/efs u:object_r:efs_file:s0

View File

@ -5,6 +5,10 @@ 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;
allow tee hal_fingerprint_default:process { getattr };
allow tee teecd_data_file:dir { search read write create getattr add_name open };
allow tee teecd_data_file:file { read write create getattr open };
allow tee system_data_file:dir { getattr };
type oeminfo_nvm, domain;
type oeminfo_nvm_device, file_type;

View File

@ -6,3 +6,8 @@ allow init userdata_block_device:blk_file relabelto;
allow init userdata_block_device:lnk_file relabelto;
allow vendor_init vendor_init:capability { sys_module };
allow init system_file:lnk_file create_file_perms;
#fix adb in some cases
allow init adbd_exec:lnk_file read;

View File

@ -3,3 +3,17 @@ type proc_ged, file_type;
allowxperm domain proc_ged:file ioctl { 0x6700-0x67ff };
allow init mnt_product_file:dir mounton;
type mtk_hal_audio, domain;
typeattribute mtk_hal_audio hal_broadcastradio_client;
type mtk_hal_power, domain;
allow mtk_hal_power system_data_root_file:file create_file_perms;
allow zygote ashmem_device:chr_file execute;
attribute hal_mms_server;
binder_call({appdomain -isolated_app}, hal_mms_server)
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;

View File

@ -1,3 +1,6 @@
type sysfs_usb_supply, file_type;
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;

View File

@ -1 +1,10 @@
qti.ims.ext u:object_r:radio_service:s0
# SPRD IMS
ims_ex u:object_r:radio_service:s0
ims_ut_ex u:object_r:radio_service:s0
ims_doze_manager u:object_r:radio_service:s0
irit u:object_r:radio_service:s0
# MTK IMS
mwis u:object_r:radio_service:s0
mtkIms u:object_r:radio_service:s0

View File

@ -148,5 +148,4 @@ allow phhsu_daemon domain:process { transition };
# 06-06 12:59:53.775 30150 30150 I auditd : type=1400 audit(0.0:35585): avc: denied { ioctl } for comm="blockdev" path="/dev/block/dm-3" dev="tmpfs" ino=12687 ioctlcmd=0x125d scontext=u:r:phhsu_daemon:s0 tcontext=u:object_r:dm_device:s0 tclass=blk_file permissive=0
allowxperm phhsu_daemon { file_type block_device }:blk_file ioctl { 0-0xffff };
allowxperm phhsu_daemon { super_block_device dm_device }:blk_file ioctl { 0x1278-0x127a 0x125d };
allowxperm phhsu_daemon { system_block_device super_block_device dm_device }:blk_file ioctl { 0x1278-0x127a 0x125d };

View File

@ -7,6 +7,8 @@ allow system_app sysfs_batteryinfo:file rw_file_perms;
type vendor_camera_prop, property_type;
set_prop(system_app, vendor_camera_prop);
type camera_prop, property_type;
set_prop(system_app, camera_prop);
type hal_ext_fingerprint_hwservice, hwservice_manager_type;
allow system_app hal_ext_fingerprint_hwservice:hwservice_manager { find };
@ -22,3 +24,21 @@ allow system_app default_hisi_hwservice:hwservice_manager { find };
type hal_tp_default, domain;
allow system_app hal_tp_default:binder { call };
#cam2api
allow system_app vendor_default_prop:property_service { set };
set_prop(system_app, default_prop);
set_prop(system_app, exported3_default_prop);
type mtk_hal_rild_hwservice, hwservice_manager_type;
allow system_app mtk_hal_rild_hwservice:hwservice_manager { find};
type mtk_vilte_support_prop, property_type;
allow system_app mtk_vilte_support_prop:property_service set;
type hal_gesturewake_hwservice, hwservice_manager_type;
type hal_gesturewake_default, domain;
allow system_app hal_gesturewake_hwservice:hwservice_manager { find };
allow system_app hal_gesturewake_default:binder { call transfer };
allow hal_gesturewake_default system_app:binder { call transfer };

View File

@ -79,7 +79,7 @@ if [ "$configfs" == 1 ];then
sleep 1
echo none > /config/usb_gadget/g1/UDC
ln -s /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/c.1/f1
echo ff100000.dwc3 > /config/usb_gadget/g1/UDC
ls /sys/class/udc |head -n 1 > /config/usb_gadget/g1/UDC
sleep 2
echo 2 > /sys/devices/virtual/android_usb/android0/port_mode

26
vndk.rc
View File

@ -44,3 +44,29 @@ on property:persist.sys.phh.caf.audio_policy=*
on property:persist.sys.phh.vsmart.dt2w=*
exec u:r:phhsu_daemon:s0 root -- /system/bin/phh-prop-handler.sh "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:ro.sf.lcd_density=*
restart surfaceflinger
on property:persist.sys.phh.disable_a2dp_offload=0
setprop persist.sys.phh.disable_a2dp_offload false
on property:persist.sys.phh.disable_a2dp_offload=1
setprop persist.sys.phh.disable_a2dp_offload true
on property:persist.sys.phh.disable_a2dp_offload=*
setprop persist.bluetooth.bluetooth_audio_hal.disabled ${persist.sys.phh.disable_a2dp_offload}
on property:init.svc.ril-proxy=stopped && property:persist.sys.phh.restart_ril=true
start ril-proxy
on property:init.svc.vendor.ril-daemon-mtk=stopped && property:persist.sys.phh.restart_ril=true
start vendor.ril-daemon-mtk
on property:persist.sys.phh.restart_ril=true
restart ril-proxy
restart vendor.qcrild
restart vendor.qcrild2
restart vendor.ril-daemon-mtk