You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The MSIX family name can be calculated without installing it.
Treat the MSIX like a zip.
Get the identity name and identity publisher from the MSIX manifest.
Implement package family name algorithm.
Komac's implementation:
privateconstval hex255 =0xFFprivateconstval binaryRadix =2privateconstval bitGroupsSize =5privateconstval padLength =8/** * Generates the package family name for a given identity name and identity publisher. * * The algorithm takes the following steps: * 1. Calculate the SHA-256 hash of the byte representation of the UTF-16 identity publisher. * 2. Take the first 8 bytes (64 bits) of the SHA-256 hash. * 3. Concatenate each byte of the first 8 bytes, and convert them to binary representation. * 4. Pad the binary value by a single zero bit to the right (left shift all bits). * 5. Group the bits in groups of 5. * 6. For each group, convert the bit representation to an index of the string "0123456789ABCDEFGHJKMNPQRSTVWXYZ" * 7. Join the letters together and make them lowercase. * 8. Append the hash part to the identity name with an underscore as a separator. * * @param identityName a string representing the identity name. * @param identityPublisher a UTF-16 string representing the identity publisher. * @return the package family name generated using the algorithm.*/fungetPackageFamilyName(identityName:String, identityPublisher:String): String {
val hashPart = identityPublisher.encode(Charsets.UTF_16LE)
.sha256()
.substring(0, 8)
.toByteArray()
.map { it.toInt() and hex255 }
.joinToString("") { it.toString(binaryRadix).padStart(padLength, '0') }
.plus('0')
.chunked(bitGroupsSize)
.map { "0123456789ABCDEFGHJKMNPQRSTVWXYZ"[it.toInt(binaryRadix)] }
.joinToString("")
.lowercase()
return"${identityName}_$hashPart"
}
The big thing to note is that 0123456789ABCDEFGHJKMNPQRSTVWXYZ does not include all the letters of the alphabet. It has to be exactly that.
Description of the new feature/enhancement
The MSIX family name can be calculated without installing it.
Komac's implementation:
The big thing to note is that
0123456789ABCDEFGHJKMNPQRSTVWXYZ
does not include all the letters of the alphabet. It has to be exactly that.Proposed technical implementation details (optional)
Useful sources:
The text was updated successfully, but these errors were encountered: