Skip to content

Commit b970c94

Browse files
committed
feat(flipper-app): initial commit
0 parents  commit b970c94

15 files changed

Lines changed: 604 additions & 0 deletions

File tree

.clang-format

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
BasedOnStyle: LLVM
2+
IndentWidth: 4
3+
ColumnLimit: 100
4+
AllowShortFunctionsOnASingleLine: None
5+
IndentCaseLabels: true

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"

.github/workflows/ci.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
defaults:
9+
run:
10+
working-directory: .
11+
steps:
12+
- uses: actions/checkout@v4
13+
- name: Install dependencies
14+
run: sudo apt-get update && sudo apt-get install -y build-essential cppcheck clang-format
15+
- name: Run linter
16+
run: make linter
17+
- name: Check format
18+
run: clang-format --dry-run --Werror *.c *.h tests/*.c
19+
- name: Run tests
20+
run: make test

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Compiled files
2+
test_logic
3+
*.o
4+
5+
# Editor files
6+
.DS_Store
7+
*.swp
8+
*~

Makefile

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Path to your Flipper Zero firmware directory
2+
FLIPPER_FIRMWARE_PATH ?= /home/<YOUR_PATH>/flipperzero-firmware
3+
PWD = $(shell pwd)
4+
5+
CC = gcc
6+
CFLAGS = -Wall -Wextra -std=c11 -I.
7+
8+
.PHONY: all help test prepare fap clean clean_firmware format linter
9+
10+
all: test
11+
12+
help:
13+
@echo "Available commands:"
14+
@echo " make test - Run unit tests for the logic"
15+
@echo " make prepare - Link this app to the Flipper firmware source"
16+
@echo " make fap - Clean firmware build and build the Flipper Zero application"
17+
@echo " make format - Run clang-format to format code"
18+
@echo " make linter - Run cppcheck to analyze code"
19+
@echo " make clean - Remove local compiled files"
20+
@echo " make clean_firmware - Remove firmware build directory"
21+
22+
format:
23+
clang-format -i *.c *.h tests/*.c
24+
25+
linter:
26+
cppcheck --enable=all --suppress=missingIncludeSystem --suppress=unusedFunction --suppress=missingInclude .
27+
28+
test: logic.o tests/test_logic.o
29+
$(CC) $(CFLAGS) -o test_logic logic.o tests/test_logic.o
30+
./test_logic
31+
32+
prepare:
33+
@if [ -d "$(FLIPPER_FIRMWARE_PATH)" ]; then \
34+
mkdir -p $(FLIPPER_FIRMWARE_PATH)/applications_user; \
35+
ln -sfn $(PWD) $(FLIPPER_FIRMWARE_PATH)/applications_user/sub_duplicate_finder; \
36+
echo "App linked to $(FLIPPER_FIRMWARE_PATH)/applications_user/sub_duplicate_finder"; \
37+
else \
38+
echo "Error: Flipper firmware path not found at $(FLIPPER_FIRMWARE_PATH)."; \
39+
fi
40+
41+
clean_firmware:
42+
@if [ -d "$(FLIPPER_FIRMWARE_PATH)/build" ]; then \
43+
echo "Cleaning firmware build directory..."; \
44+
rm -rf $(FLIPPER_FIRMWARE_PATH)/build; \
45+
fi
46+
47+
fap: prepare clean_firmware clean
48+
@if [ -d "$(FLIPPER_FIRMWARE_PATH)" ]; then \
49+
cd $(FLIPPER_FIRMWARE_PATH) && ./fbt fap_sub_dup_finder; \
50+
fi
51+
52+
logic.o: logic.c logic.h
53+
$(CC) $(CFLAGS) -c logic.c
54+
55+
tests/test_logic.o: tests/test_logic.c logic.h
56+
$(CC) $(CFLAGS) -c tests/test_logic.c -o tests/test_logic.o
57+
58+
clean:
59+
rm -f *.o tests/*.o test_logic

README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Sub-GHz Duplicate Finder for Flipper Zero
2+
3+
An application for Flipper Zero to identify, manage, and clean up duplicate `*.sub` files from Sub-GHz storage.
4+
5+
## Screenshots
6+
7+
| Main Menu | Groups View | File Management |
8+
| :---: | :---: | :---: |
9+
| ![Main](assets/main_menu.png) | ![Groups](assets/groups.png) | ![Delete](assets/delete.png) |
10+
11+
> *Tip: Capture these screenshots using the "Remote" tab in qFlipper.*
12+
13+
## Development Setup
14+
15+
This project uses a standard `Makefile` for local development on your host machine (Linux/macOS).
16+
17+
### Requirements
18+
19+
- `gcc`, `make`, `clang-format`, `cppcheck`.
20+
21+
### Commands
22+
23+
- `make test`: Run unit tests for the core logic on your computer.
24+
- `make format`: Automatically format code using `clang-format`.
25+
- `make linter`: Run static analysis with `cppcheck` to ensure code safety.
26+
- `make prepare`: Links your local project directory into the Flipper Zero firmware `applications_user` folder.
27+
- `make fap`: Builds the `.fap` binary using `fbt` (requires firmware repo).
28+
- `make clean`: Cleans local build artifacts.
29+
30+
## Building for Flipper Zero
31+
32+
1. Clone the official [Flipper Zero Firmware](https://github.com/flipperdevices/flipperzero-firmware).
33+
2. Set the `FLIPPER_FIRMWARE_PATH` in your `Makefile` to point to your local firmware directory.
34+
3. Run `make fap` from this project's directory. This command will:
35+
- Prepare the source code (symlink).
36+
- Clean previous builds.
37+
- Compile the binary using `fbt`.
38+
39+
## CI/CD
40+
41+
This project includes a GitHub Actions workflow that automatically runs:
42+
1. **Linter** (static analysis).
43+
2. **Format Check** (style enforcement).
44+
3. **Unit Tests** (logic validation).
45+
46+
## Credits
47+
Author: Endika
48+
GitHub: [github.com/endika/flipper-sub-dup](https://github.com/endika/flipper-sub-dup)

application.fam

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
App(
2+
appid="sub_dup_finder",
3+
name="Sub Duplicate Finder",
4+
apptype=FlipperAppType.EXTERNAL,
5+
entry_point="sub_dup_finder_app",
6+
stack_size=4 * 1024,
7+
fap_version=(1, 0),
8+
fap_icon="icons/icon.icon",
9+
fap_category="Sub-GHz",
10+
fap_author="Endika",
11+
fap_description="Identify and clean up duplicate .sub files in storage",
12+
)

assets/delete.png

1.72 KB
Loading

assets/groups.png

1.87 KB
Loading

assets/main_menu.png

1.4 KB
Loading

0 commit comments

Comments
 (0)