diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 000000000..1dc4f3d8c --- /dev/null +++ b/.coveragerc @@ -0,0 +1,2 @@ +[html] +show_contexts = True diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index b21d1a28d..b39f30275 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,28 +1,24 @@ --- - name: 🐞 Bug report -about: Create a report to help us improve -title: "[Bug] the title of bug report" +about: Create a new report +title: "[Bug] the summary of your report" labels: bug assignees: '' --- -#### Summary - - +#### Describe the bug + -**Device** +**Device(s) affected** - [ ] Amigo - [ ] M5stickV +- [ ] Cube - [ ] Dock - [ ] Bit - [ ] Yahboom +- [ ] WonderMV -**Version** -- [ ] Official release (selfcustody/krux): -- [ ] Beta release (odudex/krux_binaries): - -#### Describe the bug - - +**Version affected** +- [ ] Official release (selfcustody/krux): vXX.YY.Z +- [ ] Beta release (odudex/krux_binaries): vXX.YY.Z-betaWW diff --git a/.github/ISSUE_TEMPLATE/enhancement.md b/.github/ISSUE_TEMPLATE/enhancement.md index 337701782..1d7efbc50 100644 --- a/.github/ISSUE_TEMPLATE/enhancement.md +++ b/.github/ISSUE_TEMPLATE/enhancement.md @@ -1,10 +1,10 @@ --- name: 🔥 Enhancement -about: New feature or request -title: "[Enhancement] the title of new feature or enhancement" +about: New feature request +title: "[Enhancement] summarize the new feature or enhancement" labels: enhancement assignees: '' --- -#### Describe the new feature or enhancement +#### Describe your request diff --git a/.github/ISSUE_TEMPLATE/help_wanted.md b/.github/ISSUE_TEMPLATE/help_wanted.md index ad5726baa..fe6e3f61a 100644 --- a/.github/ISSUE_TEMPLATE/help_wanted.md +++ b/.github/ISSUE_TEMPLATE/help_wanted.md @@ -1,10 +1,10 @@ --- -name: 🥺 Help wanted -about: Help needed to use a feature, perform or understand a procedure -title: "[Help] the title of help wanted report" -labels: help wanted +name: 🥺 Other +about: Anything not related to a bug or feature +title: "[Other] summarize what is" +labels: other assignees: '' --- -#### Describe the problem you need help +#### Describe what it is diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index c533dfbf3..a4ffb8010 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,12 +1,8 @@ - +### What is this PR for? -### Description - - - -### What is the purpose of this pull request? +### What is the purpose of this pull request? - [ ] Bug fix -- [ ] New Feature -- [ ] Documentation update +- [ ] New feature +- [ ] Docs update - [ ] Other diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 725fce741..dd7f29d58 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,12 +5,13 @@ on: branches: - main - develop + - 'release-**' jobs: build: strategy: matrix: - device: [maixpy_m5stickv, maixpy_amigo, maixpy_bit, maixpy_dock, maixpy_yahboom, maixpy_cube] + device: [maixpy_m5stickv, maixpy_amigo, maixpy_bit, maixpy_dock, maixpy_yahboom, maixpy_cube, maixpy_wonder_mv] runs-on: ubuntu-latest services: registry: @@ -183,6 +184,30 @@ jobs: with: path: ${{ steps.extract-cube.outputs.destination }} name: build-cube + + - name: Build for WonderMV + if: matrix.device == 'maixpy_wonder_mv' + uses: docker/build-push-action@v6 + with: + context: . + build-args: DEVICE=maixpy_wonder_mv + push: true + tags: localhost:5000/selfcustody/krux-builder-wonder-mv:latest + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + - name: Extract firmware for WonderMV + id: extract-wonder-mv + if: matrix.device == 'maixpy_wonder_mv' + uses: shrink/actions-docker-extract@v3 + with: + image: localhost:5000/selfcustody/krux-builder-wonder-mv:latest + path: /src/firmware/Kboot/build/. + - name: Upload firmware for WonderMV + if: matrix.device == 'maixpy_wonder_mv' + uses: actions/upload-artifact@v4 + with: + path: ${{ steps.extract-wonder-mv.outputs.destination }} + name: build-wonder-mv - name: Move cache run: | diff --git a/.pylintrc b/.pylintrc index 18cb94562..b99a6edb6 100644 --- a/.pylintrc +++ b/.pylintrc @@ -89,7 +89,8 @@ disable=bad-inline-option, duplicate-code, ungrouped-imports, raise-missing-from, - anomalous-backslash-in-string + anomalous-backslash-in-string, + too-many-positional-arguments # Todo: remove this and adapt for releases above 24.09.0 # Enable the message, report, category or checker with the given id(s). You can # either give multiple identifier separated by comma (,) or put this option diff --git a/CHANGELOG.md b/CHANGELOG.md index 74b3710b7..5d465ca2e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,68 @@ +# Changelog 24.09.0 - September 25, 2024 + +### New Device Support: WonderMV +Manufactured by HiWonder, the WonderMV is similar to Yahboom K210 Module, with a few differences, including a metal enclosure, USB-C port, and screen backlight control. + +### Added Support for East Asian Languages - Korean and Simplified Chinese +After implementing low-level support for different glyph form factors, we were finally able to introduce the long-awaited Korean language translation. Simplified Chinese support followed shortly thereafter. + +### Faster PSBT Scanning +Reduced the time required to scan larger PSBTs by optimizing processing speed. + +### Improved QR Code Scanning +Enhanced scan success rates in challenging conditions, such as reduced focus or scanning from greater distances. + +### UI Standardization +The positions of "Yes" and "No" in prompts have been inverted to standardize the UI. Affirmative actions, such as "Yes," "Go," and "Proceed," will now be positioned on the right, while "No," "Esc," and "Back" will be on the left. + +### Enhanced Scanning Progress Bars +QR code progress bars now provide more detailed information. For UR PSBTs, the progress bar indicates when a valid frame is captured, while for BBQR, it displays the index or position of the last successfully scanned frame. + +### Mnemoniocs Editor - Loading Mnemonics +When manually loading an existing mnemonic, you can now correct typos and mistakes during the review stage by simply tapping or navigating to the incorrect words. The checksum word will be highlighted in red if the entered mnemonic is invalid to help detect eventual problems. + +### Mnemonics Editor - New Mnemonic +When generating new mnemonics through dice rolls or camera images, you can now modify the entropy by changing some of the mnemonic words. The final word will dynamically adjust to always produce a valid checksum. + +### Support for Scanning Various Binary Grid Formats +In addition to TinySeed, the camera can now scan and load mnemonics from equivalent formats, such as OneKey KeyTag, or even generic binary grids, like spreadsheets with colored, squared cells. + +### Message Signing Using SD cards +Recently released in Sparrow, the SD card message signing workflow is now supported. + +### Generate Double Mnemonics from Camera +When generating a new mnemonic using the camera, users can now choose to create a "Double Mnemonic," in addition to the standard 12 and 24-word options. This feature generates a 24-word mnemonic that, when split in half, forms two valid 12-word mnemonics. + +### Increased Valid Touch Surface +To improve touch accuracy, especially on small touchscreens, the touch surface area of buttons has been increased to make better use of the available screen space. + +### Add Account Descriptor Type Support +Krux now accepts urtype.Account type QR code descriptors. + +### Enhanced File Exploring +File explorer now better differentiate files from folders. + +### Camera Adjustments for Yahboom and WonderMV +Sensitivity and exposure adjustments were made to the GC2145 sensor, enhancing the scanning success rate for Yahboom and WonderMV devices. + +### About Shows Board Type +Ensure you flashed the correct firmware for your device consulting the "About" menu item. + +### Simplified Translations +Messages and terms were simplified to reduce firmware size and maintenance. + +### Bugfix - Signing Messages with ":" Character +Fixed an issue where signing messages containing the ":" character would result in invalid signatures when signing at addresses. + +### Bugfix - Import of Base64 Encoded PSBTs from SD Card +Fixed an issue where base64 encoded PSBTs imported from an SD card were not correctly detected and parsed. + +### Translation Removed: Polish +Polish translation was removed due to the lack of maintainers and known users. + +### Code Refactor and Optimizations +Several optimizations to increase performance and code quality. + # Changelog 24.07.0 - July 15, 2024 ### Maix Cube Support diff --git a/Dockerfile b/Dockerfile index 48054e2fc..60664715f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -105,6 +105,7 @@ RUN rm -rf vendor/embit/src/embit/util/prebuilt && \ rm -f vendor/embit/src/embit/wordlists/slip39.py && \ rm -f vendor/embit/src/embit/util/ctypes_secp256k1.py && \ rm -f vendor/embit/src/embit/util/py_secp256k1.py && \ + rm -f vendor/embit/src/embit/util/py_ripemd160.py && \ find vendor/embit -type d -name '__pycache__' -exec rm -rv {} + -depth # copy firmware to WORKDIR (src) diff --git a/README.md b/README.md index 20e7a37a8..6fde1aa34 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ [![created at](https://img.shields.io/github/created-at/selfcustody/krux)](https://github.com/selfcustody/krux/commit/bb8e2d63e031417111ff7cb2b8877c10e19410be) [![downloads](https://img.shields.io/github/downloads/selfcustody/krux/total)](https://github.com/selfcustody/krux/releases) [![downloads (latest release)](https://img.shields.io/github/downloads/selfcustody/krux/latest/total)](https://github.com/selfcustody/krux/releases) -[![commits (since latest release)](https://img.shields.io/github/commits-since/selfcustody/krux/latest/develop)](https://github.com/selfcustody/krux/compare/main...develop) +[![contributors](https://img.shields.io/github/contributors-anon/selfcustody/krux)](https://github.com/selfcustody/krux/graphs/contributors) +[![commit activity](https://img.shields.io/github/commit-activity/y/selfcustody/krux)](https://github.com/selfcustody/krux/commits) [![codecov](https://codecov.io/gh/selfcustody/krux/branch/main/graph/badge.svg?token=XU80PT6Q9V)](https://codecov.io/gh/selfcustody/krux) [![calver](https://img.shields.io/badge/calver-YY.0M.MICRO-22bfda.svg)](https://calver.org) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/selfcustody/krux/blob/main/LICENSE.md) diff --git a/docs/css/custom.css b/docs/css/custom.css index a4b76c206..9bd546b1c 100644 --- a/docs/css/custom.css +++ b/docs/css/custom.css @@ -4,4 +4,9 @@ .md-typeset img.twemoji { margin: 0 !important; +} + +.md-typeset h5 { + color: black; + text-transform: none; } \ No newline at end of file diff --git a/docs/getting-started/features/tinyseed.en.md b/docs/getting-started/features/tinyseed.en.md new file mode 100644 index 000000000..0611a2527 --- /dev/null +++ b/docs/getting-started/features/tinyseed.en.md @@ -0,0 +1,26 @@ +## Background +The examples below have been created so that you can test the workflow for scanning both 12 and 24 word mnemonics. (Scanning the left plate for a 12 word mnemonic and both plates for 24) The resulting fingerprint from an successful scan is also incldued in the image. + +### TinySeed +![](../../img/tinyseed_binarygrid/tinyseed.jpg) + +### OneKey KeyTag +![](../../img/tinyseed_binarygrid/onekey_keytag.jpg) + +### Binary Grid +![](../../img/tinyseed_binarygrid/binarygrid.jpg) + +## Size, Offset and Padding Reference +The general logic for how these are processed is: + +1. Krux first looks for a square (Which works best if with a well lit square, with clean edges, on a dark background) +2. This square is checked and if the ratio of length to height is within a defined range for the given seed type, the square is further processed. (Uses the aspect_high and aspect_low variables) +3. An X and Y offset are applied to work out the corner of the seed grid within the seed plate. Some devices like the Maix Amigo use a mirrored coordinate system and some seed types will have a slightly different layout on the front and back of the plate. (Uses the x_offset and y_offset variables, p0 for the front face and p1 for the reverse face) +4. The location of each cell within the 12x12 grid is calculated. (This uses the xpad and ypad variables) +5. Krux uses the grid created in 4 to evaluate which cells are marked and which are blank, once a seed with a valid checksum is detected, the user can then confirm the dots. + +If you have a different type of grid that you want to use, you will need to edit the offsets and padding numbers in tiny_seed.py. (All of the sizes are scaled based on the size of the square detected in step 1...) + +You can match the pre-sets for supported key-types to the physical dimensions of the tag as shown below. (The numbers for these offsets are in 1/10th of a millimeter) + +![](../../img/tinyseed_binarygrid/size_reference.jpg) \ No newline at end of file diff --git a/docs/getting-started/installing/from-gui.en.md b/docs/getting-started/installing/from-gui.en.md deleted file mode 100644 index d22a72366..000000000 --- a/docs/getting-started/installing/from-gui.en.md +++ /dev/null @@ -1,203 +0,0 @@ -You can install Krux (both official or beta releases) onto your K210-based device using our -official desktop application, [KruxInstaller](https://github.com/selfcustody/krux-installer), -available for Linux and Windows. - -### Download -Download the installer by choosing the right asset for your operating system from our -[Github releases page](https://github.com/selfcustody/krux-installer/releases): - -| **Operational System** | **File** | -|------------------------------------------------------------|:----------------------------------:| -| Windows | `krux-installer_0.0.13.exe*` | -| Debian-based: Ubuntu, PopOS, etc... | `krux-installer_0.0.13_amd64.deb*` | -| RedHat-based: Fedora, etc... | `krux-installer-0.0.13.x86_64.rpm*`| -| Any linux distribution | `krux-installer-0.0.13.AppImage*` | -| Package for Archlinux on [AUR](https://aur.archlinux.org/).| `krux-installer-bin` | - -### Verify files -If you trust the project developers, you can skip to [install](#install): - -> ⚠️ TIP: This step helps detect if any unauthorized modifications were made between github and your local computer. - -#### Integrity - - - - - - - - - - - - - - - - - - - - - - - - - -
SystemCommands
Windows (powershell) - ```pwsh - # Compare this output: - (Get-FileHash 'krux-installer_0.0.13.exe').Hash - - # With this: - Get-Content 'krux-installer_0.0.13.exe.sha256.txt' - ``` -
Debian-based - ```bash - sha256sum --check ./krux-installer_0.0.13_amd64.deb.sha256.txt - ``` -
RedHat-based - ```bash - sha256txt --check ./krux-installer-0.0.13.x86_64.rpm.sha256.txt - ``` -
Any Linux distribution - ```bash - sha256sum --check ./krux-installer-0.0.13.AppImage.sha256.txt - ``` -
- -#### Authenticity -You will need have [GPG](https://gnupg.org/) installed. Most Linux already have this, but on Windows we recommend installing [GPG4Win](https://www.gpg4win.org/). - -Once installed, run this command to retrieve the developer's key: - -```bash -gpg --keyserver hkps://keys.openpgp.org --recv-keys B4281DDDFBBD207BFA4113138974C90299326322 -``` - -Then you can verify: - -| System | Command | -|------------------------|-------------------------------------------------------| -| Windows (powershell) | `gpg --verify krux-installer_0.0.13.exe.sig` | -| Debian-based | `gpg --verify ./krux-installer_0.0.13_amd64.deb.sig` | -| RedHat-based | `gpg --verify ./krux-installer-0.0.13.x86_64.rpm.sig` | -| Any Linux distribution | `gpg --verify ./krux-installer-0.0.13.AppImage.sig` | - -> ⚠️ TIP: If the verification was successful, you may get a message similar to: `Good signature from "qlrddev "` - -### Install -Each system require different steps to install: - - - - - - - - - - - - - - - - - - - - - - - - - - -
SystemSteps
Windows -
    -
  • The krux-installer_0.0.13.exe is a NSIS installer;
  • -
  • The first time you run the .exe file the system will ask you to trust the application;
  • -
  • See windows section below for more information
  • -
Debian-based -
    -
  • Install with dpkg: sudo dpkg -i krux-installer_0.0.13_amd64.deb;
  • -
  • Update it with apt-get: sudo apt-get install -f krux-installer_0.0.13_amd64.deb.
  • -
-
RedHat-based -
    -
  • Fedora: sudo dnf install krux-installer-0.0.13.x86_64.rpm;
  • -
  • Other RedHat based distros: sudo yum localinstall krux-installer-0.0.13.x86_64.rpm.
  • -
-
Any Linux distribution -
    -
  • Place the krux-installer-0.0.13.AppImage where you want;
  • -
  • Modify permision to execute: chmod +x krux-installer-0.0.13.AppImage;
  • -
  • Run it: ./krux-installer-0.0.13.AppImage.
  • -
-
- -#### Windows -On Windows, you'll be faced with a blue window saying "Windows protected your PC". This occurs because -we don't have a [code signing certificate](https://signmycode.com/resources/how-to-sign-an-exe-or-windows-application), -Click on "More info" and allow the execution. Follow the installer's instructions to complete the installation. - -> 🛡️ TIP: If you followed the steps presented in [authenticity](#authenticity), you already -have the assurance that the software is from a verified and genuine software publisher - -Windows protected your computer - -### Usage - -#### Main Menu -When executing the Krux Installer, you will be presented with a menu of two items: - -KruxInstaller Main Menu - - -#### Select Device -First, select the device we want to flash. After that the menu will shown three items: - -Select Device Menu with choosen device - - Menu with three items - -#### Select Version -This option allows you to select the latest official version or the latest beta version on our github. If the connection works, you will see the following screen: - -Select version menu - -| **Version** | **Name** |**Advantages** | **Disadvantages** | -|-------------|------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------| -| Official | `selfcustody/krux/releases/tag/* ` |