├── upload.sh ├── changelog.txt ├── Readme.md ├── patches ├── trebledroid │ ├── platform_system_linkerconfig │ │ └── 01-Disable-vndklite-handling.patch │ ├── platform_build_make │ │ ├── 04-Dont-build-llkd.patch │ │ ├── 03-Dont-build-init.vndk-nodef.rc.patch │ │ ├── 02-build-Bypass-vendor-calls.patch │ │ └── 01-build-remove-emulator-crap-from-GSI.patch │ ├── platform_system_netd │ │ ├── 04-Don-t-abort-in-case-of-cgroup-bpf-setup-fail-since-s.patch │ │ ├── 03-Support-no-bpf-usecase.patch │ │ ├── 01-Huawei-Kirin-960-accept-broken-rpfilter-match.patch │ │ └── 02-Don-t-fail-on-FTP-conntracking-failing.patch │ ├── platform_external_selinux │ │ ├── 07-Enable-multipl_decls-by-default.-This-is-needed-beca.patch │ │ ├── 01-Increase-default-log_level-to-get-actual-selinux-err.patch │ │ ├── 09-Improve-SELinux-policy-workaround-on-device-phh-treble.patch │ │ ├── 06-Allow-mismatches-of-exfat-genfscon.patch │ │ ├── 10-Allow-sys-vm-watermark_scale_factor-conflict.patch │ │ ├── 05-if-service-is-rcs-accept-conflict.-Seen-on-Moto-E5.patch │ │ └── 04-Allow-devices-virtual-block-genfscon-conflict-seen-o.patch │ ├── platform_system_vold │ │ ├── 05-Every-voldmanaged-storage-is-adoptable.patch │ │ ├── 03-Don-t-unmount-rw-system.sh-binds.patch │ │ ├── 01-Allow-deletion-of-symlink.patch │ │ ├── 02-Failing-to-create-facedata-shouldn-t-be-fatal.patch │ │ └── 04-Add-sdfat-texfat-support.patch │ ├── platform_system_core │ │ ├── 19-Add-vendor-firmware_mnt.patch │ │ ├── 06-Panic-into-recovery-rather-than-bootloader.patch │ │ ├── 08-Set-xbin-755.patch │ │ ├── 09-Ugly-but-secure-Set-dev-uinput-as-0666-to-fix-finger.patch │ │ ├── 18-Disable-quotas-on-legacy-devices-with-encryption-dis.patch │ │ ├── 11-Allow-encryptable-fstab-flag-at-any-case.patch │ │ ├── 04-Don-t-abandon-creating-property-tree-if-there-is-a-c.patch │ │ ├── 12-Fix-support-for-devices-without-cgroupv2-support.patch │ │ ├── 02-If-Vboot2-fails-fall-back-to-Vboot1.patch │ │ ├── 01-Let-system-override-ro.apex.updatable-and-adb-secure.patch │ │ ├── 13-FDE-is-dead-Fallback-FDE-to-no-encryption-and-FDE+FBE-to-FBE.patch │ │ ├── 07-Detect-allowed-sdcard-options-based-on-vndk.patch │ │ ├── 15-Allow-apex-on-5.0-kernels.patch │ │ └── 16-watchdogd-Support-pinging-two-watchdogs.patch │ ├── platform_bootable_recovery │ │ └── 01-Don-t-reboot-if-we-couldn-t-get-bootctrl.patch │ ├── platform_system_bpf │ │ ├── 01-Support-no-bpf-usecase.patch │ │ └── 02-Revert-detect-inability-to-write-to-index.patch │ ├── platform_frameworks_base │ │ ├── 26-Once-we-integrate-Samsung-Power-hal-in-libpowermanag.patch │ │ ├── 13-HOME-deserves-to-wake-up-devices-just-as-well-as-bac.patch │ │ ├── 03-Fix-env-empty-string.patch │ │ ├── 17-Remove-useless-notification-about-console-service-be.patch │ │ ├── 27-Allow-disabling-of-fingerprint-cleanups-needed-on-so.patch │ │ ├── 25-Revert-Switch-long-press-power-behavior-in-AOSP.patch │ │ ├── 12-Always-allow-overriding-the-number-of-work-profiles.patch │ │ ├── 20-TelephonyManager-add-API-annotations-for-setTelephon.patch │ │ ├── 02-Fallback-to-stupid-autobrightness-if-brightness-valu.patch │ │ ├── 06-Don-t-crash-if-there-is-IR-HAL-is-not-declared.patch │ │ ├── 15-Fix-brightness-range-not-being-complete-on-Samsung-d.patch │ │ ├── 09-Re-order-services-so-that-it-works-even-without-qtag.patch │ │ ├── 22-Automatically-detect-pick-up-sensor-so-that-an-overl.patch │ │ ├── 01-Disable-vendor-mismatch-warning.patch │ │ ├── 07-Implement-a-persistent-property-to-override-the-defa.patch │ │ ├── 41-Detect-Moto-dynamic-hardware-feature.patch │ │ ├── 23-Catch-broken-mainBuiltInDisplayCutoutRectApproximati.patch │ │ ├── 32-Set-old-fingerprint-sensors-to-security-strong.patch │ │ └── 36-Always-add-HIDL-fingerprint-config-Galaxy-A53-is-mis.patch │ ├── platform_system_nfc │ │ └── 01-Let-vendor-have-priority-over-NFC-config-file-rather.patch │ ├── platform_frameworks_native │ │ ├── 03-unshared_oob-didn-t-exist-in-O-P-so-detect-its-suppo.patch │ │ ├── 01-On-Samsung-we-need-to-send-a-hack-message-to-HAL-to-.patch │ │ ├── 08-MIUI13-devices-hide-their-vibrator-HAL-behind-non-de.patch │ │ ├── 04-Remove-Samsung-system-permission-on-sensors.patch │ │ ├── 05-Mark-accelerometer-input-as-sensor-exclusively-if-th.patch │ │ ├── 10-Fix-light-sensor-crash-on-Xiaomi-13.patch │ │ └── 02-Matching-an-input-with-a-display-uses-uniqueId.patch │ ├── platform_packages_modules_Connectivity │ │ ├── 03-Dont-delete-UID-from-BpfMap-on-BPF-less-kernel.patch │ │ ├── 01-Allow-failing-to-load-bpf-programs-for-BPF-less-devi.patch │ │ └── 02-BpfMap-implemented-new-checks-for-kernel-4.14-but-as.patch │ ├── platform_bionic │ │ ├── 04-Add-some-properties-to-fake-in-keymaster-prop-replac.patch │ │ ├── 01-Disable-vndklite-handling.patch │ │ └── 02-Add-new-mechanism-to-fake-vendor-props-on-a-per-proc.patch │ ├── platform_frameworks_av │ │ ├── 17-Not-all-sources-in-a-route-are-valid.-Dont-ignore-th.patch │ │ ├── 16-Don-t-crash-on-unknown-audio-devices.patch │ │ ├── 14-Make-camera-IDs-filter-out-optional.patch │ │ ├── 13-No-longer-make-re-assigning-legacy-audio.patch │ │ ├── 18-Use-a-fake-volume-policy-when-none-has-been-found.patch │ │ ├── 11-Add-a-property-to-force-camera-timestamp-source.patch │ │ ├── 08-There-are-three-SCO-devices.-Fallback-from-one-to-th.patch │ │ ├── 25-Fix-high-pitched-voice-on-Qualcomm-devices.patch │ │ ├── 06-Try-again-with-trimmed-audio-port-name-i.patch │ │ ├── 07-camera-Implement-property-to-override-default-camera.patch │ │ ├── 24-Support-variable-flash-strength-on-samsung-hal-4.0.patch │ │ └── 23-Add-a-prop-to-change-Samsung-flash-strength.patch │ ├── platform_hardware_interfaces │ │ └── 01-Add-a-vendor800-command-to-be-able-to-call-vendor-sp.patch │ ├── platform_system_extras │ │ └── 01-libfscrypt-Bail-out-if-we-can-t-open-directory.patch │ ├── platform_frameworks_opt_telephony │ │ ├── 03-Fix-baseband-being-too-long-to-fit-into-a-91-chars-p.patch │ │ ├── 02-Telephony-Don-not-call-onUssdRelease-for-Huawei-RIL.patch │ │ ├── 01-SubscriptionController-Do-not-override-default-calli.patch │ │ └── 06-telephony-forward-port-support-for-forceCognitive.patch │ ├── platform_packages_apps_Settings │ │ ├── 01-Act-as-usb-device-when-there-is-no-hal-but-we-believ.patch │ │ └── 02-Ignore-cancelled-fingerprint-events-they-are-expecte.patch │ ├── platform_packages_modules_Bluetooth │ │ ├── 04-Add-option-to-change-eSCO-Transport-Unit-Size.patch │ │ ├── 08-Add-a-property-to-cap-declared-le-vendor-version.-Fo.patch │ │ ├── 01-Additionally-check-le_set_event_mask-command-resturn.patch │ │ └── 06-On-Samsung-devices-we-need-to-tell-Audio-HAL-if-we-re-running-narrow-band-or-wide-band.patch │ └── platform_frameworks_libs_net │ │ └── 01-Restore-back-the-behavior-of-isValid-It-is-legal-to-.patch ├── pre │ ├── platform_device_cherish_sepolicy │ │ └── 01-Nuke-fuseblk-sepolicy.patch │ ├── platform_system_vold │ │ └── 01-Add-missing-texfat.patch │ ├── platform_device_phh_treble │ │ ├── 03-Allow-servicemanager-to-access-hal-audio-sysbta.patch │ │ ├── 04-Allow-Huawei-offline-charge-sepolicy.patch │ │ ├── 05-Modify-SYSBTA-disabled-behaviour.patch │ │ ├── 02-Add-Bluetooth-BQR-props-and-Nuke-SAP-Profile.patch │ │ └── 06-Fix-TrebleApp-allow-in-power-save.patch │ ├── platform_build_make │ │ ├── 01-Remove-duplicated-ro-adb-secure.patch │ │ └── 02-Nuke-apns-calls.patch │ ├── platform_frameworks_base │ │ └── 01-Remove-duplicated-inCryptKeeperBounce.patch │ ├── platform_vendor_cherish │ │ ├── 01-Disable-generated-kernel-headers.patch │ │ └── 02-Nuke-charge-animation.patch │ ├── platform_frameworks_av │ │ └── 01-Revert-allow-custom-CameraParameter.patch │ └── platform_packages_apps_Aperture │ │ └── 01-Enable-auxiliary-cameras.patch └── personal │ ├── platform_device_phh_treble │ ├── 03-Allow-TrebleApp-to-delete-package-cache.patch │ ├── 02-Again-dont-handle-apn.patch │ └── 04-Address-a-QcRilAudio-denial.patch │ ├── platform_vendor_cherish │ ├── 04-BootAnimation-at-720p.patch │ ├── 01-Add-ccache-to-environment-script.patch │ ├── 03-Add-own-build-changes.patch │ └── 02-Inherit-call-phh_gsi-mk.patch │ ├── platform_system_core │ └── 01-Lockscreen-charging-info.patch │ ├── platform_vendor_hardware_overlay │ ├── 02-Handle-TrebleAppSecure.patch │ └── 03-Add-BIOMETRIC_STRONG-overlay.patch │ ├── platform_frameworks_av │ ├── 02-Free-buffers-on-observer-died.patch │ └── 03-Check-trackMeta-for-NULL.patch │ └── platform_frameworks_base │ ├── 01-Check-null-FingerprintManager-first-in-onStartedWaki.patch │ └── 03-Make-rounded-corners-padding-overridable.patch └── ota.json /upload.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | for file in `ls ~/ | grep xz` ; do 4 | gh release upload --clobber $1 ~/$file 5 | done 6 | -------------------------------------------------------------------------------- /changelog.txt: -------------------------------------------------------------------------------- 1 | A13-v20230824 2 | | Sync with source 3 | | Bring back Theme Picker 4 | 5 | A13-v20230813 6 | | Sync with August Sources -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | # treble_cherishos_patches 2 | Patches for build Cherish OS as PHH-Treble GSI 3 | 4 | ## Credits 5 | These people have helped this project in some way or another, so they should be the ones who receive all the credit: 6 | - [phhusson](https://github.com/phhusson) 7 | - [AndyYan](https://github.com/AndyCGYan) 8 | - [ponces](https://github.com/ponces) 9 | - [eremitein](https://github.com/eremitein) 10 | - [Peter Cai](https://github.com/PeterCxy) 11 | - [haridhayal11](https://github.com/haridhayal11) 12 | - [Iceows](https://github.com/Iceows) 13 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_linkerconfig/01-Disable-vndklite-handling.patch: -------------------------------------------------------------------------------- 1 | From 32a9b1cc395227f4d7d819eebaf315d521797458 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Wed, 27 Oct 2021 14:40:26 -0400 4 | Subject: [PATCH] Disable vndklite handling 5 | 6 | Change-Id: I4a132512471a68891f2efb59539267c35a3c3e56 7 | --- 8 | modules/environment.cc | 2 +- 9 | 1 file changed, 1 insertion(+), 1 deletion(-) 10 | 11 | diff --git a/modules/environment.cc b/modules/environment.cc 12 | index 82801f3..e05341b 100644 13 | --- a/modules/environment.cc 14 | +++ b/modules/environment.cc 15 | @@ -29,7 +29,7 @@ bool IsLegacyDevice() { 16 | } 17 | 18 | bool IsVndkLiteDevice() { 19 | - return Variables::GetValue("ro.vndk.lite").value_or("") == "true"; 20 | + return false; 21 | } 22 | 23 | bool IsVndkInSystemNamespace() { 24 | -- 25 | 2.25.1 26 | 27 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_build_make/04-Dont-build-llkd.patch: -------------------------------------------------------------------------------- 1 | From 90eaa68455703e85c5f97d0b13945bd04351e24c Mon Sep 17 00:00:00 2001 2 | From: Andy CrossGate Yan 3 | Date: Thu, 14 Oct 2021 12:20:52 +0000 4 | Subject: [PATCH] build: Remove llkd 5 | 6 | ...until someone figures out why Genshin Impact fails it 7 | 8 | Change-Id: I29384a820a0c07b29d3f11d7039bed40eeaee926 9 | --- 10 | target/product/base_system.mk | 1 - 11 | 1 file changed, 1 deletion(-) 12 | 13 | diff --git a/target/product/base_system.mk b/target/product/base_system.mk 14 | index b5b41f3be..c18a6dc03 100644 15 | --- a/target/product/base_system.mk 16 | +++ b/target/product/base_system.mk 17 | @@ -195,7 +195,6 @@ PRODUCT_PACKAGES += \ 18 | libwilhelm \ 19 | linker \ 20 | linkerconfig \ 21 | - llkd \ 22 | lmkd \ 23 | LocalTransport \ 24 | locksettings \ 25 | -- 26 | 2.25.1 27 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_netd/04-Don-t-abort-in-case-of-cgroup-bpf-setup-fail-since-s.patch: -------------------------------------------------------------------------------- 1 | From a8b60ea84a6cb7298e05a915373e5abeb1a44b8d Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Wed, 26 Oct 2022 18:13:56 -0400 4 | Subject: [PATCH 4/4] Don't abort in case of cgroup/bpf setup fail, since some 5 | devices dont have BPF 6 | 7 | --- 8 | server/main.cpp | 2 +- 9 | 1 file changed, 1 insertion(+), 1 deletion(-) 10 | 11 | diff --git a/server/main.cpp b/server/main.cpp 12 | index 0e81d4e5..18287d37 100644 13 | --- a/server/main.cpp 14 | +++ b/server/main.cpp 15 | @@ -134,7 +134,7 @@ int main() { 16 | 17 | if (libnetd_updatable_init(cg2_path.c_str())) { 18 | ALOGE("libnetd_updatable_init failed"); 19 | - exit(1); 20 | + //exit(1); 21 | } 22 | gLog.info("libnetd_updatable_init success"); 23 | 24 | -- 25 | 2.25.1 26 | 27 | -------------------------------------------------------------------------------- /patches/pre/platform_device_cherish_sepolicy/01-Nuke-fuseblk-sepolicy.patch: -------------------------------------------------------------------------------- 1 | From 5a09cfd89a6e836464028b8226e5836613d143cb Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Mon, 14 Nov 2022 23:44:41 +0000 4 | Subject: [PATCH] Nuke fuseblk sepolicy 5 | 6 | Leads to bootloop due alredy exist on vendor 7 | --- 8 | common/private/genfs_contexts | 5 +---- 9 | 1 file changed, 1 insertion(+), 4 deletions(-) 10 | 11 | diff --git a/common/private/genfs_contexts b/common/private/genfs_contexts 12 | index c629305..a9930bb 100644 13 | --- a/common/private/genfs_contexts 14 | +++ b/common/private/genfs_contexts 15 | @@ -1,5 +1,2 @@ 16 | -ifelse(board_excludes_fuseblk_sepolicy, `true', , 17 | -genfscon fuseblk / u:object_r:vfat:s0 18 | -) 19 | - 20 | +# Placebo line to avoid patch fail 21 | genfscon sysfs /devices/virtual/timed_output/vibrator u:object_r:sysfs_vibrator:s0 22 | -- 23 | 2.34.1 24 | 25 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_external_selinux/07-Enable-multipl_decls-by-default.-This-is-needed-beca.patch: -------------------------------------------------------------------------------- 1 | From 641e8bacdaa7eaefa219523c8f8903efbb7f4617 Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Thu, 29 Sep 2022 11:50:46 -0300 4 | Subject: [PATCH] Enable multipl_decls by default. This is needed because 8.0 5 | init doesn't add -m 6 | 7 | --- 8 | secilc/secilc.c | 2 +- 9 | 1 file changed, 1 insertion(+), 1 deletion(-) 10 | 11 | diff --git a/secilc/secilc.c b/secilc/secilc.c 12 | index 80d3583d..8f819ffa 100644 13 | --- a/secilc/secilc.c 14 | +++ b/secilc/secilc.c 15 | @@ -94,7 +94,7 @@ int main(int argc, char *argv[]) 16 | int target = SEPOL_TARGET_SELINUX; 17 | int mls = -1; 18 | int disable_dontaudit = 0; 19 | - int multiple_decls = 0; 20 | + int multiple_decls = 1; 21 | int disable_neverallow = 0; 22 | int preserve_tunables = 0; 23 | int qualified_names = 0; 24 | -- 25 | 2.37.3 26 | 27 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_vold/05-Every-voldmanaged-storage-is-adoptable.patch: -------------------------------------------------------------------------------- 1 | From bf54fb2cf068a02874b7333c0bf21c0f3246d1d9 Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Thu, 29 Sep 2022 22:46:01 -0300 4 | Subject: [PATCH] Every voldmanaged storage is adoptable 5 | 6 | --- 7 | main.cpp | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/main.cpp b/main.cpp 11 | index 5b1bdf7..e33570b 100644 12 | --- a/main.cpp 13 | +++ b/main.cpp 14 | @@ -273,7 +273,7 @@ static int process_config(VolumeManager* vm, VoldConfigs* configs) { 15 | int partnum = entry.partnum; 16 | int flags = 0; 17 | 18 | - if (entry.is_encryptable()) { 19 | + if (entry.is_encryptable() || true) { 20 | flags |= android::vold::Disk::Flags::kAdoptable; 21 | configs->has_adoptable = true; 22 | } 23 | -- 24 | 2.37.3 25 | 26 | -------------------------------------------------------------------------------- /ota.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "v20230824", 3 | "date": "1692882667", 4 | "gsi": "CherishOS | by ChonDoe feat. TD", 5 | "changelog": "https://raw.githubusercontent.com/ChonDoit/treble_superior_patches/13/changelog.txt", 6 | "variants": [ 7 | { 8 | "name": "Slim", 9 | "size": "1157960888", 10 | "url": "https://github.com/ChonDoit/treble_superior_patches/releases/download/A13-v20230824/SuperiorOS_A13-arm64-bgS-slim_20230824.img.xz" 11 | }, 12 | { 13 | "name": "Slim-VNDK-Lite", 14 | "size": "1109751952", 15 | "url": "https://github.com/ChonDoit/treble_superior_patches/releases/download/A13-v20230824/SuperiorOS_A13-arm64-bgS-slim-vndklite_20230824.img.xz" 16 | }, 17 | { 18 | "name": "Slim-Secure", 19 | "size": "1009866700", 20 | "url": "https://github.com/ChonDoit/treble_superior_patches/releases/download/A13-v20230824/SuperiorOS_A13-RO-arm64-bgN-slim_20230824.img.xz" 21 | } 22 | ] 23 | } -------------------------------------------------------------------------------- /patches/trebledroid/platform_external_selinux/01-Increase-default-log_level-to-get-actual-selinux-err.patch: -------------------------------------------------------------------------------- 1 | From 6c2ad4aed9187b64d5dae594096fece5666e648f Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Mon, 9 Apr 2018 00:19:49 +0200 4 | Subject: [PATCH 1/8] Increase default log_level to get actual selinux error in 5 | kmsg 6 | 7 | --- 8 | secilc/secilc.c | 2 +- 9 | 1 file changed, 1 insertion(+), 1 deletion(-) 10 | 11 | diff --git a/secilc/secilc.c b/secilc/secilc.c 12 | index 9c78e425..71a0f685 100644 13 | --- a/secilc/secilc.c 14 | +++ b/secilc/secilc.c 15 | @@ -103,7 +103,7 @@ int main(int argc, char *argv[]) 16 | int opt_index = 0; 17 | char *fc_buf = NULL; 18 | size_t fc_size; 19 | - enum cil_log_level log_level = CIL_ERR; 20 | + enum cil_log_level log_level = CIL_WARN; 21 | static struct option long_opts[] = { 22 | {"help", no_argument, 0, 'h'}, 23 | {"verbose", no_argument, 0, 'v'}, 24 | -- 25 | 2.25.1 26 | 27 | -------------------------------------------------------------------------------- /patches/pre/platform_system_vold/01-Add-missing-texfat.patch: -------------------------------------------------------------------------------- 1 | From b12ac26e779f6f90fe4692736a96bd04f2f77ea9 Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Tue, 7 Jun 2022 21:02:55 +0000 4 | Subject: [PATCH] Add missing texfat FS driver name 5 | 6 | --- 7 | main.cpp | 1 + 8 | 1 file changed, 1 insertion(+) 9 | 10 | diff --git a/main.cpp b/main.cpp 11 | index 7f9c21b..103551f 100644 12 | --- a/main.cpp 13 | +++ b/main.cpp 14 | @@ -67,6 +67,7 @@ int main(int argc, char** argv) { 15 | ATRACE_BEGIN("main"); 16 | 17 | LOG(DEBUG) << "Detected support for:" 18 | + << (android::vold::IsFilesystemSupported("texfat") ? " texfat" : "") 19 | << (android::vold::IsFilesystemSupported("exfat") ? " exfat" : "") 20 | << (android::vold::IsFilesystemSupported("ext4") ? " ext4" : "") 21 | << (android::vold::IsFilesystemSupported("f2fs") ? " f2fs" : "") 22 | -- 23 | 2.17.1 24 | 25 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_build_make/03-Dont-build-init.vndk-nodef.rc.patch: -------------------------------------------------------------------------------- 1 | From bb2b66de553fef9ba4e073f9a99fdbf309846104 Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Sat, 1 Oct 2022 02:48:17 +0000 4 | Subject: [PATCH] Don't build init.vndk-nodef.rc 5 | 6 | --- 7 | target/product/gsi_release.mk | 3 +-- 8 | 1 file changed, 1 insertion(+), 2 deletions(-) 9 | 10 | diff --git a/target/product/gsi_release.mk b/target/product/gsi_release.mk 11 | index 74501cd1f..28700cd39 100644 12 | --- a/target/product/gsi_release.mk 13 | +++ b/target/product/gsi_release.mk 14 | @@ -59,8 +59,7 @@ PRODUCT_PACKAGES += com.android.apex.cts.shim.v1_with_prebuilts.flattened 15 | # GSI specific tasks on boot 16 | PRODUCT_PACKAGES += \ 17 | gsi_skip_mount.cfg \ 18 | - init.gsi.rc \ 19 | - init.vndk-nodef.rc \ 20 | + init.gsi.rc 21 | 22 | # Support additional VNDK snapshots 23 | PRODUCT_EXTRA_VNDK_VERSIONS := \ 24 | -- 25 | 2.34.1 26 | 27 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_vold/03-Don-t-unmount-rw-system.sh-binds.patch: -------------------------------------------------------------------------------- 1 | From cb79745f2052faa461db44b9189fafa7cca3f4fe Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Mon, 29 Nov 2021 17:49:13 -0500 4 | Subject: [PATCH 7/7] Don't unmount rw-system.sh binds 5 | 6 | Change-Id: If9132c21defa8b09879b79a70794c5275d6852d0 7 | --- 8 | VolumeManager.cpp | 1 + 9 | 1 file changed, 1 insertion(+) 10 | 11 | diff --git a/VolumeManager.cpp b/VolumeManager.cpp 12 | index 2697f67..d592c7f 100644 13 | --- a/VolumeManager.cpp 14 | +++ b/VolumeManager.cpp 15 | @@ -957,6 +957,7 @@ int VolumeManager::unmountAll() { 16 | while ((mentry = getmntent(fp)) != NULL) { 17 | auto test = std::string(mentry->mnt_dir); 18 | if ((StartsWith(test, "/mnt/") && 19 | + !StartsWith(test, "/mnt/phh") && 20 | #ifdef __ANDROID_DEBUGGABLE__ 21 | !StartsWith(test, "/mnt/scratch") && 22 | #endif 23 | -- 24 | 2.25.1 25 | 26 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_core/19-Add-vendor-firmware_mnt.patch: -------------------------------------------------------------------------------- 1 | From 3a1c0878a2d679421e0b27c313bb090758aacf25 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Tue, 11 Jul 2023 14:52:40 -0400 4 | Subject: [PATCH] Add /vendor/firmware_mnt. 5 | 6 | Moto Razr 2019 look for firmwares (modem, sensors, ...) there 7 | 8 | --- 9 | rootdir/ueventd.rc | 2 +- 10 | 1 file changed, 1 insertion(+), 1 deletion(-) 11 | 12 | diff --git a/rootdir/ueventd.rc b/rootdir/ueventd.rc 13 | index c9cd629b317d..31f7f38ccfb7 100644 14 | --- a/rootdir/ueventd.rc 15 | +++ b/rootdir/ueventd.rc 16 | @@ -1,7 +1,7 @@ 17 | import /vendor/etc/ueventd.rc 18 | import /odm/etc/ueventd.rc 19 | 20 | -firmware_directories /etc/firmware/ /odm/firmware/ /vendor/firmware/ /firmware/image/ 21 | +firmware_directories /etc/firmware/ /odm/firmware/ /vendor/firmware/ /firmware/image/ /vendor/firmware_mnt/image/ 22 | uevent_socket_rcvbuf_size 16M 23 | 24 | subsystem graphics 25 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_vold/01-Allow-deletion-of-symlink.patch: -------------------------------------------------------------------------------- 1 | From 41366125be884173003cecd2f7fadd70248ab938 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Sat, 17 Feb 2018 19:39:38 +0100 4 | Subject: [PATCH 1/7] Allow deletion of symlink 5 | 6 | Change-Id: I9731895f88729072297f753088583aabbe6990f4 7 | --- 8 | FsCrypt.cpp | 1 + 9 | 1 file changed, 1 insertion(+) 10 | 11 | diff --git a/FsCrypt.cpp b/FsCrypt.cpp 12 | index 04def5c..c7de48e 100644 13 | --- a/FsCrypt.cpp 14 | +++ b/FsCrypt.cpp 15 | @@ -315,6 +315,7 @@ static bool prepare_dir(const std::string& dir, mode_t mode, uid_t uid, gid_t gi 16 | static bool destroy_dir(const std::string& dir) { 17 | LOG(DEBUG) << "Destroying: " << dir; 18 | if (rmdir(dir.c_str()) != 0 && errno != ENOENT) { 19 | + if(unlink(dir.c_str()) == 0) return true; 20 | PLOG(ERROR) << "Failed to destroy " << dir; 21 | return false; 22 | } 23 | -- 24 | 2.25.1 25 | 26 | -------------------------------------------------------------------------------- /patches/personal/platform_device_phh_treble/03-Allow-TrebleApp-to-delete-package-cache.patch: -------------------------------------------------------------------------------- 1 | From c9f10bac73956cb495695d52c9c6cba1c3841534 Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Fri, 7 Jul 2023 04:38:56 +0000 4 | Subject: [PATCH] Allow TrebleApp to delete /data/system/package_cache 5 | 6 | --- 7 | sepolicy/phh.te | 4 ++++ 8 | 1 file changed, 4 insertions(+) 9 | 10 | diff --git a/sepolicy/phh.te b/sepolicy/phh.te 11 | index 9e233c3..30658de 100644 12 | --- a/sepolicy/phh.te 13 | +++ b/sepolicy/phh.te 14 | @@ -15,3 +15,7 @@ allow phhsu_daemon userdata_block_device:blk_file ioctl; 15 | allowxperm phhsu_daemon userdata_block_device:blk_file ioctl { 0x1278 0x127a }; 16 | 17 | allow kernel gsi_data_file:file rw_file_perms; 18 | + 19 | +# Allow TrebleApp to delete /data/system/package_cache 20 | +allow system_app system_data_file:dir { read write open remove_name rmdir }; 21 | +allow system_app system_data_file:file { read unlink }; 22 | -- 23 | 2.34.1 24 | 25 | -------------------------------------------------------------------------------- /patches/personal/platform_vendor_cherish/04-BootAnimation-at-720p.patch: -------------------------------------------------------------------------------- 1 | From 98ba9ebcc3750a57a6451059511954d739ffa705 Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Sun, 13 Aug 2023 00:49:47 +0000 4 | Subject: [PATCH] BootAnimation 5 | 6 | --- 7 | config/bootanimation.mk | 3 ++- 8 | 1 file changed, 2 insertions(+), 1 deletion(-) 9 | 10 | diff --git a/config/bootanimation.mk b/config/bootanimation.mk 11 | index b33bfd4d..12e9020f 100644 12 | --- a/config/bootanimation.mk 13 | +++ b/config/bootanimation.mk 14 | @@ -1,3 +1,4 @@ 15 | +TARGET_BOOT_ANIMATION_RES := 720 16 | 17 | # Bootanimation 18 | ifeq ($(TARGET_BOOT_ANIMATION_RES),1080) 19 | @@ -13,4 +14,4 @@ else 20 | $(warning "CherishStyle: Current bootanimation res is not supported, forcing 1080p") 21 | endif 22 | PRODUCT_COPY_FILES += vendor/cherish/bootanimation/bootanimation_1080.zip:$(TARGET_COPY_OUT_PRODUCT)/media/bootanimation.zip 23 | -endif 24 | \ No newline at end of file 25 | +endif 26 | -- 27 | 2.34.1 28 | 29 | -------------------------------------------------------------------------------- /patches/pre/platform_device_phh_treble/03-Allow-servicemanager-to-access-hal-audio-sysbta.patch: -------------------------------------------------------------------------------- 1 | From 4a7c81ca9da035f9aa03c41fa087fbdc5d2d87af Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Fri, 11 Nov 2022 21:09:06 +0000 4 | Subject: [PATCH 3/5] Allow servicemanager to access hal_audio_sysbta 5 | 6 | --- 7 | sepolicy/hal_audio_sysbta.te | 4 ++++ 8 | 1 file changed, 4 insertions(+) 9 | 10 | diff --git a/sepolicy/hal_audio_sysbta.te b/sepolicy/hal_audio_sysbta.te 11 | index d871ed3..e5c6087 100644 12 | --- a/sepolicy/hal_audio_sysbta.te 13 | +++ b/sepolicy/hal_audio_sysbta.te 14 | @@ -8,3 +8,7 @@ hal_client_domain(hal_audio_sysbta, hal_allocator) 15 | 16 | # allow audioserver to call hal_audio dump with its own fd to retrieve status 17 | allow hal_audio_sysbta audioserver:fifo_file write; 18 | + 19 | +# Allow servicemanager to access hal_audio_sysbta 20 | +allow servicemanager hal_audio_sysbta:dir r_dir_perms; 21 | +allow servicemanager hal_audio_sysbta:file r_file_perms; 22 | -- 23 | 2.34.1 24 | 25 | -------------------------------------------------------------------------------- /patches/pre/platform_build_make/01-Remove-duplicated-ro-adb-secure.patch: -------------------------------------------------------------------------------- 1 | From cfb13756061b58e67e61876d20d997043a2bd683 Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Thu, 10 Nov 2022 21:03:49 +0000 4 | Subject: [PATCH] Remove duplicated ro.secure and ro.adb.secure 5 | 6 | --- 7 | core/main.mk | 8 -------- 8 | 1 file changed, 8 deletions(-) 9 | 10 | diff --git a/core/main.mk b/core/main.mk 11 | index 2abd9d2d6..780b9f5f5 100644 12 | --- a/core/main.mk 13 | +++ b/core/main.mk 14 | @@ -367,14 +367,6 @@ endif 15 | enable_target_debugging := true 16 | tags_to_install := 17 | ifneq (,$(user_variant)) 18 | - # Target is secure in user builds. 19 | - ADDITIONAL_SYSTEM_PROPERTIES += ro.secure=1 20 | - ADDITIONAL_SYSTEM_PROPERTIES += security.perf_harden=1 21 | - 22 | - ifeq ($(user_variant),user) 23 | - ADDITIONAL_SYSTEM_PROPERTIES += ro.adb.secure=1 24 | - endif 25 | - 26 | ifeq ($(user_variant),userdebug) 27 | # Pick up some extra useful tools 28 | tags_to_install += debug 29 | -- 30 | 2.25.1 31 | 32 | -------------------------------------------------------------------------------- /patches/pre/platform_device_phh_treble/04-Allow-Huawei-offline-charge-sepolicy.patch: -------------------------------------------------------------------------------- 1 | From f9e03bb9ec89b48f38d23da74eb632e5c572b4ed Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Mon, 19 Jun 2023 22:31:42 +0000 4 | Subject: [PATCH 2/5] Allow Huawei offline charging sepolicy 5 | 6 | --- 7 | sepolicy/charger.te | 4 ++-- 8 | 1 file changed, 2 insertions(+), 2 deletions(-) 9 | 10 | diff --git a/sepolicy/charger.te b/sepolicy/charger.te 11 | index cbcb255..53044d5 100644 12 | --- a/sepolicy/charger.te 13 | +++ b/sepolicy/charger.te 14 | @@ -3,8 +3,8 @@ attribute sysfs_backlight_attr; 15 | allow charger sysfs_backlight_attr:file rw_file_perms; 16 | 17 | # Allow charger to write to sysfs_led_attr (only for huawei) 18 | -# attribute sysfs_led_attr; 19 | -# allow charger sysfs_led_attr:file rw_file_perms; 20 | +attribute sysfs_led_attr; 21 | +allow charger sysfs_led_attr:file rw_file_perms; 22 | 23 | # Allow charger to read and write to sysfs_power 24 | allow charger sysfs_power:file rw_file_perms; 25 | -- 26 | 2.34.1 27 | 28 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_netd/03-Support-no-bpf-usecase.patch: -------------------------------------------------------------------------------- 1 | From a81ec89fd832ce5122d9ca7fc33083fa4dc0c073 Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Fri, 7 Oct 2022 02:43:21 +0000 4 | Subject: [PATCH 2/2] Support no-bpf usecase 5 | 6 | Change-Id: Ic759e2cfaf11705169a4a6b677b0e5aca26907b3 7 | --- 8 | server/Controllers.cpp | 2 +- 9 | 1 file changed, 1 insertion(+), 1 deletion(-) 10 | 11 | diff --git a/server/Controllers.cpp b/server/Controllers.cpp 12 | index 00ee186d..faa6f135 100644 13 | --- a/server/Controllers.cpp 14 | +++ b/server/Controllers.cpp 15 | @@ -284,7 +284,7 @@ void Controllers::init() { 16 | // As such simply exit netd. This may crash loop the system, but by failing 17 | // to bootup we will trigger rollback and thus this offers us protection against 18 | // a mainline update breaking things. 19 | - exit(1); 20 | + // exit(1); 21 | } 22 | gLog.info("Enabling bandwidth control: %" PRId64 "us", s.getTimeAndResetUs()); 23 | 24 | -- 25 | 2.34.1 26 | 27 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_bootable_recovery/01-Don-t-reboot-if-we-couldn-t-get-bootctrl.patch: -------------------------------------------------------------------------------- 1 | From 5b4b66da955b6b329846e6010db79b2ecb344fcf Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Thu, 12 Sep 2019 20:31:07 +0200 4 | Subject: [PATCH] Don't reboot if we couldn't get bootctrl 5 | 6 | Change-Id: Id1793660bd1c97ab369607f58a772ca3512ec1af 7 | --- 8 | update_verifier/update_verifier.cpp | 2 +- 9 | 1 file changed, 1 insertion(+), 1 deletion(-) 10 | 11 | diff --git a/update_verifier/update_verifier.cpp b/update_verifier/update_verifier.cpp 12 | index a042f900..ea3645af 100644 13 | --- a/update_verifier/update_verifier.cpp 14 | +++ b/update_verifier/update_verifier.cpp 15 | @@ -310,7 +310,7 @@ int update_verifier(int argc, char** argv) { 16 | sp module = IBootControl::getService(); 17 | if (module == nullptr) { 18 | LOG(ERROR) << "Error getting bootctrl module."; 19 | - return reboot_device(); 20 | + return 0; 21 | } 22 | 23 | uint32_t current_slot = module->getCurrentSlot(); 24 | -- 25 | 2.25.1 26 | 27 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_bpf/01-Support-no-bpf-usecase.patch: -------------------------------------------------------------------------------- 1 | From 5c06d2b7b5e15b5d441caeaa4c74eb103aff0d39 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Wed, 13 Oct 2021 10:56:52 -0400 4 | Subject: [PATCH] Support no-bpf usecase 5 | 6 | Change-Id: I75a427a2a41aa4ab1104ad88a891bef0dc2d9c91 7 | --- 8 | bpfloader/BpfLoader.cpp | 4 ++-- 9 | 1 file changed, 2 insertions(+), 2 deletions(-) 10 | 11 | diff --git a/bpfloader/BpfLoader.cpp b/bpfloader/BpfLoader.cpp 12 | index 7a68894..2d491a3 100644 13 | --- a/bpfloader/BpfLoader.cpp 14 | +++ b/bpfloader/BpfLoader.cpp 15 | @@ -121,8 +121,8 @@ int main() { 16 | ALOGE("If this triggers randomly, you might be hitting some memory allocation " 17 | "problems or startup script race."); 18 | ALOGE("--- DO NOT EXPECT SYSTEM TO BOOT SUCCESSFULLY ---"); 19 | - sleep(20); 20 | - return 2; 21 | + android::base::SetProperty("bpf.progs_loaded", "1"); 22 | + return 0; 23 | } 24 | } 25 | 26 | -- 27 | 2.25.1 28 | 29 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_core/06-Panic-into-recovery-rather-than-bootloader.patch: -------------------------------------------------------------------------------- 1 | From 05b34b0b46339166a090ea3fca01af76bd6d472a Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Sat, 1 Oct 2022 02:59:59 +0000 4 | Subject: [PATCH] Panic into recovery rather than bootloader 5 | 6 | Getting last_kmsg/pstore from bootloader isn't possible for other people 7 | than the OEM, but we have TWRP to access last_kmsg/pstore 8 | 9 | --- 10 | init/reboot_utils.cpp | 2 +- 11 | 1 file changed, 1 insertion(+), 1 deletion(-) 12 | 13 | diff --git a/init/reboot_utils.cpp b/init/reboot_utils.cpp 14 | index b3fa9fd3b..a06538639 100644 15 | --- a/init/reboot_utils.cpp 16 | +++ b/init/reboot_utils.cpp 17 | @@ -36,7 +36,7 @@ 18 | namespace android { 19 | namespace init { 20 | 21 | -static std::string init_fatal_reboot_target = "bootloader"; 22 | +static std::string init_fatal_reboot_target = "recovery"; 23 | static bool init_fatal_panic = false; 24 | 25 | // this needs to read the /proc/* files directly because it is called before 26 | -- 27 | 2.34.1 28 | 29 | -------------------------------------------------------------------------------- /patches/personal/platform_system_core/01-Lockscreen-charging-info.patch: -------------------------------------------------------------------------------- 1 | From 14ffd6f62cec7f0bd9acb70486f94839784afc04 Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Wed, 5 Jul 2023 16:37:35 +0000 4 | Subject: [PATCH] LockScreen Charging info [2/3] 5 | 6 | --- 7 | healthd/BatteryMonitor.cpp | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/healthd/BatteryMonitor.cpp b/healthd/BatteryMonitor.cpp 11 | index 48ededfa3..478e42b43 100644 12 | --- a/healthd/BatteryMonitor.cpp 13 | +++ b/healthd/BatteryMonitor.cpp 14 | @@ -47,7 +47,7 @@ 15 | #define POWER_SUPPLY_SUBSYSTEM "power_supply" 16 | #define POWER_SUPPLY_SYSFS_PATH "/sys/class/" POWER_SUPPLY_SUBSYSTEM 17 | #define SYSFS_BATTERY_CURRENT "/sys/class/power_supply/battery/current_now" 18 | -#define SYSFS_BATTERY_VOLTAGE "/sys/class/power_supply/battery/voltage_now" 19 | +#define SYSFS_BATTERY_VOLTAGE "/sys/class/power_supply/usb/voltage_now" 20 | #define FAKE_BATTERY_CAPACITY 42 21 | #define FAKE_BATTERY_TEMPERATURE 424 22 | #define MILLION 1.0e6 23 | -- 24 | 2.34.1 25 | 26 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_base/26-Once-we-integrate-Samsung-Power-hal-in-libpowermanag.patch: -------------------------------------------------------------------------------- 1 | From 16d20700511d44d4d0b2382e55df4eda806f79dc Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Mon, 27 Dec 2021 17:57:11 -0500 4 | Subject: [PATCH 28/35] Once we integrate Samsung Power hal in libpowermanager, 5 | libpowermanager and its deps require linking against 6 | vendor.samsung.hardware.miscpower@2.0 7 | 8 | Change-Id: I9084f64e505009abe9420d28b44199605cee52d8 9 | --- 10 | services/core/jni/Android.bp | 1 + 11 | 1 file changed, 1 insertion(+) 12 | 13 | diff --git a/services/core/jni/Android.bp b/services/core/jni/Android.bp 14 | index 59256cc73df1..17736c3623c9 100644 15 | --- a/services/core/jni/Android.bp 16 | +++ b/services/core/jni/Android.bp 17 | @@ -185,6 +185,7 @@ cc_defaults { 18 | "service.incremental", 19 | "vendor.samsung.hardware.light@2.0", 20 | "vendor.samsung.hardware.light@3.0", 21 | + "vendor.samsung.hardware.miscpower@2.0", 22 | ], 23 | 24 | static_libs: [ 25 | -- 26 | 2.25.1 27 | 28 | -------------------------------------------------------------------------------- /patches/personal/platform_device_phh_treble/02-Again-dont-handle-apn.patch: -------------------------------------------------------------------------------- 1 | From 8a755e234a04b2eb218cac9eb6e4c9616f0e3861 Mon Sep 17 00:00:00 2001 2 | From: ChonDoe 3 | Date: Tue, 14 Feb 2023 20:54:09 +0000 4 | Subject: [PATCH] Again, don't handle apn 5 | 6 | --- 7 | base.mk | 4 ++-- 8 | 3 files changed, 4 insertions(+), 2 deletions(-) 9 | 10 | diff --git a/base.mk b/base.mk 11 | index eee2ed7..fb8882b 100644 12 | --- a/base.mk 13 | +++ b/base.mk 14 | @@ -17,8 +17,8 @@ PRODUCT_COPY_FILES += \ 15 | device/phh/treble/bluetooth/audio/config/sysbta_audio_policy_configuration.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/sysbta_audio_policy_configuration.xml \ 16 | device/phh/treble/bluetooth/audio/config/sysbta_audio_policy_configuration_7_0.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/sysbta_audio_policy_configuration_7_0.xml 17 | 18 | -#Use a more decent APN config 19 | -PRODUCT_COPY_FILES += \ 20 | +# Use a more decent APN config 21 | +# PRODUCT_COPY_FILES += \ 22 | device/sample/etc/apns-full-conf.xml:system/etc/apns-conf.xml 23 | 24 | SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS += device/phh/treble/sepolicy 25 | -- 26 | 2.34.1 27 | 28 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_external_selinux/09-Improve-SELinux-policy-workaround-on-device-phh-treble.patch: -------------------------------------------------------------------------------- 1 | From ea9150d5199cb2fbbe84bf35db9d7a50a85c6673 Mon Sep 17 00:00:00 2001 2 | From: ponces 3 | Date: Mon, 7 Nov 2022 16:14:20 +0000 4 | Subject: [PATCH] Improve SELinux policy workaround on device/phh/treble 5 | conflict to exit with SEPOL_OK instead of SEPOL_EEXIST 6 | 7 | This fixes boot on many Samsung devices as exiting with SEPOL_EEXIST will prevent them to boot 8 | --- 9 | libsepol/cil/src/cil_build_ast.c | 1 - 10 | 1 file changed, 1 deletion(-) 11 | 12 | diff --git a/libsepol/cil/src/cil_build_ast.c b/libsepol/cil/src/cil_build_ast.c 13 | index 023fd6c7..61c8864b 100644 14 | --- a/libsepol/cil/src/cil_build_ast.c 15 | +++ b/libsepol/cil/src/cil_build_ast.c 16 | @@ -141,7 +141,6 @@ int cil_add_decl_to_symtab(struct cil_db *db, symtab_t *symtab, hashtab_key_t ke 17 | /* multiple_decls is enabled and works for this datum type, add node */ 18 | cil_list_append(prev->nodes, CIL_NODE, node); 19 | node->data = prev; 20 | - return SEPOL_EEXIST; 21 | } 22 | 23 | return SEPOL_OK; 24 | -- 25 | 2.25.1 26 | 27 | -------------------------------------------------------------------------------- /patches/pre/platform_frameworks_base/01-Remove-duplicated-inCryptKeeperBounce.patch: -------------------------------------------------------------------------------- 1 | From d146aefed9a18eca4490d15c9131301112ee3131 Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Sun, 23 Apr 2023 21:13:01 +0000 4 | Subject: [PATCH 2/2] Remove Duplicated inCryptKeeperBounce 5 | 6 | --- 7 | core/java/android/os/storage/StorageManager.java | 8 +++++--- 8 | 1 file changed, 5 insertions(+), 3 deletions(-) 9 | 10 | diff --git a/core/java/android/os/storage/StorageManager.java b/core/java/android/os/storage/StorageManager.java 11 | index 4bc7774cb2d7..d4ea2056ecb6 100644 12 | --- a/core/java/android/os/storage/StorageManager.java 13 | +++ b/core/java/android/os/storage/StorageManager.java 14 | @@ -1693,9 +1693,11 @@ public class StorageManager { 15 | return RoSystemProperties.CRYPTO_ENCRYPTED; 16 | } 17 | 18 | - public static boolean inCryptKeeperBounce() { 19 | - return false; 20 | - } 21 | + /** 22 | + * public static boolean inCryptKeeperBounce() { 23 | + * return false; 24 | + * } 25 | + */ 26 | 27 | /** {@hide} 28 | * Is this device file encrypted? 29 | -- 30 | 2.34.1 31 | 32 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_external_selinux/06-Allow-mismatches-of-exfat-genfscon.patch: -------------------------------------------------------------------------------- 1 | From 725f8a440f4a3c3c50cca83c4965dcf7ebf2b9a2 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Sun, 24 May 2020 17:22:22 +0200 4 | Subject: [PATCH 7/8] Allow mismatches of exfat genfscon 5 | 6 | --- 7 | libsepol/cil/src/cil_post.c | 4 ++++ 8 | 1 file changed, 4 insertions(+) 9 | 10 | diff --git a/libsepol/cil/src/cil_post.c b/libsepol/cil/src/cil_post.c 11 | index 68c0318e..75e5128c 100644 12 | --- a/libsepol/cil/src/cil_post.c 13 | +++ b/libsepol/cil/src/cil_post.c 14 | @@ -488,6 +488,10 @@ int cil_post_genfscon_context_compare(const void *a, const void *b) 15 | */ 16 | if(strcmp(a_genfscon->path_str, "/devices/virtual/block/") == 0) 17 | bypass = 1; 18 | + if(strcmp(a_genfscon->fs_str, "exfat") == 0 || strcmp(a_genfscon->fs_str, "esdfs") == 0) { 19 | + if(strcmp(a_genfscon->path_str, "/") == 0) 20 | + bypass = 1; 21 | + } 22 | if(bypass == 1) { 23 | fprintf(stderr, "Received conflicting %s vs %s but ignore\n", a_genfscon->path_str, b_genfscon->path_str); 24 | return 0; 25 | -- 26 | 2.25.1 27 | 28 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_base/13-HOME-deserves-to-wake-up-devices-just-as-well-as-bac.patch: -------------------------------------------------------------------------------- 1 | From b90f7d1e60221568bf9a8bef2b7855f71196e99c Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Sat, 6 Jun 2020 18:21:56 +0200 4 | Subject: [PATCH 09/35] HOME deserves to wake-up devices just as well as back 5 | and menu 6 | 7 | Change-Id: Ia562bafd8c620d00c17e8eb338e4701c6c4a3c3a 8 | --- 9 | core/java/android/view/KeyEvent.java | 1 + 10 | 1 file changed, 1 insertion(+) 11 | 12 | diff --git a/core/java/android/view/KeyEvent.java b/core/java/android/view/KeyEvent.java 13 | index cda9b233576c..bb35e3172165 100644 14 | --- a/core/java/android/view/KeyEvent.java 15 | +++ b/core/java/android/view/KeyEvent.java 16 | @@ -1988,6 +1988,7 @@ public class KeyEvent extends InputEvent implements Parcelable { 17 | switch (keyCode) { 18 | case KeyEvent.KEYCODE_CAMERA: 19 | case KeyEvent.KEYCODE_MENU: 20 | + case KeyEvent.KEYCODE_HOME: 21 | case KeyEvent.KEYCODE_PAIRING: 22 | case KeyEvent.KEYCODE_STEM_1: 23 | case KeyEvent.KEYCODE_STEM_2: 24 | -- 25 | 2.25.1 26 | 27 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_nfc/01-Let-vendor-have-priority-over-NFC-config-file-rather.patch: -------------------------------------------------------------------------------- 1 | From 270a053557c394100be9854ce30360c751960cbe Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Mon, 21 Dec 2020 19:36:54 +0100 4 | Subject: [PATCH] Let vendor have priority over NFC config file, rather than 5 | GSI 6 | 7 | Thanks @mikalovtch 8 | 9 | Change-Id: Iaee468f3b8e5c8ec90ca7e856a6526d1cbcaa33e 10 | --- 11 | src/adaptation/nfc_config.cc | 2 +- 12 | 1 file changed, 1 insertion(+), 1 deletion(-) 13 | 14 | diff --git a/src/adaptation/nfc_config.cc b/src/adaptation/nfc_config.cc 15 | index 264968e4..92606979 100644 16 | --- a/src/adaptation/nfc_config.cc 17 | +++ b/src/adaptation/nfc_config.cc 18 | @@ -30,7 +30,7 @@ using namespace ::android::base; 19 | namespace { 20 | std::string searchConfigPath(std::string file_name) { 21 | const std::vector search_path = { 22 | - "/product/etc/", "/odm/etc/", "/vendor/etc/", "/system_ext/etc/", "/etc/", 23 | + "/odm/etc/", "/vendor/etc/", "/product/etc/", "/system_ext/etc/", "/etc/", 24 | }; 25 | for (std::string path : search_path) { 26 | path.append(file_name); 27 | -- 28 | 2.25.1 29 | 30 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_base/03-Fix-env-empty-string.patch: -------------------------------------------------------------------------------- 1 | From f9fec57ba5cecff2d125f00ea61170b41f5c2597 Mon Sep 17 00:00:00 2001 2 | From: Raphael Mounier 3 | Date: Sat, 6 Aug 2022 18:08:36 +0200 4 | Subject: [PATCH] Fix hi6250 env empty string - ANDROID_STORAGE 5 | 6 | Huawei hi6250 define in init.hi6250.rc ANDROID_STORAGE to "", so check empty string and replace with default path. Apply change for all env directory 7 | --- 8 | core/java/android/os/Environment.java | 2 +- 9 | 1 file changed, 1 insertion(+), 1 deletion(-) 10 | 11 | diff --git a/core/java/android/os/Environment.java b/core/java/android/os/Environment.java 12 | index 0257408b3e42..d0841cf34c3d 100644 13 | --- a/core/java/android/os/Environment.java 14 | +++ b/core/java/android/os/Environment.java 15 | @@ -1426,7 +1426,7 @@ public class Environment { 16 | 17 | static File getDirectory(String variableName, String defaultPath) { 18 | String path = System.getenv(variableName); 19 | - return path == null ? new File(defaultPath) : new File(path); 20 | + return ((path == null || path.isEmpty()) ? new File(defaultPath) : new File(path)); 21 | } 22 | 23 | @NonNull 24 | -- 25 | 2.30.2 26 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_core/08-Set-xbin-755.patch: -------------------------------------------------------------------------------- 1 | From f5f00f782aac3cb2fff1497a93c3772058d6bb0f Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Sun, 13 Feb 2022 04:04:58 +0000 4 | Subject: [PATCH] Set xbin to 755 5 | 6 | --- 7 | libcutils/fs_config.cpp | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/libcutils/fs_config.cpp b/libcutils/fs_config.cpp 11 | index 342f9aec4..7539c1186 100644 12 | --- a/libcutils/fs_config.cpp 13 | +++ b/libcutils/fs_config.cpp 14 | @@ -90,7 +90,7 @@ static const struct fs_path_config android_dirs[] = { 15 | { 00755, AID_ROOT, AID_SHELL, 0, "system/etc" }, 16 | { 00755, AID_ROOT, AID_ROOT, 0, "system/etc/ppp" }, 17 | { 00755, AID_ROOT, AID_SHELL, 0, "system/vendor" }, 18 | - { 00750, AID_ROOT, AID_SHELL, 0, "system/xbin" }, 19 | + { 00755, AID_ROOT, AID_SHELL, 0, "system/xbin" }, 20 | { 00751, AID_ROOT, AID_SHELL, 0, "system/apex/*/bin" }, 21 | { 00751, AID_ROOT, AID_SHELL, 0, "system_ext/bin" }, 22 | { 00751, AID_ROOT, AID_SHELL, 0, "system_ext/apex/*/bin" }, 23 | -- 24 | 2.34.1 25 | 26 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_native/03-unshared_oob-didn-t-exist-in-O-P-so-detect-its-suppo.patch: -------------------------------------------------------------------------------- 1 | From 3da557c225a073e74d3eb5f1c41a22c19092dc27 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Tue, 5 Jan 2021 23:44:00 +0100 4 | Subject: [PATCH 05/16] unshared_oob didn't exist in O/P, so detect its 5 | supported based on vndk version 6 | 7 | --- 8 | cmds/installd/migrate_legacy_obb_data.sh | 2 +- 9 | 1 file changed, 1 insertion(+), 1 deletion(-) 10 | 11 | diff --git a/cmds/installd/migrate_legacy_obb_data.sh b/cmds/installd/migrate_legacy_obb_data.sh 12 | index 7399681c3e..9d5b73eae2 100644 13 | --- a/cmds/installd/migrate_legacy_obb_data.sh 14 | +++ b/cmds/installd/migrate_legacy_obb_data.sh 15 | @@ -18,7 +18,7 @@ 16 | rm -rf /data/media/0/Android/obb/test_probe 17 | mkdir -p /data/media/0/Android/obb/ 18 | touch /data/media/0/Android/obb/test_probe 19 | -if ! test -f /data/media/0/Android/obb/test_probe ; then 20 | +if ! test -f /data/media/0/Android/obb/test_probe || [ "$(adb shell getprop ro.vndk.version)" -le 28 ]; then 21 | log -p i -t migrate_legacy_obb_data "No support for 'unshared_obb'. Not migrating" 22 | rm -rf /data/media/0/Android/obb/test_probe 23 | exit 0 24 | -- 25 | 2.25.1 26 | 27 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_native/01-On-Samsung-we-need-to-send-a-hack-message-to-HAL-to-.patch: -------------------------------------------------------------------------------- 1 | From c055d562f29ec7d6b10d84a6068753e7a9072c65 Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Thu, 29 Sep 2022 00:11:56 -0300 4 | Subject: [PATCH] On Samsung, we need to send a hack-message to HAL to get all 5 | Sensors 6 | 7 | --- 8 | services/sensorservice/SensorDevice.cpp | 3 +++ 9 | 1 file changed, 3 insertions(+) 10 | 11 | diff --git a/services/sensorservice/SensorDevice.cpp b/services/sensorservice/SensorDevice.cpp 12 | index de050e02d0..c3c78de6f1 100644 13 | --- a/services/sensorservice/SensorDevice.cpp 14 | +++ b/services/sensorservice/SensorDevice.cpp 15 | @@ -37,6 +37,7 @@ 16 | #include 17 | #include 18 | #include 19 | +#include 20 | 21 | using namespace android::hardware::sensors; 22 | using android::hardware::Return; 23 | @@ -77,6 +78,8 @@ SensorDevice::SensorDevice() { 24 | } 25 | 26 | void SensorDevice::initializeSensorList() { 27 | + if(::android::base::GetBoolProperty("persist.sys.phh.samsung_sensors", false)) 28 | + setMode(5555); 29 | if (mHalWrapper == nullptr) { 30 | return; 31 | } 32 | -- 33 | 2.37.3 34 | 35 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_packages_modules_Connectivity/03-Dont-delete-UID-from-BpfMap-on-BPF-less-kernel.patch: -------------------------------------------------------------------------------- 1 | From dcc343ca4d70d0b9dd8e6a9ff08af85d47bc31bf Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Wed, 26 Oct 2022 18:11:10 -0400 4 | Subject: [PATCH 3/3] Dont delete UID from BpfMap on BPF-less kernel 5 | 6 | Change-Id: I93b5b8237f6655cb47e0b0584c54cad73a51e7b2 7 | --- 8 | service-t/src/com/android/server/net/NetworkStatsService.java | 1 + 9 | 1 file changed, 1 insertion(+) 10 | 11 | diff --git a/service-t/src/com/android/server/net/NetworkStatsService.java b/service-t/src/com/android/server/net/NetworkStatsService.java 12 | index 4f0f3411a..d45e8fa58 100644 13 | --- a/service-t/src/com/android/server/net/NetworkStatsService.java 14 | +++ b/service-t/src/com/android/server/net/NetworkStatsService.java 15 | @@ -2421,6 +2421,7 @@ public class NetworkStatsService extends INetworkStatsService.Stub { 16 | * @param uid 17 | */ 18 | private void deleteKernelTagData(int uid) { 19 | + if(mCookieTagMap == null) return; 20 | try { 21 | mCookieTagMap.forEach((key, value) -> { 22 | // If SkDestroyListener deletes the socket tag while this code is running, 23 | -- 24 | 2.25.1 25 | 26 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_base/17-Remove-useless-notification-about-console-service-be.patch: -------------------------------------------------------------------------------- 1 | From 17d6c112a8d8fbe020c0c6a266fe73f560789098 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Fri, 11 Dec 2020 14:41:09 +0100 4 | Subject: [PATCH 14/35] Remove useless notification about "console" service 5 | being running 6 | 7 | --- 8 | .../core/java/com/android/server/am/ActivityManagerService.java | 2 +- 9 | 1 file changed, 1 insertion(+), 1 deletion(-) 10 | 11 | diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java 12 | index a32aa6d895ef..38553b8a5b46 100644 13 | --- a/services/core/java/com/android/server/am/ActivityManagerService.java 14 | +++ b/services/core/java/com/android/server/am/ActivityManagerService.java 15 | @@ -4802,7 +4802,7 @@ public class ActivityManagerService extends IActivityManager.Stub 16 | } 17 | 18 | private void showConsoleNotificationIfActive() { 19 | - if (!SystemProperties.get("init.svc.console").equals("running")) { 20 | + if (!SystemProperties.get("init.svc.console").equals("running") || true) { 21 | return; 22 | } 23 | String title = mContext 24 | -- 25 | 2.25.1 26 | 27 | -------------------------------------------------------------------------------- /patches/personal/platform_vendor_cherish/01-Add-ccache-to-environment-script.patch: -------------------------------------------------------------------------------- 1 | From fa210350fdb97fd06205f0d5d9bba8cd452bce2c Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Mon, 10 Oct 2022 05:08:58 +0000 4 | Subject: [PATCH] Add CCache Check to Environment Setup 5 | 6 | --- 7 | build/envsetup.sh | 18 ++++++++++++++++++ 8 | 1 file changed, 18 insertions(+) 9 | 10 | diff --git a/build/envsetup.sh b/build/envsetup.sh 11 | index b4b68540..140486a3 100644 12 | --- a/build/envsetup.sh 13 | +++ b/build/envsetup.sh 14 | @@ -670,5 +670,23 @@ function fixup_common_out_dir() { 15 | mkdir -p ${common_out_dir} 16 | fi 17 | } 18 | + 19 | +# Check and set ccache path on envsetup 20 | +if [ -z ${CCACHE_EXEC} ]; then 21 | + ccache_path=$(which ccache) 22 | + if [ ! -z "$ccache_path" ]; then 23 | + mkdir /mnt/ccache 24 | + mount --bind ~/.ccache /mnt/ccache 25 | + export USE_CCACHE=1 26 | + export CCACHE_COMPRESS=1 27 | + export CCACHE_EXEC=/usr/bin/ccache 28 | + export CCACHE_DIR=/mnt/ccache 29 | + ccache -M 50G -F 0 30 | + echo "ccache found and CCACHE_EXEC has been set to : $ccache_path" 31 | + else 32 | + echo "ccache not found/installed!" 33 | + fi 34 | +fi 35 | + 36 | # Disable ABI checking 37 | export SKIP_ABI_CHECKS=true 38 | -- 39 | 2.34.1 40 | 41 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_netd/01-Huawei-Kirin-960-accept-broken-rpfilter-match.patch: -------------------------------------------------------------------------------- 1 | From 4a9b2319f13766bce5cebcb919d33fe917c97c4c Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Mon, 2 Jul 2018 22:01:43 +0200 4 | Subject: [PATCH 2/3] [device] ::Huawei Kirin 960:: accept broken rpfilter 5 | match 6 | 7 | How bad a security flaw is this? 8 | People lived with rpfilter on IPv4 for a very long time... 9 | 10 | Change-Id: I9aa63d18e54a8254133adf97bf757c03d6b66757 11 | --- 12 | server/TetherController.cpp | 2 +- 13 | 1 file changed, 1 insertion(+), 1 deletion(-) 14 | 15 | diff --git a/server/TetherController.cpp b/server/TetherController.cpp 16 | index 325fc413..7b106933 100644 17 | --- a/server/TetherController.cpp 18 | +++ b/server/TetherController.cpp 19 | @@ -719,7 +719,7 @@ int TetherController::setForwardRules(bool add, const char *intIface, const char 20 | "*raw\n" 21 | "%s %s -i %s -m rpfilter --invert ! -s fe80::/64 -j DROP\n" 22 | "COMMIT\n", op, LOCAL_RAW_PREROUTING, intIface); 23 | - if (iptablesRestoreFunction(V6, rpfilterCmd, nullptr) == -1 && add) { 24 | + if (iptablesRestoreFunction(V6, rpfilterCmd, nullptr) == -1 && add && false) { 25 | return -EREMOTEIO; 26 | } 27 | 28 | -- 29 | 2.25.1 30 | 31 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_bionic/04-Add-some-properties-to-fake-in-keymaster-prop-replac.patch: -------------------------------------------------------------------------------- 1 | From 73fa657ca056ef1ab283e081baf2cc06240d3054 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Sun, 28 May 2023 16:46:46 -0400 4 | Subject: [PATCH 4/4] Add some properties to fake in "keymaster" prop 5 | replacement mode, to expose unlocked vbmeta state and orange 6 | verifiedbootstate 7 | 8 | --- 9 | libc/system_properties/system_properties.cpp | 6 ++++++ 10 | 1 file changed, 6 insertions(+) 11 | 12 | diff --git a/libc/system_properties/system_properties.cpp b/libc/system_properties/system_properties.cpp 13 | index 40ff48bad..057199318 100644 14 | --- a/libc/system_properties/system_properties.cpp 15 | +++ b/libc/system_properties/system_properties.cpp 16 | @@ -121,6 +121,12 @@ static const char* redirectToProp(const char *name) { 17 | if(strcmp(name, "ro.build.version.security_patch") == 0) { 18 | return "ro.keymaster.xxx.security_patch"; 19 | } 20 | + if(strcmp(name, "ro.boot.vbmeta.device_state") == 0) { 21 | + return "ro.keymaster.xxx.vbmeta_state"; 22 | + } 23 | + if(strcmp(name, "ro.boot.verifiedbootstate") == 0) { 24 | + return "ro.keymaster.xxx.verifiedbootstate"; 25 | + } 26 | } 27 | return name; 28 | } 29 | -- 30 | 2.25.1 31 | 32 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_build_make/02-build-Bypass-vendor-calls.patch: -------------------------------------------------------------------------------- 1 | From b946c0c9e53812808292c51cf7869527edd4eca4 Mon Sep 17 00:00:00 2001 2 | From: Alberto Ponces 3 | Date: Mon, 18 Oct 2021 17:20:18 +0100 4 | Subject: [PATCH 05/10] build: Bypass vendor calls 5 | 6 | Change-Id: I69830d6264356dadd7b037553a899a4eb3d211f1 7 | --- 8 | target/product/aosp_arm64.mk | 6 +++--- 9 | 1 file changed, 3 insertions(+), 3 deletions(-) 10 | 11 | diff --git a/target/product/aosp_arm64.mk b/target/product/aosp_arm64.mk 12 | index 01897b77d2..a0a7c0d2fc 100644 13 | --- a/target/product/aosp_arm64.mk 14 | +++ b/target/product/aosp_arm64.mk 15 | @@ -51,9 +51,9 @@ $(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_product.mk) 16 | # 17 | # All components inherited here go to vendor or vendor_boot image 18 | # 19 | -$(call inherit-product, $(SRC_TARGET_DIR)/product/emulator_vendor.mk) 20 | -$(call inherit-product, $(SRC_TARGET_DIR)/board/generic_arm64/device.mk) 21 | -$(call inherit-product, $(SRC_TARGET_DIR)/product/non_ab_device.mk) 22 | +#$(call inherit-product, $(SRC_TARGET_DIR)/product/emulator_vendor.mk) 23 | +#$(call inherit-product, $(SRC_TARGET_DIR)/board/generic_arm64/device.mk) 24 | +#$(call inherit-product, $(SRC_TARGET_DIR)/product/non_ab_device.mk) 25 | 26 | # 27 | # Special settings for GSI releasing 28 | -- 29 | 2.25.1 30 | 31 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_bpf/02-Revert-detect-inability-to-write-to-index.patch: -------------------------------------------------------------------------------- 1 | From 063b97bc86f91407294597617f03b5544795e1e0 Mon Sep 17 00:00:00 2001 2 | From: Andy CrossGate Yan 3 | Date: Wed, 19 Oct 2022 02:20:05 +0000 4 | Subject: [PATCH] Revert "detect inability to write to index != 0 of bpf map 5 | array" 6 | 7 | This reverts commit ead9d83423877458023056f6ccf9390950d6726f. 8 | --- 9 | bpfloader/BpfLoader.cpp | 9 --------- 10 | 1 file changed, 9 deletions(-) 11 | 12 | diff --git a/bpfloader/BpfLoader.cpp b/bpfloader/BpfLoader.cpp 13 | index bbfa7a8..9ace0fa 100644 14 | --- a/bpfloader/BpfLoader.cpp 15 | +++ b/bpfloader/BpfLoader.cpp 16 | @@ -199,15 +199,6 @@ int main(int argc, char** argv) { 17 | } 18 | } 19 | - 20 | - int key = 1; 21 | - int value = 123; 22 | - android::base::unique_fd map( 23 | - android::bpf::createMap(BPF_MAP_TYPE_ARRAY, sizeof(key), sizeof(value), 2, 0)); 24 | - if (android::bpf::writeToMapEntry(map, &key, &value, BPF_ANY)) { 25 | - ALOGE("Critical kernel bug - failure to write into index 1 of 2 element bpf map array."); 26 | - return 1; 27 | - } 28 | 29 | if (android::base::SetProperty("bpf.progs_loaded", "1") == false) { 30 | ALOGE("Failed to set bpf.progs_loaded property"); 31 | return 1; 32 | -- 33 | 2.25.1 34 | 35 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_av/17-Not-all-sources-in-a-route-are-valid.-Dont-ignore-th.patch: -------------------------------------------------------------------------------- 1 | From 0081d05867bfdaf672d39b547341c46da4a6cdca Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Sat, 1 Oct 2022 01:19:07 +0000 4 | Subject: [PATCH] Not all sources in a route are valid. Dont ignore the whole 5 | route because of one broken source 6 | 7 | --- 8 | .../audiopolicy/common/managerdefinitions/src/Serializer.cpp | 2 +- 9 | 1 file changed, 1 insertion(+), 1 deletion(-) 10 | 11 | diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp 12 | index d4e26598a1..532c3e561c 100644 13 | --- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp 14 | +++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp 15 | @@ -671,7 +671,7 @@ std::variant PolicySerializer::deserializefindPortByTagName(trim(devTag)); 18 | } 19 | - if (source == NULL && !mIgnoreVendorExtensions) { 20 | + if (source == NULL && false) { 21 | ALOGE("%s: no source found with name=%s", __func__, devTag); 22 | return BAD_VALUE; 23 | } else if (source == NULL) { 24 | -- 25 | 2.34.1 26 | 27 | -------------------------------------------------------------------------------- /patches/personal/platform_vendor_hardware_overlay/02-Handle-TrebleAppSecure.patch: -------------------------------------------------------------------------------- 1 | From cf77e6d6d016178427cc4a3233dbaeff9d47fd18 Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Sun, 16 Oct 2022 13:39:16 +0000 4 | Subject: [PATCH] Handle TrebleApp Secure with PHH-SECURE_BUILD 5 | 6 | --- 7 | TrebleApp/Android.mk | 11 +++++++---- 8 | 1 file changed, 7 insertions(+), 4 deletions(-) 9 | 10 | diff --git a/TrebleApp/Android.mk b/TrebleApp/Android.mk 11 | index d302519..8bfd6ba 100644 12 | --- a/TrebleApp/Android.mk 13 | +++ b/TrebleApp/Android.mk 14 | @@ -1,17 +1,20 @@ 15 | LOCAL_PATH := $(my-dir) 16 | 17 | include $(CLEAR_VARS) 18 | - 19 | LOCAL_MODULE := TrebleApp 20 | -LOCAL_SRC_FILES := app.apk 21 | +ifeq ($(PHH-SECURE_BUILD), true) 22 | + LOCAL_SRC_FILES := app_secure.apk 23 | + LOCAL_OVERRIDES_PACKAGES := su SuperUser Updater 24 | + else 25 | + LOCAL_SRC_FILES := app.apk 26 | + LOCAL_OVERRIDES_PACKAGES := su Updater 27 | +endif 28 | LOCAL_MODULE_CLASS := APPS 29 | LOCAL_MODULE_SUFFIX := .apk 30 | LOCAL_BUILT_MODULE_STEM := package.apk 31 | LOCAL_CERTIFICATE := platform 32 | LOCAL_PRIVILEGED_MODULE := true 33 | -LOCAL_OVERRIDES_PACKAGES := Updater 34 | ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 31 && echo OK),OK) 35 | LOCAL_ENFORCE_USES_LIBRARIES := false 36 | endif 37 | - 38 | include $(BUILD_PREBUILT) 39 | -- 40 | 2.34.1 41 | 42 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_core/09-Ugly-but-secure-Set-dev-uinput-as-0666-to-fix-finger.patch: -------------------------------------------------------------------------------- 1 | From 9e3521425283d95a733418fff1ce940e025e67d4 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Fri, 1 Nov 2019 18:22:13 +0100 4 | Subject: [PATCH 4/6] Ugly but secure: Set /dev/uinput as 0666 to fix 5 | fingerprint sensor on some devices 6 | 7 | cf https://github.com/phhusson/device_phh_treble/pull/122/commits/e000d69c286b6686777ea6f1867f379e30273e48 8 | This is safe because even though it's 0666, its SELinux policy is very 9 | tight, and only bluetooth HAL, shell (and fingerprint HAL on Xiaomi) can 10 | access it. 11 | 12 | Change-Id: Id374e781957927d5604cb96c7a39b3fb28b3a6c5 13 | --- 14 | rootdir/ueventd.rc | 2 +- 15 | 1 file changed, 1 insertion(+), 1 deletion(-) 16 | 17 | diff --git a/rootdir/ueventd.rc b/rootdir/ueventd.rc 18 | index 56e774bdc..67230e051 100644 19 | --- a/rootdir/ueventd.rc 20 | +++ b/rootdir/ueventd.rc 21 | @@ -52,7 +52,7 @@ subsystem dma_heap 22 | 23 | # these should not be world writable 24 | /dev/uhid 0660 uhid uhid 25 | -/dev/uinput 0660 uhid uhid 26 | +/dev/uinput 0666 uhid uhid 27 | /dev/rtc0 0640 system system 28 | /dev/tty0 0660 root system 29 | /dev/graphics/* 0660 root graphics 30 | -- 31 | 2.25.1 32 | 33 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_hardware_interfaces/01-Add-a-vendor800-command-to-be-able-to-call-vendor-sp.patch: -------------------------------------------------------------------------------- 1 | From 89c4c8895587c028dc43eba3be9c4fb0a435d99c Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Sun, 19 Dec 2021 17:03:15 -0500 4 | Subject: [PATCH] Add a vendor800 command, to be able to call vendor-specific 5 | hwc functions 6 | 7 | Change-Id: Icbef1e9e3a331ae3bd5a05687d545851d94d88a8 8 | --- 9 | .../composer-command-buffer/2.1/ComposerCommandBuffer.h | 6 ++++++ 10 | 1 file changed, 6 insertions(+) 11 | 12 | diff --git a/graphics/composer/2.1/utils/command-buffer/include/composer-command-buffer/2.1/ComposerCommandBuffer.h b/graphics/composer/2.1/utils/command-buffer/include/composer-command-buffer/2.1/ComposerCommandBuffer.h 13 | index 499d3b96e..489578468 100644 14 | --- a/graphics/composer/2.1/utils/command-buffer/include/composer-command-buffer/2.1/ComposerCommandBuffer.h 15 | +++ b/graphics/composer/2.1/utils/command-buffer/include/composer-command-buffer/2.1/ComposerCommandBuffer.h 16 | @@ -402,6 +402,12 @@ class CommandWriterBase { 17 | endCommand(); 18 | } 19 | 20 | + void vendor800_1(uint32_t val) { 21 | + beginCommand(0x800 << 16, 1); 22 | + write(val); 23 | + endCommand(); 24 | + } 25 | + 26 | protected: 27 | template 28 | void beginCommand(T command, uint16_t length) { 29 | -- 30 | 2.25.1 31 | 32 | -------------------------------------------------------------------------------- /patches/personal/platform_frameworks_av/02-Free-buffers-on-observer-died.patch: -------------------------------------------------------------------------------- 1 | From bf3f57122ef8a00e737ec7feaf1347872cf018b2 Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Fri, 14 Oct 2022 12:28:28 +0000 4 | Subject: [PATCH] libstagefright: Free buffers on observer died 5 | 6 | If observer died while allocating buffers, component remains 7 | in loaded state. In cleanup, it checks for idle state to 8 | free the allocated buffers which leads to memory leak. 9 | Hence explicitly calling free buffers to avoid memory leak. 10 | --- 11 | media/libstagefright/omx/OMXNodeInstance.cpp | 8 ++++++++ 12 | 1 file changed, 8 insertions(+) 13 | 14 | diff --git a/media/libstagefright/omx/OMXNodeInstance.cpp b/media/libstagefright/omx/OMXNodeInstance.cpp 15 | index bebd5161d7..a0ce6d257f 100644 16 | --- a/media/libstagefright/omx/OMXNodeInstance.cpp 17 | +++ b/media/libstagefright/omx/OMXNodeInstance.cpp 18 | @@ -579,8 +579,16 @@ status_t OMXNodeInstance::freeNode() { 19 | LOG_ALWAYS_FATAL("unknown state %s(%#x).", asString(state), state); 20 | break; 21 | } 22 | + 23 | + if (mActiveBuffers.size() > 0) { 24 | + freeActiveBuffers(); 25 | + } 26 | 27 | Mutex::Autolock _l(mLock); 28 | + 29 | + if (mActiveBuffers.size() > 0) { 30 | + freeActiveBuffers(); 31 | + } 32 | 33 | status_t err = mOwner->freeNode(this); 34 | 35 | -- 36 | 2.34.1 37 | 38 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_core/18-Disable-quotas-on-legacy-devices-with-encryption-dis.patch: -------------------------------------------------------------------------------- 1 | From cf60793721b643dc990e010a5ed356f0b2f4685c Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Tue, 6 Jun 2023 16:17:11 +0100 4 | Subject: [PATCH 18/18] Disable quotas on legacy devices with encryption 5 | disabled 6 | 7 | Source: https://t.me/phhtreblebuilders/20521 and https://t.me/phhtreblebuilders/20546 8 | --- 9 | fs_mgr/fs_mgr.cpp | 7 +++++++ 10 | 1 file changed, 7 insertions(+) 11 | 12 | diff --git a/fs_mgr/fs_mgr.cpp b/fs_mgr/fs_mgr.cpp 13 | index 1acaea3cf..c2ccd5cd5 100644 14 | --- a/fs_mgr/fs_mgr.cpp 15 | +++ b/fs_mgr/fs_mgr.cpp 16 | @@ -370,6 +370,13 @@ static void tune_quota(const std::string& blk_device, const FstabEntry& entry, 17 | return; 18 | } 19 | 20 | + // There is no relation between quotas and encryption disabled, it's just that encryption 21 | + // being disabled shows that the device is pretty old, so quotas might be broken on it 22 | + if (!entry.fs_mgr_flags.file_encryption) { 23 | + LINFO << "Disabling quotas on legacy devices with encryption disabled"; 24 | + want_quota = false; 25 | + } 26 | + 27 | if (!tune2fs_available()) { 28 | LERROR << "Unable to " << (want_quota ? "enable" : "disable") << " quotas on " << blk_device 29 | << " because " TUNE2FS_BIN " is missing"; 30 | -- 31 | 2.25.1 32 | 33 | -------------------------------------------------------------------------------- /patches/pre/platform_device_phh_treble/05-Modify-SYSBTA-disabled-behaviour.patch: -------------------------------------------------------------------------------- 1 | From 7fdbfe272312df29db1bf00b5e7251c19537431f Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Wed, 3 May 2023 01:21:40 +0000 4 | Subject: [PATCH] Modify SYSBTA behaviour while is disabled 5 | 6 | There's a slightly chance than isn't work for some device, 7 | let's keep A2DP props as declared by default while is disabled 8 | --- 9 | phh-prop-handler.sh | 6 +++--- 10 | 1 file changed, 3 insertions(+), 3 deletions(-) 11 | 12 | diff --git a/phh-prop-handler.sh b/phh-prop-handler.sh 13 | index 24056e4..78c0e3b 100644 14 | --- a/phh-prop-handler.sh 15 | +++ b/phh-prop-handler.sh 16 | @@ -221,9 +221,9 @@ if [ "$1" == "persist.bluetooth.system_audio_hal.enabled" ]; then 17 | setprop persist.bluetooth.a2dp_offload.disabled true 18 | resetprop_phh ro.bluetooth.a2dp_offload.supported false 19 | else 20 | - resetprop_phh --delete persist.bluetooth.bluetooth_audio_hal.disabled 21 | - resetprop_phh --delete persist.bluetooth.a2dp_offload.disabled 22 | - resetprop_phh --delete ro.bluetooth.a2dp_offload.supported 23 | + resetprop_phh --delete persist.bluetooth.bluetooth_audio_hal.disabled 24 | + resetprop_phh persist.bluetooth.a2dp_offload.disabled 25 | + resetprop_phh ro.bluetooth.a2dp_offload.supported 26 | fi 27 | restartAudio 28 | exit 29 | -- 30 | 2.34.1 31 | 32 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_base/27-Allow-disabling-of-fingerprint-cleanups-needed-on-so.patch: -------------------------------------------------------------------------------- 1 | From d59d10622210c4567ccd070980fac5e8c83ee010 Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Sat, 1 Oct 2022 01:28:20 +0000 4 | Subject: [PATCH] Allow disabling of fingerprint cleanup 5 | 6 | Needed on some Realme devices that cant enumerate 7 | --- 8 | .../biometrics/sensors/fingerprint/hidl/Fingerprint21.java | 2 ++ 9 | 1 file changed, 2 insertions(+) 10 | 11 | diff --git a/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/Fingerprint21.java b/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/Fingerprint21.java 12 | index 1f8e1791c030..cb42c5e1783e 100644 13 | --- a/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/Fingerprint21.java 14 | +++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/Fingerprint21.java 15 | @@ -729,6 +729,8 @@ public class Fingerprint21 implements IHwBinder.DeathRecipient, ServiceProvider 16 | 17 | private void scheduleInternalCleanup(int userId, 18 | @Nullable ClientMonitorCallback callback) { 19 | + final boolean mNocleanup = android.os.SystemProperties.getBoolean("persist.sys.phh.fingerprint.nocleanup", false); 20 | + if(mNocleanup) return; 21 | mHandler.post(() -> { 22 | scheduleUpdateActiveUserWithoutHandler(userId); 23 | 24 | -- 25 | 2.34.1 26 | 27 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_native/08-MIUI13-devices-hide-their-vibrator-HAL-behind-non-de.patch: -------------------------------------------------------------------------------- 1 | From 59d3ecc59bf95963dfd88f842de66d9f477f2fa2 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Fri, 25 Mar 2022 05:37:56 -0400 4 | Subject: [PATCH 16/16] MIUI13 devices hide their vibrator HAL behind 5 | non-default name: "vibratorfeature" 6 | 7 | --- 8 | services/vibratorservice/VibratorHalController.cpp | 6 ++++++ 9 | 1 file changed, 6 insertions(+) 10 | 11 | diff --git a/services/vibratorservice/VibratorHalController.cpp b/services/vibratorservice/VibratorHalController.cpp 12 | index c1795f5c32..345016efd6 100644 13 | --- a/services/vibratorservice/VibratorHalController.cpp 14 | +++ b/services/vibratorservice/VibratorHalController.cpp 15 | @@ -59,6 +59,12 @@ std::shared_ptr connectHal(std::shared_ptr schedu 16 | return std::make_shared(std::move(scheduler), aidlHal); 17 | } 18 | 19 | + aidlHal = waitForVintfService(String16("vibratorfeature")); 20 | + if (aidlHal) { 21 | + ALOGV("Successfully connected to Xiaomi Vibrator HAL AIDL service."); 22 | + return std::make_shared(std::move(scheduler), aidlHal); 23 | + } 24 | + 25 | sp halV1_0 = V1_0::IVibrator::getService(); 26 | if (halV1_0 == nullptr) { 27 | ALOGV("Vibrator HAL service not available."); 28 | -- 29 | 2.25.1 30 | 31 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_native/04-Remove-Samsung-system-permission-on-sensors.patch: -------------------------------------------------------------------------------- 1 | From e8e51ed3ce4e42032f3f3a21590ed9b2f9f9f89a Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Wed, 31 Mar 2021 23:36:03 +0200 4 | Subject: [PATCH 06/16] Remove Samsung system permission on sensors 5 | 6 | --- 7 | libs/sensor/Sensor.cpp | 1 + 8 | libs/sensor/include/sensor/Sensor.h | 1 + 9 | 2 files changed, 2 insertions(+) 10 | 11 | diff --git a/libs/sensor/Sensor.cpp b/libs/sensor/Sensor.cpp 12 | index 0a49008584..012b87c6ed 100644 13 | --- a/libs/sensor/Sensor.cpp 14 | +++ b/libs/sensor/Sensor.cpp 15 | @@ -409,6 +409,7 @@ const String8& Sensor::getStringType() const { 16 | } 17 | 18 | const String8& Sensor::getRequiredPermission() const { 19 | + if (mRequiredPermission == "com.samsung.permission.SSENSOR") return mFakeRequiredPermission; 20 | return mRequiredPermission; 21 | } 22 | 23 | diff --git a/libs/sensor/include/sensor/Sensor.h b/libs/sensor/include/sensor/Sensor.h 24 | index 374b68fab5..ffc715fc07 100644 25 | --- a/libs/sensor/include/sensor/Sensor.h 26 | +++ b/libs/sensor/include/sensor/Sensor.h 27 | @@ -128,6 +128,7 @@ private: 28 | uint32_t mFifoMaxEventCount; 29 | String8 mStringType; 30 | String8 mRequiredPermission; 31 | + String8 mFakeRequiredPermission; 32 | bool mRequiredPermissionRuntime = false; 33 | int32_t mRequiredAppOp; 34 | int32_t mMaxDelay; 35 | -- 36 | 2.25.1 37 | 38 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_external_selinux/10-Allow-sys-vm-watermark_scale_factor-conflict.patch: -------------------------------------------------------------------------------- 1 | From 24b3713d636c6869b35a511a00495642c9b23ccd Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Thu, 20 Jul 2023 14:21:21 -0400 4 | Subject: [PATCH] Allow /sys/vm/watermark_scale_factor conflict -- seen on 5 | Freebox Player Pop 6 | 7 | --- 8 | libsepol/cil/src/cil_post.c | 9 +++++++++ 9 | 1 file changed, 9 insertions(+) 10 | 11 | diff --git a/libsepol/cil/src/cil_post.c b/libsepol/cil/src/cil_post.c 12 | index 97bf54f88..4cf1f2d39 100644 13 | --- a/libsepol/cil/src/cil_post.c 14 | +++ b/libsepol/cil/src/cil_post.c 15 | @@ -502,6 +502,15 @@ int cil_post_genfscon_context_compare(const void *a, const void *b) 16 | */ 17 | if(strcmp(a_genfscon->path_str, "/devices/virtual/block/") == 0) 18 | bypass = 1; 19 | + /* 20 | + * This conflict has been seen on Freebox Player Pop 21 | + * - AOSP T says (genfscon proc "/sys/vm/watermark_scale_factor" (u object_r proc_watermark_scale_factor ((s0) (s0)))) 22 | + * - stock rom says proc_vm_writable 23 | + * 24 | + * Stock ROM uses it only in recovery so it's safe to ignore 25 | + */ 26 | + if(strcmp(a_genfscon->path_str, "/sys/vm/watermark_scale_factor") == 0) 27 | + bypass = 1; 28 | if(strcmp(a_genfscon->fs_str, "exfat") == 0 || strcmp(a_genfscon->fs_str, "esdfs") == 0) { 29 | if(strcmp(a_genfscon->path_str, "/") == 0) 30 | bypass = 1; 31 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_bionic/01-Disable-vndklite-handling.patch: -------------------------------------------------------------------------------- 1 | From 1f5d6c985598d537566407e21cab13e6540f9b69 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Wed, 27 Oct 2021 14:39:29 -0400 4 | Subject: [PATCH 1/2] Disable vndklite handling 5 | 6 | Change-Id: Ic4474cf80fc4b45a9a2760dd51e2ca29c4d961e2 7 | --- 8 | linker/linker.cpp | 5 ----- 9 | 1 file changed, 5 deletions(-) 10 | 11 | diff --git a/linker/linker.cpp b/linker/linker.cpp 12 | index 3488f5cc7..c32ea8484 100644 13 | --- a/linker/linker.cpp 14 | +++ b/linker/linker.cpp 15 | @@ -93,7 +93,6 @@ static uint64_t g_module_unload_counter = 0; 16 | static const char* const kLdConfigArchFilePath = "/system/etc/ld.config." ABI_STRING ".txt"; 17 | 18 | static const char* const kLdConfigFilePath = "/system/etc/ld.config.txt"; 19 | -static const char* const kLdConfigVndkLiteFilePath = "/system/etc/ld.config.vndk_lite.txt"; 20 | 21 | static const char* const kLdGeneratedConfigFilePath = "/linkerconfig/ld.config.txt"; 22 | 23 | @@ -3368,10 +3367,6 @@ static std::string get_ld_config_file_apex_path(const char* executable_path) { 24 | } 25 | 26 | static std::string get_ld_config_file_vndk_path() { 27 | - if (android::base::GetBoolProperty("ro.vndk.lite", false)) { 28 | - return kLdConfigVndkLiteFilePath; 29 | - } 30 | - 31 | std::string ld_config_file_vndk = kLdConfigFilePath; 32 | size_t insert_pos = ld_config_file_vndk.find_last_of('.'); 33 | if (insert_pos == std::string::npos) { 34 | -- 35 | 2.25.1 36 | 37 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_extras/01-libfscrypt-Bail-out-if-we-can-t-open-directory.patch: -------------------------------------------------------------------------------- 1 | From de8cc0d6796c3bac1b2665e1ca5f5aa2ef404ade Mon Sep 17 00:00:00 2001 2 | From: Luca Stefani 3 | Date: Wed, 9 Sep 2020 12:43:54 +0200 4 | Subject: [PATCH] libfscrypt: Bail out if we can't open directory 5 | 6 | * On QCOM Q vendor init.qcom.rc has a 'mkdir' entry 7 | for /data/system 8 | * While the encryption policy matches and is applied properly in 9 | permissive, vendor_init doesn't have enough perms to open 10 | and run ioctl over system_data_file to check its policy 11 | * Instead of opening the possiblity to vendors, just 12 | bail out if we fail to open the directory 13 | 14 | Test: m, boot r-gsi on Zenfone 6 15 | Change-Id: I5ea37019221cd0887b8a5d7454f5a42ac01335c7 16 | --- 17 | libfscrypt/fscrypt.cpp | 2 +- 18 | 1 file changed, 1 insertion(+), 1 deletion(-) 19 | 20 | diff --git a/libfscrypt/fscrypt.cpp b/libfscrypt/fscrypt.cpp 21 | index f6e97f11..bbf40c3c 100644 22 | --- a/libfscrypt/fscrypt.cpp 23 | +++ b/libfscrypt/fscrypt.cpp 24 | @@ -326,7 +326,7 @@ bool EnsurePolicy(const EncryptionPolicy& policy, const std::string& directory) 25 | android::base::unique_fd fd(open(directory.c_str(), O_DIRECTORY | O_NOFOLLOW | O_CLOEXEC)); 26 | if (fd == -1) { 27 | PLOG(ERROR) << "Failed to open directory " << directory; 28 | - return false; 29 | + return true; 30 | } 31 | 32 | bool already_encrypted = fscrypt_is_encrypted(fd); 33 | -- 34 | 2.25.1 35 | 36 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_core/11-Allow-encryptable-fstab-flag-at-any-case.patch: -------------------------------------------------------------------------------- 1 | From 771612a08b792dd12cdec0d7faba0b2c3371bc8a Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Fri, 7 Oct 2022 03:32:01 +0000 4 | Subject: [PATCH] Allow encryptable fstab flag at any case 5 | 6 | ChonDoe: Simple re-do from Ponces patch due fails on bash (? 7 | 8 | With FDE drop "encryptable" fstab flags isn't allowed anymore 9 | for any except adoptable storage. Unencrypted device with old DFE 10 | will leads to bootloop due this, lets allow it again at any case. 11 | 12 | --- 13 | fs_mgr/fs_mgr_fstab.cpp | 5 ++--- 14 | 1 file changed, 2 insertions(+), 3 deletions(-) 15 | 16 | diff --git a/fs_mgr/fs_mgr_fstab.cpp b/fs_mgr/fs_mgr_fstab.cpp 17 | index 2933b61f8..cf5f0dda8 100644 18 | --- a/fs_mgr/fs_mgr_fstab.cpp 19 | +++ b/fs_mgr/fs_mgr_fstab.cpp 20 | @@ -319,9 +319,8 @@ bool ParseFsMgrFlags(const std::string& flags, FstabEntry* entry) { 21 | // reservation of a crypto footer) and thus never got removed. 22 | if (entry->fs_mgr_flags.crypt && !entry->fs_mgr_flags.vold_managed && 23 | access("/system/bin/recovery", F_OK) != 0) { 24 | - LERROR << "FDE is no longer supported; 'encryptable' can only be used for adoptable " 25 | - "storage"; 26 | - return false; 27 | + LWARNING << "IGNORED = FDE is no longer supported; 'encryptable' can only be used for adoptable storage"; 28 | + return true; 29 | } 30 | return true; 31 | } 32 | -- 33 | 2.34.1 34 | 35 | -------------------------------------------------------------------------------- /patches/personal/platform_frameworks_base/01-Check-null-FingerprintManager-first-in-onStartedWaki.patch: -------------------------------------------------------------------------------- 1 | From 840ab7152c1e2ba8a9377d1f3f8ce05fca3fcfbc Mon Sep 17 00:00:00 2001 2 | From: Andy CrossGate Yan 3 | Date: Fri, 30 Jun 2023 04:47:34 +0000 4 | Subject: [PATCH] Check null FingerprintManager first in onStartedWakingUp 5 | 6 | Fixes crashing when unlocking from AOD 7 | --- 8 | .../android/systemui/statusbar/phone/CentralSurfacesImpl.java | 1 + 9 | 1 file changed, 1 insertion(+) 10 | 11 | diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java 12 | index c274849fe6ec..002b7a1e79de 100644 13 | --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java 14 | +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java 15 | @@ -3685,6 +3685,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces, 16 | && mStatusBarStateController.getDozeAmount() == 1f 17 | && mWakefulnessLifecycle.getLastWakeReason() 18 | == PowerManager.WAKE_REASON_POWER_BUTTON 19 | + && mFingerprintManager.get() != null 20 | && fpm != null 21 | && fpm.isPowerbuttonFps() 22 | && fpm.hasEnrolledFingerprints() 23 | -- 24 | 2.34.1 25 | 26 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_core/04-Don-t-abandon-creating-property-tree-if-there-is-a-c.patch: -------------------------------------------------------------------------------- 1 | From 3b03a0580bf2ff4efd2f3f51ea54001e332bb9b6 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Sun, 18 Oct 2020 18:14:47 +0200 4 | Subject: [PATCH 2/6] Don't abandon creating property tree if there is a 5 | conflict, and hope for the best 6 | 7 | Change-Id: I194c815fdd58bfb84aaf7db02b8f0d00b4db21e8 8 | --- 9 | .../libpropertyinfoserializer/property_info_serializer.cpp | 3 ++- 10 | 1 file changed, 2 insertions(+), 1 deletion(-) 11 | 12 | diff --git a/property_service/libpropertyinfoserializer/property_info_serializer.cpp b/property_service/libpropertyinfoserializer/property_info_serializer.cpp 13 | index 803657ab8..ecdd0be20 100644 14 | --- a/property_service/libpropertyinfoserializer/property_info_serializer.cpp 15 | +++ b/property_service/libpropertyinfoserializer/property_info_serializer.cpp 16 | @@ -19,6 +19,7 @@ 17 | #include "property_info_parser/property_info_parser.h" 18 | 19 | #include 20 | +#include 21 | 22 | #include "trie_builder.h" 23 | #include "trie_serializer.h" 24 | @@ -34,7 +35,7 @@ bool BuildTrie(const std::vector& property_info, 25 | 26 | for (const auto& [name, context, type, is_exact] : property_info) { 27 | if (!trie_builder.AddToTrie(name, context, type, is_exact, error)) { 28 | - return false; 29 | + std::cerr << "Failed adding " << name << " to property trie... let's hope for the best" << std::endl; 30 | } 31 | } 32 | 33 | -- 34 | 2.25.1 35 | 36 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_core/12-Fix-support-for-devices-without-cgroupv2-support.patch: -------------------------------------------------------------------------------- 1 | From a3617738ea4aed8fef5df2fe9af7db9473da342e Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Wed, 26 Oct 2022 17:59:11 -0400 4 | Subject: [PATCH 13/13] Fix support for devices without cgroupv2 support 5 | 6 | This is technically a revert of 1bd1746447. 7 | The warning inside the commit doesn't really apply to us, because the 8 | devices without cgroupv2 simply won't freeze processes at all 9 | (which is in itself an issue, but a different one) 10 | --- 11 | init/service.cpp | 4 ++++ 12 | 1 file changed, 4 insertions(+) 13 | 14 | diff --git a/init/service.cpp b/init/service.cpp 15 | index bd704cf8e..188b042d9 100644 16 | --- a/init/service.cpp 17 | +++ b/init/service.cpp 18 | @@ -662,11 +662,15 @@ Result Service::Start() { 19 | limit_percent_ != -1 || !limit_property_.empty(); 20 | errno = -createProcessGroup(proc_attr_.uid, pid_, use_memcg); 21 | if (errno != 0) { 22 | + PLOG(ERROR) << "createProcessGroup(" << proc_attr_.uid << ", " << pid_ << ") failed for service '" << name_ << "'"; 23 | + 24 | +#if 0 25 | if (char byte = 0; write((*pipefd)[1], &byte, 1) < 0) { 26 | return ErrnoError() << "sending notification failed"; 27 | } 28 | return Error() << "createProcessGroup(" << proc_attr_.uid << ", " << pid_ 29 | << ") failed for service '" << name_ << "'"; 30 | +#endif 31 | } 32 | 33 | if (use_memcg) { 34 | -- 35 | 2.25.1 36 | 37 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_opt_telephony/03-Fix-baseband-being-too-long-to-fit-into-a-91-chars-p.patch: -------------------------------------------------------------------------------- 1 | From 0e7e075e39f7569bc955a30ed6eb94af06a13ebd Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Mon, 6 Dec 2021 16:28:22 -0500 4 | Subject: [PATCH 3/5] Fix baseband being too long to fit into a 91 chars 5 | property, preventing telephony subsystem from starting 6 | 7 | Change-Id: I1762e4a8cc137626be89f350229d6be162bdaf57 8 | --- 9 | src/java/com/android/internal/telephony/GsmCdmaPhone.java | 2 +- 10 | 1 file changed, 1 insertion(+), 1 deletion(-) 11 | 12 | diff --git a/src/java/com/android/internal/telephony/GsmCdmaPhone.java b/src/java/com/android/internal/telephony/GsmCdmaPhone.java 13 | index 1486e0e8c0..e57a16228b 100644 14 | --- a/src/java/com/android/internal/telephony/GsmCdmaPhone.java 15 | +++ b/src/java/com/android/internal/telephony/GsmCdmaPhone.java 16 | @@ -3040,7 +3040,7 @@ public class GsmCdmaPhone extends Phone { 17 | String version = (String)ar.result; 18 | if (version != null) { 19 | int length = version.length(); 20 | - final int MAX_VERSION_LEN = SystemProperties.PROP_VALUE_MAX/2; 21 | + final int MAX_VERSION_LEN = SystemProperties.PROP_VALUE_MAX/2 - 2; 22 | TelephonyManager.from(mContext).setBasebandVersionForPhone(getPhoneId(), 23 | length <= MAX_VERSION_LEN ? version 24 | : version.substring(length - MAX_VERSION_LEN, length)); 25 | -- 26 | 2.25.1 27 | 28 | -------------------------------------------------------------------------------- /patches/pre/platform_device_phh_treble/02-Add-Bluetooth-BQR-props-and-Nuke-SAP-Profile.patch: -------------------------------------------------------------------------------- 1 | From 04a0ae146c09fe0e9da2d959df253a03ecb0edf5 Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Mon, 19 Jun 2023 22:26:48 +0000 4 | Subject: [PATCH] Add Bluetooth BQR props and Nuke SAP Profile 5 | 6 | --- 7 | system.prop | 10 +++++++++- 8 | 1 file changed, 9 insertions(+), 1 deletion(-) 9 | 10 | diff --git a/system.prop b/system.prop 11 | index fa2a5c9..bfb6145 100644 12 | --- a/system.prop 13 | +++ b/system.prop 14 | @@ -30,6 +30,7 @@ bluetooth.device.class_of_device=90,2,12 15 | 16 | # Enable system-side generic bluetooth audio HAL 17 | persist.bluetooth.system_audio_hal.enabled=1 18 | + 19 | # Set commonly-supported Bluetooth profiles to enabled 20 | # TODO: Enable BLE Audio profiles on newer vendors 21 | bluetooth.profile.asha.central.enabled?=true 22 | @@ -45,7 +46,14 @@ bluetooth.profile.opp.enabled?=true 23 | bluetooth.profile.pan.nap.enabled?=true 24 | bluetooth.profile.pan.panu.enabled?=true 25 | bluetooth.profile.pbap.server.enabled?=true 26 | -bluetooth.profile.sap.server.enabled?=true 27 | +#bluetooth.profile.sap.server.enabled?=true 28 | + 29 | +# System props to enable Bluetooth Quality Report (BQR) feature 30 | +# BQR event mask configuration 31 | +persist.bluetooth.bqr.event_mask=14 32 | + 33 | +# BQR minimum report interval configuration 34 | +persist.bluetooth.bqr.min_interval_ms=500 35 | 36 | # Samsung vendors default to a Samsung-specific gadget for MTP. Set this to use AOSP's functionfs MTP 37 | vendor.usb.use_ffs_mtp=1 38 | -- 39 | 2.34.1 40 | 41 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_base/25-Revert-Switch-long-press-power-behavior-in-AOSP.patch: -------------------------------------------------------------------------------- 1 | From 4c797b922204ab8d933a217a1ab8df139c57311f Mon Sep 17 00:00:00 2001 2 | From: Andy CrossGate Yan 3 | Date: Sat, 4 Sep 2021 08:26:30 +0000 4 | Subject: [PATCH 24/35] Revert "Switch long-press power behavior in AOSP." 5 | 6 | This reverts commit 803c77a0a24624111944832098c6f65158051dc4. 7 | --- 8 | core/res/res/values/config.xml | 4 ++-- 9 | 1 file changed, 2 insertions(+), 2 deletions(-) 10 | 11 | diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml 12 | index 21c6f087a2d4..beddd6767eea 100644 13 | --- a/core/res/res/values/config.xml 14 | +++ b/core/res/res/values/config.xml 15 | @@ -977,7 +977,7 @@ 16 | 4 - Go to voice assist 17 | 5 - Go to assistant (Settings.Secure.ASSISTANT) 18 | --> 19 | - 5 20 | + 1 21 | 22 | 23 | 500 24 | @@ -1009,7 +1009,7 @@ 25 | 1 - Mute toggle 26 | 2 - Global actions menu 27 | --> 28 | - 2 29 | + 1 30 | 31 | 16 | 17 | 18 | - false 19 | + true 20 | 21 | 22 | 23 | @@ -46,15 +46,11 @@ 24 | - "30" 25 | - "60" 26 | - "120" 27 | - Example: 28 | + Example: --> 29 | 30 | 0 sd|hd|fhd 60|120 31 | 1 sd|hd|fhd 60 32 | 33 | - --> 34 | - 35 | - 36 | - 37 | 38 | 38 | - 39 | 40 | diff --git a/sysconfig-me.phh.treble.app.xml b/sysconfig-me.phh.treble.app.xml 41 | new file mode 100644 42 | index 0000000..ea10cc1 43 | --- /dev/null 44 | +++ b/sysconfig-me.phh.treble.app.xml 45 | @@ -0,0 +1,8 @@ 46 | + 47 | + 48 | + 49 | + 50 | + 51 | + 52 | + 53 | + 54 | -- 55 | 2.34.1 56 | 57 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_av/06-Try-again-with-trimmed-audio-port-name-i.patch: -------------------------------------------------------------------------------- 1 | From f1a716f3dec614a6fb7882216574d05e36005a03 Mon Sep 17 00:00:00 2001 2 | From: Peter Cai 3 | Date: Thu, 23 Jan 2020 11:13:43 +0800 4 | Subject: [PATCH 03/23] audiopolicy: try again with trimmed audio port name if 5 | not found 6 | 7 | * In Spreadtrum BSP, some audio routes may contain ports with extra 8 | spaces at the beginning and the end, causing audiopolicy to refuse to 9 | load and leading to broken audio. 10 | 11 | * Fix this by retrying with trimmed port name when not found. Do not 12 | use trimmed name all the time because a white space is a valid 13 | character in port name, and we cannot be sure nobody is using it for 14 | legitimite purposes. 15 | 16 | Change-Id: I993708b28e8404bc8c483d71a850ac69382231bd 17 | --- 18 | .../common/managerdefinitions/src/Serializer.cpp | 14 ++++++++++++++ 19 | 1 file changed, 14 insertions(+) 20 | 21 | diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp 22 | index 9a857ff091..d919951007 100644 23 | --- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp 24 | +++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp 25 | @@ -579,6 +579,17 @@ std::variant PolicySerializer::deserialize< 26 | return deviceDesc; 27 | } 28 | 29 | +char* trim(char * s) { 30 | + int l = strlen(s); 31 | + 32 | + if (l > 0) { 33 | + while (isspace(s[l - 1])) --l; 34 | + while (*s && isspace(*s)) ++s, --l; 35 | + } 36 | + 37 | + return strndup(s, l); 38 | +} 39 | + 40 | template<> 41 | std::variant PolicySerializer::deserialize( 42 | const xmlNode *cur, RouteTraits::PtrSerializingCtx ctx) 43 | @@ -626,6 +637,9 @@ std::variant PolicySerializer::deserialize source = ctx->findPortByTagName(devTag); 47 | + if (source == NULL) { 48 | + source = ctx->findPortByTagName(trim(devTag)); 49 | + } 50 | if (source == NULL && !mIgnoreVendorExtensions) { 51 | ALOGE("%s: no source found with name=%s", __func__, devTag); 52 | return BAD_VALUE; 53 | -- 54 | 2.25.1 55 | 56 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_core/15-Allow-apex-on-5.0-kernels.patch: -------------------------------------------------------------------------------- 1 | From 63121c6c5f3e4fc168a7cff852d4be14e689b5d6 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Fri, 28 Apr 2023 12:29:05 -0400 4 | Subject: [PATCH 16/16] Allow apex on > 5.0 kernels. This is needed because on 5 | Pixels, camera HAL are exclusively in vendor apex 6 | 7 | --- 8 | init/property_service.cpp | 15 ++++++++++++++- 9 | 1 file changed, 14 insertions(+), 1 deletion(-) 10 | 11 | diff --git a/init/property_service.cpp b/init/property_service.cpp 12 | index 080ee9c71..3dc81169e 100644 13 | --- a/init/property_service.cpp 14 | +++ b/init/property_service.cpp 15 | @@ -61,6 +61,7 @@ 16 | #include 17 | #include 18 | #include 19 | +#include 20 | 21 | #include "debug_ramdisk.h" 22 | #include "epoll.h" 23 | @@ -632,6 +633,16 @@ uint32_t InitPropertySet(const std::string& name, const std::string& value) { 24 | static bool load_properties_from_file(const char*, const char*, 25 | std::map*); 26 | 27 | +static bool kernel_supports_capex() { 28 | + //Put a threshold at >= 5.0 29 | + struct utsname buf; 30 | + uname(&buf); 31 | + const char *where = buf.release; 32 | + int a = atoi(where); 33 | + if(a <= 4) return false; 34 | + return true; 35 | +} 36 | + 37 | /* 38 | * Filter is used to decide which properties to load: NULL loads all keys, 39 | * "ro.foo.*" is a prefix match, and "ro.foo.bar" is an exact match. 40 | @@ -726,7 +737,9 @@ static void LoadProperties(char* data, const char* filter, const char* filename, 41 | } else if (it->second != value) { 42 | LOG(WARNING) << "Overriding previous property '" << key << "':'" << it->second 43 | << "' with new value '" << value << "'"; 44 | - if(strcmp("ro.apex.updatable", key) == 0 || strstr(key, "adb") || strstr(key, "secure")) { 45 | + if(strcmp("ro.apex.updatable", key) == 0 && !kernel_supports_capex()) { 46 | + LOG(WARNING) << "... Ignored apex by kernel version"; 47 | + } else if(strstr(key, "adb") || strstr(key, "secure")) { 48 | LOG(WARNING) << "... Ignored"; 49 | } else { 50 | it->second = value; 51 | -- 52 | 2.25.1 53 | 54 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_base/07-Implement-a-persistent-property-to-override-the-defa.patch: -------------------------------------------------------------------------------- 1 | From f49408a064193ffa320fe81f53984264138094db Mon Sep 17 00:00:00 2001 2 | From: Peter Cai 3 | Date: Wed, 1 Jun 2022 16:56:20 -0400 4 | Subject: [PATCH 07/37] Implement a persistent property to override the default 5 | primary camera (0) 6 | 7 | Change-Id: I49b45d00bf71d7932591b3516d49a680e1b6568b 8 | --- 9 | core/java/android/hardware/Camera.java | 5 ++++++ 10 | core/java/android/hardware/camera2/CameraManager.java | 9 +++++++++ 11 | 2 files changed, 14 insertions(+) 12 | 13 | diff --git a/core/java/android/hardware/Camera.java b/core/java/android/hardware/Camera.java 14 | index b3bb1e853c26..83c68889f874 100644 15 | --- a/core/java/android/hardware/Camera.java 16 | +++ b/core/java/android/hardware/Camera.java 17 | @@ -469,6 +469,11 @@ public class Camera { 18 | * @see #open(int) 19 | */ 20 | public static Camera open() { 21 | + int altPrimaryCamera = SystemProperties.getInt("persist.sys.alt_primary_camera", -1); 22 | + if (altPrimaryCamera > 0) { 23 | + return new Camera(altPrimaryCamera); 24 | + } 25 | + 26 | int numberOfCameras = getNumberOfCameras(); 27 | CameraInfo cameraInfo = new CameraInfo(); 28 | for (int i = 0; i < numberOfCameras; i++) { 29 | diff --git a/core/java/android/hardware/camera2/CameraManager.java b/core/java/android/hardware/camera2/CameraManager.java 30 | index fdde647d8774..dcbb1a5e0484 100644 31 | --- a/core/java/android/hardware/camera2/CameraManager.java 32 | +++ b/core/java/android/hardware/camera2/CameraManager.java 33 | @@ -1755,6 +1755,15 @@ public final class CameraManager { 34 | } 35 | }}); 36 | 37 | + // HAXX: Allow overriding default primary camera (assumed to be camera 0) via property 38 | + // Should match with libcameraservice/common/CameraProviderManager.cpp 39 | + int altPrimaryCamera = SystemProperties.getInt("persist.sys.alt_primary_camera", -1); 40 | + if (altPrimaryCamera > 0 && altPrimaryCamera < cameraIds.length) { 41 | + String origPrimary = cameraIds[0]; 42 | + cameraIds[0] = cameraIds[altPrimaryCamera]; 43 | + cameraIds[altPrimaryCamera] = origPrimary; 44 | + } 45 | + 46 | } 47 | 48 | public static boolean cameraStatusesContains(CameraStatus[] cameraStatuses, String id) { 49 | -- 50 | 2.25.1 51 | 52 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_base/41-Detect-Moto-dynamic-hardware-feature.patch: -------------------------------------------------------------------------------- 1 | From 0f33084286e99cb289b30a41211a69acbdf12bac Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Wed, 5 Jul 2023 10:50:36 -0400 4 | Subject: [PATCH 41/41] Detect Moto dynamic hardware feature 5 | 6 | Moto added a custom node in sysconfig XMLs: 7 | 8 | This node reads a property and enables a feature based on it. 9 | 10 | Take those into account to enable NFC on Moto devices which have 11 | NFC-less variants 12 | --- 13 | .../java/com/android/server/SystemConfig.java | 19 +++++++++++++++++++ 14 | 1 file changed, 19 insertions(+) 15 | 16 | diff --git a/core/java/com/android/server/SystemConfig.java b/core/java/com/android/server/SystemConfig.java 17 | index 00b01051adae..ffcc75e63d66 100644 18 | --- a/core/java/com/android/server/SystemConfig.java 19 | +++ b/core/java/com/android/server/SystemConfig.java 20 | @@ -979,6 +979,25 @@ public class SystemConfig { 21 | } 22 | XmlUtils.skipCurrentTag(parser); 23 | } break; 24 | + case "unavailable-feature-conditional": { 25 | + if (allowFeatures) { 26 | + String fname = parser.getAttributeValue(null, "name"); 27 | + String prop = parser.getAttributeValue(null, "prop"); 28 | + if (fname == null || prop == null) { 29 | + Slog.w(TAG, "<" + name + "> without name in " + permFile 30 | + + " at " + parser.getPositionDescription()); 31 | + } else { 32 | + if(android.os.SystemProperties.getBoolean(prop, false)) { 33 | + addFeature(fname, 0); 34 | + } else { 35 | + mUnavailableFeatures.add(fname); 36 | + } 37 | + } 38 | + } else { 39 | + logNotAllowedInPartition(name, permFile, parser); 40 | + } 41 | + XmlUtils.skipCurrentTag(parser); 42 | + } break; 43 | case "allow-in-power-save-except-idle": { 44 | if (allowOverrideAppRestrictions) { 45 | String pkgname = parser.getAttributeValue(null, "package"); 46 | -- 47 | 2.25.1 48 | 49 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_core/16-watchdogd-Support-pinging-two-watchdogs.patch: -------------------------------------------------------------------------------- 1 | From d7037a9f94800e8107c0e847b572298c6d063c99 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Sat, 27 May 2023 05:36:21 -0400 4 | Subject: [PATCH 16/18] watchdogd: Support pinging two watchdogs 5 | 6 | --- 7 | watchdogd/watchdogd.cpp | 33 +++++++++++++++++++++++++++++++++ 8 | 1 file changed, 33 insertions(+) 9 | 10 | diff --git a/watchdogd/watchdogd.cpp b/watchdogd/watchdogd.cpp 11 | index 5dc41e6b8..69abb4e2b 100644 12 | --- a/watchdogd/watchdogd.cpp 13 | +++ b/watchdogd/watchdogd.cpp 14 | @@ -20,12 +20,15 @@ 15 | #include 16 | #include 17 | #include 18 | +#include 19 | 20 | #include 21 | 22 | #define DEV_NAME "/dev/watchdog" 23 | +#define DEV_NAME2 "/dev/watchdog1" 24 | 25 | int main(int argc, char** argv) { 26 | + struct stat st_buf; 27 | android::base::InitLogging(argv, &android::base::KernelLogger); 28 | 29 | int interval = 10; 30 | @@ -42,6 +45,13 @@ int main(int argc, char** argv) { 31 | return 1; 32 | } 33 | 34 | + int fd2 = open(DEV_NAME2, O_RDWR | O_CLOEXEC); 35 | + fstat(fd2, &st_buf); 36 | + if ((st_buf.st_mode & S_IFMT) != S_IFCHR) { 37 | + close(fd2); 38 | + fd2 = -1; 39 | + } 40 | + 41 | int timeout = interval + margin; 42 | int ret = ioctl(fd, WDIOC_SETTIMEOUT, &timeout); 43 | if (ret) { 44 | @@ -61,8 +71,31 @@ int main(int argc, char** argv) { 45 | } 46 | } 47 | 48 | + if(fd2 >= 0) { 49 | + int interval2 = interval; 50 | + ret = ioctl(fd2, WDIOC_SETTIMEOUT, &timeout); 51 | + if (ret) { 52 | + PLOG(ERROR) << "Failed to set2 timeout to " << timeout; 53 | + ret = ioctl(fd, WDIOC_GETTIMEOUT, &timeout); 54 | + if (ret) { 55 | + PLOG(ERROR) << "Failed to get timeout"; 56 | + } else { 57 | + if (timeout > margin) { 58 | + interval2 = timeout - margin; 59 | + } else { 60 | + interval2 = 1; 61 | + } 62 | + LOG(WARNING) << "Adjusted interval to timeout returned by driver: " 63 | + << "timeout " << timeout << ", interval " << interval2 << ", margin " 64 | + << margin; 65 | + } 66 | + } 67 | + if(interval2 < interval) interval = interval2; 68 | + } 69 | + 70 | while (true) { 71 | write(fd, "", 1); 72 | + if (fd2 >= 0) write(fd2, "", 1); 73 | sleep(interval); 74 | } 75 | } 76 | -- 77 | 2.25.1 78 | 79 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_base/23-Catch-broken-mainBuiltInDisplayCutoutRectApproximati.patch: -------------------------------------------------------------------------------- 1 | From 579c04fac7b714e99280d71042afc3f2ccddd0b4 Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Wed, 28 Sep 2022 22:35:26 -0300 4 | Subject: [PATCH] Catch broken mainBuiltInDisplayCutoutRectApproximation 5 | 6 | Some devices (Redmi Note 9T) have: 7 | mainBuiltInDisplayCutoutRectApproximation = @android:mainBuiltInDisplayCutout 8 | Since mainBuiltInDisplayCutout is private, its ID is dynamic and can't 9 | be relied upon. 10 | This means that we'll get garbage in mainBuiltInDisplayCutoutRectApproximation 11 | The SVG Path parser will fail, triggering an exception. 12 | 13 | Fix it by catching it, and parsing mainBuiltInDisplayCutout instead 14 | --- 15 | core/java/android/view/DisplayCutout.java | 17 ++++++++++++----- 16 | 1 file changed, 12 insertions(+), 5 deletions(-) 17 | 18 | diff --git a/core/java/android/view/DisplayCutout.java b/core/java/android/view/DisplayCutout.java 19 | index 83a7b3f01a95..b386c3192f1c 100644 20 | --- a/core/java/android/view/DisplayCutout.java 21 | +++ b/core/java/android/view/DisplayCutout.java 22 | @@ -1055,11 +1055,18 @@ public final class DisplayCutout { 23 | public static DisplayCutout fromResourcesRectApproximation(Resources res, 24 | String displayUniqueId, int physicalDisplayWidth, int physicalDisplayHeight, 25 | int displayWidth, int displayHeight) { 26 | - return pathAndDisplayCutoutFromSpec(getDisplayCutoutPath(res, displayUniqueId), 27 | - getDisplayCutoutApproximationRect(res, displayUniqueId), physicalDisplayWidth, 28 | - physicalDisplayHeight, displayWidth, displayHeight, 29 | - DENSITY_DEVICE_STABLE / (float) DENSITY_DEFAULT, 30 | - getWaterfallInsets(res, displayUniqueId)).second; 31 | + try { 32 | + return pathAndDisplayCutoutFromSpec(getDisplayCutoutPath(res, displayUniqueId), 33 | + getDisplayCutoutApproximationRect(res, displayUniqueId), physicalDisplayWidth, 34 | + physicalDisplayHeight, displayWidth, displayHeight, DENSITY_DEVICE_STABLE / (float) DENSITY_DEFAULT, 35 | + getWaterfallInsets(res, displayUniqueId)).second; 36 | + } catch(Throwable t) { 37 | + return pathAndDisplayCutoutFromSpec(getDisplayCutoutPath(res, displayUniqueId), 38 | + null, physicalDisplayWidth, physicalDisplayHeight, 39 | + displayWidth, displayHeight, 40 | + DENSITY_DEVICE_STABLE / (float) DENSITY_DEFAULT, 41 | + getWaterfallInsets(res, displayUniqueId)).second; 42 | + } 43 | } 44 | 45 | /** 46 | -- 47 | 2.34.1 48 | 49 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_base/32-Set-old-fingerprint-sensors-to-security-strong.patch: -------------------------------------------------------------------------------- 1 | From c507779193354e887b809ee5abc253e6ef02aa0f Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Sat, 3 Dec 2022 17:13:24 -0500 4 | Subject: [PATCH] Set old fingerprint sensors to security "strong" 5 | 6 | This allows removing config_biometric_sensors from overlays, which led 7 | to Pixels not booting, because they are using AIDL biometric sensor, and 8 | despite its name, config_biometric_sensors is HIDL-specific 9 | --- 10 | .../core/java/com/android/server/biometrics/AuthService.java | 2 +- 11 | .../core/java/com/android/server/biometrics/AuthService.java | 2 +- 12 | 1 file changed, 2 insertion(+), 2 deletion(-) 13 | 14 | diff --git a/services/core/java/com/android/server/biometrics/AuthService.java b/services/core/java/com/android/server/biometrics/AuthService.java 15 | index bc550d3113703..2fad2bd108321 100644 16 | --- a/services/core/java/com/android/server/biometrics/AuthService.java 17 | +++ b/services/core/java/com/android/server/biometrics/AuthService.java 18 | @@ -666,7 +666,7 @@ public void onStart() { 19 | if (pm.hasSystemFeature(PackageManager.FEATURE_FACE)) { 20 | modalities.add(String.valueOf(BiometricAuthenticator.TYPE_FACE)); 21 | } 22 | - final String strength = String.valueOf(Authenticators.BIOMETRIC_CONVENIENCE); 23 | + final String strength = String.valueOf(Authenticators.BIOMETRIC_STRONG); 24 | final String[] configStrings = new String[modalities.size()]; 25 | for (int i = 0; i < modalities.size(); ++i) { 26 | final String id = String.valueOf(i); 27 | 28 | diff --git a/services/core/java/com/android/server/biometrics/AuthService.java b/services/core/java/com/android/server/biometrics/AuthService.java 29 | index 2fad2bd108321..6fbc3c66c1bcf 100644 30 | --- a/services/core/java/com/android/server/biometrics/AuthService.java 31 | +++ b/services/core/java/com/android/server/biometrics/AuthService.java 32 | @@ -631,7 +631,7 @@ public void onStart() { 33 | final int firstApiLevel = SystemProperties.getInt(SYSPROP_FIRST_API_LEVEL, 0); 34 | final int apiLevel = SystemProperties.getInt(SYSPROP_API_LEVEL, firstApiLevel); 35 | String[] configStrings = mInjector.getConfiguration(getContext()); 36 | - if (configStrings.length == 0 && apiLevel == Build.VERSION_CODES.R) { 37 | + if (configStrings.length == 0 && apiLevel <= Build.VERSION_CODES.R) { 38 | // For backwards compatibility with R where biometrics could work without being 39 | // configured in config_biometric_sensors. In the absence of a vendor provided 40 | // configuration, we assume the weakest biometric strength (i.e. convenience). 41 | -- 42 | 2.25.1 43 | 44 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_bionic/02-Add-new-mechanism-to-fake-vendor-props-on-a-per-proc.patch: -------------------------------------------------------------------------------- 1 | From 80252e3a2495d6e840b678a5540494f3a2e395ba Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Sat, 19 Feb 2022 08:20:25 -0500 4 | Subject: [PATCH 2/2] Add new mechanism to fake vendor props on a per-process 5 | basis 6 | 7 | This reads debug.phh.props.. If its value is "vendor", 8 | then ro.product.device/ro.product.manufacturer is read from vendor 9 | --- 10 | libc/system_properties/system_properties.cpp | 38 ++++++++++++++++++++ 11 | 1 file changed, 38 insertions(+) 12 | 13 | diff --git a/libc/system_properties/system_properties.cpp b/libc/system_properties/system_properties.cpp 14 | index 1cb15c3df..d6e7e3e68 100644 15 | --- a/libc/system_properties/system_properties.cpp 16 | +++ b/libc/system_properties/system_properties.cpp 17 | @@ -35,6 +35,7 @@ 18 | #include 19 | #include 20 | #include 21 | +#include 22 | 23 | #include 24 | 25 | @@ -50,6 +51,32 @@ 26 | #define SERIAL_DIRTY(serial) ((serial)&1) 27 | #define SERIAL_VALUE_LEN(serial) ((serial) >> 24) 28 | 29 | +static char comm[128]; 30 | +static bool self_ok = false; 31 | +static char comm_override[PROP_VALUE_MAX]; 32 | + 33 | +static void read_self() { 34 | + //NB: Not atomic, but should be good enough, there is no possible corruption from concurrency 35 | + if(self_ok) return; 36 | + self_ok = true; 37 | + 38 | + int fd = open("/proc/self/comm", O_RDONLY); 39 | + if(fd<0) return; 40 | + read(fd, comm, sizeof(comm)-1); 41 | + for(unsigned i=0; i0) return r; 67 | + } 68 | + if(strcmp(name, "ro.product.manufacturer") == 0) { 69 | + int r = Get("ro.product.vendor.manufacturer", value); 70 | + if(r>0) return r; 71 | + } 72 | + } 73 | const prop_info* pi = Find(name); 74 | 75 | if (pi != nullptr) { 76 | -- 77 | 2.25.1 78 | 79 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_av/07-camera-Implement-property-to-override-default-camera.patch: -------------------------------------------------------------------------------- 1 | From 3df12991e9f63417985b167d58cbfe9253d4dc1b Mon Sep 17 00:00:00 2001 2 | From: Peter Cai 3 | Date: Wed, 1 Jun 2022 16:56:46 -0400 4 | Subject: [PATCH 07/26] camera: Implement property to override default camera 5 | 6 | Complement to the frameworks/base patch. 7 | 8 | Change-Id: I002bfa974bafc2cc01365eeea31c7a5dcb5a2028 9 | --- 10 | .../common/CameraProviderManager.cpp | 22 +++++++++++++++++++ 11 | 1 file changed, 22 insertions(+) 12 | 13 | diff --git a/services/camera/libcameraservice/common/CameraProviderManager.cpp b/services/camera/libcameraservice/common/CameraProviderManager.cpp 14 | index f209f71cdf..1b38057889 100644 15 | --- a/services/camera/libcameraservice/common/CameraProviderManager.cpp 16 | +++ b/services/camera/libcameraservice/common/CameraProviderManager.cpp 17 | @@ -36,6 +36,7 @@ 18 | #include 19 | #include 20 | #include 21 | +#include 22 | #include 23 | #include 24 | #include 25 | @@ -210,6 +211,15 @@ std::vector CameraProviderManager::getCameraDeviceIds(std::unordere 26 | } 27 | } 28 | } 29 | + 30 | + int32_t altPrimaryCamera = property_get_int32("persist.sys.alt_primary_camera", 0); 31 | + 32 | + if (altPrimaryCamera != 0 && deviceIds.size() > (size_t) altPrimaryCamera) { 33 | + const std::string origPrimary = deviceIds[0]; 34 | + deviceIds[0] = deviceIds[altPrimaryCamera]; 35 | + deviceIds[altPrimaryCamera] = origPrimary; 36 | + } 37 | + 38 | return deviceIds; 39 | } 40 | 41 | @@ -276,6 +286,18 @@ std::vector CameraProviderManager::getAPI1CompatibleCameraDeviceIds 42 | std::sort(systemDeviceIds.begin(), systemDeviceIds.end(), sortFunc); 43 | deviceIds.insert(deviceIds.end(), publicDeviceIds.begin(), publicDeviceIds.end()); 44 | deviceIds.insert(deviceIds.end(), systemDeviceIds.begin(), systemDeviceIds.end()); 45 | + 46 | + // Default camera ID hack should match with android.hardware.camera2.CameraManager.sortCameraIds 47 | + // Note that the alt primary camera may not be available here due to filterLogicalCameraIdsLocked() 48 | + // in which case we will just ignore it. 49 | + int altPrimaryCameraId = base::GetIntProperty("persist.sys.alt_primary_camera", -1); 50 | + 51 | + if (altPrimaryCameraId > 0 && altPrimaryCameraId < (int) deviceIds.size()) { 52 | + std::string origPrimary = deviceIds[0]; 53 | + deviceIds[0] = deviceIds[altPrimaryCameraId]; 54 | + deviceIds[altPrimaryCameraId] = origPrimary; 55 | + } 56 | + 57 | return deviceIds; 58 | } 59 | 60 | -- 61 | 2.34.1 62 | 63 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_opt_telephony/01-SubscriptionController-Do-not-override-default-calli.patch: -------------------------------------------------------------------------------- 1 | From 74531e99c8728e84d5555fa58d8edb56389b73f2 Mon Sep 17 00:00:00 2001 2 | From: Peter Cai 3 | Date: Mon, 5 Sep 2022 14:02:37 -0400 4 | Subject: [PATCH 01/10] SubscriptionController: Do not override default calling 5 | account from third-party apps 6 | 7 | When the user has selected a calling account from a third-party app as 8 | default, it should not be overridden by the rest of the telephony 9 | subsystem (e.g. SIM subcription updates, or default SIM slot selection). 10 | 11 | Otherwise, it creates a somewhat annoying situation where the user has 12 | to keep re-selecting the desired calling account after every reboot. 13 | 14 | Test: manual 15 | Change-Id: Iccab64e9b3b3ab4773bd8944d47c2006f229d472 16 | --- 17 | .../telephony/SubscriptionController.java | 19 ++++++++++++++++--- 18 | 1 file changed, 16 insertions(+), 3 deletions(-) 19 | 20 | diff --git a/src/java/com/android/internal/telephony/SubscriptionController.java b/src/java/com/android/internal/telephony/SubscriptionController.java 21 | index 82799bea8b..a9131f6b7a 100644 22 | --- a/src/java/com/android/internal/telephony/SubscriptionController.java 23 | +++ b/src/java/com/android/internal/telephony/SubscriptionController.java 24 | @@ -2855,9 +2855,22 @@ public class SubscriptionController extends ISub.Stub { 25 | subId); 26 | 27 | TelecomManager telecomManager = mContext.getSystemService(TelecomManager.class); 28 | - 29 | - telecomManager.setUserSelectedOutgoingPhoneAccount(newHandle); 30 | - logd("[setDefaultVoiceSubId] requesting change to phoneAccountHandle=" + newHandle); 31 | + PhoneAccountHandle currentHandle = telecomManager.getUserSelectedOutgoingPhoneAccount(); 32 | + logd("[setDefaultVoiceSubId] current phoneAccountHandle=" + currentHandle); 33 | + 34 | + String currentPackageName = 35 | + currentHandle == null ? null : currentHandle.getComponentName().getPackageName(); 36 | + boolean currentIsSim = "com.android.phone".equals(currentPackageName); 37 | + // Do not override user selected outgoing calling account 38 | + // if the user has selected a third-party app as default 39 | + boolean shouldKeepOutgoingAccount = currentHandle != null && !currentIsSim; 40 | + 41 | + if (!shouldKeepOutgoingAccount) { 42 | + telecomManager.setUserSelectedOutgoingPhoneAccount(newHandle); 43 | + logd("[setDefaultVoiceSubId] change to phoneAccountHandle=" + newHandle); 44 | + } else { 45 | + logd("[setDefaultVoiceSubId] default phoneAccountHandle not changed."); 46 | + } 47 | 48 | if (previousDefaultSub != getDefaultSubId()) { 49 | sendDefaultChangedBroadcast(getDefaultSubId()); 50 | -- 51 | 2.25.1 52 | 53 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_av/24-Support-variable-flash-strength-on-samsung-hal-4.0.patch: -------------------------------------------------------------------------------- 1 | From d6adaf1022ba17c8b27d63f9f89e44fc2828d14b Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Mon, 2 May 2022 17:37:09 -0400 4 | Subject: [PATCH 23/23] Support variable flash strength on samsung hal 4.0 5 | 6 | --- 7 | services/camera/libcameraservice/Android.bp | 1 + 8 | .../libcameraservice/common/CameraProviderManager.cpp | 6 ++++++ 9 | 2 files changed, 7 insertions(+) 10 | 11 | diff --git a/services/camera/libcameraservice/Android.bp b/services/camera/libcameraservice/Android.bp 12 | index c4e551af3d..6b21520150 100644 13 | --- a/services/camera/libcameraservice/Android.bp 14 | +++ b/services/camera/libcameraservice/Android.bp 15 | @@ -170,6 +170,7 @@ cc_library_shared { 16 | "vendor.samsung.hardware.camera.provider@3.0", 17 | "vendor.samsung.hardware.camera.provider@4.0", 18 | "vendor.samsung.hardware.camera.device@5.0", 19 | + "vendor.samsung.hardware.camera.device@4.0", 20 | "media_permission-aidl-cpp", 21 | ], 22 | 23 | diff --git a/services/camera/libcameraservice/common/hidl/HidlProviderInfo.cpp b/services/camera/libcameraservice/common/hidl/HidlProviderInfo.cpp 24 | index ecb2011c19..d5c4f4e561 100644 25 | --- a/services/camera/libcameraservice/common/hidl/HidlProviderInfo.cpp 26 | +++ b/services/camera/libcameraservice/common/hidl/HidlProviderInfo.cpp 27 | @@ -30,6 +30,7 @@ 28 | #include 29 | #include 30 | #include 31 | +#include 32 | 33 | namespace { 34 | const bool kEnableLazyHal(property_get_bool("ro.camera.enableLazyHal", false)); 35 | @@ -782,9 +783,14 @@ status_t HidlProviderInfo::HidlDeviceInfo3::setTorchMode(bool enabled) { 36 | auto sehCast = vendor::samsung::hardware::camera::device::V5_0::ISehCameraDevice::castFrom(interface); 37 | android::sp seh = sehCast; 38 | 39 | + auto sehCast2 = vendor::samsung::hardware::camera::device::V4_0::ISehCameraDevice::castFrom(interface); 40 | + android::sp seh2 = sehCast2; 41 | + 42 | Status s; 43 | if(seh != nullptr) { 44 | s = seh->sehSetTorchModeStrength(enabled ? TorchMode::ON : TorchMode::OFF, flashStrength); 45 | + } else if(seh2 != nullptr) { 46 | + s = seh2->sehSetTorchModeStrength(enabled ? TorchMode::ON : TorchMode::OFF, flashStrength); 47 | } else { 48 | s = interface->setTorchMode(enabled ? TorchMode::ON : TorchMode::OFF); 49 | } 50 | -- 51 | 2.25.1 52 | 53 | -------------------------------------------------------------------------------- /patches/personal/platform_vendor_cherish/02-Inherit-call-phh_gsi-mk.patch: -------------------------------------------------------------------------------- 1 | From 56b5fc29f9b0c586b543602b7eaced5243d84d53 Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Fri, 7 Oct 2022 17:52:31 +0000 4 | Subject: [PATCH] Inherit call phh_gsi.mk 5 | 6 | --- 7 | config/common.mk | 31 ++++++++++++------------------- 8 | 1 file changed, 12 insertions(+), 19 deletions(-) 9 | 10 | diff --git a/config/common.mk b/config/common.mk 11 | index cf7b1354..7249e00f 100644 12 | --- a/config/common.mk 13 | +++ b/config/common.mk 14 | @@ -3,6 +3,14 @@ $(call inherit-product, vendor/cherish/config/main_version.mk) 15 | 16 | PRODUCT_BRAND ?= CherishOS 17 | 18 | +CHERISH_VANILLA := true 19 | + 20 | +# PHH GSI 21 | +$(call inherit-product, vendor/cherish/config/phh_gsi.mk) 22 | + 23 | +# Set Bootanimation at 720P 24 | +TARGET_BOOT_ANIMATION_RES := 720 25 | + 26 | PRODUCT_BUILD_PROP_OVERRIDES += BUILD_UTC_DATE=0 27 | 28 | ifeq ($(PRODUCT_GMS_CLIENTID_BASE),) 29 | @@ -23,15 +31,16 @@ endif 30 | 31 | # ART 32 | # Optimize everything for preopt 33 | -PRODUCT_DEX_PREOPT_DEFAULT_COMPILER_FILTER := everything 34 | +PRODUCT_DEX_PREOPT_DEFAULT_COMPILER_FILTER := speed-profile 35 | + 36 | # Don't preopt prebuilts 37 | -DONT_DEXPREOPT_PREBUILTS := true 38 | +# DONT_DEXPREOPT_PREBUILTS := true 39 | 40 | PRODUCT_PROPERTY_OVERRIDES += \ 41 | pm.dexopt.boot=verify \ 42 | pm.dexopt.first-boot=quicken \ 43 | pm.dexopt.install=speed-profile \ 44 | - pm.dexopt.bg-dexopt=everything 45 | + pm.dexopt.bg-dexopt=speed-profile 46 | 47 | ifneq ($(AB_OTA_PARTITIONS),) 48 | PRODUCT_PROPERTY_OVERRIDES += \ 49 | @@ -52,18 +61,6 @@ PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \ 50 | ro.com.android.dateformat=MM-dd-yyyy \ 51 | persist.sys.disable_rescue=true 52 | 53 | -ifeq ($(TARGET_BUILD_VARIANT),eng) 54 | -# Disable ADB authentication 55 | -PRODUCT_SYSTEM_DEFAULT_PROPERTIES += ro.adb.secure=0 56 | -else 57 | -# Enable ADB authentication 58 | -PRODUCT_SYSTEM_DEFAULT_PROPERTIES += ro.adb.secure=1 59 | - 60 | -# Disable extra StrictMode features on all non-engineering builds 61 | -PRODUCT_SYSTEM_DEFAULT_PROPERTIES += persist.sys.strictmode.disable=true 62 | -endif 63 | - 64 | - 65 | # Enable WiFi Display 66 | PRODUCT_PROPERTY_OVERRIDES += \ 67 | persist.sys.wfd.nohdcp=1 \ 68 | @@ -119,10 +116,6 @@ PRODUCT_COPY_FILES += \ 69 | PRODUCT_COPY_FILES += \ 70 | frameworks/base/data/keyboards/Vendor_045e_Product_028e.kl:$(TARGET_COPY_OUT_PRODUCT)/usr/keylayout/Vendor_045e_Product_0719.kl 71 | 72 | -# Enable Google LILY_EXPERIENCE feature 73 | -PRODUCT_COPY_FILES += \ 74 | - vendor/cherish/target/config/permissions/lily_experience.xml:$(TARGET_COPY_OUT_PRODUCT)/etc/sysconfig/lily_experience.xml 75 | - 76 | # Enforce privapp-permissions whitelist 77 | PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \ 78 | ro.control_privapp_permissions=log 79 | -- 80 | 2.34.1 81 | 82 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_av/23-Add-a-prop-to-change-Samsung-flash-strength.patch: -------------------------------------------------------------------------------- 1 | From 46de089f9982988dcadf61db1aee134114600019 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Sat, 16 Apr 2022 14:30:14 -0400 4 | Subject: [PATCH 22/23] Add a prop to change Samsung flash strength 5 | 6 | --- 7 | services/camera/libcameraservice/Android.bp | 1 + 8 | .../common/CameraProviderManager.cpp | 14 +++++++++++++- 9 | 2 files changed, 14 insertions(+), 1 deletion(-) 10 | 11 | diff --git a/services/camera/libcameraservice/Android.bp b/services/camera/libcameraservice/Android.bp 12 | index d4d6aa3fd4..c4e551af3d 100644 13 | --- a/services/camera/libcameraservice/Android.bp 14 | +++ b/services/camera/libcameraservice/Android.bp 15 | @@ -169,6 +169,7 @@ cc_library_shared { 16 | "android.hardware.camera.device-V1-ndk", 17 | "vendor.samsung.hardware.camera.provider@3.0", 18 | "vendor.samsung.hardware.camera.provider@4.0", 19 | + "vendor.samsung.hardware.camera.device@5.0", 20 | "media_permission-aidl-cpp", 21 | ], 22 | 23 | diff --git a/services/camera/libcameraservice/common/hidl/HidlProviderInfo.cpp b/services/camera/libcameraservice/common/hidl/HidlProviderInfo.cpp 24 | index 4e6bac24db..ecb2011c19 100644 25 | --- a/services/camera/libcameraservice/common/hidl/HidlProviderInfo.cpp 26 | +++ b/services/camera/libcameraservice/common/hidl/HidlProviderInfo.cpp 27 | @@ -29,6 +29,7 @@ 28 | #include 29 | #include 30 | #include 31 | +#include 32 | 33 | namespace { 34 | const bool kEnableLazyHal(property_get_bool("ro.camera.enableLazyHal", false)); 35 | @@ -776,7 +777,18 @@ HidlProviderInfo::HidlDeviceInfo3::HidlDeviceInfo3( 36 | status_t HidlProviderInfo::HidlDeviceInfo3::setTorchMode(bool enabled) { 37 | using hardware::camera::common::V1_0::TorchMode; 38 | const sp interface = startDeviceInterface(); 39 | - Status s = interface->setTorchMode(enabled ? TorchMode::ON : TorchMode::OFF); 40 | + int32_t flashStrength = property_get_int32("persist.sys.phh.flash_strength", 1); 41 | + 42 | + auto sehCast = vendor::samsung::hardware::camera::device::V5_0::ISehCameraDevice::castFrom(interface); 43 | + android::sp seh = sehCast; 44 | + 45 | + Status s; 46 | + if(seh != nullptr) { 47 | + s = seh->sehSetTorchModeStrength(enabled ? TorchMode::ON : TorchMode::OFF, flashStrength); 48 | + } else { 49 | + s = interface->setTorchMode(enabled ? TorchMode::ON : TorchMode::OFF); 50 | + } 51 | + 52 | return mapToStatusT(s); 53 | } 54 | 55 | -- 56 | 2.25.1 57 | 58 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_packages_modules_Bluetooth/01-Additionally-check-le_set_event_mask-command-resturn.patch: -------------------------------------------------------------------------------- 1 | From 7cfe2f9b5d19f2a0b0bd14b0c94482448ae33817 Mon Sep 17 00:00:00 2001 2 | From: "tzu-hsien.huang" 3 | Date: Wed, 20 Jul 2022 15:12:01 +0800 4 | Subject: [PATCH 1/8] Additionally check le_set_event_mask command resturn 5 | status with UNSUPPORTED_LMP_OR_LL_PARAMETER 6 | 7 | In GD BT stack, stack will check each return status of HCI Commands. E.g. reset , le_set_event_mask, set_event_mask …etc. 8 | In BT spec 5.2, SIG add some parameters for le_set_event_mask for le audio, like LE Terminate BIG Complete event: Supported. 9 | However, some legacy chips do not support LE Audio feature, and controller will return Status: Unsupported LMP Parameter Value when it receives this HCI Command 10 | When it checks the return value and find the status is not SUCCESS, it will cause FAIL and cannot be compatible with old legacy chip. 11 | After brushing GSI, Bluetooth will turn off automatically when it is turned on. 12 | So all CTS test will always fail. 13 | 14 | Check le_set_event_mask command return status with SUCCESS or UNSUPPORTED_LMP_OR_LL_PARAMETER 15 | 16 | Bug: 239662211 17 | Test: CtsBluetoothTestCases 18 | Change-Id: I2b0cede7f47eecd2124a386e958773289eb6f11c 19 | --- 20 | system/gd/hci/controller.cc | 11 ++++++++++- 21 | 1 file changed, 10 insertions(+), 1 deletion(-) 22 | 23 | diff --git a/system/gd/hci/controller.cc b/system/gd/hci/controller.cc 24 | index a48222117a..a7d83b0ca1 100644 25 | --- a/system/gd/hci/controller.cc 26 | +++ b/system/gd/hci/controller.cc 27 | @@ -548,7 +548,7 @@ struct Controller::impl { 28 | void le_set_event_mask(uint64_t le_event_mask) { 29 | std::unique_ptr packet = LeSetEventMaskBuilder::Create(le_event_mask); 30 | hci_->EnqueueCommand( 31 | - std::move(packet), module_.GetHandler()->BindOnceOn(this, &Controller::impl::check_le_set_event_mask_status)); 32 | + std::move(packet), module_.GetHandler()->BindOnceOn(this, &Controller::impl::check_event_mask_status)); 33 | } 34 | 35 | void check_le_set_event_mask_status(CommandCompleteView view) { 36 | @@ -569,6 +569,15 @@ struct Controller::impl { 37 | ASSERT(status_view.GetStatus() == ErrorCode::SUCCESS); 38 | } 39 | 40 | + template 41 | + void check_event_mask_status(CommandCompleteView view) { 42 | + ASSERT(view.IsValid()); 43 | + auto status_view = T::Create(view); 44 | + ASSERT(status_view.IsValid()); 45 | + ASSERT(status_view.GetStatus() == ErrorCode::SUCCESS || 46 | + status_view.GetStatus() == ErrorCode::UNSUPPORTED_LMP_OR_LL_PARAMETER); 47 | + } 48 | + 49 | #define OP_CODE_MAPPING(name) \ 50 | case OpCode::name: { \ 51 | uint16_t index = (uint16_t)OpCodeIndex::name; \ 52 | -- 53 | 2.34.1 54 | 55 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_opt_telephony/06-telephony-forward-port-support-for-forceCognitive.patch: -------------------------------------------------------------------------------- 1 | From cdd09b71e7dec575a5216adc430c67c0260f1a01 Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Sat, 1 Oct 2022 01:49:58 +0000 4 | Subject: [PATCH] telephony: forward-port support for forceCognitive 5 | 6 | * This is needed on some MTK devices. Android 10 refactored some code, 7 | so now the "non-persistent/cognitive" filter is relocated to RIL and 8 | also in DcTracker.setupData(). 9 | 10 | Change-Id: I7dd387a9f064a969ca5774e53b05388de12aa308 11 | --- 12 | src/java/com/android/internal/telephony/RadioDataProxy.java | 4 +++- 13 | .../android/internal/telephony/dataconnection/DcTracker.java | 3 ++- 14 | 2 files changed, 5 insertions(+), 2 deletions(-) 15 | 16 | diff --git a/src/java/com/android/internal/telephony/RadioDataProxy.java b/src/java/com/android/internal/telephony/RadioDataProxy.java 17 | index cbc762a59d..868a926667 100644 18 | --- a/src/java/com/android/internal/telephony/RadioDataProxy.java 19 | +++ b/src/java/com/android/internal/telephony/RadioDataProxy.java 20 | @@ -21,6 +21,7 @@ import android.net.LinkProperties; 21 | import android.os.AsyncResult; 22 | import android.os.Message; 23 | import android.os.RemoteException; 24 | +import android.os.SystemProperties; 25 | import android.telephony.Rlog; 26 | import android.telephony.ServiceState; 27 | import android.telephony.data.DataProfile; 28 | @@ -234,7 +235,8 @@ public class RadioDataProxy extends RadioServiceProxy { 29 | } else { 30 | ArrayList dpis = new ArrayList<>(); 31 | for (DataProfile dp : profiles) { 32 | - if (dp.isPersistent()) { 33 | + boolean forceCognitive = SystemProperties.getBoolean("persist.sys.phh.radio.force_cognitive", false); 34 | + if (dp.isPersistent() || forceCognitive) { 35 | dpis.add(RILUtils.convertToHalDataProfile10(dp)); 36 | } 37 | } 38 | diff --git a/src/java/com/android/internal/telephony/dataconnection/DcTracker.java b/src/java/com/android/internal/telephony/dataconnection/DcTracker.java 39 | index 28f69dcdc9..3e73e2b9ef 100755 40 | --- a/src/java/com/android/internal/telephony/dataconnection/DcTracker.java 41 | +++ b/src/java/com/android/internal/telephony/dataconnection/DcTracker.java 42 | @@ -2160,8 +2160,9 @@ public class DcTracker extends Handler { 43 | } 44 | 45 | // profile id is only meaningful when the profile is persistent on the modem. 46 | + boolean forceCognitive = SystemProperties.getBoolean("persist.sys.phh.radio.force_cognitive", false); 47 | int profileId = DATA_PROFILE_INVALID; 48 | - if (apnSetting.isPersistent()) { 49 | + if (apnSetting.isPersistent() || forceCognitive) { 50 | profileId = apnSetting.getProfileId(); 51 | if (profileId == DATA_PROFILE_DEFAULT) { 52 | profileId = getApnProfileID(apnContext.getApnType()); 53 | -- 54 | 2.34.1 55 | 56 | -------------------------------------------------------------------------------- /patches/personal/platform_vendor_hardware_overlay/03-Add-BIOMETRIC_STRONG-overlay.patch: -------------------------------------------------------------------------------- 1 | From fb2178caac7a284bd28ce19554469fbf3b5777f5 Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Wed, 12 Apr 2023 18:49:28 +0000 4 | Subject: [PATCH] Add BIOMETRIC_STRONG overlay 5 | 6 | --- 7 | Misc/Biometrics/Android.mk | 8 ++++++++ 8 | Misc/Biometrics/AndroidManifest.xml | 17 +++++++++++++++++ 9 | Misc/Biometrics/res/values/arrays.xml | 6 ++++++ 10 | overlay.mk | 1 + 11 | 4 files changed, 32 insertions(+) 12 | create mode 100644 Misc/Biometrics/Android.mk 13 | create mode 100644 Misc/Biometrics/AndroidManifest.xml 14 | create mode 100644 Misc/Biometrics/res/values/arrays.xml 15 | 16 | diff --git a/Misc/Biometrics/Android.mk b/Misc/Biometrics/Android.mk 17 | new file mode 100644 18 | index 0000000..538c61c 19 | --- /dev/null 20 | +++ b/Misc/Biometrics/Android.mk 21 | @@ -0,0 +1,8 @@ 22 | +LOCAL_PATH := $(call my-dir) 23 | +include $(CLEAR_VARS) 24 | +LOCAL_MODULE_TAGS := optional 25 | +LOCAL_PACKAGE_NAME := treble-overlay-misc-biometrics 26 | +LOCAL_MODULE_PATH := $(TARGET_OUT_PRODUCT)/overlay 27 | +LOCAL_IS_RUNTIME_RESOURCE_OVERLAY := true 28 | +LOCAL_PRIVATE_PLATFORM_APIS := true 29 | +include $(BUILD_PACKAGE) 30 | diff --git a/Misc/Biometrics/AndroidManifest.xml b/Misc/Biometrics/AndroidManifest.xml 31 | new file mode 100644 32 | index 0000000..1d5131a 33 | --- /dev/null 34 | +++ b/Misc/Biometrics/AndroidManifest.xml 35 | @@ -0,0 +1,17 @@ 36 | + 37 | + 42 | + 46 | + 52 | + 53 | diff --git a/Misc/Biometrics/res/values/arrays.xml b/Misc/Biometrics/res/values/arrays.xml 54 | new file mode 100644 55 | index 0000000..e3c63f1 56 | --- /dev/null 57 | +++ b/Misc/Biometrics/res/values/arrays.xml 58 | @@ -0,0 +1,6 @@ 59 | + 60 | + 61 | + 62 | + 0:2:15 63 | + 64 | + 65 | diff --git a/overlay.mk b/overlay.mk 66 | index 3208568..da1edbb 100644 67 | --- a/overlay.mk 68 | +++ b/overlay.mk 69 | @@ -84,6 +84,7 @@ PRODUCT_PACKAGES += \ 70 | treble-overlay-meizu-m2181-systemui \ 71 | treble-overlay-misc-aod \ 72 | treble-overlay-misc-aod-systemui \ 73 | + treble-overlay-misc-biometrics \ 74 | treble-overlay-misc-dt2w \ 75 | treble-overlay-misc-launcher3 \ 76 | treble-overlay-misc-minimal-brightness \ 77 | -- 78 | 2.34.1 79 | 80 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_base/36-Always-add-HIDL-fingerprint-config-Galaxy-A53-is-mis.patch: -------------------------------------------------------------------------------- 1 | From d7d35a988cbbe567faa9e6ed5994b66e7861c21e Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Tue, 3 Jan 2023 17:59:00 -0500 4 | Subject: [PATCH 37/37] Always add HIDL fingerprint config (Galaxy A53 is 5 | missing it on A12 vendor) -- but first enumerate AIDL 6 | 7 | --- 8 | .../core/java/com/android/server/biometrics/AuthService.java | 4 ++-- 9 | .../biometrics/sensors/fingerprint/FingerprintService.java | 3 ++- 10 | 2 files changed, 4 insertions(+), 3 deletions(-) 11 | 12 | diff --git a/services/core/java/com/android/server/biometrics/AuthService.java b/services/core/java/com/android/server/biometrics/AuthService.java 13 | index 748152aa7c97..b47b47c41f76 100644 14 | --- a/services/core/java/com/android/server/biometrics/AuthService.java 15 | +++ b/services/core/java/com/android/server/biometrics/AuthService.java 16 | @@ -650,11 +650,11 @@ public class AuthService extends SystemService { 17 | final int firstApiLevel = SystemProperties.getInt(SYSPROP_FIRST_API_LEVEL, 0); 18 | final int apiLevel = SystemProperties.getInt(SYSPROP_API_LEVEL, firstApiLevel); 19 | String[] configStrings = mInjector.getConfiguration(getContext()); 20 | - if (configStrings.length == 0 && apiLevel <= Build.VERSION_CODES.R) { 21 | + if (configStrings.length == 0) { 22 | // For backwards compatibility with R where biometrics could work without being 23 | // configured in config_biometric_sensors. In the absence of a vendor provided 24 | // configuration, we assume the weakest biometric strength (i.e. convenience). 25 | - Slog.w(TAG, "Found R vendor partition without config_biometric_sensors"); 26 | + Slog.w(TAG, "Found vendor partition without config_biometric_sensors"); 27 | configStrings = generateRSdkCompatibleConfiguration(); 28 | } 29 | hidlConfigs = new SensorConfig[configStrings.length]; 30 | diff --git a/services/core/java/com/android/server/biometrics/sensors/fingerprint/FingerprintService.java b/services/core/java/com/android/server/biometrics/sensors/fingerprint/FingerprintService.java 31 | index 94b67cedf86c..9468f5f91c24 100644 32 | --- a/services/core/java/com/android/server/biometrics/sensors/fingerprint/FingerprintService.java 33 | +++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/FingerprintService.java 34 | @@ -905,8 +905,9 @@ public class FingerprintService extends SystemService { 35 | final Handler handler = new Handler(thread.getLooper()); 36 | 37 | handler.post(() -> { 38 | - addHidlProviders(hidlSensors); 39 | addAidlProviders(); 40 | + if(mServiceProviders.isEmpty()) 41 | + addHidlProviders(hidlSensors); 42 | 43 | final IBiometricService biometricService = IBiometricService.Stub.asInterface( 44 | ServiceManager.getService(Context.BIOMETRIC_SERVICE)); 45 | -- 46 | 2.25.1 47 | 48 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_packages_modules_Bluetooth/06-On-Samsung-devices-we-need-to-tell-Audio-HAL-if-we-re-running-narrow-band-or-wide-band.patch: -------------------------------------------------------------------------------- 1 | From 8d8af3c4c48b54a8f4eca959b254d835fef337aa Mon Sep 17 00:00:00 2001 2 | From: Andreas Schneider 3 | Date: Sat, 12 Nov 2022 00:35:46 +0000 4 | Subject: [PATCH 6/6] On Samsung devices, we need to tell Audio HAL if we're 5 | running narrow band or wide band 6 | 7 | Ported to Android 13. 8 | 9 | Change-Id: I7802b7a29c017a2cd7018e82772183df1dfa0b89 10 | --- 11 | .../com/android/bluetooth/hfp/HeadsetStateMachine.java | 8 ++++++++ 12 | 1 file changed, 8 insertions(+) 13 | 14 | diff --git a/android/app/src/com/android/bluetooth/hfp/HeadsetStateMachine.java b/android/app/src/com/android/bluetooth/hfp/HeadsetStateMachine.java 15 | index b237e7d6cc..73579cba50 100644 16 | --- a/android/app/src/com/android/bluetooth/hfp/HeadsetStateMachine.java 17 | +++ b/android/app/src/com/android/bluetooth/hfp/HeadsetStateMachine.java 18 | @@ -147,6 +147,7 @@ public class HeadsetStateMachine extends StateMachine { 19 | // Audio Parameters 20 | private boolean mHasNrecEnabled = false; 21 | private boolean mHasWbsEnabled = false; 22 | + private int mReportScoSampleRate = 0; 23 | // AT Phone book keeps a group of states used by AT+CPBR commands 24 | @VisibleForTesting 25 | final AtPhonebook mPhonebook; 26 | @@ -228,6 +229,7 @@ public class HeadsetStateMachine extends StateMachine { 27 | } 28 | mHasWbsEnabled = false; 29 | mHasNrecEnabled = false; 30 | + mReportScoSampleRate = 0; 31 | } 32 | 33 | public void dump(StringBuilder sb) { 34 | @@ -457,6 +459,7 @@ public class HeadsetStateMachine extends StateMachine { 35 | mNeedDialingOutReply = false; 36 | mHasWbsEnabled = false; 37 | mHasNrecEnabled = false; 38 | + mReportScoSampleRate = 0; 39 | broadcastStateTransitions(); 40 | // Remove the state machine for unbonded devices 41 | if (mPrevState != null 42 | @@ -1542,6 +1545,9 @@ public class HeadsetStateMachine extends StateMachine { 43 | + " hasNrecEnabled=" + mHasNrecEnabled 44 | + " hasWbsEnabled=" + mHasWbsEnabled); 45 | am.setBluetoothHeadsetProperties(getCurrentDeviceName(), mHasNrecEnabled, mHasWbsEnabled); 46 | + if (mReportScoSampleRate > 0) { 47 | + am.setParameters("g_sco_samplerate=" + mReportScoSampleRate); 48 | + } 49 | } 50 | 51 | @VisibleForTesting 52 | @@ -1685,10 +1691,12 @@ public class HeadsetStateMachine extends StateMachine { 53 | switch (wbsConfig) { 54 | case HeadsetHalConstants.BTHF_WBS_YES: 55 | mHasWbsEnabled = true; 56 | + mReportScoSampleRate = 16000; 57 | break; 58 | case HeadsetHalConstants.BTHF_WBS_NO: 59 | case HeadsetHalConstants.BTHF_WBS_NONE: 60 | mHasWbsEnabled = false; 61 | + mReportScoSampleRate = 8000; 62 | break; 63 | default: 64 | Log.e(TAG, "processWBSEvent: unknown wbsConfig " + wbsConfig); 65 | -- 66 | 2.25.1 67 | 68 | -------------------------------------------------------------------------------- /patches/pre/platform_vendor_cherish/02-Nuke-charge-animation.patch: -------------------------------------------------------------------------------- 1 | From 36cef1ee4863acb3d1189aa4a3100f965abb61fe Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Sat, 12 Aug 2023 23:59:03 +0000 4 | Subject: [PATCH] Nuke charge animation 5 | 6 | Alredy exist on TD repo 7 | 8 | --- 9 | charger/Android.mk | 68 ---------------------------------------------- 10 | 1 file changed, 68 deletions(-) 11 | delete mode 100644 charger/Android.mk 12 | 13 | diff --git a/charger/Android.mk b/charger/Android.mk 14 | deleted file mode 100644 15 | index cc182726..00000000 16 | --- a/charger/Android.mk 17 | +++ /dev/null 18 | @@ -1,68 +0,0 @@ 19 | -# 20 | -# Copyright (C) 2020 Raphielscape LLC. and Haruka LLC. 21 | -# 22 | -# Licensed under the Apache License, Version 2.0 (the License); 23 | -# you may not use this file except in compliance with the License. 24 | -# You may obtain a copy of the License at 25 | -# 26 | -# http://www.apache.org/licenses/LICENSE-2.0 27 | -# 28 | -# Unless required by applicable law or agreed to in writing, software 29 | -# distributed under the License is distributed on an AS IS BASIS, 30 | -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 31 | -# See the License for the specific language governing permissions and 32 | -# limitations under the License. 33 | -# 34 | -# 35 | - 36 | -LOCAL_PATH := $(call my-dir) 37 | - 38 | -### pixel_charger_res_images ### 39 | -ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true) 40 | -define _add-product-charger-image 41 | -include $$(CLEAR_VARS) 42 | -LOCAL_MODULE := pixel_charger_res_images_charger_$(notdir $(1)) 43 | -LOCAL_MODULE_STEM := $(notdir $(1)) 44 | -_img_modules += $$(LOCAL_MODULE) 45 | -LOCAL_SRC_FILES := $1 46 | -LOCAL_MODULE_TAGS := optional 47 | -LOCAL_MODULE_CLASS := ETC 48 | -LOCAL_MODULE_PATH := $$(TARGET_OUT_PRODUCT)/etc/res/images/charger 49 | -LOCAL_PRODUCT_MODULE := true 50 | -include $$(BUILD_PREBUILT) 51 | -endef 52 | - 53 | -_img_modules := 54 | -_images := 55 | -$(foreach _img, $(call find-subdir-subdir-files, "images/charger", "*.png"), \ 56 | - $(eval $(call _add-product-charger-image,$(_img)))) 57 | - 58 | -### pixel_charger_animation_file ### 59 | -define _add-product-charger-animation-file 60 | -include $$(CLEAR_VARS) 61 | -LOCAL_MODULE := pixel_charger_res_values_charger_$(notdir $(1)) 62 | -LOCAL_MODULE_STEM := $(notdir $(1)) 63 | -_anim_modules += $$(LOCAL_MODULE) 64 | -LOCAL_SRC_FILES := $1 65 | -LOCAL_MODULE_TAGS := optional 66 | -LOCAL_MODULE_CLASS := ETC 67 | -LOCAL_MODULE_PATH := $$(TARGET_OUT_PRODUCT)/etc/res/values/charger 68 | -LOCAL_PRODUCT_MODULE := true 69 | -include $$(BUILD_PREBUILT) 70 | -endef 71 | - 72 | -_anim_modules := 73 | -$(foreach _txt, $(call find-subdir-subdir-files, "values/charger", "*.txt"), \ 74 | - $(eval $(call _add-product-charger-animation-file,$(_txt)))) 75 | - 76 | -include $(CLEAR_VARS) 77 | -LOCAL_MODULE := product_charger_res_images 78 | -LOCAL_MODULE_TAGS := optional 79 | -LOCAL_REQUIRED_MODULES := $(_img_modules) $(_anim_modules) 80 | -include $(BUILD_PHONY_PACKAGE) 81 | - 82 | -_add-product-charger-image := 83 | -_add-product-charger-animation-file := 84 | -_img_modules := 85 | -_anim_modules := 86 | -endif # LOCAL_CHARGER_NO_UI 87 | -- 88 | 2.34.1 89 | 90 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_vold/04-Add-sdfat-texfat-support.patch: -------------------------------------------------------------------------------- 1 | From 447398be7017e3785e9308dc5a8e5e20dfd1757b Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Mon, 20 Aug 2018 22:37:54 +0200 4 | Subject: [PATCH 1/2] Add Samsung sdfat support 5 | 6 | --- 7 | fs/Exfat.cpp | 9 ++++++--- 8 | 1 file changed, 6 insertions(+), 3 deletions(-) 9 | 10 | diff --git a/fs/Exfat.cpp b/fs/Exfat.cpp 11 | index c8b19e0..7e96af7 100644 12 | --- a/fs/Exfat.cpp 13 | +++ b/fs/Exfat.cpp 14 | @@ -35,7 +35,7 @@ static const char* kFsckPath = "/system/bin/fsck.exfat"; 15 | 16 | bool IsSupported() { 17 | return access(kMkfsPath, X_OK) == 0 && access(kFsckPath, X_OK) == 0 && 18 | - IsFilesystemSupported("exfat"); 19 | + (IsFilesystemSupported("exfat") || IsFilesystemSupported("sdfat")); 20 | } 21 | 22 | status_t Check(const std::string& source) { 23 | @@ -61,13 +61,16 @@ status_t Mount(const std::string& source, const std::string& target, int ownerUi 24 | auto mountData = android::base::StringPrintf("uid=%d,gid=%d,fmask=%o,dmask=%o", ownerUid, 25 | ownerGid, permMask, permMask); 26 | 27 | - if (mount(source.c_str(), target.c_str(), "exfat", mountFlags, mountData.c_str()) == 0) { 28 | + const char *fs = "exfat"; 29 | + if(IsFilesystemSupported("sdfat")) 30 | + fs = "sdfat"; 31 | + if (mount(source.c_str(), target.c_str(), fs, mountFlags, mountData.c_str()) == 0) { 32 | return 0; 33 | } 34 | 35 | PLOG(ERROR) << "Mount failed; attempting read-only"; 36 | mountFlags |= MS_RDONLY; 37 | - if (mount(source.c_str(), target.c_str(), "exfat", mountFlags, mountData.c_str()) == 0) { 38 | + if (mount(source.c_str(), target.c_str(), fs, mountFlags, mountData.c_str()) == 0) { 39 | return 0; 40 | } 41 | 42 | -- 43 | 2.34.1 44 | 45 | 46 | From 497e9b685965ec545926958393c5475401bd537a Mon Sep 17 00:00:00 2001 47 | From: Pierre-Hugues Husson 48 | Date: Tue, 28 Jan 2020 00:27:17 +0100 49 | Subject: [PATCH 2/2] Add Sony texfat support 50 | 51 | --- 52 | fs/Exfat.cpp | 8 +++++++- 53 | 1 file changed, 7 insertions(+), 1 deletion(-) 54 | 55 | diff --git a/fs/Exfat.cpp b/fs/Exfat.cpp 56 | index 7e96af7..7d3d23c 100644 57 | --- a/fs/Exfat.cpp 58 | +++ b/fs/Exfat.cpp 59 | @@ -35,7 +35,11 @@ static const char* kFsckPath = "/system/bin/fsck.exfat"; 60 | 61 | bool IsSupported() { 62 | return access(kMkfsPath, X_OK) == 0 && access(kFsckPath, X_OK) == 0 && 63 | - (IsFilesystemSupported("exfat") || IsFilesystemSupported("sdfat")); 64 | + ( 65 | + IsFilesystemSupported("exfat") || 66 | + IsFilesystemSupported("sdfat") || 67 | + IsFilesystemSupported("texfat") 68 | + ); 69 | } 70 | 71 | status_t Check(const std::string& source) { 72 | @@ -64,6 +68,8 @@ status_t Mount(const std::string& source, const std::string& target, int ownerUi 73 | const char *fs = "exfat"; 74 | if(IsFilesystemSupported("sdfat")) 75 | fs = "sdfat"; 76 | + if(IsFilesystemSupported("texfat")) 77 | + fs = "texfat"; 78 | if (mount(source.c_str(), target.c_str(), fs, mountFlags, mountData.c_str()) == 0) { 79 | return 0; 80 | } 81 | -- 82 | 2.34.1 83 | 84 | -------------------------------------------------------------------------------- /patches/personal/platform_frameworks_base/03-Make-rounded-corners-padding-overridable.patch: -------------------------------------------------------------------------------- 1 | From 3f17fe66c227e1a96c6d8eee3ea9265d4ddee3b5 Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Thu, 10 Aug 2023 01:45:58 +0000 4 | Subject: [PATCH] Make corners padding overridable with persist.sys.phh.rounded_corners_padding 5 | 6 | --- 7 | .../src/com/android/systemui/shade/ShadeHeaderController.kt | 5 ++++- 8 | .../statusbar/phone/StatusBarContentInsetsProvider.kt | 5 ++++- 9 | 2 files changed, 8 insertions(+), 2 deletions(-) 10 | 11 | diff --git a/packages/SystemUI/src/com/android/systemui/shade/ShadeHeaderController.kt b/packages/SystemUI/src/com/android/systemui/shade/ShadeHeaderController.kt 12 | index 8617c561dc68..17c3def37e78 100644 13 | --- a/packages/SystemUI/src/com/android/systemui/shade/ShadeHeaderController.kt 14 | +++ b/packages/SystemUI/src/com/android/systemui/shade/ShadeHeaderController.kt 15 | @@ -29,6 +29,7 @@ import android.content.ContentUris 16 | import android.icu.util.Calendar 17 | import android.net.Uri 18 | import android.os.Bundle 19 | +import android.os.SystemProperties 20 | import android.os.Trace 21 | import android.os.Trace.TRACE_TAG_APP 22 | import android.provider.AlarmClock 23 | @@ -504,7 +505,9 @@ constructor( 24 | } 25 | 26 | private fun updateResources() { 27 | - roundedCorners = resources.getDimensionPixelSize(R.dimen.rounded_corner_content_padding) 28 | + roundedCorners = SystemProperties.getInt("persist.sys.phh.rounded_corners_padding", -1); 29 | + if(roundedCorners == -1) 30 | + roundedCorners = resources.getDimensionPixelSize(R.dimen.rounded_corner_content_padding) 31 | val padding = resources.getDimensionPixelSize(R.dimen.qs_panel_padding) 32 | header.setPadding(padding, header.paddingTop, padding, header.paddingBottom) 33 | updateQQSPaddings() 34 | diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarContentInsetsProvider.kt b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarContentInsetsProvider.kt 35 | index c850d4f9c56b..4ee02eea4b9e 100644 36 | --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarContentInsetsProvider.kt 37 | +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarContentInsetsProvider.kt 38 | @@ -20,6 +20,7 @@ import android.content.Context 39 | import android.content.res.Resources 40 | import android.graphics.Point 41 | import android.graphics.Rect 42 | +import android.os.SystemProperties; 43 | import android.util.LruCache 44 | import android.util.Pair 45 | import android.view.DisplayCutout 46 | @@ -231,7 +232,9 @@ class StatusBarContentInsetsProvider @Inject constructor( 47 | ): Rect { 48 | val currentRotation = getExactRotation(context) 49 | 50 | - val roundedCornerPadding = rotatedResources 51 | + var roundedCornerPadding = SystemProperties.getInt("persist.sys.phh.rounded_corners_padding", -1); 52 | + if(roundedCornerPadding == -1) 53 | + roundedCornerPadding = rotatedResources 54 | .getDimensionPixelSize(R.dimen.rounded_corner_content_padding) 55 | val minDotPadding = if (isPrivacyDotEnabled) 56 | rotatedResources.getDimensionPixelSize(R.dimen.ongoing_appops_dot_min_padding) 57 | -- 58 | 2.34.1 59 | 60 | --------------------------------------------------------------------------------