示例#1
0
 private static Device _initDeviceMetadata(Context paramContext) {
   if (paramContext != null) new Device();
   synchronized (CREATE_DEVICE_METADATA_LOCK) {
     Object localObject2 = UTUtdid.instance(paramContext).getValue();
     Object localObject1;
     if (!StringUtils.isEmpty((String) localObject2)) {
       localObject1 = localObject2;
       if (((String) localObject2).endsWith("\n"))
         localObject1 = ((String) localObject2).substring(0, ((String) localObject2).length() - 1);
       localObject2 = new Device();
     }
     try {
       long l = System.currentTimeMillis();
       String str = PhoneInfoUtils.getImei(paramContext);
       paramContext = PhoneInfoUtils.getImsi(paramContext);
       ((Device) localObject2).setDeviceId(str);
       ((Device) localObject2).setImei(str);
       ((Device) localObject2).setCreateTimestamp(l);
       ((Device) localObject2).setImsi(paramContext);
       ((Device) localObject2).setUtdid((String) localObject1);
       ((Device) localObject2).setCheckSum(getMetadataCheckSum((Device) localObject2));
       return localObject2;
       break label133;
       throw paramContext;
     } finally {
     }
     label133:
     return null;
   }
 }
示例#2
0
 static long getMetadataCheckSum(Device paramDevice) {
   if (paramDevice != null) {
     paramDevice =
         String.format(
             "%s%s%s%s%s",
             new Object[] {
               paramDevice.getUtdid(),
               paramDevice.getDeviceId(),
               Long.valueOf(paramDevice.getCreateTimestamp()),
               paramDevice.getImsi(),
               paramDevice.getImei()
             });
     if (!StringUtils.isEmpty(paramDevice)) {
       Adler32 localAdler32 = new Adler32();
       localAdler32.reset();
       localAdler32.update(paramDevice.getBytes());
       return localAdler32.getValue();
     }
   }
   return 0L;
 }