Source release 17.1.0
This commit is contained in:
30
cdm/create_cert_cc.py
Executable file
30
cdm/create_cert_cc.py
Executable file
@@ -0,0 +1,30 @@
|
||||
#!/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>
|
||||
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});""")
|
||||
Reference in New Issue
Block a user