Skip to content

Instantly share code, notes, and snippets.

@spezifisch
Last active August 29, 2024 17:06
Show Gist options
  • Select an option

  • Save spezifisch/0cd89a25c730ac267559c44b5487c9ff to your computer and use it in GitHub Desktop.

Select an option

Save spezifisch/0cd89a25c730ac267559c44b5487c9ff to your computer and use it in GitHub Desktop.
LineageOS device|vendor|stock comparer
tar -cvzf /sdcard/proprietary-files.tar.gz /odm/etc /product/app /product/priv-app /system/etc /system_ext/app /system_ext/bin /system_ext/etc /system_ext/framework /system_ext/lib64 /system_ext/priv-app /system/framework /vendor/app /vendor/bin /vendor/etc /vendor/firmware /vendor/gpu /vendor/lib64 /vendor/lib
export DEVICE_BASE=$HOME/android/lineage/device/xiaomi/veux
export VENDOR_BASE=$HOME/android/lineage/vendor/xiaomi/veux/proprietary
export STOCK_BASE=$HOME/Dumps/veux-stock-vendor-20240829-1
for x in $(cat "$DEVICE_BASE/proprietary-files.txt" | cut -d'|' -f1 | grep -Ev '(^#|^$)'); do
F="$VENDOR_BASE/$x"
if [ -e "$F" ]; then
#echo "found $x in vendor"
G="$STOCK_BASE/$x"
if [ -e "$G" ]; then
#echo "found $x in stock"
if diff -q "$F" "$G" > /dev/null; then
# same files
echo "match-vendor/stock $x"
else
echo "mismatch-vendor/stock $x"
fi
else
echo "missing-compare $x"
fi
else
echo "extraneous $x"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment