Implement extract_apks

Bug: 152319766
Test: manual and builtin
Change-Id: Ia15d66e86c7bcfd52f5b776173ca1665b68ff438
diff --git a/cmd/extract_apks/bundle_proto/regen.sh b/cmd/extract_apks/bundle_proto/regen.sh
new file mode 100755
index 0000000..89fb655
--- /dev/null
+++ b/cmd/extract_apks/bundle_proto/regen.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+# Generates the golang source file of protos file describing APK set table of
+# contents (toc.pb file).
+
+set -e
+function die() { echo "ERROR: $1" >&2; exit 1; }
+
+readonly error_msg="Maybe you need to run 'lunch aosp_arm-eng && m aprotoc blueprint_tools'?"
+
+hash aprotoc &>/dev/null || die "could not find aprotoc. ${error_msg}"
+# TODO(asmundak): maybe have the paths relative to repo top?
+(cd "${0%/*}" && aprotoc --go_out=paths=source_relative:. commands.proto config.proto targeting.proto ) || die "build failed. ${error_msg}"