Skip to content

Commit

Permalink
Fix/il2cpp pc exception (#127)
Browse files Browse the repository at this point in the history
* Catch exception and give explanation that IL2CPP not currently supported for social sign in on PC

* Increment package version
  • Loading branch information
BellringerQuinn authored Jun 3, 2024
1 parent 6b321c1 commit affb32a
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
20 changes: 20 additions & 0 deletions Assets/Sequence/SequenceSDK/Authentication/OpenIdAuthenticator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ public void PlatformSpecificSetup()
$"add HKEY_CURRENT_USER\\Software\\Classes\\{_urlScheme}\\shell\\open /f",
$"add HKEY_CURRENT_USER\\Software\\Classes\\{_urlScheme}\\shell\\open\\command /t REG_SZ /d \"\\\"{appPath}\\\" \\\"%1\\\"\" /f",
};
#if ENABLE_MONO
foreach(var args in commands) {
var command = new System.Diagnostics.ProcessStartInfo();
command.FileName = "C:\\Windows\\System32\\reg.exe";
Expand All @@ -252,6 +253,25 @@ public void PlatformSpecificSetup()
command.CreateNoWindow = true;
System.Diagnostics.Process.Start(command);
}
#elif ENABLE_IL2CPP
try
{
foreach(var args in commands) {
var command = new System.Diagnostics.ProcessStartInfo();
command.FileName = "C:\\Windows\\System32\\reg.exe";
command.Arguments = args;
command.UseShellExecute = false;
command.CreateNoWindow = true;
System.Diagnostics.Process.Start(command);
}
}
catch (Exception ex)
{
string message = $"Failed to register URL scheme '{_urlScheme}': {ex.Message}" + "\nSocial sign in is not currently supported on IL2CPP";
Debug.LogWarning(message);
throw new Exception(message);
}
#endif

StartWindowsServer();
#elif UNITY_STANDALONE_OSX
Expand Down
7 changes: 6 additions & 1 deletion Assets/Sequence/SequenceSDK/WaaS/WaaSLogin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,12 @@ public WaaSLogin(IValidator validator = null)

string nonce = SequenceCoder.KeccakHashASCII(_sessionId).EnsureHexPrefix();
_authenticator = new OpenIdAuthenticator(nonce);
_authenticator.PlatformSpecificSetup();
try {
_authenticator.PlatformSpecificSetup();
}
catch (Exception e) {
Debug.LogError($"Error encountered during PlatformSpecificSetup: {e.Message}\nSocial sign in will not work.");
}
Application.deepLinkActivated += _authenticator.HandleDeepLink;
_authenticator.SignedIn += OnSocialLogin;
_authenticator.OnSignInFailed += OnSocialSignInFailed;
Expand Down
2 changes: 1 addition & 1 deletion Assets/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "xyz.0xsequence.waas-unity",
"version": "2.8.2",
"version": "2.8.3",
"displayName": "Sequence Embedded Wallet SDK",
"description": "A Unity SDK for the Sequence WaaS API",
"unity": "2021.3",
Expand Down

0 comments on commit affb32a

Please sign in to comment.