Skip to content

Commit

Permalink
Excluding installation only sound files from wyzehack binary.
Browse files Browse the repository at this point in the history
The sound files are only used during installation, excluding them
from the wyzehack binary to save space.
  • Loading branch information
HclX committed Jan 24, 2021
1 parent a0fa142 commit 623cd32
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 12 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ functions:
* Moving v2 installation location from /params to /configs.
* WIP v3 camera support (require special steps, see tools/v3/README.md).
* Tested on firmware 4.9.6.224 (V2), 4.6.10.224 (PAN) and 4.36.0.228 (V3).
* Reducing wyzehack binary size by excluding some sound files.

## 0.4.04:
* Adding support for latest firmware (4.9.6.218, 4.10.6.218).
Expand Down
14 changes: 12 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,20 @@ tar \
--group=root:0 \
--mtime='1970-01-01' \
--dereference \
-cz -O -C wyze_hack . >>.tmp/Upgrade/wyze_hack.sh
-cz -O -C wyze_hack \
./main.sh \
./hack_ver.inc \
./bin \
./init \
>>.tmp/Upgrade/wyze_hack.sh

chmod a+x .tmp/Upgrade/wyze_hack.sh
cp ./wyze_hack/upgraderun.sh .tmp/Upgrade/
cp -r \
./wyze_hack/upgraderun.sh \
./wyze_hack/upgrade.sh \
./wyze_hack/install_snd \
.tmp/Upgrade/

tar \
--sort=name \
--owner=root:0 \
Expand Down
2 changes: 1 addition & 1 deletion installer/remote_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ fi

python3 -m pip install requests
python3 ./wyze_updater.py --token ~/.wyze_token $DEBUG update \
-m WYZEC1-JZ -m WYZECP1_JEF -m WYZE_CAKP2JFUS -f ./firmware.bin -p 11808
-m WYZEC1-JZ -m WYZECP1_JEF -m WYZE_CAKP2JFUS -m WYZEDB3 -f ./firmware.bin -p 11808
Binary file modified release/wyze_hacks_0_5_01.zip
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
18 changes: 9 additions & 9 deletions wyze_hack/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ cmd_install() {

echo "WyzeHack: Starting wyze hack installer..."

play_sound $WYZEHACK_DIR/snd/begin.wav 50
play_sound $THIS_DIR/install_snd/begin.wav 50

if [ -f $SD_DIR/debug/.copyfiles ];
then
Expand All @@ -589,7 +589,7 @@ cmd_install() {
if [ -z "$WYZEAPP_VER" ];
then
echo "WyzeHack: Wyze version not found!!!"
play_sound $WYZEHACK_DIR/snd/failed.wav 50
play_sound $THIS_DIR/install_snd/failed.wav 50
return 1
fi

Expand All @@ -604,10 +604,10 @@ cmd_install() {
rm /params/wyze_hack.*
fi

if [ -f /tmp/Upgrade/config.inc ];
if [ -f $THIS_DIR/config.inc ];
then
echo "WyzeHack: Use config file /tmp/Upgrade/config.inc"
sed 's/\r$//' /tmp/Upgrade/config.inc > $WYZEHACK_CFG
echo "WyzeHack: Use config file $THIS_DIR/config.inc"
sed 's/\r$//' $THIS_DIR/config.inc > $WYZEHACK_CFG
fi

if [ -f "$SD_DIR/config.inc" ];
Expand All @@ -619,14 +619,14 @@ cmd_install() {
if [ ! -f "$WYZEHACK_CFG" ];
then
echo "WyzeHack: Configuration file not found, aborting..."
play_sound $WYZEHACK_DIR/snd/failed.wav 50
play_sound $THIS_DIR/install_snd/failed.wav 50
return 1
fi

if [ -z "$DEVICE_MODEL" ];
then
echo "WyzeHack: Unknown device model, aborting..."
play_sound $WYZEHACK_DIR/snd/failed.wav 50
play_sound $THIS_DIR/install_snd/failed.wav 50
return 1
fi

Expand All @@ -639,11 +639,11 @@ cmd_install() {
if ! hook_init;
then
echo "WyzeHack: Hooking up boot script failed"
play_sound $WYZEHACK_DIR/snd/failed.wav 50
play_sound $THIS_DIR/install_snd/failed.wav 50
return 1
fi

play_sound $WYZEHACK_DIR/snd/finished.wav 50
play_sound $THIS_DIR/install_snd/finished.wav 50

rm $SD_DIR/version.ini.old > /dev/null 2>&1
mv $SD_DIR/version.ini $SD_DIR/version.ini.old > /dev/null 2>&1
Expand Down

0 comments on commit 623cd32

Please sign in to comment.