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
|
2023-11-07 10:17:31 +00:00
|
|
|
# BIP39 or SLIP39 words that have "dash" in them
|
2023-11-14 11:15:04 +00:00
|
|
|
EXCEPTIONS+=( "dash" )
|
2024-02-11 17:30:20 +00:00
|
|
|
EXCEPTIONS+=( "confirm_ethereum_tx" "confirm_ethereum_staking_tx" ) # model-specific, so is in layout/__init__.py instead of ethereum/layout.py
|
2023-08-11 15:57:32 +00:00
|
|
|
EXCEPTIONS+=( "__" ) # ignoring the translations blob (section__key delimiter)
|
2024-03-05 16:09:57 +00:00
|
|
|
EXCEPTIONS+=( "{}" "{0}" ) # ignoring the translations blob (template identifier)
|
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
|
|
|
|
ALTCOINS=$(./common/tools/cointool.py dump -l -p -t -d T1B1 -d T2T1 -d T2B1 | 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
|