增加固件版本信息

hdrplus
Matthew 1 year ago
parent 1844195c64
commit b74d96991a

@ -20,6 +20,7 @@
#include <stdio.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <sys/system_properties.h>
#include <Client/Database.h>
@ -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);
}

@ -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<String, String>("oid", mService.getSerialNo()));
postParams.add(new Pair<String, String>("maintainVersion", mService.getMasterAppVersion()));
postParams.add(new Pair<String, String>("firmware", MpMasterService.getSystemProperty("ro.custom.ota.version")));
// SysApi.
postParams.add(new Pair<String, String>("simcard1", mService.getIccid(1)));
// if (mService.isSeparateNetwork()) {
postParams.add(new Pair<String, String>("simcard2", mService.getIccid(2)));
@ -307,6 +309,9 @@ public class AppMaster {
stats.add(new Pair<String, String>("failedTimes", Integer.toString(items[6])));
stats.add(new Pair<String, String>("uploads", Integer.toString(items[7])));
stats.add(new Pair<String, String>("uploads", Integer.toString(items[7])));
if (items[8] > 0) {
stats.add(new Pair<String, String>("rebootTimes", Integer.toString(items[8])));
}

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

Loading…
Cancel
Save