diff --git a/rootfs/usr/share/d3m0n/config b/rootfs/usr/share/d3m0n/config index 2e6cbbbf..5d7e68f0 100644 --- a/rootfs/usr/share/d3m0n/config +++ b/rootfs/usr/share/d3m0n/config @@ -1,3 +1,4 @@ wallpaper: default theme: default_dark -splash_time: 3000 \ No newline at end of file +splash_time: 3000 +update: true \ No newline at end of file diff --git a/rootfs/usr/share/d3m0n/firstboot.sh b/rootfs/usr/share/d3m0n/firstboot.sh index 30a05297..e249585a 100644 --- a/rootfs/usr/share/d3m0n/firstboot.sh +++ b/rootfs/usr/share/d3m0n/firstboot.sh @@ -1,5 +1,180 @@ -#!/bin/bash +#!/bin/bash -echo "" +# update +sudo apt-get update -y + +# installing libs +sudo apt-get install mono-complete -y +sudo apt install xorg xserver-xorg xinit cmake git -y +sudo apt-get install --reinstall libgtk2.0-0 -y +sudo apt-get install paplay -y + + +# setting correct perms +sudo chmod +rx /usr/share/d3m0n +sudo chmod +rx /usr/share/d3m0n/* +sudo chmod +rx /usr/share/d3m0n/display/* +sudo chmod +rx /usr/share/d3m0n/apps/* +sudo chmod +rx /usr/share/d3m0n/ssh +sudo chmod +rx /usr/share/d3m0n/ssh/* + + + +# creating display driver +sudo mkdir /usr/share/d3m0n/display/source +cd /usr/share/d3m0n/display/source +sudo git clone https://github.com/juj/fbcp-ili9341.git +cd fbcp-ili9341 +sudo mkdir build +cd build +sudo cmake ../ -DILI9341=ON -DDISPLAY_ROTATE_180_DEGREES=ON -DGPIO_TFT_DATA_CONTROL=24 -DGPIO_TFT_RESET_PIN=25 -DSPI_BUS_CLOCK_DIVISOR=6 -DSTATISTICS=0 +sudo make -j +sudo cp ./fbcp-ili9341 /usr/share/d3m0n/display/fbcp-ili9341 + +cd ~ + +# formating boot config file +sudo rm -rf /boot/config.txt + +sudo echo "# For more options and information see +# http://rpf.io/configtxt +# Some settings may impact device functionality. See link above for details + +# uncomment if you get no picture on HDMI for a default safe mode +#hdmi_safe=1 + +# uncomment the following to adjust overscan. Use positive numbers if console +# goes off screen, and negative if there is too much border +#overscan_left=16 +#overscan_right=16 +#overscan_top=16 +#overscan_bottom=16 + +# uncomment to force a console size. By default it will be display's size minus +# overscan. +#framebuffer_width=1280 +#framebuffer_height=720 + +# uncomment if hdmi display is not detected and composite is being output +hdmi_force_hotplug=1 +display_lcd_rotate=1 +display_hdmi_rotate=1 +# uncomment to force a specific HDMI mode (this will force VGA) +#hdmi_group=1 +#hdmi_mode=1 + +# uncomment to force a HDMI mode rather than DVI. This can make audio work in +# DMT (computer monitor) modes +#hdmi_drive=2 + +# uncomment to increase signal to HDMI, if you have interference, blanking, or +# no display +#config_hdmi_boost=4 + +# uncomment for composite PAL +#sdtv_mode=2 + +#uncomment to overclock the arm. 700 MHz is the default. +#arm_freq=800 + +# Uncomment some or all of these to enable the optional hardware interfaces +dtparam=i2c_arm=on +#dtparam=i2s=on +dtparam=spi=on + +# Uncomment this to enable infrared communication. +#dtoverlay=gpio-ir,gpio_pin=17 +#dtoverlay=gpio-ir-tx,gpio_pin=18 + +# Additional overlays and parameters are documented /boot/overlays/README + +# Enable audio (loads snd_bcm2835) +dtparam=audio=on + +# Automatically load overlays for detected cameras +start_x=1 + +# Automatically load overlays for detected DSI displays +display_auto_detect=1 + +# Enable DRM VC4 V3D driver +#dtoverlay=vc4-kms-v3d +max_framebuffers=2 + +# Disable compensation for displays with overscan +disable_overscan=1 + +[cm4] +# Enable host mode on the 2711 built-in XHCI USB controller. +# This line should be removed if the legacy DWC2 controller is required +# (e.g. for USB device mode) or if USB support is not required. +otg_mode=1 + +[all] + +[pi4] +dtoverlay=vc4-fkms-v3d +# Run as fast as firmware / board allows +arm_boost=1 + +[all] +#framebuffer_width=240 +#framebuffer_height=320 +hdmi_cvt=480 640 60 2 1 +hdmi_group=2 +hdmi_mode=87 +hdmi_drive=2 +gpu_mem=128 + +# power optimisation +dtparam=act_led_trigger=none +dtparam=act_led_activelow=on +dtoverlay=disable-bt + +# enable serial communication +enable_uart=1 +dtoverlay=pi3-miniuart-bt" > /boot/config.txt + +# also delete this console=serial0, 115200 in /boot/cmdline.txt + + + + + +sudo rm -rf /etc/rc.local + +echo "#!/bin/sh -e +# +# rc.local +# +# This script is executed at the end of each multiuser runlevel. +# Make sure that the script will "exit 0" on success or any other +# value on error. +# +# In order to enable or disable this script just change the execution +# bits. +# +# By default this script does nothing. + +sudo bash /usr/share/d3m0n/startup.sh & + +exit 0" > /etc/rc.local + +sudo chmod +x /etc/rc.local + + +echo "Banner /usr/share/d3m0n/ssh/banner" >> /etc/ssh/sshd_config + + + +# enable autologin +cat > /etc/systemd/system/getty@tty1.service.d/autologin.conf << EOF +[Service] +ExecStart= +ExecStart=-/sbin/agetty --autologin $USER --noclear %I \$TERM +EOF + + +sudo reboot now exit 0 \ No newline at end of file diff --git a/rootfs/usr/share/d3m0n/ssh/banner b/rootfs/usr/share/d3m0n/ssh/banner index e89b8304..36da244e 100644 --- a/rootfs/usr/share/d3m0n/ssh/banner +++ b/rootfs/usr/share/d3m0n/ssh/banner @@ -1,9 +1,9 @@ - \e[33m██████╗ ██████╗ ███╗ ███╗ ██████╗ ███╗ ██╗ + ██████╗ ██████╗ ███╗ ███╗ ██████╗ ███╗ ██╗ ██╔══██╗╚════██╗████╗ ████║██╔═████╗████╗ ██║ - ██║ ██║ █████╔╝██╔████╔██║██║██╔██║██╔██╗ ██║ - ██║ ██║ ╚═══██╗██║╚██╔╝██║████╔╝██║██║╚██╗██║ + ██║ ██║ █████╔╝ ██╔████╔██║██║██╔██║██╔██╗ ██║ + ██║ ██║ ╚═══██╗ ██║╚██╔╝██║████╔╝██║██║╚██╗██║ ██████╔╝██████╔╝██║ ╚═╝ ██║╚██████╔╝██║ ╚████║ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝ - \e[31mmade by \e[32m4re5 group - \e[4;31mthe first hacking cellular phone\e[0m + made by 4re5 group + the first hacking cellular phone diff --git a/rootfs/usr/share/d3m0n/startup.sh b/rootfs/usr/share/d3m0n/startup.sh index c95c08df..c5f3c0bd 100644 --- a/rootfs/usr/share/d3m0n/startup.sh +++ b/rootfs/usr/share/d3m0n/startup.sh @@ -1,18 +1,51 @@ #!/bin/bash # d3m0n_os startup object (executed in /etc/rc.local) -xrandr --output Screen1 --mode 640x480 +# optimize d3m0n phone +# ref https://www.cnx-software.com/2021/12/09/raspberry-pi-zero-2-w-power-consumption/ +echo none | sudo tee /sys/class/leds/led0/trigger +echo 1 | sudo tee /sys/class/leds/led0/brightness +# setup display +sudo xinit & +export DISPLAY=:0 + +# xrandr --output default --mode 640x480 + +# setup TFT screen driver +sudo bash /usr/share/d3m0n/display/run.sh & + +# display infos on tty1 printf "\n" printf "\n" printf "[ \033[0;32mOK\033[0m ] d3m0n started successfully\n" + +# print IP address +_IP=$(hostname -I) || true +if [ "$_IP" ]; then + printf "Current IP address is %s\n" "$_IP" +fi +print "\n" printf "\n" printf "\n" +# display image +# sudo fbi -d /dev/fb0 -T 1 --fitwidth --noverbose splash.png + +# manually setup command +# sudo apt install p7zip-full -y && wget 192.168.43.89:8000/d3m0n.7z && sudo 7z x -r -aoa d3m0n.7z -o/usr/share/d3m0n && sudo bash /usr/share/d3m0n/firstboot.sh + +# sudo X -nocursor -s 0 -dpms& +export DISPLAY=:0 +sudo mono /usr/share/d3m0n/apps/d3m0n.exe& + + +# sudo xvfb-run -n 0 -s "-screen 0 480x640x16" sudo mono /usr/share/d3m0n/apps/d3m0n.exe +# sudo xvfb-run --auto-servernum --server-num=1 sudo mono d3m0n.exe & -bash /usr/share/d3m0n/display/run.sh -mono /usr/share/d3m0n/apps/d3m0n.exe +# screenshot sudo xwd -display :0 -root -silent | convert xwd:- png:/tmp/screenshot.png +# display build cmake ../ -DILI9341=ON -DGPIO_TFT_DATA_CONTROL=24 -DGPIO_TFT_RESET_PIN=25 -DSPI_BUS_CLOCK_DIVISOR=6 -DSTATISTICS=number exit 0 \ No newline at end of file diff --git a/rootfs/usr/share/d3m0n/temp/5vsvcZFR5R3XXBpsy9xn/app b/rootfs/usr/share/d3m0n/temp/5vsvcZFR5R3XXBpsy9xn/app new file mode 100644 index 00000000..859883ed --- /dev/null +++ b/rootfs/usr/share/d3m0n/temp/5vsvcZFR5R3XXBpsy9xn/app @@ -0,0 +1,6 @@ +name: testapp +package: com.4re5.d3m0n.test +icon: default +perms: none +start_path: /path/to +category: test \ No newline at end of file diff --git a/rootfs/usr/share/d3m0n/temp/5vsvcZFR5R3XXBpsy9xn/defs/file.write b/rootfs/usr/share/d3m0n/temp/5vsvcZFR5R3XXBpsy9xn/defs/file.write new file mode 100644 index 00000000..f9f6cf34 --- /dev/null +++ b/rootfs/usr/share/d3m0n/temp/5vsvcZFR5R3XXBpsy9xn/defs/file.write @@ -0,0 +1,4 @@ + + logn("let's goooo", "red"); + lol="lol"; + logn("lol is equal to: $lol", "green");}; \ No newline at end of file diff --git a/rootfs/usr/share/d3m0n/temp/5vsvcZFR5R3XXBpsy9xn/layouts/main.layout b/rootfs/usr/share/d3m0n/temp/5vsvcZFR5R3XXBpsy9xn/layouts/main.layout new file mode 100644 index 00000000..5299b945 --- /dev/null +++ b/rootfs/usr/share/d3m0n/temp/5vsvcZFR5R3XXBpsy9xn/layouts/main.layout @@ -0,0 +1,3 @@ +# d3m0n layout + +Window: width="100%"; height="100%"; title="test"; bg_color="orange"; topbar="false"; \ No newline at end of file diff --git "a/rootfs/usr/share/d3m0n/temp/5vsvcZFR5R3XXBpsy9xn/ressources/icons8-cercle-64.png\357\200\272Zone.Identifier" "b/rootfs/usr/share/d3m0n/temp/5vsvcZFR5R3XXBpsy9xn/ressources/icons8-cercle-64.png\357\200\272Zone.Identifier" new file mode 100644 index 00000000..053d1127 --- /dev/null +++ "b/rootfs/usr/share/d3m0n/temp/5vsvcZFR5R3XXBpsy9xn/ressources/icons8-cercle-64.png\357\200\272Zone.Identifier" @@ -0,0 +1,3 @@ +[ZoneTransfer] +ZoneId=3 +HostUrl=about:internet diff --git a/rootfs/usr/share/d3m0n/temp/5vsvcZFR5R3XXBpsy9xn/ressources/shoot.png b/rootfs/usr/share/d3m0n/temp/5vsvcZFR5R3XXBpsy9xn/ressources/shoot.png new file mode 100644 index 00000000..28ff8cc1 Binary files /dev/null and b/rootfs/usr/share/d3m0n/temp/5vsvcZFR5R3XXBpsy9xn/ressources/shoot.png differ diff --git a/rootfs/usr/share/d3m0n/temp/5vsvcZFR5R3XXBpsy9xn/ressources/test.cs b/rootfs/usr/share/d3m0n/temp/5vsvcZFR5R3XXBpsy9xn/ressources/test.cs new file mode 100644 index 00000000..68e2e6fc --- /dev/null +++ b/rootfs/usr/share/d3m0n/temp/5vsvcZFR5R3XXBpsy9xn/ressources/test.cs @@ -0,0 +1,13 @@ +using System; +using System.Windows.Forms; + +namespace myNamespace +{ + public class myclass + { + public static void myFunct(string text, int integ) + { + MessageBox.Show(text+(50+integ).ToString()); + } + } +} \ No newline at end of file diff --git a/rootfs/usr/share/d3m0n/temp/5vsvcZFR5R3XXBpsy9xn/ressources/test.dll b/rootfs/usr/share/d3m0n/temp/5vsvcZFR5R3XXBpsy9xn/ressources/test.dll new file mode 100644 index 00000000..cb94666a Binary files /dev/null and b/rootfs/usr/share/d3m0n/temp/5vsvcZFR5R3XXBpsy9xn/ressources/test.dll differ diff --git a/rootfs/usr/share/d3m0n/temp/5vsvcZFR5R3XXBpsy9xn/src/events/main.src/Window.OnCreate b/rootfs/usr/share/d3m0n/temp/5vsvcZFR5R3XXBpsy9xn/src/events/main.src/Window.OnCreate new file mode 100644 index 00000000..2aabca9b --- /dev/null +++ b/rootfs/usr/share/d3m0n/temp/5vsvcZFR5R3XXBpsy9xn/src/events/main.src/Window.OnCreate @@ -0,0 +1 @@ + logn("[o] loaded test", "orange"); SystemDef(); \ No newline at end of file diff --git a/rootfs/usr/share/d3m0n/temp/5vsvcZFR5R3XXBpsy9xn/src/events/main.src/shoot.OnClick b/rootfs/usr/share/d3m0n/temp/5vsvcZFR5R3XXBpsy9xn/src/events/main.src/shoot.OnClick new file mode 100644 index 00000000..ff778ba9 --- /dev/null +++ b/rootfs/usr/share/d3m0n/temp/5vsvcZFR5R3XXBpsy9xn/src/events/main.src/shoot.OnClick @@ -0,0 +1 @@ + alert("hello world! you've clicked shoot"); \ No newline at end of file diff --git a/rootfs/usr/share/d3m0n/temp/5vsvcZFR5R3XXBpsy9xn/src/main.src b/rootfs/usr/share/d3m0n/temp/5vsvcZFR5R3XXBpsy9xn/src/main.src new file mode 100644 index 00000000..a0fd3c9b --- /dev/null +++ b/rootfs/usr/share/d3m0n/temp/5vsvcZFR5R3XXBpsy9xn/src/main.src @@ -0,0 +1,6 @@ +# d3m0n source + +Window.OnCreate => logn("[o] loaded test", "orange"); SystemDef(); +# [$ressources/test.dll,myNamespace,myclass,myFunct(a, b)]; + +shoot.OnClick => alert("hello world! you've clicked shoot"); \ No newline at end of file diff --git a/rootfs/usr/share/d3m0n/temp/5vsvcZFR5R3XXBpsy9xn/src/test.src b/rootfs/usr/share/d3m0n/temp/5vsvcZFR5R3XXBpsy9xn/src/test.src new file mode 100644 index 00000000..55d02811 --- /dev/null +++ b/rootfs/usr/share/d3m0n/temp/5vsvcZFR5R3XXBpsy9xn/src/test.src @@ -0,0 +1 @@ +def myfunc{ logn("let's goooo", "red"); lol="lol"; logn("lol is equal to: $lol", "green");} \ No newline at end of file diff --git a/rootfs/usr/share/d3m0n/temp/RH6jjizJkHNTnXctu07j/app b/rootfs/usr/share/d3m0n/temp/RH6jjizJkHNTnXctu07j/app new file mode 100644 index 00000000..5de94d4c --- /dev/null +++ b/rootfs/usr/share/d3m0n/temp/RH6jjizJkHNTnXctu07j/app @@ -0,0 +1,6 @@ +name: contacts +package: com.4re5.d3m0n.contacts +icon: contacts +perms: none +start_path: /path/to +category: communication \ No newline at end of file diff --git a/rootfs/usr/share/d3m0n/temp/RH6jjizJkHNTnXctu07j/src/main.src b/rootfs/usr/share/d3m0n/temp/RH6jjizJkHNTnXctu07j/src/main.src new file mode 100644 index 00000000..6ec7d334 --- /dev/null +++ b/rootfs/usr/share/d3m0n/temp/RH6jjizJkHNTnXctu07j/src/main.src @@ -0,0 +1,3 @@ +# d3m0n source + +Window.OnCreate => logn("[o] loaded contacts", "orange"); \ No newline at end of file diff --git a/rootfs/usr/share/d3m0n/temp/dbriFvAP5ythkgSXHhde/README.txt b/rootfs/usr/share/d3m0n/temp/dbriFvAP5ythkgSXHhde/README.txt new file mode 100644 index 00000000..d1af0107 --- /dev/null +++ b/rootfs/usr/share/d3m0n/temp/dbriFvAP5ythkgSXHhde/README.txt @@ -0,0 +1,16 @@ +# official d3m0n photo app + +test command +sudo raspistill -o test.jpg -w 480 -h 640 -q 100 -t 1 -n +-n = no preview +-t = preview timout +-o = output +-w = width +-h = height + +Can overlay preview on top of photo app? +-p = Preview window settings <'x,y,w,h'> + + +# video +raspivid -o Desktop/video.h264 \ No newline at end of file diff --git a/rootfs/usr/share/d3m0n/temp/dbriFvAP5ythkgSXHhde/app b/rootfs/usr/share/d3m0n/temp/dbriFvAP5ythkgSXHhde/app new file mode 100644 index 00000000..eaf69c0c --- /dev/null +++ b/rootfs/usr/share/d3m0n/temp/dbriFvAP5ythkgSXHhde/app @@ -0,0 +1,6 @@ +name: camera +package: com.4re5.d3m0n.camera +icon: camera +perms: sudo +start_path: /path/to +category: photo \ No newline at end of file diff --git a/rootfs/usr/share/d3m0n/temp/dbriFvAP5ythkgSXHhde/layouts/main.layout b/rootfs/usr/share/d3m0n/temp/dbriFvAP5ythkgSXHhde/layouts/main.layout new file mode 100644 index 00000000..4494845c --- /dev/null +++ b/rootfs/usr/share/d3m0n/temp/dbriFvAP5ythkgSXHhde/layouts/main.layout @@ -0,0 +1,9 @@ +# d3m0n layout + +Window: width="100%"; height="100%"; title="camera"; bg_color="black"; topbar="false"; + +Image: name="shoot"; src="$ressources/shoot.png"; width="50"; height="50"; position="bottom"; margin_bottom="10"; bg_color="25, 25, 25"; mode="stretch"; + +Rect: name="camera_bg"; bg_color="black"; width="100%"; height="73%"; + +Rect: name="camera_shoot"; bg_color="25, 25, 25"; width="100%"; position="bottom"; height="27%"; \ No newline at end of file diff --git a/rootfs/usr/share/d3m0n/temp/dbriFvAP5ythkgSXHhde/layouts/test.layout b/rootfs/usr/share/d3m0n/temp/dbriFvAP5ythkgSXHhde/layouts/test.layout new file mode 100644 index 00000000..1e941bfa --- /dev/null +++ b/rootfs/usr/share/d3m0n/temp/dbriFvAP5ythkgSXHhde/layouts/test.layout @@ -0,0 +1,5 @@ +# d3m0n layout + +Window: width="100%"; height="100%"; bg_color="lime"; name="TestWindow"; + +Text: name="my Text :p"; color="orange"; position="50, 50"; \ No newline at end of file diff --git "a/rootfs/usr/share/d3m0n/temp/dbriFvAP5ythkgSXHhde/ressources/icons8-cercle-64.png\357\200\272Zone.Identifier" "b/rootfs/usr/share/d3m0n/temp/dbriFvAP5ythkgSXHhde/ressources/icons8-cercle-64.png\357\200\272Zone.Identifier" new file mode 100644 index 00000000..053d1127 --- /dev/null +++ "b/rootfs/usr/share/d3m0n/temp/dbriFvAP5ythkgSXHhde/ressources/icons8-cercle-64.png\357\200\272Zone.Identifier" @@ -0,0 +1,3 @@ +[ZoneTransfer] +ZoneId=3 +HostUrl=about:internet diff --git a/rootfs/usr/share/d3m0n/temp/dbriFvAP5ythkgSXHhde/ressources/shoot.png b/rootfs/usr/share/d3m0n/temp/dbriFvAP5ythkgSXHhde/ressources/shoot.png new file mode 100644 index 00000000..28ff8cc1 Binary files /dev/null and b/rootfs/usr/share/d3m0n/temp/dbriFvAP5ythkgSXHhde/ressources/shoot.png differ diff --git a/rootfs/usr/share/d3m0n/temp/dbriFvAP5ythkgSXHhde/ressources/test.dll b/rootfs/usr/share/d3m0n/temp/dbriFvAP5ythkgSXHhde/ressources/test.dll new file mode 100644 index 00000000..ccc6053a Binary files /dev/null and b/rootfs/usr/share/d3m0n/temp/dbriFvAP5ythkgSXHhde/ressources/test.dll differ diff --git a/rootfs/usr/share/d3m0n/temp/dbriFvAP5ythkgSXHhde/src/main.src b/rootfs/usr/share/d3m0n/temp/dbriFvAP5ythkgSXHhde/src/main.src new file mode 100644 index 00000000..c21a6265 --- /dev/null +++ b/rootfs/usr/share/d3m0n/temp/dbriFvAP5ythkgSXHhde/src/main.src @@ -0,0 +1,5 @@ +# d3m0n source + +Window.OnCreate => logn("[o] loaded camera", "orange"); + +shoot.OnClick => display($layouts/test.layout); alert("hello world! you've clicked shoot"); \ No newline at end of file diff --git a/rootfs/usr/share/d3m0n/temp/dbriFvAP5ythkgSXHhde/src/test.src b/rootfs/usr/share/d3m0n/temp/dbriFvAP5ythkgSXHhde/src/test.src new file mode 100644 index 00000000..55d02811 --- /dev/null +++ b/rootfs/usr/share/d3m0n/temp/dbriFvAP5ythkgSXHhde/src/test.src @@ -0,0 +1 @@ +def myfunc{ logn("let's goooo", "red"); lol="lol"; logn("lol is equal to: $lol", "green");} \ No newline at end of file diff --git a/rootfs/usr/share/d3m0n/temp/l7xZ80s2mkSzP95oPwvo/app b/rootfs/usr/share/d3m0n/temp/l7xZ80s2mkSzP95oPwvo/app new file mode 100644 index 00000000..be08838e --- /dev/null +++ b/rootfs/usr/share/d3m0n/temp/l7xZ80s2mkSzP95oPwvo/app @@ -0,0 +1,6 @@ +name: messages +package: com.4re5.d3m0n.messages +icon: messages +perms: none +start_path: /path/to +category: communication \ No newline at end of file diff --git a/rootfs/usr/share/d3m0n/temp/l7xZ80s2mkSzP95oPwvo/layouts/main.layout b/rootfs/usr/share/d3m0n/temp/l7xZ80s2mkSzP95oPwvo/layouts/main.layout new file mode 100644 index 00000000..590cccc0 --- /dev/null +++ b/rootfs/usr/share/d3m0n/temp/l7xZ80s2mkSzP95oPwvo/layouts/main.layout @@ -0,0 +1,5 @@ +# d3m0n layout + +Window: width="100%"; height="100%"; title="gallery"; bg_color="white"; topbar="true"; + +Text: content="Soon..."; pisition="center"; color="red"; \ No newline at end of file diff --git a/rootfs/usr/share/d3m0n/temp/l7xZ80s2mkSzP95oPwvo/src/main.src b/rootfs/usr/share/d3m0n/temp/l7xZ80s2mkSzP95oPwvo/src/main.src new file mode 100644 index 00000000..616ee3bf --- /dev/null +++ b/rootfs/usr/share/d3m0n/temp/l7xZ80s2mkSzP95oPwvo/src/main.src @@ -0,0 +1,3 @@ +# d3m0n source + +Window.OnCreate => logn("[o] loaded messages", "orange"); \ No newline at end of file diff --git a/rootfs/usr/share/d3m0n/temp/qRQ59Yi7UVHUxnqROOWJ/app b/rootfs/usr/share/d3m0n/temp/qRQ59Yi7UVHUxnqROOWJ/app new file mode 100644 index 00000000..f360d8e7 --- /dev/null +++ b/rootfs/usr/share/d3m0n/temp/qRQ59Yi7UVHUxnqROOWJ/app @@ -0,0 +1,6 @@ +name: phone +package: com.4re5.d3m0n.phone +icon: phone +perms: none +start_path: /path/to +category: communication \ No newline at end of file diff --git a/rootfs/usr/share/d3m0n/temp/qRQ59Yi7UVHUxnqROOWJ/layouts/main.layout b/rootfs/usr/share/d3m0n/temp/qRQ59Yi7UVHUxnqROOWJ/layouts/main.layout new file mode 100644 index 00000000..590cccc0 --- /dev/null +++ b/rootfs/usr/share/d3m0n/temp/qRQ59Yi7UVHUxnqROOWJ/layouts/main.layout @@ -0,0 +1,5 @@ +# d3m0n layout + +Window: width="100%"; height="100%"; title="gallery"; bg_color="white"; topbar="true"; + +Text: content="Soon..."; pisition="center"; color="red"; \ No newline at end of file diff --git a/rootfs/usr/share/d3m0n/temp/qRQ59Yi7UVHUxnqROOWJ/src/main.src b/rootfs/usr/share/d3m0n/temp/qRQ59Yi7UVHUxnqROOWJ/src/main.src new file mode 100644 index 00000000..508a6ae2 --- /dev/null +++ b/rootfs/usr/share/d3m0n/temp/qRQ59Yi7UVHUxnqROOWJ/src/main.src @@ -0,0 +1,3 @@ +# d3m0n source + +Window.OnCreate => logn("[o] loaded phone", "orange"); \ No newline at end of file diff --git a/rootfs/usr/share/d3m0n/testing/AT_tester.cs b/rootfs/usr/share/d3m0n/testing/AT_tester.cs new file mode 100644 index 00000000..5c283d39 --- /dev/null +++ b/rootfs/usr/share/d3m0n/testing/AT_tester.cs @@ -0,0 +1,207 @@ +// set pin +// AT+CPIN=“2608“ + + +// +COPS: , +// +// 0 automatic +// 1 manual +// 2 de-register from network +// 4 manual/automatic +// +// 0 long alphanumeric format +// 1 short alphanumeric format +// 2 numeric format + + + + + + + + + + +using System; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using System.IO.Ports; + +class Program +{ + static SerialPort Serial1; + + private static string inputstring = ""; + private static string lastCommand = ""; + + private static bool upperCaseStatus = false; //keep tracks of whether incoming string needs to be converted to upper case + + private static string portName = "/dev/ttyAMA0"; + private static int baudRate = 115200; + + public static void Main(string[] args) { + Serial1 = new SerialPort(portName, baudRate); + + Thread.Sleep(5000); + + Console.WriteLine(); + Console.WriteLine("## GA6 GSM Module - AT Tester ##"); + Console.WriteLine("--------------------------------"); + Console.WriteLine(); + Console.WriteLine("-- Usage --"); + Console.WriteLine(); + Console.WriteLine("Start AT commands with \"at\" or \"AT\" ( is automatically appended)"); + Console.WriteLine("Use \">\" shorthand for \"AT+\" (eg. \">CREG?\")"); + Console.WriteLine("Start string with \"$\" (eg. \"$message\")"); + Console.WriteLine("Start decimal number with \"#d\" or \"#D\" (eg. \"#D42\")"); + Console.WriteLine("Start hex number with \"#h\" or \"#H\" (eg. \"#H42\")"); + Console.WriteLine("Send carriage return with \"\" or \"\""); + Console.WriteLine("Send newline with \"\" or \"\""); + Console.WriteLine("Start custom commands with \"/\" (eg. \"/command\")"); + Console.WriteLine(); + Thread.Sleep(1000); + + while(true) + { + inputstring = Console.ReadLine(); //read the contents of serial buffer as string + Console.WriteLine(); + Console.Write("-- Input ("); + Console.Write(inputstring.length()); + Console.WriteLine(") --"); + + lastCommand = inputstring; //just a backup of the original string + + //----------------------------------------------------------------// + //custom commands + + if(inputstring.StartsWith("/")) { //allows you to send non-AT commands + Console.WriteLine(inputstring+" let's go"); + processCustomCmd(); + } + + //----------------------------------------------------------------// + //send a number as hex + + else if(inputstring.StartsWith("#H") || inputstring.StartsWith("#h")) { //allows you to send hex value + Console.WriteLine(inputstring); + string Substring = inputstring.Substring(2); //remove "#h" part + byte[] hexstring = Encoding.ASCII.GetBytes(Substring); //convert string object to byte array + var intNumber = BitConverter.ToInt32(hexstring, 16); // convert Byte[] to int + Serial1.Write(intNumber); //can only write values between 0-255 + } + + //----------------------------------------------------------------// + //send a number as dec + + else if(inputstring.StartsWith("#D") || inputstring.StartsWith("#d")) { //allows you to send dec value + Console.WriteLine(inputstring); + string Substring = inputstring.Substring(2); //remove "#h" part + var intNumber = Substring.toInt(); + Serial1.Write(intNumber); //can only write values between 0-255 + } + + //----------------------------------------------------------------// + //send the CR character + + else if(inputstring.StartsWith("") || inputstring.StartsWith("")) { //allows you to send dec value + Serial1.Write(0xD); //can only write values between 0-255 + } + + //----------------------------------------------------------------// + //send the line feed or newline charcater + + else if(inputstring.StartsWith("") || inputstring.StartsWith("")) { //allows you to send dec value + Serial1.Write(0xA); //can only write values between 0-255 + } + + //----------------------------------------------------------------// + //sends out a string without '$' or CR, LF characters + + else if(inputstring.StartsWith("$")) { //allows you to send text + Console.WriteLine(inputstring); + string Substring = inputstring.Substring(1); //remove the $ char + Serial1.Write(Substring); + upperCaseStatus = false; + } + + //----------------------------------------------------------------// + //at command + + else if(inputstring.StartsWith("at") || inputstring.StartsWith("AT")){ + inputstring.ToUpper(); + Console.WriteLine("AT command: "+inputstring); + + Serial1.Write(inputstring); + Serial1.Write(0xD); //carriage return : important --> \r + Serial1.Write(0xA); //newline --> \n + upperCaseStatus = true; + } + + //----------------------------------------------------------------// + //at command + + else if(inputstring.StartsWith(">")){ + inputstring = "AT+" + inputstring.Substring(1); + inputstring.ToUpper(); + Console.WriteLine(inputstring); + + Serial1.Write(inputstring); + Serial1.Write(0xD); //carriage return : important + // Serial1.Write(0xA); //newline + upperCaseStatus = true; + } + + //----------------------------------------------------------------// + } + + listenToGsm(upperCaseStatus); + } + + //================================================================// + //custom commands start with "/" + + public static void processCustomCmd() { + //add your custom command handles below + Console.WriteLine("inputstring: '"+inputstring+"'"); + if(inputstring.StartsWith("/send sms")) { + Console.WriteLine(); + Console.WriteLine("-- Input --"); + Console.WriteLine("AT+CMGF=1"); + Serial1.WriteLine("AT+CMGF=1"); //access text mode + Thread.Sleep(500); + listenToGsm(true); //we must wait after each command + Console.WriteLine(); + Console.WriteLine("-- Input --"); + Console.WriteLine("AT+CMGS=\"+33687476125\""); + Serial1.WriteLine("AT+CMGS=\"+33687476125\""); //set phone number + Thread.Sleep(500); + listenToGsm(true); + Console.WriteLine(); + Console.WriteLine("-- Input --"); + Console.WriteLine("Je t'aime papa ❤"); + Console.WriteLine("\n"); + Serial1.Write("Je t'aime papa ❤"); //sms content + Serial1.Write(26); //substitute char to end message + Thread.Sleep(500); + listenToGsm(false); //wait for the confirmation + Console.WriteLine(""); + } + } + + //================================================================// + //listen to GSM module port + + public static void listenToGsm(bool ToUpper) { + if(Serial1.IsOpen()) { //monitor the serial 1 interface + inputstring = Serial1.ReadLine(); //read the contents of serial buffer as string + Console.WriteLine(); + Console.Write("-- Response ("); + Console.Write(inputstring.length()); + Console.WriteLine(") --"); + if(ToUpper) + inputstring.ToUpper(); + Console.Write(inputstring); + } + } +} \ No newline at end of file diff --git a/rootfs/usr/share/d3m0n/testing/build.sh b/rootfs/usr/share/d3m0n/testing/build.sh new file mode 100644 index 00000000..6e97cc65 --- /dev/null +++ b/rootfs/usr/share/d3m0n/testing/build.sh @@ -0,0 +1,5 @@ +#!/usr/bin/bash + +mcs AT_tester.cs + +mono AT_tester.cs \ No newline at end of file diff --git a/rootfs/usr/share/d3m0n/themes/default_dark/icons/circle-selected.png b/rootfs/usr/share/d3m0n/themes/default_dark/icons/circle-selected.png new file mode 100644 index 00000000..9b6325ca Binary files /dev/null and b/rootfs/usr/share/d3m0n/themes/default_dark/icons/circle-selected.png differ diff --git a/rootfs/usr/share/d3m0n/themes/default_dark/icons/circle.png b/rootfs/usr/share/d3m0n/themes/default_dark/icons/circle.png new file mode 100644 index 00000000..470ce278 Binary files /dev/null and b/rootfs/usr/share/d3m0n/themes/default_dark/icons/circle.png differ diff --git a/rootfs/usr/share/d3m0n/themes/default_dark/icons/contacts.png b/rootfs/usr/share/d3m0n/themes/default_dark/icons/contacts.png new file mode 100644 index 00000000..142c1e36 Binary files /dev/null and b/rootfs/usr/share/d3m0n/themes/default_dark/icons/contacts.png differ diff --git "a/rootfs/usr/share/d3m0n/themes/default_dark/icons/contacts.png\357\200\272Zone.Identifier" "b/rootfs/usr/share/d3m0n/themes/default_dark/icons/contacts.png\357\200\272Zone.Identifier" new file mode 100644 index 00000000..053d1127 --- /dev/null +++ "b/rootfs/usr/share/d3m0n/themes/default_dark/icons/contacts.png\357\200\272Zone.Identifier" @@ -0,0 +1,3 @@ +[ZoneTransfer] +ZoneId=3 +HostUrl=about:internet diff --git "a/rootfs/usr/share/d3m0n/themes/default_dark/icons/icons8-cercle-plein-96 (1).png\357\200\272Zone.Identifier" "b/rootfs/usr/share/d3m0n/themes/default_dark/icons/icons8-cercle-plein-96 (1).png\357\200\272Zone.Identifier" new file mode 100644 index 00000000..053d1127 --- /dev/null +++ "b/rootfs/usr/share/d3m0n/themes/default_dark/icons/icons8-cercle-plein-96 (1).png\357\200\272Zone.Identifier" @@ -0,0 +1,3 @@ +[ZoneTransfer] +ZoneId=3 +HostUrl=about:internet diff --git "a/rootfs/usr/share/d3m0n/themes/default_dark/icons/icons8-cercle-plein-96.png\357\200\272Zone.Identifier" "b/rootfs/usr/share/d3m0n/themes/default_dark/icons/icons8-cercle-plein-96.png\357\200\272Zone.Identifier" new file mode 100644 index 00000000..053d1127 --- /dev/null +++ "b/rootfs/usr/share/d3m0n/themes/default_dark/icons/icons8-cercle-plein-96.png\357\200\272Zone.Identifier" @@ -0,0 +1,3 @@ +[ZoneTransfer] +ZoneId=3 +HostUrl=about:internet diff --git "a/rootfs/usr/share/d3m0n/themes/default_dark/icons/icons8-test-account-96.png\357\200\272Zone.Identifier" "b/rootfs/usr/share/d3m0n/themes/default_dark/icons/icons8-test-account-96.png\357\200\272Zone.Identifier" new file mode 100644 index 00000000..053d1127 --- /dev/null +++ "b/rootfs/usr/share/d3m0n/themes/default_dark/icons/icons8-test-account-96.png\357\200\272Zone.Identifier" @@ -0,0 +1,3 @@ +[ZoneTransfer] +ZoneId=3 +HostUrl=about:internet