Skip to content

Commit ae948ef

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

19 files changed

Lines changed: 681 additions & 0 deletions

.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
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: '[BUG] '
5+
labels: bug
6+
assignees: ''
7+
---
8+
9+
## Describe the bug
10+
A clear and concise description of what the bug is.
11+
12+
## To Reproduce
13+
Steps to reproduce the behavior:
14+
1. Go to '...'
15+
2. Click on '....'
16+
3. Scroll down to '....'
17+
4. See error
18+
19+
## Expected behavior
20+
A clear and concise description of what you expected to happen.
21+
22+
## Flipper Details
23+
- Firmware version: [e.g., Release 0.85.0]
24+
- App version: [e.g., 1.0.0]
25+
26+
## Additional context
27+
Add any other context about the problem here.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: '[FEAT] '
5+
labels: enhancement
6+
assignees: ''
7+
---
8+
9+
## Is your feature request related to a problem? Please describe.
10+
A clear and concise description of what the problem is. Ex: I'm always frustrated when [...]
11+
12+
## Describe the solution you'd like
13+
A clear and concise description of what you want to happen.
14+
15+
## Describe alternatives you've considered
16+
A clear and concise description of any alternative solutions or features you've considered.
17+
18+
## Additional context
19+
Add any other context or screenshots about the feature request here.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
## Description
2+
Please include a summary of the change and which issue is fixed.
3+
4+
## Type of change
5+
- [ ] Bug fix (non-breaking change which fixes an issue)
6+
- [ ] New feature (non-breaking change which adds functionality)
7+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
8+
9+
## How Has This Been Tested?
10+
Please describe the tests that you ran to verify your changes.
11+
- [ ] Ran `make test`
12+
- [ ] Ran `make linter`
13+
- [ ] Compiled with `make fap`
14+
15+
## Checklist:
16+
- [ ] My code follows the style guidelines of this project
17+
- [ ] I have performed a self-review of my own code
18+
- [ ] My changes generate no new warnings

.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+
*~

LICENSE

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
GNU GENERAL PUBLIC LICENSE
2+
Version 3, 29 June 2007
3+
4+
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
5+
Everyone is permitted to copy and distribute verbatim copies of this license
6+
document, but changing it is not allowed.
7+
8+
Preamble
9+
10+
The GNU General Public License is a free, copyleft license for software
11+
and other kinds of works.
12+
13+
... [Text omitted for brevity - Standard GPLv3] ...

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)

0 commit comments

Comments
 (0)