-
Notifications
You must be signed in to change notification settings - Fork 60
Krux Apps, small utility programs to enhance Krux #485
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #485 +/- ##
===========================================
+ Coverage 97.37% 97.40% +0.03%
===========================================
Files 83 84 +1
Lines 10525 10690 +165
===========================================
+ Hits 10249 10413 +164
- Misses 276 277 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Example of steganography app usage: https://excalidraw.com/#json=3C163DUVqLssMRl1_rl8A,nfbdz4uv1AY95q725OaZ-g |
|
I’ve tested this extensively and believe the PR is ready to merge. I know that @jdlcdl has tested both the Nostr and Steganography Kapps, and another person has successfully tested only the Steganography Kapp without any issues. This PR does not yet include the inconspicuous startup feature #203 ; we’ll need to discuss the best approach for implementing that separately. |
|
In the NosTR app, the fingerprint keeps blinking. I’m not sure if this is intentional behavior or if there’s something I haven’t understood yet IMG_0614.MOV |
|
Thx @Pentecost1 you found a bug 👍 will fix ASAP |
|
I discussed inconspicuous startup (#203) with other devs on Telegram. Since Kapps can do anything, it’s hard to guarantee the firmware remains intact after they run. I initially suggested disabling Kapp startup and forcing a reboot before entering the firmware, which would require users to re-enable the Kapp each time. On further thought, we could instead allow only specific Kapps, those that don’t access or modify firmware code, to run at startup, and then safely continue to the firmware without disabling the Kapp or rebooting. I’ll update this PR accordingly and add a small, simple Kapp for inconspicuous startup. |
What is this PR for?
Create a new Tool to enable the execution of developer's signed Krux apps as
.mpyfiles in SD card.In the simulator you will need the
.mpyand its.mpy.sigin thesimulator/sdandsimulator/flashfolders. It fakes the execution of the selected.mpyfile (withinsimulator/sd) by executing the respective.pyfile in thesimulator's root folder (I created links insimulator/to the files inkapps/, so changes there are automatically reflected in the simulator).In order to execute on the device, first enable execution of SPIFFS VFS changing the file(Already merged)firmware/MaixPy/components/micropython/port/src/maixpy_main.cline276tovfs->exec_allowed = true;you need to get this selfcustody/micropython#6 for micropython and selfcustody/MaixPy#26 for MaixPy.In any case you will need to generate a
.mpyfile using the toolfirmware/MaixPy/components/micropython/core/mpy-cross. Follow itsREADME.mdinstructions in order to make and then compile a.pyfile into.mpy. It is implied that all Kapps must implement therun()function to be executed.You will also need to create a
.sigfile based on the.mpy. Remember to change the contents of theSIGNER_PUBKEYinsidesrc\krux\metadata.pyfollowing instructions here To generate a keypair and Signing the firmware (firmware will be your .mpy file) in order to sign and verify the signature within Krux code (Ex:./krux sign kapps/nostr.mpy privkey.pem).Use this nice tool from @kdmukai to test Nostr Kapp: https://nostrtool.com/
It’s also implied (though we can change this later) that Kapps won’t be translated - existing firmware strings will be, but new ones won’t. I also think we need to distribute the
.mpyfiles (and their signatures) with each release.In the future we might add the possibility to keep more than one Kapp in flash memory and run a selected Kapp at startup instead of Krux (with also the possibility to open Krux anyway).
Other changes
poetry run poe mpy-all)get_pubkeyandcheck_signatureallow_kappChanges made to:
Did you build the code and tested on device?
What is the purpose of this pull request?
TODO LIST:
exec_allowedattr.