├── VERSION
├── unbrick
├── y20ga
│ ├── filename
│ ├── newhome
│ │ └── app
│ │ │ └── script
│ │ │ ├── ethdhcp.sh
│ │ │ └── wifidhcp.sh
│ └── mtd.txt
├── y25ga
│ ├── filename
│ ├── newhome
│ │ └── app
│ │ │ └── script
│ │ │ ├── ethdhcp.sh
│ │ │ └── wifidhcp.sh
│ └── mtd.txt
├── y30qa
│ ├── filename
│ ├── newhome
│ │ └── app
│ │ │ └── script
│ │ │ ├── ethdhcp.sh
│ │ │ └── wifidhcp.sh
│ └── mtd.txt
├── y501gc
│ ├── filename
│ ├── newhome
│ │ └── app
│ │ │ └── script
│ │ │ ├── ethdhcp.sh
│ │ │ └── wifidhcp.sh
│ └── mtd.txt
├── create.jffs2
├── gzip.exe
├── mkfs.jffs2
├── mkimage.exe
├── clean.sh
├── clean.bat
├── build.bat
├── mount.jffs2
└── README.md
├── .gitattributes
├── sdhack
├── y20ga
│ └── Factory
│ │ ├── factory_test.sh
│ │ ├── configure_wifi.cfg.ori
│ │ └── configure_wifi.sh
├── y25ga
│ └── Factory
│ │ ├── factory_test.sh
│ │ ├── configure_wifi.cfg.ori
│ │ └── configure_wifi.sh
├── y30qa
│ └── Factory
│ │ ├── factory_test.sh
│ │ ├── configure_wifi.cfg.ori
│ │ └── configure_wifi.sh
└── y501gc
│ └── Factory
│ ├── factory_test.sh
│ ├── configure_wifi.cfg.ori
│ └── configure_wifi.sh
├── src
├── proccgi
│ ├── proccgi
│ │ ├── .gitignore
│ │ ├── config.mak
│ │ └── Makefile
│ ├── .gitignore
│ ├── cleanup.proccgi
│ ├── init.proccgi
│ ├── install.proccgi
│ ├── compile.proccgi
│ └── config.mak
├── static
│ ├── static
│ │ └── home
│ │ │ ├── yi-hack-v4
│ │ │ └── yi-hack
│ │ │ ├── fw_upgrade_in_progress
│ │ │ ├── etc
│ │ │ ├── ptz_presets.conf
│ │ │ ├── fallback.jpg
│ │ │ ├── camera.conf
│ │ │ ├── system.conf
│ │ │ └── mqttv4.conf
│ │ │ ├── script
│ │ │ ├── blacklist
│ │ │ │ ├── ip
│ │ │ │ └── url
│ │ │ ├── env.sh
│ │ │ ├── ethdhcp.sh
│ │ │ ├── wifidhcp.sh
│ │ │ ├── clean_records.sh
│ │ │ ├── mqtt_advertise
│ │ │ │ └── check_conf.sh
│ │ │ ├── conf2mqtt.sh
│ │ │ └── configure_wifi.sh
│ │ │ └── bin
│ │ │ └── cloudAPI
│ ├── .gitignore
│ ├── cleanup.static
│ ├── init.static
│ ├── compile.static
│ └── install.static
├── ftpd
│ ├── .gitignore
│ ├── cleanup.ftpd
│ ├── compile.ftpd
│ ├── install.ftpd
│ ├── init.ftpd
│ └── ftpd.patch
├── minimp4
│ ├── .gitignore
│ ├── cleanup.minimp4
│ ├── install.minimp4
│ ├── init.minimp4
│ └── compile.minimp4
├── mjpeg-avi
│ ├── .gitignore
│ ├── cleanup.mjpeg-avi
│ ├── init.mjpeg-avi
│ ├── install.mjpeg-avi
│ ├── makefile.patch
│ ├── compile.mjpeg-avi
│ └── create_avi.sh
├── mqtt
│ ├── .gitignore
│ ├── cleanup.mqtt
│ ├── init.mqtt
│ ├── install.mqtt
│ ├── config.mak
│ └── compile.mqtt
├── www
│ ├── .gitignore
│ ├── cleanup.www
│ ├── init.www
│ ├── httpd
│ │ ├── htdocs
│ │ │ ├── css
│ │ │ │ ├── all.css
│ │ │ │ └── normalize.min.css
│ │ │ ├── img
│ │ │ │ ├── home.png
│ │ │ │ ├── icon.png
│ │ │ │ ├── loading.gif
│ │ │ │ ├── wlan_no_signal.png
│ │ │ │ ├── wlan_medium_signal.png
│ │ │ │ ├── wlan_strong_signal.png
│ │ │ │ ├── wlan_weak_signal.png
│ │ │ │ ├── arrow-up-bold-box-outline.png
│ │ │ │ └── arrow-up-right-bold-box-outline.png
│ │ │ ├── js
│ │ │ │ ├── app.js
│ │ │ │ └── modules
│ │ │ │ │ ├── snapshot.js
│ │ │ │ │ ├── speak.js
│ │ │ │ │ └── global.js
│ │ │ └── pages
│ │ │ │ ├── snapshot.html
│ │ │ │ ├── eventsfile.html
│ │ │ │ └── timelapse.html
│ │ ├── cgi-bin
│ │ │ ├── hostname.js
│ │ │ ├── reboot.sh
│ │ │ ├── reset.sh
│ │ │ ├── save.sh
│ │ │ ├── record.sh
│ │ │ ├── proxy.sh
│ │ │ ├── eventsdirdel.sh
│ │ │ ├── eventsdir.sh
│ │ │ ├── eventsfiledel.sh
│ │ │ ├── validate.sh
│ │ │ ├── get_configs.sh
│ │ │ ├── links.sh
│ │ │ ├── preset.sh
│ │ │ ├── speaker_file.sh
│ │ │ └── snapshot.sh
│ │ └── tools
│ │ │ └── remcomm.awk
│ ├── install.www
│ └── compile.www
├── mosquitto
│ ├── .gitignore
│ ├── config.mosquitto
│ ├── cleanup.mosquitto
│ ├── init.mosquitto
│ ├── install.mosquitto
│ └── compile.mosquitto
├── rtsp_server_yi
│ ├── .gitignore
│ ├── cleanup.rtsp_server_yi
│ ├── install.rtsp_server_yi
│ ├── init.rtsp_server_yi
│ ├── compile.rtsp_server_yi
│ └── Makefile.rtsp_server_yi
├── h264grabber
│ ├── .gitignore
│ ├── cleanup.h264grabber
│ ├── init.h264grabber
│ ├── install.h264grabber
│ ├── h264grabber
│ │ └── Makefile
│ └── compile.h264grabber
├── proxychains-ng
│ ├── .gitignore
│ ├── proxychains.conf
│ ├── cleanup.proxychains-ng
│ ├── init.proxychains-ng
│ ├── config.mak
│ ├── install.proxychains-ng
│ └── compile.proxychains-ng
├── sftp-server
│ ├── .gitignore
│ ├── cleanup.sftp-server
│ ├── install.sftp-server
│ ├── init.sftp-server
│ └── compile.sftp-server
├── mdnsd
│ ├── .gitignore
│ ├── cleanup.mdnsd
│ ├── install.mdnsd
│ ├── config.mdnsd
│ ├── compile.mdnsd
│ └── init.mdnsd
├── jq
│ ├── .gitignore
│ ├── cleanup.jq
│ ├── install.jq
│ ├── init.jq
│ └── compile.jq
├── pcmvol
│ ├── .gitignore
│ ├── cleanup.pcmvol
│ ├── init.pcmvol
│ ├── install.pcmvol
│ ├── pcmvol
│ │ └── Makefile
│ └── compile.pcmvol
├── libwolf_02_mqtt
│ ├── .gitignore
│ ├── cleanup.libwolf_02_mqtt
│ ├── config.wolfmqtt
│ ├── fflush.patch
│ ├── install.libwolf_02_mqtt
│ ├── compile.libwolf_02_mqtt
│ └── init.libwolf_02_mqtt
├── libwolf_01_ssl
│ ├── .gitignore
│ ├── cleanup.libwolf_01_ssl
│ ├── config.wolfssl
│ ├── compile.libwolf_01_ssl
│ ├── install.libwolf_01_ssl
│ └── init.libwolf_01_ssl
├── set_tz_offset
│ ├── .gitignore
│ ├── cleanup.set_tz_offset
│ ├── init.set_tz_offset
│ ├── install.set_tz_offset
│ ├── set_tz_offset
│ │ ├── Makefile
│ │ └── set_tz_offset.h
│ └── compile.set_tz_offset
├── alsa-lib
│ ├── .gitignore
│ ├── cleanup.alsa-lib
│ ├── install.alsa-lib
│ ├── compile.alsa-lib
│ ├── patch
│ │ ├── 001_dmix_support_S16_LE_format.patch
│ │ ├── 300-ensure-ringbuffer-empty-with-dmix.patch
│ │ ├── 201-fix-snd_pcm_area_silence-remaining-samples-issue.patch
│ │ └── 100-link_fix.patch
│ └── init.alsa-lib
├── busybox
│ ├── .gitignore
│ ├── install.busybox
│ ├── cleanup.busybox
│ ├── compile.busybox
│ ├── config.busybox
│ ├── init.busybox
│ ├── onvif.patch
│ ├── auth.patch
│ └── gzdef.patch
├── dropbear
│ ├── .gitignore
│ ├── cleanup.dropbear
│ ├── config.dropbear
│ ├── compile.dropbear
│ ├── install.dropbear
│ ├── init.dropbear
│ └── localoptions.h
├── mqtt-config
│ ├── .gitignore
│ ├── cleanup.mqtt-config
│ ├── install.mqtt-config
│ ├── mqtt-config
│ │ ├── validate.h
│ │ ├── config.h
│ │ ├── Makefile
│ │ ├── mqtt.h
│ │ └── mqtt-config.h
│ ├── init.mqtt-config
│ └── compile.mqtt-config
├── ipc_cmd
│ ├── cleanup.ipc_cmd
│ ├── .gitignore
│ ├── init.ipc_cmd
│ ├── ipc_cmd
│ │ ├── ptz.h
│ │ ├── ipc_multiplex.h
│ │ ├── ipc_notify.h
│ │ ├── Makefile
│ │ └── ipc_read.h
│ ├── install.ipc_cmd
│ └── compile.ipc_cmd
├── snapshot
│ ├── .gitignore
│ ├── snapshot
│ │ ├── wm_res
│ │ │ ├── high
│ │ │ │ ├── wm_540p_0.bmp
│ │ │ │ ├── wm_540p_1.bmp
│ │ │ │ ├── wm_540p_2.bmp
│ │ │ │ ├── wm_540p_3.bmp
│ │ │ │ ├── wm_540p_4.bmp
│ │ │ │ ├── wm_540p_5.bmp
│ │ │ │ ├── wm_540p_6.bmp
│ │ │ │ ├── wm_540p_7.bmp
│ │ │ │ ├── wm_540p_8.bmp
│ │ │ │ ├── wm_540p_9.bmp
│ │ │ │ ├── wm_540p_10.bmp
│ │ │ │ ├── wm_540p_11.bmp
│ │ │ │ └── wm_540p_12.bmp
│ │ │ └── low
│ │ │ │ ├── wm_540p_0.bmp
│ │ │ │ ├── wm_540p_1.bmp
│ │ │ │ ├── wm_540p_10.bmp
│ │ │ │ ├── wm_540p_11.bmp
│ │ │ │ ├── wm_540p_12.bmp
│ │ │ │ ├── wm_540p_2.bmp
│ │ │ │ ├── wm_540p_3.bmp
│ │ │ │ ├── wm_540p_4.bmp
│ │ │ │ ├── wm_540p_5.bmp
│ │ │ │ ├── wm_540p_6.bmp
│ │ │ │ ├── wm_540p_7.bmp
│ │ │ │ ├── wm_540p_8.bmp
│ │ │ │ └── wm_540p_9.bmp
│ │ ├── add_water.h
│ │ ├── convert2jpg.h
│ │ └── water_mark.h
│ ├── init.snapshot
│ ├── cleanup.snapshot
│ ├── install.snapshot
│ └── compile.snapshot
├── rRTSPServer
│ ├── .gitignore
│ ├── cleanup.rRTSPServer
│ ├── install.rRTSPServer
│ ├── remove-mangling.patch
│ ├── not-arduino.patch
│ ├── Makefile.libhelix-aac
│ ├── friend.patch
│ ├── rRTSPServer.patch
│ ├── src
│ │ └── FileServerMediaSubsession_BC.cpp
│ ├── compile.rRTSPServer
│ ├── include
│ │ ├── FileServerMediaSubsession_BC.hh
│ │ ├── Speaker.hh
│ │ ├── VideoFramedMemorySource.hh
│ │ ├── PCMFileSink.hh
│ │ └── PCMAudioFileServerMediaSubsession_BC.hh
│ └── init.rRTSPServer
└── onvif_simple_server
│ ├── .gitignore
│ ├── install.onvif_simple_server
│ ├── cleanup.onvif_simple_server
│ ├── arm-openwrt-linux-toolchain.cmake
│ ├── mbedtls_config.h
│ ├── init.onvif_simple_server
│ └── path.patch
├── sysroot
├── y20ga
│ └── home
│ │ └── yi-hack
│ │ └── fw_upgrade_in_progress
├── y25ga
│ └── home
│ │ └── yi-hack
│ │ └── fw_upgrade_in_progress
├── y30qa
│ └── home
│ │ └── yi-hack
│ │ └── fw_upgrade_in_progress
└── y501gc
│ └── home
│ └── yi-hack
│ └── fw_upgrade_in_progress
├── assets
├── yi-hack-allwinner-logo.png
└── yi-hack-allwinner-logo.sketch
├── .gitignore
├── .github
└── workflows
│ ├── stale.yml
│ └── main.yml
├── LICENSE
├── .gitmodules
├── scripts
├── pack_fw.all.sh
├── cleanup.sh
└── common.sh
└── CONTRIBUTING.md
/VERSION:
--------------------------------------------------------------------------------
1 | 0.4.0
2 |
--------------------------------------------------------------------------------
/unbrick/y20ga/filename:
--------------------------------------------------------------------------------
1 | y20ga
2 |
--------------------------------------------------------------------------------
/unbrick/y25ga/filename:
--------------------------------------------------------------------------------
1 | y25ga
2 |
--------------------------------------------------------------------------------
/unbrick/y30qa/filename:
--------------------------------------------------------------------------------
1 | y30qa
2 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | *.sh text eol=lf
2 |
--------------------------------------------------------------------------------
/sdhack/y20ga/Factory/factory_test.sh:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/sdhack/y25ga/Factory/factory_test.sh:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/sdhack/y30qa/Factory/factory_test.sh:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/sdhack/y501gc/Factory/factory_test.sh:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/unbrick/y501gc/filename:
--------------------------------------------------------------------------------
1 | y501gc
2 |
--------------------------------------------------------------------------------
/src/proccgi/proccgi/.gitignore:
--------------------------------------------------------------------------------
1 | build/
2 |
--------------------------------------------------------------------------------
/src/static/static/home/yi-hack-v4:
--------------------------------------------------------------------------------
1 | yi-hack
--------------------------------------------------------------------------------
/src/static/static/home/yi-hack/fw_upgrade_in_progress:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/sysroot/y20ga/home/yi-hack/fw_upgrade_in_progress:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/sysroot/y25ga/home/yi-hack/fw_upgrade_in_progress:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/sysroot/y30qa/home/yi-hack/fw_upgrade_in_progress:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/sysroot/y501gc/home/yi-hack/fw_upgrade_in_progress:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/ftpd/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore the install dir
2 | _install/
3 |
4 |
--------------------------------------------------------------------------------
/src/minimp4/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore the install dir
2 | _install/
3 |
--------------------------------------------------------------------------------
/src/mjpeg-avi/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore the install dir
2 | _install/
3 |
--------------------------------------------------------------------------------
/src/mqtt/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore the install dir
2 | _install/
3 |
4 |
--------------------------------------------------------------------------------
/src/www/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore the install dir
2 | _install/
3 |
4 |
--------------------------------------------------------------------------------
/src/mosquitto/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore the install dir
2 | _install/
3 |
4 |
--------------------------------------------------------------------------------
/src/proccgi/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore the install dir
2 | _install/
3 |
4 |
--------------------------------------------------------------------------------
/src/rtsp_server_yi/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore the install dir
2 | _install/
3 |
--------------------------------------------------------------------------------
/src/static/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore the install dir
2 | _install/
3 |
4 |
--------------------------------------------------------------------------------
/src/h264grabber/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore the install dir
2 | _install/
3 |
4 |
--------------------------------------------------------------------------------
/src/proxychains-ng/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore the install dir
2 | _install/
3 |
4 |
--------------------------------------------------------------------------------
/src/sftp-server/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore the install dir
2 | _install/
3 |
4 |
--------------------------------------------------------------------------------
/src/mdnsd/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore the install dir
2 | _install/
3 | mdnsd-0.12/
4 |
--------------------------------------------------------------------------------
/src/jq/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore the install dir
2 | _install/
3 | jq-1.5/
4 | jq-*.tar.gz
5 |
--------------------------------------------------------------------------------
/src/pcmvol/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore the install dir
2 | _install/
3 | pcmvol/pcmvol
4 |
5 |
--------------------------------------------------------------------------------
/unbrick/create.jffs2:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | ./mkfs.jffs2 -l --pad=$1 -e 4KiB -r $2 -o $3
4 |
--------------------------------------------------------------------------------
/src/libwolf_02_mqtt/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore the install dir
2 | _install/
3 | wolf*
4 | v*.tar.gz
5 |
--------------------------------------------------------------------------------
/unbrick/gzip.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/roleoroleo/yi-hack-Allwinner/HEAD/unbrick/gzip.exe
--------------------------------------------------------------------------------
/src/libwolf_01_ssl/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore the install dir
2 | _install/
3 | wolfssl*
4 | v*.tar.gz
5 |
--------------------------------------------------------------------------------
/src/mosquitto/config.mosquitto:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | #USE_MOSQUITTO=1
4 | BUILD_FOLDER="mosquitto"
5 |
--------------------------------------------------------------------------------
/src/set_tz_offset/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore the install dir
2 | _install/
3 | set_tz_offset/set_tz_offset
4 |
--------------------------------------------------------------------------------
/src/www/cleanup.www:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
--------------------------------------------------------------------------------
/unbrick/mkfs.jffs2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/roleoroleo/yi-hack-Allwinner/HEAD/unbrick/mkfs.jffs2
--------------------------------------------------------------------------------
/unbrick/mkimage.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/roleoroleo/yi-hack-Allwinner/HEAD/unbrick/mkimage.exe
--------------------------------------------------------------------------------
/src/static/static/home/yi-hack/etc/ptz_presets.conf:
--------------------------------------------------------------------------------
1 | 0=
2 | 1=
3 | 2=
4 | 3=
5 | 4=
6 | 5=
7 | 6=
8 | 7=
9 |
--------------------------------------------------------------------------------
/src/alsa-lib/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore the install dir
2 | _install/
3 | alsa-lib-1.1.4.1/
4 | alsa-lib-*.tar.bz2
5 |
--------------------------------------------------------------------------------
/src/busybox/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore the install dir
2 | _install/
3 | busybox-1.36.1/
4 | *.tar.gz
5 | *.tar.bz2
6 |
--------------------------------------------------------------------------------
/src/dropbear/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore the install dir
2 | _install/
3 | dropbear-DROPBEAR_2024.86/
4 | *.tar.gz
5 |
--------------------------------------------------------------------------------
/src/mqtt-config/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore the install dir
2 | _install/
3 | mqtt-config/lib
4 | mqtt-config/mqtt-config
5 |
--------------------------------------------------------------------------------
/src/www/init.www:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | rm -rf ./_install
7 |
--------------------------------------------------------------------------------
/assets/yi-hack-allwinner-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/roleoroleo/yi-hack-Allwinner/HEAD/assets/yi-hack-allwinner-logo.png
--------------------------------------------------------------------------------
/src/static/cleanup.static:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | rm -rf ./_install
7 |
--------------------------------------------------------------------------------
/src/www/httpd/htdocs/css/all.css:
--------------------------------------------------------------------------------
1 | @import url("normalize.min.css");
2 | @import url("skeleton.min.css");
3 | @import url("custom.css");
--------------------------------------------------------------------------------
/src/www/httpd/htdocs/img/home.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/roleoroleo/yi-hack-Allwinner/HEAD/src/www/httpd/htdocs/img/home.png
--------------------------------------------------------------------------------
/src/www/httpd/htdocs/img/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/roleoroleo/yi-hack-Allwinner/HEAD/src/www/httpd/htdocs/img/icon.png
--------------------------------------------------------------------------------
/assets/yi-hack-allwinner-logo.sketch:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/roleoroleo/yi-hack-Allwinner/HEAD/assets/yi-hack-allwinner-logo.sketch
--------------------------------------------------------------------------------
/src/static/init.static:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | rm -rf ./_install
7 |
8 |
--------------------------------------------------------------------------------
/src/www/httpd/htdocs/img/loading.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/roleoroleo/yi-hack-Allwinner/HEAD/src/www/httpd/htdocs/img/loading.gif
--------------------------------------------------------------------------------
/src/jq/cleanup.jq:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | rm -rf jq-1.5
7 | rm jq*.tar.gz
8 |
--------------------------------------------------------------------------------
/src/ftpd/cleanup.ftpd:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | cd pure-ftpd
7 |
8 | make clean
9 |
--------------------------------------------------------------------------------
/src/ipc_cmd/cleanup.ipc_cmd:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | cd ipc_cmd
7 |
8 | make clean
9 |
--------------------------------------------------------------------------------
/src/pcmvol/cleanup.pcmvol:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | cd pcmvol
7 |
8 | make clean
9 |
--------------------------------------------------------------------------------
/src/proccgi/cleanup.proccgi:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | cd proccgi
7 |
8 | make clean
9 |
--------------------------------------------------------------------------------
/src/www/httpd/htdocs/img/wlan_no_signal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/roleoroleo/yi-hack-Allwinner/HEAD/src/www/httpd/htdocs/img/wlan_no_signal.png
--------------------------------------------------------------------------------
/src/busybox/install.busybox:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | rsync -a ./_install/* ../../build/
7 |
8 |
--------------------------------------------------------------------------------
/src/minimp4/cleanup.minimp4:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | cd minimp4
7 |
8 | rm -f minimp4_yi
9 |
--------------------------------------------------------------------------------
/src/mjpeg-avi/cleanup.mjpeg-avi:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | cd mjpeg-avi
7 |
8 | make clean
9 |
--------------------------------------------------------------------------------
/src/snapshot/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore the install dir
2 | _install/
3 | snapshot/SDK
4 | snapshot/ffmpeg-4.0.6
5 | snapshot/jpeg-9e
6 | snapshot/framefinder
7 |
--------------------------------------------------------------------------------
/src/snapshot/snapshot/wm_res/high/wm_540p_0.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/roleoroleo/yi-hack-Allwinner/HEAD/src/snapshot/snapshot/wm_res/high/wm_540p_0.bmp
--------------------------------------------------------------------------------
/src/snapshot/snapshot/wm_res/high/wm_540p_1.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/roleoroleo/yi-hack-Allwinner/HEAD/src/snapshot/snapshot/wm_res/high/wm_540p_1.bmp
--------------------------------------------------------------------------------
/src/snapshot/snapshot/wm_res/high/wm_540p_2.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/roleoroleo/yi-hack-Allwinner/HEAD/src/snapshot/snapshot/wm_res/high/wm_540p_2.bmp
--------------------------------------------------------------------------------
/src/snapshot/snapshot/wm_res/high/wm_540p_3.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/roleoroleo/yi-hack-Allwinner/HEAD/src/snapshot/snapshot/wm_res/high/wm_540p_3.bmp
--------------------------------------------------------------------------------
/src/snapshot/snapshot/wm_res/high/wm_540p_4.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/roleoroleo/yi-hack-Allwinner/HEAD/src/snapshot/snapshot/wm_res/high/wm_540p_4.bmp
--------------------------------------------------------------------------------
/src/snapshot/snapshot/wm_res/high/wm_540p_5.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/roleoroleo/yi-hack-Allwinner/HEAD/src/snapshot/snapshot/wm_res/high/wm_540p_5.bmp
--------------------------------------------------------------------------------
/src/snapshot/snapshot/wm_res/high/wm_540p_6.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/roleoroleo/yi-hack-Allwinner/HEAD/src/snapshot/snapshot/wm_res/high/wm_540p_6.bmp
--------------------------------------------------------------------------------
/src/snapshot/snapshot/wm_res/high/wm_540p_7.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/roleoroleo/yi-hack-Allwinner/HEAD/src/snapshot/snapshot/wm_res/high/wm_540p_7.bmp
--------------------------------------------------------------------------------
/src/snapshot/snapshot/wm_res/high/wm_540p_8.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/roleoroleo/yi-hack-Allwinner/HEAD/src/snapshot/snapshot/wm_res/high/wm_540p_8.bmp
--------------------------------------------------------------------------------
/src/snapshot/snapshot/wm_res/high/wm_540p_9.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/roleoroleo/yi-hack-Allwinner/HEAD/src/snapshot/snapshot/wm_res/high/wm_540p_9.bmp
--------------------------------------------------------------------------------
/src/snapshot/snapshot/wm_res/low/wm_540p_0.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/roleoroleo/yi-hack-Allwinner/HEAD/src/snapshot/snapshot/wm_res/low/wm_540p_0.bmp
--------------------------------------------------------------------------------
/src/snapshot/snapshot/wm_res/low/wm_540p_1.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/roleoroleo/yi-hack-Allwinner/HEAD/src/snapshot/snapshot/wm_res/low/wm_540p_1.bmp
--------------------------------------------------------------------------------
/src/snapshot/snapshot/wm_res/low/wm_540p_10.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/roleoroleo/yi-hack-Allwinner/HEAD/src/snapshot/snapshot/wm_res/low/wm_540p_10.bmp
--------------------------------------------------------------------------------
/src/snapshot/snapshot/wm_res/low/wm_540p_11.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/roleoroleo/yi-hack-Allwinner/HEAD/src/snapshot/snapshot/wm_res/low/wm_540p_11.bmp
--------------------------------------------------------------------------------
/src/snapshot/snapshot/wm_res/low/wm_540p_12.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/roleoroleo/yi-hack-Allwinner/HEAD/src/snapshot/snapshot/wm_res/low/wm_540p_12.bmp
--------------------------------------------------------------------------------
/src/snapshot/snapshot/wm_res/low/wm_540p_2.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/roleoroleo/yi-hack-Allwinner/HEAD/src/snapshot/snapshot/wm_res/low/wm_540p_2.bmp
--------------------------------------------------------------------------------
/src/snapshot/snapshot/wm_res/low/wm_540p_3.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/roleoroleo/yi-hack-Allwinner/HEAD/src/snapshot/snapshot/wm_res/low/wm_540p_3.bmp
--------------------------------------------------------------------------------
/src/snapshot/snapshot/wm_res/low/wm_540p_4.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/roleoroleo/yi-hack-Allwinner/HEAD/src/snapshot/snapshot/wm_res/low/wm_540p_4.bmp
--------------------------------------------------------------------------------
/src/snapshot/snapshot/wm_res/low/wm_540p_5.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/roleoroleo/yi-hack-Allwinner/HEAD/src/snapshot/snapshot/wm_res/low/wm_540p_5.bmp
--------------------------------------------------------------------------------
/src/snapshot/snapshot/wm_res/low/wm_540p_6.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/roleoroleo/yi-hack-Allwinner/HEAD/src/snapshot/snapshot/wm_res/low/wm_540p_6.bmp
--------------------------------------------------------------------------------
/src/snapshot/snapshot/wm_res/low/wm_540p_7.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/roleoroleo/yi-hack-Allwinner/HEAD/src/snapshot/snapshot/wm_res/low/wm_540p_7.bmp
--------------------------------------------------------------------------------
/src/snapshot/snapshot/wm_res/low/wm_540p_8.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/roleoroleo/yi-hack-Allwinner/HEAD/src/snapshot/snapshot/wm_res/low/wm_540p_8.bmp
--------------------------------------------------------------------------------
/src/snapshot/snapshot/wm_res/low/wm_540p_9.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/roleoroleo/yi-hack-Allwinner/HEAD/src/snapshot/snapshot/wm_res/low/wm_540p_9.bmp
--------------------------------------------------------------------------------
/src/static/static/home/yi-hack/etc/fallback.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/roleoroleo/yi-hack-Allwinner/HEAD/src/static/static/home/yi-hack/etc/fallback.jpg
--------------------------------------------------------------------------------
/src/www/httpd/htdocs/img/wlan_medium_signal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/roleoroleo/yi-hack-Allwinner/HEAD/src/www/httpd/htdocs/img/wlan_medium_signal.png
--------------------------------------------------------------------------------
/src/www/httpd/htdocs/img/wlan_strong_signal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/roleoroleo/yi-hack-Allwinner/HEAD/src/www/httpd/htdocs/img/wlan_strong_signal.png
--------------------------------------------------------------------------------
/src/www/httpd/htdocs/img/wlan_weak_signal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/roleoroleo/yi-hack-Allwinner/HEAD/src/www/httpd/htdocs/img/wlan_weak_signal.png
--------------------------------------------------------------------------------
/src/www/install.www:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | rsync -a ./_install/* ../../build/home/yi-hack/
7 |
--------------------------------------------------------------------------------
/src/h264grabber/cleanup.h264grabber:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | cd h264grabber
7 |
8 | make clean
9 |
--------------------------------------------------------------------------------
/src/proxychains-ng/proxychains.conf:
--------------------------------------------------------------------------------
1 | dynamic_chain
2 |
3 | chain_len = 1
4 |
5 | tcp_read_time_out 15000
6 | tcp_connect_time_out 8000
7 |
8 | [ProxyList]
9 |
--------------------------------------------------------------------------------
/src/rRTSPServer/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore the install dir
2 | _install/
3 | live/
4 | live.*.tar.gz
5 | fdk-aac/
6 | v*.tar.gz
7 | libhelix-aac/
8 | 2.0.0.tar.gz
9 |
--------------------------------------------------------------------------------
/src/snapshot/snapshot/wm_res/high/wm_540p_10.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/roleoroleo/yi-hack-Allwinner/HEAD/src/snapshot/snapshot/wm_res/high/wm_540p_10.bmp
--------------------------------------------------------------------------------
/src/snapshot/snapshot/wm_res/high/wm_540p_11.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/roleoroleo/yi-hack-Allwinner/HEAD/src/snapshot/snapshot/wm_res/high/wm_540p_11.bmp
--------------------------------------------------------------------------------
/src/snapshot/snapshot/wm_res/high/wm_540p_12.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/roleoroleo/yi-hack-Allwinner/HEAD/src/snapshot/snapshot/wm_res/high/wm_540p_12.bmp
--------------------------------------------------------------------------------
/src/rtsp_server_yi/cleanup.rtsp_server_yi:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | cd RtspServer
7 |
8 | make clean
9 |
--------------------------------------------------------------------------------
/src/set_tz_offset/cleanup.set_tz_offset:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | cd set_tz_offset
7 |
8 | make clean
9 |
--------------------------------------------------------------------------------
/src/sftp-server/cleanup.sftp-server:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | cd openssh-portable
7 |
8 | make clean
9 |
--------------------------------------------------------------------------------
/src/alsa-lib/cleanup.alsa-lib:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | rm -rf alsa-lib-1.1.4.1
7 | rm -f alsa-lib-*.tar.bz2
8 |
--------------------------------------------------------------------------------
/src/proxychains-ng/cleanup.proxychains-ng:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | cd proxychains-ng
7 |
8 | make clean
9 |
--------------------------------------------------------------------------------
/src/www/httpd/cgi-bin/hostname.js:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | printf "Content-type: text/javascript\r\n\r\n"
4 |
5 | printf "hostname=\"%s\";" $(cat /home/yi-hack/etc/hostname)
6 |
--------------------------------------------------------------------------------
/src/www/httpd/htdocs/img/arrow-up-bold-box-outline.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/roleoroleo/yi-hack-Allwinner/HEAD/src/www/httpd/htdocs/img/arrow-up-bold-box-outline.png
--------------------------------------------------------------------------------
/src/dropbear/cleanup.dropbear:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | source config.dropbear
7 |
8 | rm -rf "${BUILD_FOLDER}"
9 |
--------------------------------------------------------------------------------
/src/static/compile.static:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | mkdir -p ./_install
7 |
8 | rsync -a ./static/* ./_install
9 |
--------------------------------------------------------------------------------
/src/ipc_cmd/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore the install dir
2 | _install/
3 | ipc_cmd/ipc_cmd
4 | ipc_cmd/ipc_multiplex.so
5 | ipc_cmd/ipc_read
6 | ipc_cmd/ipc_notify
7 | ipc_cmd/ipc2file
8 |
--------------------------------------------------------------------------------
/src/ipc_cmd/init.ipc_cmd:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | rm -rf ./_install
7 |
8 | cd ipc_cmd
9 |
10 | make clean
11 |
--------------------------------------------------------------------------------
/src/mqtt/cleanup.mqtt:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | rm -rf ./_install
7 |
8 | cd mqttv4
9 |
10 | make clean
11 |
--------------------------------------------------------------------------------
/src/pcmvol/init.pcmvol:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | rm -rf ./_install
7 |
8 | cd pcmvol
9 |
10 | make clean
11 |
--------------------------------------------------------------------------------
/src/snapshot/init.snapshot:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | rm -rf ./_install
7 |
8 | cd snapshot
9 |
10 | make clean
11 |
--------------------------------------------------------------------------------
/src/www/httpd/htdocs/img/arrow-up-right-bold-box-outline.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/roleoroleo/yi-hack-Allwinner/HEAD/src/www/httpd/htdocs/img/arrow-up-right-bold-box-outline.png
--------------------------------------------------------------------------------
/unbrick/clean.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | for DIR in * ; do
4 | if [ -d $DIR ]; then
5 | FILENAME=`cat $DIR/filename`
6 | rm -f $DIR/home_$FILENAME.gz
7 | fi
8 | done
9 |
--------------------------------------------------------------------------------
/src/h264grabber/init.h264grabber:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | rm -rf ./_install
7 |
8 | cd h264grabber
9 |
10 | make clean
11 |
--------------------------------------------------------------------------------
/src/mdnsd/cleanup.mdnsd:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | source config.mdnsd
7 |
8 | rm -rf "${BUILD_FOLDER}"
9 |
10 | make clean
11 |
--------------------------------------------------------------------------------
/src/mqtt-config/cleanup.mqtt-config:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | rm -rf ./_install
7 |
8 | cd mqtt-config
9 |
10 | make clean
11 |
--------------------------------------------------------------------------------
/src/static/install.static:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | mkdir -p ../../build/
7 |
8 | rsync -a ./_install/* ../../build/
9 |
10 |
--------------------------------------------------------------------------------
/src/set_tz_offset/init.set_tz_offset:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | rm -rf ./_install
7 |
8 | cd set_tz_offset
9 |
10 | make clean
11 |
--------------------------------------------------------------------------------
/sdhack/y20ga/Factory/configure_wifi.cfg.ori:
--------------------------------------------------------------------------------
1 | # Don't use backslash char \
2 | # Don't use double quote " around ssid and psk
3 | # Space chars are allowed
4 | wifi_ssid=My AP 2.4GHz
5 | wifi_psk=password$
6 |
--------------------------------------------------------------------------------
/sdhack/y25ga/Factory/configure_wifi.cfg.ori:
--------------------------------------------------------------------------------
1 | # Don't use backslash char \
2 | # Don't use double quote " around ssid and psk
3 | # Space chars are allowed
4 | wifi_ssid=My AP 2.4GHz
5 | wifi_psk=password$
6 |
--------------------------------------------------------------------------------
/sdhack/y30qa/Factory/configure_wifi.cfg.ori:
--------------------------------------------------------------------------------
1 | # Don't use backslash char \
2 | # Don't use double quote " around ssid and psk
3 | # Space chars are allowed
4 | wifi_ssid=My AP 2.4GHz
5 | wifi_psk=password$
6 |
--------------------------------------------------------------------------------
/sdhack/y501gc/Factory/configure_wifi.cfg.ori:
--------------------------------------------------------------------------------
1 | # Don't use backslash char \
2 | # Don't use double quote " around ssid and psk
3 | # Space chars are allowed
4 | wifi_ssid=My AP 2.4GHz
5 | wifi_psk=password$
6 |
--------------------------------------------------------------------------------
/src/busybox/cleanup.busybox:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | source config.busybox
7 |
8 | rm -rf "${BUILD_FOLDER}"
9 |
10 | make clean
11 |
--------------------------------------------------------------------------------
/src/ftpd/compile.ftpd:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | cd pure-ftpd || exit 1
7 |
8 | make clean
9 | make -j$(nproc) || exit 1
10 | make install
11 |
--------------------------------------------------------------------------------
/src/rRTSPServer/cleanup.rRTSPServer:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | rm -rf live
7 | rm -f live.*.tar.gz
8 | rm -rf fdk-aac
9 | rm -f v*.tar.gz
10 |
--------------------------------------------------------------------------------
/src/snapshot/cleanup.snapshot:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | cd snapshot
7 |
8 | make clean
9 | rm -rf SDK
10 | rm -rf jpeg-*
11 | rm -rf ffmpeg-*
12 |
--------------------------------------------------------------------------------
/src/libwolf_01_ssl/cleanup.libwolf_01_ssl:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | source config.wolfssl
7 |
8 | rm -rf ./_install
9 | rm -rf "${BUILD_FOLDER}"
10 |
--------------------------------------------------------------------------------
/src/libwolf_02_mqtt/cleanup.libwolf_02_mqtt:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | source config.wolfmqtt
7 |
8 | rm -rf ./_install
9 | rm -rf "${BUILD_FOLDER}"
10 |
--------------------------------------------------------------------------------
/src/ftpd/install.ftpd:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | mkdir -p ../../build/home/yi-hack/sbin/
7 |
8 | rsync -a ./_install/sbin/pure-ftpd ../../build/home/yi-hack/sbin/
9 |
--------------------------------------------------------------------------------
/src/jq/install.jq:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | mkdir -p ../../build/home/yi-hack/bin/ || exit 1
7 |
8 | rsync -av ./_install/* ../../build/home/yi-hack/ || exit 1
9 |
--------------------------------------------------------------------------------
/src/mdnsd/install.mdnsd:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | mkdir -p ../../build/home/yi-hack/sbin/
7 |
8 | rsync -a ./_install/sbin/mdnsd ../../build/home/yi-hack/sbin/
9 |
--------------------------------------------------------------------------------
/src/pcmvol/install.pcmvol:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | mkdir -p ../../build/home/yi-hack/bin/ || exit 1
7 |
8 | rsync -av ./_install/* ../../build/home/yi-hack/ || exit 1
9 |
--------------------------------------------------------------------------------
/src/alsa-lib/install.alsa-lib:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | mkdir -p ../../build/home/yi-hack/lib/
7 |
8 | rsync -a ./_install/lib/libasound.so* ../../build/home/yi-hack/lib/
9 |
--------------------------------------------------------------------------------
/src/minimp4/install.minimp4:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | mkdir -p ../../build/home/yi-hack/bin/ || exit 1
7 |
8 | rsync -av ./_install/* ../../build/home/yi-hack/ || exit 1
9 |
--------------------------------------------------------------------------------
/src/proccgi/init.proccgi:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -e
4 |
5 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
6 | cd $SCRIPT_DIR
7 |
8 | rm -rf ./_install
9 |
10 | cp config.mak ./proccgi/
11 |
12 | cd proccgi
13 |
14 | make clean
15 |
--------------------------------------------------------------------------------
/src/snapshot/install.snapshot:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | mkdir -p ../../build/home/yi-hack/bin/ || exit 1
7 |
8 | rsync -av ./_install/* ../../build/home/yi-hack/ || exit 1
9 |
--------------------------------------------------------------------------------
/src/h264grabber/install.h264grabber:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | mkdir -p ../../build/home/yi-hack/bin/ || exit 1
7 |
8 | rsync -av ./_install/* ../../build/home/yi-hack/ || exit 1
9 |
--------------------------------------------------------------------------------
/src/proccgi/install.proccgi:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -e
4 |
5 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
6 | cd $SCRIPT_DIR
7 |
8 | mkdir -p ../../build/home/yi-hack/bin/
9 |
10 | rsync -av ./_install/* ../../build/home/yi-hack/
11 |
--------------------------------------------------------------------------------
/src/rRTSPServer/install.rRTSPServer:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | mkdir -p ../../build/home/yi-hack/bin/ || exit 1
7 |
8 | rsync -av ./_install/* ../../build/home/yi-hack/ || exit 1
9 |
--------------------------------------------------------------------------------
/src/rtsp_server_yi/install.rtsp_server_yi:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | mkdir -p ../../build/home/yi-hack/bin/ || exit 1
7 |
8 | rsync -av ./_install/* ../../build/home/yi-hack/ || exit 1
9 |
--------------------------------------------------------------------------------
/src/set_tz_offset/install.set_tz_offset:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | mkdir -p ../../build/home/yi-hack/bin/ || exit 1
7 |
8 | rsync -av ./_install/* ../../build/home/yi-hack/ || exit 1
9 |
--------------------------------------------------------------------------------
/src/busybox/compile.busybox:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | source config.busybox
7 |
8 | cd "${BUILD_FOLDER}"
9 |
10 | make -j$(nproc) ARCH=arm || exit 1
11 | make install || exit 1
12 |
--------------------------------------------------------------------------------
/src/mqtt/init.mqtt:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -e
4 |
5 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
6 | cd $SCRIPT_DIR
7 |
8 | rm -rf ./_install
9 |
10 | cd mqttv4
11 | git reset --hard
12 |
13 | cp ../config.mak config.mak
14 |
15 | cd ..
16 |
--------------------------------------------------------------------------------
/src/sftp-server/install.sftp-server:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | mkdir -p ../../build/home/yi-hack/usr/libexec/ || exit 1
7 |
8 | rsync -av ./_install/* ../../build/home/yi-hack/ || exit 1
9 |
--------------------------------------------------------------------------------
/src/proxychains-ng/init.proxychains-ng:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | rm -rf ./_install
7 |
8 | cd proxychains-ng || exit 1
9 | git reset --hard || exit 1
10 |
11 | cp ../config.mak ./
12 |
--------------------------------------------------------------------------------
/src/static/static/home/yi-hack/script/blacklist/ip:
--------------------------------------------------------------------------------
1 | 47.89.253.148
2 | 47.74.247.115
3 | 47.251.52.14
4 | 47.90.241.246
5 | 47.74.131.238
6 | 47.74.208.204
7 | 47.90.203.190
8 | 47.254.18.99
9 | 47.88.59.209
10 | 47.90.240.160
11 | 47.74.255.9
12 |
--------------------------------------------------------------------------------
/unbrick/y20ga/newhome/app/script/ethdhcp.sh:
--------------------------------------------------------------------------------
1 | killall udhcpc
2 | HN="yi-hack"
3 | if [ -f /home/yi-hack/etc/hostname ]; then
4 | HN=$(cat /home/yi-hack/etc/hostname)
5 | fi
6 | udhcpc -i eth0 -b -s /home/app/script/default.script -x hostname:$HN
7 |
--------------------------------------------------------------------------------
/unbrick/y20ga/newhome/app/script/wifidhcp.sh:
--------------------------------------------------------------------------------
1 | killall udhcpc
2 | HN="yi-hack"
3 | if [ -f /home/yi-hack/etc/hostname ]; then
4 | HN=$(cat /home/yi-hack/etc/hostname)
5 | fi
6 | udhcpc -i wlan0 -b -s /home/app/script/default.script -x hostname:$HN
7 |
--------------------------------------------------------------------------------
/unbrick/y25ga/newhome/app/script/ethdhcp.sh:
--------------------------------------------------------------------------------
1 | killall udhcpc
2 | HN="yi-hack"
3 | if [ -f /home/yi-hack/etc/hostname ]; then
4 | HN=$(cat /home/yi-hack/etc/hostname)
5 | fi
6 | udhcpc -i eth0 -b -s /home/app/script/default.script -x hostname:$HN
7 |
--------------------------------------------------------------------------------
/unbrick/y25ga/newhome/app/script/wifidhcp.sh:
--------------------------------------------------------------------------------
1 | killall udhcpc
2 | HN="yi-hack"
3 | if [ -f /home/yi-hack/etc/hostname ]; then
4 | HN=$(cat /home/yi-hack/etc/hostname)
5 | fi
6 | udhcpc -i wlan0 -b -s /home/app/script/default.script -x hostname:$HN
7 |
--------------------------------------------------------------------------------
/unbrick/y30qa/newhome/app/script/ethdhcp.sh:
--------------------------------------------------------------------------------
1 | killall udhcpc
2 | HN="yi-hack"
3 | if [ -f /home/yi-hack/etc/hostname ]; then
4 | HN=$(cat /home/yi-hack/etc/hostname)
5 | fi
6 | udhcpc -i eth0 -b -s /home/app/script/default.script -x hostname:$HN
7 |
--------------------------------------------------------------------------------
/unbrick/y30qa/newhome/app/script/wifidhcp.sh:
--------------------------------------------------------------------------------
1 | killall udhcpc
2 | HN="yi-hack"
3 | if [ -f /home/yi-hack/etc/hostname ]; then
4 | HN=$(cat /home/yi-hack/etc/hostname)
5 | fi
6 | udhcpc -i wlan0 -b -s /home/app/script/default.script -x hostname:$HN
7 |
--------------------------------------------------------------------------------
/unbrick/y501gc/newhome/app/script/ethdhcp.sh:
--------------------------------------------------------------------------------
1 | killall udhcpc
2 | HN="yi-hack"
3 | if [ -f /home/yi-hack/etc/hostname ]; then
4 | HN=$(cat /home/yi-hack/etc/hostname)
5 | fi
6 | udhcpc -i eth0 -b -s /home/app/script/default.script -x hostname:$HN
7 |
--------------------------------------------------------------------------------
/unbrick/y501gc/newhome/app/script/wifidhcp.sh:
--------------------------------------------------------------------------------
1 | killall udhcpc
2 | HN="yi-hack"
3 | if [ -f /home/yi-hack/etc/hostname ]; then
4 | HN=$(cat /home/yi-hack/etc/hostname)
5 | fi
6 | udhcpc -i wlan0 -b -s /home/app/script/default.script -x hostname:$HN
7 |
--------------------------------------------------------------------------------
/src/mdnsd/config.mdnsd:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | VERSION="0.12"
4 | MAIN_URL="https://github.com/troglobit/mdnsd/releases/download/v${VERSION}/mdnsd-${VERSION}.tar.gz"
5 | PACKAGE="mdnsd-${VERSION}"
6 | ARCHIVE="${PACKAGE}.tar.gz"
7 | BUILD_FOLDER="mdnsd-${VERSION}"
8 |
--------------------------------------------------------------------------------
/unbrick/clean.bat:
--------------------------------------------------------------------------------
1 | @ECHO OFF
2 | SETLOCAL EnableDelayedExpansion
3 |
4 | FOR /F %%x in ('dir /B /D /A:D *') do (
5 | SET DIR=%%x
6 | FOR /F "tokens=*" %%g IN ('type !DIR!\filename') do (SET FILENAME=%%g)
7 | DEL !DIR!\home_!FILENAME!.gz
8 | )
9 |
--------------------------------------------------------------------------------
/src/dropbear/config.dropbear:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | VERSION="2024.86"
4 | MAIN_URL=https://github.com/mkj/dropbear/archive/refs/tags/DROPBEAR_${VERSION}.tar.gz
5 | PACKAGE="DROPBEAR_${VERSION}"
6 | ARCHIVE="${PACKAGE}.tar.gz"
7 | BUILD_FOLDER="dropbear-DROPBEAR_${VERSION}"
--------------------------------------------------------------------------------
/src/www/httpd/htdocs/js/app.js:
--------------------------------------------------------------------------------
1 | var APP = (function() {
2 |
3 | function init() {
4 | APP.global.init();
5 | }
6 |
7 | return {
8 | init: init
9 | };
10 |
11 | })(jQuery);
12 |
13 | $(function() {
14 | APP.init();
15 | });
--------------------------------------------------------------------------------
/src/www/httpd/htdocs/pages/snapshot.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |

6 |
7 |
--------------------------------------------------------------------------------
/src/ipc_cmd/ipc_cmd/ptz.h:
--------------------------------------------------------------------------------
1 | #define MSTAR 1
2 | #define ALLWINNER 2
3 | #define ALLWINNER_V2 3
4 | #define ALLWINNER_V2_ALT 4
5 |
6 | int is_ptz(char *model);
7 | int get_model_suffix(char *model, int size);
8 | int read_ptz(int *px, int *py, int *pi);
9 |
--------------------------------------------------------------------------------
/src/mjpeg-avi/init.mjpeg-avi:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | rm -rf ./_install
7 |
8 | cd mjpeg-avi || exit 1
9 | git reset --hard || exit 1
10 |
11 | cp ../create_avi.sh .
12 | patch -p0 < ../makefile.patch
13 |
--------------------------------------------------------------------------------
/src/onvif_simple_server/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore the install dir
2 | _install/
3 | *.xz
4 | *.gz
5 | libtomcrypt
6 | libtomcrypt*/
7 | mbedtls
8 | mbedtls*/
9 | wolfssl
10 | wolfssl*/
11 | zlib
12 | zlib*/
13 | json-c
14 | json-c*/
15 | onvif_simple_server/onvif_simple_server
16 |
--------------------------------------------------------------------------------
/src/ipc_cmd/install.ipc_cmd:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | mkdir -p ../../build/home/yi-hack/bin/ || exit 1
7 | mkdir -p ../../build/home/yi-hack/lib/ || exit 1
8 |
9 | rsync -av ./_install/* ../../build/home/yi-hack/ || exit 1
10 |
--------------------------------------------------------------------------------
/src/libwolf_01_ssl/config.wolfssl:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | VERSION="5.8.4"
4 | MAIN_URL=https://github.com/wolfSSL/wolfssl/archive/refs/tags/v${VERSION}-stable.tar.gz
5 | PACKAGE="v${VERSION}-stable"
6 | ARCHIVE="${PACKAGE}.tar.gz"
7 | BUILD_FOLDER="wolfssl-${VERSION}-stable"
8 | LIB_VERSION="44.0.1"
9 |
--------------------------------------------------------------------------------
/src/mdnsd/compile.mdnsd:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | source config.mdnsd
7 |
8 | cd "${BUILD_FOLDER}"
9 |
10 | make -j $(nproc) || exit 1
11 | make install || exit 1
12 |
13 | arm-openwrt-linux-strip ../_install/sbin/* || exit 1
14 |
--------------------------------------------------------------------------------
/src/mjpeg-avi/install.mjpeg-avi:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | mkdir -p ../../build/home/yi-hack/bin/ || exit 1
7 | mkdir -p ../../build/home/yi-hack/script/ || exit 1
8 |
9 | rsync -av ./_install/* ../../build/home/yi-hack/ || exit 1
10 |
--------------------------------------------------------------------------------
/src/mosquitto/cleanup.mosquitto:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | source config.mosquitto
4 |
5 | if [ "$USE_MOSQUITTO" != "1" ]; then
6 | exit
7 | fi
8 |
9 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
10 | cd $SCRIPT_DIR
11 |
12 | rm -rf ./_install
13 |
14 | cd "${BUILD_FOLDER}"
15 |
16 | make clean
17 |
--------------------------------------------------------------------------------
/src/mqtt-config/install.mqtt-config:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | mkdir -p ../../build/home/yi-hack/bin/ || exit 1
7 | mkdir -p ../../build/home/yi-hack/lib/ || exit 1
8 |
9 | rsync -av ./_install/* ../../build/home/yi-hack/ || exit 1
10 |
--------------------------------------------------------------------------------
/src/mosquitto/init.mosquitto:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | source config.mosquitto
4 |
5 | if [ "$USE_MOSQUITTO" != "1" ]; then
6 | exit
7 | fi
8 |
9 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
10 | cd $SCRIPT_DIR
11 |
12 | rm -rf ./_install
13 |
14 | cd "${BUILD_FOLDER}" || exit 1
15 | git reset --hard
16 |
--------------------------------------------------------------------------------
/src/busybox/config.busybox:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | VERSION="1.36.1"
4 | #MAIN_URL=https://github.com/mirror/busybox/archive/refs/tags/${VERSION}.tar.gz
5 | MAIN_URL=https://busybox.net/downloads/busybox-${VERSION}.tar.bz2
6 | PACKAGE="busybox-${VERSION}"
7 | ARCHIVE="${PACKAGE}.tar.bz2"
8 | BUILD_FOLDER="busybox-${VERSION}"
--------------------------------------------------------------------------------
/src/pcmvol/pcmvol/Makefile:
--------------------------------------------------------------------------------
1 | OBJECTS = pcmvol.o
2 | all: pcmvol
3 |
4 | pcmvol.o: pcmvol.c $(HEADERS)
5 | $(CC) -c $< -fPIC -Os -o $@
6 |
7 | pcmvol: $(OBJECTS)
8 | $(CC) $(OBJECTS) -lm -fPIC -Os -o $@
9 | $(STRIP) $@
10 |
11 | .PHONY: clean
12 |
13 | clean:
14 | rm -f pcmvol
15 | rm -f $(OBJECTS)
16 |
--------------------------------------------------------------------------------
/src/onvif_simple_server/install.onvif_simple_server:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | mkdir -p ../../build/home/yi-hack/www/onvif || exit 1
7 | mkdir -p ../../build/home/yi-hack/bin/ || exit 1
8 |
9 | rsync -av ./_install/* ../../build/home/yi-hack/ || exit 1
10 |
--------------------------------------------------------------------------------
/src/static/static/home/yi-hack/etc/camera.conf:
--------------------------------------------------------------------------------
1 | SWITCH_ON=yes
2 | SAVE_VIDEO_ON_MOTION=yes
3 | MOTION_DETECTION=no
4 | SENSITIVITY=low
5 | AI_HUMAN_DETECTION=no
6 | AI_VEHICLE_DETECTION=no
7 | AI_ANIMAL_DETECTION=no
8 | SOUND_DETECTION=no
9 | SOUND_SENSITIVITY=80
10 | LED=no
11 | ROTATE=no
12 | IR=yes
13 | CRUISE=no
14 |
--------------------------------------------------------------------------------
/src/www/httpd/cgi-bin/reboot.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | printf "Content-type: application/json\r\n\r\n"
4 | printf "{\n"
5 | printf "\"%s\":\"%s\"\\n" "error" "false"
6 | printf "}\n"
7 |
8 | # Yeah, it's pretty ugly.. but hey, it works.
9 |
10 | sync
11 | sync
12 | sync
13 | killall -q mqttv4
14 | sleep 1
15 | reboot
16 |
--------------------------------------------------------------------------------
/unbrick/y20ga/mtd.txt:
--------------------------------------------------------------------------------
1 | dev: size erasesize name
2 | mtd0: 00080000 00010000 "uboot"
3 | mtd1: 00240000 00010000 "boot"
4 | mtd2: 00180000 00010000 "rootfs"
5 | mtd3: 00b80000 00010000 "home"
6 | mtd4: 00020000 00010000 "env"
7 | mtd5: 00010000 00010000 "mfg"
8 | mtd6: 00010000 00010000 "conf"
9 | mtd7: 00000000 00000000 "UDISK"
10 |
--------------------------------------------------------------------------------
/unbrick/y25ga/mtd.txt:
--------------------------------------------------------------------------------
1 | dev: size erasesize name
2 | mtd0: 00080000 00001000 "uboot"
3 | mtd1: 00240000 00001000 "boot"
4 | mtd2: 00180000 00001000 "rootfs"
5 | mtd3: 00b80000 00001000 "home"
6 | mtd4: 00020000 00001000 "env"
7 | mtd5: 00010000 00001000 "mfg"
8 | mtd6: 00010000 00001000 "conf"
9 | mtd7: 00000000 00000000 "UDISK"
10 |
--------------------------------------------------------------------------------
/unbrick/y30qa/mtd.txt:
--------------------------------------------------------------------------------
1 | dev: size erasesize name
2 | mtd0: 00080000 00001000 "uboot"
3 | mtd1: 00240000 00001000 "boot"
4 | mtd2: 00180000 00001000 "rootfs"
5 | mtd3: 00b80000 00001000 "home"
6 | mtd4: 00020000 00001000 "env"
7 | mtd5: 00010000 00001000 "mfg"
8 | mtd6: 00010000 00001000 "conf"
9 | mtd7: 00000000 00000000 "UDISK"
10 |
--------------------------------------------------------------------------------
/src/libwolf_02_mqtt/config.wolfmqtt:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | VERSION="1.20.0"
4 | MAIN_URL=https://github.com/wolfSSL/wolfMQTT/archive/refs/tags/v${VERSION}.tar.gz
5 | PACKAGE="DROPBEAR_${VERSION}"
6 | ARCHIVE="v${VERSION}.tar.gz"
7 | BUILD_FOLDER="wolfMQTT-${VERSION}"
8 | LIB_VERSION="18.0.0"
9 | WOLFSSL_DIR="../libwolf_01_ssl/_install"
10 |
--------------------------------------------------------------------------------
/src/mqtt/install.mqtt:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | mkdir -p ../../build/home/yi-hack/bin/ || exit 1
7 | mkdir -p ../../build/home/yi-hack/lib/ || exit 1
8 | mkdir -p ../../build/home/yi-hack/etc/mqtt/ || exit 1
9 |
10 | rsync -av ./_install/* ../../build/home/yi-hack/ || exit 1
11 |
--------------------------------------------------------------------------------
/unbrick/y501gc/mtd.txt:
--------------------------------------------------------------------------------
1 | dev: size erasesize name
2 | mtd0: 00080000 00001000 "uboot"
3 | mtd1: 002a0000 00001000 "boot"
4 | mtd2: 00180000 00001000 "rootfs"
5 | mtd3: 01b20000 00001000 "home"
6 | mtd4: 00020000 00001000 "env"
7 | mtd5: 00010000 00001000 "mfg"
8 | mtd6: 00010000 00001000 "conf"
9 | mtd7: 00000000 00000000 "UDISK"
10 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | /build/*
3 | !/build/.gitkeep
4 |
5 | /out
6 | /bin
7 |
8 | # The following files are ignored because they need some cleanup
9 | REQUIRED_PACKAGES
10 | INIT_SUBMODULES.md
11 |
12 | *.DS_Store
13 | *.o
14 | .idea
15 | src/h264grabber/h264grabber/h264grabber
16 | src/ipc_cmd/ipc_cmd/ipc_cmd
17 | src/snapshot/snapshot/imggrabber
18 |
--------------------------------------------------------------------------------
/src/proxychains-ng/config.mak:
--------------------------------------------------------------------------------
1 | CC=arm-openwrt-linux-gcc
2 | prefix=/home/yi-hack/
3 | libdir=/home/yi-hack/lib
4 | sysconfdir=/home/yi-hack/etc
5 | USER_CFLAGS=-Os -mcpu=cortex-a7 -mfpu=neon-vfpv4 -I/opt/yi/toolchain-sunxi-musl/toolchain/include -L/opt/yi/toolchain-sunxi-musl/toolchain/lib
6 | USER_LDFLAGS=
7 | AR=arm-openwrt-linux-ar
8 | RANLIB=arm-openwrt-linux-ranlib
9 |
--------------------------------------------------------------------------------
/src/libwolf_01_ssl/compile.libwolf_01_ssl:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -e
4 |
5 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
6 | cd $SCRIPT_DIR
7 |
8 | source config.wolfssl
9 |
10 | cd "${BUILD_FOLDER}"
11 |
12 | make clean
13 | make -j$(nproc) \
14 | || exit 1
15 |
16 | make install || exit 1
17 |
18 | arm-openwrt-linux-strip ../_install/lib/libwolfssl.so.${LIB_VERSION}
19 |
--------------------------------------------------------------------------------
/src/www/httpd/cgi-bin/reset.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | cd /home/yi-hack/etc
4 |
5 | rm hostname
6 |
7 | rm camera.conf
8 | rm mqttv4.conf
9 | rm proxychains.conf
10 | rm system.conf
11 |
12 | tar jxvf defaults.tar.bz2 > /dev/null 2>&1
13 |
14 | printf "Content-type: application/json\r\n\r\n"
15 | printf "{\n"
16 | printf "\"%s\":\"%s\"\\n" "error" "false"
17 | printf "}\n"
18 |
--------------------------------------------------------------------------------
/src/mqtt-config/mqtt-config/validate.h:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 | #include
5 | #include
6 |
7 | #define PARAM_SIZE 128
8 | #define PARAM_OPTIONS 9
9 | #define PARAM_NUM 81
10 |
11 | int validate_param(char *file, char *key, char *value);
12 | int extract_param(char *param, char *file, char *key, int index);
13 |
--------------------------------------------------------------------------------
/src/mosquitto/install.mosquitto:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | source config.mosquitto
4 |
5 | if [ "$USE_MOSQUITTO" != "1" ]; then
6 | exit
7 | fi
8 |
9 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
10 | cd $SCRIPT_DIR
11 |
12 | mkdir -p ../../build/home/yi-hack/bin/ || exit 1
13 | mkdir -p ../../build/home/yi-hack/lib/ || exit 1
14 |
15 | rsync -av ./_install/* ../../build/home/yi-hack/ || exit 1
16 |
--------------------------------------------------------------------------------
/src/rtsp_server_yi/init.rtsp_server_yi:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -e
4 |
5 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
6 | cd $SCRIPT_DIR
7 |
8 | rm -rf ./_install
9 |
10 | cd RtspServer
11 | git reset --hard
12 |
13 | cp ../Makefile.rtsp_server_yi ./Makefile
14 | #sed -i 's/O_FLAG = -O2/O_FLAG = -Os/g' Makefile
15 | #sed -i 's/CXX_FLAGS += -std=c++11/CXX_FLAGS += -Os -std=c++11/g' Makefile
16 |
--------------------------------------------------------------------------------
/src/set_tz_offset/set_tz_offset/Makefile:
--------------------------------------------------------------------------------
1 | OBJECTS = set_tz_offset.o
2 | LIBS = -lpthread -lrt
3 |
4 | all: set_tz_offset
5 |
6 | set_tz_offset.o: set_tz_offset.c $(HEADERS)
7 | $(CC) -c $< -fPIC -O2 -o $@
8 |
9 | set_tz_offset: $(OBJECTS)
10 | $(CC) $(OBJECTS) $(LIBS) -fPIC -O2 -o $@
11 | $(STRIP) $@
12 |
13 | .PHONY: clean
14 |
15 | clean:
16 | rm -f set_tz_offset
17 | rm -f $(OBJECTS)
18 |
--------------------------------------------------------------------------------
/src/libwolf_01_ssl/install.libwolf_01_ssl:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | source config.wolfssl
7 |
8 | mkdir -p ../../build/home/yi-hack/lib/ || exit 1
9 |
10 | LIB_VERSION_1=$(echo ${LIB_VERSION} | cut -d '.' -f 1)
11 |
12 | cp ./_install/lib/libwolfssl.so.${LIB_VERSION} ../../build/home/yi-hack/lib/libwolfssl.so.${LIB_VERSION_1} || exit 1
13 |
--------------------------------------------------------------------------------
/src/sftp-server/init.sftp-server:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | rm -rf ./_install
7 |
8 | cd openssh-portable
9 | git reset --hard
10 |
11 | autoreconf || exit 1
12 |
13 | ./configure CC=arm-openwrt-linux-gcc \
14 | --prefix=$SCRIPT_DIR/_install \
15 | --host=arm \
16 | --without-openssl \
17 | --without-zlib \
18 | || exit 1
19 |
--------------------------------------------------------------------------------
/src/www/httpd/tools/remcomm.awk:
--------------------------------------------------------------------------------
1 | function remComm() {
2 | if ( !m )
3 | m = index($0, cs);
4 |
5 | if ( m && p = index($0, ce) ) {
6 | $0 = substr($0, 1, m-1) substr($0, p+3);
7 | if (m = index($0, cs))
8 | remComm();
9 | }
10 | }
11 |
12 | BEGIN {
13 | ORS="";
14 | cs="";
16 | m = 0;
17 | }
18 | {
19 | remComm();
20 | if ( !m && NF )
21 | print
22 | }
23 |
24 |
--------------------------------------------------------------------------------
/src/alsa-lib/compile.alsa-lib:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | cd alsa-lib-1.1.4.1 || exit 1
7 |
8 | make clean
9 | make -j $(nproc) || exit 1
10 |
11 | mkdir -p ../_install/lib
12 | cp -f ./src/.libs/libasound.so.2.0.0 ../_install/lib/
13 |
14 | cp -fP ./src/.libs/libasound.so.2 ../_install/lib/
15 |
16 | arm-openwrt-linux-strip ../_install/lib/libasound.so.2.0.0 || exit 1
17 |
--------------------------------------------------------------------------------
/src/dropbear/compile.dropbear:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | source config.dropbear
7 |
8 | cd "${BUILD_FOLDER}"
9 |
10 | make clean
11 | make -j$(nproc) \
12 | PROGRAMS="dropbear dropbearkey dropbearconvert dbclient scp" \
13 | MULTI=1 \
14 | || exit 1
15 |
16 | mkdir -p ../_install
17 |
18 | cp ./dropbearmulti ../_install/
19 |
20 | #make install || exit 1
21 |
--------------------------------------------------------------------------------
/src/www/httpd/cgi-bin/save.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | printf "Content-type: application/octet-stream\r\n\r\n"
4 |
5 | TMP_DIR="/tmp/yi-temp-save"
6 | mkdir $TMP_DIR
7 | cd $TMP_DIR
8 | cp /home/yi-hack/etc/*.conf .
9 | if [ -f /home/yi-hack/etc/hostname ]; then
10 | cp /home/yi-hack/etc/hostname .
11 | fi
12 | tar cvf config.tar * > /dev/null
13 | bzip2 config.tar
14 | cat $TMP_DIR/config.tar.bz2
15 | cd /tmp
16 | rm -rf $TMP_DIR
17 |
--------------------------------------------------------------------------------
/src/static/static/home/yi-hack/script/blacklist/url:
--------------------------------------------------------------------------------
1 | api.xiaoyi.com
2 | api.xiaoyi.com.tw
3 | api.eu.xiaoyi.com
4 | api.us.xiaoyi.com
5 | log.xiaoyi.com
6 | log.xiaoyi.com.tw
7 | log.eu.xiaoyi.com
8 | log.us.xiaoyi.com
9 | hch.xiaoyi.com
10 | ot.io.mi.com
11 | ott.io.mi.com
12 | yicamera-router.mi-ae.com.sg
13 | tnpmastercn.xiaoyi.com
14 | openapi.kuaipan.cn
15 | api-content.dfs.kuaipan.cn
16 | familymonitor-interface-test.mi-ae.com.sg
17 |
--------------------------------------------------------------------------------
/src/proxychains-ng/install.proxychains-ng:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | mkdir -p ../../build/home/yi-hack/bin/
7 | mkdir -p ../../build/home/yi-hack/lib/
8 | mkdir -p ../../build/home/yi-hack/etc/
9 |
10 | rsync -a ./_install/bin/* ../../build/home/yi-hack/bin/
11 | rsync -a ./_install/lib/* ../../build/home/yi-hack/lib/
12 | rsync -a ./proxychains.conf ../../build/home/yi-hack/etc/
13 |
--------------------------------------------------------------------------------
/src/mqtt-config/init.mqtt-config:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | rm -rf ./_install
7 |
8 | cd mqtt-config
9 |
10 | mkdir -p ./lib
11 |
12 | if [ ! -f ../../mosquitto/_install/lib/libmosquitto.so.1 ] ; then
13 | echo "ERROR: mqttv4 requires mosquitto to be compiled first."
14 | exit 1
15 | fi
16 |
17 | ln -fs ../../../mosquitto/_install/lib/libmosquitto.so.1 ./lib/libmosquitto.so
18 |
--------------------------------------------------------------------------------
/src/busybox/init.busybox:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | rm -rf ./_install
7 |
8 | source config.busybox
9 |
10 | rm -rf ./_install
11 |
12 | if [ ! -f "${ARCHIVE}" ]; then
13 | wget "${MAIN_URL}"
14 | fi
15 |
16 | tar xvf "${ARCHIVE}"
17 |
18 | cd "${BUILD_FOLDER}"
19 |
20 | patch -p1 < ../gzdef.patch
21 | patch -p1 < ../onvif.patch
22 | patch -p1 < ../auth.patch
23 |
24 | cp ../.config ./ || exit 1
25 |
--------------------------------------------------------------------------------
/src/libwolf_02_mqtt/fflush.patch:
--------------------------------------------------------------------------------
1 | diff -Naur wolfMQTT-1.20.0.ori/examples/pub-sub/mqtt-sub.c wolfMQTT-1.20.0/examples/pub-sub/mqtt-sub.c
2 | --- wolfMQTT-1.20.0.ori/examples/pub-sub/mqtt-sub.c 2025-05-01 22:34:47.000000000 +0200
3 | +++ wolfMQTT-1.20.0/examples/pub-sub/mqtt-sub.c 2025-11-25 10:54:53.064091696 +0100
4 | @@ -96,6 +96,7 @@
5 | }
6 | else {
7 | PRINTF("%s", buf);
8 | + fflush(stdout);
9 | }
10 |
11 | #ifdef WOLFMQTT_V5
12 |
--------------------------------------------------------------------------------
/src/jq/init.jq:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | ARCHIVE=jq-1.5.tar.gz
4 |
5 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
6 | cd $SCRIPT_DIR
7 |
8 | rm -rf ./_install
9 |
10 | if [ ! -f $ARCHIVE ]; then
11 | wget https://github.com/stedolan/jq/releases/download/jq-1.5/$ARCHIVE
12 | fi
13 | tar zxvf $ARCHIVE
14 |
15 | cd jq-1.5 || exit 1
16 |
17 | export CFLAGS+="-Os -ffunction-sections -fdata-sections"
18 | export LDFLAGS+="-Wl,--gc-sections"
19 | ./configure --host=arm-openwrt-linux --disable-docs
20 |
--------------------------------------------------------------------------------
/src/h264grabber/h264grabber/Makefile:
--------------------------------------------------------------------------------
1 | OBJECTS = h264grabber.o
2 | OPTS = -mcpu=cortex-a7 -mfpu=neon-vfpv4
3 |
4 | CC= arm-openwrt-linux-gcc
5 | STRIP= arm-openwrt-linux-strip
6 |
7 | all: h264grabber
8 |
9 | h264grabber.o: h264grabber.c $(HEADERS)
10 | $(CC) -c $< $(OPTS) -fPIC -Os -Wall -o $@
11 |
12 | h264grabber: $(OBJECTS)
13 | $(CC) $(OBJECTS) $(LIB) $(OPTS) -fPIC -Os -Wall -o $@
14 | $(STRIP) $@
15 |
16 | .PHONY: clean
17 |
18 | clean:
19 | rm -f h264grabber
20 | rm -f $(OBJECTS)
21 |
--------------------------------------------------------------------------------
/src/mjpeg-avi/makefile.patch:
--------------------------------------------------------------------------------
1 | --- makefile.ori 2023-03-16 14:31:20.000000000 +0100
2 | +++ makefile 2023-03-17 09:53:26.384909022 +0100
3 | @@ -1,4 +1,4 @@
4 | -CC := gcc
5 | +#CC := gcc
6 |
7 | SRCS := src/avi.c src/main.c
8 | OBJS := $(SRCS:.c=.o)
9 | @@ -7,7 +7,7 @@
10 | NO_WARNINGS := multichar
11 | FLAGS := $(addprefix -Wno-, $(NO_WARNINGS))
12 |
13 | -OUTDIR := bin
14 | +OUTDIR := .
15 |
16 | all: avimake
17 |
18 | @@ -24,3 +24,4 @@
19 |
20 | clean:
21 | rm -rf src/*.o src/*.d
22 | + rm -f avimake
23 |
--------------------------------------------------------------------------------
/src/rRTSPServer/remove-mangling.patch:
--------------------------------------------------------------------------------
1 | diff -Naur libhelix-aac.ori/statname.h libhelix-aac/statname.h
2 | --- libhelix-aac.ori/statname.h.ori 2025-04-30 10:18:44.570755045 +0200
3 | +++ libhelix-aac/statname.h 2025-04-30 10:18:51.083119940 +0200
4 | @@ -50,7 +50,6 @@
5 | * all the C functions and global variables will be mangled by the preprocessor
6 | * e.g. void DCT4(...) becomes void raac_DCT4(...)
7 | */
8 | -#define STAT_PREFIX raac
9 |
10 | #define STATCC1(x,y,z) STATCC2(x,y,z)
11 | #define STATCC2(x,y,z) x##y##z
12 |
--------------------------------------------------------------------------------
/src/mqtt-config/mqtt-config/config.h:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 | #include
5 | #include
6 | #include
7 |
8 | #define MAX_LINE_LENGTH 512
9 | #define MAX_KEY_LENGTH 128
10 | #define MAX_VALUE_LENGTH 128
11 |
12 | void config_set_handler(void (*f)(const char* key, const char* value));
13 | void config_parse(FILE *fp);
14 | void config_replace(char *filename, char *key, char *value);
15 | FILE *open_conf_file(const char* filename);
16 | void close_conf_file(FILE *fp);
17 |
--------------------------------------------------------------------------------
/src/ipc_cmd/ipc_cmd/ipc_multiplex.h:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include
10 |
11 | #define IPC_QUEUE_NAME "/ipc_dispatch"
12 | #define ENV_IPC_MULTIPLEX_DEBUG "IPC_MULTIPLEX_DEBUG"
13 | #define IPC_MESSAGE_MAX_SIZE 512
14 | #define MESSAGE_PRIORITY 1
15 | #define INVALID_QUEUE -1
16 | #define MESSAGE_TARGET_OFFSET 0
17 | #define MESSAGE_ID_IPC_DISPATCH 1
18 |
--------------------------------------------------------------------------------
/src/libwolf_02_mqtt/install.libwolf_02_mqtt:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | source config.wolfmqtt
7 |
8 | mkdir -p ../../build/home/yi-hack/bin/ || exit 1
9 | mkdir -p ../../build/home/yi-hack/lib/ || exit 1
10 |
11 | LIB_VERSION_1=$(echo ${LIB_VERSION} | cut -d '.' -f 1)
12 |
13 | cp ./_install/lib/libwolfmqtt.so.${LIB_VERSION} ../../build/home/yi-hack/lib/libwolfmqtt.so.${LIB_VERSION_1}
14 | cp ./_install/bin/mqtt-pub ../../build/home/yi-hack/bin/
15 | cp ./_install/bin/mqtt-sub ../../build/home/yi-hack/bin/
16 |
--------------------------------------------------------------------------------
/src/www/httpd/htdocs/js/modules/snapshot.js:
--------------------------------------------------------------------------------
1 | var APP = APP || {};
2 |
3 | APP.snapshot = (function($) {
4 |
5 | function init() {
6 | initPage();
7 | }
8 |
9 | function initPage() {
10 | jQuery.get('cgi-bin/snapshot.sh?res=high&base64=yes&watermark=yes', function(data) {
11 | image = document.getElementById('imgSnap');
12 | image.src = 'data:image/png;base64,' + data;
13 | image.style = 'width:100%;';
14 | })
15 | }
16 |
17 | return {
18 | init: init
19 | };
20 |
21 | })(jQuery);
--------------------------------------------------------------------------------
/src/static/static/home/yi-hack/bin/cloudAPI:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | CONF_FILE="etc/system.conf"
4 |
5 | YI_HACK_PREFIX="/home/yi-hack"
6 |
7 | get_config()
8 | {
9 | key=$1
10 | grep $1 $YI_HACK_PREFIX/$CONF_FILE | cut -d "=" -f2
11 | }
12 |
13 | if [[ $(get_config DISABLE_CLOUD) == "yes" ]] ; then
14 | $YI_HACK_PREFIX/bin/cloudAPI_fake "$@"
15 | else
16 | if [[ $(get_config PROXYCHAINSNG) == "yes" ]] ; then
17 | $YI_HACK_PREFIX/bin/proxychains4 $YI_HACK_PREFIX/bin/cloudAPI_real "$@"
18 | else
19 | $YI_HACK_PREFIX/bin/cloudAPI_real "$@"
20 | fi
21 | fi
22 |
--------------------------------------------------------------------------------
/src/libwolf_02_mqtt/compile.libwolf_02_mqtt:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -e
4 |
5 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
6 | cd $SCRIPT_DIR
7 |
8 | source config.wolfmqtt
9 |
10 | cd "${BUILD_FOLDER}"
11 |
12 | make clean
13 | make -j$(nproc) \
14 | || exit 1
15 |
16 | make install || exit 1
17 | cp ./examples/pub-sub/.libs/mqtt-pub ../_install/bin/
18 | cp ./examples/pub-sub/.libs/mqtt-sub ../_install/bin/
19 |
20 | arm-openwrt-linux-strip ../_install/lib/libwolfmqtt.so.${LIB_VERSION}
21 | arm-openwrt-linux-strip ../_install/bin/mqtt-pub
22 | arm-openwrt-linux-strip ../_install/bin/mqtt-sub
23 |
--------------------------------------------------------------------------------
/src/www/httpd/htdocs/pages/eventsfile.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
Here you can see all the motion events detected.
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/src/busybox/onvif.patch:
--------------------------------------------------------------------------------
1 | diff -Naur busybox-1.36.1.ori/networking/httpd.c busybox-1.36.1/networking/httpd.c
2 | --- busybox-1.36.1.ori/networking/httpd.c 2024-01-08 16:45:49.504118695 +0100
3 | +++ busybox-1.36.1/networking/httpd.c 2024-01-08 16:52:14.701167800 +0100
4 | @@ -2406,6 +2406,13 @@
5 | }
6 | cgi_type = CGI_NORMAL;
7 | }
8 | + else if (is_prefixed_with(tptr, "onvif/")) {
9 | + if (tptr[6] == '\0') {
10 | + /* protect listing "cgi-bin/" */
11 | + send_headers_and_exit(HTTP_FORBIDDEN);
12 | + }
13 | + cgi_type = CGI_NORMAL;
14 | + }
15 | #endif
16 |
17 | if (urlp[-1] == '/') {
18 |
--------------------------------------------------------------------------------
/src/www/httpd/htdocs/pages/timelapse.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
Here you can see all time-lapse video files.
8 |
9 |
10 |
![]()
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/static/static/home/yi-hack/script/env.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | CONF_FILE="etc/system.conf"
4 |
5 | YI_HACK_PREFIX="/home/yi-hack"
6 |
7 | export PATH=$PATH:/home/base/tools:/home/yi-hack/bin:/home/yi-hack/sbin:/home/yi-hack/usr/bin:/home/yi-hack/usr/sbin:/tmp/sd/yi-hack/bin:/tmp/sd/yi-hack/sbin
8 | export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/lib:/home/yi-hack/lib:/tmp/sd/yi-hack/lib
9 |
10 | get_config()
11 | {
12 | key=$1
13 | grep -w $1 $YI_HACK_PREFIX/$CONF_FILE | cut -d "=" -f2
14 | }
15 |
16 | TZ_CONF=$(get_config TIMEZONE)
17 |
18 | if [ ! -z "$TZ_CONF" ]; then
19 | export TZ=$TZ_CONF
20 | fi
21 |
--------------------------------------------------------------------------------
/src/rRTSPServer/not-arduino.patch:
--------------------------------------------------------------------------------
1 | diff -Naur libhelix-aac.ori/aaccommon.h libhelix-aac/aaccommon.h
2 | --- libhelix-aac.ori/aaccommon.h
3 | +++ libhelix-aac/aaccommon.h
4 | @@ -46,8 +46,14 @@
5 | #ifndef _AACCOMMON_H
6 | #define _AACCOMMON_H
7 |
8 | -#include
9 | -#include
10 | +#ifdef ARDUINO
11 | + #include
12 | + #include
13 | +#else
14 | + #define PROGMEM
15 | + #define pgm_read_byte(addr) (*(const unsigned char *)(addr))
16 | + #define pgm_read_word(addr) (*(const unsigned short *)(addr))
17 | +#endif
18 |
19 | // Can't fit in ESP8266 RAM
20 | #ifndef ESP8266
21 |
--------------------------------------------------------------------------------
/src/alsa-lib/patch/001_dmix_support_S16_LE_format.patch:
--------------------------------------------------------------------------------
1 | Index: alsa-lib-1.1.4.1/src/conf/alsa.conf
2 | ===================================================================
3 | --- alsa-lib-1.1.4.1.orig/src/conf/alsa.conf
4 | +++ alsa-lib-1.1.4.1/src/conf/alsa.conf
5 | @@ -77,7 +77,7 @@ defaults.pcm.ipc_gid audio
6 | defaults.pcm.ipc_perm 0660
7 | defaults.pcm.dmix.max_periods 0
8 | defaults.pcm.dmix.rate 48000
9 | -defaults.pcm.dmix.format "unchanged"
10 | +defaults.pcm.dmix.format "S16_LE"
11 | defaults.pcm.dmix.card defaults.pcm.card
12 | defaults.pcm.dmix.device defaults.pcm.device
13 | defaults.pcm.dsnoop.card defaults.pcm.card
14 |
--------------------------------------------------------------------------------
/.github/workflows/stale.yml:
--------------------------------------------------------------------------------
1 | name: 'Close stale issues and PRs'
2 | on:
3 | schedule:
4 | - cron: '30 1 * * *'
5 | workflow_dispatch:
6 |
7 | jobs:
8 | stale:
9 | runs-on: ubuntu-latest
10 | steps:
11 | - uses: actions/stale@v9
12 | with:
13 | stale-issue-message: ' This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.'
14 | days-before-issue-stale: 90
15 | days-before-issue-close: 30
16 | days-before-pr-stale: -1
17 | days-before-pr-close: -1
18 |
--------------------------------------------------------------------------------
/src/ipc_cmd/ipc_cmd/ipc_notify.h:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include
10 | #include
11 | #include
12 |
13 | #define IPC_QUEUE_NAME "/ipc_dispatch"
14 | #define IPC_MESSAGE_MAX_SIZE 512
15 | #define COMMAND_MAX_SIZE 512
16 |
17 | int ipc_init();
18 | void ipc_stop();
19 | static int open_queue();
20 | static int clear_queue();
21 | static int parse_message(char *msg, char *cmd, ssize_t len);
22 | void print_usage(char *progname);
23 |
--------------------------------------------------------------------------------
/src/minimp4/init.minimp4:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | export CROSSPATH=/opt/yi/toolchain-sunxi-musl/toolchain/bin
4 | export PATH=${PATH}:${CROSSPATH}
5 |
6 | export TARGET=arm-openwrt-linux
7 | export CROSS=arm-openwrt-linux
8 | export BUILD=x86_64-pc-linux-gnu
9 |
10 | export CROSSPREFIX=${CROSS}-
11 |
12 | export STRIP=${CROSSPREFIX}strip
13 | export CXX=${CROSSPREFIX}g++
14 | export CC=${CROSSPREFIX}gcc
15 | export LD=${CROSSPREFIX}ld
16 | export AS=${CROSSPREFIX}as
17 | export AR=${CROSSPREFIX}ar
18 |
19 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
20 | cd $SCRIPT_DIR
21 |
22 | rm -rf ./_install
23 |
24 | cd minimp4 || exit 1
25 | git reset --hard
26 |
--------------------------------------------------------------------------------
/src/alsa-lib/patch/300-ensure-ringbuffer-empty-with-dmix.patch:
--------------------------------------------------------------------------------
1 | Index: alsa-lib-1.1.4.1/src/pcm/pcm_direct.c
2 | ===================================================================
3 | --- alsa-lib-1.1.4.1.orig/src/pcm/pcm_direct.c
4 | +++ alsa-lib-1.1.4.1/src/pcm/pcm_direct.c
5 | @@ -1341,7 +1341,7 @@ int snd_pcm_direct_initialize_slave(snd_
6 | return ret;
7 | }
8 |
9 | - if (dmix->type == SND_PCM_TYPE_DSHARE) {
10 | + if (dmix->type == SND_PCM_TYPE_DSHARE || dmix->type == SND_PCM_TYPE_DMIX) {
11 | const snd_pcm_channel_area_t *dst_areas;
12 | dst_areas = snd_pcm_mmap_areas(spcm);
13 | snd_pcm_areas_silence(dst_areas, 0, spcm->channels,
14 |
--------------------------------------------------------------------------------
/src/ftpd/init.ftpd:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | rm -rf ./_install
7 |
8 | cd pure-ftpd || exit 1
9 | git reset --hard || exit 1
10 |
11 | cd ..
12 | patch -p0 < ftpd.patch
13 | cd pure-ftpd
14 |
15 | ./autogen.sh || exit 1
16 |
17 | ./configure CC=arm-openwrt-linux-gcc \
18 | --prefix=$SCRIPT_DIR/_install \
19 | CFLAGS="-Os -mcpu=cortex-a7 -mfpu=neon-vfpv4 -I/opt/yi/toolchain-sunxi-musl/toolchain/include -L/opt/yi/toolchain-sunxi-musl/toolchain/lib" \
20 | AR=arm-openwrt-linux-ar \
21 | RANLIB=arm-openwrt-linux-ranlib \
22 | --host=arm \
23 | --with-minimal \
24 | || exit 1
25 |
--------------------------------------------------------------------------------
/src/onvif_simple_server/cleanup.onvif_simple_server:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | cd onvif_simple_server
7 |
8 | make clean
9 |
10 | cd ..
11 |
12 | rm -rf libtomcrypt*
13 | rm -f crypt*.tar.xz
14 | rm -rf mbedtls-3.4.0
15 | rm -rf mbedtls
16 | rm -f v3.4.0.tar.gz
17 | rm -rf wolfssl*
18 | rm -f v5.7.4-stable.tar.gz
19 | rm -rf zlib*
20 | rm -rf json-c*
21 | rm -f v1.7.18.tar.gz
22 | rm -f onvif_simple_server/extras/libtomcrypt
23 | rm -f onvif_simple_server/extras/mbedtls
24 | rm -f onvif_simple_server/extras/wolfssl
25 | rm -f onvif_simple_server/extras/zlib
26 | rm -f onvif_simple_server/extras/json-c
27 |
--------------------------------------------------------------------------------
/unbrick/build.bat:
--------------------------------------------------------------------------------
1 | @ECHO OFF
2 | SETLOCAL EnableDelayedExpansion
3 |
4 | FOR /F %%x in ('dir /B /D /A:D *') do (
5 | SET DIR=%%x
6 | FOR /F "tokens=*" %%g IN ('type !DIR!\filename') do (SET FILENAME=%%g)
7 | IF exist !DIR!/mtdblock2.bin (
8 | mkimage.exe -A arm -O linux -T filesystem -C none -a 0x0 -e 0x0 -n "xiaoyi-rootfs" -d !DIR!/mtdblock2.bin !DIR!/rootfs_!FILENAME!
9 | gzip.exe !DIR!/rootfs_!FILENAME!
10 | )
11 | IF exist !DIR!/mtdblock3.bin (
12 | mkimage.exe -A arm -O linux -T filesystem -C none -a 0x0 -e 0x0 -n "xiaoyi-home" -d !DIR!/mtdblock3.bin !DIR!/home_!FILENAME!
13 | gzip.exe !DIR!/home_!FILENAME!
14 | )
15 | )
16 |
--------------------------------------------------------------------------------
/src/proccgi/compile.proccgi:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -e
4 |
5 | export CROSSPATH=/opt/yi/toolchain-sunxi-musl/toolchain/bin
6 | export PATH=${PATH}:${CROSSPATH}
7 |
8 | export TARGET=arm-openwrt-linux
9 | export CROSS=arm-openwrt-linux
10 | export BUILD=x86_64-pc-linux-gnu
11 |
12 | export CROSSPREFIX=${CROSS}-
13 |
14 | export STRIP=${CROSSPREFIX}strip
15 | export CXX=${CROSSPREFIX}g++
16 | export CC=${CROSSPREFIX}gcc
17 | export LD=${CROSSPREFIX}ld
18 | export AS=${CROSSPREFIX}as
19 | export AR=${CROSSPREFIX}ar
20 |
21 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
22 | cd $SCRIPT_DIR
23 |
24 | cd proccgi
25 |
26 | make -j $(nproc) || exit 1
27 |
28 | mkdir -p ../_install/bin
29 |
30 | cp ./build/proccgi ../_install/bin
31 |
--------------------------------------------------------------------------------
/src/mqtt-config/mqtt-config/Makefile:
--------------------------------------------------------------------------------
1 | TARGET = mqtt-config
2 |
3 | CFLAGS += -Os -Wall -I.
4 |
5 | LIBS += -L./lib
6 | ifdef USE_MOSQUITTO
7 | MQTT_LIB="-DUSE_MOSQUITTO"
8 | LIBS += -lmosquitto
9 | else
10 | LIBS += -lwolfmqtt \
11 | -lwolfssl
12 | endif
13 | LIBS += -lrt -lpthread
14 |
15 | .PHONY: default all clean
16 |
17 | default: $(TARGET)
18 | all: default
19 |
20 | OBJECTS = $(patsubst %.c, %.o, $(wildcard *.c))
21 | HEADERS = $(wildcard *.h)
22 |
23 | %.o: %.c $(HEADERS)
24 | $(CC) $(MQTT_LIB) $(CFLAGS) -c $< -o $@
25 |
26 | .PRECIOUS: $(TARGET) $(OBJECTS)
27 |
28 | $(TARGET): $(OBJECTS)
29 | $(CC) $(OBJECTS) -Wall $(LIBS) -o $@
30 | $(STRIP) $(TARGET)
31 |
32 | clean:
33 | rm -f *.o
34 | rm -f $(TARGET)
35 |
--------------------------------------------------------------------------------
/src/libwolf_01_ssl/init.libwolf_01_ssl:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | CPWD=$(pwd)
7 |
8 | rm -rf ./_install
9 |
10 | source config.wolfssl
11 |
12 | if [ ! -f "${ARCHIVE}" ]; then
13 | wget "${MAIN_URL}"
14 | fi
15 |
16 | tar xvf "${ARCHIVE}"
17 |
18 | cd "${BUILD_FOLDER}"
19 |
20 | ./autogen.sh
21 |
22 | ./configure CC=arm-openwrt-linux-gcc \
23 | CFLAGS="-Os -mcpu=cortex-a7 -mfpu=neon-vfpv4 -I/opt/yi/toolchain-sunxi-musl/toolchain/include -L/opt/yi/toolchain-sunxi-musl/toolchain/lib" \
24 | AR=arm-openwrt-linux-ar \
25 | RANLIB=arm-openwrt-linux-ranlib \
26 | --host=arm-openwrt-linux \
27 | --prefix=$CPWD/_install \
28 | || exit 1
29 |
30 | cd $CPWD
31 |
--------------------------------------------------------------------------------
/src/jq/compile.jq:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | export CROSSPATH=/opt/yi/toolchain-sunxi-musl/toolchain/bin
4 | export PATH=${PATH}:${CROSSPATH}
5 |
6 | export TARGET=arm-openwrt-linux
7 | export CROSS=arm-openwrt-linux
8 | export BUILD=x86_64-pc-linux-gnu
9 |
10 | export CROSSPREFIX=${CROSS}-
11 |
12 | export STRIP=${CROSSPREFIX}strip
13 | export CXX=${CROSSPREFIX}g++
14 | export CC=${CROSSPREFIX}gcc
15 | export LD=${CROSSPREFIX}ld
16 | export AS=${CROSSPREFIX}as
17 | export AR=${CROSSPREFIX}ar
18 |
19 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
20 | cd $SCRIPT_DIR
21 |
22 | cd jq-1.5 || exit 1
23 |
24 | make clean
25 | make -j $(nproc) || exit 1
26 |
27 | mkdir -p ../_install/bin || exit 1
28 |
29 | cp ./jq ../_install/bin || exit 1
30 |
31 | $STRIP ../_install/bin/* || exit 1
32 |
--------------------------------------------------------------------------------
/src/mdnsd/init.mdnsd:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | source config.mdnsd
7 |
8 | rm -rf ./_install
9 |
10 | if [ ! -f ${ARCHIVE} ]; then
11 | wget "${MAIN_URL}" || exit 1
12 | fi
13 | tar zxvf "${ARCHIVE}" || exit 1
14 | cd "${BUILD_FOLDER}" || exit 1
15 |
16 | ./configure CC=arm-openwrt-linux-gcc \
17 | --prefix=$SCRIPT_DIR/_install \
18 | CFLAGS="-Os -mcpu=cortex-a7 -mfpu=neon-vfpv4 -I/opt/yi/toolchain-sunxi-musl/toolchain/include -L/opt/yi/toolchain-sunxi-musl/toolchain/lib" \
19 | AR=arm-openwrt-linux-ar \
20 | RANLIB=arm-openwrt-linux-ranlib \
21 | --host=arm \
22 | --disable-shared \
23 | --disable-doc \
24 | --without-mquery \
25 | --without-systemd \
26 | || exit 1
27 |
--------------------------------------------------------------------------------
/src/busybox/auth.patch:
--------------------------------------------------------------------------------
1 | diff -Naur busybox-1.36.1.ori/networking/httpd.c busybox-1.36.1/networking/httpd.c
2 | --- busybox-1.36.1.ori/networking/httpd.c 2024-01-08 16:52:14.701167800 +0100
3 | +++ busybox-1.36.1/networking/httpd.c 2024-01-08 16:53:21.413344344 +0100
4 | @@ -2136,8 +2136,12 @@
5 | goto end_check_passwd;
6 | }
7 | bad_input:
8 | - /* Comparing plaintext "user:pass" in one go */
9 | - r = strcmp(cur->after_colon, user_and_passwd);
10 | + /* Check if auth is disabled for this path */
11 | + r = strcmp(cur->after_colon, ":");
12 | + if (r != 0) {
13 | + /* Comparing plaintext "user:pass" in one go */
14 | + r = strcmp(cur->after_colon, user_and_passwd);
15 | + }
16 | end_check_passwd:
17 | if (r == 0) {
18 | remoteuser = xstrndup(user_and_passwd,
19 |
--------------------------------------------------------------------------------
/src/pcmvol/compile.pcmvol:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | export CROSSPATH=/opt/yi/toolchain-sunxi-musl/toolchain/bin
4 | export PATH=${PATH}:${CROSSPATH}
5 |
6 | export TARGET=arm-openwrt-linux
7 | export CROSS=arm-openwrt-linux
8 | export BUILD=x86_64-pc-linux-gnu
9 |
10 | export CROSSPREFIX=${CROSS}-
11 |
12 | export STRIP=${CROSSPREFIX}strip
13 | export CXX=${CROSSPREFIX}g++
14 | export CC=${CROSSPREFIX}gcc
15 | export LD=${CROSSPREFIX}ld
16 | export AS=${CROSSPREFIX}as
17 | export AR=${CROSSPREFIX}ar
18 |
19 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
20 | cd $SCRIPT_DIR
21 |
22 | cd pcmvol || exit 1
23 |
24 | make clean
25 | make -j $(nproc) || exit 1
26 |
27 | mkdir -p ../_install/bin || exit 1
28 |
29 | cp ./pcmvol ../_install/bin || exit 1
30 |
31 | ${STRIP} ../_install/bin/* || exit 1
32 |
--------------------------------------------------------------------------------
/src/dropbear/install.dropbear:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | mkdir -p ../../build/home/yi-hack/bin/
7 | mkdir -p ../../build/home/yi-hack/sbin/
8 |
9 | arm-openwrt-linux-strip ./_install/dropbearmulti
10 | rsync -a ./_install/dropbearmulti ../../build/home/yi-hack/bin/
11 |
12 | ln -fs /home/yi-hack/bin/dropbearmulti ../../build/home/yi-hack/bin/dbclient
13 | ln -fs /home/yi-hack/bin/dropbearmulti ../../build/home/yi-hack/bin/dropbearconvert
14 | ln -fs /home/yi-hack/bin/dropbearmulti ../../build/home/yi-hack/bin/dropbearkey
15 | ln -fs /home/yi-hack/bin/dropbearmulti ../../build/home/yi-hack/bin/scp
16 | ln -fs /home/yi-hack/bin/dropbearmulti ../../build/home/yi-hack/bin/ssh
17 | ln -fs /home/yi-hack/bin/dropbearmulti ../../build/home/yi-hack/sbin/dropbear
18 |
--------------------------------------------------------------------------------
/src/onvif_simple_server/arm-openwrt-linux-toolchain.cmake:
--------------------------------------------------------------------------------
1 | set(CMAKE_SYSTEM_NAME Linux)
2 | set(CMAKE_SYSTEM_PROCESSOR ARM)
3 |
4 | set(TOOLCHAIN_PREFIX arm-openwrt-linux-)
5 | execute_process(
6 | COMMAND which ${TOOLCHAIN_PREFIX}gcc
7 | OUTPUT_VARIABLE BINUTILS_PATH
8 | OUTPUT_STRIP_TRAILING_WHITESPACE
9 | )
10 |
11 | get_filename_component(ARM_TOOLCHAIN_DIR ${BINUTILS_PATH} DIRECTORY)
12 |
13 | set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}gcc)
14 | set(CMAKE_AR ${TOOLCHAIN_PREFIX}ar)
15 |
16 | set(CMAKE_SYSROOT ${ARM_TOOLCHAIN_DIR}/../arm-openwrt-linux/sysroot)
17 | set(CMAKE_FIND_ROOT_PATH ${BINUTILS_PATH})
18 | set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
19 | set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
20 | set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
21 |
22 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Os" )
23 |
--------------------------------------------------------------------------------
/src/ftpd/ftpd.patch:
--------------------------------------------------------------------------------
1 | diff -Naur pure-ftpd.ori/src/log_unix.c pure-ftpd/src/log_unix.c
2 | --- pure-ftpd.ori/src/log_unix.c 2020-04-11 15:36:30.246492557 +0200
3 | +++ pure-ftpd/src/log_unix.c 2020-04-11 15:36:05.438545312 +0200
4 | @@ -54,6 +54,10 @@
5 | return;
6 | }
7 | #ifdef USE_SHADOW
8 | + /* Hack for Yi Allwinner cam */
9 | + if (strlen(pw.pw_passwd) == 0) {
10 | + goto good;
11 | + }
12 | if ((((pw.pw_passwd)[0] == 'x' && (pw.pw_passwd)[1] == 0) ||
13 | ((pw.pw_passwd)[0] == '#' && (pw.pw_passwd)[1] == '#' &&
14 | strcmp(pw.pw_passwd + 2, account) == 0)) &&
15 | @@ -84,6 +88,8 @@
16 | goto bye;
17 | }
18 | }
19 | +
20 | + good:
21 | result->uid = pw.pw_uid;
22 | result->gid = pw.pw_gid;
23 | result->dir = dir;
24 |
--------------------------------------------------------------------------------
/src/set_tz_offset/compile.set_tz_offset:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | export CROSSPATH=/opt/yi/toolchain-sunxi-musl/toolchain/bin
4 | export PATH=${PATH}:${CROSSPATH}
5 |
6 | export TARGET=arm-openwrt-linux
7 | export CROSS=arm-openwrt-linux
8 | export BUILD=x86_64-pc-linux-gnu
9 |
10 | export CROSSPREFIX=${CROSS}-
11 |
12 | export STRIP=${CROSSPREFIX}strip
13 | export CXX=${CROSSPREFIX}g++
14 | export CC=${CROSSPREFIX}gcc
15 | export LD=${CROSSPREFIX}ld
16 | export AS=${CROSSPREFIX}as
17 | export AR=${CROSSPREFIX}ar
18 |
19 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
20 | cd $SCRIPT_DIR
21 |
22 | cd set_tz_offset || exit 1
23 |
24 | make clean
25 | make -j $(nproc) || exit 1
26 |
27 | mkdir -p ../_install/bin || exit 1
28 |
29 | cp ./set_tz_offset ../_install/bin || exit 1
30 |
31 | ${STRIP} ../_install/bin/* || exit 1
32 |
--------------------------------------------------------------------------------
/src/dropbear/init.dropbear:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | source config.dropbear
7 |
8 | rm -rf ./_install
9 |
10 | if [ ! -f "${ARCHIVE}" ]; then
11 | wget "${MAIN_URL}"
12 | fi
13 |
14 | tar xvf "${ARCHIVE}"
15 |
16 | cd "${BUILD_FOLDER}"
17 |
18 | #autoconf; autoheader || exit 1
19 |
20 | ./configure CC=arm-openwrt-linux-gcc \
21 | --prefix=$SCRIPT_DIR/_install \
22 | CFLAGS="-Os -mcpu=cortex-a7 -mfpu=neon-vfpv4 -I/opt/yi/toolchain-sunxi-musl/toolchain/include -L/opt/yi/toolchain-sunxi-musl/toolchain/lib" \
23 | AR=arm-openwrt-linux-ar \
24 | RANLIB=arm-openwrt-linux-ranlib \
25 | --host=arm \
26 | --disable-zlib \
27 | --disable-harden \
28 | --disable-syslog \
29 | || exit 1
30 |
31 | cp ../localoptions.h ./ || exit 1
32 |
--------------------------------------------------------------------------------
/src/rtsp_server_yi/compile.rtsp_server_yi:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | export CROSSPATH=/opt/yi/toolchain-sunxi-musl/toolchain/bin
4 | export PATH=${PATH}:${CROSSPATH}
5 |
6 | export TARGET=arm-openwrt-linux
7 | export CROSS=arm-openwrt-linux
8 | export BUILD=x86_64-pc-linux-gnu
9 |
10 | export CROSSPREFIX=${CROSS}-
11 |
12 | export STRIP=${CROSSPREFIX}strip
13 | export CXX=${CROSSPREFIX}g++
14 | export CC=${CROSSPREFIX}gcc
15 | export LD=${CROSSPREFIX}ld
16 | export AS=${CROSSPREFIX}as
17 | export AR=${CROSSPREFIX}ar
18 |
19 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
20 | cd $SCRIPT_DIR
21 |
22 | cd RtspServer || exit 1
23 |
24 | make clean
25 | make -j $(nproc) || exit 1
26 |
27 | mkdir -p ../_install/bin || exit 1
28 |
29 | cp ./rtsp_server_yi ../_install/bin/rtsp_server_yi || exit 1
30 |
31 | ${STRIP} ../_install/bin/* || exit 1
32 |
--------------------------------------------------------------------------------
/src/sftp-server/compile.sftp-server:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | export CROSSPATH=/opt/yi/toolchain-sunxi-musl/toolchain/bin
4 | export PATH=${PATH}:${CROSSPATH}
5 |
6 | export TARGET=arm-openwrt-linux
7 | export CROSS=arm-openwrt-linux
8 | export BUILD=x86_64-pc-linux-gnu
9 |
10 | export CROSSPREFIX=${CROSS}-
11 |
12 | export STRIP=${CROSSPREFIX}strip
13 | export CXX=${CROSSPREFIX}g++
14 | export CC=${CROSSPREFIX}gcc
15 | export LD=${CROSSPREFIX}ld
16 | export AS=${CROSSPREFIX}as
17 | export AR=${CROSSPREFIX}ar
18 |
19 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
20 | cd $SCRIPT_DIR
21 |
22 | cd openssh-portable
23 |
24 | make clean
25 | make -j$(nproc) \
26 | sftp-server \
27 | || exit 1
28 |
29 | mkdir -p ../_install/usr/libexec
30 |
31 | cp ./sftp-server ../_install/usr/libexec/
32 | $STRIP ../_install/usr/libexec/* || exit 1
33 |
--------------------------------------------------------------------------------
/src/snapshot/snapshot/add_water.h:
--------------------------------------------------------------------------------
1 | #ifndef __ADD_WATER_H__
2 | #define __ADD_WATER_H__
3 |
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include
10 | #include
11 | #include
12 | #include
13 | #include
14 | #include
15 | #include
16 | #include
17 | #include
18 | #include
19 | #include
20 | #include "water_mark.h"
21 |
22 | int WMInit(WaterMarkInfo *WM_info, char WMPath[30]);
23 | int WMRelease(WaterMarkInfo *WM_info);
24 | int AddWM (WaterMarkInfo *WM_info, unsigned int bg_width, unsigned int bg_height, void *bg_y_vir,
25 | void *bg_c_vir, unsigned int wm_pos_x, unsigned int wm_pos_y, struct tm *time_data);
26 |
27 | #endif
28 |
--------------------------------------------------------------------------------
/src/libwolf_02_mqtt/init.libwolf_02_mqtt:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | CPWD=$(pwd)
7 |
8 | rm -rf ./_install
9 |
10 | source config.wolfmqtt
11 |
12 | if [ ! -f "${ARCHIVE}" ]; then
13 | wget "${MAIN_URL}"
14 | fi
15 |
16 | tar xvf "${ARCHIVE}"
17 |
18 | cd "${BUILD_FOLDER}"
19 |
20 | ./autogen.sh
21 |
22 | ./configure CC=arm-openwrt-linux-gcc \
23 | CFLAGS="-Os -mcpu=cortex-a7 -mfpu=neon-vfpv4 -I/opt/yi/toolchain-sunxi-musl/toolchain/include -I${CPWD}/${WOLFSSL_DIR}/include -L/opt/yi/toolchain-sunxi-musl/toolchain/lib -L${CPWD}/${WOLFSSL_DIR}/lib" \
24 | AR=arm-openwrt-linux-ar \
25 | RANLIB=arm-openwrt-linux-ranlib \
26 | --host=arm-openwrt-linux \
27 | --prefix=$CPWD/_install \
28 | --enable-tls \
29 | || exit 1
30 |
31 | cd ..
32 | patch -p0 < ./fflush.patch
33 |
--------------------------------------------------------------------------------
/src/rRTSPServer/Makefile.libhelix-aac:
--------------------------------------------------------------------------------
1 | OBJECTS = aacdec.o aactabs.o bitstream.o buffers.o dct4.o decelmnt.o dequant.o fft.o filefmt.o huffman.o hufftabs.o imdct.o noiseless.o pns.o sbr.o sbrfft.o sbrfreq.o sbrhfadj.o sbrhfgen.o sbrhuff.o sbrimdct.o sbrmath.o sbrqmf.o sbrside.o sbrtabs.o stproc.o tns.o trigtabs.o
2 | OBJECTS_S = sbrcov.o
3 |
4 | all: libhelix-aac.so libhelix-aac.a
5 |
6 | sbrcov.o: sbrcov.S
7 | $(AS) -c $< -o $@
8 |
9 | %.o: %.c $(HEADERS)
10 | $(CC) -c $< -fPIC -DUSE_DEFAULT_STDLIB -DXXXX__arm__ -Os -o $@
11 |
12 | libhelix-aac.so: $(OBJECTS) $(OBJECTS_S)
13 | $(CC) $(OBJECTS) $(OBJECTS_S) $(LIBS) -fPIC -shared -Os -o $@
14 | $(STRIP) $@
15 |
16 | libhelix-aac.a: $(OBJECTS) $(OBJECTS_S)
17 | $(AR) rcs $@ $(OBJECTS) $(OBJECTS_S)
18 |
19 | .PHONY: clean
20 |
21 | clean:
22 | rm -f libhelix-aac.so
23 | rm -f $(OBJECTS)
24 | rm -f $(OBJECTS_S)
25 |
--------------------------------------------------------------------------------
/src/mjpeg-avi/compile.mjpeg-avi:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | export CROSSPATH=/opt/yi/toolchain-sunxi-musl/toolchain/bin
4 | export PATH=${PATH}:${CROSSPATH}
5 |
6 | export TARGET=arm-openwrt-linux
7 | export CROSS=arm-openwrt-linux
8 | export BUILD=x86_64-pc-linux-gnu
9 |
10 | export CROSSPREFIX=${CROSS}-
11 |
12 | export STRIP=${CROSSPREFIX}strip
13 | export CXX=${CROSSPREFIX}g++
14 | export CC=${CROSSPREFIX}gcc
15 | export LD=${CROSSPREFIX}ld
16 | export AS=${CROSSPREFIX}as
17 | export AR=${CROSSPREFIX}ar
18 |
19 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
20 | cd $SCRIPT_DIR
21 |
22 | cd mjpeg-avi || exit 1
23 |
24 | make clean
25 | make -j $(nproc) || exit 1
26 |
27 | mkdir -p ../_install/bin || exit 1
28 | mkdir -p ../_install/script || exit 1
29 |
30 | cp ./avimake ../_install/bin || exit 1
31 | cp ./create_avi.sh ../_install/script || exit 1
32 |
33 | ${STRIP} ../_install/bin/* || exit 1
34 |
--------------------------------------------------------------------------------
/src/snapshot/compile.snapshot:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | export CROSSPATH=/opt/yi/toolchain-sunxi-musl/toolchain/bin
4 | export PATH=${PATH}:${CROSSPATH}
5 |
6 | export TARGET=arm-openwrt-linux
7 | export CROSS=arm-openwrt-linux
8 | export BUILD=x86_64-pc-linux-gnu
9 |
10 | export CROSSPREFIX=${CROSS}-
11 |
12 | export STRIP=${CROSSPREFIX}strip
13 | export CXX=${CROSSPREFIX}g++
14 | export CC=${CROSSPREFIX}gcc
15 | export LD=${CROSSPREFIX}ld
16 | export AS=${CROSSPREFIX}as
17 | export AR=${CROSSPREFIX}ar
18 |
19 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
20 | cd $SCRIPT_DIR
21 |
22 | cd snapshot || exit 1
23 |
24 | make clean
25 | make -j $(nproc) || exit 1
26 |
27 | mkdir -p ../_install/bin || exit 1
28 | mkdir -p ../_install/etc/wm_res || exit 1
29 |
30 | cp ./imggrabber ../_install/bin || exit 1
31 | cp -r ./wm_res/* ../_install/etc/wm_res || exit 1
32 |
33 | ${STRIP} ../_install/bin/* || exit 1
34 |
--------------------------------------------------------------------------------
/src/h264grabber/compile.h264grabber:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | export CROSSPATH=/opt/yi/toolchain-sunxi-musl/toolchain/bin
4 | export PATH=${PATH}:${CROSSPATH}
5 |
6 | export TARGET=arm-openwrt-linux
7 | export CROSS=arm-openwrt-linux
8 | export BUILD=x86_64-pc-linux-gnu
9 |
10 | export CROSSPREFIX=${CROSS}-
11 |
12 | export STRIP=${CROSSPREFIX}strip
13 | export CXX=${CROSSPREFIX}g++
14 | export CC=${CROSSPREFIX}gcc
15 | export LD=${CROSSPREFIX}ld
16 | export AS=${CROSSPREFIX}as
17 | export AR=${CROSSPREFIX}ar
18 |
19 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
20 | cd $SCRIPT_DIR
21 |
22 | cd h264grabber || exit 1
23 |
24 | make clean
25 | make -j $(nproc) || exit 1
26 |
27 | mkdir -p ../_install/bin || exit 1
28 |
29 | cp ./h264grabber ../_install/bin || exit 1
30 |
31 | ${STRIP} ../_install/bin/* || exit 1
32 |
33 | cd ../_install/bin/
34 | ln -s h264grabber h264grabber_h
35 | ln -s h264grabber h264grabber_l
36 |
--------------------------------------------------------------------------------
/src/mqtt/config.mak:
--------------------------------------------------------------------------------
1 | #
2 | # This file is part of mqttv4 (https://github.com/TheCrypt0/mqttv4).
3 | # Copyright (c) 2018-2019 Davide Maggioni.
4 | #
5 | # This program is free software: you can redistribute it and/or modify
6 | # it under the terms of the GNU General Public License as published by
7 | # the Free Software Foundation, version 3.
8 | #
9 | # This program is distributed in the hope that it will be useful, but
10 | # WITHOUT ANY WARRANTY; without even the implied warranty of
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | # General Public License for more details.
13 | #
14 | # You should have received a copy of the GNU General Public License
15 | # along with this program. If not, see .
16 | #
17 |
18 | CC=arm-openwrt-linux-gcc
19 | AR=arm-openwrt-linux-ar
20 | RANLIB=arm-openwrt-linux-ranlib
21 | STRIP=arm-openwrt-linux-strip
22 |
--------------------------------------------------------------------------------
/src/proccgi/config.mak:
--------------------------------------------------------------------------------
1 | #
2 | # This file is part of yi-hack-v4 (https://github.com/TheCrypt0/yi-hack-v4).
3 | # Copyright (c) 2018-2019 Davide Maggioni.
4 | #
5 | # This program is free software: you can redistribute it and/or modify
6 | # it under the terms of the GNU General Public License as published by
7 | # the Free Software Foundation, version 3.
8 | #
9 | # This program is distributed in the hope that it will be useful, but
10 | # WITHOUT ANY WARRANTY; without even the implied warranty of
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | # General Public License for more details.
13 | #
14 | # You should have received a copy of the GNU General Public License
15 | # along with this program. If not, see .
16 | #
17 |
18 | CC=arm-openwrt-linux-gcc
19 | AR=arm-openwrt-linux-ar
20 | RANLIB=arm-openwrt-linux-ranlib
21 | STRIP=arm-openwrt-linux-strip
22 |
--------------------------------------------------------------------------------
/src/proccgi/proccgi/config.mak:
--------------------------------------------------------------------------------
1 | #
2 | # This file is part of yi-hack-v4 (https://github.com/TheCrypt0/yi-hack-v4).
3 | # Copyright (c) 2018-2019 Davide Maggioni.
4 | #
5 | # This program is free software: you can redistribute it and/or modify
6 | # it under the terms of the GNU General Public License as published by
7 | # the Free Software Foundation, version 3.
8 | #
9 | # This program is distributed in the hope that it will be useful, but
10 | # WITHOUT ANY WARRANTY; without even the implied warranty of
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | # General Public License for more details.
13 | #
14 | # You should have received a copy of the GNU General Public License
15 | # along with this program. If not, see .
16 | #
17 |
18 | CC=arm-openwrt-linux-gcc
19 | AR=arm-openwrt-linux-ar
20 | RANLIB=arm-openwrt-linux-ranlib
21 | STRIP=arm-openwrt-linux-strip
22 |
--------------------------------------------------------------------------------
/src/alsa-lib/init.alsa-lib:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | ARCHIVE=alsa-lib-1.1.4.1.tar.bz2
4 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
5 | cd $SCRIPT_DIR
6 |
7 | rm -rf ./_install
8 | rm -rf ./alsa-lib-1.1.4.1
9 |
10 | if [ ! -f $ARCHIVE ]; then
11 | wget https://www.alsa-project.org/files/pub/lib/$ARCHIVE
12 | fi
13 | tar jxvf $ARCHIVE
14 |
15 | cd alsa-lib-1.1.4.1 || exit 1
16 |
17 | patch -p1 < ../patch/001_dmix_support_S16_LE_format.patch
18 | patch -p1 < ../patch/100-link_fix.patch
19 | patch -p1 < ../patch/200-fix_include_file_redirect_warnings.patch
20 | patch -p1 < ../patch/201-fix-snd_pcm_area_silence-remaining-samples-issue.patch
21 | patch -p1 < ../patch/300-ensure-ringbuffer-empty-with-dmix.patch
22 |
23 | patch -p1 < ../alsa-lib.patch
24 |
25 | export CFLAGS+="-Os"
26 | ./configure --host=arm-openwrt-linux --disable-aload --disable-topology --disable-ucm --disable-alisp --disable-python --without-debug --with-versioned=no
27 |
--------------------------------------------------------------------------------
/src/alsa-lib/patch/201-fix-snd_pcm_area_silence-remaining-samples-issue.patch:
--------------------------------------------------------------------------------
1 | After silencing the buffer 64 bits at a time, any remaining samples
2 | need to be silenced by the following width-specific code. However, instead
3 | of silencing the end of the buffer, the code instead re-silences the start
4 | of the buffer, leaving the end unsilenced. To fix this, update the pointer
5 | used by the width-specific code to point to the end of the area just
6 | silenced, instead of leaving it pointing to the start of the buffer.
7 |
8 | diff --git a/src/pcm/pcm.c b/src/pcm/pcm.c
9 | index 200b10c..c020cbf 100644
10 | --- a/src/pcm/pcm.c
11 | +++ b/src/pcm/pcm.c
12 | @@ -2908,6 +2908,7 @@ int snd_pcm_area_silence(const snd_pcm_channel_area_t *dst_area, snd_pcm_uframes
13 | *dstp++ = silence;
14 | if (samples == 0)
15 | return 0;
16 | + dst = (char *)dstp;
17 | }
18 | dst_step = dst_area->step / 8;
19 | switch (width) {
20 |
--------------------------------------------------------------------------------
/src/mqtt/compile.mqtt:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -e
4 |
5 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
6 | cd $SCRIPT_DIR
7 |
8 | CPWD=$(pwd)
9 | MOSQUITTO_DIR="../mosquitto/_install"
10 | WOLFSSL_DIR="../libwolf_01_ssl/_install"
11 | WOLFMQTT_DIR="../libwolf_02_mqtt/_install"
12 |
13 | cd mqttv4
14 |
15 | #export USE_MOSQUITTO=1
16 | export CFLAGS="-Os -mcpu=cortex-a7 -mfpu=neon-vfpv4 -I/opt/yi/toolchain-sunxi-musl/toolchain/include -I${CPWD}/${WOLFSSL_DIR}/include -I${CPWD}/${WOLFMQTT_DIR}/include -I${CPWD}/${MOSQUITTO_DIR}/../mosquitto/lib"
17 | export LIBS="-L/opt/yi/toolchain-sunxi-musl/toolchain/lib -L${CPWD}/${WOLFSSL_DIR}/lib -L${CPWD}/${WOLFMQTT_DIR}/lib -L${CPWD}/${MOSQUITTO_DIR}/lib"
18 |
19 | make clean
20 | make -j $(nproc) || exit 1
21 |
22 | mkdir -p ../_install/bin
23 | mkdir -p ../_install/etc
24 |
25 | cp ./mqttv4 ../_install/bin
26 | cp ./conf/mqttv4.conf ../_install/etc
27 |
28 | arm-openwrt-linux-strip ../_install/bin/*
29 |
--------------------------------------------------------------------------------
/src/rRTSPServer/friend.patch:
--------------------------------------------------------------------------------
1 | diff -Naur live.old/liveMedia/include/RTPSource.hh live/liveMedia/include/RTPSource.hh
2 | --- live.old/liveMedia/include/RTPSource.hh 2023-01-19 16:01:59.000000000 +0100
3 | +++ live/liveMedia/include/RTPSource.hh 2024-02-26 16:42:21.733370235 +0100
4 | @@ -86,7 +86,7 @@
5 | // RTP sequence numbers and timestamps are usually not useful to receivers.
6 | // (Our implementation of RTP reception already does all needed handling of RTP sequence numbers and timestamps.)
7 | u_int16_t curPacketRTPSeqNum() const { return fCurPacketRTPSeqNum; }
8 | -private: friend class MediaSubsession; // "MediaSubsession" is the only outside class that ever needs to see RTP timestamps!
9 | +//private: friend class MediaSubsession; // "MediaSubsession" is the only outside class that ever needs to see RTP timestamps!
10 | u_int32_t curPacketRTPTimestamp() const { return fCurPacketRTPTimestamp; }
11 |
12 | protected:
13 |
--------------------------------------------------------------------------------
/src/rRTSPServer/rRTSPServer.patch:
--------------------------------------------------------------------------------
1 | diff -Naur live.ori/config.linux-cross live/config.linux-cross
2 | --- live.ori/config.linux-cross 1970-01-01 01:00:00.000000000 +0100
3 | +++ live/config.linux-cross 2021-02-18 10:39:28.103846011 +0100
4 | @@ -0,0 +1,17 @@
5 | +COMPILE_OPTS = $(INCLUDES) -I. -O0 -ffunction-sections -fdata-sections -DSOCKLEN_T=socklen_t -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 -DNO_OPENSSL=1 -DRTP_PAYLOAD_MAX_SIZE=1352
6 | +C = c
7 | +C_COMPILER = $(CC)
8 | +C_FLAGS = $(COMPILE_OPTS) $(CPPFLAGS) $(CFLAGS)
9 | +CPP = cpp
10 | +CPLUSPLUS_COMPILER = $(CXX)
11 | +CPLUSPLUS_FLAGS = $(COMPILE_OPTS) -Wall -DBSD=1 $(CPPFLAGS) $(CXXFLAGS)
12 | +OBJ = o
13 | +LINK = $(CXX) -o
14 | +LINK_OPTS = -Wl,--gc-sections -L. $(LDFLAGS)
15 | +CONSOLE_LINK_OPTS = $(LINK_OPTS)
16 | +LIBRARY_LINK = $(AR) cr
17 | +LIBRARY_LINK_OPTS =
18 | +LIB_SUFFIX = a
19 | +LIBS_FOR_CONSOLE_APPLICATION =
20 | +LIBS_FOR_GUI_APPLICATION =
21 | +EXE =
22 |
--------------------------------------------------------------------------------
/src/minimp4/compile.minimp4:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | export CROSSPATH=/opt/yi/toolchain-sunxi-musl/toolchain/bin
4 | export PATH=${PATH}:${CROSSPATH}
5 |
6 | export TARGET=arm-openwrt-linux
7 | export CROSS=arm-openwrt-linux
8 | export BUILD=x86_64-pc-linux-gnu
9 |
10 | export CROSSPREFIX=${CROSS}-
11 |
12 | export STRIP=${CROSSPREFIX}strip
13 | export CXX=${CROSSPREFIX}g++
14 | export CC=${CROSSPREFIX}gcc
15 | export LD=${CROSSPREFIX}ld
16 | export AS=${CROSSPREFIX}as
17 | export AR=${CROSSPREFIX}ar
18 |
19 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
20 | cd $SCRIPT_DIR
21 |
22 | cd minimp4 || exit 1
23 | rm -f minimp4_yi
24 |
25 | $CC -mcpu=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -DNDEBUG -D_FILE_OFFSET_BITS=64 \
26 | -flto -Os -fomit-frame-pointer -ftree-vectorize \
27 | -o minimp4_yi minimp4_yi.c -lm -lpthread
28 |
29 | mkdir -p ../_install/bin || exit 1
30 |
31 | cp ./minimp4_yi ../_install/bin || exit 1
32 | $STRIP ../_install/bin/* || exit 1
33 |
--------------------------------------------------------------------------------
/src/www/httpd/cgi-bin/record.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | YI_HACK_PREFIX="/home/yi-hack"
4 |
5 | . $YI_HACK_PREFIX/www/cgi-bin/validate.sh
6 |
7 | if ! $(validateQueryString $QUERY_STRING); then
8 | printf "Content-type: application/json\r\n\r\n"
9 | printf "{\n"
10 | printf "\"%s\":\"%s\"\\n" "error" "true"
11 | printf "}"
12 | exit
13 | fi
14 |
15 | TIME=60
16 |
17 | for I in 1
18 | do
19 | CONF="$(echo $QUERY_STRING | cut -d'&' -f$I | cut -d'=' -f1)"
20 | VAL="$(echo $QUERY_STRING | cut -d'&' -f$I | cut -d'=' -f2)"
21 |
22 | if [ "$CONF" == "time" ] ; then
23 | TIME="$VAL"
24 | fi
25 | done
26 |
27 | if ! $(validateNumber $TIME); then
28 | printf "Content-type: application/json\r\n\r\n"
29 | printf "{\n"
30 | printf "\"%s\":\"%s\"\\n" "error" "true"
31 | printf "}"
32 | exit
33 | fi
34 |
35 | ipc_cmd -S $TIME &
36 |
37 | printf "Content-type: application/json\r\n\r\n"
38 | printf "{\n"
39 | printf "\"%s\":\"%s\"\\n" "error" "false"
40 | printf "}\n"
41 |
--------------------------------------------------------------------------------
/src/ipc_cmd/ipc_cmd/Makefile:
--------------------------------------------------------------------------------
1 | OBJECTS_C = ipc_cmd.o ptz.o
2 | OBJECTS_R = ipc_read.o
3 | OBJECTS_N = ipc_notify.o
4 | OBJECTS_2 = ipc2file.o
5 | #LIBS = -lpthread -lrt
6 |
7 | all: ipc_cmd ipc_read ipc_notify ipc2file ipc_multiplex.so
8 |
9 | %.o: %.c $(HEADERS)
10 | $(CC) -c $< -fPIC -Os -o $@
11 |
12 | ipc_multiplex.so: ipc_multiplex.c $(HEADERS)
13 | $(CC) $< -fPIC -Os -shared -o $@
14 |
15 | ipc_cmd: $(OBJECTS_C)
16 | $(CC) $(OBJECTS_C) $(LIBS) -fPIC -Os -o $@
17 | $(STRIP) $@
18 |
19 | ipc_read: $(OBJECTS_R)
20 | $(CC) $(OBJECTS_R) $(LIBS) -fPIC -Os -o $@
21 | $(STRIP) $@
22 |
23 | ipc_notify: $(OBJECTS_N)
24 | $(CC) $(OBJECTS_N) $(LIBS) -fPIC -Os -o $@
25 | $(STRIP) $@
26 |
27 | ipc2file: $(OBJECTS_2)
28 | $(CC) $(OBJECTS_2) $(LIBS) -fPIC -Os -o $@
29 | $(STRIP) $@
30 |
31 | .PHONY: clean
32 |
33 | clean:
34 | rm -f ipc_cmd
35 | rm -f ipc_read
36 | rm -f ipc_notify
37 | rm -f ipc2file
38 | rm -f ipc_multiplex.so
39 | rm -f $(OBJECTS_C)
40 | rm -f $(OBJECTS_R)
41 | rm -f $(OBJECTS_N)
42 | rm -f $(OBJECTS_2)
43 |
--------------------------------------------------------------------------------
/src/ipc_cmd/compile.ipc_cmd:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | export CROSSPATH=/opt/yi/toolchain-sunxi-musl/toolchain/bin
4 | export PATH=${PATH}:${CROSSPATH}
5 |
6 | export TARGET=arm-openwrt-linux
7 | export CROSS=arm-openwrt-linux
8 | export BUILD=x86_64-pc-linux-gnu
9 |
10 | export CROSSPREFIX=${CROSS}-
11 |
12 | export STRIP=${CROSSPREFIX}strip
13 | export CXX=${CROSSPREFIX}g++
14 | export CC=${CROSSPREFIX}gcc
15 | export LD=${CROSSPREFIX}ld
16 | export AS=${CROSSPREFIX}as
17 | export AR=${CROSSPREFIX}ar
18 |
19 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
20 | cd $SCRIPT_DIR
21 |
22 | cd ipc_cmd || exit 1
23 |
24 | make clean
25 | make -j $(nproc) || exit 1
26 |
27 | mkdir -p ../_install/bin || exit 1
28 | mkdir -p ../_install/lib || exit 1
29 |
30 | cp ./ipc_cmd ../_install/bin || exit 1
31 | cp ./ipc_read ../_install/bin || exit 1
32 | cp ./ipc_notify ../_install/bin || exit 1
33 | cp ./ipc2file ../_install/bin || exit 1
34 | cp ./ipc_multiplex.so ../_install/lib || exit 1
35 |
36 | ${STRIP} ../_install/bin/* || exit 1
37 | ${STRIP} ../_install/lib/* || exit 1
38 |
--------------------------------------------------------------------------------
/unbrick/mount.jffs2:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | ## Script to mount jffs2 filesystem using mtd kernel modules.
4 | ## EMAC, Inc. 2009
5 |
6 | if [[ $# -lt 2 ]]
7 | then
8 | echo "Usage: $0 FSNAME.JFFS2 MOUNTPOINT [ERASEBLOCK_SIZE]"
9 | exit 1
10 | fi
11 |
12 | if [ "$(whoami)" != "root" ]
13 | then
14 | echo "$0 must be run as root!"
15 | exit 1
16 | fi
17 |
18 | if [[ ! -e $1 ]]
19 | then
20 | echo "$1 does not exist"
21 | exit 1
22 | fi
23 |
24 | if [[ ! -d $2 ]]
25 | then
26 | echo "$2 is not a valid mount point"
27 | exit 1
28 | fi
29 |
30 | if [[ "$3" == "" ]]
31 | then
32 | esize="128"
33 | else
34 | esize="$3"
35 | fi
36 |
37 | # cleanup if necessary
38 | umount /dev/mtdblock0 &>/dev/null
39 | modprobe -r mtdram &>/dev/null
40 | modprobe -r mtdblock &>/dev/null
41 |
42 | modprobe mtdram total_size=32768 erase_size=$esize || exit 1
43 | modprobe mtdblock || exit 1
44 | dd if="$1" of=/dev/mtdblock0 || exit 1
45 | mount -t jffs2 /dev/mtdblock0 $2 || exit 1
46 |
47 | echo "Successfully mounted $1 on $2"
48 | exit 0
49 |
50 |
--------------------------------------------------------------------------------
/src/dropbear/localoptions.h:
--------------------------------------------------------------------------------
1 | #ifndef DROPBEAR_LOCALOPTIONS_H
2 | #define DROPBEAR_LOCALOPTIONS_H
3 |
4 | #define DSS_PRIV_FILENAME "/home/yi-hack/etc/dropbear/dropbear_dss_host_key"
5 | #define RSA_PRIV_FILENAME "/home/yi-hack/etc/dropbear/dropbear_rsa_host_key"
6 | #define ECDSA_PRIV_FILENAME "/home/yi-hack/etc/dropbear/dropbear_ecdsa_host_key"
7 | #define ED25519_PRIV_FILENAME "/home/yi-hack/etc/dropbear/dropbear_ed25519_host_key"
8 |
9 | #define DROPBEAR_PATH_SSH_PROGRAM "/home/yi-hack/bin/dbclient"
10 |
11 | #define DEFAULT_PATH "/usr/bin:/usr/sbin:/bin:/sbin:/home/base/tools:/home/app/localbin:/home/base:/home/base/tools:/home/yi-hack/bin:/home/yi-hack/sbin:/home/yi-hack/usr/bin:/home/yi-hack/usr/sbin:/tmp/sd/yi-hack/bin:/tmp/sd/yi-hack/sbin"
12 | #define DEFAULT_ROOT_PATH "/usr/bin:/usr/sbin:/bin:/sbin:/home/base/tools:/home/app/localbin:/home/base:/home/base/tools:/home/yi-hack/bin:/home/yi-hack/sbin:/home/yi-hack/usr/bin:/home/yi-hack/usr/sbin:/tmp/sd/yi-hack/bin:/tmp/sd/yi-hack/sbin"
13 |
14 | #define SFTPSERVER_PATH "/home/yi-hack/usr/libexec/sftp-server"
15 |
16 | #endif /* DROPBEAR_LOCALOPTIONS_H */
17 |
--------------------------------------------------------------------------------
/src/alsa-lib/patch/100-link_fix.patch:
--------------------------------------------------------------------------------
1 | --- a/src/Makefile.in
2 | +++ b/src/Makefile.in
3 | @@ -421,7 +421,7 @@ clean-libLTLIBRARIES:
4 | rm -f $${locs}; \
5 | }
6 | libasound.la: $(libasound_la_OBJECTS) $(libasound_la_DEPENDENCIES) $(EXTRA_libasound_la_DEPENDENCIES)
7 | - $(AM_V_CCLD)$(libasound_la_LINK) -rpath $(libdir) $(libasound_la_OBJECTS) $(libasound_la_LIBADD) $(LIBS)
8 | + $(AM_V_CCLD)$(libasound_la_LINK) -rpath $(DESTDIR)$(libdir) $(libasound_la_OBJECTS) $(libasound_la_LIBADD) $(LIBS)
9 |
10 | mostlyclean-compile:
11 | -rm -f *.$(OBJEXT)
12 | --- a/src/pcm/scopes/Makefile.in
13 | +++ b/src/pcm/scopes/Makefile.in
14 | @@ -348,7 +348,7 @@ clean-pkglibLTLIBRARIES:
15 | rm -f $${locs}; \
16 | }
17 | scope-level.la: $(scope_level_la_OBJECTS) $(scope_level_la_DEPENDENCIES) $(EXTRA_scope_level_la_DEPENDENCIES)
18 | - $(AM_V_CCLD)$(scope_level_la_LINK) -rpath $(pkglibdir) $(scope_level_la_OBJECTS) $(scope_level_la_LIBADD) $(LIBS)
19 | + $(AM_V_CCLD)$(scope_level_la_LINK) -rpath $(DESTDIR)$(pkglibdir) $(scope_level_la_OBJECTS) $(scope_level_la_LIBADD) $(LIBS)
20 |
21 | mostlyclean-compile:
22 | -rm -f *.$(OBJEXT)
23 |
--------------------------------------------------------------------------------
/src/onvif_simple_server/mbedtls_config.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file mbedtls_config.h
3 | *
4 | * \brief Configuration options (set of defines)
5 | *
6 | * This set of compile-time options may be used to enable
7 | * or disable features selectively, and reduce the global
8 | * memory footprint.
9 | */
10 | /*
11 | * Copyright The Mbed TLS Contributors
12 | * SPDX-License-Identifier: Apache-2.0
13 | *
14 | * Licensed under the Apache License, Version 2.0 (the "License"); you may
15 | * not use this file except in compliance with the License.
16 | * You may obtain a copy of the License at
17 | *
18 | * http://www.apache.org/licenses/LICENSE-2.0
19 | *
20 | * Unless required by applicable law or agreed to in writing, software
21 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
22 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23 | * See the License for the specific language governing permissions and
24 | * limitations under the License.
25 | */
26 |
27 | #define MBEDTLS_HAVE_ASM
28 | #define MBEDTLS_HAVE_TIME
29 | #define MBEDTLS_HAVE_TIME_DATE
30 | #define MBEDTLS_SHA1_C
31 | #define MBEDTLS_BASE64_C
32 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License
2 |
3 | Copyright (c) 2010-2020 Google, Inc. http://angularjs.org
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
22 |
--------------------------------------------------------------------------------
/src/www/httpd/cgi-bin/proxy.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | YI_HACK_PREFIX="/home/yi-hack"
4 |
5 | . $YI_HACK_PREFIX/www/cgi-bin/validate.sh
6 |
7 | if ! $(validateQueryString $QUERY_STRING); then
8 | printf "Content-type: application/json\r\n\r\n"
9 | printf "{\n"
10 | printf "\"%s\":\"%s\"\\n" "error" "true"
11 | printf "}"
12 | exit
13 | fi
14 |
15 | PARAM="$(echo $QUERY_STRING | cut -d'&' -f1 | cut -d'=' -f1)"
16 | VALUE="$(echo $QUERY_STRING | cut -d'&' -f1 | cut -d'=' -f2)"
17 |
18 | TEST_WITH_PROXY="0"
19 | if [ "$PARAM" == "proxy" ]; then
20 | if [ "$VALUE" == "1" ]; then
21 | TEST_WITH_PROXY="1"
22 | fi
23 | else
24 | printf "Content-type: application/json\r\n\r\n"
25 | printf "{\n"
26 | printf "\"%s\":\"%s\"\\n" "error" "true"
27 | printf "}"
28 | exit
29 | fi
30 |
31 | if [ "$TEST_WITH_PROXY" == "1" ]; then
32 | RES=$(IFS='' proxychains4 wget -O- -q http://ipinfo.io)
33 | else
34 | RES=$(IFS='' wget -O- -q http://ipinfo.io)
35 | fi
36 |
37 | printf "Content-type: application/json\r\n\r\n"
38 | printf "{\n"
39 | printf "\"%s\":\"%s\",\\n" "error" "false"
40 | printf "\"%s\":%s\\n" "result" "$RES"
41 | printf "}"
42 |
--------------------------------------------------------------------------------
/src/mosquitto/compile.mosquitto:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | source config.mosquitto
4 |
5 | if [ "$USE_MOSQUITTO" != "1" ]; then
6 | exit
7 | fi
8 |
9 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
10 | cd $SCRIPT_DIR
11 |
12 | cd "${BUILD_FOLDER}" || exit 1
13 |
14 | export CXX=g++
15 |
16 | make clean
17 | make -j$(nproc) \
18 | CROSS_COMPILE=arm-openwrt-linux- \
19 | CC=gcc \
20 | AR=ar \
21 | ARCH=arm \
22 | CFLAGS="-Os -mcpu=cortex-a7 -mfpu=neon-vfpv4 -I/opt/yi/toolchain-sunxi-musl/toolchain/include -L/opt/yi/toolchain-sunxi-musl/toolchain/lib" \
23 | WITH_SRV=no \
24 | WITH_UUID=no \
25 | WITH_WEBSOCKETS=no \
26 | WITH_TLS=no \
27 | WITH_TLS_PSK=no \
28 | WITH_CJSON=no \
29 | WITH_BRIDGE=no \
30 | WITH_MEMORY_TRACKING=no \
31 | WITH_DOCS=no \
32 | || exit 1
33 |
34 | mkdir -p ../_install/bin || exit 1
35 | mkdir -p ../_install/lib || exit 1
36 |
37 | cp ./client/mosquitto_pub ../_install/bin || exit 1
38 | cp ./client/mosquitto_sub ../_install/bin || exit 1
39 |
40 | cp ./lib/libmosquitto.so.1 ../_install/lib || exit 1
41 |
42 | arm-openwrt-linux-strip ../_install/bin/* || exit 1
43 | arm-openwrt-linux-strip ../_install/lib/* || exit 1
44 |
--------------------------------------------------------------------------------
/src/proxychains-ng/compile.proxychains-ng:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | export CROSSPATH=/opt/yi/toolchain-sunxi-musl/toolchain/bin
4 | export PATH=${PATH}:${CROSSPATH}
5 |
6 | export TARGET=arm-openwrt-linux
7 | export CROSS=arm-openwrt-linux
8 | export BUILD=x86_64-pc-linux-gnu
9 |
10 | export CROSSPREFIX=${CROSS}-
11 |
12 | export STRIP=${CROSSPREFIX}strip
13 | export CXX=${CROSSPREFIX}g++
14 | export CC=${CROSSPREFIX}gcc
15 | export LD=${CROSSPREFIX}ld
16 | export AS=${CROSSPREFIX}as
17 | export AR=${CROSSPREFIX}ar
18 |
19 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
20 | cd $SCRIPT_DIR
21 |
22 | cd proxychains-ng || exit 1
23 |
24 | make clean
25 | make -j$(nproc) || exit 1
26 |
27 | mkdir -p $SCRIPT_DIR/_install/bin
28 | mkdir -p $SCRIPT_DIR/_install/lib
29 | mkdir -p $SCRIPT_DIR/_install/etc
30 |
31 | cp -f proxychains4 $SCRIPT_DIR/_install/bin
32 | cp -f libproxychains4.so $SCRIPT_DIR/_install/lib
33 |
34 | arm-openwrt-linux-strip $SCRIPT_DIR/_install/bin/proxychains4
35 | arm-openwrt-linux-strip $SCRIPT_DIR/_install/lib/libproxychains4.so
36 |
37 | cd ..
38 | cp -f proxychains.conf $SCRIPT_DIR/_install/etc/proxychains.conf.template
39 | cp -f proxychains.conf $SCRIPT_DIR/_install/etc/proxychains.conf
40 |
--------------------------------------------------------------------------------
/src/mqtt-config/compile.mqtt-config:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | export CROSSPATH=/opt/yi/toolchain-sunxi-musl/toolchain/bin
4 | export PATH=${PATH}:${CROSSPATH}
5 |
6 | export TARGET=arm-openwrt-linux
7 | export CROSS=arm-openwrt-linux
8 | export BUILD=x86_64-pc-linux-gnu
9 |
10 | export CROSSPREFIX=${CROSS}-
11 |
12 | export STRIP=${CROSSPREFIX}strip
13 | export CXX=${CROSSPREFIX}g++
14 | export CC=${CROSSPREFIX}gcc
15 | export LD=${CROSSPREFIX}ld
16 | export AS=${CROSSPREFIX}as
17 | export AR=${CROSSPREFIX}ar
18 |
19 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
20 | cd $SCRIPT_DIR
21 |
22 | CPWD=$(pwd)
23 | MOSQUITTO_DIR="../mosquitto/_install"
24 | WOLFSSL_DIR="../libwolf_01_ssl/_install"
25 | WOLFMQTT_DIR="../libwolf_02_mqtt/_install"
26 |
27 | cd mqtt-config
28 |
29 | #export USE_MOSQUITTO=1
30 | export CFLAGS="-I${CPWD}/${WOLFSSL_DIR}/include -I${CPWD}/${WOLFMQTT_DIR}/include -I${CPWD}/${MOSQUITTO_DIR}/../mosquitto/lib"
31 | export LIBS="-L${CPWD}/${WOLFSSL_DIR}/lib -L${CPWD}/${WOLFMQTT_DIR}/lib -L${CPWD}/${MOSQUITTO_DIR}/lib"
32 |
33 | make clean
34 | make -j $(nproc) || exit 1
35 |
36 | mkdir -p ../_install/bin
37 |
38 | cp ./mqtt-config ../_install/bin
39 |
40 | arm-openwrt-linux-strip ../_install/bin/*
41 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "src/ftpd/pure-ftpd"]
2 | path = src/ftpd/pure-ftpd
3 | url = https://github.com/jedisct1/pure-ftpd
4 | [submodule "src/mosquitto/mosquitto"]
5 | path = src/mosquitto/mosquitto
6 | url = https://github.com/eclipse/mosquitto
7 | [submodule "src/proxychains-ng/proxychains-ng"]
8 | path = src/proxychains-ng/proxychains-ng
9 | url = https://github.com/rofl0r/proxychains-ng
10 | [submodule "src/mqtt/mqttv4"]
11 | path = src/mqtt/mqttv4
12 | url = https://github.com/roleoroleo/mqttv4
13 | [submodule "src/rtsp_server_yi/RtspServer"]
14 | path = src/rtsp_server_yi/RtspServer
15 | url = http://github.com/roleoroleo/RtspServer
16 | [submodule "src/minimp4/minimp4"]
17 | path = src/minimp4/minimp4
18 | url = https://github.com/roleoroleo/minimp4
19 | [submodule "src/sftp-server/openssh-portable"]
20 | path = src/sftp-server/openssh-portable
21 | url = https://github.com/openssh/openssh-portable
22 | [submodule "src/mjpeg-avi/mjpeg-avi"]
23 | path = src/mjpeg-avi/mjpeg-avi
24 | url = https://github.com/Ricardicus/mjpeg-avi
25 | [submodule "src/onvif_simple_server/onvif_simple_server"]
26 | path = src/onvif_simple_server/onvif_simple_server
27 | url = http://github.com/roleoroleo/onvif_simple_server
28 |
--------------------------------------------------------------------------------
/scripts/pack_fw.all.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | #
4 | # This file is part of yi-hack-v4 (https://github.com/TheCrypt0/yi-hack-v4).
5 | # Copyright (c) 2018-2019 Davide Maggioni.
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU General Public License as published by
9 | # the Free Software Foundation, version 3.
10 | #
11 | # This program is distributed in the hope that it will be useful, but
12 | # WITHOUT ANY WARRANTY; without even the implied warranty of
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | # General Public License for more details.
15 | #
16 | # You should have received a copy of the GNU General Public License
17 | # along with this program. If not, see .
18 | #
19 |
20 | get_script_dir()
21 | {
22 | echo "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
23 | }
24 |
25 | ###############################################################################
26 |
27 | source "$(get_script_dir)/common.sh"
28 |
29 | require_root
30 |
31 | SCRIPT_DIR=$(get_script_dir)
32 |
33 | for CAMERA_NAME in "${!CAMERAS[@]}"; do
34 | $SCRIPT_DIR/pack_fw.sh $CAMERA_NAME
35 | done
36 |
--------------------------------------------------------------------------------
/src/rRTSPServer/src/FileServerMediaSubsession_BC.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2025 roleo.
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, version 3.
7 | *
8 | * This program is distributed in the hope that it will be useful, but
9 | * WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 | * General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | */
16 |
17 | /*
18 | * A ServerMediaSubsession object
19 | */
20 |
21 | #include "FileServerMediaSubsession_BC.hh"
22 |
23 | FileServerMediaSubsession_BC
24 | ::FileServerMediaSubsession_BC(UsageEnvironment& env, char const* fileName,
25 | Boolean reuseFirstSource)
26 | : OnDemandServerMediaSubsession_BC(env, reuseFirstSource),
27 | fFileSize(0) {
28 | fFileName = strDup(fileName);
29 | }
30 |
31 | FileServerMediaSubsession_BC::~FileServerMediaSubsession_BC() {
32 | delete[] (char*)fFileName;
33 | }
34 |
--------------------------------------------------------------------------------
/src/mqtt-config/mqtt-config/mqtt.h:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 |
10 | #ifdef USE_MOSQUITTO
11 | #include
12 | #else
13 | #include
14 | #include
15 | #include
16 | #include
17 | #endif
18 |
19 | //#include
20 |
21 | //#define EMPTY_TOPIC "EMPTY_TOPIC"
22 | #define MQTT_MAX_PACKET_SZ 2048
23 | #define MQTT_PING_INTERVAL 30
24 | #define RECONNECT_DELAY 3000
25 | #define DEFAULT_CON_TIMEOUT 5000
26 | #define DEFAULT_CMD_TIMEOUT 30000
27 |
28 | void mqtt_set_conf(mqtt_conf_t *conf);
29 | int init_mqtt(void);
30 | void stop_mqtt(void);
31 | int init_mosquitto_instance();
32 | void mqtt_loop(void);
33 | #ifdef USE_MOSQUITTO
34 | void connect_callback(struct mosquitto *mosq, void *obj, int result);
35 | void disconnect_callback(struct mosquitto *mosq, void *obj, int result);
36 | void message_callback(struct mosquitto *mosq, void *obj, const struct mosquitto_message *message);
37 | #endif
38 | void mqtt_check_connection();
39 | int mqtt_connect();
40 |
--------------------------------------------------------------------------------
/src/static/static/home/yi-hack/etc/system.conf:
--------------------------------------------------------------------------------
1 | HTTPD=yes
2 | TELNETD=yes
3 | SSHD=yes
4 | FTPD=yes
5 | BUSYBOX_FTPD=no
6 | MDNSD=yes
7 | DISABLE_CLOUD=no
8 | REC_WITHOUT_CLOUD=no
9 | MQTT=no
10 | RTSP=yes
11 | RTSP_ALT=standard
12 | RTSP_STREAM=high
13 | RTSP_AUDIO=yes
14 | RTSP_STI=yes
15 | SPEAKER_AUDIO=yes
16 | SNAPSHOT=yes
17 | SNAPSHOT_VIDEO=no
18 | SNAPSHOT_LOW=no
19 | TIMELAPSE=no
20 | TIMELAPSE_FTP=no
21 | TIMELAPSE_FTP_SAME_NAME=no
22 | TIMELAPSE_DT=60
23 | TIMELAPSE_VDT=
24 | ONVIF=yes
25 | ONVIF_WSDD=yes
26 | ONVIF_PROFILE=high
27 | ONVIF_WM_SNAPSHOT=yes
28 | ONVIF_AUDIO_BC=NONE
29 | ONVIF_ENABLE_MEDIA2=no
30 | ONVIF_FAULT_IF_UNKNOWN=no
31 | ONVIF_FAULT_IF_SET=no
32 | ONVIF_SYNOLOGY_NVR=no
33 | TIME_OSD=no
34 | NTPD=yes
35 | NTP_SERVER=pool.ntp.org
36 | PROXYCHAINSNG=no
37 | SWAP_FILE=yes
38 | SWAP_SWAPPINESS=15
39 | KERNEL_TUNING=yes
40 | RTSP_PORT=554
41 | HTTPD_PORT=80
42 | USERNAME=
43 | PASSWORD=
44 | TIMEZONE=
45 | EVENTS_TIME=autodetect
46 | FREE_SPACE=0
47 | FTP_UPLOAD=no
48 | FTP_HOST=
49 | FTP_DIR=
50 | FTP_DIR_TREE=no
51 | FTP_USERNAME=
52 | FTP_PASSWORD=
53 | FTP_FILE_DELETE_AFTER_UPLOAD=yes
54 | SSH_PASSWORD=
55 | CRONTAB=
56 | DEBUG_LOG=no
57 | STATIC_IP=
58 | STATIC_MASK=
59 | STATIC_GW=
60 | STATIC_DNS1=
61 | STATIC_DNS2=
62 |
--------------------------------------------------------------------------------
/src/snapshot/snapshot/convert2jpg.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2020 roleo.
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, version 3.
7 | *
8 | * This program is distributed in the hope that it will be useful, but
9 | * WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 | * General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | */
16 |
17 | /*
18 | * Reads the YUV buffer, extracts the last frame and converts it to jpg.
19 | */
20 |
21 | #include
22 | #include
23 | #include
24 | #include
25 |
26 | #include
27 |
28 | #define JPEG_QUALITY 90
29 |
30 | int YUVtoJPG(char * output_file, unsigned char *input, const int width, const int height, const int dest_width, const int dest_height);
31 | int convert2jpg(char *output_file, char *input_file, const int width, const int height, const int dest_width, const int dest_height);
32 |
--------------------------------------------------------------------------------
/src/static/static/home/yi-hack/script/ethdhcp.sh:
--------------------------------------------------------------------------------
1 | killall udhcpc
2 | HN="yi-hack"
3 | CONF_FILE="etc/system.conf"
4 | YI_HACK_PREFIX="/home/yi-hack"
5 |
6 | get_config()
7 | {
8 | key=$1
9 | grep -w $1 $YI_HACK_PREFIX/$CONF_FILE | cut -d "=" -f2
10 | }
11 |
12 | STATIC_IP=$(get_config STATIC_IP)
13 | STATIC_MASK=$(get_config STATIC_MASK)
14 | STATIC_GW=$(get_config STATIC_GW)
15 | STATIC_DNS1=$(get_config STATIC_DNS1)
16 | STATIC_DNS2=$(get_config STATIC_DNS2)
17 |
18 | if [ -z $STATIC_IP ] || [ -z $STATIC_MASK ]; then
19 | if [ -f /tmp/sd/yi-hack/etc/hostname ]; then
20 | HN=$(cat /tmp/sd/yi-hack/etc/hostname)
21 | fi
22 | udhcpc -i eth0 -b -s /home/app/script/default.script -x hostname:$HN
23 | else
24 | ifconfig wlan0 $STATIC_IP netmask $STATIC_MASK
25 | if [ ! -z $STATIC_GW ]; then
26 | route add -net 0.0.0.0 gw $STATIC_GW
27 | fi
28 | if [ ! -z $STATIC_DNS1 ] || [ ! -z $STATIC_DNS2 ]; then
29 | rm /tmp/resolv.conf
30 | touch /tmp/resolv.conf
31 | if [ ! -z $STATIC_DNS1 ]; then
32 | echo "nameserver $STATIC_DNS1" >> /tmp/resolv.conf
33 | fi
34 | if [ ! -z $STATIC_DNS2 ]; then
35 | echo "nameserver $STATIC_DNS2" >> /tmp/resolv.conf
36 | fi
37 | fi
38 | fi
39 |
--------------------------------------------------------------------------------
/src/static/static/home/yi-hack/script/wifidhcp.sh:
--------------------------------------------------------------------------------
1 | killall udhcpc
2 | HN="yi-hack"
3 | CONF_FILE="etc/system.conf"
4 | YI_HACK_PREFIX="/home/yi-hack"
5 |
6 | get_config()
7 | {
8 | key=$1
9 | grep -w $1 $YI_HACK_PREFIX/$CONF_FILE | cut -d "=" -f2
10 | }
11 |
12 | STATIC_IP=$(get_config STATIC_IP)
13 | STATIC_MASK=$(get_config STATIC_MASK)
14 | STATIC_GW=$(get_config STATIC_GW)
15 | STATIC_DNS1=$(get_config STATIC_DNS1)
16 | STATIC_DNS2=$(get_config STATIC_DNS2)
17 |
18 | if [ -z $STATIC_IP ] || [ -z $STATIC_MASK ]; then
19 | if [ -f /tmp/sd/yi-hack/etc/hostname ]; then
20 | HN=$(cat /tmp/sd/yi-hack/etc/hostname)
21 | fi
22 | udhcpc -i wlan0 -b -s /home/app/script/default.script -x hostname:$HN
23 | else
24 | ifconfig wlan0 $STATIC_IP netmask $STATIC_MASK
25 | if [ ! -z $STATIC_GW ]; then
26 | route add -net 0.0.0.0 gw $STATIC_GW
27 | fi
28 | if [ ! -z $STATIC_DNS1 ] || [ ! -z $STATIC_DNS2 ]; then
29 | rm /tmp/resolv.conf
30 | touch /tmp/resolv.conf
31 | if [ ! -z $STATIC_DNS1 ]; then
32 | echo "nameserver $STATIC_DNS1" >> /tmp/resolv.conf
33 | fi
34 | if [ ! -z $STATIC_DNS2 ]; then
35 | echo "nameserver $STATIC_DNS2" >> /tmp/resolv.conf
36 | fi
37 | fi
38 | fi
39 |
--------------------------------------------------------------------------------
/src/www/httpd/cgi-bin/eventsdirdel.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | validateRecDir()
4 | {
5 | if [ "${#1}" != "14" ]; then
6 | DIR = "none"
7 | fi
8 | if [ "Y${1:4:1}" != "YY" ] ; then
9 | DIR = "none"
10 | fi
11 | if [ "M${1:7:1}" != "MM" ] ; then
12 | DIR = "none"
13 | fi
14 | if [ "D${1:10:1}" != "DD" ] ; then
15 | DIR = "none"
16 | fi
17 | if [ "H${1:13:1}" != "HH" ] ; then
18 | DIR = "none"
19 | fi
20 | }
21 |
22 | YI_HACK_PREFIX="/home/yi-hack"
23 |
24 | . $YI_HACK_PREFIX/www/cgi-bin/validate.sh
25 |
26 | if ! $(validateQueryString $QUERY_STRING); then
27 | printf "Content-type: application/json\r\n\r\n"
28 | printf "{\n"
29 | printf "\"%s\":\"%s\"\\n" "error" "true"
30 | printf "}"
31 | exit
32 | fi
33 |
34 | DIR="none"
35 |
36 | CONF="$(echo $QUERY_STRING | cut -d'=' -f1)"
37 | VAL="$(echo $QUERY_STRING | cut -d'=' -f2)"
38 |
39 | if [ "$CONF" == "dir" ] ; then
40 | DIR="$VAL"
41 | fi
42 |
43 | if [ "$DIR" == "all" ]; then
44 | DIR="*"
45 | else
46 | validateRecDir $DIR
47 | fi
48 |
49 | if [ "$DIR" != "none" ] ; then
50 | rm -rf /tmp/sd/record/$DIR
51 | fi
52 |
53 | printf "Content-type: application/json\r\n\r\n"
54 | printf "{\n"
55 | printf "\"%s\":\"%s\"\\n" "error" "false"
56 | printf "}"
57 |
--------------------------------------------------------------------------------
/src/rRTSPServer/compile.rRTSPServer:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | export CROSSPATH=/opt/yi/toolchain-sunxi-musl/toolchain/bin
4 | export PATH=${PATH}:${CROSSPATH}
5 |
6 | export TARGET=arm-openwrt-linux
7 | export CROSS=arm-openwrt-linux
8 | export BUILD=x86_64-pc-linux-gnu
9 |
10 | export CROSSPREFIX=${CROSS}-
11 |
12 | export STRIP=${CROSSPREFIX}strip
13 | export CXX=${CROSSPREFIX}g++
14 | export CC=${CROSSPREFIX}gcc
15 | export LD=${CROSSPREFIX}ld
16 | export AS=${CROSSPREFIX}as
17 | export AR=${CROSSPREFIX}ar
18 |
19 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
20 | cd $SCRIPT_DIR
21 |
22 | cd libhelix-aac || exit 1
23 | make clean
24 | make -j $(nproc) || exit 1
25 | mkdir ../live/lib/
26 | cp -f ./libhelix-aac.a ../live/lib/
27 | mkdir ../live/include/libhelix-aac
28 | cp -f ./aaccommon.h ../live/include/libhelix-aac
29 | cp -f ./aacdec.h ../live/include/libhelix-aac
30 | cp -f ./statname.h ../live/include/libhelix-aac
31 | cd ..
32 |
33 | cd live || exit 1
34 | make clean
35 | make || exit 1
36 |
37 | mkdir -p ../_install/bin || exit 1
38 |
39 | cp ./rRTSPServer ../_install/bin || exit 1
40 |
41 | arm-openwrt-linux-strip ../_install/bin/* || exit 1
42 |
43 | #cd hlsProxy || exit 1
44 | #make clean
45 | #make || exit 1
46 |
47 | #cp ./live555HLSProxy ../../_install/bin || exit 1
48 |
49 | #arm-openwrt-linux-strip ../../_install/bin/* || exit 1
50 |
--------------------------------------------------------------------------------
/src/www/httpd/cgi-bin/eventsdir.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | CONF_FILE="etc/system.conf"
4 | YI_HACK_PREFIX="/home/yi-hack"
5 |
6 | HOMEVER=$(cat /home/homever)
7 | HV=${HOMEVER:0:2}
8 |
9 | get_config()
10 | {
11 | key=$1
12 | grep -w $1 $YI_HACK_PREFIX/$CONF_FILE | cut -d "=" -f2
13 | }
14 |
15 | printf "Content-type: application/json\r\n\r\n"
16 | printf "{\"records\":[\n"
17 |
18 | COUNT=`ls -r /tmp/sd/record | grep H -c`
19 | IDX=1
20 | for f in `ls -r /tmp/sd/record | grep H`; do
21 | if [ ${#f} == 14 ]; then
22 | FS00="${f:0:4}-${f:5:2}-${f:8:2} ${f:11:2}:00"
23 | if [[ $(get_config EVENTS_TIME) == "autodetect" ]] ; then
24 | FS00E=$(date -u -d "$FS00" +"%s")
25 | elif [[ $(get_config EVENTS_TIME) == "local" ]] ; then
26 | FS00E=$(date -d "$FS00" +"%s")
27 | elif [[ $(get_config EVENTS_TIME) == "gmt" ]] ; then
28 | FS00E=$(date -u -d "$FS00" +"%s")
29 | fi
30 | FL=$(date +%YY%mM%dD%HH -d "@$FS00E")
31 | printf "{\n"
32 | printf "\"%s\":\"%s\",\n" "datetime" "Date: ${FL:0:4}-${FL:5:2}-${FL:8:2} Time: ${FL:11:2}:00"
33 | printf "\"%s\":\"%s\"\n" "dirname" "$f"
34 | if [ "$IDX" == "$COUNT" ]; then
35 | printf "}\n"
36 | else
37 | printf "},\n"
38 | fi
39 | IDX=$(($IDX+1))
40 | fi
41 | done
42 |
43 | printf "]}\n"
44 |
--------------------------------------------------------------------------------
/src/mjpeg-avi/create_avi.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # Should be called with the path to the jpgs to be converted as first argument
3 | # resolution of the jpgs as the second argument, optional fps as third
4 |
5 | if [ $# -le 1 ]; then
6 | echo "usage: $0 path_to_jpgs resolution_of_jpgs [fps]"
7 | exit 1
8 | fi
9 |
10 | path_jpgs=$1
11 | resolution_jpgs=$2
12 | fps_jpgs=10
13 |
14 | if [ $# -eq 3 ]; then
15 | fps_jpgs=$3
16 | fi
17 |
18 | _dir="/tmp/sd/.jpgs"
19 | _unique_name_count=1
20 |
21 | while [ -d $_dir ]; do
22 | _dir=$_dir$_unique_name_count
23 | _unique_name_count=$((_unique_name_count+1))
24 | done
25 | mkdir $_dir
26 |
27 | # making a directory containing the jpgs in directory 'path_jpgs' and naming them X.jpeg where X is an ascending number starting from 1.
28 | count=1
29 | for file in $(ls $path_jpgs | sort -n); do
30 | e=${file%*.jpeg}
31 | f=${file%*.jpg}
32 | if [ ! $e = $file ] || [ ! $f = $file ]; then
33 | cp $path_jpgs/$file $_dir/$count.jpeg
34 | count=$((count+1))
35 | fi
36 | done
37 |
38 | # calling the program!
39 | if cd $path_jpgs; then
40 | avimake -r $resolution_jpgs -l $_dir -n $((count-1)) -s $fps_jpgs
41 | video_file=$(date +%Y-%m-%d_%H-%M-00)
42 | mv Video.avi $video_file.avi
43 | fi
44 |
45 | # remove processed files
46 | cd /tmp
47 | rm -r $path_jpgs/*.jpg
48 | rm -r $path_jpgs/*.jpeg
49 |
50 | # cleanup
51 | if cd $_dir; then
52 | rm *
53 | cd ..
54 | rmdir $_dir
55 | fi
56 |
--------------------------------------------------------------------------------
/src/rRTSPServer/include/FileServerMediaSubsession_BC.hh:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2025 roleo.
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, version 3.
7 | *
8 | * This program is distributed in the hope that it will be useful, but
9 | * WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 | * General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | */
16 |
17 | /*
18 | * A ServerMediaSubsession object
19 | */
20 |
21 | #ifndef _FILE_SERVER_MEDIA_SUBSESSION_BC_HH
22 | #define _FILE_SERVER_MEDIA_SUBSESSION_BC_HH
23 |
24 | #ifndef _SERVER_MEDIA_SESSION_HH
25 | #include "ServerMediaSession.hh"
26 | #endif
27 | #ifndef _ON_DEMAND_SERVER_MEDIA_SUBSESSION_BC_HH
28 | #include "OnDemandServerMediaSubsession_BC.hh"
29 | #endif
30 |
31 | class FileServerMediaSubsession_BC: public OnDemandServerMediaSubsession_BC {
32 | protected: // we're a virtual base class
33 | FileServerMediaSubsession_BC(UsageEnvironment& env, char const* fileName,
34 | Boolean reuseFirstSource);
35 | virtual ~FileServerMediaSubsession_BC();
36 |
37 | protected:
38 | char const* fFileName;
39 | u_int64_t fFileSize; // if known
40 | };
41 |
42 | #endif
43 |
--------------------------------------------------------------------------------
/src/www/httpd/htdocs/js/modules/speak.js:
--------------------------------------------------------------------------------
1 | var APP = APP || {};
2 |
3 | APP.speak = (function($) {
4 |
5 | function init() {
6 | registerEventHandler();
7 | }
8 |
9 | function registerEventHandler() {
10 | $(document).on("click", '#button-speak', function(e) {
11 | sendText();
12 | });
13 | $(document).on("click", '#button-speaker', function(e) {
14 | sendWav();
15 | });
16 | }
17 |
18 | function sendText() {
19 | ttsterm = $("input[name='ttsinput']").prop('value');
20 | ttslang = $("select[name='ttslang']").prop('value');
21 | ttsvol = $("select[name='ttsvol']").prop('value');
22 | $.ajax({
23 | url: "cgi-bin/speak.sh?lang="+ttslang+"&voldb="+ttsvol,
24 | type: 'POST',
25 | contentType: false,
26 | data: ttsterm,
27 | cache: false,
28 | processData: false
29 | });
30 | }
31 |
32 | function sendWav() {
33 | var fileData = $('#wavfile').prop('files')[0];
34 | var formData = new FormData();
35 | formData.append('file', fileData);
36 | wavvol = $("select[name='wavvol']").prop('value');
37 | $.ajax({
38 | url: "cgi-bin/speaker.sh?voldb="+wavvol,
39 | type: 'POST',
40 | contentType: false,
41 | data: formData,
42 | cache: false,
43 | processData: false
44 | });
45 | }
46 |
47 | return {
48 | init: init
49 | };
50 |
51 | })(jQuery);
52 |
--------------------------------------------------------------------------------
/src/ipc_cmd/ipc_cmd/ipc_read.h:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include
10 | #include
11 | #include
12 |
13 | #define IPC_QUEUE_NAME "/ipc_dispatch"
14 | #define IPC_MESSAGE_MAX_SIZE 512
15 |
16 | #define IPC_MOTION_START "\x01\x00\x00\x00\x02\x00\x00\x00\x7c\x00\x7c\x00\x00\x00\x00\x00"
17 | #define IPC_MOTION_START_C "\x04\x00\x00\x00\x02\x00\x00\x00\x09\x70\x09\x70\x00\x00\x00\x00"
18 | #define IPC_MOTION_STOP "\x01\x00\x00\x00\x02\x00\x00\x00\x7d\x00\x7d\x00\x00\x00\x00\x00"
19 | #define IPC_AI_HUMAN_DETECTION "\x01\x00\x00\x00\x02\x00\x00\x00\xed\x00\xed\x00\x00\x00\x00\x00"
20 | #define IPC_AI_BODY_DETECTION_C "\x04\x00\x00\x00\x02\x00\x00\x00\x06\x70\x06\x70\x00\x00\x00\x00"
21 | #define IPC_AI_VEHICLE_DETECTION_C "\x04\x00\x00\x00\x02\x00\x00\x00\x07\x70\x07\x70\x00\x00\x00\x00"
22 | #define IPC_AI_ANIMAL_DETECTION_C "\x04\x00\x00\x00\x02\x00\x00\x00\x08\x70\x08\x70\x00\x00\x00\x00"
23 | #define IPC_BABY_CRYING "\x04\x00\x00\x00\x02\x00\x00\x00\x02\x60\x02\x60\x00\x00\x00\x00"
24 | #define IPC_SOUND_DETECTION "\x04\x00\x00\x00\x02\x00\x00\x00\x04\x60\x04\x60\x00\x00\x00\x00"
25 |
26 | int ipc_init();
27 | void ipc_stop();
28 | static int open_queue();
29 | static int clear_queue();
30 | static int parse_message(char *msg, ssize_t len);
31 | void print_usage(char *progname);
32 |
--------------------------------------------------------------------------------
/src/static/static/home/yi-hack/script/clean_records.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | if [ $# -ne 1 ]; then
4 | exit
5 | fi
6 |
7 | case $1 in
8 | ''|*[!0-9]*) exit;;
9 | *) continue;;
10 | esac
11 |
12 | if [ $1 -gt 99 ]; then
13 | exit
14 | fi
15 | if [ $1 -lt 1 ]; then
16 | exit
17 | fi
18 |
19 | MAX_AVI_NUMBER=10
20 | USED_SPACE_LIMIT=$((100-$1))
21 |
22 | if [ -d /tmp/sd/record/timelapse ]; then
23 | cd /tmp/sd/record/timelapse
24 | AVI_NUMBER=`ls -lr | grep .avi | awk 'END{print NR}'`
25 | while [ "$AVI_NUMBER" -gt "$MAX_AVI_NUMBER" ]
26 | do
27 | OLD_FILE=`ls -lr | grep .avi | awk 'END{print}' | awk '{print $9}'`
28 | if [ ! -z "$OLD_FILE" ]; then
29 | echo "Deleting file $OLD_FILE"
30 | rm -f $OLD_FILE
31 | AVI_NUMBER=`ls -lr | grep .avi | awk 'END{print NR}'`
32 | else
33 | break
34 | fi
35 | done
36 | fi
37 |
38 | if [ -d /tmp/sd/record ]; then
39 | cd /tmp/sd/record
40 | USED_SPACE=`df /tmp/sd/ | grep mmc | awk '{print $5}' | tr -d '%'`
41 |
42 | if [ -z "$USED_SPACE" ]; then
43 | exit
44 | fi
45 |
46 | while [ "$USED_SPACE" -gt "$USED_SPACE_LIMIT" ]
47 | do
48 | OLD_DIR=`ls -lr | grep -v tmp | grep -v timelapse | awk 'END{print}' | awk '{print $9}'`
49 | if [ ! -z "$OLD_DIR" ]; then
50 | echo "Deleting dir $OLD_DIR"
51 | rm -rf $OLD_DIR
52 | else
53 | break
54 | fi
55 | USED_SPACE=`df /tmp/sd/ | grep mmc | awk '{print $5}' | tr -d '%'`
56 | done
57 | fi
58 |
59 | echo "Done!"
60 |
--------------------------------------------------------------------------------
/src/proccgi/proccgi/Makefile:
--------------------------------------------------------------------------------
1 | #
2 | # This file is part of yi-hack-v4 (https://github.com/TheCrypt0/yi-hack-v4).
3 | # Copyright (c) 2018-2019 Davide Maggioni.
4 | #
5 | # This program is free software: you can redistribute it and/or modify
6 | # it under the terms of the GNU General Public License as published by
7 | # the Free Software Foundation, version 3.
8 | #
9 | # This program is distributed in the hope that it will be useful, but
10 | # WITHOUT ANY WARRANTY; without even the implied warranty of
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | # General Public License for more details.
13 | #
14 | # You should have received a copy of the GNU General Public License
15 | # along with this program. If not, see .
16 | #
17 |
18 | -include config.mak
19 |
20 | TARGET = proccgi
21 |
22 | BUILD_DIR = build
23 | SRC_DIR = src
24 | INCLUDE_DIR = include
25 |
26 | CFLAGS = -Os
27 | LIBS =
28 |
29 | .PHONY: default all clean directories
30 |
31 | default: directories $(TARGET)
32 | all: default
33 |
34 | OBJECTS = $(patsubst $(SRC_DIR)/%.c, $(BUILD_DIR)/%.o, $(wildcard $(SRC_DIR)/*.c))
35 | SOURCES = $(wildcard $(SRC_DIR)/*.c)
36 | HEADERS = $(wildcard $(INCLUDE_DIR)/*.h)
37 |
38 | $(OBJECTS): $(SOURCES) $(HEADERS)
39 | $(CC) $(CFLAGS) -c $< -o $@
40 |
41 | .PRECIOUS: $(TARGET) $(OBJECTS)
42 |
43 | $(TARGET): $(OBJECTS)
44 | $(CC) $(OBJECTS) -Wall $(LIBS) -o $(BUILD_DIR)/$@
45 | $(STRIP) $(BUILD_DIR)/$(TARGET)
46 |
47 | directories:
48 | mkdir -p $(BUILD_DIR)
49 |
50 | clean:
51 | rm -f $(BUILD_DIR)/*.o
52 | rm -f $(BUILD_DIR)/$(TARGET)
53 |
54 |
--------------------------------------------------------------------------------
/src/mqtt-config/mqtt-config/mqtt-config.h:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include
10 | #include "mosquitto.h"
11 | #include "config.h"
12 | #include "validate.h"
13 |
14 | #define MQTT_CONF_FILE "/home/yi-hack/etc/mqttv4.conf"
15 | #define CONF_FILE_PATH "/home/yi-hack/etc"
16 | #define CONF2MQTT_SCRIPT "/home/yi-hack/script/conf2mqtt.sh"
17 | #define CA_CERT "/home/yi-hack/etc/mqtt/ca.crt"
18 | #define CLIENT_CERT "/home/yi-hack/etc/mqtt/client.crt"
19 | #define CLIENT_KEY "/home/yi-hack/etc/mqtt/client.key"
20 |
21 | typedef struct
22 | {
23 | char *user;
24 | char *password;
25 | char host[128];
26 | char bind_address[128];
27 | int port;
28 | int tls;
29 | int keepalive;
30 | int qos;
31 | char *client_id;
32 | char *mqtt_prefix_cmnd;
33 | } mqtt_conf_t;
34 |
35 | typedef struct
36 | {
37 | char* topic;
38 | char* msg;
39 | int len;
40 | } mqtt_msg_t;
41 |
42 | void handle_signal(int s);
43 | void connect_callback(struct mosquitto *mosq, void *obj, int result);
44 | void disconnect_callback(struct mosquitto *mosq, void *obj, int result);
45 | void message_callback(struct mosquitto *mosq, void *obj, const struct mosquitto_message *message);
46 | void handle_config(const char *key, const char *value);
47 | int mqtt_free_conf(mqtt_conf_t *conf);
48 | int mqtt_init_conf(mqtt_conf_t *conf);
49 | void mqtt_check_connection();
50 | int mqtt_connect();
51 | void stop_mqtt(void);
52 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing
2 |
3 | ## Bug Reports and Issues
4 | Bug Reports are welcome and appreciated! However, due to an influx of poor quality report, we have some processes in place to help.
5 |
6 | #### Search for Related Issues
7 | Your bug or issue may have already been reported by another user. Please make sure to search through the "Issues" tab for similar issues to the one you're submitting
8 |
9 | #### One Bug/Report per Issue
10 | In order to keep the conversation relevant on an issue and to make issues easier to find, please create one issue per bug that you're encountering. If you're unsure if your issue is two seperate problems or one, err on the side of caution and submit multiple bug reports.
11 |
12 | #### Be Responsive
13 | We want to fix problems as fast as possible, but all contributors are volunteers for this project. Please respect their time and be reasonably responsive to questions that a contributor may ask. Issues that don't have a response may be closed if there hasn't been a response for 14 days to keep things clean.
14 |
15 | #### Provide Detail
16 | Similar to the prior note, please provide as much information as possible in your initial report. Things like:
17 | - Logs
18 | - Hack Version
19 | - Camera Model
20 | - Camera Version
21 |
22 | This helps us diagnose issues faster and provide resolutions. If needed information isn't provided, it's going to get asked for anyways.
23 |
24 | ## Pull Requests
25 |
26 | Code changes and improvements are welcome and encouraged! If you plan on changing a large section of the project (swapping around components, removing features), please file an issue with us so we can discuss a path forward and implementation details.
27 |
--------------------------------------------------------------------------------
/src/snapshot/snapshot/water_mark.h:
--------------------------------------------------------------------------------
1 | #ifndef COLOR_TYPE_H
2 | #define COLOR_TYPE_H
3 |
4 | #ifdef __cplusplus
5 | extern "C" {
6 | #endif /* __cplusplus */
7 |
8 | #define MAX_PIC 20
9 | #define WM_SOURCE_PATH "/tmp/res/wm_540p_"
10 |
11 | typedef struct BackGroudLayerInfo
12 | {
13 | unsigned int width;
14 | unsigned int height;
15 | unsigned char* y;
16 | unsigned char* c;
17 | }BackGroudLayerInfo;
18 |
19 | typedef struct SinglePicture
20 | {
21 | unsigned char id; //picture id
22 | unsigned char* y;
23 | unsigned char* c;
24 | unsigned char* alph;
25 | }SinglePicture;
26 |
27 | typedef struct WaterMarkInfo
28 | {
29 | unsigned int width; //single pic width
30 | unsigned int height; //single pic height
31 | unsigned int picture_number;
32 | SinglePicture single_pic[MAX_PIC];
33 | }WaterMarkInfo;
34 |
35 | typedef struct WaterMarkPositon
36 | {
37 | unsigned int x;
38 | unsigned int y;
39 | }WaterMarkPositon;
40 |
41 | typedef struct ShowWaterMarkParam
42 | {
43 | WaterMarkPositon pos; //the position of the waterMark
44 | unsigned char number;
45 | unsigned char id_list[MAX_PIC]; //the index of the picture of the waterMark
46 | }ShowWaterMarkParam;
47 |
48 | void argb2yuv420sp(unsigned char *src_p, unsigned char *alph, unsigned int width, unsigned int height,
49 | unsigned char *dest_y, unsigned char *dest_c);
50 | int watermark_blending(BackGroudLayerInfo *bg_info, WaterMarkInfo *wm_info, ShowWaterMarkParam *wm_Param);
51 | int watermark_blending_ajust_brightness(BackGroudLayerInfo *bg_info, WaterMarkInfo *wm_info, ShowWaterMarkParam *wm_Param);
52 | #ifdef __cplusplus
53 | }
54 | #endif /* __cplusplus */
55 |
56 | #endif
57 |
--------------------------------------------------------------------------------
/src/rRTSPServer/include/Speaker.hh:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2025 roleo.
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, version 3.
7 | *
8 | * This program is distributed in the hope that it will be useful, but
9 | * WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 | * General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | */
16 |
17 | /*
18 | * Class to handle GPIOS to activate speaker
19 | */
20 |
21 | #ifndef _SPEAKER_HH
22 | #define _SPEAKER_HH
23 |
24 | #include
25 | #include
26 |
27 | #define SPEAKER_OFF 0
28 | #define SPEAKER_ON 1
29 |
30 | #define SPEAKER_MAX_VALUE 1000 // ms
31 |
32 | #define DEVICE_NUM 0x70
33 | #define CPLD_DEV "/dev/cpld_periph"
34 | #define SEM_FILE "audio_in_fifo.lock"
35 |
36 | class Speaker {
37 |
38 | public:
39 | static Speaker* createNew();
40 | virtual ~Speaker();
41 | int switchSpeaker(int on);
42 | int getCounter();
43 | void setCounter(int value);
44 | Boolean isActive();
45 | Boolean stopThread();
46 |
47 | protected:
48 | Speaker(sem_t *semSpeaker);
49 |
50 | private:
51 | int openCpld();
52 | void closeCpld(int fd);
53 | void runIO(int fd, int n);
54 |
55 | private:
56 | char *fSemFile;
57 | sem_t *fSemSpeaker;
58 | Boolean fIsActive;
59 | Boolean fExitThread;
60 | int fSpeakerCounter;
61 | };
62 |
63 | #endif
64 |
--------------------------------------------------------------------------------
/src/set_tz_offset/set_tz_offset/set_tz_offset.h:
--------------------------------------------------------------------------------
1 | #ifndef SET_TZ_OFFSET_H
2 | #define SET_TZ_OFFSET_H
3 |
4 | #include
5 | #include
6 |
7 | #define _F_ __FILE__
8 | #define _FU_ __FUNCTION__
9 | #define _L_ __LINE__
10 |
11 | #define IPC_QUEUE_NAME "/ipc_dispatch"
12 | #define MMAP_INFO "/tmp/mmap.info"
13 |
14 | #define MID_P2P 1
15 | #define MID_RMM 2
16 | #define MID_CLOUD 4
17 | #define MID_DISPATCH 4
18 | #define MID_RCD 0x10
19 |
20 | typedef enum {
21 | Y203C,
22 | Y23,
23 | Y25,
24 | Y30,
25 | H201C,
26 | H305R,
27 | H307,
28 |
29 | Y20GA, // 9
30 | Y20GA_12,
31 | Y25GA,
32 | Y30QA,
33 | Y501GC,
34 |
35 | H30GA, // 9
36 | H30GA_11,
37 | H51GA,
38 | H52GA,
39 | H60GA, // 9
40 | H60GA_12,
41 | Q321BR_LSX,
42 | Q705BR,
43 | QG311R,
44 | R30GB,
45 | R35GB,
46 | R37GB,
47 | R40GA,
48 | Y211BA,
49 | Y211GA, // 9
50 | Y211GA_12,
51 | Y213GA,
52 | Y21GA, // 9
53 | Y21GA_12,
54 | Y28GA,
55 | Y291GA, // 9,
56 | Y291GA_12,
57 | Y29GA,
58 | Y623,
59 | B091QP
60 | } MODEL;
61 |
62 | typedef enum {
63 | DISPATCH_SET_TZ_OFFSET = 0x8e,
64 | } MSG_TYPE;
65 |
66 | typedef struct
67 | {
68 | int dstMid;
69 | int srcMid;
70 | short mainOp;
71 | short subOp;
72 | int msgLength;
73 | } mqueue_msg_header_t;
74 |
75 | void dump_string(char *source_file, const char *func, int line, char *text, ...);
76 | int cloud_send_msg(mqd_t mqfd, MSG_TYPE msg_type, char *payload, int payload_len);
77 | int cloud_set_tz_offset(int tz_offset);
78 | int set_tz_offset_osd(int enable, int addr, int val);
79 |
80 | #endif
81 |
--------------------------------------------------------------------------------
/src/www/httpd/cgi-bin/eventsfiledel.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | validateRecFile()
4 | {
5 | if [ "${#1}" != "27" ]; then
6 | FILE="none"
7 | fi
8 |
9 | if [ "Y${1:4:1}" != "YY" ] ; then
10 | FILE="none"
11 | fi
12 | if [ "M${1:7:1}" != "MM" ] ; then
13 | FILE="none"
14 | fi
15 | if [ "D${1:10:1}" != "DD" ] ; then
16 | FILE="none"
17 | fi
18 | if [ "H${1:13:1}" != "HH" ] ; then
19 | FILE="none"
20 | fi
21 |
22 | if [ "M${1:17:1}" != "MM" ] ; then
23 | FILE="none"
24 | fi
25 | if [ "S${1:20:1}" != "SS" ] ; then
26 | FILE="none"
27 | fi
28 | }
29 |
30 | fbasename()
31 | {
32 | echo ${1:0:$((${#1} - 4))}
33 | }
34 |
35 | YI_HACK_PREFIX="/home/yi-hack"
36 |
37 | . $YI_HACK_PREFIX/www/cgi-bin/validate.sh
38 |
39 | if ! $(validateQueryString $QUERY_STRING); then
40 | printf "Content-type: application/json\r\n\r\n"
41 | printf "{\n"
42 | printf "\"%s\":\"%s\"\\n" "error" "true"
43 | printf "}\n"
44 | exit
45 | fi
46 |
47 | FILE="none"
48 |
49 | CONF="$(echo $QUERY_STRING | cut -d'=' -f1)"
50 | VAL="$(echo $QUERY_STRING | cut -d'=' -f2)"
51 |
52 | if [ "$CONF" == "file" ] ; then
53 | FILE="$VAL"
54 | fi
55 |
56 | validateRecFile $FILE
57 |
58 | if [ "$FILE" == "none" ] ; then
59 | printf "Content-type: application/json\r\n\r\n"
60 | printf "{\n"
61 | printf "\"%s\":\"%s\"\\n" "error" "true"
62 | printf "}\n"
63 | exit
64 | fi
65 |
66 | BASE_NAME=$(fbasename "$FILE")
67 | rm -f /tmp/sd/record/$BASE_NAME.mp4
68 | rm -f /tmp/sd/record/$BASE_NAME.jpg
69 |
70 | printf "Content-type: application/json\r\n\r\n"
71 |
72 | printf "{\n"
73 | printf "\"%s\":\"%s\"\\n" "error" "false"
74 | printf "}\n"
75 |
--------------------------------------------------------------------------------
/src/static/static/home/yi-hack/script/mqtt_advertise/check_conf.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | YI_HACK_PREFIX="/home/yi-hack"
4 | CONF_MQTT_ADVERTISE_FILE="$YI_HACK_PREFIX/etc/mqtt_advertise.conf"
5 |
6 | PARMS1="
7 | MQTT_ADV_LINK_ENABLE=no
8 | MQTT_ADV_LINK_BOOT=no
9 | MQTT_ADV_LINK_CRON=no
10 | MQTT_ADV_LINK_CRONTAB=
11 | MQTT_ADV_LINK_TOPIC=links
12 | MQTT_ADV_LINK_RETAIN=1
13 | MQTT_ADV_LINK_QOS=0
14 | MQTT_ADV_INFO_GLOBAL_ENABLE=no
15 | MQTT_ADV_INFO_GLOBAL_BOOT=no
16 | MQTT_ADV_INFO_GLOBAL_CRON=no
17 | MQTT_ADV_INFO_GLOBAL_CRONTAB=
18 | MQTT_ADV_INFO_GLOBAL_TOPIC=info_global
19 | MQTT_ADV_INFO_GLOBAL_RETAIN=1
20 | MQTT_ADV_INFO_GLOBAL_QOS=0
21 | MQTT_ADV_CAMERA_SETTING_ENABLE=no
22 | MQTT_ADV_CAMERA_SETTING_BOOT=no
23 | MQTT_ADV_CAMERA_SETTING_CRON=no
24 | MQTT_ADV_CAMERA_SETTING_CRONTAB=
25 | MQTT_ADV_CAMERA_SETTING_TOPIC=camera_setting
26 | MQTT_ADV_CAMERA_SETTING_RETAIN=1
27 | MQTT_ADV_CAMERA_SETTING_QOS=0
28 | MQTT_ADV_TELEMETRY_ENABLE=no
29 | MQTT_ADV_TELEMETRY_BOOT=no
30 | MQTT_ADV_TELEMETRY_CRON=no
31 | MQTT_ADV_TELEMETRY_CRONTAB=
32 | MQTT_ADV_TELEMETRY_TOPIC=telemetry
33 | MQTT_ADV_TELEMETRY_RETAIN=1
34 | MQTT_ADV_TELEMETRY_QOS=0
35 | HOMEASSISTANT_ENABLE=no
36 | HOMEASSISTANT_BOOT=no
37 | HOMEASSISTANT_CRON=no
38 | HOMEASSISTANT_CRONTAB=
39 | HOMEASSISTANT_MQTT_PREFIX=homeassistant
40 | HOMEASSISTANT_NAME=
41 | HOMEASSISTANT_IDENTIFIERS=yi-cam
42 | HOMEASSISTANT_MANUFACTURER=YI
43 | HOMEASSISTANT_MODEL=
44 | HOMEASSISTANT_RETAIN=1
45 | HOMEASSISTANT_QOS=0
46 | "
47 |
48 | for i in $PARMS1; do
49 | if [ ! -z "$i" ]; then
50 | PAR=$(echo "$i" | cut -d= -f1)
51 | MATCH=$(cat $CONF_MQTT_ADVERTISE_FILE | grep ^$PAR=)
52 | if [ -z "$MATCH" ]; then
53 | echo "$i" >>$CONF_MQTT_ADVERTISE_FILE
54 | fi
55 | fi
56 | done
57 |
--------------------------------------------------------------------------------
/src/static/static/home/yi-hack/script/conf2mqtt.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | YI_HACK_PREFIX="/home/yi-hack"
4 | CAMERA_CONF_FILE="$YI_HACK_PREFIX/etc/camera.conf"
5 | MQTT_CONF_FILE="$YI_HACK_PREFIX/etc/mqttv4.conf"
6 |
7 | . $MQTT_CONF_FILE
8 |
9 | if [ -z "$MQTT_IP" ]; then
10 | exit
11 | fi
12 | if [ -z "$MQTT_PORT" ]; then
13 | exit
14 | fi
15 |
16 | if [ "$MQTT_TLS" == "1" ]; then
17 | MQTT_TLS="-t"
18 |
19 | if [ -f $YI_HACK_PREFIX/etc/mqtt/ca.crt ]; then
20 | MQTT_CA_CERT="-A $YI_HACK_PREFIX/etc/mqtt/ca.crt"
21 |
22 | if [ -f $YI_HACK_PREFIX/etc/mqtt/client.crt ]; then
23 | MQTT_CLIENT_CERT="-c $YI_HACK_PREFIX/etc/mqtt/client.crt"
24 |
25 | if [ -f $YI_HACK_PREFIX/etc/mqtt/client.key ]; then
26 | MQTT_CLIENT_KEY="-K $YI_HACK_PREFIX/etc/mqtt/client.key"
27 | else
28 | MQTT_CLIENT_CERT=""
29 | MQTT_CLIENT_KEY=""
30 | fi
31 | else
32 | MQTT_CLIENT_CERT=""
33 | MQTT_CLIENT_KEY=""
34 | fi
35 | else
36 | MQTT_TLS=""
37 | MQTT_CA_CERT=""
38 | MQTT_CLIENT_CERT=""
39 | MQTT_CLIENT_KEY=""
40 | fi
41 | else
42 | MQTT_TLS=""
43 | MQTT_CA_CERT=""
44 | MQTT_CLIENT_CERT=""
45 | MQTT_CLIENT_KEY=""
46 | fi
47 |
48 | if [ ! -z "$MQTT_USER" ]; then
49 | MQTT_USER="-u $MQTT_USER"
50 | fi
51 |
52 | if [ ! -z "$MQTT_PASSWORD" ]; then
53 | MQTT_PASSWORD="-w $MQTT_PASSWORD"
54 | fi
55 |
56 | while IFS='=' read -r key val ; do
57 | lkey="$(echo $key | tr '[A-Z]' '[a-z]')"
58 | $YI_HACK_PREFIX/bin/mqtt-pub -h "$MQTT_IP" -p "$MQTT_PORT" $MQTT_USER $MQTT_PASSWORD $MQTT_TLS $MQTT_CA_CERT $MQTT_CLIENT_CERT $MQTT_CLIENT_KEY -n $MQTT_PREFIX/stat/camera/$lkey -m $val -r
59 | done < "$CAMERA_CONF_FILE"
60 |
--------------------------------------------------------------------------------
/src/www/httpd/cgi-bin/validate.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | validateFile()
4 | {
5 | case $1 in
6 | *[\'!\"@\#\$%\&^*\(\),:\;]* )
7 | return 1;;
8 | *)
9 | return 0;;
10 | esac
11 | }
12 |
13 | validateBaseName()
14 | {
15 | if [ "${1::1}" == "." ]; then
16 | return 1
17 | fi
18 | case $1 in
19 | *[\/\'!\"@\#\$%\&^*\(\),:\;]* )
20 | return 1;;
21 | *)
22 | return 0;;
23 | esac
24 | }
25 |
26 | validateDir()
27 | {
28 | case $1 in
29 | *[\'!\"@\#\$%^*\(\)_+.,:\;]* )
30 | return 1;;
31 | *)
32 | return 0;;
33 | esac
34 | }
35 |
36 | validateLang()
37 | {
38 | if [ "${#1}" != "5" ]; then
39 | return 1
40 | else
41 | RES=$(echo ${1} | sed -E 's/[a-zA-Z-]//g')
42 | if [ -z "$RES" ]; then
43 | return 0
44 | else
45 | return 1
46 | fi
47 | fi
48 | }
49 |
50 | # Integer and float with . or ,
51 | validateNumber(){
52 | case $1 in
53 | ''|*[!0-9.,\-]* )
54 | return 1;;
55 | * )
56 | return 0;;
57 | esac
58 | }
59 |
60 | # Only chars, ditigs and some special chars: '_' '-' ' '
61 | validateString()
62 | {
63 | case $1 in
64 | *[\'!\"@\#\$%\&^*\(\).,:\;]* )
65 | return 1;;
66 | *)
67 | return 0;;
68 | esac
69 | }
70 |
71 | validateQueryString()
72 | {
73 | case $1 in
74 | *[\'!\"@\#\$%^*\(\),:\;]* )
75 | return 1;;
76 | *)
77 | return 0;;
78 | esac
79 | }
80 |
81 | validateKey()
82 | {
83 | case $1 in
84 | *[\|\\\/\'!\"@\#\$%\&^*\(\).,:\;{}=?]* )
85 | return 1;;
86 | *)
87 | return 0;;
88 | esac
89 | }
90 |
--------------------------------------------------------------------------------
/src/www/httpd/htdocs/css/normalize.min.css:
--------------------------------------------------------------------------------
1 | /*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */
2 | html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}button,[type="button"],[type="reset"],[type="submit"]{-webkit-appearance:button}button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px}[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}
--------------------------------------------------------------------------------
/src/busybox/gzdef.patch:
--------------------------------------------------------------------------------
1 | diff -Naur busybox-1.36.1.ori/networking/httpd.c busybox-1.36.1/networking/httpd.c
2 | --- busybox-1.36.1.ori/networking/httpd.c 2023-01-03 15:14:43.000000000 +0100
3 | +++ busybox-1.36.1/networking/httpd.c 2024-01-08 16:45:49.504118695 +0100
4 | @@ -2182,7 +2182,7 @@
5 | struct stat sb;
6 | char *urlcopy;
7 | char *urlp;
8 | - char *tptr;
9 | + char *tptr, *gztptr;
10 | #if ENABLE_FEATURE_HTTPD_ACL_IP
11 | unsigned remote_ip;
12 | #endif
13 | @@ -2418,7 +2418,32 @@
14 | g_query = xstrdup(g_query); /* ok for NULL too */
15 | strcpy(urlp, index_page);
16 | }
17 | + gztptr = xasprintf("%s.gz", tptr);
18 | if (stat(tptr, &sb) == 0) {
19 | + free(gztptr);
20 | + /* If URL is a directory with no slash, set up
21 | + * "HTTP/1.1 302 Found" "Location: /dir/" reply */
22 | + if (urlp[-1] != '/' && S_ISDIR(sb.st_mode)) {
23 | + found_moved_temporarily = urlcopy;
24 | + } else {
25 | +#if ENABLE_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR
26 | + char *suffix = strrchr(tptr, '.');
27 | + if (suffix) {
28 | + Htaccess *cur;
29 | + for (cur = script_i; cur; cur = cur->next) {
30 | + if (strcmp(cur->before_colon + 1, suffix) == 0) {
31 | + cgi_type = CGI_INTERPRETER;
32 | + break;
33 | + }
34 | + }
35 | + }
36 | +#endif
37 | + file_size = sb.st_size;
38 | + last_mod = sb.st_mtime;
39 | + }
40 | + }
41 | + else if (stat(gztptr, &sb) == 0) {
42 | + free(gztptr);
43 | /* If URL is a directory with no slash, set up
44 | * "HTTP/1.1 302 Found" "Location: /dir/" reply */
45 | if (urlp[-1] != '/' && S_ISDIR(sb.st_mode)) {
46 | @@ -2442,6 +2467,7 @@
47 | }
48 | #if ENABLE_FEATURE_HTTPD_CGI
49 | else if (urlp[-1] == '/') {
50 | + free(gztptr);
51 | /* It's a dir URL and there is no index.html */
52 | /* Is there cgi-bin/index.cgi? */
53 | if (access("/cgi-bin/index.cgi"+1, X_OK) != 0)
54 |
--------------------------------------------------------------------------------
/src/www/httpd/htdocs/js/modules/global.js:
--------------------------------------------------------------------------------
1 | var APP = APP || {};
2 |
3 | APP.global = (function($) {
4 |
5 | function init() {
6 | registerEventHandler();
7 | initPage();
8 | }
9 |
10 | function registerEventHandler() {
11 | $(document).on('click', 'html', function(e) {
12 | $('nav').removeClass('mobile');
13 | });
14 |
15 | $(document).on('click', '.nav-toggler', function(e) {
16 | $('nav').toggleClass('mobile');
17 | e.preventDefault();
18 | e.stopPropagation();
19 | });
20 | }
21 |
22 | function initPage() {
23 | let currentPage = retrievePageFromUrl();
24 | loadPage(currentPage);
25 | // $('#nav-title').text(hostname);
26 | document.title = hostname + " - " + currentPage;
27 | }
28 |
29 | function retrievePageFromUrl() {
30 | let parsedUrl = new URL(window.location.href);
31 |
32 | return parsedUrl.searchParams.has("page") ? parsedUrl.searchParams.get("page") : 'status';
33 | }
34 |
35 | function loadPage(currentPage) {
36 | console.log("Current page: %s", currentPage);
37 |
38 | $.ajax({
39 | type: "GET",
40 | url: "pages/" + currentPage + ".html?nocache=" + Math.floor(Date.now() / 1000),
41 | success: function(data) {
42 | $('#container').html(data);
43 | initPageModule(currentPage);
44 | },
45 | error: function(response) {
46 | console.log('error', response);
47 | }
48 | });
49 | }
50 |
51 | function initPageModule(module) {
52 | if (APP.hasOwnProperty(module)) {
53 | APP[module].init();
54 | } else {
55 | console.log('module %s not registered', module);
56 | }
57 | }
58 |
59 | return {
60 | init: init
61 | };
62 |
63 | })(jQuery);
--------------------------------------------------------------------------------
/src/www/httpd/cgi-bin/get_configs.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | get_conf_type()
4 | {
5 | CONF="$(echo $QUERY_STRING | cut -d'=' -f1)"
6 | VAL="$(echo $QUERY_STRING | cut -d'=' -f2)"
7 |
8 | if [ "$CONF" == "conf" ] ; then
9 | echo $VAL
10 | fi
11 | }
12 |
13 | YI_HACK_PREFIX="/home/yi-hack"
14 |
15 | . $YI_HACK_PREFIX/www/cgi-bin/validate.sh
16 |
17 | if ! $(validateQueryString $QUERY_STRING); then
18 | printf "Content-type: application/json\r\n\r\n"
19 | printf "{\n"
20 | printf "\"%s\":\"%s\"\\n" "error" "true"
21 | printf "}"
22 | exit
23 | fi
24 |
25 | printf "Content-type: application/json\r\n\r\n"
26 |
27 | CONF_TYPE="$(get_conf_type)"
28 | CONF_FILE=""
29 |
30 | if [ "$CONF_TYPE" == "mqtt" ] ; then
31 | CONF_FILE="$YI_HACK_PREFIX/etc/mqttv4.conf"
32 | else
33 | CONF_FILE="$YI_HACK_PREFIX/etc/$CONF_TYPE.conf"
34 | fi
35 |
36 | printf "{\n"
37 |
38 | PROXY_LIST="0"
39 | PROXYCHAINS_SERVERS=
40 | if [ "$CONF_TYPE" == "proxychains" ] ; then
41 | while IFS= read -r LINE ; do
42 | if [ "$PROXY_LIST" == "1" ] ; then
43 | PROXYCHAINS_SERVERS=${PROXYCHAINS_SERVERS}${LINE}";"
44 | fi
45 | if [ "$LINE" == "[ProxyList]" ] ; then
46 | PROXY_LIST="1"
47 | fi
48 | done < "$CONF_FILE"
49 | PROXYCHAINS_SERVERS=${PROXYCHAINS_SERVERS%?}
50 | echo -e \"PROXYCHAINS_SERVERS\":\"$PROXYCHAINS_SERVERS\",
51 | else
52 | sed '/^#/d; /^$/d; s/\\/\\\\/g; s/\"/\\"/g; s/\([^=]*\)=\(.*\)/"\1":"\2",/' "$CONF_FILE"
53 | fi
54 |
55 | if [ "$CONF_TYPE" == "system" ] ; then
56 | printf "\"%s\":\"%s\",\n" "HOSTNAME" "$(cat $YI_HACK_PREFIX/etc/hostname | sed -r 's/\\/\\\\/g;s/"/\\"/g;')"
57 | fi
58 |
59 | if [ "$CONF_TYPE" == "camera" ] ; then
60 | HOMEVER=$(cat /home/homever)
61 | printf "\"%s\":\"%s\",\n" "HOMEVER" "$HOMEVER"
62 | fi
63 |
64 | # Empty values to "close" the json
65 | printf "\"%s\":\"%s\"\n" "NULL" "NULL"
66 |
67 | printf "}"
68 |
--------------------------------------------------------------------------------
/src/www/httpd/cgi-bin/links.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | CONF_FILE="etc/system.conf"
4 | YI_HACK_PREFIX="/home/yi-hack"
5 |
6 | get_config()
7 | {
8 | key=$1
9 | grep -w $1 $YI_HACK_PREFIX/$CONF_FILE | cut -d "=" -f2
10 | }
11 |
12 | LOCAL_IP=$(ifconfig wlan0 | awk '/inet addr/{print substr($2,6)}')
13 |
14 | case $(get_config RTSP_PORT) in
15 | ''|*[!0-9]*) RTSP_PORT=554 ;;
16 | *) RTSP_PORT=$(get_config RTSP_PORT) ;;
17 | esac
18 | case $(get_config HTTPD_PORT) in
19 | ''|*[!0-9]*) HTTPD_PORT=8080 ;;
20 | *) HTTPD_PORT=$(get_config HTTPD_PORT) ;;
21 | esac
22 |
23 | if [[ $RTSP_PORT != "554" ]] ; then
24 | D_RTSP_PORT=:$RTSP_PORT
25 | fi
26 | if [[ $HTTPD_PORT != "80" ]] ; then
27 | D_HTTPD_PORT=:$HTTPD_PORT
28 | fi
29 |
30 | printf "Content-type: application/json\r\n\r\n"
31 | printf "{\n"
32 |
33 | if [[ $(get_config RTSP) == "yes" ]] ; then
34 | if [[ $(get_config RTSP_STREAM) == "low" ]] ; then
35 | printf "\"%s\":\"%s\",\n" "low_res_stream" "rtsp://$LOCAL_IP$D_RTSP_PORT/ch0_1.h264"
36 | elif [[ $(get_config RTSP_STREAM) == "high" ]] ; then
37 | printf "\"%s\":\"%s\",\n" "high_res_stream" "rtsp://$LOCAL_IP$D_RTSP_PORT/ch0_0.h264"
38 | elif [[ $(get_config RTSP_STREAM) == "both" ]] ; then
39 | printf "\"%s\":\"%s\",\n" "low_res_stream" "rtsp://$LOCAL_IP$D_RTSP_PORT/ch0_1.h264"
40 | printf "\"%s\":\"%s\",\n" "high_res_stream" "rtsp://$LOCAL_IP$D_RTSP_PORT/ch0_0.h264"
41 | fi
42 | if [[ $(get_config RTSP_AUDIO) != "no" ]] && [[ $(get_config RTSP_AUDIO) != "none" ]] ; then
43 | printf "\"%s\":\"%s\",\n" "audio_stream" "rtsp://$LOCAL_IP$D_RTSP_PORT/ch0_2.h264"
44 | fi
45 | fi
46 |
47 | printf "\"%s\":\"%s\",\n" "low_res_snapshot" "http://$LOCAL_IP$D_HTTPD_PORT/cgi-bin/snapshot.sh?res=low&watermark=yes"
48 | printf "\"%s\":\"%s\"\n" "high_res_snapshot" "http://$LOCAL_IP$D_HTTPD_PORT/cgi-bin/snapshot.sh?res=high&watermark=yes"
49 |
50 | printf "}"
51 |
--------------------------------------------------------------------------------
/src/static/static/home/yi-hack/etc/mqttv4.conf:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Configuration file for mqttv4 #
3 | ###############################################################################
4 |
5 | # -----------------------------------------------------------------------------
6 | # Basic MQTT settings
7 | # -----------------------------------------------------------------------------
8 |
9 | MQTT_IP=0.0.0.0
10 | MQTT_PORT=1883
11 | MQTT_TLS=0
12 |
13 | MQTT_CLIENT_ID=yi-cam
14 |
15 | MQTT_USER=
16 | MQTT_PASSWORD=
17 |
18 | MQTT_PREFIX=yicam
19 |
20 | # -----------------------------------------------------------------------------
21 | # Set the topics where the messages will be published
22 | # The final topic will be MQTT_PREFIX/TOPIC_MOTION
23 | # -----------------------------------------------------------------------------
24 |
25 | TOPIC_BIRTH_WILL=status
26 | TOPIC_MOTION=motion_detection
27 | TOPIC_MOTION_IMAGE=motion_detection_image
28 | MOTION_IMAGE_DELAY=0.5
29 | TOPIC_MOTION_FILES=motion_files
30 | TOPIC_SOUND_DETECTION=sound_detection
31 |
32 | # -----------------------------------------------------------------------------
33 | # Set the topics messages
34 | # -----------------------------------------------------------------------------
35 |
36 | BIRTH_MSG=online
37 | WILL_MSG=offline
38 | MOTION_START_MSG=motion_start
39 | MOTION_STOP_MSG=motion_stop
40 | AI_HUMAN_DETECTION_MSG=human
41 | AI_VEHICLE_DETECTION_MSG=vehicle
42 | AI_ANIMAL_DETECTION_MSG=animal
43 | BABY_CRYING_MSG=crying
44 | SOUND_DETECTION_MSG=sound
45 |
46 | # -----------------------------------------------------------------------------
47 | # Other settings
48 | # -----------------------------------------------------------------------------
49 |
50 | MQTT_KEEPALIVE=120
51 | MQTT_QOS=1
52 | MQTT_RETAIN_BIRTH_WILL=1
53 | MQTT_RETAIN_MOTION=0
54 | MQTT_RETAIN_MOTION_IMAGE=0
55 | MQTT_RETAIN_MOTION_FILES=0
56 | MQTT_RETAIN_SOUND_DETECTION=0
57 |
--------------------------------------------------------------------------------
/src/onvif_simple_server/init.onvif_simple_server:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
4 | cd $SCRIPT_DIR
5 |
6 | rm -rf ./_install
7 |
8 | if [ ! -f crypt-1.18.2.tar.xz ]; then
9 | wget https://github.com/libtom/libtomcrypt/releases/download/v1.18.2/crypt-1.18.2.tar.xz
10 | fi
11 | tar Jxvf ./crypt-1.18.2.tar.xz
12 | if [ ! -L libtomcrypt ]; then
13 | ln -s libtomcrypt-1.18.2 libtomcrypt
14 | cd onvif_simple_server/extras
15 | ln -s ../../libtomcrypt-1.18.2 libtomcrypt
16 | cd ../..
17 | fi
18 |
19 | if [ ! -f v3.4.0.tar.gz ]; then
20 | wget https://github.com/Mbed-TLS/mbedtls/archive/refs/tags/v3.4.0.tar.gz
21 | fi
22 | tar zxvf ./v3.4.0.tar.gz
23 | if [ ! -L mbedtls ]; then
24 | ln -s mbedtls-3.4.0 mbedtls
25 | cd onvif_simple_server/extras
26 | ln -s ../../mbedtls-3.4.0 mbedtls
27 | cd ../..
28 | fi
29 | cp -f mbedtls_config.h mbedtls/include/mbedtls/
30 |
31 | if [ ! -f v5.7.4-stable.tar.gz ]; then
32 | wget https://github.com/wolfSSL/wolfssl/archive/refs/tags/v5.7.4-stable.tar.gz
33 | fi
34 | tar zxvf ./v5.7.4-stable.tar.gz
35 | if [ ! -L wolfssl ]; then
36 | ln -s wolfssl-5.7.4-stable wolfssl
37 | cd onvif_simple_server/extras
38 | ln -s ../../wolfssl-5.7.4-stable wolfssl
39 | cd ../..
40 | fi
41 |
42 | if [ ! -f zlib-1.3.1.tar.gz ]; then
43 | wget https://www.zlib.net/zlib-1.3.1.tar.gz
44 | fi
45 | tar zxvf ./zlib-1.3.1.tar.gz
46 | if [ ! -L zlib ]; then
47 | ln -s zlib-1.3.1 zlib
48 | cd onvif_simple_server/extras
49 | ln -s ../../zlib-1.3.1 zlib
50 | cd ../..
51 | fi
52 |
53 | if [ ! -f json-c-0.18.tar.gz ]; then
54 | wget https://s3.amazonaws.com/json-c_releases/releases/json-c-0.18.tar.gz
55 | fi
56 | tar zxvf ./json-c-0.18.tar.gz
57 | if [ ! -L json-c ]; then
58 | ln -s json-c-0.18 json-c
59 | mkdir -p json-c/build
60 | cd onvif_simple_server/extras
61 | ln -s ../../json-c-0.18 json-c
62 | cd ../..
63 | fi
64 |
65 | cd onvif_simple_server
66 |
67 | git reset --hard
68 |
69 | patch -p1 < ../path.patch
70 |
--------------------------------------------------------------------------------
/src/www/httpd/cgi-bin/preset.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | YI_HACK_PREFIX="/home/yi-hack"
4 | PTZ_CONF_FILE=$YI_HACK_PREFIX/etc/ptz_presets.conf
5 | PTZ_SCRIPT=$YI_HACK_PREFIX/script/ptz_presets.sh
6 |
7 | . $YI_HACK_PREFIX/www/cgi-bin/validate.sh
8 |
9 | return_error() {
10 | printf "Content-type: application/json\r\n\r\n"
11 | printf "{\n"
12 | printf "\"%s\":\"%s\",\\n" "error" "true"
13 | printf "\"%s\":\"%s\"\\n" "message" "$@"
14 | printf "}"
15 | }
16 |
17 | if ! $(validateQueryString $QUERY_STRING); then
18 | return_error "Invalid query"
19 | exit
20 | fi
21 |
22 | ACTION="none"
23 | NUM=-1
24 | NAME=""
25 |
26 | for I in 1 2 3
27 | do
28 | CONF="$(echo $QUERY_STRING | cut -d'&' -f$I | cut -d'=' -f1)"
29 | VAL="$(echo $QUERY_STRING | cut -d'&' -f$I | cut -d'=' -f2)"
30 |
31 | if [ "$CONF" == "action" ] ; then
32 | ACTION="$VAL"
33 | elif [ "$CONF" == "num" ] ; then
34 | if $(validateNumber $VAL); then
35 | NUM="$VAL"
36 | else
37 | if [ "$VAL" == "all" ]; then
38 | NUM="$VAL"
39 | else
40 | return_error "Wrong arguments"
41 | exit
42 | fi
43 | fi
44 | elif [ "$CONF" == "name" ] ; then
45 | if $(validateString $VAL); then
46 | NAME="$VAL"
47 | else
48 | return_error "Wrong arguments"
49 | exit
50 | fi
51 | fi
52 | done
53 |
54 | if [ "$ACTION" == "none" ] || [ "$ACTION" == "get_presets" ]; then
55 | return_error -99
56 | exit
57 | fi
58 |
59 | if [ "$NUM" != "-1" ]; then
60 | NUM="-n $NUM"
61 | else
62 | NUM=""
63 | fi
64 | if [ ! -z $NAME ]; then
65 | NAME="-m $NAME"
66 | else
67 | NAME=""
68 | fi
69 |
70 | RES=$($PTZ_SCRIPT -a $ACTION $NUM $NAME)
71 |
72 | if [ "$RES" == "" ]; then
73 | printf "Content-type: application/json\r\n\r\n"
74 | printf "{\n"
75 | printf "\"%s\":\"%s\"\\n" "error" "false"
76 | printf "}"
77 | else
78 | return_error $RES
79 | fi
80 |
--------------------------------------------------------------------------------
/src/rRTSPServer/init.rRTSPServer:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | ARCHIVE=live.2023.01.19.tar.gz
4 | LIBHELIXAAC_VER=2.0.0
5 | ARCHIVE_LIBHELIXAAC=${LIBHELIXAAC_VER}.tar.gz
6 |
7 | export CROSSPATH=/opt/yi/toolchain-sunxi-musl/toolchain/bin
8 | export PATH=${PATH}:${CROSSPATH}
9 |
10 | export TARGET=arm-openwrt-linux
11 | export CROSS=arm-openwrt-linux
12 | export BUILD=x86_64-pc-linux-gnu
13 |
14 | export CROSSPREFIX=${CROSS}-
15 |
16 | export STRIP=${CROSSPREFIX}strip
17 | export CXX=${CROSSPREFIX}g++
18 | export CC=${CROSSPREFIX}gcc
19 | export LD=${CROSSPREFIX}ld
20 | export AS=${CROSSPREFIX}as
21 | export AR=${CROSSPREFIX}ar
22 |
23 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
24 | cd $SCRIPT_DIR
25 |
26 | rm -rf ./_install
27 | rm -rf ./live
28 | rm -rf ./fdk-aac
29 | rm -rf ./libhelix-aac
30 |
31 | # fdk-aac
32 | if [ ! -f ${ARCHIVE_LIBHELIXAAC} ]; then
33 | wget https://github.com/earlephilhower/ESP8266Audio/archive/refs/tags/${ARCHIVE_LIBHELIXAAC}
34 | fi
35 | tar zxvf ${ARCHIVE_LIBHELIXAAC}
36 | mv ESP8266Audio-2.0.0/src/libhelix-aac libhelix-aac
37 | patch -p0 < not-arduino.patch
38 | patch -p0 < remove-mangling.patch
39 | cd libhelix-aac
40 | wget https://raw.githubusercontent.com/FrankBoesing/Arduino-Teensy-Codec-lib/refs/heads/master/aac/armgcc_nosyms/sbrcov.S
41 | sed -i -e 's/raac_CVKernel1/CVKernel1/g' sbrcov.S
42 | sed -i -e 's/raac_CVKernel2/CVKernel2/g' sbrcov.S
43 | cd ..
44 | rm -rf ESP8266Audio-2.0.0
45 | cp Makefile.libhelix-aac libhelix-aac/Makefile
46 |
47 | # live555
48 | if [ ! -f $ARCHIVE ]; then
49 | wget https://download.videolan.org/pub/contrib/live555/$ARCHIVE
50 | fi
51 | tar zxvf $ARCHIVE
52 | find live -type d -exec chmod 755 {} +
53 | find live -type f -name "*.cpp" -exec chmod 644 {} +
54 | find live -type f -name "*.hh" -exec chmod 644 {} +
55 | find live -type f -name "Makefile*" -exec chmod 644 {} +
56 |
57 | patch -p0 < rRTSPServer.patch
58 | patch -p0 < friend.patch
59 |
60 | cd live || exit 1
61 |
62 | ./genMakefiles linux-cross
63 | cp -f ../Makefile.rRTSPServer Makefile
64 | cp -rf ../src .
65 | cp -rf ../include .
66 |
--------------------------------------------------------------------------------
/sdhack/y20ga/Factory/configure_wifi.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | function print_help {
4 | echo "configure_wifi.sh"
5 | echo "will be used on next boot"
6 | }
7 |
8 | CFG_FILE=/tmp/sd/Factory/configure_wifi.cfg
9 | if [ ! -f "$CFG_FILE" ]; then
10 | echo "configure_wifi.cfg not found"
11 | exit 1
12 | fi
13 |
14 | TMP=$(cat $CFG_FILE | grep wifi_ssid=)
15 | SSID=$(echo "${TMP:10}")
16 | TMP=$(cat $CFG_FILE | grep wifi_psk=)
17 | KEY=$(echo "${TMP:9}")
18 |
19 | if [ -z "$SSID" ]; then
20 | echo "error: ssid has not been set"
21 | print_help
22 | exit 1
23 | fi
24 | if [ ${#SSID} -gt 63 ]; then
25 | echo "error: ssid is too long"
26 | print_help
27 | exit 1
28 | fi
29 |
30 | if [ -z "$KEY" ]; then
31 | echo "error: key has not been set"
32 | print_help
33 | exit 1
34 | fi
35 | if [ ${#KEY} -gt 63 ]; then
36 | echo "error: key is too long"
37 | print_help
38 | exit 1
39 | fi
40 |
41 | CURRENT_SSID=$(dd bs=1 skip=28 count=64 if=/dev/mtdblock6 2>/dev/null)
42 | CURRENT_KEY=$(dd bs=1 skip=92 count=64 if=/dev/mtdblock6 2>/dev/null)
43 |
44 | echo $SSID ${#SSID} - $CURRENT_SSID ${#CURRENT_SSID}
45 | echo $KEY ${#KEY} - $CURRENT_KEY ${#CURRENT_KEY}
46 |
47 | if [ "$SSID" == "$CURRENT_SSID" ] && [ "$KEY" == "$CURRENT_KEY" ]; then
48 | echo "ssid and key already configured"
49 | exit
50 | fi
51 |
52 | echo "creating partition backup..."
53 | DATE=$(date '+%Y%m%d%H%M%S')
54 | dd if=/dev/mtdblock6 of=/tmp/sd/mtdblock6_$DATE.bin 2>/dev/null
55 |
56 | # clear the existing passwords (to ensure we are null terminated)
57 | cat /dev/zero | dd of=/dev/mtdblock6 bs=1 seek=28 count=64 conv=notrunc
58 | cat /dev/zero | dd of=/dev/mtdblock6 bs=1 seek=92 count=64 conv=notrunc
59 | # write SSID
60 | echo -n "$SSID" | dd of=/dev/mtdblock6 bs=1 seek=28 count=64 conv=notrunc
61 | # write key
62 | echo -n "$KEY" | dd of=/dev/mtdblock6 bs=1 seek=92 count=64 conv=notrunc
63 | #write "connected" bit
64 | printf "\00\00\00\00" | dd of=/dev/mtdblock6 bs=1 seek=24 count=4 conv=notrunc
65 |
66 | sync
67 | sync
68 | sync
69 | reboot
70 |
--------------------------------------------------------------------------------
/sdhack/y25ga/Factory/configure_wifi.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | function print_help {
4 | echo "configure_wifi.sh"
5 | echo "will be used on next boot"
6 | }
7 |
8 | CFG_FILE=/tmp/sd/Factory/configure_wifi.cfg
9 | if [ ! -f "$CFG_FILE" ]; then
10 | echo "configure_wifi.cfg not found"
11 | exit 1
12 | fi
13 |
14 | TMP=$(cat $CFG_FILE | grep wifi_ssid=)
15 | SSID=$(echo "${TMP:10}")
16 | TMP=$(cat $CFG_FILE | grep wifi_psk=)
17 | KEY=$(echo "${TMP:9}")
18 |
19 | if [ -z "$SSID" ]; then
20 | echo "error: ssid has not been set"
21 | print_help
22 | exit 1
23 | fi
24 | if [ ${#SSID} -gt 63 ]; then
25 | echo "error: ssid is too long"
26 | print_help
27 | exit 1
28 | fi
29 |
30 | if [ -z "$KEY" ]; then
31 | echo "error: key has not been set"
32 | print_help
33 | exit 1
34 | fi
35 | if [ ${#KEY} -gt 63 ]; then
36 | echo "error: key is too long"
37 | print_help
38 | exit 1
39 | fi
40 |
41 | CURRENT_SSID=$(dd bs=1 skip=28 count=64 if=/dev/mtdblock6 2>/dev/null)
42 | CURRENT_KEY=$(dd bs=1 skip=92 count=64 if=/dev/mtdblock6 2>/dev/null)
43 |
44 | echo $SSID ${#SSID} - $CURRENT_SSID ${#CURRENT_SSID}
45 | echo $KEY ${#KEY} - $CURRENT_KEY ${#CURRENT_KEY}
46 |
47 | if [ "$SSID" == "$CURRENT_SSID" ] && [ "$KEY" == "$CURRENT_KEY" ]; then
48 | echo "ssid and key already configured"
49 | exit
50 | fi
51 |
52 | echo "creating partition backup..."
53 | DATE=$(date '+%Y%m%d%H%M%S')
54 | dd if=/dev/mtdblock6 of=/tmp/sd/mtdblock6_$DATE.bin 2>/dev/null
55 |
56 | # clear the existing passwords (to ensure we are null terminated)
57 | cat /dev/zero | dd of=/dev/mtdblock6 bs=1 seek=28 count=64 conv=notrunc
58 | cat /dev/zero | dd of=/dev/mtdblock6 bs=1 seek=92 count=64 conv=notrunc
59 | # write SSID
60 | echo -n "$SSID" | dd of=/dev/mtdblock6 bs=1 seek=28 count=64 conv=notrunc
61 | # write key
62 | echo -n "$KEY" | dd of=/dev/mtdblock6 bs=1 seek=92 count=64 conv=notrunc
63 | #write "connected" bit
64 | printf "\00\00\00\00" | dd of=/dev/mtdblock6 bs=1 seek=24 count=4 conv=notrunc
65 |
66 | sync
67 | sync
68 | sync
69 | reboot
70 |
--------------------------------------------------------------------------------
/sdhack/y30qa/Factory/configure_wifi.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | function print_help {
4 | echo "configure_wifi.sh"
5 | echo "will be used on next boot"
6 | }
7 |
8 | CFG_FILE=/tmp/sd/Factory/configure_wifi.cfg
9 | if [ ! -f "$CFG_FILE" ]; then
10 | echo "configure_wifi.cfg not found"
11 | exit 1
12 | fi
13 |
14 | TMP=$(cat $CFG_FILE | grep wifi_ssid=)
15 | SSID=$(echo "${TMP:10}")
16 | TMP=$(cat $CFG_FILE | grep wifi_psk=)
17 | KEY=$(echo "${TMP:9}")
18 |
19 | if [ -z "$SSID" ]; then
20 | echo "error: ssid has not been set"
21 | print_help
22 | exit 1
23 | fi
24 | if [ ${#SSID} -gt 63 ]; then
25 | echo "error: ssid is too long"
26 | print_help
27 | exit 1
28 | fi
29 |
30 | if [ -z "$KEY" ]; then
31 | echo "error: key has not been set"
32 | print_help
33 | exit 1
34 | fi
35 | if [ ${#KEY} -gt 63 ]; then
36 | echo "error: key is too long"
37 | print_help
38 | exit 1
39 | fi
40 |
41 | CURRENT_SSID=$(dd bs=1 skip=28 count=64 if=/dev/mtdblock6 2>/dev/null)
42 | CURRENT_KEY=$(dd bs=1 skip=92 count=64 if=/dev/mtdblock6 2>/dev/null)
43 |
44 | echo $SSID ${#SSID} - $CURRENT_SSID ${#CURRENT_SSID}
45 | echo $KEY ${#KEY} - $CURRENT_KEY ${#CURRENT_KEY}
46 |
47 | if [ "$SSID" == "$CURRENT_SSID" ] && [ "$KEY" == "$CURRENT_KEY" ]; then
48 | echo "ssid and key already configured"
49 | exit
50 | fi
51 |
52 | echo "creating partition backup..."
53 | DATE=$(date '+%Y%m%d%H%M%S')
54 | dd if=/dev/mtdblock6 of=/tmp/sd/mtdblock6_$DATE.bin 2>/dev/null
55 |
56 | # clear the existing passwords (to ensure we are null terminated)
57 | cat /dev/zero | dd of=/dev/mtdblock6 bs=1 seek=28 count=64 conv=notrunc
58 | cat /dev/zero | dd of=/dev/mtdblock6 bs=1 seek=92 count=64 conv=notrunc
59 | # write SSID
60 | echo -n "$SSID" | dd of=/dev/mtdblock6 bs=1 seek=28 count=64 conv=notrunc
61 | # write key
62 | echo -n "$KEY" | dd of=/dev/mtdblock6 bs=1 seek=92 count=64 conv=notrunc
63 | #write "connected" bit
64 | printf "\00\00\00\00" | dd of=/dev/mtdblock6 bs=1 seek=24 count=4 conv=notrunc
65 |
66 | sync
67 | sync
68 | sync
69 | reboot
70 |
--------------------------------------------------------------------------------
/sdhack/y501gc/Factory/configure_wifi.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | function print_help {
4 | echo "configure_wifi.sh"
5 | echo "will be used on next boot"
6 | }
7 |
8 | CFG_FILE=/tmp/sd/Factory/configure_wifi.cfg
9 | if [ ! -f "$CFG_FILE" ]; then
10 | echo "configure_wifi.cfg not found"
11 | exit 1
12 | fi
13 |
14 | TMP=$(cat $CFG_FILE | grep wifi_ssid=)
15 | SSID=$(echo "${TMP:10}")
16 | TMP=$(cat $CFG_FILE | grep wifi_psk=)
17 | KEY=$(echo "${TMP:9}")
18 |
19 | if [ -z "$SSID" ]; then
20 | echo "error: ssid has not been set"
21 | print_help
22 | exit 1
23 | fi
24 | if [ ${#SSID} -gt 63 ]; then
25 | echo "error: ssid is too long"
26 | print_help
27 | exit 1
28 | fi
29 |
30 | if [ -z "$KEY" ]; then
31 | echo "error: key has not been set"
32 | print_help
33 | exit 1
34 | fi
35 | if [ ${#KEY} -gt 63 ]; then
36 | echo "error: key is too long"
37 | print_help
38 | exit 1
39 | fi
40 |
41 | CURRENT_SSID=$(dd bs=1 skip=28 count=64 if=/dev/mtdblock6 2>/dev/null)
42 | CURRENT_KEY=$(dd bs=1 skip=92 count=64 if=/dev/mtdblock6 2>/dev/null)
43 |
44 | echo $SSID ${#SSID} - $CURRENT_SSID ${#CURRENT_SSID}
45 | echo $KEY ${#KEY} - $CURRENT_KEY ${#CURRENT_KEY}
46 |
47 | if [ "$SSID" == "$CURRENT_SSID" ] && [ "$KEY" == "$CURRENT_KEY" ]; then
48 | echo "ssid and key already configured"
49 | exit
50 | fi
51 |
52 | echo "creating partition backup..."
53 | DATE=$(date '+%Y%m%d%H%M%S')
54 | dd if=/dev/mtdblock6 of=/tmp/sd/mtdblock6_$DATE.bin 2>/dev/null
55 |
56 | # clear the existing passwords (to ensure we are null terminated)
57 | cat /dev/zero | dd of=/dev/mtdblock6 bs=1 seek=28 count=64 conv=notrunc
58 | cat /dev/zero | dd of=/dev/mtdblock6 bs=1 seek=92 count=64 conv=notrunc
59 | # write SSID
60 | echo -n "$SSID" | dd of=/dev/mtdblock6 bs=1 seek=28 count=64 conv=notrunc
61 | # write key
62 | echo -n "$KEY" | dd of=/dev/mtdblock6 bs=1 seek=92 count=64 conv=notrunc
63 | #write "connected" bit
64 | printf "\00\00\00\00" | dd of=/dev/mtdblock6 bs=1 seek=24 count=4 conv=notrunc
65 |
66 | sync
67 | sync
68 | sync
69 | reboot
70 |
--------------------------------------------------------------------------------
/unbrick/README.md:
--------------------------------------------------------------------------------
1 | ## Content
2 |
3 | This procedure allows you to unbrick your cam using a backup file (which you did previously).
4 |
5 | Please note: bootloader saves the hash of the file and if it matches the hash of the file you are trying to load, this procedure will not work.
6 |
7 | In this case, you have to use a different file: for example you can use "factory" if you have previously used "hacked" and vice versa (see below).
8 |
9 | In the "hacked" version I added a random file to force the hash to change.
10 |
11 |
12 | ## How to use
13 |
14 | 1. Clone this repo on a linux environment.
15 | 2. Copy your partition (mtdblockX.bin) in the folder corresponding to your model. mtdblock2.bin for rootfs partition and mtdblock3.bin for home partition.
16 | 3. Enter to the unbrick folder
17 | `cd unbrick`
18 | 4. Run the build command with the desired option.
19 |
20 | If you want to create an original unbrick partition:
21 |
22 | `./build.sh factory`
23 |
24 | If you want to create a hacked partition:
25 |
26 | `./build.sh hacked`
27 |
28 | The last option allows you to run the hack after the unbrick (but you need to install the hack separately). The backup partition is already modified to run the hack.
29 | 5. You will find the file home_XXX.gz (and/or rootfs_XXX.gz) in the folder corresponding to your model.
30 | 6. Check if there were any errors in the procedure: the size of the resulting file must be similar to the corresponding mtdblockX.bin.
31 | 7. Unzip it in the root folder of your sd card.
32 | 8. Switch on the cam and wait for the cam to come online.
33 |
34 | To run this script correctly you have to comply some dependencies depending on your OS.
35 | For example if you are using a Debian distro, install:
36 | - mtd-utils
37 | - u-boot-tools
38 |
39 | ## DISCLAIMER
40 | **NOBODY BUT YOU IS RESPONSIBLE FOR ANY USE OR DAMAGE THIS SOFTWARE MAY CAUSE. THIS IS INTENDED FOR EDUCATIONAL PURPOSES ONLY. USE AT YOUR OWN RISK.**
41 |
42 | # Donation
43 | If you like this project, you can buy Roleo a beer :)
44 | [](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=JBYXDMR24FW7U¤cy_code=EUR&source=url)
45 |
--------------------------------------------------------------------------------
/src/www/compile.www:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | compress_html()
4 | {
5 | local SRC=$1
6 | local DST=$2
7 |
8 | echo "Compressing $SRC..."
9 | awk -f ./httpd/tools/remcomm.awk "$SRC" > ./_install/www/tmp.html
10 | xmllint --html --noblanks ./_install/www/tmp.html > "$DST"
11 | rm ./_install/www/tmp.html
12 | }
13 |
14 | set -e
15 |
16 | SCRIPT_DIR=$(cd `dirname $0` && pwd)
17 | cd $SCRIPT_DIR
18 |
19 | mkdir -p ./_install/www/cgi-bin
20 | mkdir -p ./_install/www/img
21 | mkdir -p ./_install/www/css
22 | mkdir -p ./_install/www/js
23 | mkdir -p ./_install/www/pages
24 | ln -s /tmp/sd/record ./_install/www/record
25 |
26 | echo "Compressing CSS files..."
27 | #find ./httpd/htdocs/css/* ! -name all.css -exec cat {} \+ > ./_install/www/htdocs/css/tmp.css
28 | cat ./httpd/htdocs/css/normalize.min.css ./httpd/htdocs/css/skeleton.min.css ./httpd/htdocs/css/custom.css > ./_install/www/css/tmp.css
29 | yui-compressor --type css -o ./_install/www/css/all.css ./_install/www/css/tmp.css
30 | rm ./_install/www/css/tmp.css
31 |
32 | echo "Compressing JS files..."
33 | cp ./httpd/htdocs/js/jquery.min.js ./_install/www/js/jquery.min.js
34 | cat ./httpd/htdocs/js/utils.js ./httpd/htdocs/js/app.js ./httpd/htdocs/js/modules/*.js > ./_install/www/js/tmp.js
35 | yui-compressor -v --type js -o ./_install/www/js/all.js ./_install/www/js/tmp.js
36 | rm ./_install/www/js/tmp.js
37 |
38 | echo "Compressing HTML files..."
39 |
40 | compress_html ./httpd/htdocs/index.html ./_install/www/index.html
41 |
42 | # Compress pages
43 | for PAGE in ./httpd/htdocs/pages/*.html ; do
44 | PAGE_NAME="${PAGE##*/}"
45 | compress_html ./httpd/htdocs/pages/$PAGE_NAME ./_install/www/pages/$PAGE_NAME
46 | done
47 |
48 | echo "Copying image files..."
49 | cp -R ./httpd/htdocs/img/. ./_install/www/img/
50 |
51 | # To exlude more directories add the following line to the find command (after "-type f")
52 | # -not \( -path './_install/www/DIRECTORY_NAME/*' -prune \)
53 | echo "Aplying GZIP Compression to files..."
54 | find ./_install/www/* -type f -not \( -path './_install/www/cgi-bin/*' -prune \) -exec gzip -f -9 {} +
55 |
56 | echo "Copying the cgi-bin folder..."
57 | cp ./httpd/cgi-bin/* ./_install/www/cgi-bin
58 |
59 | echo "Compilation succeeded."
60 |
--------------------------------------------------------------------------------
/src/static/static/home/yi-hack/script/configure_wifi.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | function print_help {
4 | echo "configure_wifi.sh"
5 | echo "will be used on next boot"
6 | }
7 |
8 | CFG_FILE=/tmp/configure_wifi.cfg
9 | if [ ! -f "$CFG_FILE" ]; then
10 | echo "configure_wifi.cfg not found"
11 | exit 1
12 | fi
13 |
14 | TMP=$(cat $CFG_FILE | grep wifi_ssid=)
15 | SSID=$(echo "${TMP:10}")
16 | TMP=$(cat $CFG_FILE | grep wifi_psk=)
17 | KEY=$(echo "${TMP:9}")
18 |
19 | if [ -z "$SSID" ]; then
20 | echo "error: ssid has not been set"
21 | print_help
22 | exit 1
23 | fi
24 | if [ ${#SSID} -gt 63 ]; then
25 | echo "error: ssid is too long"
26 | print_help
27 | exit 1
28 | fi
29 |
30 | if [ -z "$KEY" ]; then
31 | echo "error: key has not been set"
32 | print_help
33 | exit 1
34 | fi
35 | if [ ${#KEY} -gt 63 ]; then
36 | echo "error: key is too long"
37 | print_help
38 | exit 1
39 | fi
40 |
41 | CURRENT_SSID=$(dd bs=1 skip=28 count=64 if=/dev/mtdblock6 2>/dev/null)
42 | CURRENT_KEY=$(dd bs=1 skip=92 count=64 if=/dev/mtdblock6 2>/dev/null)
43 | CONNECTED_BIT=$(hexdump -s 24 -n 4 -v /dev/mtdblock6 | awk 'FNR <=1' | awk '{print $3$2}')
44 |
45 | echo $SSID ${#SSID} - $CURRENT_SSID ${#CURRENT_SSID}
46 | echo $KEY ${#KEY} - $CURRENT_KEY ${#CURRENT_KEY}
47 | echo $CONNECTED_BIT
48 |
49 | if [ "$SSID" == "$CURRENT_SSID" ] && [ "$KEY" == "$CURRENT_KEY" ] && [ "$CONNECTED_BIT" == "00000000" ]; then
50 | echo "ssid and key already configured"
51 | if [ $# -ne 1 ] || [ "$1" != "force" ]; then
52 | exit
53 | fi
54 | fi
55 |
56 | echo "creating partition backup..."
57 | DATE=$(date '+%Y%m%d%H%M%S')
58 | dd if=/dev/mtdblock6 of=/tmp/sd/mtdblock6_$DATE.bin 2>/dev/null
59 |
60 | # clear the existing passwords (to ensure we are null terminated)
61 | cat /dev/zero | dd of=/dev/mtdblock6 bs=1 seek=28 count=64 conv=notrunc
62 | cat /dev/zero | dd of=/dev/mtdblock6 bs=1 seek=92 count=64 conv=notrunc
63 | # write SSID
64 | echo -n "$SSID" | dd of=/dev/mtdblock6 bs=1 seek=28 count=64 conv=notrunc
65 | # write key
66 | echo -n "$KEY" | dd of=/dev/mtdblock6 bs=1 seek=92 count=64 conv=notrunc
67 | #write "connected" bit
68 | printf "\00\00\00\00" | dd of=/dev/mtdblock6 bs=1 seek=24 count=4 conv=notrunc
69 |
70 | sync
71 | sync
72 | sync
73 |
--------------------------------------------------------------------------------
/.github/workflows/main.yml:
--------------------------------------------------------------------------------
1 | # Action Name
2 | name: Build Project
3 |
4 | # Controls when the action will run.
5 | on:
6 | push:
7 | branches:
8 | - master
9 | - crdnl/*
10 | pull_request:
11 | branches:
12 | - master
13 |
14 | jobs:
15 | build:
16 | # The type of runner that the job will run on
17 | runs-on: ubuntu-latest
18 |
19 | # Steps represent a sequence of tasks that will be executed as part of the job
20 | steps:
21 | # Install the dependencies to build the image
22 | - name: Install Dependencies
23 | run: |
24 | sudo apt-get update
25 | sudo apt-get install -y git unzip build-essential bison libbison-dev \
26 | autoconf autotools-dev automake libssl-dev zlib1g-dev libzzip-dev \
27 | flex libfl-dev yui-compressor closure-compiler optipng jpegoptim libtidy5deb1 \
28 | node-less sassc sass-spec libhtml-tidy-perl libxml2-utils
29 |
30 | # Retrieve the toolchain from the OpenWRT folks
31 | - name: Retrieve the Toolchain
32 | uses: actions/checkout@v3
33 | with:
34 | repository: lindenis-org/lindenis-v536-prebuilt
35 | path: toolchain
36 |
37 | # Move the toolchain to the proper location
38 | - name: Shuffle the Toolchain
39 | run: |
40 | mkdir -p /opt/yi/toolchain-sunxi-musl
41 | cp -r ${GITHUB_WORKSPACE}/toolchain/gcc/linux-x86/arm/toolchain-sunxi-musl/toolchain /opt/yi/toolchain-sunxi-musl/
42 |
43 | # Checks-out the repository under $GITHUB_WORKSPACE, so the job can access it
44 | - name: Retrieve the Repository
45 | uses: actions/checkout@v3
46 | with:
47 | submodules: true
48 | path: main
49 |
50 | - name: Fix Permissions
51 | run: |
52 | chmod +x ${GITHUB_WORKSPACE}/main/scripts/*
53 | - name: Compile the Firmware
54 | run: |
55 | cd ${GITHUB_WORKSPACE}/main
56 | ./scripts/compile.sh
57 |
58 | - name: Package the Firmware
59 | run: |
60 | cd ${GITHUB_WORKSPACE}/main
61 | sudo ./scripts/pack_fw.all.sh
62 |
63 | - name: Upload Artifacts
64 | uses: actions/upload-artifact@v4
65 | with:
66 | name: Output-Dir
67 | path: /home/runner/work/yi-hack-Allwinner/yi-hack-Allwinner/main//out
68 |
--------------------------------------------------------------------------------
/scripts/cleanup.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | #
4 | # This file is part of yi-hack-v4 (https://github.com/TheCrypt0/yi-hack-v4).
5 | # Copyright (c) 2019 densanki.
6 | # Copyright (c) 2019 Davide Maggioni.
7 | #
8 | # This program is free software: you can redistribute it and/or modify
9 | # it under the terms of the GNU General Public License as published by
10 | # the Free Software Foundation, version 3.
11 | #
12 | # This program is distributed in the hope that it will be useful, but
13 | # WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | # General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU General Public License
18 | # along with this program. If not, see .
19 | #
20 |
21 | #set -e
22 |
23 | get_script_dir()
24 | {
25 | echo "$(cd `dirname $0` && pwd)"
26 | }
27 |
28 | source "$(get_script_dir)/common.sh"
29 |
30 | require_root
31 |
32 | echo ""
33 | echo "------------------------------------------------------------------------"
34 | echo " YI-HACK - CLEANUP"
35 | echo "------------------------------------------------------------------------"
36 | echo ""
37 |
38 | BASE_DIR=$(get_script_dir)/../
39 | BASE_DIR=$(normalize_path $BASE_DIR)
40 |
41 | SYSROOT_DIR=$BASE_DIR/sysroot
42 | STATIC_DIR=$BASE_DIR/static
43 | BUILD_DIR=$BASE_DIR/build
44 | OUT_DIR=$BASE_DIR/out
45 |
46 | echo "Cleaning build dir ..."
47 | rm -rf $BUILD_DIR
48 | echo "Cleaning out dir ..."
49 | rm -rf $OUT_DIR
50 |
51 | echo "Cleaning src/*/_install folders ..."
52 |
53 | SRC_DIR=$(get_script_dir)/../src
54 |
55 | for SUB_DIR in $SRC_DIR/* ; do
56 | if [ -d ${SUB_DIR} ]; then # Will not run if no directories are available
57 | echo -n "Cleaning _install in $(basename \"$SUB_DIR\") ..."
58 | rm -rf $SUB_DIR/_install
59 | echo "done!"
60 | fi
61 | done
62 |
63 | echo ""
64 |
65 | for SUB_DIR in $SRC_DIR/* ; do
66 | if [ -d ${SUB_DIR} ]; then # Will not run if no directories are available
67 | echo -n "Cleaning $(basename \"$SUB_DIR\") ..."
68 | cd $SUB_DIR
69 | MOD_DIR=$(basename $SUB_DIR)
70 | ./cleanup.$MOD_DIR
71 | echo "done!"
72 | fi
73 | done
74 |
75 | echo ""
76 | echo "Finished!"
77 | echo ""
78 |
--------------------------------------------------------------------------------
/src/www/httpd/cgi-bin/speaker_file.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # Play a file stored in FILE_PATH by name
4 |
5 | export PATH=$PATH:/home/base/tools:/home/yi-hack/bin:/home/yi-hack/sbin:/home/yi-hack/usr/bin:/home/yi-hack/usr/sbin:/tmp/sd/yi-hack/bin:/tmp/sd/yi-hack/sbin
6 | export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/lib:/home/yi-hack/lib:/tmp/sd/yi-hack/lib
7 |
8 | YI_HACK_PREFIX="/home/yi-hack"
9 | FILE_PATH="/tmp/sd/audio/"
10 |
11 | . $YI_HACK_PREFIX/www/cgi-bin/validate.sh
12 |
13 | if ! $(validateQueryString $QUERY_STRING); then
14 | printf "Content-type: application/json\r\n\r\n"
15 | printf "{\n"
16 | printf "\"%s\":\"%s\"\\n" "error" "true"
17 | printf "}"
18 | exit
19 | fi
20 |
21 | LANG="en-US"
22 | VOLDB="1"
23 |
24 | for I in 1 2
25 | do
26 | PARAM="$(echo $QUERY_STRING | cut -d'&' -f$I | cut -d'=' -f1)"
27 | VALUE="$(echo $QUERY_STRING | cut -d'&' -f$I | cut -d'=' -f2)"
28 |
29 | if [ "$PARAM" == "voldb" ] ; then
30 | VOLDB="$VALUE"
31 | fi
32 | done
33 |
34 | if ! $(validateNumber $VOLDB); then
35 | printf "{\n"
36 | printf "\"%s\":\"%s\",\\n" "error" "true"
37 | printf "\"%s\":\"%s\"\\n" "description" "Invalid volume"
38 | printf "}"
39 | exit
40 | fi
41 |
42 | read -r POST_DATA
43 |
44 | printf "Content-type: application/json\r\n\r\n"
45 |
46 | if [ -f /tmp/sd/audio/$POST_DATA ] && [ -e /tmp/audio_in_fifo ]; then
47 | TMP_FILE="/tmp/sd/speak.pcm"
48 | if [ ! -f $TMP_FILE ]; then
49 | cat $FILE_PATH$POST_DATA > $TMP_FILE
50 | cat $TMP_FILE | pcmvol -G $VOLDB > /tmp/audio_in_fifo
51 | sleep 1
52 | rm $TMP_FILE
53 |
54 | printf "{\n"
55 | printf "\"%s\":\"%s\",\\n" "error" "false"
56 | printf "\"%s\":\"%s\"\\n" "description" "$POST_DATA"
57 | printf "}"
58 | else
59 | printf "{\n"
60 | printf "\"%s\":\"%s\",\\n" "error" "true"
61 | printf "\"%s\":\"%s\"\\n" "description" "Speaker busy"
62 | printf "}"
63 | fi
64 | else
65 | if [ ! -f $FILE_PATH$POST_DATA ]; then
66 | printf "{\n"
67 | printf "\"%s\":\"%s\"\\n" "error" "true"
68 | printf "\"%s\":\"%s\"\\n" "description" "File not found"
69 | printf "}"
70 | elif [ ! -e /tmp/audio_in_fifo ]; then
71 | printf "{\n"
72 | printf "\"%s\":\"%s\"\\n" "error" "true"
73 | printf "\"%s\":\"%s\"\\n" "description" "Audio input disabled"
74 | printf "}"
75 | fi
76 | fi
77 |
--------------------------------------------------------------------------------
/src/rtsp_server_yi/Makefile.rtsp_server_yi:
--------------------------------------------------------------------------------
1 | #DEBUG = -D_DEBUG
2 |
3 | TARGET1 = rtsp_server
4 | TARGET2 = rtsp_pusher
5 | TARGET3 = rtsp_h264_file
6 | TARGET4 = rtsp_server_yi
7 |
8 | OBJS_PATH = objs
9 |
10 | CROSS_COMPILE = $(CROSSPREFIX)
11 | CXX = $(CROSS_COMPILE)g++
12 | CC = $(CROSS_COMPILE)gcc
13 | STRIP = $(CROSS_COMPILE)strip
14 |
15 | INC = -I$(shell pwd)/src/ -I$(shell pwd)/src/net -I$(shell pwd)/src/xop -I$(shell pwd)/src/3rdpart -I$(shell pwd)/example/other
16 | LIB =
17 |
18 | LD_FLAGS = -Wl,--gc-sections -lrt -pthread -lpthread -ldl -lm $(DEBUG)
19 | CXX_FLAGS += -std=c++11 -ffunction-sections -fdata-sections
20 |
21 | O_FLAG = -O2
22 |
23 | SRC1 = $(notdir $(wildcard ./src/net/*.cpp))
24 | OBJS1 = $(patsubst %.cpp,$(OBJS_PATH)/%.o,$(SRC1))
25 |
26 | SRC2 = $(notdir $(wildcard ./src/xop/*.cpp))
27 | OBJS2 = $(patsubst %.cpp,$(OBJS_PATH)/%.o,$(SRC2))
28 |
29 | SRC3 = $(notdir $(wildcard ./example/other/*.cpp))
30 | OBJS3 = $(patsubst %.cpp,$(OBJS_PATH)/%.o,$(SRC3))
31 |
32 | SRC4 = $(notdir $(wildcard ./example/rtsp_server.cpp))
33 | OBJS4 = $(patsubst %.cpp,$(OBJS_PATH)/%.o,$(SRC4))
34 |
35 | SRC5 = $(notdir $(wildcard ./example/rtsp_pusher.cpp))
36 | OBJS5 = $(patsubst %.cpp,$(OBJS_PATH)/%.o,$(SRC5))
37 |
38 | SRC6 = $(notdir $(wildcard ./example/rtsp_h264_file.cpp))
39 | OBJS6 = $(patsubst %.cpp,$(OBJS_PATH)/%.o,$(SRC6))
40 |
41 | SRC7 = $(notdir $(wildcard ./example/rtsp_server_yi.cpp))
42 | OBJS7 = $(patsubst %.cpp,$(OBJS_PATH)/%.o,$(SRC7))
43 |
44 | all: BUILD_DIR $(TARGET1) $(TARGET2) $(TARGET3) $(TARGET4)
45 |
46 | BUILD_DIR:
47 | @-mkdir -p $(OBJS_PATH)
48 |
49 | $(TARGET1) : $(OBJS1) $(OBJS2) $(OBJS3) $(OBJS4)
50 | $(CXX) $^ -o $@ $(CFLAGS) $(LD_FLAGS) $(CXX_FLAGS)
51 |
52 | $(TARGET2) : $(OBJS1) $(OBJS2) $(OBJS3) $(OBJS5)
53 | $(CXX) $^ -o $@ $(CFLAGS) $(LD_FLAGS) $(CXX_FLAGS)
54 |
55 | $(TARGET3) : $(OBJS1) $(OBJS2) $(OBJS3) $(OBJS6)
56 | $(CXX) $^ -o $@ $(CFLAGS) $(LD_FLAGS) $(CXX_FLAGS)
57 |
58 | $(TARGET4) : $(OBJS1) $(OBJS2) $(OBJS3) $(OBJS7)
59 | $(CXX) $^ -o $@ $(CFLAGS) $(LD_FLAGS) $(CXX_FLAGS)
60 |
61 | $(OBJS_PATH)/%.o : ./example/%.cpp
62 | $(CXX) -c $< -o $@ $(CXX_FLAGS) $(INC)
63 | $(OBJS_PATH)/%.o : ./src/net/%.cpp
64 | $(CXX) -c $< -o $@ $(CXX_FLAGS) $(INC)
65 | $(OBJS_PATH)/%.o : ./src/xop/%.cpp
66 | $(CXX) -c $< -o $@ $(CXX_FLAGS) $(INC)
67 | $(OBJS_PATH)/%.o : ./example/other/%.cpp
68 | $(CXX) -c $< -o $@ $(CXX_FLAGS) $(INC)
69 |
70 | clean:
71 | -rm -rf $(OBJS_PATH) $(TARGET1) $(TARGET2) $(TARGET3) $(TARGET4)
72 |
--------------------------------------------------------------------------------
/src/www/httpd/cgi-bin/snapshot.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | YI_HACK_PREFIX="/home/yi-hack"
4 |
5 | . $YI_HACK_PREFIX/www/cgi-bin/validate.sh
6 |
7 | if ! $(validateQueryString $QUERY_STRING); then
8 | printf "Content-type: application/json\r\n\r\n"
9 | printf "{\n"
10 | printf "\"%s\":\"%s\"\\n" "error" "true"
11 | printf "}"
12 | exit
13 | fi
14 |
15 | BASE64="no"
16 | RES="-r high"
17 | WATERMARK="no"
18 | OUTPUT_FILE="none"
19 | MODEL=$(cat /home/yi-hack/model_suffix)
20 |
21 | for I in 1 2 3 4
22 | do
23 | CONF="$(echo $QUERY_STRING | cut -d'&' -f$I | cut -d'=' -f1)"
24 | VAL="$(echo $QUERY_STRING | cut -d'&' -f$I | cut -d'=' -f2)"
25 |
26 | if [ "$CONF" == "res" ] ; then
27 | if [ "$VAL" == "low" ] || [ "$VAL" == "high" ] ; then
28 | RES="-r $VAL"
29 | fi
30 | elif [ "$CONF" == "watermark" ] ; then
31 | if [ "$VAL" == "yes" ] || [ "$VAL" == "no" ] ; then
32 | WATERMARK=$VAL
33 | fi
34 | elif [ "$CONF" == "base64" ] ; then
35 | if [ "$VAL" == "yes" ] || [ "$VAL" == "no" ] ; then
36 | BASE64=$VAL
37 | fi
38 | elif [ "$CONF" == "file" ] ; then
39 | OUTPUT_FILE=$VAL
40 | fi
41 | done
42 |
43 | REDIRECT=""
44 | if $(validateBaseName $OUTPUT_FILE); then
45 | if [ "$OUTPUT_FILE" != "none" ] ; then
46 | OUTPUT_DIR=$(cd "$(dirname "/tmp/sd/record/$OUTPUT_FILE")"; pwd)
47 | OUTPUT_DIR=$(echo "$OUTPUT_DIR" | cut -c1-14)
48 | if [ "$OUTPUT_DIR" == "/tmp/sd/record" ]; then
49 | REDIRECT="yes"
50 | fi
51 | fi
52 | fi
53 |
54 | if [ "$WATERMARK" == "yes" ] ; then
55 | WATERMARK="-w"
56 | elif [ "$WATERMARK" == "no" ] ; then
57 | WATERMARK=""
58 | fi
59 |
60 | if [ "$REDIRECT" == "yes" ] ; then
61 | if [ "$BASE64" == "no" ] ; then
62 | imggrabber -m $MODEL $RES $WATERMARK > /tmp/sd/record/$OUTPUT_FILE
63 | elif [ "$BASE64" == "yes" ] ; then
64 | imggrabber -m $MODEL $RES $WATERMARK | base64 > /tmp/sd/record/$OUTPUT_FILE
65 | fi
66 | printf "Content-type: application/json\r\n\r\n"
67 | printf "{\n"
68 | printf "\"%s\":\"%s\"\\n" "error" "false"
69 | printf "}"
70 | else
71 | if [ "$BASE64" == "no" ] ; then
72 | printf "Content-type: image/jpeg\r\n\r\n"
73 | imggrabber -m $MODEL $RES $WATERMARK
74 | elif [ "$BASE64" == "yes" ] ; then
75 | printf "Content-type: image/jpeg;base64\r\n\r\n"
76 | imggrabber -m $MODEL $RES $WATERMARK | base64
77 | fi
78 | fi
79 |
--------------------------------------------------------------------------------
/src/onvif_simple_server/path.patch:
--------------------------------------------------------------------------------
1 | diff -Naur onvif_simple_server.ori/onvif_notify_server.c onvif_simple_server/onvif_notify_server.c
2 | --- onvif_simple_server.ori/onvif_notify_server.c 2025-05-20 16:04:41.566106647 +0200
3 | +++ onvif_simple_server/onvif_notify_server.c 2025-05-19 21:58:06.946512597 +0200
4 | @@ -39,11 +39,11 @@
5 | #include "log.h"
6 | #include "onvif_simple_server.h"
7 |
8 | -#define DEFAULT_CONF_FILE "/etc/onvif_simple_server.conf"
9 | -#define DEFAULT_JSON_CONF_FILE "/etc/onvif_simple_server.json"
10 | -#define DEFAULT_LOG_FILE "/var/log/onvif_notify_server.log"
11 | +#define DEFAULT_CONF_FILE "/tmp/onvif_simple_server.conf"
12 | +#define DEFAULT_JSON_CONF_FILE "/tmp/onvif_simple_server.json"
13 | +#define DEFAULT_LOG_FILE "/tmp/onvif_notify_server.log"
14 | #define DEFAULT_PID_FILE "/var/run/onvif_notify_server.pid"
15 | -#define TEMPLATE_DIR "/etc/onvif_notify_server"
16 | +#define TEMPLATE_DIR "/home/yi-hack/etc/onvif_notify_server"
17 | #define INOTIFY_DIR "/tmp/onvif_notify_server"
18 |
19 | #define ALARM_OFF 0
20 | diff -Naur onvif_simple_server.ori/onvif_simple_server.c onvif_simple_server/onvif_simple_server.c
21 | --- onvif_simple_server.ori/onvif_simple_server.c 2025-05-20 16:05:41.953491940 +0200
22 | +++ onvif_simple_server/onvif_simple_server.c 2025-05-19 22:11:39.609081482 +0200
23 | @@ -38,9 +38,9 @@
24 | #include "utils.h"
25 | #include "log.h"
26 |
27 | -#define DEFAULT_CONF_FILE "/etc/onvif_simple_server.conf"
28 | -#define DEFAULT_JSON_CONF_FILE "/etc/onvif_simple_server.json"
29 | -#define DEFAULT_LOG_FILE "/var/log/onvif_simple_server.log"
30 | +#define DEFAULT_CONF_FILE "/tmp/onvif_simple_server.conf"
31 | +#define DEFAULT_JSON_CONF_FILE "/tmp/onvif_simple_server.json"
32 | +#define DEFAULT_LOG_FILE "/tmp/onvif_simple_server.log"
33 | #define DEBUG_FILE "/tmp/onvif_simple_server.debug"
34 |
35 | #define ROTATION_LOG_LENGTH 3
36 | diff -Naur onvif_simple_server.ori/wsd_simple_server.c onvif_simple_server/wsd_simple_server.c
37 | --- onvif_simple_server.ori/wsd_simple_server.c 2025-05-20 16:06:31.857058818 +0200
38 | +++ onvif_simple_server/wsd_simple_server.c 2025-05-19 20:17:54.965288550 +0200
39 | @@ -38,8 +38,8 @@
40 | #define PORT 3702
41 | #define TYPE "NetworkVideoTransmitter"
42 |
43 | -#define DEFAULT_LOG_FILE "/var/log/wsd_simple_server.log"
44 | -#define TEMPLATE_DIR "/etc/wsd_simple_server"
45 | +#define DEFAULT_LOG_FILE "/tmp/wsd_simple_server.log"
46 | +#define TEMPLATE_DIR "/home/yi-hack/etc/wsd_simple_server"
47 |
48 | #define RECV_BUFFER_LEN 4096
49 |
50 |
--------------------------------------------------------------------------------
/src/rRTSPServer/include/VideoFramedMemorySource.hh:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2025 roleo.
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, version 3.
7 | *
8 | * This program is distributed in the hope that it will be useful, but
9 | * WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 | * General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | */
16 |
17 | /*
18 | * A class for streaming data from a queue
19 | */
20 |
21 | #ifndef _FRAMED_MEMORY_SOURCE_HH
22 | #define _FRAMED_MEMORY_SOURCE_HH
23 |
24 | #ifndef _FRAMED_SOURCE_HH
25 | #include "FramedSource.hh"
26 | #endif
27 |
28 | #include
29 |
30 | class VideoFramedMemorySource: public FramedSource {
31 | public:
32 | static VideoFramedMemorySource* createNew(UsageEnvironment& env,
33 | int hNumber,
34 | output_queue *qBuffer,
35 | Boolean useTimeForPres,
36 | unsigned playTimePerFrame = 0);
37 |
38 | void seekToByteAbsolute(u_int64_t byteNumber, u_int64_t numBytesToStream = 0);
39 | void seekToByteRelative(int64_t offset, u_int64_t numBytesToStream = 0);
40 | static void doGetNextFrameTask(void *clientData);
41 | void doGetNextFrameEx();
42 |
43 | protected:
44 | VideoFramedMemorySource(UsageEnvironment& env,
45 | int hNumber,
46 | output_queue *qBuffer,
47 | Boolean useTimeForPres,
48 | unsigned playTimePerFrame);
49 | // called only by createNew()
50 |
51 | virtual ~VideoFramedMemorySource();
52 |
53 | private:
54 | // redefined virtual functions:
55 | virtual void doGetNextFrame();
56 | virtual void doStopGettingFrames();
57 |
58 | private:
59 | int fHNumber;
60 | output_queue *fQBuffer;
61 | u_int64_t fCurIndex;
62 | Boolean fUseTimeForPres;
63 | unsigned fPlayTimePerFrame;
64 | unsigned fLastPlayTime;
65 | Boolean fLimitNumBytesToStream;
66 | u_int64_t fNumBytesToStream; // used iff "fLimitNumBytesToStream" is True
67 | Boolean fHaveStartedReading;
68 | };
69 |
70 | #endif
71 |
--------------------------------------------------------------------------------
/src/rRTSPServer/include/PCMFileSink.hh:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2025 roleo.
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, version 3.
7 | *
8 | * This program is distributed in the hope that it will be useful, but
9 | * WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 | * General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | */
16 |
17 | /*
18 | * PCM File Sink
19 | */
20 |
21 | #ifndef _PCM_FILE_SINK_HH
22 | #define _PCM_FILE_SINK_HH
23 |
24 | #include "FileSink.hh"
25 | #include "Speaker.hh"
26 |
27 | #define ULAW 0
28 | #define ALAW 1
29 |
30 | #define FILTER_M 0.125
31 |
32 | class PCMFileSink: public FileSink {
33 | public:
34 | static PCMFileSink* createNew(UsageEnvironment& env, char const* fileName,
35 | int destSampleRate, int srcLaw,
36 | Boolean enableSpeaker,
37 | unsigned bufferSize = 8192);
38 | // "bufferSize" should be at least as large as the largest expected
39 | // input frame.
40 |
41 | virtual void addData(unsigned char* data, unsigned dataSize,
42 | struct timeval presentationTime);
43 | // (Available in case a client wants to add extra data to the output file)
44 |
45 | protected:
46 | PCMFileSink(UsageEnvironment& env, FILE* fid, int destSampleRate, int srcLaw,
47 | Boolean enableSpeaker, unsigned bufferSize);
48 | // called only by createNew()
49 | virtual ~PCMFileSink();
50 |
51 | protected: // redefined virtual functions:
52 | virtual Boolean continuePlaying();
53 |
54 | protected:
55 | static void afterGettingFrame(void* clientData, unsigned frameSize,
56 | unsigned numTruncatedBytes,
57 | struct timeval presentationTime,
58 | unsigned durationInMicroseconds);
59 | virtual void afterGettingFrame(unsigned frameSize,
60 | unsigned numTruncatedBytes,
61 | struct timeval presentationTime);
62 |
63 | int fDestSampleRate;
64 | int fSrcLaw;
65 | int fPacketCounter;
66 | int16_t *fPCMBuffer;
67 | int16_t fLastSample;
68 | Speaker *fSpeaker;
69 | };
70 |
71 | #endif
72 |
--------------------------------------------------------------------------------
/scripts/common.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | #
4 | # This file is part of yi-hack-v4 (https://github.com/TheCrypt0/yi-hack-v4).
5 | # Copyright (c) 2018-2019 Davide Maggioni.
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU General Public License as published by
9 | # the Free Software Foundation, version 3.
10 | #
11 | # This program is distributed in the hope that it will be useful, but
12 | # WITHOUT ANY WARRANTY; without even the implied warranty of
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | # General Public License for more details.
15 | #
16 | # You should have received a copy of the GNU General Public License
17 | # along with this program. If not, see .
18 | #
19 |
20 | ###############################################################################
21 | # Cameras list
22 | ###############################################################################
23 |
24 | declare -A CAMERAS
25 |
26 | #CAMERAS["yi_home_1080p_6FUS_450"]="y203c"
27 | #CAMERAS["yi_home_1080p_9FUS_450"]="y203c"
28 | #CAMERAS["yi_home_1080p_BFUS_450"]="y203c"
29 | #CAMERAS["yi_dome_1080p_6FUS_460"]="h201c"
30 | #CAMERAS["yi_dome_1080p_BFUS_460"]="h201c"
31 | CAMERAS["y20ga"]="y20ga"
32 | CAMERAS["y25ga"]="y25ga"
33 | CAMERAS["y30qa"]="y30qa"
34 | CAMERAS["y501gc"]="y501gc"
35 |
36 | ###############################################################################
37 | # Common functions
38 | ###############################################################################
39 |
40 | require_root()
41 | {
42 | if [ "$(whoami)" != "root" ]; then
43 | echo "$0 must be run as root!"
44 | exit 1
45 | fi
46 | }
47 |
48 | normalize_path()
49 | {
50 | local path=${1//\/.\//\/}
51 | local npath=$(echo $path | sed -e 's;[^/][^/]*/\.\./;;')
52 | while [[ $npath != $path ]]; do
53 | path=$npath
54 | npath=$(echo $path | sed -e 's;[^/][^/]*/\.\./;;')
55 | done
56 | echo $path
57 | }
58 |
59 | check_camera_name()
60 | {
61 | local CAMERA_NAME=$1
62 | if [[ ! ${CAMERAS[$CAMERA_NAME]+_} ]]; then
63 | printf "%s not found.\n\n" $CAMERA_NAME
64 |
65 | printf "Here's the list of supported cameras:\n\n"
66 | print_cameras_list
67 | printf "\n"
68 | exit 1
69 | fi
70 | }
71 |
72 | print_cameras_list()
73 | {
74 | for CAMERA_NAME in "${!CAMERAS[@]}"; do
75 | printf "%s\n" $CAMERA_NAME
76 | done
77 | }
78 |
79 | get_camera_id()
80 | {
81 | local CAMERA_NAME=$1
82 | check_camera_name $CAMERA_NAME
83 | echo ${CAMERAS[$CAMERA_NAME]}
84 | }
85 |
--------------------------------------------------------------------------------
/src/rRTSPServer/include/PCMAudioFileServerMediaSubsession_BC.hh:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2025 roleo.
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, version 3.
7 | *
8 | * This program is distributed in the hope that it will be useful, but
9 | * WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 | * General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | */
16 |
17 | /*
18 | * A ServerMediaSubsession object that creates new, unicast, RTPSource
19 | * on demand, to a PCM Audio
20 | */
21 |
22 | #ifndef _PCM_AUDIO_FILE_SERVER_MEDIA_SUBSESSION_BC_HH
23 | #define _PCM_AUDIO_FILE_SERVER_MEDIA_SUBSESSION_BC_HH
24 |
25 | #ifndef _FILE_SERVER_MEDIA_SUBSESSION_BC_HH
26 | #include "FileServerMediaSubsession_BC.hh"
27 | #endif
28 |
29 | class PCMAudioFileServerMediaSubsession_BC: public FileServerMediaSubsession_BC {
30 | public:
31 | static PCMAudioFileServerMediaSubsession_BC*
32 | createNew(UsageEnvironment& env, char const* fileName, Boolean reuseFirstSource,
33 | int sampleRate, int numChannels, int law, Boolean enableSpeaker);
34 |
35 | protected:
36 | PCMAudioFileServerMediaSubsession_BC(UsageEnvironment& env,
37 | char const* fileName, Boolean reuseFirstSource,
38 | int sampleRate, int numChannels, int law, Boolean enableSpeaker);
39 | // called only by createNew();
40 | virtual ~PCMAudioFileServerMediaSubsession_BC();
41 |
42 | protected: // redefined virtual functions
43 | virtual FramedSource* createNewStreamSource(unsigned clientSessionId,
44 | unsigned& estBitrate);
45 | virtual RTPSink* createNewRTPSink(Groupsock* rtpGroupsock,
46 | unsigned char rtpPayloadTypeIfDynamic,
47 | FramedSource* inputSource);
48 |
49 | virtual MediaSink* createNewStreamDestination(unsigned clientSessionId,
50 | unsigned& estBitrate);
51 | // "estBitrate" is the stream's estimated bitrate, in kbps
52 | virtual RTPSource* createNewRTPSource(Groupsock* rtpGroupsock,
53 | unsigned char rtpPayloadTypeIfDynamic,
54 | MediaSink* outputSink);
55 |
56 | private:
57 | int fSampleRate;
58 | int fNumChannels;
59 | int fLaw;
60 | Boolean fEnableSpeaker;
61 | char* fAuxSDPLine;
62 | unsigned char fRTPPayloadFormat;
63 | unsigned fRTPTimestampFrequency;
64 |
65 | };
66 |
67 | #endif
68 |
--------------------------------------------------------------------------------