Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Commit

Permalink
android_14.0.0.0_r50 rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
MisterZtr committed Jun 30, 2024
1 parent d2148d6 commit a6eccf1
Show file tree
Hide file tree
Showing 200 changed files with 3,012 additions and 1,577 deletions.
18 changes: 15 additions & 3 deletions README-RU.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,27 @@ repo init -u https://github.com/PixelOS-AOSP/manifest.git -b fourteen --git-lfs
git clone https://github.com/MisterZtr/treble_manifest.git .repo/local_manifests -b 14



### После этого синхронизируйте исходный код, выполнив эту команду:

```bash
repo sync --force-sync --optimized-fetch --no-tags --no-clone-bundle --prune -j$(nproc --all)
```


### После синхронизации примените патчи:
### После синхронизации исходного кода, сгенерируйте приватные ключи для подписывания сборки:

```bash
subject='/C=US/ST=State/L=City/O=Android/OU=Android/CN=Android/[email protected]'
for x in releasekey platform shared media networkstack verity otakey testkey sdk_sandbox bluetooth nfc; do \
./development/tools/make_key vendor/aosp/signing/keys/$x "$subject"; \
done
```
Где:

C: Код страны (например., RU) ST: Название региона L: Название города O: Название организации OU: Имя сотрудника организации CN: Общее имя emailAddress: Ваш адресс электронной почты


### Далее примените патчи:

Скопируйте папку patches в папку c прошивкой, а далее

Expand Down Expand Up @@ -67,7 +79,7 @@ export CCACHE_MAXSIZE=50G # 50 GB
```
. build/envsetup.sh
ccache -M 50G -F 0
lunch treble_arm64_bN-ap1a-userdebug
lunch treble_arm64_bN-ap2a-userdebug
make systemimage -j$(nproc --all)
```

Expand Down
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,20 @@ repo init -u https://github.com/PixelOS-AOSP/manifest.git -b fourteen --git-lfs
repo sync --force-sync --optimized-fetch --no-tags --no-clone-bundle --prune -j$(nproc --all)
```

### After synchronizing the source code, generate private keys to sign the build:

### After syncing, apply the patches:
```bash
subject='/C=US/ST=State/L=City/O=Android/OU=Android/CN=Android/[email protected]'
for x in releasekey platform shared media networkstack verity otakey testkey sdk_sandbox bluetooth nfc; do \
./development/tools/make_key vendor/aosp/signing/keys/$x "$subject"; \
done
```
Where:

C: Country code (e.g., US) ST: State name L: City name O: Organization name OU: Organizational Unit name CN: Common name emailAddress: Your email address


### Next, apply patches:

Copy the patches folder to rom folder and in rom folder

Expand Down Expand Up @@ -67,7 +79,7 @@ In rom folder,
```
. build/envsetup.sh
ccache -M 50G -F 0
lunch treble_arm64_bN-ap1a-userdebug
lunch treble_arm64_bN-ap2a-userdebug
make systemimage -j$(nproc --all)
```

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
From c0724aca39c9e50864d73d405c8bec8de757efbb Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <[email protected]>
Date: Wed, 27 Oct 2021 14:39:29 -0400
Subject: [PATCH 1/2] Disable vndklite handling

Change-Id: Ic4474cf80fc4b45a9a2760dd51e2ca29c4d961e2
---
linker/linker.cpp | 5 -----
1 file changed, 5 deletions(-)

diff --git a/linker/linker.cpp b/linker/linker.cpp
index b0caeddc1..3e0e7fecf 100644
--- a/linker/linker.cpp
+++ b/linker/linker.cpp
@@ -97,7 +97,6 @@ static uint64_t g_module_unload_counter = 0;
static const char* const kLdConfigArchFilePath = "/system/etc/ld.config." ABI_STRING ".txt";

static const char* const kLdConfigFilePath = "/system/etc/ld.config.txt";
-static const char* const kLdConfigVndkLiteFilePath = "/system/etc/ld.config.vndk_lite.txt";

static const char* const kLdGeneratedConfigFilePath = "/linkerconfig/ld.config.txt";

@@ -3463,10 +3462,6 @@ static std::string get_ld_config_file_apex_path(const char* executable_path) {
}

static std::string get_ld_config_file_vndk_path() {
- if (android::base::GetBoolProperty("ro.vndk.lite", false)) {
- return kLdConfigVndkLiteFilePath;
- }
-
std::string ld_config_file_vndk = kLdConfigFilePath;
size_t insert_pos = ld_config_file_vndk.find_last_of('.');
if (insert_pos == std::string::npos) {
--
2.34.1

Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
From c89be47b786aa45ad3fbd9ba1ac201e43c6070ec Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <[email protected]>
Date: Sat, 19 Feb 2022 08:20:25 -0500
Subject: [PATCH 2/2] Add new mechanism to fake vendor props on a per-process
basis

This reads debug.phh.props.<process name>. If its value is "vendor",
then ro.product.device/ro.product.manufacturer is read from vendor
---
libc/system_properties/system_properties.cpp | 87 +++++++++++++++++++-
1 file changed, 85 insertions(+), 2 deletions(-)

diff --git a/libc/system_properties/system_properties.cpp b/libc/system_properties/system_properties.cpp
index 701a31d06..02c60e600 100644
--- a/libc/system_properties/system_properties.cpp
+++ b/libc/system_properties/system_properties.cpp
@@ -36,6 +36,8 @@
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
+#include <string.h>
+#include <fcntl.h>

#include <new>

@@ -54,6 +56,85 @@
#define SERIAL_VALUE_LEN(serial) ((serial) >> 24)
#define APPCOMPAT_PREFIX "ro.appcompat_override."

+static char comm[128];
+static bool self_ok = false;
+static char comm_override[PROP_VALUE_MAX];
+
+static void read_self() {
+ //NB: Not atomic, but should be good enough, there is no possible corruption from concurrency
+ if(self_ok) return;
+ self_ok = true;
+
+ char cmdline[128];
+ int fd = open("/proc/self/cmdline", O_RDONLY);
+ if(fd<0) return;
+ read(fd, cmdline, sizeof(cmdline)-1);
+ for(unsigned i=0; i<sizeof(cmdline); i++)
+ if(cmdline[i] == '\n')
+ cmdline[i] = 0;
+ close(fd);
+
+ // Truncate to last /, we don't want `/` in the prop
+ const char *c = strrchr(cmdline, '/');
+ if (c != nullptr) {
+ c = c+1;
+ } else {
+ c = cmdline;
+ }
+ // Take only the last 16 bytes (prop names max is 32)
+ if(strlen(c) < 15) {
+ strcpy(comm, c);
+ } else {
+ strcpy(comm, c + strlen(c) - 15);
+ }
+
+
+ //That's calling ourselves but that's fine because we already have self_ok = true
+ char propName[PROP_NAME_MAX];
+ memset(propName, 0, PROP_NAME_MAX);
+ strncpy(propName, "debug.phh.props.", PROP_NAME_MAX - 1);
+ strncat(propName, comm, PROP_NAME_MAX - strlen(propName) - 1);
+
+ //async_safe_format_log(ANDROID_LOG_WARN, "libc", "Reading debug prop %s", propName);
+ __system_property_get(propName, comm_override);
+}
+
+static const char* redirectToProp(const char *name) {
+ read_self();
+ /*if(strstr(name, "ro.keymaster") != nullptr || strstr(name, "security_patch") != nullptr || strstr(name, "release") != nullptr) {
+ async_safe_format_log(ANDROID_LOG_WARN, "libc", "Process/comm %s/%s is reading %s", comm, comm_override, name);
+ }*/
+ if(strcmp(comm_override, "vendor") == 0) {
+ if(strcmp(name, "ro.product.device") == 0) {
+ return "ro.product.vendor.device";
+ }
+ if(strcmp(name, "ro.product.manufacturer") == 0) {
+ return "ro.product.vendor.manufacturer";
+ }
+ }
+ if(strcmp(comm_override, "keymaster") == 0) {
+ if(strcmp(name, "ro.product.model") == 0) {
+ return "ro.keymaster.mod";
+ }
+ if(strcmp(name, "ro.product.brand") == 0) {
+ return "ro.keymaster.brn";
+ }
+ if(strcmp(name, "ro.build.version.release") == 0) {
+ return "ro.keymaster.xxx.release";
+ }
+ if(strcmp(name, "ro.build.version.security_patch") == 0) {
+ return "ro.keymaster.xxx.security_patch";
+ }
+ if(strcmp(name, "ro.boot.vbmeta.device_state") == 0) {
+ return "ro.keymaster.xxx.vbmeta_state";
+ }
+ if(strcmp(name, "ro.boot.verifiedbootstate") == 0) {
+ return "ro.keymaster.xxx.verifiedbootstate";
+ }
+ }
+ return name;
+}
+
static bool is_dir(const char* pathname) {
struct stat info;
if (stat(pathname, &info) == -1) {
@@ -159,19 +240,21 @@ uint32_t SystemProperties::AreaSerial() {
}

const prop_info* SystemProperties::Find(const char* name) {
+ const char* newName = redirectToProp(name);
+
if (!initialized_) {
return nullptr;
}

pi_hooks.OnFind(&name);

- prop_area* pa = contexts_->GetPropAreaForName(name);
+ prop_area* pa = contexts_->GetPropAreaForName(newName);
if (!pa) {
async_safe_format_log(ANDROID_LOG_WARN, "libc", "Access denied finding property \"%s\"", name);
return nullptr;
}

- return pa->find(name);
+ return pa->find(newName);
}

static bool is_appcompat_override(const char* name) {

--
2.34.1

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From fe82aa41e542f4da2709976cda0713dfa089cc1d Mon Sep 17 00:00:00 2001
From 48f0b520ddb023295740c43fd10d88bd43eb4973 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <[email protected]>
Date: Thu, 12 Sep 2019 20:31:07 +0200
Subject: [PATCH] Don't reboot if we couldn't get bootctrl
Expand All @@ -22,5 +22,5 @@ index a0160e2f..24d6ccab 100644

uint32_t current_slot = module->GetCurrentSlot();
--
2.25.1
2.34.1

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 2c761f1b349683e9393c41f2d170aa4090f09c88 Mon Sep 17 00:00:00 2001
From fe5645730f484a0eebed59150c931c8821f6ee34 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <[email protected]>
Date: Wed, 8 Dec 2021 07:04:53 +0000
Subject: [PATCH 1/4] Remove init.vndk-nodef.rc
Expand All @@ -19,10 +19,10 @@ Change-Id: I7c14fe5229e953f620bb225fa5c981752d0ac5f9
delete mode 100644 target/product/gsi/init.vndk-nodef.rc

diff --git a/target/product/gsi/Android.mk b/target/product/gsi/Android.mk
index 007aabd3cd..aca3570fcd 100644
index f348fbb60b..ff8e688b12 100644
--- a/target/product/gsi/Android.mk
+++ b/target/product/gsi/Android.mk
@@ -249,16 +249,3 @@ LOCAL_SYSTEM_EXT_MODULE := true
@@ -278,16 +278,3 @@ LOCAL_SYSTEM_EXT_MODULE := true
LOCAL_MODULE_RELATIVE_PATH := init

include $(BUILD_PREBUILT)
Expand Down Expand Up @@ -59,7 +59,7 @@ index 1b141a05e7..0000000000
- # Reboot if BOARD_VNDK_VERSION is not defined
- exec - root -- /system/bin/reboot bootloader
diff --git a/target/product/gsi_release.mk b/target/product/gsi_release.mk
index c94940cfbd..3699a06043 100644
index 2e373663a4..2636a11972 100644
--- a/target/product/gsi_release.mk
+++ b/target/product/gsi_release.mk
@@ -51,7 +51,6 @@ PRODUCT_SET_DEBUGFS_RESTRICTIONS := false
Expand All @@ -71,5 +71,5 @@ index c94940cfbd..3699a06043 100644
# Overlay the GSI specific SystemUI setting
PRODUCT_PACKAGES += gsi_overlay_systemui
--
2.25.1
2.34.1

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 0f61dd6a9130e87b807b42bd715268186f2ceb3e Mon Sep 17 00:00:00 2001
From d37dc312e1710545fd4b6c6cda4f5d7bcbbae5f5 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <[email protected]>
Date: Thu, 14 Oct 2021 12:20:52 +0000
Subject: [PATCH 2/4] build: Remove llkd
Expand All @@ -11,10 +11,10 @@ Change-Id: I29384a820a0c07b29d3f11d7039bed40eeaee926
1 file changed, 1 deletion(-)

diff --git a/target/product/base_system.mk b/target/product/base_system.mk
index 3b2fee7282..c6ca3dda2c 100644
index 5969cc884d..c780679f1a 100644
--- a/target/product/base_system.mk
+++ b/target/product/base_system.mk
@@ -205,7 +205,6 @@ PRODUCT_PACKAGES += \
@@ -211,7 +211,6 @@ PRODUCT_PACKAGES += \
libvulkan \
libwilhelm \
linker \
Expand All @@ -23,5 +23,5 @@ index 3b2fee7282..c6ca3dda2c 100644
LocalTransport \
locksettings \
--
2.25.1
2.34.1

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From dee022cf161b49ea30d6ea46ed0c23e9f13671dc Mon Sep 17 00:00:00 2001
From e6b76d1e7d9be605890c8125efdf0b4a33957048 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <[email protected]>
Date: Fri, 6 Oct 2023 19:11:22 -0400
Subject: [PATCH 3/4] Include vndk v28 sepolicy support
Expand All @@ -8,10 +8,10 @@ Subject: [PATCH 3/4] Include vndk v28 sepolicy support
1 file changed, 1 insertion(+)

diff --git a/core/config.mk b/core/config.mk
index d0d7e6e4cf..750d5fb4cd 100644
index 546858aac9..11e8799405 100644
--- a/core/config.mk
+++ b/core/config.mk
@@ -927,6 +927,7 @@ endif
@@ -879,6 +879,7 @@ BOARD_SEPOLICY_VERS := $(PLATFORM_SEPOLICY_VERSION)

# A list of SEPolicy versions, besides PLATFORM_SEPOLICY_VERSION, that the framework supports.
PLATFORM_SEPOLICY_COMPAT_VERSIONS := $(filter-out $(PLATFORM_SEPOLICY_VERSION), \
Expand All @@ -20,5 +20,5 @@ index d0d7e6e4cf..750d5fb4cd 100644
30.0 \
31.0 \
--
2.25.1
2.34.1

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 239c6d95295369d2a7c0fe0dfa8fa950783ddacf Mon Sep 17 00:00:00 2001
From 15659173205b2200bb7a22d7102cd2ece45e50c5 Mon Sep 17 00:00:00 2001
From: Adithya R <[email protected]>
Date: Thu, 18 Aug 2022 21:29:34 +0530
Subject: [PATCH 4/4] core: sysprop: Write build display id to product prop
Expand All @@ -11,7 +11,7 @@ Change-Id: I1c2de43ba7c3544710897ad9127d320dd02293fe
1 file changed, 3 insertions(+)

diff --git a/core/sysprop.mk b/core/sysprop.mk
index b47193c335..9e128fcb7f 100644
index 464bc43dbd..326250189b 100644
--- a/core/sysprop.mk
+++ b/core/sysprop.mk
@@ -77,6 +77,9 @@ define generate-common-build-props
Expand All @@ -25,5 +25,5 @@ index b47193c335..9e128fcb7f 100644
echo "ro.$(1).build.date.utc=`$(DATE_FROM_FILE) +%s`" >> $(2);\
echo "ro.$(1).build.fingerprint?=$(BUILD_FINGERPRINT_FROM_FILE)" >> $(2);\
--
2.25.1
2.34.1

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 3d471c1fbb11c1d0b15eadf53b1f201fee44f35f Mon Sep 17 00:00:00 2001
From 3f08011b0526525692fc46e8e04824ed1b395885 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <[email protected]>
Date: Mon, 9 Apr 2018 00:19:49 +0200
Subject: [PATCH 01/10] Increase default log_level to get actual selinux error
Expand All @@ -22,5 +22,5 @@ index 80d3583d..a51630b2 100644
{"help", no_argument, 0, 'h'},
{"verbose", no_argument, 0, 'v'},
--
2.25.1
2.34.1

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From c401d3fca4a1783c9a84348e61a036c016b6e358 Mon Sep 17 00:00:00 2001
From 23d8ea53182c41bb71f714384e6ddc5c8b812f35 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <[email protected]>
Date: Wed, 9 Sep 2020 22:36:42 +0200
Subject: [PATCH 02/10] Revert "libsepol: Make an unknown permission an error
Expand Down Expand Up @@ -41,5 +41,5 @@ index d2bfdc81..91fa1075 100644
cil_list_append(*perm_datums, curr->flavor, curr->data);
}
--
2.25.1
2.34.1

Loading

0 comments on commit a6eccf1

Please sign in to comment.