From 8bcc0cdaaadc95bbc58aaeb061ae3deb3bcbb132 Mon Sep 17 00:00:00 2001 From: objnull Date: Sun, 11 Aug 2024 22:23:09 -0400 Subject: [PATCH] Migrated project to C --- .gitignore | 3 +++ build/{.empty => .gitkeep} | 0 docker/Dockerfile | 17 +++-------------- docker/flipper-dev.sh | 4 ++-- project/application.fam | 14 ++++++++++++++ project/flippypass.c | 11 +++++++++++ project/flippypass.png | Bin 0 -> 111 bytes scripts/build.sh | 4 ++-- 8 files changed, 35 insertions(+), 18 deletions(-) rename build/{.empty => .gitkeep} (100%) create mode 100644 project/application.fam create mode 100644 project/flippypass.c create mode 100644 project/flippypass.png diff --git a/.gitignore b/.gitignore index 598d0be..88e52a8 100644 --- a/.gitignore +++ b/.gitignore @@ -54,3 +54,6 @@ dkms.conf # Executables **.fap + +# Cache +**.ufbt/ \ No newline at end of file diff --git a/build/.empty b/build/.gitkeep similarity index 100% rename from build/.empty rename to build/.gitkeep diff --git a/docker/Dockerfile b/docker/Dockerfile index 7cdc123..a2457a9 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -8,21 +8,10 @@ WORKDIR /tmp/src ## Installing Requisites RUN apt update -y -RUN apt install -y wget curl build-essential pkg-config libssl-dev +RUN apt install -y curl wget python3 python3-pip -## Downloading RUSTUP -RUN wget https://sh.rustup.rs -O /tmp/rustup.sh -RUN chmod +x /tmp/rustup.sh -RUN /tmp/rustup.sh -y -RUN chmod +x /root/.cargo/env -RUN /root/.cargo/env - -## Downloading rustup requirements -RUN /root/.cargo/bin/rustup toolchain install nightly -RUN /root/.cargo/bin/cargo install cargo-generate - -## Flipper-Zero Build Target -RUN /root/.cargo/bin/rustup target add --toolchain nightly thumbv7em-none-eabihf +## Downloading uFBT +RUN pip install ufbt --break-system-packages ## Copying compile script COPY docker/flipper-dev.sh /bin/flipper-dev.sh diff --git a/docker/flipper-dev.sh b/docker/flipper-dev.sh index f563f52..5f97159 100644 --- a/docker/flipper-dev.sh +++ b/docker/flipper-dev.sh @@ -3,7 +3,7 @@ cp -r /src/. ./ cp -r /src/* ./ # Building the Project -/root/.cargo/bin/cargo build --target thumbv7em-none-eabihf +ufbt # Copy the .FAP file to the app directory -cp ./target/thumbv7em-none-eabihf/debug/*.fap /app/ \ No newline at end of file +cp dist/*.fap /app/ \ No newline at end of file diff --git a/project/application.fam b/project/application.fam new file mode 100644 index 0000000..b0d9a95 --- /dev/null +++ b/project/application.fam @@ -0,0 +1,14 @@ +App( + appid="flippypass", # Must be unique + name="Flippy Pass", # Displayed in menus + apptype=FlipperAppType.EXTERNAL, + entry_point="flippypass_app", + stack_size=2 * 1024, + fap_category="Tools", + # Optional values + fap_version="0.1", + fap_icon="flippypass.png", # 10x10 1-bit PNG + fap_description="A Password Manager for the Flipper-Zero", + fap_author="OBJNULL", + fap_weburl="https://git.objnull.net/objnull/FlippyPass" +) diff --git a/project/flippypass.c b/project/flippypass.c new file mode 100644 index 0000000..8fe801d --- /dev/null +++ b/project/flippypass.c @@ -0,0 +1,11 @@ +// Libraries +#include + +// Entry Point +int32_t flippypass_app(void* p) { + // Not using P Parameter + UNUSED(p); + + // Exit App + return 0; +} \ No newline at end of file diff --git a/project/flippypass.png b/project/flippypass.png new file mode 100644 index 0000000000000000000000000000000000000000..172ec5a14ef1e3a61d0b8d2d4b5934c15a5ab7ef GIT binary patch literal 111 zcmeAS@N?(olHy`uVBq!ia0vp^AT}2V8<6ZZI=>f4nRvQ5hDd}b|M~y_e?6NLgYs8V zBLjm45xu8X6IvBK-P{C(nG$MJ3VDPJ86T}(wr_o>sUU-rsn*L0oh{lx{S2P2elF{r I5}Fto01js#9RL6T literal 0 HcmV?d00001 diff --git a/scripts/build.sh b/scripts/build.sh index 3552a46..81fbb17 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -1,7 +1,7 @@ clear -echo "Building Project" docker run --rm -it \ -e USER=$USER \ -v "$PWD/project:/src:ro,z" \ -v "$PWD/build:/app:Z" \ - flipper-dev \ No newline at end of file + -v "$PWD/.ufbt:/root/.ufbt:Z" \ + flipper-dev $@ \ No newline at end of file