Krux Apps, small utility programs to enhance Krux#485
Krux Apps, small utility programs to enhance Krux#485tadeubas wants to merge 2 commits intoselfcustody:developfrom
Conversation
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (89.39%) is below the target coverage (95.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## develop #485 +/- ##
===========================================
- Coverage 97.31% 97.17% -0.15%
===========================================
Files 83 84 +1
Lines 10568 10749 +181
===========================================
+ Hits 10284 10445 +161
- Misses 284 304 +20 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Use my PUBKEY to test the signed apps (kapp, nostr) more easily, just change your |
|
This idea (krux apps) seems great to solve some open issues like this one #203 , krux devices have limited hardware in general, and probably for the future of the project we will need changes like this to allow continuous addition of features. some tests are broken in my machine, a notebook nix os ryzen 7 with 16 gb ram(I can run the krux main branch), i try by poetry and get some lib import errors, "No module named..." |
|
Hi @j-moreno-c-r I think you have to use this cmd before trying to execute tests: |
|
ok sorry for the innatention, everithing run fine now |
949ecd7 to
54251e8
Compare
|
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. |
|
Pleeeeaase 🙏🏽 squash commits so i can review, is confusing to me 🥺. Also we need to edit commits compliant to CI and appear to have some tests to make. |
|
I understand the concern 🙂 Once that’s done, we can move on to refining commit messages, addressing CI expectations, and doing a more detailed code review if needed 😉 |
It's worth to add some detailed information in #821 or followup? |
|
Needs rebase and squash commits |
5f50af2 to
31b2266
Compare
|
Just some doc nits. Also wdyt about have more commits, but organized like as follow?
|
Thank you for the suggestion. At this point, the changes are complete, so I'll leave it as is. |
| sing_message = SignMessage(self.ctx) | ||
| data, qr_format, message_filename = sing_message._load_message() |
There was a problem hiding this comment.
| sing_message = SignMessage(self.ctx) | |
| data, qr_format, message_filename = sing_message._load_message() | |
| sign_message = SignMessage(self.ctx) | |
| data, qr_format, message_filename = sign_message._load_message() |
There was a problem hiding this comment.
nice typo, will fix asap
Nice, is very neat work. Congrats! |


What is this PR for?
Create a new Tool to enable the execution of developer's signed Krux apps (Kapps) as
.mpyfiles in the SD card.To test on the simulator, copy the
.mpyfile and its corresponding.mpy.siginto thesimulator/sdfolder. When executed, both files are automatically copied tosimulator/flash. The simulator then emulates the execution of the selected Kapp by running the corresponding.pyfile from the simulator’s root directory. To avoid duplication, it’s recommended to create symbolic links to these.pyfiles instead of copying them.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.It is possible to keep more than one Kapp in flash memory. There is a security setting to enable the startup execution of a Kapp (before Krux firmware for OPSec), only Kapps that have the const
ALLOW_STARTUP = Trueare listed there.Other changes
krux]poetry run poe mpy-all)get_pubkeyandcheck_signatureallow_kappandstartup_kappChanges made to:
Did you build the code and tested on device?
What is the purpose of this pull request?
TODO LIST:
exec_allowedattr.