pylkko wrote:apt is a package manager, you probably mean a debian package like a .deb-file.
I researched the mi band 4 a bit more and it appears that you can indeed read the ble characteristics despite them being encrypted. apparently you need to do the first ever pairing with the native app, and this allows you to fetch the key. after this you can just read it like a book.
Bluetooth low energy is different from the standard bluetooth protocol, in the sense that you do not need to pair the device, the device can send out pulses of data. For example, a watch can read your pulse with a sensor and broadcast this out every 5 seconds. Then any device near that has a ble device can read them (there are multiple apps for reading ble signals in app stores).
Here is a python library for that purpose. it even comes with a ready made console program with a pseudo-graphical interface (similar to ncurses)
all you need to do is install a package with apt, clone the code and get your key (the instructions are on the github page)
https://github.com/satcar77/miband4
I got the key but that project doesn' t have the band settings, sleep monitoring and more.
Most of the functions are available on the band.
Can someone use
https://codeberg.org/Freeyourgadget/Gadgetbridge to create a debian package?
It is an open source app, available also on github.