如题所述
http://blog.csdn.net/boonya/article/details/39396331
Androidçå¼åè å¨ä¸äºç¹å®æ åµä¸é½éè¦ç¥éææºä¸çå¯ä¸è®¾å¤IDãä¾å¦ï¼è·è¸ªåºç¨ç¨åºçå®è£ ï¼çæç¨äºå¤å¶ä¿æ¤çDRMæ¶éè¦ä½¿ç¨è®¾å¤çå¯ä¸IDãå¨æ¬ææ¡£ç»å°¾å¤æä¾äºä½ä¸ºåèç示ä¾ä»£ç ç段ã
èå´
æ¬ææä¾æå ³å¦ä½è¯»ååç§Android设å¤ç IDçä»ç»ï¼ç¨ä»¥ä½¿ç¨æ è¯å·ãæ¬æåå®ç¨æ·å·²ç»å®è£ äºAndroid以åå¼ååºç¨ç¨åºå¿ è¦çå·¥å ·ã并ä¸ï¼æ¬æåå®ç¨æ·å·²äºè§£Androidçåºæ¬ç¥è¯ã
ç®ä»
å¨æè½½Androidæä½ç³»ç»ç设å¤ä¸ï¼å·²ç»åå¨å¥½å ç§ç±»åç设å¤æ è¯å·ãå åçææAndroid设å¤é½å ·æçµè¯åè½ï¼å æ¤æ¥æ¾æ¯é¨è®¾å¤ç¡¬ä»¶å¯ä¸çIMEIï¼MEIDï¼æESNä¹å¾å®¹æãä½ä» è½ä½¿ç¨Wifiç设å¤æé³ä¹ææ¾å¨æ²¡æçµè¯ç¡¬ä»¶ï¼æ以没æè¿ç§ç±»åçå¯ä¸æ è¯å·ãæ¬æéè¿°äºå¦ä½è¯»åä¸åAndroid设å¤çæ è¯å·ã
æ£ç´¢Android设å¤IDåç§æ¹å¼
以ä¸æ¯Android设å¤ä¸åç±»åçè¯å«è®¾å¤IDã
· å¯ä¸ç¼å·ï¼IMEIï¼MEIDï¼ESNï¼IMSIï¼
· MACå°å
· åºåå·
· ANDROID_ID
å¯ä¸ç¼å·ï¼IMEIï¼MEIDï¼ESNï¼IMSIï¼
说æå¨ä»¥åï¼å½Android设å¤åä½ä¸ºçµè¯ä½¿ç¨æ¶ï¼å¯»æ¾å¯ä¸æ è¯å·æ¯è¾ç®åï¼ï¼ï¼å¯ç¨äºæ¾å°ï¼åå³äºç½ç»ææ¯ï¼ææºç¡¬ä»¶å¯ä¸çIMEIï¼MEIDï¼ESNåIMSIç¼å·ã
TelephonyManager.getDeviceId
IMEIï¼MEIDï¼ESNï¼IMSIçå®ä¹å¦ä¸ï¼
•IMEIï¼å½é 移å¨è®¾å¤è¯å«ç ï¼å¯ä¸ç¼å·ï¼ç¨äºè¯å« GSMï¼WCDMAææºä»¥åä¸äºå«æçµè¯ï¼ç§»å¨è®¾å¤è¯å«ç ï¼å ¨çå¯ä¸ç¼å·ï¼ç¨äºè¯å«CDMA移å¨çµå°è®¾å¤çç©ç硬件ï¼MEIDåºç°çç®çæ¯å代ESNå·æ®µï¼çµååºåå·ï¼ï¼çµååºåå·ï¼å¯ä¸ç¼å·ï¼ç¨äºè¯å«CDMAææºï¼å½é 移å¨ç¨æ·è¯å«ç ï¼ä¸ææGSMåUMTSç½ç»ææºç¨æ·ç¸å ³èçå¯ä¸è¯å«ç¼å·å¦éè¦æ£ç´¢è®¾å¤çIDï¼å¨é¡¹ç®ä¸è¦ä½¿ç¨ä»¥ä¸ä»£ç ï¼
•MEID
•ESN
•IMSI
import android.telephony.TelephonyManager;
import android.content.Context;
String imeistring = null;
String imsistring = null;
{
TelephonyManager telephonyManager;
telephonyManager =
( TelephonyManager )getSystemService( Context.TELEPHONY_SERVICE );
/*
* getDeviceId() function Returns the unique device ID.
* for example,the IMEI for GSM and the MEID or ESN for CDMA phones.
*/
imeistring = telephonyManager.getDeviceId();
/*
* getSubscriberId() function Returns the unique subscriber ID,
* for example, the IMSI for a GSM phone.
*/
imsistring = telephonyManager.getSubscriberId();
}
å¦è¦åªè¯»åææºçç¶æï¼åéæ·»å READ_PHONE_STATE许å¯å°AndroidManifest.xmlæ件ä¸ã
<uses-permission android:name="android.permission.READ_PHONE_ST
缺ç¹
•Android设å¤è¦å ·æçµè¯åè½
•å ¶å·¥ä½ä¸æ¯å¾å¯é
•åºåå·
•å½å ¶å·¥ä½æ¶ï¼è¯¥å¼ä¿çäºè®¾å¤çé置信æ¯ï¼âæ¢å¤åºå设置âï¼ï¼ä»èå¯ä»¥æ¶é¤å½å®¢æ·å é¤èªå·±è®¾å¤ä¸çä¿¡æ¯ï¼å¹¶æ设å¤è½¬å¦ä¸ä¸ªäººæ¶åççé误ã
Macå°å
说æ
å¯éè¿æ£ç´¢æ¾å°è®¾å¤çWi - Fiæèç硬件çMacå°åãä½æ¯ï¼ä¸æ¨è使ç¨Macå°åä½ä¸ºå¯ä¸çæ è¯å·ã
缺ç¹è®¾å¤è¦å ·å¤Wi â Fiåè½ï¼å¹¶éææç设å¤é½æWi â Fiåè½ï¼å¦æ设å¤ç®åæ£å¨ä½¿ç¨Wi - Fiï¼åä¸è½æ¥åMacå°å
åºåå·
ä»Android 2.3ï¼âå§é¥¼âï¼å¼å§ï¼éè¿android.os.Build.SERIALæ¹æ³åºåå·å¯è¢«ä½¿ç¨ã没æçµè¯åè½ç设å¤ä¹é½éè¦ä¸ç»åºå¯ä¸ç设å¤ID; æäºææºä¹å¯ä»¥éè¦è¿æ ·åãåºåå·å¯ä»¥ç¨äºè¯å«MIDï¼ç§»å¨äºèç½è®¾å¤ï¼æPMPï¼ä¾¿æºå¼åªä½ææ¾å¨ï¼ï¼è¿ä¸¤ç§è®¾å¤é½æ²¡æçµè¯åè½ãéè¿è¯»åç³»ç»å±æ§å¼âro.serialnoâçæ¹æ³ï¼å¯ä»¥ä½¿ç¨åºåå·ä½ä¸ºè®¾å¤ID ã
import java.lang.reflect.Method;
String serialnum = null;
try {
Class<?> c = Class.forName("android.os.SystemProperties");
Method get = c.getMethod("get", String.class, String.class );
serialnum = (String)( get.invoke(c, "ro.serialno", "unknown" ) );
}
catch (Exception ignored)
{
}
缺ç¹
åºåå·æ æ³å¨ææAndroid设å¤ä¸ä½¿ç¨ã
ANDROID_ID
说æ
æ´å ·ä½å°è¯´ï¼Settings.Secure.ANDROID_ID æ¯ä¸ä¸²64ä½çç¼ç ï¼åå è¿å¶çå符串ï¼ï¼æ¯éæºçæç设å¤ç第ä¸ä¸ªå¼å¯¼ï¼å ¶è®°å½çä¸ä¸ªåºå®å¼ï¼éè¿å®å¯ä»¥ç¥é设å¤ç寿å½ï¼å¨è®¾å¤æ¢å¤åºå设置åï¼è¯¥å¼å¯è½ä¼æ¹åï¼ã ANDROID_IDä¹å¯è§ä¸ºä½ä¸ºå¯ä¸è®¾å¤æ è¯å·çä¸ä¸ªå¥½éæ©ãå¦è¦æ£ç´¢ç¨äºè®¾å¤ID çANDROID_IDï¼è¯·åé ä¸é¢ç示ä¾ä»£ç
String androidId = Settings.Secure.getString(getContentResolver(),Settings.Secure.ANDROID_ID);
Androidçå¼åè å¨ä¸äºç¹å®æ åµä¸é½éè¦ç¥éææºä¸çå¯ä¸è®¾å¤IDãä¾å¦ï¼è·è¸ªåºç¨ç¨åºçå®è£ ï¼çæç¨äºå¤å¶ä¿æ¤çDRMæ¶éè¦ä½¿ç¨è®¾å¤çå¯ä¸IDãå¨æ¬ææ¡£ç»å°¾å¤æä¾äºä½ä¸ºåèç示ä¾ä»£ç ç段ã
èå´
æ¬ææä¾æå ³å¦ä½è¯»ååç§Android设å¤ç IDçä»ç»ï¼ç¨ä»¥ä½¿ç¨æ è¯å·ãæ¬æåå®ç¨æ·å·²ç»å®è£ äºAndroid以åå¼ååºç¨ç¨åºå¿ è¦çå·¥å ·ã并ä¸ï¼æ¬æåå®ç¨æ·å·²äºè§£Androidçåºæ¬ç¥è¯ã
ç®ä»
å¨æè½½Androidæä½ç³»ç»ç设å¤ä¸ï¼å·²ç»åå¨å¥½å ç§ç±»åç设å¤æ è¯å·ãå åçææAndroid设å¤é½å ·æçµè¯åè½ï¼å æ¤æ¥æ¾æ¯é¨è®¾å¤ç¡¬ä»¶å¯ä¸çIMEIï¼MEIDï¼æESNä¹å¾å®¹æãä½ä» è½ä½¿ç¨Wifiç设å¤æé³ä¹ææ¾å¨æ²¡æçµè¯ç¡¬ä»¶ï¼æ以没æè¿ç§ç±»åçå¯ä¸æ è¯å·ãæ¬æéè¿°äºå¦ä½è¯»åä¸åAndroid设å¤çæ è¯å·ã
æ£ç´¢Android设å¤IDåç§æ¹å¼
以ä¸æ¯Android设å¤ä¸åç±»åçè¯å«è®¾å¤IDã
· å¯ä¸ç¼å·ï¼IMEIï¼MEIDï¼ESNï¼IMSIï¼
· MACå°å
· åºåå·
· ANDROID_ID
å¯ä¸ç¼å·ï¼IMEIï¼MEIDï¼ESNï¼IMSIï¼
说æå¨ä»¥åï¼å½Android设å¤åä½ä¸ºçµè¯ä½¿ç¨æ¶ï¼å¯»æ¾å¯ä¸æ è¯å·æ¯è¾ç®åï¼ï¼ï¼å¯ç¨äºæ¾å°ï¼åå³äºç½ç»ææ¯ï¼ææºç¡¬ä»¶å¯ä¸çIMEIï¼MEIDï¼ESNåIMSIç¼å·ã
TelephonyManager.getDeviceId
IMEIï¼MEIDï¼ESNï¼IMSIçå®ä¹å¦ä¸ï¼
•IMEIï¼å½é 移å¨è®¾å¤è¯å«ç ï¼å¯ä¸ç¼å·ï¼ç¨äºè¯å« GSMï¼WCDMAææºä»¥åä¸äºå«æçµè¯ï¼ç§»å¨è®¾å¤è¯å«ç ï¼å ¨çå¯ä¸ç¼å·ï¼ç¨äºè¯å«CDMA移å¨çµå°è®¾å¤çç©ç硬件ï¼MEIDåºç°çç®çæ¯å代ESNå·æ®µï¼çµååºåå·ï¼ï¼çµååºåå·ï¼å¯ä¸ç¼å·ï¼ç¨äºè¯å«CDMAææºï¼å½é 移å¨ç¨æ·è¯å«ç ï¼ä¸ææGSMåUMTSç½ç»ææºç¨æ·ç¸å ³èçå¯ä¸è¯å«ç¼å·å¦éè¦æ£ç´¢è®¾å¤çIDï¼å¨é¡¹ç®ä¸è¦ä½¿ç¨ä»¥ä¸ä»£ç ï¼
•MEID
•ESN
•IMSI
import android.telephony.TelephonyManager;
import android.content.Context;
String imeistring = null;
String imsistring = null;
{
TelephonyManager telephonyManager;
telephonyManager =
( TelephonyManager )getSystemService( Context.TELEPHONY_SERVICE );
/*
* getDeviceId() function Returns the unique device ID.
* for example,the IMEI for GSM and the MEID or ESN for CDMA phones.
*/
imeistring = telephonyManager.getDeviceId();
/*
* getSubscriberId() function Returns the unique subscriber ID,
* for example, the IMSI for a GSM phone.
*/
imsistring = telephonyManager.getSubscriberId();
}
å¦è¦åªè¯»åææºçç¶æï¼åéæ·»å READ_PHONE_STATE许å¯å°AndroidManifest.xmlæ件ä¸ã
<uses-permission android:name="android.permission.READ_PHONE_ST
缺ç¹
•Android设å¤è¦å ·æçµè¯åè½
•å ¶å·¥ä½ä¸æ¯å¾å¯é
•åºåå·
•å½å ¶å·¥ä½æ¶ï¼è¯¥å¼ä¿çäºè®¾å¤çé置信æ¯ï¼âæ¢å¤åºå设置âï¼ï¼ä»èå¯ä»¥æ¶é¤å½å®¢æ·å é¤èªå·±è®¾å¤ä¸çä¿¡æ¯ï¼å¹¶æ设å¤è½¬å¦ä¸ä¸ªäººæ¶åççé误ã
Macå°å
说æ
å¯éè¿æ£ç´¢æ¾å°è®¾å¤çWi - Fiæèç硬件çMacå°åãä½æ¯ï¼ä¸æ¨è使ç¨Macå°åä½ä¸ºå¯ä¸çæ è¯å·ã
缺ç¹è®¾å¤è¦å ·å¤Wi â Fiåè½ï¼å¹¶éææç设å¤é½æWi â Fiåè½ï¼å¦æ设å¤ç®åæ£å¨ä½¿ç¨Wi - Fiï¼åä¸è½æ¥åMacå°å
åºåå·
ä»Android 2.3ï¼âå§é¥¼âï¼å¼å§ï¼éè¿android.os.Build.SERIALæ¹æ³åºåå·å¯è¢«ä½¿ç¨ã没æçµè¯åè½ç设å¤ä¹é½éè¦ä¸ç»åºå¯ä¸ç设å¤ID; æäºææºä¹å¯ä»¥éè¦è¿æ ·åãåºåå·å¯ä»¥ç¨äºè¯å«MIDï¼ç§»å¨äºèç½è®¾å¤ï¼æPMPï¼ä¾¿æºå¼åªä½ææ¾å¨ï¼ï¼è¿ä¸¤ç§è®¾å¤é½æ²¡æçµè¯åè½ãéè¿è¯»åç³»ç»å±æ§å¼âro.serialnoâçæ¹æ³ï¼å¯ä»¥ä½¿ç¨åºåå·ä½ä¸ºè®¾å¤ID ã
import java.lang.reflect.Method;
String serialnum = null;
try {
Class<?> c = Class.forName("android.os.SystemProperties");
Method get = c.getMethod("get", String.class, String.class );
serialnum = (String)( get.invoke(c, "ro.serialno", "unknown" ) );
}
catch (Exception ignored)
{
}
缺ç¹
åºåå·æ æ³å¨ææAndroid设å¤ä¸ä½¿ç¨ã
ANDROID_ID
说æ
æ´å ·ä½å°è¯´ï¼Settings.Secure.ANDROID_ID æ¯ä¸ä¸²64ä½çç¼ç ï¼åå è¿å¶çå符串ï¼ï¼æ¯éæºçæç设å¤ç第ä¸ä¸ªå¼å¯¼ï¼å ¶è®°å½çä¸ä¸ªåºå®å¼ï¼éè¿å®å¯ä»¥ç¥é设å¤ç寿å½ï¼å¨è®¾å¤æ¢å¤åºå设置åï¼è¯¥å¼å¯è½ä¼æ¹åï¼ã ANDROID_IDä¹å¯è§ä¸ºä½ä¸ºå¯ä¸è®¾å¤æ è¯å·çä¸ä¸ªå¥½éæ©ãå¦è¦æ£ç´¢ç¨äºè®¾å¤ID çANDROID_IDï¼è¯·åé ä¸é¢ç示ä¾ä»£ç
String androidId = Settings.Secure.getString(getContentResolver(),Settings.Secure.ANDROID_ID);
温馨提示:答案为网友推荐,仅供参考
第1个回答 2015-07-17
可以,
唯一编号有很多种(IMEI,MEID,ESN,IMSI) 比如: telephonyManager = ( TelephonyManager )getSystemService( Context.TELEPHONY_SERVICE ); imeistring = telephonyManager.getDeviceId();
唯一编号有很多种(IMEI,MEID,ESN,IMSI) 比如: telephonyManager = ( TelephonyManager )getSystemService( Context.TELEPHONY_SERVICE ); imeistring = telephonyManager.getDeviceId();
第2个回答 2015-07-17
拨号盘输入*#06#