False OVRPlugin change detection from Meta XR Core SDK v63
From Meta XR Core SDK v63, the "Changes to OVRPlugin detected" dialog appears even without any plugin changes.
I discovered that OculusProjectConfig.asset contains hashes of the plugin's FULL PATH from v63. This means that simply moving the project or sharing it among team members triggers a false "Restart Unity" dialog.
From OVRPluginInfoOpenXR.cs:
string md5Win64Actual = GetFileChecksum(Path.GetFullPath(PluginRelPathWin64));
string md5AndroidActual = GetFileChecksum(Path.GetFullPath(PluginRelPathAndroid));
v62:
private static string GetFileChecksum(string filePath)
{
using var md5 = new MD5CryptoServiceProvider();
byte[] buffer = md5.ComputeHash(File.ReadAllBytes(filePath));
return string.Join(null, buffer.Select(b => b.ToString("x2")));
}
v63:
private static string GetFileChecksum(string filePath)
{
using var md5 = new MD5CryptoServiceProvider();
byte[] buffer = md5.ComputeHash(File.ReadAllBytes(filePath));
byte[] pathBuffer = md5.ComputeHash(Encoding.UTF8.GetBytes(filePath));
return string.Join(null, buffer.Select(b => b.ToString("x2"))) + string.Join(null, pathBuffer.Select(b => b.ToString("x2")));
}
I encountered the issue when I updated my project to v64 and just commited the change to GitHub. My CI automated build started crashing due to the incorrect plugin change detection and I struggled to find the cause for hours...
I believe this behaviour is unexpected, and the change should be reverted.
