#!/usr/bin/env bash
set -euo pipefail

out_adevtool_deps/host/linux-x86/bin/bpmodify -w -m android.hardware.authsecret -parameter frozen -set-bool false hardware/interfaces/authsecret/aidl/Android.bp
mkdir -p hardware/interfaces/authsecret/aidl/aidl_api/android.hardware.authsecret/current
rsync --recursive --update --delete-before out_adevtool_deps/soong/.intermediates/hardware/interfaces/authsecret/aidl/android.hardware.authsecret_interface/dump/* hardware/interfaces/authsecret/aidl/aidl_api/android.hardware.authsecret/current
out_adevtool_deps/host/linux-x86/bin/bpmodify -w -m android.hardware.authsecret -parameter versions -remove-property hardware/interfaces/authsecret/aidl/Android.bp
out_adevtool_deps/host/linux-x86/bin/bpmodify -w -m android.hardware.authsecret -parameter versions_with_info -add-literal '{version: "1", imports: []}'  hardware/interfaces/authsecret/aidl/Android.bp && out_adevtool_deps/host/linux-x86/bin/bpmodify -w -m android.hardware.authsecret -parameter frozen -set-bool true hardware/interfaces/authsecret/aidl/Android.bp
