Reference:
https://blog.csdn.net/njweiyukun/article/details/54024442
https://blog.csdn.net/voler_hjl/article/details/53788126
http://www.520monkey.com/archives/1277
CodePudding user response:
Calculated in accordance with the following code imei value is only 14, I * # 06 # found out on mobile phones is 15, don't know this have any effect?package com. CND. Wechat;
Import the Java. IO. The File;
Import the Java. IO. FileInputStream;
Import the Java. IO. ObjectInputStream;
import java.util.Map;
Public class MainTest {
/* *
* @ param args
*/
Public static void main (String [] args) {
//TODO Auto - generated method stub
The File xmlFile=new File (" E: \ \ nexus6p \ \ MicroMsg_source \ \ CompatibleInfo CFG ");
GetDate (xmlFile, 0, null);
System. The out. Println (" -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - fuck ");
}
@ SuppressWarnings ({" resource ", "unchecked"})
Public static Object getDate (File cfgFile, int dataKey, Class<?> Clazz) {
FileInputStream fis=null;
Try {
Fis=new FileInputStream (cfgFile);
ObjectInputStream ois=new ObjectInputStream (fis);
MapMaps=(Map ) Ois. ReadObject ();
For (Integer key: maps. KeySet ()) {
System. The out. Println (" key: "+ key +", value: "+ maps. Get (key));
} the if (clazz==Integer. Class) {
Return (Integer) maps. Get (dataKey);
} else if (clazz==String class) {
Return (String) maps. Get (dataKey);
}
} the catch (Exception e) {
System. The out. Println (" get wx uin excepiton: "+ e);
}
return null;
}
}