码迷,mamicode.com
首页 > 其他好文 > 详细

uuid

时间:2015-04-11 13:04:28      阅读:100      评论:0      收藏:0      [点我收藏+]

标签:

  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;
    }
  }

 

uuid

标签:

原文地址:http://www.cnblogs.com/jiujiudongli/p/4417280.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!