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

Commit

Permalink
Merge pull request #114 from n0xa/develop
Browse files Browse the repository at this point in the history
Merge Develop Into Main
  • Loading branch information
n0xa committed Feb 25, 2024
2 parents 6049c64 + 7b5f52f commit cbe9523
Show file tree
Hide file tree
Showing 17 changed files with 723 additions and 114 deletions.
52 changes: 52 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
FROM python:3.6-slim

ENV PYTHONBUFFERED=1

# Install required packages and tools
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
bash \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

RUN curl -fsSL https://github.com/raw/arduino/arduino-cli/master/install.sh | BINDIR=/usr/bin sh

# Ensure pip is installed and upgrade it
RUN python3 -m ensurepip
RUN pip3 install --no-cache --upgrade pip setuptools pyserial esptool

# Install 32-bit C++ standard library
RUN apt-get update && apt-get install -y --no-install-recommends \
lib32stdc++6 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# Install m5stack boards
COPY ./package_m5stack_index.json /package_m5stack_index.json
RUN arduino-cli core install m5stack:esp32 --additional-urls "file:///package_m5stack_index.json" --log-level warn --verbose

RUN arduino-cli core search m5stack
RUN arduino-cli board listall
#
# Create a directory for the prerequisites script
RUN mkdir -p /deauth_prerequisites
COPY ./deauth_prerequisites/install_prerequisites_Linux.sh /deauth_prerequisites/install_prerequisites_linux.sh

# Make the script executable
RUN chmod +x /deauth_prerequisites/install_prerequisites_linux.sh

# Run the script
RUN /deauth_prerequisites/install_prerequisites_linux.sh

ARG LIBRARIES

# Install required libraries
RUN arduino-cli lib install $LIBRARIES --log-level warn --verbose

COPY ./scripts/compile.sh /compile.sh
RUN chmod +x /compile.sh

COPY ./scripts/entrypoint.sh ./entrypoint.sh
RUN chmod +x /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,32 @@ esptool.py --chip esp32s3 merge_bin --output final.bin 0x0000 m5stick-nemo.ino.b
esptool.exe write_flash -z 0 final.bin
```

## Building from Source (Docker)

- Install Docker
- Run `./scripts/docker-build.sh <configs/.env.>`
- Run `./scripts/flash.sh --device=<your-device-port>`

```sh
# This will build an image will all required libraries based on the configured platform, and it will compile, output and merge binaries
# By default this will compile for the M5Cardputer in en-us locale, ./config/.env.M5Cardputer
./scripts/docker-build.sh

# If you want to select a different build config you can pass it as a parameter. See ./configs/ for various configurations
./scripts/docker-build.sh ./config/.env.M5Cardputer

# Binary files will be output to ./build
ls ./build

# This will flash the build output from the build step, it reuses the container image from the previous step.
# By default this will compile for the M5Cardputer in en-us locale, ./config/.env.M5Cardputer
./scipts/flash.sh --device=/dev/ttyusb0

# If you passed a different build config make sure to pass it along to the flash script
./scipts/flash.sh --device=/dev/ttyusb0 --build-config=./config/.env.M5Cardputer
```



## Troubleshooting
* 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.
Expand Down
6 changes: 6 additions & 0 deletions configs/.env.M5Cardputer
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export LOCALE="en-us"
export NAME="M5Cardputer"
export FQBN="m5stack:esp32:m5stack_cardputer"
export EXTRA_FLAGS="-DCARDPUTER"
export LIBRARIES="M5Cardputer IRRemoteESP8266 M5Stack-SD-Updater M5Unified"
export BOOTLOADER_ADDR="0x0000"
6 changes: 6 additions & 0 deletions configs/.env.M5StickC
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export LOCALE="en-us"
export NAME="M5StickC"
export FQBN="m5stack:esp32:m5stack_stickc"
export EXTRA_FLAGS="-DSTICK_C"
export LIBRARIES="M5StickC@0.2.8 IRRemoteESP8266 M5Stack-SD-Updater M5Unified"
export BOOTLOADER_ADDR="0x1000"
6 changes: 6 additions & 0 deletions configs/.env.M5StickCPlus
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export LOCALE="en-us"
export NAME="M5StickCPlus"
export FQBN="m5stack:esp32:m5stack_stickc_plus"
export EXTRA_FLAGS="-DSTICK_C_PLUS"
export LIBRARIES="M5StickCPlus IRRemoteESP8266 M5Stack-SD-Updater M5Unified"
export BOOTLOADER_ADDR="0x1000"
6 changes: 6 additions & 0 deletions configs/.env.M5StickCPlus2
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export LOCALE="en-us"
export NAME="M5StickCPlus2"
export FQBN="m5stack:esp32:m5stack_stickc_plus2"
export EXTRA_FLAGS="-DSTICK_C_PLUS2"
export LIBRARIES="M5StickCPlus2 IRRemoteESP8266 M5Stack-SD-Updater M5Unified"
export BOOTLOADER_ADDR="0x1000"
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,51 +1,51 @@
@echo off
setlocal enabledelayedexpansion

set "baseFolder=%localappdata%\Arduino15\packages\m5stack\hardware\esp32"

rem Find the latest version of the folder
set "latestVersion="
for /d %%I in ("%baseFolder%\*") do (
set "latestVersion=%%~nxI"
)

if not defined latestVersion (
echo No version found.
pause
exit /b
)

rem Full path to the file to be edited
set "file=%baseFolder%\%latestVersion%\platform.txt"
set "backupFile=%baseFolder%\%latestVersion%\platform.txt.bkp"
set "prefix=build.extra_flags.esp32"
set "option= -w"

set "prefix2=compiler.c.elf.libs.esp32"
set "option2= -zmuldefs"

set "readyMark=##NEMO_DEAUTH_READY##"

rem Check if the ready mark already exists in the file
findstr /C:"%readyMark%" "%file%" >nul
if %errorlevel% equ 0 (
echo The file is already OK.
pause
exit /b
)

rem Create a backup copy of the original file
copy "%file%" "%backupFile%"

rem Use PowerShell to edit the file
powershell -Command "(Get-Content '%file%') | ForEach-Object { $_ -replace ('^(%prefix%.*?)$', '$1%option%') -replace ('^(%prefix2%.*?)$', '$1%option2%') } | Set-Content '%file%'"

rem Add the ready mark to the end of the file
echo %readyMark%>> "%file%"

rem Open the latest version of the folder in Windows Explorer
start explorer "%baseFolder%\%latestVersion%"

echo Done.
pause

@echo off
setlocal enabledelayedexpansion

set "baseFolder=%localappdata%\Arduino15\packages\m5stack\hardware\esp32"

rem Find the latest version of the folder
set "latestVersion="
for /d %%I in ("%baseFolder%\*") do (
set "latestVersion=%%~nxI"
)

if not defined latestVersion (
echo No version found.
pause
exit /b
)

rem Full path to the file to be edited
set "file=%baseFolder%\%latestVersion%\platform.txt"
set "backupFile=%baseFolder%\%latestVersion%\platform.txt.bkp"
set "prefix=build.extra_flags.esp32"
set "option= -w"

set "prefix2=compiler.c.elf.libs.esp32"
set "option2= -zmuldefs"

set "readyMark=##NEMO_DEAUTH_READY##"

rem Check if the ready mark already exists in the file
findstr /C:"%readyMark%" "%file%" >nul
if %errorlevel% equ 0 (
echo The file is already OK.
pause
exit /b
)

rem Create a backup copy of the original file
copy "%file%" "%backupFile%"

rem Use PowerShell to edit the file
powershell -Command "(Get-Content '%file%') | ForEach-Object { $_ -replace ('^(%prefix%.*?)$', '$1%option%') -replace ('^(%prefix2%.*?)$', '$1%option2%') } | Set-Content '%file%'"

rem Add the ready mark to the end of the file
echo %readyMark%>> "%file%"

rem Open the latest version of the folder in Windows Explorer
start explorer "%baseFolder%\%latestVersion%"

echo Done.
pause

Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
#!/bin/bash

#

baseFolder="$HOME/.arduino15/packages/m5stack/hardware/esp32"

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

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

# Open the latest version of the folder in Finder
open "$baseFolder/$latestVersion"

echo "Done."
read -p "Press Enter to exit."
48 changes: 47 additions & 1 deletion localization.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,29 @@
#define TXT_WFA_PORTAL "Clone Portal"
#define TXT_WFA_DEAUTH "Deauth attack"
#define TXT_WFA_COMBINED "Deauth+Clone"
#define TXT_BLACK "Black"
#define TXT_NAVY "Navy"
#define TXT_DARKGREEN "Dark Green"
#define TXT_DARKCYAN "Dark Cyan"
#define TXT_MAROON "Maroon"
#define TXT_PURPLE "Purple"
#define TXT_OLIVE "Olive"
#define TXT_LIGHTGREY "Light Grey"
#define TXT_DARKGREY "Dark Grey"
#define TXT_BLUE "Blue"
#define TXT_GREEN "Green"
#define TXT_CYAN "Cyan"
#define TXT_RED "Red"
#define TXT_MAGENTA "Magenta"
#define TXT_YELLOW "Yellow"
#define TXT_WHITE "White"
#define TXT_ORANGE "Orange"
#define TXT_GREENYELLOW "Green Yellow"
#define TXT_PINK "Pink"
#define TXT_COLOR "Custom Colors"
#define TXT_SET_FGCOLOR "MAIN COLOR"
#define TXT_SET_BGCOLOR "BACKGROUND COLOR"
#define TXT_THEME "Color Theme"
#endif

#if defined(LANGUAGE_PT_BR)
Expand Down Expand Up @@ -150,4 +173,27 @@
#define TXT_WFA_PORTAL "Clonar Portal"
#define TXT_WFA_DEAUTH "Ataque Deauth"
#define TXT_WFA_COMBINED "Deauth+Clone"
#endif
#define TXT_BLACK "Preto"
#define TXT_NAVY "Azul Escuro"
#define TXT_DARKGREEN "Verde Escuro"
#define TXT_DARKCYAN "Ciano Escuro"
#define TXT_MAROON "Vermelho Escuro"
#define TXT_PURPLE "Roxo"
#define TXT_OLIVE "Castanho"
#define TXT_LIGHTGREY "Cinzo Claro"
#define TXT_DARKGREY "Cinzo Escuro"
#define TXT_BLUE "Azul"
#define TXT_GREEN "Verde"
#define TXT_CYAN "Ciano"
#define TXT_RED "Vermelho"
#define TXT_MAGENTA "Magenta"
#define TXT_YELLOW "Amarelo"
#define TXT_WHITE "Branco"
#define TXT_ORANGE "Alaranjado"
#define TXT_GREENYELLOW "Verde Amarelo"
#define TXT_PINK "Rosa"
#define TXT_COLOR "Mudar Cores"
#define TXT_SET_FGCOLOR "COR PRINCIPAL"
#define TXT_SET_BGCOLOR "COR DE FUNDO"
#define TXT_THEME "Tema De Cores"
#endif
Loading

0 comments on commit cbe9523

Please sign in to comment.