标签:
public static String readDeviceUUID() { Object localObject1 = getValidDeviceUUIDByInstant(); if (localObject1 != null) { if (Log.D) Log.d("Temp", "readDeviceUUID() read deivceUUID -->> " + (String)localObject1); return localObject1; } if (Log.D) Log.d("Temp", "readDeviceUUID() create -->> "); StringBuilder localStringBuilder = new StringBuilder(); String str1 = CommonUtil.getDeviceId(); if (!TextUtils.isEmpty(str1)) str1 = str1.trim().replaceAll("-", ""); String str2 = macAddress; if (str2 == null) CommonUtil.getLocalMacAddress(macAddressListener); while (true) { synchronized (macAddressListener) { try { if (!already) { if (Log.D) Log.d("Temp", "mac wait start -->> "); macAddressListener.wait(); if (Log.D) Log.d("Temp", "mac wait end -->> "); } if (macAddress == null) { str2 = ""; if (!TextUtils.isEmpty(str2)) str2 = str2.trim().replaceAll("-|\\.|:", ""); if (!TextUtils.isEmpty(str1)) localStringBuilder.append(str1); localStringBuilder.append("-"); if (!TextUtils.isEmpty(str2)) localStringBuilder.append(str2); String str3 = localStringBuilder.toString(); if (isValidDeviceUUID(str3)) { if (Log.D) Log.d("Temp", "readDeviceUUID() write -->> "); CommonUtil.getJdSharedPreferences().edit().putString("uuid", str3).commit(); } if (Log.D) Log.d("Temp", "readDeviceUUID() create deivceUUID -->> " + str3); localObject1 = str3; } } catch (InterruptedException localInterruptedException) { localInterruptedException.printStackTrace(); continue; } } str2 = macAddress; } }
标签:
原文地址:http://www.cnblogs.com/jiujiudongli/p/4417280.html