Cherry pick 18.4 changes to udc-widevine-dev

Get the udc-widevine-dev Android branch and oemcrypto-v18 cdm branch in
sync. The commit ID for 18.4 on oemcrypto-v18 is
a2f23a2281e5e06dc2867585bdc516fa132b6396.

Merged from go/wvgerrit/190151

Bug: 290252845
Test: WVTS tests are running and passing
Change-Id: I457332e7ca70a5b5169345e1279b3eb9f18413b6
This commit is contained in:
Vicky Min
2024-01-18 20:56:14 +00:00
parent e001272e4d
commit 7186433edf
98 changed files with 135280 additions and 258 deletions

View File

@@ -0,0 +1,34 @@
#!/usr/bin/python3
# Copyright 2022 Google LLC. All Rights Reserved. This file and proprietary
# source code may only be used and distributed under the Widevine License
# Agreement.
"""Creates a cert.cc file from a cert.bin file."""
import argparse
import pathlib
import sys
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('input')
parser.add_argument('output')
parser.add_argument('--variable', default='DeviceCert')
options = parser.parse_args(sys.argv[1:])
in_path = pathlib.Path(options.input)
dat = ', '.join(str(x) for x in in_path.read_bytes())
out_path = pathlib.Path(options.output)
out_path.write_text(f"""// Copyright 2021 Google LLC. All Rights Reserved.
#include <stdint.h>
#include <stddef.h>
namespace widevine {{
extern const uint8_t k{options.variable}[];
const uint8_t k{options.variable}[] = {{ {dat} }};
extern const size_t k{options.variable}Size;
const size_t k{options.variable}Size = sizeof(k{options.variable});
}} // namespace widevine""")