Skip to content

Commit

Permalink
[Fix] Pre-Release 0.4.0c - No Cloud recording amendments
Browse files Browse the repository at this point in the history
 Changes to be committed:
	modified:   VERSION
	modified:   src/static/static/home/yi-hack-v5/script/cloudAPI_fake
	modified:   src/static/static/home/yi-hack-v5/script/system.sh
  • Loading branch information
alienatedsec committed Aug 9, 2023
1 parent a6453e4 commit 35b1a8c
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 16 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.4.0b
0.4.0c
14 changes: 8 additions & 6 deletions src/static/static/home/yi-hack-v5/script/cloudAPI_fake
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/sh

# 0.4.0c

CONF_FILE="etc/system.conf"
if [ -d "/tmp/sd/yi-hack-v5" ]; then
YI_HACK_V5_PREFIX="/tmp/sd/yi-hack-v5"
Expand Down Expand Up @@ -85,8 +87,8 @@ elif [ "$c" = "136" ]; then
echo '{"code":"20000","time":'$(date +%s)'000}'
elif [ "$c" = "141" ]; then
#CMD_do_tnp_on_line
echo '{"code":"20000"}'
#echo '{"code":"20000","data":{"InitString":"ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCD","License":"ABDCDE:","DID":"'$uid'"}}'
#echo '{"code":"20000"}'
echo '{"code":"20000","data":{"InitString":"ABGBJPLDIEEKKKHPODFPPOEJHNCHFCGAHHEDKFIJIDBCDIBDPKIIAONIPBCLBOKOPIKMDKPMNADGACDMBC","License":"FTTDHY:","DID":"'$uid'"}}'
elif [ "$c" = "142" ]; then
#CMD_do_get_dev_info
TIMEZONE=$(get_config TIMEZONE)
Expand All @@ -98,12 +100,12 @@ elif [ "$c" = "142" ]; then
#{"code":"20000","data":{"timezone":"GMT+01:00","language":"en-US","tz_offset":3600000,"css_flag":0,"css_mode":0,"appParam":{"schedule_power":{"schedule_power_on":{"enable":0,"repeater":"","time":"2212220800"},"schedule_power_off":{"enable":0,"repeater":"","time":"2212222200"}}},"doorbellCoolingDuration":"0","model":"38","allowFeature":{"Vehicle":0,"Animal":0,"Person":1}}}
elif [ "$c" = "304" ]; then
#CMD_do_update_event_v4
echo '{"code":"20000"}'
#echo '{"code":"20000","data":{"id":"'$EventTime'","ipcSetTime":"180"}}'
#echo '{"code":"20000"}'
echo '{"code":"20000","data":{"id":"'$EventTime'","ipcSetTime":"180"}}'
elif [ "$c" = "306" ]; then
#CMD_do_gen_presigned_url_v5
echo '{"code":"20000"}'
#echo '{"code":"20000","data":{"jpg":{"method":"PUT","pwd":"unusedpassword_","url":"http://server/yyyy/mm/dd/xxx/xxx.jpg?Expires=xxx&OSSAccessKeyId=xxx&Signature=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"},"mp4":{"method":"PUT","pwd":"unusedpassword_","url":"http://server/yyyy/mm/dd/xxx/xxx.mp4?Expires=xxx&OSSAccessKeyId=xxx&Signature=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"},"ok":"true"}}'
#echo '{"code":"20000"}'
echo '{"code":"20000","data":{"jpg":{"method":"PUT","pwd":"unusedpassword_","url":"http://server/yyyy/mm/dd/xxx/xxx.jpg?Expires=xxx&OSSAccessKeyId=xxx&Signature=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"},"mp4":{"method":"PUT","pwd":"unusedpassword_","url":"http://server/yyyy/mm/dd/xxx/xxx.mp4?Expires=xxx&OSSAccessKeyId=xxx&Signature=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"},"ok":"true"}}'
elif [ "$c" = "411" ]; then
#CMD_do_event_upload
echo ''
Expand Down
25 changes: 16 additions & 9 deletions src/static/static/home/yi-hack-v5/script/system.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/sh

# 0.4.0c

CONF_FILE="etc/system.conf"

if [ -d "/tmp/sd/yi-hack-v5" ]; then
Expand Down Expand Up @@ -65,6 +67,11 @@ if [ -f $YI_HACK_UPGRADE_PATH/yi-hack-v5/fw_upgrade_in_progress ]; then
exit
fi

# Update cloudAPI_fake if necessary
if [[ "$(grep -m 3 -n '' /home/app/cloudAPI_fake | tail -n 1 | cut -d ':' -f 2 | cut -c 3-)" != "$(grep -m 3 -n '' $YI_HACK_PREFIX/script/cloudAPI_fake | tail -n 1 | cut -d ':' -f 2 | cut -c 3-)" ]]; then
cp -f $YI_HACK_PREFIX/script/cloudAPI_fake /home/app/
fi

# Manual Wi-Fi config
if [ -f /tmp/sd/recover/configure_wifi.cfg ]; then
mv /tmp/sd/recover/configure_wifi.cfg /tmp/configure_wifi.cfg
Expand Down Expand Up @@ -150,14 +157,19 @@ else
echo "Version file does not exist. Your SD card is not FAT32 to load the latest firmware correctly. Go to https://github.com/alienatedsec/yi-hack-v5/discussions/267" > "/tmp/sd/fat32error.txt"
fi

if [[ $(get_config NTPD) == "yes" ]] ; then
# Wait until all the other processes have been initialized
sleep 5 && ntpd -p $(get_config NTP_SERVER) &
fi

if [[ $(get_config DISABLE_CLOUD) == "no" ]] ; then
(
cd /home/app
killall dispatch
LD_PRELOAD=/home/yi-hack-v5/lib/ipc_multiplex.so ./dispatch &
sleep 2
LD_LIBRARY_PATH="/home/yi-hack-v5/lib:/lib:/home/lib:/home/app/locallib:/home/hisiko/hisilib" ./rmm &
sleep 4
sleep 8
./mp4record &
./cloud &
./p2p_tnp &
Expand All @@ -174,13 +186,13 @@ if [[ $(get_config DISABLE_CLOUD) == "yes" ]] ; then
LD_PRELOAD=/home/yi-hack-v5/lib/ipc_multiplex.so ./dispatch &
sleep 2
LD_LIBRARY_PATH="/home/yi-hack-v5/lib:/lib:/home/lib:/home/app/locallib:/home/hisiko/hisilib" ./rmm &
sleep 4
./cloud &

sleep 8
if [[ $(get_config REC_WITHOUT_CLOUD) == "yes" ]] ; then
cd /home/app
./mp4record &
fi
sleep 4
./cloud &
)
fi

Expand Down Expand Up @@ -213,11 +225,6 @@ mkdir -p $YI_HACK_PREFIX/etc/dropbear
dropbear -R -B
fi

if [[ $(get_config NTPD) == "yes" ]] ; then
# Wait until all the other processes have been initialized
sleep 5 && ntpd -p $(get_config NTP_SERVER) &
fi

ipc_multiplexer &

mqttv4 &
Expand Down

0 comments on commit 35b1a8c

Please sign in to comment.