Bug: 316978205 Test: m android.hardware.drm-service.widevine Change-Id: Ibf77a0135fa832424f38619bdd2df0ccc53f5849
28 lines
802 B
Python
28 lines
802 B
Python
import argparse
|
|
import datetime
|
|
import json
|
|
import sys
|
|
|
|
if __name__ == "__main__":
|
|
|
|
description = 'APEX Manifest JSON (stdin) to C++ header (stdout)'
|
|
parser = argparse.ArgumentParser(description=description)
|
|
parser.add_argument('--guard', type=str,
|
|
default='WVCDM_WV_ANDROID_BUILD_ID_H_',
|
|
help='Include guard')
|
|
args = parser.parse_args()
|
|
|
|
apex_manifest = json.load(sys.stdin)
|
|
output = f'''\
|
|
// Copyright {datetime.date.today().year} Google LLC. All Rights Reserved. This file and proprietary
|
|
// source code may only be used and distributed under the Widevine License
|
|
// Agreement.
|
|
//
|
|
#ifndef {args.guard}
|
|
#define {args.guard}
|
|
|
|
#define WV_ANDROID_BUILD_ID "{apex_manifest['version']}"
|
|
|
|
#endif // {args.guard}'''
|
|
print(output)
|