Skip to content
This repository was archived by the owner on Aug 22, 2024. It is now read-only.

Commit cbe9523

Browse files
authored
Merge pull request #114 from n0xa/develop
Merge Develop Into Main
2 parents 6049c64 + 7b5f52f commit cbe9523

17 files changed

+723
-114
lines changed

Dockerfile

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
FROM python:3.6-slim
2+
3+
ENV PYTHONBUFFERED=1
4+
5+
# Install required packages and tools
6+
RUN apt-get update && apt-get install -y --no-install-recommends \
7+
curl \
8+
bash \
9+
&& apt-get clean \
10+
&& rm -rf /var/lib/apt/lists/*
11+
12+
RUN curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | BINDIR=/usr/bin sh
13+
14+
# Ensure pip is installed and upgrade it
15+
RUN python3 -m ensurepip
16+
RUN pip3 install --no-cache --upgrade pip setuptools pyserial esptool
17+
18+
# Install 32-bit C++ standard library
19+
RUN apt-get update && apt-get install -y --no-install-recommends \
20+
lib32stdc++6 \
21+
&& apt-get clean \
22+
&& rm -rf /var/lib/apt/lists/*
23+
24+
# Install m5stack boards
25+
COPY ./package_m5stack_index.json /package_m5stack_index.json
26+
RUN arduino-cli core install m5stack:esp32 --additional-urls "file:///package_m5stack_index.json" --log-level warn --verbose
27+
28+
RUN arduino-cli core search m5stack
29+
RUN arduino-cli board listall
30+
#
31+
# Create a directory for the prerequisites script
32+
RUN mkdir -p /deauth_prerequisites
33+
COPY ./deauth_prerequisites/install_prerequisites_Linux.sh /deauth_prerequisites/install_prerequisites_linux.sh
34+
35+
# Make the script executable
36+
RUN chmod +x /deauth_prerequisites/install_prerequisites_linux.sh
37+
38+
# Run the script
39+
RUN /deauth_prerequisites/install_prerequisites_linux.sh
40+
41+
ARG LIBRARIES
42+
43+
# Install required libraries
44+
RUN arduino-cli lib install $LIBRARIES --log-level warn --verbose
45+
46+
COPY ./scripts/compile.sh /compile.sh
47+
RUN chmod +x /compile.sh
48+
49+
COPY ./scripts/entrypoint.sh ./entrypoint.sh
50+
RUN chmod +x /entrypoint.sh
51+
52+
ENTRYPOINT ["/entrypoint.sh"]

README.md

+26
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,32 @@ esptool.py --chip esp32s3 merge_bin --output final.bin 0x0000 m5stick-nemo.ino.b
132132
esptool.exe write_flash -z 0 final.bin
133133
```
134134

135+
## Building from Source (Docker)
136+
137+
- Install Docker
138+
- Run `./scripts/docker-build.sh <configs/.env.>`
139+
- Run `./scripts/flash.sh --device=<your-device-port>`
140+
141+
```sh
142+
# This will build an image will all required libraries based on the configured platform, and it will compile, output and merge binaries
143+
# By default this will compile for the M5Cardputer in en-us locale, ./config/.env.M5Cardputer
144+
./scripts/docker-build.sh
145+
146+
# If you want to select a different build config you can pass it as a parameter. See ./configs/ for various configurations
147+
./scripts/docker-build.sh ./config/.env.M5Cardputer
148+
149+
# Binary files will be output to ./build
150+
ls ./build
151+
152+
# This will flash the build output from the build step, it reuses the container image from the previous step.
153+
# By default this will compile for the M5Cardputer in en-us locale, ./config/.env.M5Cardputer
154+
./scipts/flash.sh --device=/dev/ttyusb0
155+
156+
# If you passed a different build config make sure to pass it along to the flash script
157+
./scipts/flash.sh --device=/dev/ttyusb0 --build-config=./config/.env.M5Cardputer
158+
```
159+
160+
135161

136162
## Troubleshooting
137163
* Several features output debugging information to the serial monitor. Use the Serial Monitor feature in Arduino IDE or M5Burner to gather this information. It may have useful hints. When filing a bug report, it often helps to include serial monitor output.

configs/.env.M5Cardputer

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export LOCALE="en-us"
2+
export NAME="M5Cardputer"
3+
export FQBN="m5stack:esp32:m5stack_cardputer"
4+
export EXTRA_FLAGS="-DCARDPUTER"
5+
export LIBRARIES="M5Cardputer IRRemoteESP8266 M5Stack-SD-Updater M5Unified"
6+
export BOOTLOADER_ADDR="0x0000"

configs/.env.M5StickC

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export LOCALE="en-us"
2+
export NAME="M5StickC"
3+
export FQBN="m5stack:esp32:m5stack_stickc"
4+
export EXTRA_FLAGS="-DSTICK_C"
5+
export LIBRARIES="M5StickC@0.2.8 IRRemoteESP8266 M5Stack-SD-Updater M5Unified"
6+
export BOOTLOADER_ADDR="0x1000"

configs/.env.M5StickCPlus

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export LOCALE="en-us"
2+
export NAME="M5StickCPlus"
3+
export FQBN="m5stack:esp32:m5stack_stickc_plus"
4+
export EXTRA_FLAGS="-DSTICK_C_PLUS"
5+
export LIBRARIES="M5StickCPlus IRRemoteESP8266 M5Stack-SD-Updater M5Unified"
6+
export BOOTLOADER_ADDR="0x1000"

configs/.env.M5StickCPlus2

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export LOCALE="en-us"
2+
export NAME="M5StickCPlus2"
3+
export FQBN="m5stack:esp32:m5stack_stickc_plus2"
4+
export EXTRA_FLAGS="-DSTICK_C_PLUS2"
5+
export LIBRARIES="M5StickCPlus2 IRRemoteESP8266 M5Stack-SD-Updater M5Unified"
6+
export BOOTLOADER_ADDR="0x1000"
File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,51 @@
1-
@echo off
2-
setlocal enabledelayedexpansion
3-
4-
set "baseFolder=%localappdata%\Arduino15\packages\m5stack\hardware\esp32"
5-
6-
rem Find the latest version of the folder
7-
set "latestVersion="
8-
for /d %%I in ("%baseFolder%\*") do (
9-
set "latestVersion=%%~nxI"
10-
)
11-
12-
if not defined latestVersion (
13-
echo No version found.
14-
pause
15-
exit /b
16-
)
17-
18-
rem Full path to the file to be edited
19-
set "file=%baseFolder%\%latestVersion%\platform.txt"
20-
set "backupFile=%baseFolder%\%latestVersion%\platform.txt.bkp"
21-
set "prefix=build.extra_flags.esp32"
22-
set "option= -w"
23-
24-
set "prefix2=compiler.c.elf.libs.esp32"
25-
set "option2= -zmuldefs"
26-
27-
set "readyMark=##NEMO_DEAUTH_READY##"
28-
29-
rem Check if the ready mark already exists in the file
30-
findstr /C:"%readyMark%" "%file%" >nul
31-
if %errorlevel% equ 0 (
32-
echo The file is already OK.
33-
pause
34-
exit /b
35-
)
36-
37-
rem Create a backup copy of the original file
38-
copy "%file%" "%backupFile%"
39-
40-
rem Use PowerShell to edit the file
41-
powershell -Command "(Get-Content '%file%') | ForEach-Object { $_ -replace ('^(%prefix%.*?)$', '$1%option%') -replace ('^(%prefix2%.*?)$', '$1%option2%') } | Set-Content '%file%'"
42-
43-
rem Add the ready mark to the end of the file
44-
echo %readyMark%>> "%file%"
45-
46-
rem Open the latest version of the folder in Windows Explorer
47-
start explorer "%baseFolder%\%latestVersion%"
48-
49-
echo Done.
50-
pause
51-
1+
@echo off
2+
setlocal enabledelayedexpansion
3+
4+
set "baseFolder=%localappdata%\Arduino15\packages\m5stack\hardware\esp32"
5+
6+
rem Find the latest version of the folder
7+
set "latestVersion="
8+
for /d %%I in ("%baseFolder%\*") do (
9+
set "latestVersion=%%~nxI"
10+
)
11+
12+
if not defined latestVersion (
13+
echo No version found.
14+
pause
15+
exit /b
16+
)
17+
18+
rem Full path to the file to be edited
19+
set "file=%baseFolder%\%latestVersion%\platform.txt"
20+
set "backupFile=%baseFolder%\%latestVersion%\platform.txt.bkp"
21+
set "prefix=build.extra_flags.esp32"
22+
set "option= -w"
23+
24+
set "prefix2=compiler.c.elf.libs.esp32"
25+
set "option2= -zmuldefs"
26+
27+
set "readyMark=##NEMO_DEAUTH_READY##"
28+
29+
rem Check if the ready mark already exists in the file
30+
findstr /C:"%readyMark%" "%file%" >nul
31+
if %errorlevel% equ 0 (
32+
echo The file is already OK.
33+
pause
34+
exit /b
35+
)
36+
37+
rem Create a backup copy of the original file
38+
copy "%file%" "%backupFile%"
39+
40+
rem Use PowerShell to edit the file
41+
powershell -Command "(Get-Content '%file%') | ForEach-Object { $_ -replace ('^(%prefix%.*?)$', '$1%option%') -replace ('^(%prefix2%.*?)$', '$1%option2%') } | Set-Content '%file%'"
42+
43+
rem Add the ready mark to the end of the file
44+
echo %readyMark%>> "%file%"
45+
46+
rem Open the latest version of the folder in Windows Explorer
47+
start explorer "%baseFolder%\%latestVersion%"
48+
49+
echo Done.
50+
pause
51+

DEAUTH Prerequisites/install_prerequisites_Linux.sh deauth_prerequisites/install_prerequisites_Linux.sh

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
#!/bin/bash
22

3-
#
4-
53
baseFolder="$HOME/.arduino15/packages/m5stack/hardware/esp32"
64

75
# Find the latest version of the folder
8-
latestVersion=$(find "$baseFolder" -maxdepth 1 -type d -exec basename {} \; | sort -V | head -n 1)
6+
latestVersion=$(find "$baseFolder" -maxdepth 1 -type d -exec basename {} \; | sed '/esp32/d' | sort -V -r | head -n 1)
97

108
if [ -z "$latestVersion" ]; then
119
echo "No version found."
@@ -51,8 +49,4 @@ awk -v prefix="$prefix" -v option="$option" -v prefix2="$prefix2" -v option2="$o
5149
# Add the ready mark to the end of the file
5250
echo "$readyMark" >> "$file"
5351

54-
# Open the latest version of the folder in Finder
55-
open "$baseFolder/$latestVersion"
56-
5752
echo "Done."
58-
read -p "Press Enter to exit."

localization.h

+47-1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,29 @@
7373
#define TXT_WFA_PORTAL "Clone Portal"
7474
#define TXT_WFA_DEAUTH "Deauth attack"
7575
#define TXT_WFA_COMBINED "Deauth+Clone"
76+
#define TXT_BLACK "Black"
77+
#define TXT_NAVY "Navy"
78+
#define TXT_DARKGREEN "Dark Green"
79+
#define TXT_DARKCYAN "Dark Cyan"
80+
#define TXT_MAROON "Maroon"
81+
#define TXT_PURPLE "Purple"
82+
#define TXT_OLIVE "Olive"
83+
#define TXT_LIGHTGREY "Light Grey"
84+
#define TXT_DARKGREY "Dark Grey"
85+
#define TXT_BLUE "Blue"
86+
#define TXT_GREEN "Green"
87+
#define TXT_CYAN "Cyan"
88+
#define TXT_RED "Red"
89+
#define TXT_MAGENTA "Magenta"
90+
#define TXT_YELLOW "Yellow"
91+
#define TXT_WHITE "White"
92+
#define TXT_ORANGE "Orange"
93+
#define TXT_GREENYELLOW "Green Yellow"
94+
#define TXT_PINK "Pink"
95+
#define TXT_COLOR "Custom Colors"
96+
#define TXT_SET_FGCOLOR "MAIN COLOR"
97+
#define TXT_SET_BGCOLOR "BACKGROUND COLOR"
98+
#define TXT_THEME "Color Theme"
7699
#endif
77100

78101
#if defined(LANGUAGE_PT_BR)
@@ -150,4 +173,27 @@
150173
#define TXT_WFA_PORTAL "Clonar Portal"
151174
#define TXT_WFA_DEAUTH "Ataque Deauth"
152175
#define TXT_WFA_COMBINED "Deauth+Clone"
153-
#endif
176+
#define TXT_BLACK "Preto"
177+
#define TXT_NAVY "Azul Escuro"
178+
#define TXT_DARKGREEN "Verde Escuro"
179+
#define TXT_DARKCYAN "Ciano Escuro"
180+
#define TXT_MAROON "Vermelho Escuro"
181+
#define TXT_PURPLE "Roxo"
182+
#define TXT_OLIVE "Castanho"
183+
#define TXT_LIGHTGREY "Cinzo Claro"
184+
#define TXT_DARKGREY "Cinzo Escuro"
185+
#define TXT_BLUE "Azul"
186+
#define TXT_GREEN "Verde"
187+
#define TXT_CYAN "Ciano"
188+
#define TXT_RED "Vermelho"
189+
#define TXT_MAGENTA "Magenta"
190+
#define TXT_YELLOW "Amarelo"
191+
#define TXT_WHITE "Branco"
192+
#define TXT_ORANGE "Alaranjado"
193+
#define TXT_GREENYELLOW "Verde Amarelo"
194+
#define TXT_PINK "Rosa"
195+
#define TXT_COLOR "Mudar Cores"
196+
#define TXT_SET_FGCOLOR "COR PRINCIPAL"
197+
#define TXT_SET_BGCOLOR "COR DE FUNDO"
198+
#define TXT_THEME "Tema De Cores"
199+
#endif

0 commit comments

Comments
 (0)