blob: 3fc6f86653c55617654be199581ce25916b52521 [file] [log] [blame]
// Copyright (C) 2020 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
filegroup {
name: "CtsApkVerityTestAppDm",
srcs: ["CtsApkVerityTestApp.dm"],
}
filegroup {
name: "CtsApkVerityTestAppSplitDm",
srcs: ["CtsApkVerityTestAppSplit.dm"],
}
filegroup {
name: "fsverity-debug-key",
srcs: ["fsverity-debug-key.pem"],
}
filegroup {
name: "fsverity-debug-cert",
srcs: ["fsverity-debug.x509.pem"],
}
genrule_defaults {
name: "cts_apk_verity_sig_gen_default",
tools: ["fsverity"],
tool_files: [
":fsverity-debug-key",
":fsverity-debug-cert",
],
cmd: "$(location fsverity) sign $(in) $(out) " +
"--key=$(location :fsverity-debug-key) " +
"--cert=$(location :fsverity-debug-cert) " +
"> /dev/null",
}
genrule {
name: "CtsApkVerityTestAppFsvSig",
defaults: ["cts_apk_verity_sig_gen_default"],
srcs: [":CtsApkVerityTestApp"],
out: ["CtsApkVerityTestApp.apk.fsv_sig"],
}
genrule {
name: "CtsApkVerityTestAppDmFsvSig",
defaults: ["cts_apk_verity_sig_gen_default"],
srcs: [":CtsApkVerityTestAppDm"],
out: ["CtsApkVerityTestApp.dm.fsv_sig"],
}
genrule {
name: "CtsApkVerityTestAppSplitFsvSig",
defaults: ["cts_apk_verity_sig_gen_default"],
srcs: [":CtsApkVerityTestAppSplit"],
out: ["CtsApkVerityTestAppSplit.apk.fsv_sig"],
}
genrule {
name: "CtsApkVerityTestAppSplitDmFsvSig",
defaults: ["cts_apk_verity_sig_gen_default"],
srcs: [":CtsApkVerityTestAppSplitDm"],
out: ["CtsApkVerityTestAppSplit.dm.fsv_sig"],
}
// Create another app with mismatched .fsv_sig
genrule {
name: "CtsApkVerityTestApp2",
srcs: [":CtsApkVerityTestApp"],
out: ["CtsApkVerityTestApp2.apk"],
cmd: "cp -f $(in) $(out)"
}
genrule {
name: "CtsApkVerityTestApp2FsvSig",
srcs: [":CtsApkVerityTestAppSplitFsvSig"],
out: ["CtsApkVerityTestApp2.apk.fsv_sig"],
cmd: "cp -f $(in) $(out)"
}