From b74d96991a1c8ed648ba35e384bcbc81f5a03cd6 Mon Sep 17 00:00:00 2001 From: Matthew Date: Mon, 3 Jun 2024 22:44:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=9B=BA=E4=BB=B6=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mpmaster/src/main/cpp/mpmaster.cpp | 16 ++++++++++++++++ .../java/com/xypower/mpmaster/AppMaster.java | 7 ++++++- .../com/xypower/mpmaster/MpMasterService.java | 1 + 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/mpmaster/src/main/cpp/mpmaster.cpp b/mpmaster/src/main/cpp/mpmaster.cpp index e17feda4..5485b576 100644 --- a/mpmaster/src/main/cpp/mpmaster.cpp +++ b/mpmaster/src/main/cpp/mpmaster.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include @@ -83,3 +84,18 @@ Java_com_xypower_mpmaster_MpMasterService_getStats(JNIEnv* env, jclass cls, jlon } +extern "C" JNIEXPORT jstring JNICALL +Java_com_xypower_mpmaster_MpMasterService_getSystemProperty( + JNIEnv* env, + jclass cls, jstring key) { + + const char *keyStr = env->GetStringUTFChars(key, 0); + + char value[PROP_VALUE_MAX] = { 0 }; + __system_property_get(keyStr, value); + + env->ReleaseStringUTFChars(key, keyStr); + + return env->NewStringUTF(value); +} + diff --git a/mpmaster/src/main/java/com/xypower/mpmaster/AppMaster.java b/mpmaster/src/main/java/com/xypower/mpmaster/AppMaster.java index 087dfe5d..98d0d6b9 100644 --- a/mpmaster/src/main/java/com/xypower/mpmaster/AppMaster.java +++ b/mpmaster/src/main/java/com/xypower/mpmaster/AppMaster.java @@ -10,7 +10,6 @@ import android.os.PowerManager; import android.os.SystemClock; import android.telephony.TelephonyManager; import android.text.TextUtils; -import android.util.Log; import android.util.Pair; import android.util.Base64; @@ -224,6 +223,9 @@ public class AppMaster { postParams.add(new Pair("oid", mService.getSerialNo())); postParams.add(new Pair("maintainVersion", mService.getMasterAppVersion())); + postParams.add(new Pair("firmware", MpMasterService.getSystemProperty("ro.custom.ota.version"))); + + // SysApi. postParams.add(new Pair("simcard1", mService.getIccid(1))); // if (mService.isSeparateNetwork()) { postParams.add(new Pair("simcard2", mService.getIccid(2))); @@ -307,6 +309,9 @@ public class AppMaster { stats.add(new Pair("failedTimes", Integer.toString(items[6]))); stats.add(new Pair("uploads", Integer.toString(items[7]))); + stats.add(new Pair("uploads", Integer.toString(items[7]))); + + if (items[8] > 0) { stats.add(new Pair("rebootTimes", Integer.toString(items[8]))); } diff --git a/mpmaster/src/main/java/com/xypower/mpmaster/MpMasterService.java b/mpmaster/src/main/java/com/xypower/mpmaster/MpMasterService.java index a55fa83e..0dfd1083 100644 --- a/mpmaster/src/main/java/com/xypower/mpmaster/MpMasterService.java +++ b/mpmaster/src/main/java/com/xypower/mpmaster/MpMasterService.java @@ -941,6 +941,7 @@ public class MpMasterService extends Service { public native static int getInt(int cmd); public native static int[] getStats(long ts); + public native static String getSystemProperty(String key); ////////////////////////GPS////////////////////