Skip to content

Commit

Permalink
v0.2.7.14
Browse files Browse the repository at this point in the history
  • Loading branch information
Retr0Kr0dy authored Jan 7, 2025
2 parents fae26db + fe9167e commit d14164c
Show file tree
Hide file tree
Showing 17 changed files with 274 additions and 291 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Build and release

on:
push:
branches:
- main

jobs:
build-and-release:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: 'recursive'

- name: Build ESP-IDF Firmware
uses: espressif/esp-idf-ci-action@v1
with:
command: /app/Retr0Kr0dy/BeamStalker/patch-esp-idf.sh && idf.py build
esp_idf_version: v4.4
target: esp32s3 # Currently we only build for M5Cardputer (so esp32s3)
path: 'Firmware/BeamStalker'

- name: Set name and tag_name
id: set_name
run: |
if [[ "${{ github.event_name }}" == "pull_request" && -n "${{ github.event.pull_request.title }}" ]]; then
echo "name=${{ github.event.pull_request.title }}" >> $GITHUB_ENV
echo "tag_name=${{ github.event.pull_request.title }}" >> $GITHUB_ENV
elif [[ -n "${{ github.event.head_commit.message }}" ]]; then
echo "name=${{ github.event.head_commit.message }}" >> $GITHUB_ENV
echo "tag_name=${{ github.event.head_commit.message }}" >> $GITHUB_ENV
else
echo "name=BeamStalker" >> $GITHUB_ENV
echo "tag_name=vX" >> $GITHUB_ENV
fi
- name: Create Release
uses: softprops/action-gh-release@v1
with:
name: ${{ env.name }}
tag_name: ${{ env.tag_name }}
fail_on_unmatched_files: true
files: |
Firmware/BeamStalker/build/BeamStalker-v*.bin
25 changes: 0 additions & 25 deletions .github/workflows/build-firmware.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ on:
pull_request:
branches:
- '**'
push:
branches:
- main

jobs:
build:
Expand All @@ -25,25 +22,3 @@ jobs:
esp_idf_version: v4.4
target: esp32s3 # Currently we only build for M5Cardputer (so esp32s3)
path: 'Firmware/BeamStalker'

- name: Set name and tag_name
id: set_name
run: |
if [[ "${{ github.event_name }}" == "pull_request" && -n "${{ github.event.pull_request.title }}" ]]; then
echo "name=${{ github.event.pull_request.title }}" >> $GITHUB_ENV
echo "tag_name=${{ github.event.pull_request.title }}" >> $GITHUB_ENV
elif [[ -n "${{ github.event.head_commit.message }}" ]]; then
echo "name=${{ github.event.head_commit.message }}" >> $GITHUB_ENV
echo "tag_name=${{ github.event.head_commit.message }}" >> $GITHUB_ENV
else
echo "name=BeamStalker" >> $GITHUB_ENV
echo "tag_name=vX" >> $GITHUB_ENV
fi
- name: Create Release
uses: softprops/action-gh-release@v1
with:
name: ${{ env.name }}
tag_name: ${{ env.tag_name }}
fail_on_unmatched_files: true
files: |
Firmware/BeamStalker/build/BeamStalker-v*.bin
61 changes: 25 additions & 36 deletions Firmware/BeamStalker/main/BeamStalker-cardputer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@ extern "C" {
#include "firmware/apps/Wifi/wifi_main.h"
#include "firmware/apps/BLE/ble_main.h"

#include "M5GFX.h"
#include "M5Cardputer.h"

M5GFX display;
M5Canvas canvas(&display);

int mainTask() {
vTaskDelay(pdMS_TO_TICKS(100));

Expand Down Expand Up @@ -60,60 +54,51 @@ int mainTask() {

drawMenu(MainMenu, MainMenuSelector);

int UPp, DOWNp, LEFTp, RIGHTp, SELECTp, RETURNp;

while (1) {
M5Cardputer.update();
if (M5Cardputer.Keyboard.isPressed()) {
UPp = M5Cardputer.Keyboard.isKeyPressed(';');
DOWNp = M5Cardputer.Keyboard.isKeyPressed('.');
LEFTp = M5Cardputer.Keyboard.isKeyPressed(',');
RIGHTp = M5Cardputer.Keyboard.isKeyPressed('/');
SELECTp = M5Cardputer.Keyboard.isKeyPressed(KEY_ENTER);
RETURNp = M5Cardputer.Keyboard.isKeyPressed('`');

if (RETURNp) {
updateBoard();
if (anyPressed()) {

if (returnPressed()) {
vTaskDelay(pdMS_TO_TICKS(300));
return 0;
}
else if (UPp) {
else if (upPressed()) {
MainMenuSelector = intChecker(MainMenuSelector - 1, MainMenu.length);
vTaskDelay(pdMS_TO_TICKS(50));
}
else if (DOWNp) {
else if (downPressed()) {
MainMenuSelector = intChecker(MainMenuSelector + 1, MainMenu.length);
vTaskDelay(pdMS_TO_TICKS(50));
}
else if (LEFTp && (MainMenu.elements[MainMenuSelector].type == 0)) {
else if (leftPressed() && (MainMenu.elements[MainMenuSelector].type == 0)) {
MainMenu.elements[MainMenuSelector].selector = intChecker(MainMenu.elements[MainMenuSelector].selector - 1, MainMenu.elements[MainMenuSelector].length);
vTaskDelay(pdMS_TO_TICKS(50));
}
else if (RIGHTp && (MainMenu.elements[MainMenuSelector].type == 0)) {
else if (rightPressed() && (MainMenu.elements[MainMenuSelector].type == 0)) {
MainMenu.elements[MainMenuSelector].selector = intChecker(MainMenu.elements[MainMenuSelector].selector + 1, MainMenu.elements[MainMenuSelector].length);
vTaskDelay(pdMS_TO_TICKS(50));
}


else if (SELECTp) {
else if (selectPressed()) {
vTaskDelay(pdMS_TO_TICKS(300));
switch (MainMenuSelector) {
int ret;
case 0: // WiFcker
M5GFX_clear_screen();
clearScreen();
ret = APP_WiFcker();
if (ret != 0) {
printf("Error in app.");
}
break;
case 1: // BLE
M5GFX_clear_screen();
clearScreen();
ret = APP_BLE();
if (ret != 0) {
printf("Error in app.");
}
break;
case 2: // Options
M5GFX_clear_screen();
clearScreen();
ret = APP_Options();
if (ret != 0) {
printf("Error in app.");
Expand All @@ -128,8 +113,10 @@ int mainTask() {
}

extern "C" void app_main(void) {
#ifdef CONFIG_M5_BOARD
M5Cardputer.begin(true);
M5.Power.begin();
#endif

esp_err_t ret = nvs_flash_init();
if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND) {
Expand All @@ -138,46 +125,48 @@ extern "C" void app_main(void) {
}
ESP_ERROR_CHECK(ret);

M5.Display.clear();
clearScreen();
M5.Display.setTextSize(charsize_multiplier);
M5.Display.setTextColor(TFT_WHITE, TFT_BLACK);
M5.Display.setFont(&fonts::FreeMonoBold18pt7b);
const char* name = "BeamStalker";

for (;;) {
M5.Display.clear();
// int16_t x = (M5.Display.width() - 128) / 2;
// drawBitmap(x, 0, 128, 64, skullLogo, TFT_WHITE);
clearScreen();
int16_t x = ((M5.Display.width() - 120) / 4) * 3;
drawBitmap(x, 0, 120, 120, skully, TFT_WHITE);

vTaskDelay(pdMS_TO_TICKS(200));

#ifdef CONFIG_M5_BOARD
M5.Display.setCursor(0, 70);
M5.Display.print(name);
M5.Display.setCursor(0, 90);
M5.Display.print(VERSION);
#endif

printf("%s %s\n", name, VERSION);

vTaskDelay(pdMS_TO_TICKS(500));

M5.Display.setCursor(0, 110);
M5.Display.print("Press to boot...");

int loop = 1;

while (loop) {
M5Cardputer.update();
if (M5Cardputer.Keyboard.isPressed()) {
updateBoard();
if (anyPressed()) {
int wait = 1;
while (wait) {
M5Cardputer.update();
if (M5Cardputer.Keyboard.isPressed()) {
updateBoard();
if (anyPressed()) {
wait = 0;
}
vTaskDelay(pdMS_TO_TICKS(30));
}

M5.Display.clear();
clearScreen();

int taskRet = mainTask();
if (taskRet != 0) {
Expand Down
9 changes: 9 additions & 0 deletions Firmware/BeamStalker/main/Kconfig.projbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
menu "BeamStalker Build Configuration"

config M5_BOARD
bool "is M5Stack hardware"
default n
help
Specify if board is using M5Stack libs.

endmenu
21 changes: 6 additions & 15 deletions Firmware/BeamStalker/main/firmware/apps/BLE/ble_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,22 @@ int bleMenuTask() {

drawMenu(Menu, Selector);

int UPp, DOWNp, SELECTp, RETURNp;

while (1) {
M5Cardputer.update();
if (M5Cardputer.Keyboard.isChange()) {
UPp = M5Cardputer.Keyboard.isKeyPressed(';');
DOWNp = M5Cardputer.Keyboard.isKeyPressed('.');
// LEFTp = M5Cardputer.Keyboard.isKeyPressed(',');
// RIGHTp = M5Cardputer.Keyboard.isKeyPressed('/');
SELECTp = M5Cardputer.Keyboard.isKeyPressed(KEY_ENTER);
RETURNp = M5Cardputer.Keyboard.isKeyPressed('`');

if (RETURNp) {
updateBoard();
if (anyPressed()) {
if (returnPressed()) {
vTaskDelay(pdMS_TO_TICKS(300));
return 0;
}
else if (UPp) {
else if (upPressed()) {
Selector = intChecker(Selector - 1, Menu.length);
vTaskDelay(pdMS_TO_TICKS(50));
}
else if (DOWNp) {
else if (downPressed()) {
Selector = intChecker(Selector + 1, Menu.length);
vTaskDelay(pdMS_TO_TICKS(50));
}
if (SELECTp) {
if (selectPressed()) {
vTaskDelay(pdMS_TO_TICKS(300));

switch (Selector) {
Expand Down
33 changes: 12 additions & 21 deletions Firmware/BeamStalker/main/firmware/apps/BLE/ble_spam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,19 +157,10 @@ int BLESpam() {

drawMenu(Menu, Selector);

int UPp, DOWNp, LEFTp, RIGHTp, SELECTp, RETURNp;

while (1) {
M5Cardputer.update();
if (M5Cardputer.Keyboard.isChange()) {
UPp = M5Cardputer.Keyboard.isKeyPressed(';');
DOWNp = M5Cardputer.Keyboard.isKeyPressed('.');
LEFTp = M5Cardputer.Keyboard.isKeyPressed(',');
RIGHTp = M5Cardputer.Keyboard.isKeyPressed('/');
SELECTp = M5Cardputer.Keyboard.isKeyPressed(KEY_ENTER);
RETURNp = M5Cardputer.Keyboard.isKeyPressed('`');

if (RETURNp) {
updateBoard();
if (anyPressed()) {
if (returnPressed()) {
/* STOP BLE */
ESP_ERROR_CHECK(esp_bluedroid_disable());
ESP_ERROR_CHECK(esp_bluedroid_deinit());
Expand All @@ -181,30 +172,30 @@ int BLESpam() {

return 0;
}
else if (UPp) {
else if (upPressed()) {
Selector = intChecker(Selector - 1, Menu.length);
vTaskDelay(pdMS_TO_TICKS(50));
}
else if (DOWNp) {
else if (downPressed()) {
Selector = intChecker(Selector + 1, Menu.length);
vTaskDelay(pdMS_TO_TICKS(50));
}
else if (LEFTp && (Menu.elements[Selector].type == 0)) {
else if (leftPressed() && (Menu.elements[Selector].type == 0)) {
Menu.elements[Selector].selector = intChecker(Menu.elements[Selector].selector - 1, Menu.elements[Selector].length);
vTaskDelay(pdMS_TO_TICKS(50));
}
else if (RIGHTp && (Menu.elements[Selector].type == 0)) {
else if (rightPressed() && (Menu.elements[Selector].type == 0)) {
Menu.elements[Selector].selector = intChecker(Menu.elements[Selector].selector + 1, Menu.elements[Selector].length);
vTaskDelay(pdMS_TO_TICKS(50));
}
if (SELECTp) {
if (selectPressed()) {
vTaskDelay(pdMS_TO_TICKS(300));
M5GFX_clear_screen();
clearScreen();
switch (Selector) {
case 1: // Start attack
vTaskDelay(pdMS_TO_TICKS(100));

M5GFX_display_text(0, 0, "Spamming!!!", TFT_WHITE);
displayText(0, 0, "Spamming!!!", TFT_WHITE);

if (Menu.elements[Selector].selector == 4) { // all
// choice = (EBLEPayloadType)esp_random() % 4;
Expand All @@ -214,8 +205,8 @@ int BLESpam() {
}
int wait = 1;
while (wait) {
M5Cardputer.update();
if (M5Cardputer.Keyboard.isPressed()) {
updateBoard();
if (anyPressed()) {
wait = 0;
}

Expand Down
Loading

0 comments on commit d14164c

Please sign in to comment.