build: Override host metadata

reference taken from
https://grapheneos.social/@GrapheneOS/113870255397154703

instead of fixed host number, use a random generated host number that follows google's host number format to bypass revolut's host checks

Change-Id: I72feafd663a551eb0c6c4146d52137ed0dc7456d
Co-authored-by: Terminator-J <terminator_j@hotbutteredmonkey.com>
Signed-off-by: rmp22 <195054967+rmp22@users.noreply.github.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
This commit is contained in:
rmp22
2025-03-29 07:09:04 +08:00
committed by Joey
parent ce2fb744bd
commit 4526af71d3

View File

@@ -1012,3 +1012,14 @@ function build_kernel() {
chmod -x "${target_kernel_dir}/"*
echo "Kernel build output copied to ${target_kernel_dir}/"
}
function generate_host_overrides() {
export BUILD_USERNAME=android-build
HEX=$(openssl rand -hex 8)
ALPHA=$(cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 4 | head -n 1)
export BUILD_HOSTNAME="r-${HEX}-${ALPHA}"
echo "BUILD_USERNAME=$BUILD_USERNAME"
echo "BUILD_HOSTNAME=$BUILD_HOSTNAME"
}
generate_host_overrides