This commit is contained in:
wangcongtao
2020-01-15 19:17:33 +08:00
parent 75f4d373a9
commit 6ddf294e7d
9 changed files with 117 additions and 40 deletions

View File

@@ -75,6 +75,8 @@ public class ParamsUtil {
public static Map< String, Object > getAnalyticsCustomParams() {
Map< String, Object > map = new ArrayMap<>();
map.put( "debug", DebugConfig.isDebug() ? 1 : 0 );
map.put( "systemversion", Utils.getFotaVersion() );
map.put( "sn", Utils.getSn() );
return map;
}

View File

@@ -55,15 +55,24 @@ public class Utils {
public static final String GET = "get";
public static final String GSM_SERIAL = "gsm.serial";
public static final String FOTA_VERSION = "ro.fota.version";
public static final String PROPERTIES = "android.os.SystemProperties";
public static String getSn() {
String serial = "";
return getSystemProperties( GSM_SERIAL );
}
public static String getFotaVersion() {
return getSystemProperties( FOTA_VERSION );
}
public static String getSystemProperties( String name ) {
String value = "";
try {
Class< ? > c = Class.forName( PROPERTIES );
Method get = c.getMethod( GET, String.class );
serial = ( String ) get.invoke( c, GSM_SERIAL );
value = ( String ) get.invoke( c, GSM_SERIAL );
} catch ( ClassNotFoundException var3 ) {
var3.printStackTrace();
} catch ( NoSuchMethodException var4 ) {
@@ -73,7 +82,6 @@ public class Utils {
} catch ( IllegalAccessException var6 ) {
var6.printStackTrace();
}
return serial;
return value;
}
}