diff --git a/android/src/org/notify/FreeKill/Helper.java b/android/src/org/notify/FreeKill/Helper.java index d084f4b4..335d83a9 100644 --- a/android/src/org/notify/FreeKill/Helper.java +++ b/android/src/org/notify/FreeKill/Helper.java @@ -2,6 +2,7 @@ package org.notify.FreeKill; +import android.provider.Settings; import android.app.Activity; import android.view.View; import android.view.WindowManager; @@ -43,4 +44,12 @@ public class Helper { } }); } + + public static String GetSerial() { + Activity activity = QtNative.activity(); + return Settings.Secure.getString( + activity.getContentResolver(), + Settings.Secure.ANDROID_ID + ); + } } diff --git a/src/core/util.cpp b/src/core/util.cpp index d4e7a1c9..c93eb496 100644 --- a/src/core/util.cpp +++ b/src/core/util.cpp @@ -205,7 +205,12 @@ QJsonDocument String2Json(const QString &str) { } QString GetDeviceUuid() { +#ifdef Q_OS_ANDROID + QJniObject string = QJniObject::callStaticObjectMethod("org/notify/FreeKill/Helper", "GetSerial", "()Ljava/lang/String;"); + return string.toString(); +#else return QSysInfo::machineUniqueId(); +#endif } QString Color(const QString &raw, fkShell::TextColor color,