Changes for July 2024, syncing up to 20240721

This commit is contained in:
Andy CrossGate Yan
2024-07-21 17:19:43 +08:00
parent 3963eaa06e
commit bcc6abe459
240 changed files with 3746 additions and 2018 deletions

View File

@@ -1,7 +1,7 @@
From e50480813b4a96cb3f3105dc5b1ccb7e5928ac68 Mon Sep 17 00:00:00 2001
From 7b512450f9a8b4d65bda3daccd5d76b6d86722d3 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sun, 8 Aug 2021 01:43:40 +0000
Subject: [PATCH 1/9] treble: Lineage-ify
Subject: [PATCH 1/7] treble: Lineage-ify
Squash of:
- Proper target names
@@ -31,7 +31,7 @@ Change-Id: I25eee7a3804f335430a447ae1424402d7e37851b
create mode 100644 overlay-lineage/lineage-sdk/lineage/res/res/values/config.xml
diff --git a/base.mk b/base.mk
index 22525cd..e40af53 100644
index 43e261b..1c2fe3d 100644
--- a/base.mk
+++ b/base.mk
@@ -18,7 +18,13 @@ PRODUCT_COPY_FILES += \

View File

@@ -1,7 +1,7 @@
From 50987c84d728f49fc04c78e4a935231caaf6317f Mon Sep 17 00:00:00 2001
From ca0a29e2a10704398ef98db53ea472c70e6d2df5 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sun, 8 Aug 2021 09:29:32 +0000
Subject: [PATCH 2/9] treble: Set BOARD_EXT4_SHARE_DUP_BLOCKS explicitly
Subject: [PATCH 2/7] treble: Set BOARD_EXT4_SHARE_DUP_BLOCKS explicitly
Change-Id: I725443154fabde548d2e6c1b072d34c27596c421
---

View File

@@ -1,7 +1,7 @@
From aece8f5deb59a054729539eef6957bd5db325bb5 Mon Sep 17 00:00:00 2001
From 8bfd515e29aa6998c95326afcd7b9212bc50e855 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Wed, 20 Oct 2021 11:30:25 +0000
Subject: [PATCH 3/9] treble: Set TARGET_NO_KERNEL_OVERRIDE
Subject: [PATCH 3/7] treble: Set TARGET_NO_KERNEL_OVERRIDE
Taken from Lineage generic targets - skips building kernel cleanly

View File

@@ -1,7 +1,7 @@
From 29d58c7756130f41aaa10d457cef3806792b5d13 Mon Sep 17 00:00:00 2001
From 2171319d09fd6681683c2fbb8841ff00589e826c Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Tue, 11 Oct 2022 11:29:02 +0000
Subject: [PATCH 4/9] treble: Enable call recording
Subject: [PATCH 4/7] treble: Enable call recording
Change-Id: I57ca3604363547419a566b37b5151b6b30c46d28
---

View File

@@ -1,7 +1,7 @@
From 1a5f992428f38427b3d3e25984bc0b425ff6d4f1 Mon Sep 17 00:00:00 2001
From 2f8779cb2631ddff20e81d56b4a1a7c0ec46fb19 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sat, 5 Nov 2022 23:49:11 +0000
Subject: [PATCH 5/9] treble: Switch to MindTheGapps
Subject: [PATCH 5/7] treble: Switch to MindTheGapps
Change-Id: I1b80d4c5176cbf4af21d147c71b0abce6027c7c7
---

View File

@@ -1,7 +1,7 @@
From 4f32c09f61ab0c69b3768257764d1257e812839e Mon Sep 17 00:00:00 2001
From 4b55f0e5ab9d96991820576f9c15e47168ce829a Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sat, 15 Jul 2023 17:01:27 +0800
Subject: [PATCH 9/9] treble: Import prebuilt PHH Superuser
Subject: [PATCH 6/7] treble: Import prebuilt PHH Superuser
Change-Id: I9655d706ef3e1f32d0584a68384823db895e0283
---

View File

@@ -1,35 +0,0 @@
From d0c31b8531c239d6c550ed14690496fa9d6b13d2 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Tue, 22 Nov 2022 00:36:15 +0000
Subject: [PATCH 6/9] treble: Stop securing ADB
Seems to kill USB Debugging altogether on certain devices,
and unrelated to SN anyway
Build-time macro coupled with vendor/lineage might do better...
Change-Id: I0215b3ed970dd53a124f48e30ca2cf4b0c6d2899
---
rw-system.sh | 3 ---
1 file changed, 3 deletions(-)
diff --git a/rw-system.sh b/rw-system.sh
index 968b903..4dd61f3 100644
--- a/rw-system.sh
+++ b/rw-system.sh
@@ -804,13 +804,10 @@ if [ -f /system/phh/secure ] || [ -f /metadata/phh/secure ];then
resetprop_phh ro.boot.veritymode enforcing
resetprop_phh ro.boot.warranty_bit 0
resetprop_phh ro.warranty_bit 0
- resetprop_phh ro.debuggable 0
resetprop_phh ro.secure 1
resetprop_phh ro.build.type user
resetprop_phh --delete ro.build.selinux
- resetprop_phh ro.adb.secure 1
-
# Hide system/xbin/su
mount /mnt/phh/empty_dir /system/xbin
mount /mnt/phh/empty_dir /system/app/me.phh.superuser
--
2.34.1

View File

@@ -0,0 +1,166 @@
From 6049d780bfdddc2d11a0b3f1bca6b6de6a761ed5 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Mon, 15 Jul 2024 22:30:54 +0800
Subject: [PATCH 7/7] treble: Remove Securize (1/2)
Leave this Play Integrity mess to the professionals
Change-Id: Ic4ef0512d8b555b85e7497464a07913101fcc819
---
base.mk | 1 -
files/ota.sh | 3 ---
phh-securize.sh | 38 -----------------------------
rw-system.sh | 63 ++++++-------------------------------------------
4 files changed, 7 insertions(+), 98 deletions(-)
delete mode 100644 phh-securize.sh
diff --git a/base.mk b/base.mk
index 1c2fe3d..dea8d2d 100644
--- a/base.mk
+++ b/base.mk
@@ -178,7 +178,6 @@ PRODUCT_PACKAGES += \
resetprop_phh
PRODUCT_COPY_FILES += \
- device/phh/treble/phh-securize.sh:system/bin/phh-securize.sh \
device/phh/treble/files/ota.sh:system/bin/ota.sh \
PRODUCT_COPY_FILES += \
diff --git a/files/ota.sh b/files/ota.sh
index a43ce81..78fea95 100644
--- a/files/ota.sh
+++ b/files/ota.sh
@@ -8,9 +8,6 @@ if ! [ "$(getprop ro.boot.dynamic_partitions)" = true ];then
fi
flavor=$(getprop ro.product.product.name)
-if [ -f /system/phh/secure ];then
- flavor=${flavor}-secure
-fi
nextVersion=$(curl --silent -L https://raw.githubusercontent.com/phhusson/treble_experimentations/master/ota/squeak/$flavor/date)
if [ -z "$nextVersion" ];then
echo "Couldn't find any OTA for $flavor"
diff --git a/phh-securize.sh b/phh-securize.sh
deleted file mode 100644
index 80b46d7..0000000
--- a/phh-securize.sh
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/system/bin/sh
-
-if [ -e /system/bin/magisk ]
-then
- # remove bind-mount of phh-su overriding /system/bin/su -> ./magisk
- umount -l /system/bin/magisk
- # we need to modify the real system partition
- MAGISK_MIRROR="$(magisk --path)/.magisk/mirror"
- SYSTEM=$MAGISK_MIRROR/system
- MOUNTPOINT_LIST="$MAGISK_MIRROR/system_root $MAGISK_MIRROR/system"
-else
- SYSTEM=/system
- MOUNTPOINT_LIST="/system /"
-fi
-
-# remove bind-mount of phh-su (preventing $SYSTEM/xbin/su to be removed)
-umount -l /system/xbin/su
-
-for MOUNTPOINT in $MOUNTPOINT_LIST
-do
- [ -d $MOUNTPOINT ] && mountpoint -q $MOUNTPOINT && break
-done
-
-mount -o remount,rw $MOUNTPOINT
-remount
-
-touch $SYSTEM/phh/secure
-rm $SYSTEM/xbin/su
-rm $SYSTEM/bin/phh-su
-rm $SYSTEM/etc/init/su.rc
-rm $SYSTEM/bin/phh-securize.sh
-rm -Rf $SYSTEM/{app,priv-app}/me.phh.superuser/
-rm -Rf /data/su || true
-mount -o remount,ro $MOUNTPOINT
-sync
-mkdir /metadata/phh
-touch /metadata/phh/secure
-reboot
diff --git a/rw-system.sh b/rw-system.sh
index 3ddfdda..7546fae 100644
--- a/rw-system.sh
+++ b/rw-system.sh
@@ -779,65 +779,16 @@ copyprop() {
resetprop_phh "$1" "$(getprop "$2")"
fi
}
-if [ -f /system/phh/secure ] || [ -f /metadata/phh/secure ];then
- copyprop ro.build.device ro.vendor.build.device
- copyprop ro.system.build.fingerprint ro.vendor.build.fingerprint
- copyprop ro.bootimage.build.fingerprint ro.vendor.build.fingerprint
- copyprop ro.build.fingerprint ro.vendor.build.fingerprint
- copyprop ro.build.device ro.vendor.product.device
- copyprop ro.product.system.device ro.vendor.product.device
- copyprop ro.product.device ro.vendor.product.device
- copyprop ro.product.system.device ro.product.vendor.device
- copyprop ro.product.device ro.product.vendor.device
- copyprop ro.product.system.name ro.vendor.product.name
- copyprop ro.product.name ro.vendor.product.name
- copyprop ro.product.system.name ro.product.vendor.device
- copyprop ro.product.name ro.product.vendor.device
- copyprop ro.system.product.brand ro.vendor.product.brand
- copyprop ro.product.brand ro.vendor.product.brand
- copyprop ro.product.system.model ro.vendor.product.model
- copyprop ro.product.model ro.vendor.product.model
- copyprop ro.product.system.model ro.product.vendor.model
- copyprop ro.product.model ro.product.vendor.model
- copyprop ro.build.product ro.vendor.product.model
- copyprop ro.build.product ro.product.vendor.model
- copyprop ro.system.product.manufacturer ro.vendor.product.manufacturer
- copyprop ro.product.manufacturer ro.vendor.product.manufacturer
- copyprop ro.system.product.manufacturer ro.product.vendor.manufacturer
- copyprop ro.product.manufacturer ro.product.vendor.manufacturer
- (getprop ro.vendor.build.security_patch; getprop ro.keymaster.xxx.security_patch) |sort |tail -n 1 |while read v;do
- [ -n "$v" ] && resetprop_phh ro.build.version.security_patch "$v"
- done
- resetprop_phh ro.build.tags release-keys
- resetprop_phh ro.boot.vbmeta.device_state locked
- resetprop_phh ro.boot.verifiedbootstate green
- resetprop_phh ro.boot.flash.locked 1
- resetprop_phh ro.boot.veritymode enforcing
- resetprop_phh ro.boot.warranty_bit 0
- resetprop_phh ro.warranty_bit 0
- resetprop_phh ro.debuggable 0
- resetprop_phh ro.secure 1
- resetprop_phh ro.build.type user
- resetprop_phh --delete ro.build.selinux
-
- resetprop_phh ro.adb.secure 1
-
- # Hide system/xbin/su
- mount /mnt/phh/empty_dir /system/xbin
- mount /mnt/phh/empty_dir /system/app/me.phh.superuser
- mount /system/phh/empty /system/xbin/phh-su
-else
- mkdir /mnt/phh/xbin
- chmod 0755 /mnt/phh/xbin
- chcon u:object_r:system_file:s0 /mnt/phh/xbin
+mkdir /mnt/phh/xbin
+chmod 0755 /mnt/phh/xbin
+chcon u:object_r:system_file:s0 /mnt/phh/xbin
- #phh-su will bind over this empty file to make a real su
- touch /mnt/phh/xbin/su
- chcon u:object_r:system_file:s0 /mnt/phh/xbin/su
+#phh-su will bind over this empty file to make a real su
+touch /mnt/phh/xbin/su
+chcon u:object_r:system_file:s0 /mnt/phh/xbin/su
- mount -o bind /mnt/phh/xbin /system/xbin
-fi
+mount -o bind /mnt/phh/xbin /system/xbin
for abi in "" 64;do
f=/vendor/lib$abi/libstagefright_foundation.so
--
2.34.1

View File

@@ -1,49 +0,0 @@
From 77488a9ec7f97c5b658cd6224b0ef147ef9752cd Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Thu, 29 Dec 2022 15:12:03 +0000
Subject: [PATCH 7/9] treble: Securize on-demand
Status is stored in /metadata and controlled by persist prop
Change-Id: I8069b6f471ad87ab34c18b743689ab3584cee35b
---
phh-prop-handler.sh | 14 ++++++++++++++
vndk.rc | 3 +++
2 files changed, 17 insertions(+)
diff --git a/phh-prop-handler.sh b/phh-prop-handler.sh
index e187466..fe857b7 100644
--- a/phh-prop-handler.sh
+++ b/phh-prop-handler.sh
@@ -281,3 +281,17 @@ if [ "$1" == "persist.bluetooth.system_audio_hal.enabled" ]; then
restartAudio
exit
fi
+
+if [ "$1" == "persist.sys.phh.securize" ];then
+ if [[ "$prop_value" != "true" && "$prop_value" != "false" ]]; then
+ exit 1
+ fi
+
+ if [[ "$prop_value" == "true" ]]; then
+ mkdir /metadata/phh
+ touch /metadata/phh/secure
+ else
+ rm /metadata/phh/secure
+ fi
+ exit
+fi
diff --git a/vndk.rc b/vndk.rc
index 9f74ffd..dfcfcfe 100644
--- a/vndk.rc
+++ b/vndk.rc
@@ -112,3 +112,6 @@ service watchdogd-gsi /system/bin/watchdogd 10 20
# Fix for non-AMOLED Transsion devices where brightness would be dimmer than usual
on property:ro.vendor.transsion.backlight_12bit=*
setprop ro.vendor.transsion.backlight_hal.optimization ${ro.vendor.transsion.backlight_12bit}
+
+on property:persist.sys.phh.securize=*
+ exec u:r:phhsu_daemon:s0 root -- /system/bin/phh-prop-handler.sh "persist.sys.phh.securize"
--
2.34.1

View File

@@ -1,46 +0,0 @@
From 74ec0afa2767a82f22e16d8499ef1a48ffa34f1c Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Wed, 22 Mar 2023 23:37:05 +0000
Subject: [PATCH 8/9] treble: Also use /data/adb for securize status
Change-Id: I778f2be5407ae0a548a098c72031cce9be83cf96
---
phh-prop-handler.sh | 5 ++++-
rw-system.sh | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/phh-prop-handler.sh b/phh-prop-handler.sh
index fe857b7..c21438c 100644
--- a/phh-prop-handler.sh
+++ b/phh-prop-handler.sh
@@ -288,10 +288,13 @@ if [ "$1" == "persist.sys.phh.securize" ];then
fi
if [[ "$prop_value" == "true" ]]; then
- mkdir /metadata/phh
+ mkdir -p /metadata/phh
touch /metadata/phh/secure
+ mkdir -p /data/adb/phh
+ touch /data/adb/phh/secure
else
rm /metadata/phh/secure
+ rm /data/adb/phh/secure
fi
exit
fi
diff --git a/rw-system.sh b/rw-system.sh
index 4dd61f3..2817795 100644
--- a/rw-system.sh
+++ b/rw-system.sh
@@ -767,7 +767,7 @@ copyprop() {
resetprop_phh "$1" "$(getprop "$2")"
fi
}
-if [ -f /system/phh/secure ] || [ -f /metadata/phh/secure ];then
+if [ -f /system/phh/secure ] || [ -f /metadata/phh/secure ] || [ -f /data/adb/phh/secure ];then
copyprop ro.build.device ro.vendor.build.device
copyprop ro.system.build.fingerprint ro.vendor.build.fingerprint
copyprop ro.bootimage.build.fingerprint ro.vendor.build.fingerprint
--
2.34.1

View File

@@ -1,4 +1,4 @@
From 7b5af6750bdcfd107e607906b886a3034d52cb53 Mon Sep 17 00:00:00 2001
From 82927d1019eddeb325ea689cdf493717eab7bb49 Mon Sep 17 00:00:00 2001
From: Victor Bo <bvoid@yandex.ru>
Date: Wed, 3 Mar 2021 06:31:17 -0500
Subject: [PATCH] Restore /sbin for Magisk compatibility
@@ -58,7 +58,7 @@ index 9ab7f4305..c45317d0f 100644
{ 00755, AID_ROOT, AID_SHELL, 0, "system/bin/*" },
{ 00755, AID_ROOT, AID_SHELL, 0, "system/xbin/*" },
diff --git a/rootdir/Android.mk b/rootdir/Android.mk
index 7deb17324..aeeaad496 100644
index 7444f963f..b74887c43 100644
--- a/rootdir/Android.mk
+++ b/rootdir/Android.mk
@@ -96,7 +96,7 @@ endif
@@ -67,7 +67,7 @@ index 7deb17324..aeeaad496 100644
LOCAL_POST_INSTALL_CMD := mkdir -p $(addprefix $(TARGET_ROOT_OUT)/, \
- dev proc sys system data data_mirror odm oem acct config storage mnt apex bootstrap-apex debug_ramdisk \
+ sbin dev proc sys system data data_mirror odm oem acct config storage mnt apex bootstrap-apex debug_ramdisk \
linkerconfig second_stage_resources postinstall $(BOARD_ROOT_EXTRA_FOLDERS)); \
linkerconfig second_stage_resources postinstall tmp $(BOARD_ROOT_EXTRA_FOLDERS)); \
ln -sf /system/bin $(TARGET_ROOT_OUT)/bin; \
ln -sf /system/etc $(TARGET_ROOT_OUT)/etc; \
diff --git a/rootdir/init.environ.rc.in b/rootdir/init.environ.rc.in

View File

@@ -1,42 +1,29 @@
From 66534cd4c678494e0aa0e74197a39fcee57e313a Mon Sep 17 00:00:00 2001
From 5de486b70139a2dc66c38b0be6df5396b74391fc Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Thu, 29 Dec 2022 15:08:49 +0000
Subject: [PATCH] Simplify Securize to CheckBoxPreference and persist prop
Date: Mon, 15 Jul 2024 22:14:09 +0800
Subject: [PATCH] Remove Securize (2/2)
For "Securize on-demand"
Leave this Play Integrity mess to the professionals
Change-Id: I36abaea9714ccdd5680be88e771143eee2a170cd
---
app/src/main/java/me/phh/treble/app/Misc.kt | 5 +++
.../java/me/phh/treble/app/MiscSettings.kt | 33 -------------------
app/src/main/res/xml/pref_misc.xml | 7 ++--
3 files changed, 10 insertions(+), 35 deletions(-)
.../java/me/phh/treble/app/MiscSettings.kt | 34 -------------------
app/src/main/res/xml/pref_misc.xml | 6 ++--
2 files changed, 4 insertions(+), 36 deletions(-)
diff --git a/app/src/main/java/me/phh/treble/app/Misc.kt b/app/src/main/java/me/phh/treble/app/Misc.kt
index a56b460..8861d51 100644
--- a/app/src/main/java/me/phh/treble/app/Misc.kt
+++ b/app/src/main/java/me/phh/treble/app/Misc.kt
@@ -302,6 +302,10 @@ object Misc: EntryStartup {
val value = sp.getString(key, "0")
SystemProperties.set("persist.sys.bt.esco_transport_unit_size", value)
}
+ MiscSettings.securize -> {
+ val value = sp.getBoolean(key, false)
+ SystemProperties.set("persist.sys.phh.securize", if (value) "true" else "false")
+ }
}
}
@@ -328,5 +332,6 @@ object Misc: EntryStartup {
spListener.onSharedPreferenceChanged(sp, MiscSettings.noHwcomposer)
spListener.onSharedPreferenceChanged(sp, MiscSettings.storageFUSE)
spListener.onSharedPreferenceChanged(sp, MiscSettings.dt2w)
+ spListener.onSharedPreferenceChanged(sp, MiscSettings.securize)
}
}
diff --git a/app/src/main/java/me/phh/treble/app/MiscSettings.kt b/app/src/main/java/me/phh/treble/app/MiscSettings.kt
index e3b5312..5fe481f 100644
index 78556be..661abb2 100644
--- a/app/src/main/java/me/phh/treble/app/MiscSettings.kt
+++ b/app/src/main/java/me/phh/treble/app/MiscSettings.kt
@@ -56,39 +56,6 @@ class MiscSettingsFragment : SettingsFragment() {
@@ -21,7 +21,6 @@ object MiscSettings : Settings {
val disableButtonsBacklight = "key_misc_disable_buttons_backlight"
val forceNavbarOff = "key_misc_force_navbar_off"
val bluetooth = "key_misc_bluetooth"
- val securize = "key_misc_securize"
val removeTelephony = "key_misc_removetelephony"
val remotectl = "key_misc_remotectl"
val disableAudioEffects = "key_misc_disable_audio_effects"
@@ -58,39 +57,6 @@ class MiscSettingsFragment : SettingsFragment() {
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
super.onCreatePreferences(savedInstanceState, rootKey)
@@ -77,20 +64,19 @@ index e3b5312..5fe481f 100644
removeTelephonyPref!!.setOnPreferenceClickListener {
diff --git a/app/src/main/res/xml/pref_misc.xml b/app/src/main/res/xml/pref_misc.xml
index e41659d..bdf1147 100644
index dbd8b88..0e8706d 100644
--- a/app/src/main/res/xml/pref_misc.xml
+++ b/app/src/main/res/xml/pref_misc.xml
@@ -193,8 +193,11 @@
@@ -203,8 +203,10 @@
android:entryValues="@array/pref_misc_fod_color_values"
android:key="key_misc_fod_color"
android:title="Under-display fp color" />
- <Preference android:title="Securize"
- android:key="key_misc_securize" />
+ <CheckBoxPreference
+ android:defaultValue="false"
+ android:key="key_misc_securize"
+ android:title="Spoof system properties"
+ android:summary="For better chances of passing SafetyNet\nMight cause bootloop on some devices" />
+ <Preference
+ android:enabled="false"
+ android:title="Securize"
+ android:summary="Unsupported - please try other methods\n(e.g. PlayIntegrityFix module)" />
</PreferenceCategory>
<PreferenceCategory android:title="Debugging">
<Preference android:title="Debug Sensors">