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
|
|
|
|
# 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
|
2023-03-27 15:52:59 +00:00
|
|
|
EXCEPTIONS+=( "DKDNEM" ) # has NEM in it, some sort of weird coincidence
|
2023-07-31 15:02:36 +00:00
|
|
|
EXCEPTIONS+=( "confirm_ethereum_tx" ) # is model-specific, so is in layout/__init__.py instead of ethereum/layout.py
|
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
|
|
|
|
2019-08-26 12:50:28 +00:00
|
|
|
# dump all coins except the first 3 (Bitcoin, Testnet, Regtest)
|
2023-08-28 14:46:57 +00:00
|
|
|
ALTCOINS=$(./common/tools/cointool.py dump -l -p -t -d T1B1 -d T2T1 -d T2B1 | 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
|