public static UDN valueOf(String udnString) { return new UDN(udnString.startsWith(PREFIX) ? udnString.substring(PREFIX.length()) : udnString); }
public void setString(String s) throws InvalidHeaderException { if (!s.startsWith(UDN.PREFIX) || !s.endsWith(ROOT_DEVICE_SUFFIX)) { throw new InvalidHeaderException( "Invalid root device USN header value, must start with '" + UDN.PREFIX + "' and end with '" + ROOT_DEVICE_SUFFIX + "' but is '" + s + "'" ); } UDN udn = new UDN(s.substring(UDN.PREFIX.length(), s.length() - ROOT_DEVICE_SUFFIX.length())); setValue(udn); }
public void setString(String s) throws InvalidHeaderException { if (!s.startsWith(UDN.PREFIX)) { throw new InvalidHeaderException("Invalid UDA header value, must start with '"+UDN.PREFIX+"': " + s); } if (s.contains("::urn")) { throw new InvalidHeaderException("Invalid UDA header value, must not contain '::urn': " + s); } UDN udn = new UDN( s.substring(UDN.PREFIX.length()) ); setValue(udn); }
return new UDN( new UUID( new BigInteger(-1, hash).longValue(),
public static UDN valueOf(String udnString) { return new UDN(udnString.startsWith(PREFIX) ? udnString.substring(PREFIX.length()) : udnString); }
public static UDN uniqueSystemIdentifier(String salt) { StringBuilder systemSalt = new StringBuilder(); systemSalt.append(Build.MANUFACTURER); systemSalt.append(Build.MODEL); systemSalt.append(Build.SERIAL); Log.d(TAG, systemSalt.toString()); try { byte[] hash = MessageDigest.getInstance("MD5").digest(systemSalt.toString().getBytes()); return new UDN(new UUID(new BigInteger(-1, hash).longValue(), salt.hashCode())); } catch (Exception ex) { throw new RuntimeException(ex); } }
public void setString(String s) throws InvalidHeaderException { if (!s.startsWith(UDN.PREFIX) || !s.endsWith(ROOT_DEVICE_SUFFIX)) { throw new InvalidHeaderException( "Invalid root device USN header value, must start with '" + UDN.PREFIX + "' and end with '" + ROOT_DEVICE_SUFFIX + "' but is '" + s + "'" ); } UDN udn = new UDN(s.substring(UDN.PREFIX.length(), s.length() - ROOT_DEVICE_SUFFIX.length())); setValue(udn); }
public void setString(String s) throws InvalidHeaderException { if (!s.startsWith(UDN.PREFIX)) { throw new InvalidHeaderException("Invalid UDA header value, must start with '"+UDN.PREFIX+"': " + s); } if (s.contains("::urn")) { throw new InvalidHeaderException("Invalid UDA header value, must not contain '::urn': " + s); } UDN udn = new UDN( s.substring(UDN.PREFIX.length()) ); setValue(udn); }
try { byte[] hash = MessageDigest.getInstance("MD5").digest(systemSalt.toString().getBytes()); return new UDN( new UUID( new BigInteger(-1, hash).longValue(),
public static UDN valueOf(String udnString) { return new UDN(udnString.startsWith(PREFIX) ? udnString.substring(PREFIX.length()) : udnString); }
public void setString(String s) throws InvalidHeaderException { if (!s.startsWith(UDN.PREFIX) || !s.endsWith(ROOT_DEVICE_SUFFIX)) { throw new InvalidHeaderException( "Invalid root device USN header value, must start with '" + UDN.PREFIX + "' and end with '" + ROOT_DEVICE_SUFFIX + "' but is '" + s + "'" ); } UDN udn = new UDN(s.substring(UDN.PREFIX.length(), s.length() - ROOT_DEVICE_SUFFIX.length())); setValue(udn); }
public void setString(String s) throws InvalidHeaderException { if (!s.startsWith(UDN.PREFIX)) { throw new InvalidHeaderException("Invalid UDA header value, must start with '"+UDN.PREFIX+"': " + s); } if (s.contains("::urn")) { throw new InvalidHeaderException("Invalid UDA header value, must not contain '::urn': " + s); } UDN udn = new UDN( s.substring(UDN.PREFIX.length()) ); setValue(udn); }
return new UDN( new UUID( new BigInteger(-1, hash).longValue(),
generateContentTask.execute(context); udn = new UDN(UUID.randomUUID()); DeviceType type = new UDADeviceType(deviceType, version);