Skip to content

Commit

Permalink
Merge branch 'master' into beta
Browse files Browse the repository at this point in the history
  • Loading branch information
jmtatsch committed May 11, 2021
2 parents a4a8bdc + 90076db commit c153709
Show file tree
Hide file tree
Showing 16 changed files with 651 additions and 772 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,6 @@ firmware_mod/config/userscripts/motiondetection/*
firmware_mod/config/userscripts/startup/*
!firmware_mod/config/userscripts/startup/*.dist
firmware_mod/root/.ssh/*

# avoid committing OSX .DS_Store files
.DS_Store
1,366 changes: 621 additions & 745 deletions firmware_mod/config/ssl/cacert/cacert.pem

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions firmware_mod/config/ssl/cacert/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
# We don't mind you downloading the PEM file from us in an automated fashion,
# but please don't do it more often than once per day. It is only updated once
# every few months anyway.
# ABOUT: https://curl.haxx.se/docs/caextract.html
# ABOUT: https://curl.se/docs/caextract.html

curl --remote-name --time-cond cacert.pem https://curl.haxx.se/ca/cacert.pem
curl --remote-name --time-cond cacert.pem https://curl.se/ca/cacert.pem
1 change: 1 addition & 0 deletions firmware_mod/config/ssl/letsencrypt_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ fi


## Adding cronjob to keep the cert updated
mkdir -p ${CONFIGPATH}/cron/periodic/weekly
cat > ${CONFIGPATH}/cron/periodic/weekly/letsencrypt <<EOF
#!/bin/sh
PATH=/system/sdcard/bin:/system/bin:/bin:/sbin:/usr/bin:/usr/sbin
Expand Down
19 changes: 4 additions & 15 deletions firmware_mod/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,26 +85,15 @@ if [ ! "$SWAP_ZRAM" = false ]; then
swapon -p 20 /dev/zram0
fi

## Create crontab dir and start crond:
if [ ! -d /system/sdcard/config/cron ]; then
mkdir -p ${CONFIGPATH}/cron/crontabs
CRONPERIODIC="${CONFIGPATH}/cron/periodic"
echo ${CONFIGPATH}/cron/crontabs/periodic
# Wish busybox sh had brace expansion...
## Create cron periodic dirs and start crond:
CRONPERIODIC="${CONFIGPATH}/cron/periodic"
if [ ! -d $CRONPERIODIC ]; then
mkdir -p ${CRONPERIODIC}/15min \
${CRONPERIODIC}/hourly \
${CRONPERIODIC}/daily \
${CRONPERIODIC}/weekly \
${CRONPERIODIC}/monthly
cat > ${CONFIGPATH}/cron/crontabs/root <<EOF
# min hour day month weekday command
*/15 * * * * busybox run-parts ${CRONPERIODIC}/15min
0 * * * * busybox run-parts ${CRONPERIODIC}/hourly
0 2 * * * busybox run-parts ${CRONPERIODIC}/daily
0 3 * * 6 busybox run-parts ${CRONPERIODIC}/weekly
0 5 1 * * busybox run-parts ${CRONPERIODIC}/monthly
EOF
echo "Created cron directories and standard interval jobs" >> $LOGPATH
echo "Created cron periodic directories" >> $LOGPATH
fi
/system/sdcard/bin/busybox crond -L /system/sdcard/log/crond.log -c /system/sdcard/config/cron/crontabs

Expand Down
6 changes: 6 additions & 0 deletions firmware_mod/scripts/detectionOn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,12 @@ send_snapshot() {
$smbclient_cmd -D "$smb_stills_path" -c "lcd /tmp; mkdir $groupname; cd $groupname; put $snapshot_tempfilename; rename $snapshot_tempfilename $filename.jpg"
) &
fi
# Wait for all background jobs to finish before existing
debug_msg "Waiting for background jobs to end in send_snapshot function:"
for jobpid in $(jobs -p); do
wait "$jobpid"
debug_msg "Job in send_snapshot function $jobpid ended"
done

}

Expand Down
2 changes: 1 addition & 1 deletion firmware_mod/scripts/wifi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ wpa_action_watchdog_stop() {
}

ap_scanner_ssid() {
grep -v '^[[:space:]]*#' "$WPA_CONFIG" | grep "ssid=" | head -1 | cut -d "=" -f2
grep -v '^[[:space:]]*#' "$WPA_CONFIG" | grep "ssid=" | cut -d "=" -f2
}

ap_scanner_scan() {
Expand Down
2 changes: 1 addition & 1 deletion firmware_mod/www/cgi-bin/ui_camera.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ if [ -n "$F_cmd" ]; then
if [ -n "${F_videoPort+x}" ]; then
videoport=$(echo "${F_videoPort}"| tr '\n')
rewrite_config /system/sdcard/config/rtspserver.conf PORT "$videoport"
echo "Set video port tp ${videoport}<br />"
echo "Set video port to ${videoport}<br />"
fi
if [ -n "${F_autoNightMode+x}" ]; then
rewrite_config /system/sdcard/config/autonight.conf autonight_mode $F_autoNightMode
Expand Down
6 changes: 3 additions & 3 deletions firmware_mod/www/lib/w3css/w3.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ legend{color:inherit;display:table;max-width:100%;padding:0;white-space:normal}t
[type=search]::-webkit-search-decoration{-webkit-appearance:none}
::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}
/* End extract */
html,body{font-family:Verdana,sans-serif;font-size:15px;line-height:1.5}html{overflow-x:hidden}
html,body{font-family:Verdana,sans-serif;font-size:15px;line-height:1.5;height:100%}html{overflow-x:hidden}
h1{font-size:36px}h2{font-size:30px}h3{font-size:24px}h4{font-size:20px}h5{font-size:18px}h6{font-size:16px}.w3-serif{font-family:serif}
h1,h2,h3,h4,h5,h6{font-family:"Segoe UI",Arial,sans-serif;font-weight:400;margin:10px 0}.w3-wide{letter-spacing:4px}
hr{border:0;border-top:1px solid #eee;margin:20px 0}
Expand Down Expand Up @@ -79,7 +79,7 @@ hr{border:0;border-top:1px solid #eee;margin:20px 0}
.w3-col.l5{width:41.66666%}.w3-col.l6{width:49.99999%}.w3-col.l7{width:58.33333%}.w3-col.l8{width:66.66666%}
.w3-col.l9{width:74.99999%}.w3-col.l10{width:83.33333%}.w3-col.l11{width:91.66666%}.w3-col.l12{width:99.99999%}}
.w3-rest{overflow:hidden}.w3-stretch{margin-left:-16px;margin-right:-16px}
.w3-content,.w3-auto{margin-left:auto;margin-right:auto}.w3-content{max-width:980px}.w3-auto{max-width:1140px}
.w3-content,.w3-auto{margin-left:auto;margin-right:auto}.w3-content{max-width:980px}.w3-auto{max-width:1140px;height:100%;display:flex;flex-direction:column}#content{flex:1}
.w3-cell-row{display:table;width:100%}.w3-cell{display:table-cell}
.w3-cell-top{vertical-align:top}.w3-cell-middle{vertical-align:middle}.w3-cell-bottom{vertical-align:bottom}
.w3-hide{display:none!important}.w3-show-block,.w3-show{display:block!important}.w3-show-inline-block{display:inline-block!important}
Expand Down Expand Up @@ -229,4 +229,4 @@ hr{border:0;border-top:1px solid #eee;margin:20px 0}
.w3-border-light-grey,.w3-hover-border-light-grey:hover,.w3-border-light-gray,.w3-hover-border-light-gray:hover{border-color:#f1f1f1!important}
.w3-border-dark-grey,.w3-hover-border-dark-grey:hover,.w3-border-dark-gray,.w3-hover-border-dark-gray:hover{border-color:#616161!important}
.w3-border-pale-red,.w3-hover-border-pale-red:hover{border-color:#ffe7e7!important}.w3-border-pale-green,.w3-hover-border-pale-green:hover{border-color:#e7ffe7!important}
.w3-border-pale-yellow,.w3-hover-border-pale-yellow:hover{border-color:#ffffcc!important}.w3-border-pale-blue,.w3-hover-border-pale-blue:hover{border-color:#e7ffff!important}
.w3-border-pale-yellow,.w3-hover-border-pale-yellow:hover{border-color:#ffffcc!important}.w3-border-pale-blue,.w3-hover-border-pale-blue:hover{border-color:#e7ffff!important}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added hacks/cfw/wyzecam_v2/cfw-1.2.bin
Binary file not shown.
6 changes: 3 additions & 3 deletions hacks/firmware/create_hacked_firmware_wyzecam_v2.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/usr/bin/env bash
FIRMWARE_ROOT=$(pwd)/../../firmware_original/wyzecam_v2/4.9.4.28/
FIRMWARE_ROOT=$(pwd)/../../firmware_original/wyzecam_v2/rtsp-4.28.4.49/
TMPDIR=./rootfs
OUTFILE=./rootfs.bin
rm -r $TMPDIR $OUTFILE
unsquashfs -d $TMPDIR $FIRMWARE_ROOT/rootfs.bin
cp ./rcfile.sh $TMPDIR/etc/init.d/rcS
mksquashfs $TMPDIR $OUTFILE -b 1048576 -comp xz -Xdict-size 100%
mksquashfs $TMPDIR $OUTFILE -b 131072 -comp xz -Xdict-size 100%
./packer.py $FIRMWARE_ROOT/kernel.bin $OUTFILE $FIRMWARE_ROOT/driver.bin $FIRMWARE_ROOT/appfs.bin firmware_hacked.bin
rm -r $TMPDIR $OUTFILE
rm -r $TMPDIR $OUTFILE
8 changes: 6 additions & 2 deletions hacks/firmware/rcfile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ do
sleep 1
echo "Mount sucessful"
if [ -f /system/sdcard/run.sh ]; then
# Turn off blue LED
echo 1 > /sys/class/gpio/gpio39/value
echo 39 > /sys/class/gpio/unexport
echo "Starting run.sh from sdcard"
Expand All @@ -111,6 +112,9 @@ echo 1 > /sys/class/gpio/gpio39/value
echo 39 > /sys/class/gpio/unexport


if [ -f /system/init/app_init.sh ]; then
/system/init/app_init.sh &
# Run init script
APP_INIT=/system/init/app_init.sh
if [ -f $APP_INIT ]; then
chmod a+x $APP_INIT
$APP_INIT &
fi

0 comments on commit c153709

Please sign in to comment.