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////////////////////