Skip to content

Commit

Permalink
wiki: signing builds: fix apexes array
Browse files Browse the repository at this point in the history
Right now apexes is a string, and the loop {%- for apex in apexes %}
hence does not work.  Split the string into a proper array to fix
this.

Also change so we loop over apexes twice to first print all
--extra_apks args, and then all --extra_apex_payload_key args, as I
think this looks nicer.

Change-Id: I8b546cbbe6d64e096abadac138c88b9f570d556b
  • Loading branch information
Grimler91 authored and luk1337 committed Dec 30, 2023
1 parent 4a5f79a commit 0532f59
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pages/signing_builds.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ com.android.wifi.resources
com.google.pixel.vibrator.hal
com.qorvo.uwb
{% endcapture %}
{% assign apexes = apexes | newline_to_br | strip_newlines | replace: "<br />", " " | strip %}
{% assign apexes = apexes | newline_to_br | strip_newlines | replace: "<br />", " " | strip | split: " " %}

LineageOS 19.1 and above will also require APEXes be re-signed.
Each APEX file is signed with two keys: one for the mini file system image within an APEX and the other for the entire APEX.
Expand All @@ -80,7 +80,7 @@ sed -i 's|2048|4096|g' ~/.android-certs/make_key
```
Then generate the APEX keys altering the `subject` line to reflect your information. You will need to enter twice the passphrase for each APEX.
```
for apex in {{ apexes }}; do \
for apex in {{ apexes | join: " " }}; do \
subject='/C=US/ST=California/L=Mountain View/O=Android/OU=Android/CN='$apex'/[email protected]'; \
~/.android-certs/make_key ~/.android-certs/$apex "$subject"; \
openssl pkcs8 -in ~/.android-certs/$apex.pk8 -inform DER -out ~/.android-certs/$apex.pem; \
Expand Down Expand Up @@ -133,6 +133,8 @@ croot
sign_target_files_apks -o -d ~/.android-certs \
{%- for apex in apexes %}
--extra_apks {{ apex }}.apex=$HOME/.android-certs/{{ apex }} \
{%- endfor %}
{%- for apex in apexes %}
--extra_apex_payload_key {{ apex }}.apex=$HOME/.android-certs/{{ apex }}.pem \
{%- endfor %}
$OUT/obj/PACKAGING/target_files_intermediates/*-target_files-*.zip \
Expand Down

0 comments on commit 0532f59

Please sign in to comment.