2023-08-28 14:46:57 +00:00
|
|
|
#!/usr/bin/env bash
|
2019-08-26 12:50:28 +00:00
|
|
|
RETURN=0
|
|
|
|
|
2023-03-24 15:17:44 +00:00
|
|
|
EXCEPTIONS=()
|
|
|
|
EXCEPTIONS+=( "decred" ) # "decred" figures in field names used by the bitcoin app
|
|
|
|
EXCEPTIONS+=( "omni" ) # OMNI is part of the bitcoin app
|
2024-03-07 12:47:34 +00:00
|
|
|
EXCEPTIONS+=( "derive_cardano" ) # field name in Initialize message
|
|
|
|
# BIP39 or SLIP39 words that have "dash" and "ripple" in them
|
|
|
|
EXCEPTIONS+=( "dash" "ripple" )
|
2023-03-24 15:17:44 +00:00
|
|
|
|
|
|
|
GREP_ARGS=()
|
|
|
|
for exception in "${EXCEPTIONS[@]}"; do
|
|
|
|
GREP_ARGS+=(-e $exception)
|
|
|
|
done
|
2021-05-25 14:02:01 +00:00
|
|
|
|
2023-11-14 11:15:04 +00:00
|
|
|
# dump all coins except the first 3 (Bitcoin, Testnet, Regtest), exclude names with less than 4 characters
|
2024-03-07 12:29:32 +00:00
|
|
|
ALTCOINS=$(./common/tools/cointool.py dump -l -p -t | grep '"name"' | cut -d '"' -f 4 | tail -n +4 | awk 'length($0)>3')
|
2021-05-25 14:02:01 +00:00
|
|
|
# split on newlines only
|
|
|
|
OLDIFS=$IFS
|
|
|
|
IFS="
|
|
|
|
"
|
|
|
|
for altcoin in $ALTCOINS; do
|
2019-08-26 12:50:28 +00:00
|
|
|
# echo :"$altcoin":
|
2023-03-24 15:17:44 +00:00
|
|
|
if strings "$1" | grep -i "$altcoin" | grep -vi ${GREP_ARGS[@]} ; then
|
2019-08-26 12:50:28 +00:00
|
|
|
RETURN=1
|
|
|
|
fi
|
|
|
|
done
|
2021-05-25 14:02:01 +00:00
|
|
|
IFS=$OLDIFS
|
2019-08-26 12:50:28 +00:00
|
|
|
|
2022-07-25 18:17:28 +00:00
|
|
|
if [ $RETURN -ne 0 ]; then
|
|
|
|
echo "ERROR: Altcoin strings found in Bitcoin-only firmware."
|
|
|
|
fi
|
2019-08-26 12:50:28 +00:00
|
|
|
exit $RETURN
|