summaryrefslogtreecommitdiff
path: root/apex/README.md
blob: e98c63dacd9d09337dde4728dd3b9f70adff2725 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Add a new VNDK APEX

In this document we add a new VNDK APEX for version 30. When you follow this doc with different versions,
change "30" to what you're adding. (eg. 31)

1. Add a new definition in `Android.bp`

```
apex_vndk {
    name: "com.android.vndk.v30",
    manifest: "apex_manifest.v30.json",
    key: "com.android.vndk.v30.key",
    certificate: ":com.android.vndk.v30.certificate",
    vndk_version: "30",
    system_ext_specific: true,
    file_contexts: ":com.android.vndk-file_contexts",
}

apex_key {
    name: "com.android.vndk.v30.key",
    public_key: "com.android.vndk.v30.pubkey",
    private_key: "com.android.vndk.v30.pem",
}

android_app_certificate {
    name: "com.android.vndk.v30.certificate",
    certificate: "com.android.vndk.v30",
}
```

2. Add `apex_manifest.v30.json`

```
{
  "name": "com.android.vndk.v30",
  "version": 1
}
```

3. Add keys/ceritificate

```
openssl genrsa -out com.android.vndk.v30.pem 4096
avbtool extract_public_key --key com.android.vndk.v30.pem --output com.android.vndk.v30.pubkey
openssl req -x509 -newkey rsa:4096 -nodes -days 999999 -keyout key.pem -out com.android.vndk.v30.x509.pem

# Enter following info via the interactive prompts
# Country Name: US
# State: California
# Locality Name: Mountain View
# Organization Name: Android
# Organization Unit Name: Android
# Common Name: com.android.vndk
# Email address: android@android.com

openssl pkcs8 -topk8 -inform PEM -outform DER -in key.pem -out com.android.vndk.v30.pk8 -nocrypt

rm key.pem
```

4. Verify

```
m com.android.vndk.v30
```