Skip to content

Instantly share code, notes, and snippets.

@dtrunk90
Last active September 28, 2022 18:11
Show Gist options
  • Save dtrunk90/2bcbdbaf97d71c0471a965fbad6ff523 to your computer and use it in GitHub Desktop.
Save dtrunk90/2bcbdbaf97d71c0471a965fbad6ff523 to your computer and use it in GitHub Desktop.
Can be executed within android root dir for finding identical proprietary files
#!/bin/bash
vendor="sony"
devices=("akari" "akatsuki" "aurora" "xz2c")
cmp_all() {
for device in "${devices[@]:1}"; do
if ! cmp -s "vendor/$vendor/${devices[0]}/$1" "vendor/$vendor/$device/$1"; then
return 1
fi
done
return 0
}
find $(printf "vendor/$vendor/%s " "${devices[@]}") -type f | cut -d'/' -f4- | sort -f | uniq -c | grep "${#devices[@]} " | awk '{print $2}' |
while IFS= read -r line; do
if cmp_all $line; then
echo "$line"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment