Files
android/libwvdrmengine/move_widevine_data.sh
Edwin Wong 59fcc20138 Move persistent data to /data/vendor.
Widevine persistent data is stored in /data/mediadrm, HALs
are not allowed to access files in /data. Move persistent
data to /data/vendor/mediadrm/widevine for older devices,
and persistent data will not be saved under /data/vendor.

Test: Play Movies & Tv, Netflix

bug: 36601695
Change-Id: I31fdd43b7db327bf6d8343dc95e9883ae6bce70d
2018-01-15 13:50:06 -08:00

22 lines
506 B
Bash
Executable File

#!/system/bin/sh
DEST_PATH="/data/vendor/mediadrm"
FILES_MOVED="/data/vendor/mediadrm/files_moved"
SRC_PATH="/data/mediadrm"
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"
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