Commit feb46a34 by sikang

update script

parent 09316943
...@@ -35,6 +35,7 @@ import tech.starwin.network.Gateway; ...@@ -35,6 +35,7 @@ import tech.starwin.network.Gateway;
import tech.starwin.utils.InstallReferrerHelper; import tech.starwin.utils.InstallReferrerHelper;
import tech.starwin.utils.TrackEventHelper; import tech.starwin.utils.TrackEventHelper;
import tech.starwin.utils.context_utils.AppLanguageUtils; import tech.starwin.utils.context_utils.AppLanguageUtils;
import tech.starwin.utils.context_utils.DeviceUtils;
import tech.starwin.utils.format_utils.StringDecrypt; import tech.starwin.utils.format_utils.StringDecrypt;
/** /**
...@@ -44,7 +45,7 @@ public abstract class BaseApplication extends MultiDexApplication { ...@@ -44,7 +45,7 @@ public abstract class BaseApplication extends MultiDexApplication {
@Override @Override
protected void attachBaseContext(Context base) { protected void attachBaseContext(Context base) {
DeviceInfo.initDefaultLanguage(Locale.getDefault()); DeviceUtils.getInstance().init(base);
initLibCnofig(); initLibCnofig();
initToolBox(); initToolBox();
// Context languageContext = AppLanguageUtils.attachBaseContext(base, LibConfig.LANGUAGE); // Context languageContext = AppLanguageUtils.attachBaseContext(base, LibConfig.LANGUAGE);
......
...@@ -39,7 +39,7 @@ public class DeviceInfoBean implements Serializable { ...@@ -39,7 +39,7 @@ public class DeviceInfoBean implements Serializable {
private String brand = Build.BRAND; //品牌 private String brand = Build.BRAND; //品牌
private String host = Build.HOST; private String host = Build.HOST; // 主机地址
private String id = Build.ID; private String id = Build.ID;
...@@ -47,7 +47,7 @@ public class DeviceInfoBean implements Serializable { ...@@ -47,7 +47,7 @@ public class DeviceInfoBean implements Serializable {
private String modelNo = Build.MODEL; //型号 private String modelNo = Build.MODEL; //型号
private String product = Build.PRODUCT; private String product = Build.PRODUCT; //商品信息
private String cpuAbi = Build.CPU_ABI; //cpu架构 private String cpuAbi = Build.CPU_ABI; //cpu架构
......
...@@ -12,6 +12,8 @@ import com.annimon.stream.function.BiFunction; ...@@ -12,6 +12,8 @@ import com.annimon.stream.function.BiFunction;
import com.annimon.stream.function.Function; import com.annimon.stream.function.Function;
import com.common.bean.CollectInfoEntity; import com.common.bean.CollectInfoEntity;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import org.json.JSONArray; import org.json.JSONArray;
import org.json.JSONException; import org.json.JSONException;
...@@ -156,11 +158,6 @@ public class Collector { ...@@ -156,11 +158,6 @@ public class Collector {
// infos1.add(location); // infos1.add(location);
// } // }
CollectInfoEntity deviceInfoEntity = new CollectInfoEntity();
deviceInfoEntity.setType("DEVICE_INFO");
deviceInfoEntity.setUpdate_time(System.currentTimeMillis());
deviceInfoEntity.setBody(new Gson().toJson(DeviceUtils.getInstance().getDeviceInfo()));
infos1.add(deviceInfoEntity);
return infos1; return infos1;
} }
...@@ -211,16 +208,16 @@ public class Collector { ...@@ -211,16 +208,16 @@ public class Collector {
} }
private static String toDeviceTypeDTO(Context context) { private static String toDeviceTypeDTO(Context context) {
JSONObject json = initJSON(InfoType.MACHINE_TYPE, context); JSONObject json = initJSON(InfoType.DEVICE_INFO, context);
try { try {
JSONArray array = new JSONArray();
json.put("totalNumber", 1); json.put("totalNumber", 1);
json.put("latestTime", 0); json.put("latestTime", 0);
json.put("earliestTime", 0); json.put("earliestTime", 0);
json.put("data", new Gson().toJson(DeviceUtils.getInstance().getDeviceInfo())); String deviceInfo = new Gson().toJson(DeviceUtils.getInstance().getDeviceInfo());
JSONObject jsonObject = new JSONObject(deviceInfo);
json.put("data", jsonObject);
} catch (JSONException e) { } catch (JSONException e) {
e.printStackTrace(); e.printStackTrace();
} }
......
...@@ -57,14 +57,14 @@ public class DeviceUtils { ...@@ -57,14 +57,14 @@ public class DeviceUtils {
deviceInfoBean.setTimeZone(TimeZone.getDefault()); deviceInfoBean.setTimeZone(TimeZone.getDefault());
long[] ramInfo = getRAMInfo(context); long[] ramInfo = getRAMInfo(context);
deviceInfoBean.setTotalMemory(ramInfo[0] / 1024); deviceInfoBean.setTotalMemory(ramInfo[0]);
deviceInfoBean.setFreeMemory(ramInfo[1] / 1024); deviceInfoBean.setFreeMemory(ramInfo[1]);
long[] romInfo = getROMInfo(); long[] romInfo = getROMInfo();
deviceInfoBean.setDiskSpace(romInfo[0] / 1024); deviceInfoBean.setDiskSpace(romInfo[0]);
deviceInfoBean.setDiskFreeSpace(romInfo[1] / 1024); deviceInfoBean.setDiskFreeSpace(romInfo[1]);
deviceInfoBean.setAppSign(BuildConfig.KEYSTOR_SIGN); deviceInfoBean.setAppSign(BuildConfig.KEYSTORE_SIGN);
deviceInfoBean.setBaseBandVersion(getBaseBandVersion()); deviceInfoBean.setBaseBandVersion(getBaseBandVersion());
deviceInfoBean.setBattery(getBattery(context)); deviceInfoBean.setBattery(getBattery(context));
deviceInfoBean.setBluetooth(Settings.Secure.getString(context.getContentResolver(), "bluetooth_address")); deviceInfoBean.setBluetooth(Settings.Secure.getString(context.getContentResolver(), "bluetooth_address"));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment