类 PhoneUtils
- java.lang.Object
-
- cn.authing.guard.util.device.PhoneUtils
-
public class PhoneUtils extends Object
-
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static intgetAndroidVersion()static StringgetDeviceBoard()static StringgetDeviceBrand()static StringgetDeviceId(Context context)Return the unique device id.static StringgetDeviceManufacturer()static StringgetDeviceModel()static StringgetDeviceName()static StringgetDeviceName(Context context)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 StringgetIp()static StringgetIp(Context context)static StringgetMEID(Context context)Return the MEID.static StringgetNetworkType(Context context)static StringgetOsVersion()static intgetPhoneType(Context context)Returns the current phone type.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 StringintToIp(int i)将ip的整数形式转换成ip形式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
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
-
getDeviceModel
public static String getDeviceModel()
-
getDeviceManufacturer
public static String getDeviceManufacturer()
-
getDeviceName
public static String getDeviceName()
-
getDeviceBoard
public static String getDeviceBoard()
-
getDeviceBrand
public static String getDeviceBrand()
-
getOsVersion
public static String getOsVersion()
-
getAndroidVersion
public static int getAndroidVersion()
-
getIp
public static String getIp()
-
intToIp
public static String intToIp(int i)
将ip的整数形式转换成ip形式
-
-