Skip to content

Commit 35b1a8c

Browse files
committed
[Fix] Pre-Release 0.4.0c - No Cloud recording amendments
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
1 parent a6453e4 commit 35b1a8c

File tree

3 files changed

+25
-16
lines changed

3 files changed

+25
-16
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.4.0b
1+
0.4.0c

src/static/static/home/yi-hack-v5/script/cloudAPI_fake

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/sh
22

3+
# 0.4.0c
4+
35
CONF_FILE="etc/system.conf"
46
if [ -d "/tmp/sd/yi-hack-v5" ]; then
57
YI_HACK_V5_PREFIX="/tmp/sd/yi-hack-v5"
@@ -85,8 +87,8 @@ elif [ "$c" = "136" ]; then
8587
echo '{"code":"20000","time":'$(date +%s)'000}'
8688
elif [ "$c" = "141" ]; then
8789
#CMD_do_tnp_on_line
88-
echo '{"code":"20000"}'
89-
#echo '{"code":"20000","data":{"InitString":"ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCD","License":"ABDCDE:","DID":"'$uid'"}}'
90+
#echo '{"code":"20000"}'
91+
echo '{"code":"20000","data":{"InitString":"ABGBJPLDIEEKKKHPODFPPOEJHNCHFCGAHHEDKFIJIDBCDIBDPKIIAONIPBCLBOKOPIKMDKPMNADGACDMBC","License":"FTTDHY:","DID":"'$uid'"}}'
9092
elif [ "$c" = "142" ]; then
9193
#CMD_do_get_dev_info
9294
TIMEZONE=$(get_config TIMEZONE)
@@ -98,12 +100,12 @@ elif [ "$c" = "142" ]; then
98100
#{"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}}}
99101
elif [ "$c" = "304" ]; then
100102
#CMD_do_update_event_v4
101-
echo '{"code":"20000"}'
102-
#echo '{"code":"20000","data":{"id":"'$EventTime'","ipcSetTime":"180"}}'
103+
#echo '{"code":"20000"}'
104+
echo '{"code":"20000","data":{"id":"'$EventTime'","ipcSetTime":"180"}}'
103105
elif [ "$c" = "306" ]; then
104106
#CMD_do_gen_presigned_url_v5
105-
echo '{"code":"20000"}'
106-
#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"}}'
107+
#echo '{"code":"20000"}'
108+
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"}}'
107109
elif [ "$c" = "411" ]; then
108110
#CMD_do_event_upload
109111
echo ''

src/static/static/home/yi-hack-v5/script/system.sh

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/sh
22

3+
# 0.4.0c
4+
35
CONF_FILE="etc/system.conf"
46

57
if [ -d "/tmp/sd/yi-hack-v5" ]; then
@@ -65,6 +67,11 @@ if [ -f $YI_HACK_UPGRADE_PATH/yi-hack-v5/fw_upgrade_in_progress ]; then
6567
exit
6668
fi
6769

70+
# Update cloudAPI_fake if necessary
71+
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
72+
cp -f $YI_HACK_PREFIX/script/cloudAPI_fake /home/app/
73+
fi
74+
6875
# Manual Wi-Fi config
6976
if [ -f /tmp/sd/recover/configure_wifi.cfg ]; then
7077
mv /tmp/sd/recover/configure_wifi.cfg /tmp/configure_wifi.cfg
@@ -150,14 +157,19 @@ else
150157
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"
151158
fi
152159

160+
if [[ $(get_config NTPD) == "yes" ]] ; then
161+
# Wait until all the other processes have been initialized
162+
sleep 5 && ntpd -p $(get_config NTP_SERVER) &
163+
fi
164+
153165
if [[ $(get_config DISABLE_CLOUD) == "no" ]] ; then
154166
(
155167
cd /home/app
156168
killall dispatch
157169
LD_PRELOAD=/home/yi-hack-v5/lib/ipc_multiplex.so ./dispatch &
158170
sleep 2
159171
LD_LIBRARY_PATH="/home/yi-hack-v5/lib:/lib:/home/lib:/home/app/locallib:/home/hisiko/hisilib" ./rmm &
160-
sleep 4
172+
sleep 8
161173
./mp4record &
162174
./cloud &
163175
./p2p_tnp &
@@ -174,13 +186,13 @@ if [[ $(get_config DISABLE_CLOUD) == "yes" ]] ; then
174186
LD_PRELOAD=/home/yi-hack-v5/lib/ipc_multiplex.so ./dispatch &
175187
sleep 2
176188
LD_LIBRARY_PATH="/home/yi-hack-v5/lib:/lib:/home/lib:/home/app/locallib:/home/hisiko/hisilib" ./rmm &
177-
sleep 4
178-
./cloud &
179-
189+
sleep 8
180190
if [[ $(get_config REC_WITHOUT_CLOUD) == "yes" ]] ; then
181191
cd /home/app
182192
./mp4record &
183193
fi
194+
sleep 4
195+
./cloud &
184196
)
185197
fi
186198

@@ -213,11 +225,6 @@ mkdir -p $YI_HACK_PREFIX/etc/dropbear
213225
dropbear -R -B
214226
fi
215227

216-
if [[ $(get_config NTPD) == "yes" ]] ; then
217-
# Wait until all the other processes have been initialized
218-
sleep 5 && ntpd -p $(get_config NTP_SERVER) &
219-
fi
220-
221228
ipc_multiplexer &
222229

223230
mqttv4 &

0 commit comments

Comments
 (0)