diff --git a/shared/liboxide/devicesettings.cpp b/shared/liboxide/devicesettings.cpp index 47870b75..2849202a 100644 --- a/shared/liboxide/devicesettings.cpp +++ b/shared/liboxide/devicesettings.cpp @@ -322,4 +322,18 @@ namespace Oxide { } return physicalKeyboards; } + + const QString& DeviceSettings::version(){ + static QString version = ""; + if(version.isEmpty()){ + auto lines = QFile("/usr/share/remarkable/update.conf").readAll().split('\n'); + for(const QString& line : lines){ + if(line.startsWith("REMARKABLE_RELEASE_VERSION=")){ + version = line.mid(27); + break; + } + } + } + return version; + } } diff --git a/shared/liboxide/devicesettings.h b/shared/liboxide/devicesettings.h index e7ad2e83..b8a35fb4 100644 --- a/shared/liboxide/devicesettings.h +++ b/shared/liboxide/devicesettings.h @@ -144,6 +144,11 @@ namespace Oxide{ * \return All virtual keyboard devices */ QList virtualKeyboards(); + /*! + * \brief Get the version of the OS + * \return Version string + */ + const QString& version(); private: DeviceType _deviceType; diff --git a/shared/liboxide/oxide_sentry.cpp b/shared/liboxide/oxide_sentry.cpp index 5cbf7976..529a3a1e 100644 --- a/shared/liboxide/oxide_sentry.cpp +++ b/shared/liboxide/oxide_sentry.cpp @@ -168,7 +168,7 @@ namespace Oxide::Sentry{ sentry_value_set_by_key(user, "id", sentry_value_new_string(machineId())); sentry_set_user(user); // Setup context - std::string version = readFile("/etc/version"); + auto version = deviceSettings.version().toStdString(); sentry_set_tag("os.version", version.c_str()); sentry_set_tag("name", name); sentry_value_t device = sentry_value_new_object();