Last active
September 28, 2022 18:11
-
-
Save dtrunk90/2bcbdbaf97d71c0471a965fbad6ff523 to your computer and use it in GitHub Desktop.
Can be executed within android root dir for finding identical proprietary files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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