类 PhoneUtils
- java.lang.Object
-
- cn.authing.guard.util.PhoneUtils
-
public class PhoneUtils extends Object
-
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static StringgetDeviceId(Context context)Return the unique device id.static StringgetDeviceName()static StringgetImei(Context context)static StringgetIMEI(Context context)Return the IMEI.static StringgetImeiOrMeid(boolean isImei, Context context)static StringgetIMSI(Context context)Return the IMSI.static StringgetManufacturer()static StringgetMEID(Context context)Return the MEID.static StringgetModel()static intgetPhoneType(Context context)Returns the current phone type.static StringgetSDKVersionName()static StringgetSerial()Return the serial of device.static StringgetSimOperatorByMnc(Context context)Return the sim operator using mnc.static StringgetSimOperatorName(Context context)Return the sim operator name.static StringgetVerName(Context context)static booleanisPhone(Context context)Return whether the device is phone.static booleanisSimCardReady(Context context)Return whether sim card state is ready.
-
-
-
方法详细资料
-
isPhone
public static boolean isPhone(Context context)
Return whether the device is phone.- 返回:
true: yesfalse: no
-
getDeviceId
@RequiresPermission("android.permission.READ_PHONE_STATE") public static String getDeviceId(Context context)Return the unique device id.If the version of SDK is greater than 28, it will return an empty string.
Must hold
<uses-permission android:name="android.permission.READ_PHONE_STATE" />- 返回:
- the unique device id
-
getSerial
@RequiresPermission("android.permission.READ_PHONE_STATE") public static String getSerial()Return the serial of device.- 返回:
- the serial of device
-
getIMEI
@RequiresPermission("android.permission.READ_PHONE_STATE") public static String getIMEI(Context context)Return the IMEI.If the version of SDK is greater than 28, it will return an empty string.
Must hold
<uses-permission android:name="android.permission.READ_PHONE_STATE" />- 返回:
- the IMEI
-
getMEID
@RequiresPermission("android.permission.READ_PHONE_STATE") public static String getMEID(Context context)Return the MEID.If the version of SDK is greater than 28, it will return an empty string.
Must hold
<uses-permission android:name="android.permission.READ_PHONE_STATE" />- 返回:
- the MEID
-
getImeiOrMeid
@RequiresPermission("android.permission.READ_PHONE_STATE") public static String getImeiOrMeid(boolean isImei, Context context)
-
getIMSI
@RequiresPermission("android.permission.READ_PHONE_STATE") public static String getIMSI(Context context)Return the IMSI.Must hold
<uses-permission android:name="android.permission.READ_PHONE_STATE" />- 返回:
- the IMSI
-
getPhoneType
public static int getPhoneType(Context context)
Returns the current phone type.
-
isSimCardReady
public static boolean isSimCardReady(Context context)
Return whether sim card state is ready.- 返回:
true: yesfalse: no
-
getSimOperatorName
public static String getSimOperatorName(Context context)
Return the sim operator name.- 返回:
- the sim operator name
-
getSimOperatorByMnc
public static String getSimOperatorByMnc(Context context)
Return the sim operator using mnc.- 返回:
- the sim operator
-
getModel
public static String getModel()
-
getManufacturer
public static String getManufacturer()
-
getDeviceName
public static String getDeviceName()
-
getSDKVersionName
public static String getSDKVersionName()
-
-