2023-03-24 15:17:44 +00:00
|
|
|
#!/bin/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
|
|
|
|
# BIP39 or SLIP39 words that have "dash", "nem", or "flo" in them
|
|
|
|
EXCEPTIONS+=( "cinema" "dash" "enemy" "float" "flock" "flower" "floor" "floral" )
|
|
|
|
EXCEPTIONS+=( "mnemonic" ) # has NEM in it
|
|
|
|
EXCEPTIONS+=( "workflow" "overflow" ) # has Flo in it
|
|
|
|
EXCEPTIONS+=( "SyntaxError" ) # has Axe in it
|
|
|
|
|
|
|
|
GREP_ARGS=()
|
|
|
|
for exception in "${EXCEPTIONS[@]}"; do
|
|
|
|
GREP_ARGS+=(-e $exception)
|
|
|
|
done
|
2021-05-25 14:02:01 +00:00
|
|
|
|
2019-08-26 12:50:28 +00:00
|
|
|
# dump all coins except the first 3 (Bitcoin, Testnet, Regtest)
|
2022-08-02 10:10:56 +00:00
|
|
|
ALTCOINS=$(./common/tools/cointool.py dump -l -p -t -d trezor1 -d trezor2 | grep '"name"' | cut -d '"' -f 4 | tail -n +4)
|
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
|