Skip to content

Commit 31eb2ac

Browse files
Use PlayerPrefs for secure storage while working in the editor - easier to debug (#221)
1 parent c5126d1 commit 31eb2ac

File tree

4 files changed

+29
-2
lines changed

4 files changed

+29
-2
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using UnityEngine;
2+
3+
namespace Sequence.Utils.SecureStorage
4+
{
5+
public class EditorSecureStorage : ISecureStorage
6+
{
7+
public void StoreString(string key, string value)
8+
{
9+
PlayerPrefs.SetString(key, value);
10+
PlayerPrefs.Save();
11+
}
12+
13+
public string RetrieveString(string key)
14+
{
15+
return PlayerPrefs.GetString(key);
16+
}
17+
18+
public EditorSecureStorage()
19+
{
20+
}
21+
}
22+
}

Packages/Sequence-Unity/Sequence/SequenceSDK/Utils/SecureStorage/EditorSecureStorage.cs.meta

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Packages/Sequence-Unity/Sequence/SequenceSDK/Utils/SecureStorage/SecureStorageFactory.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ public static class SecureStorageFactory
77
{
88
public static ISecureStorage CreateSecureStorage()
99
{
10-
#if UNITY_IOS && !UNITY_EDITOR
10+
#if UNITY_EDITOR
11+
return new EditorSecureStorage();
12+
#elif UNITY_IOS && !UNITY_EDITOR
1113
return new iOSKeychainStorage();
1214
#elif UNITY_STANDALONE_OSX || UNITY_EDITOR_OSX
1315
return new MacOSKeychainStorage();

Packages/Sequence-Unity/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "xyz.0xsequence.waas-unity",
3-
"version": "3.14.0",
3+
"version": "3.14.1",
44
"displayName": "Sequence Embedded Wallet SDK",
55
"description": "A Unity SDK for the Sequence WaaS API",
66
"unity": "2021.3",

0 commit comments

Comments
 (0)