subsurface/mobile-widgets
Linus Torvalds 85392343fa Re-do the libdivecomputer fingerprint save/load code
This tries to make our fingerprinting code work better, by avoiding
using the "deviceid" field that has always been unreliable because we've
calculated it multiple different ways, and even for the same version of
subsurface, it ends up changing in the middle (ie we calculate one value
initially, then re-calculate it when we have a proper serial number
string).

So instead, the fingerprinting code will look up and save the
fingerprint file using purely "stable" information that is available
early during the download:

 - the device model name (which is a string with vendor and product name
   separated by a space)

 - the DC_EVENT_DEVINFO 32-bit 'serial' number (which is not necessarily
   a real serial number at all, but hopefully at least a unique number
   for the particular product)

but because the model name is not necessarily a good filename (think
slashes and other possibly invalid characters), we hash that model name
and use the resulting hex number in the fingerprint file name.

This way the fingerprint file is unambiguous at load and save time, and
depends purely on libdivecomputer data.

But because we also need to verify that we have the actual _dive_
associated with that fingerprint, we also need to save the final
deviceid and diveid when saving the fingerprint file, so that when we
load it again we can look up the dive and verify that we have it before
we use the fingerprint data.

To do that, the fingerprint file itself contains not just the
fingerprint data from libdivecomputer, but the last 8 bytes of the file
are the (subsurface) deviceid and the diveid of the dive that is
associated with the fingerprint.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-09-19 16:51:46 -07:00
..
3rdparty mobile/UI: correctly update title bar font size 2021-01-19 12:42:48 -08:00
qml core: remove location service preferences 2021-09-13 11:21:34 -07:00
CMakeLists.txt statistics: add a skeleton StatsManager class 2021-01-10 15:16:52 -08:00
qmlinterface.cpp mobile/summary: remove dive summary calculation 2020-02-08 10:29:36 -08:00
qmlinterface.h mobile/summary: remove dive summary calculation 2020-02-08 10:29:36 -08:00
qmlmanager.cpp Re-do the libdivecomputer fingerprint save/load code 2021-09-19 16:51:46 -07:00
qmlmanager.h Re-do the libdivecomputer fingerprint save/load code 2021-09-19 16:51:46 -07:00
statsmanager.cpp mobile/statistics: make charts model available to UI 2021-01-13 11:39:36 -08:00
statsmanager.h mobile/statistics: make charts model available to UI 2021-01-13 11:39:36 -08:00
themeinterface.cpp mobile/UI: remember the system default font size 2021-01-19 12:35:29 -08:00
themeinterface.h mobile/UI: remember the system default font size 2021-01-19 12:35:29 -08:00