Files
android/libwvdrmengine/move_widevine_data.sh
Alex Dale 659301abd3 Specified /bin/bash for Android scripts.
[ Merge of http://go/wvgerrit/165139 ]

Changed the specified shell program used to execute our team's Android
scripts to bash.

Bug: 266891333
Test: ./build_all_unit_tests.sh
Change-Id: Id6fc8e4db10a71e9f17fc48a52a4883331e908d3
2023-01-26 22:23:25 -08:00

30 lines
818 B
Bash
Executable File

#!/bin/bash
DEST_PATH="/data/vendor/mediadrm"
FILES_MOVED="/data/vendor/mediadrm/files_moved"
SRC_PATH="/data/mediadrm"
L3_FILE_PATTERN="ay64.dat*"
if [ ! -f "$FILES_MOVED" ]; then
for i in "$SRC_PATH/IDM"*; do
dest_path=$DEST_PATH/"${i#$SRC_PATH/}"
if [ -d "$i" ]; then
mkdir -p "$dest_path" -m 700
mv "$i" "$DEST_PATH"
for file in ${dest_path}/${L3_FILE_PATTERN}; do
[ -e "${file}" ] || continue
# We need to move any L3 files in the IDM folder to the L3 subfolder.
l3_dir="${dest_path}/L3/"
mkdir -p "${l3_dir}" -m 700
mv "${file}" "${l3_dir}"
done
find "$dest_path" -print0 | while IFS= read -r -d '' file
do
chgrp media "$file"
done
fi
done
restorecon -R "$DEST_PATH"
echo 1 > "$FILES_MOVED"
fi