避免用户同意隐私协议前获取IMEI和MAC,缓存IMEI避免频繁获取

This commit is contained in:
juntao
2020-10-14 18:23:08 +08:00
parent 04a8f5772c
commit 8dfda56586
23 changed files with 99 additions and 63 deletions

View File

@ -13,6 +13,7 @@ import android.util.Log;
import androidx.annotation.Nullable;
import com.gh.common.exposure.meta.MetaUtil;
import com.halo.assistant.HaloApp;
import com.lightgame.utils.Util_System_Phone_State;
import com.tencent.stat.StatConfig;
@ -46,7 +47,7 @@ public class DeviceUtils {
context = context.getApplicationContext();
JSONObject object = new JSONObject();
object.put("os", "Android");
object.put("imei", Util_System_Phone_State.getDeviceId(context));
object.put("imei", MetaUtil.getIMEI());
object.put("mac", getMac(context));
object.put("model", MODEL);
object.put("manufacturer", MANUFACTURER);
@ -62,7 +63,7 @@ public class DeviceUtils {
public static JSONObject getUserDevice(Context context) { // 判断新老用户device数据
JSONObject object = new JSONObject();
try {
object.put("IMEI", Util_System_Phone_State.getDeviceId(context));
object.put("IMEI", MetaUtil.getIMEI());
object.put("ANDROID_ID", Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID));
object.put("MAC", getMac(context));
object.put("MTA_ID", StatConfig.getMid(context));