获取IMEI号,旧版本

// 获取 IMEI号private static String getIMEIOld(Context context){if (ContextCompat
//  获取 IMEI号
private static String getIMEIOld(Context context){if (ContextCompat.checkSelfPermission(context, Manifest.permission.READ_PHONE_STATE) != PackageManager.PERMISSION_GRANTED) {//进行授权ActivityCompat.requestPermissions((Activity) context, new String[]{Manifest.permission.READ_PHONE_STATE}, 1);Toast.makeText(context, "没有权限,请打开设置!", Toast.LENGTH_SHORT).show();WTActivityManager.INSTANCE.finishAllActivity();return "0";} else {TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);assert tm != null;return tm.getDeviceId();}
}