1// Copyright (C) 2019 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//      http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15filegroup {
16    name: "ApkVerityTestKeyPem",
17    srcs: ["ApkVerityTestKey.pem"],
18}
19
20filegroup {
21    name: "ApkVerityTestCertPem",
22    srcs: ["ApkVerityTestCert.pem"],
23}
24
25filegroup {
26    name: "ApkVerityTestCertDer",
27    srcs: ["ApkVerityTestCert.der"],
28}
29
30filegroup {
31    name: "ApkVerityTestAppDm",
32    srcs: ["ApkVerityTestApp.dm"],
33}
34
35filegroup {
36    name: "ApkVerityTestAppSplitDm",
37    srcs: ["ApkVerityTestAppSplit.dm"],
38}
39
40genrule_defaults {
41    name: "apk_verity_sig_gen_default",
42    tools: ["fsverity"],
43    tool_files: [":ApkVerityTestKeyPem", ":ApkVerityTestCertPem"],
44    cmd: "$(location fsverity) sign $(in) $(out) " +
45        "--key=$(location :ApkVerityTestKeyPem) " +
46        "--cert=$(location :ApkVerityTestCertPem) " +
47        "> /dev/null",
48}
49
50genrule {
51    name: "ApkVerityTestAppFsvSig",
52    defaults: ["apk_verity_sig_gen_default"],
53    srcs: [":ApkVerityTestApp"],
54    out: ["ApkVerityTestApp.apk.fsv_sig"],
55}
56
57genrule {
58    name: "ApkVerityTestAppDmFsvSig",
59    defaults: ["apk_verity_sig_gen_default"],
60    srcs: [":ApkVerityTestAppDm"],
61    out: ["ApkVerityTestApp.dm.fsv_sig"],
62}
63
64genrule {
65    name: "ApkVerityTestAppSplitFsvSig",
66    defaults: ["apk_verity_sig_gen_default"],
67    srcs: [":ApkVerityTestAppSplit"],
68    out: ["ApkVerityTestAppSplit.apk.fsv_sig"],
69}
70
71genrule {
72    name: "ApkVerityTestAppSplitDmFsvSig",
73    defaults: ["apk_verity_sig_gen_default"],
74    srcs: [":ApkVerityTestAppSplitDm"],
75    out: ["ApkVerityTestAppSplit.dm.fsv_sig"],
76}
77
78