README.md
1# Add a new VNDK APEX
2
3In this document we add a new VNDK APEX for version 30. When you follow this doc with different versions,
4change "30" to what you're adding. (eg. 31)
5
61. Add a new definition in `Android.bp`
7
8```
9apex_vndk {
10 name: "com.android.vndk.v30",
11 manifest: "apex_manifest.v30.json",
12 key: "com.android.vndk.v30.key",
13 certificate: ":com.android.vndk.v30.certificate",
14 vndk_version: "30",
15 system_ext_specific: true,
16 file_contexts: ":com.android.vndk-file_contexts",
17}
18
19apex_key {
20 name: "com.android.vndk.v30.key",
21 public_key: "com.android.vndk.v30.pubkey",
22 private_key: "com.android.vndk.v30.pem",
23}
24
25android_app_certificate {
26 name: "com.android.vndk.v30.certificate",
27 certificate: "com.android.vndk.v30",
28}
29```
30
312. Add `apex_manifest.v30.json`
32
33```
34{
35 "name": "com.android.vndk.v30",
36 "version": 1
37}
38```
39
403. Add keys/ceritificate
41
42```
43openssl genrsa -out com.android.vndk.v30.pem 4096
44avbtool extract_public_key --key com.android.vndk.v30.pem --output com.android.vndk.v30.pubkey
45openssl req -x509 -newkey rsa:4096 -nodes -days 999999 -keyout key.pem -out com.android.vndk.v30.x509.pem
46
47# Enter following info via the interactive prompts
48# Country Name: US
49# State: California
50# Locality Name: Mountain View
51# Organization Name: Android
52# Organization Unit Name: Android
53# Common Name: com.android.vndk
54# Email address: android@android.com
55
56openssl pkcs8 -topk8 -inform PEM -outform DER -in key.pem -out com.android.vndk.v30.pk8 -nocrypt
57
58rm key.pem
59```
60
614. Verify
62
63```
64m com.android.vndk.v30
65```
66