Initial unified commit for Android 14, with TrebleDroid GSI target, syncing up to 20240208

This commit is contained in:
Andy CrossGate Yan
2024-02-17 16:46:38 +08:00
commit e9902a4450
281 changed files with 169698 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,23 @@
From ae62c13bca7549786b4705d4fb7913ccceb6917e 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
Change-Id: I725443154fabde548d2e6c1b072d34c27596c421
---
board-base.mk | 2 ++
1 file changed, 2 insertions(+)
diff --git a/board-base.mk b/board-base.mk
index 2cb5dbc..e493d1c 100644
--- a/board-base.mk
+++ b/board-base.mk
@@ -10,3 +10,5 @@ BOARD_ROOT_EXTRA_FOLDERS += bt_firmware sec_storage efs persist
BUILD_BROKEN_ELF_PREBUILT_PRODUCT_COPY_FILES := true
BOARD_ROOT_EXTRA_SYMLINKS := $(filter-out $(BOARD_ROOT_EXTRA_SYMLINKS),/mnt/vendor/persist:/persist)
+
+BOARD_EXT4_SHARE_DUP_BLOCKS := true
--
2.34.1

View File

@@ -0,0 +1,25 @@
From bb54a87ee1d14bd80308129c1ab38ad042d807a2 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
Taken from Lineage generic targets - skips building kernel cleanly
Change-Id: Id71d3a3aed56fd4e815a64ef4191b125fc5026ce
---
board-base.mk | 2 ++
1 file changed, 2 insertions(+)
diff --git a/board-base.mk b/board-base.mk
index e493d1c..9d1d45e 100644
--- a/board-base.mk
+++ b/board-base.mk
@@ -12,3 +12,5 @@ BUILD_BROKEN_ELF_PREBUILT_PRODUCT_COPY_FILES := true
BOARD_ROOT_EXTRA_SYMLINKS := $(filter-out $(BOARD_ROOT_EXTRA_SYMLINKS),/mnt/vendor/persist:/persist)
BOARD_EXT4_SHARE_DUP_BLOCKS := true
+
+TARGET_NO_KERNEL_OVERRIDE := true
--
2.34.1

View File

@@ -0,0 +1,40 @@
From c4cf51f21f0b23e57fd4eb49cce0056f459ebc65 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
Change-Id: I57ca3604363547419a566b37b5151b6b30c46d28
---
.../dialer/callrecord/res/values/config.xml | 20 +++++++++++++++++++
1 file changed, 20 insertions(+)
create mode 100644 overlay-lineage/packages/apps/Dialer/java/com/android/dialer/callrecord/res/values/config.xml
diff --git a/overlay-lineage/packages/apps/Dialer/java/com/android/dialer/callrecord/res/values/config.xml b/overlay-lineage/packages/apps/Dialer/java/com/android/dialer/callrecord/res/values/config.xml
new file mode 100644
index 0000000..4cacde5
--- /dev/null
+++ b/overlay-lineage/packages/apps/Dialer/java/com/android/dialer/callrecord/res/values/config.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2021 The LineageOS Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<resources>
+ <bool name="call_recording_enabled">true</bool>
+ <integer name="call_recording_audio_source">4</integer>
+</resources>
--
2.34.1

View File

@@ -0,0 +1,46 @@
From 7295a2f4cd712111205bcbc356e468f2a8ad01fd 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
Change-Id: I1b80d4c5176cbf4af21d147c71b0abce6027c7c7
---
generate.sh | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/generate.sh b/generate.sh
index 3527159..0bd6556 100644
--- a/generate.sh
+++ b/generate.sh
@@ -24,9 +24,15 @@ for part in a ab;do
extra_packages=""
vndk="vndk.mk"
optional_base=""
+
+ baseArch="$arch"
+ if [ "$arch" = "a64" ];then
+ baseArch="arm"
+ fi
+
if [ "$apps" == "gapps" ];then
apps_suffix="g"
- apps_script='$(call inherit-product, device/phh/treble/gapps.mk)'
+ apps_script='$(call inherit-product, vendor/gapps/'$baseArch'/'$baseArch'-vendor.mk)'
apps_name="with GApps"
fi
if [ "$apps" == "gapps-go" ];then
@@ -66,11 +72,6 @@ for part in a ab;do
target="lineage_${arch}_${part_suffix}${apps_suffix}${su_suffix}"
- baseArch="$arch"
- if [ "$arch" = "a64" ];then
- baseArch="arm"
- fi
-
zygote=32
if [ "$arch" = "arm64" ];then
zygote=64_32
--
2.34.1

View File

@@ -0,0 +1,35 @@
From 86cd9fa8131d6a7534b7ee7944e7ac177d032442 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 358f232..e631b64 100644
--- a/rw-system.sh
+++ b/rw-system.sh
@@ -793,13 +793,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 ro.build.selinux 0
- 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,49 @@
From 211c16eca1949b5813b7e4d65eaa0fa8cdeb2b01 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 aea5bb0..0020d21 100644
--- a/phh-prop-handler.sh
+++ b/phh-prop-handler.sh
@@ -279,3 +279,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 3029abf..d75bc9e 100644
--- a/vndk.rc
+++ b/vndk.rc
@@ -102,3 +102,6 @@ service watchdogd-gsi /system/bin/watchdogd 10 20
class core
oneshot
seclabel u:r:watchdogd:s0
+
+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

@@ -0,0 +1,46 @@
From 985159eedef9f48dececcef108b9bee809adef3b 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 0020d21..750f1eb 100644
--- a/phh-prop-handler.sh
+++ b/phh-prop-handler.sh
@@ -286,10 +286,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 e631b64..c5df982 100644
--- a/rw-system.sh
+++ b/rw-system.sh
@@ -756,7 +756,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

File diff suppressed because it is too large Load Diff