Skip to content

Commit 9ae1a27

Browse files
committed
[scripts/build] Reorder functions to match call order
1 parent 1823f52 commit 9ae1a27

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

scripts/build

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,29 @@ cores=$(nproc)
1818
build_chromium="${BUILD_CHROMIUM?}"
1919
build_kernel="${BUILD_KERNEL?}"
2020

21+
function apply_patches(){
22+
cd "${base_dir}"
23+
local fdroid_org="packages/apps/F-DroidPrivilegedExtension/app/src/main/java/org"
24+
local fdroid_whitelist="${fdroid_org}/fdroid/fdroid/privileged/ClientWhitelist.java"
25+
local platform_key_hash; platform_key_hash=$( \
26+
openssl x509 -in "${key_dir}/platform.x509.pem" -outform DER \
27+
| sha256sum | cut -c1-64; \
28+
)
29+
echo "Platform Key Hash: ${platform_key_hash}"
30+
if [ -f "${base_dir}/${fdroid_whitelist}" ]; then
31+
echo "patching file ${fdroid_whitelist}"
32+
sed -i \
33+
"s/[a-f0-9]\\{64\\}/${platform_key_hash}/g" \
34+
"${base_dir}/${fdroid_whitelist}"
35+
fi
36+
for patch in ${platform_patches//,/ }; do
37+
echo "Applying patch: $patch_dir/${patch}"
38+
patch -p1 --no-backup-if-mismatch < "${patch_dir}/${patch}"
39+
done
40+
echo "export BUILD_ID=${build_id}" > "${base_dir}/build/core/build_id.mk"
41+
cd -
42+
}
43+
2144
function build_external(){
2245
local vendor_dist="${external_dir}/vendor/out/${device}/${build_id,,}/vendor/"
2346
local vendor_dest="${base_dir}/vendor/"
@@ -46,29 +69,6 @@ function build_external(){
4669
fi
4770
}
4871

49-
function apply_patches(){
50-
cd "${base_dir}"
51-
local fdroid_org="packages/apps/F-DroidPrivilegedExtension/app/src/main/java/org"
52-
local fdroid_whitelist="${fdroid_org}/fdroid/fdroid/privileged/ClientWhitelist.java"
53-
local platform_key_hash; platform_key_hash=$( \
54-
openssl x509 -in "${key_dir}/platform.x509.pem" -outform DER \
55-
| sha256sum | cut -c1-64; \
56-
)
57-
echo "Platform Key Hash: ${platform_key_hash}"
58-
if [ -f "${base_dir}/${fdroid_whitelist}" ]; then
59-
echo "patching file ${fdroid_whitelist}"
60-
sed -i \
61-
"s/[a-f0-9]\\{64\\}/${platform_key_hash}/g" \
62-
"${base_dir}/${fdroid_whitelist}"
63-
fi
64-
for patch in ${platform_patches//,/ }; do
65-
echo "Applying patch: $patch_dir/${patch}"
66-
patch -p1 --no-backup-if-mismatch < "${patch_dir}/${patch}"
67-
done
68-
echo "export BUILD_ID=${build_id}" > "${base_dir}/build/core/build_id.mk"
69-
cd -
70-
}
71-
7272
function build_platform(){
7373
cd "$base_dir"
7474
choosecombo "${build_type}" "aosp_${device}" "${build_variant}"

0 commit comments

Comments
 (0)