Skip to content

Commit e00275e

Browse files
authored
Merge pull request #112 from HAECHI-LABS/borre/bora-connect-login
feat: Add LoginWithBoraIdToken
2 parents ee9087a + 439c72f commit e00275e

File tree

62 files changed

+1582
-307
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+1582
-307
lines changed

Assets/Editor/FaceBuildMenu.cs

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,48 @@
1+
using Editor;
12
using UnityBuilderAction;
23
using UnityEditor;
4+
using UnityEditor.SceneManagement;
35
using UnityEngine;
46

57
public class FaceBuildMenu : MonoBehaviour
68
{
7-
[MenuItem("FaceWallet/Build Android Dev")]
9+
[MenuItem(("FaceWallet/Dev/Build Android APK"))]
810
static void BuildAndroidDev()
911
{
10-
var newVersion = VersionUpgrader.Upgrade(FaceDeployEnvironment.Dev);
11-
BuildScript.CustomizeForFace(FaceDeployEnvironment.Dev, newVersion);
12+
BuildAndRunAndroidDevInner(false);
13+
}
14+
15+
[MenuItem(("FaceWallet/Dev/Build and Run Android"))]
16+
static void BuildAndRunAndroidDev()
17+
{
18+
BuildAndRunAndroidDevInner(true);
19+
}
20+
21+
[MenuItem("FaceWallet/Dev/Prepare Dev Android Build")]
22+
static void PrepareDevAndroidBuild()
23+
{
24+
BuildScript.CustomizeForFace(FaceDeployEnvironment.Dev);
25+
SetupAndroidKeystore.Setup();
26+
EditorSceneManager.OpenScene(FaceDeployConstants.DevSecnePath);
27+
}
28+
29+
static void BuildAndRunAndroidDevInner(bool run)
30+
{
31+
BuildScript.CustomizeForFace(FaceDeployEnvironment.Dev);
32+
SetupAndroidKeystore.Setup();
1233

1334
BuildPlayerOptions buildPlayerOptions = new BuildPlayerOptions();
1435
buildPlayerOptions.options = BuildOptions.None;
1536
buildPlayerOptions.target = BuildTarget.Android;
37+
if (run)
38+
{
39+
buildPlayerOptions.options |= BuildOptions.AutoRunPlayer;
40+
}
1641

1742
var buildAndroidAndroidAPK = "build/Android/Android.apk";
1843
buildPlayerOptions.locationPathName = buildAndroidAndroidAPK;
1944
BuildPipeline.BuildPlayer(buildPlayerOptions);
2045
Debug.Log("Build success " + buildAndroidAndroidAPK);
2146
EditorUtility.RevealInFinder(buildAndroidAndroidAPK);
2247
}
23-
24-
[MenuItem("FaceWallet/Bump dev version")]
25-
static void BumpDevVersion()
26-
{
27-
VersionUpgrader.Upgrade(FaceDeployEnvironment.Dev);
28-
}
2948
}

Assets/Editor/FaceDeployConstants.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ public class FaceDeployConstants
33
public static string DevAppId = "xyz.facewallet.dev.app";
44
public static string StageAppId = "xyz.facewallet.unity.app";
55

6-
public static string SecnePath =
6+
public static string StageSecnePath =
77
"Packages/haechi.face.unity.sdk/Samples/SampleDapp/Scenes/SampleV2Scene.unity";
8+
9+
public static string DevSecnePath =
10+
"Assets/Scenes/Development/Scenes/DevelopmentV2Scene.unity";
811
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.IO;
2+
using UnityEditor;
3+
using UnityEngine;
4+
5+
namespace Editor
6+
{
7+
public class SetupAndroidKeystore
8+
{
9+
private struct EnvFile
10+
{
11+
public string keystorePassword;
12+
public string keyPassword;
13+
}
14+
15+
public static void Setup()
16+
{
17+
if (File.Exists("./env.json"))
18+
{
19+
Debug.Log("env.json exists. use unity-dev.keystore");
20+
var envFile = File.ReadAllText("./env.json");
21+
var env = JsonUtility.FromJson<EnvFile>(envFile);
22+
23+
PlayerSettings.Android.useCustomKeystore = true;
24+
PlayerSettings.Android.keystoreName = "./unity-dev.keystore";
25+
PlayerSettings.Android.keystorePass = env.keystorePassword;
26+
PlayerSettings.Android.keyaliasName = "unity-dev";
27+
PlayerSettings.Android.keyaliasPass = env.keyPassword;
28+
}
29+
else
30+
{
31+
Debug.LogWarning("env.json not found. You can't use Google log with id token");
32+
PlayerSettings.Android.useCustomKeystore = false;
33+
}
34+
}
35+
}
36+
}

Assets/Editor/SetupAndroidKeystore.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.

Assets/Editor/UnityBuilderAction/BuildScript.cs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,25 @@ public static class BuildScript
1818

1919
private const string FaceDeploymentEnvArgName = "faceDeployEnvironment";
2020

21-
public static void CustomizeForFace(FaceDeployEnvironment deployEnvironment,
22-
VersionUpgrader.Version newVersion)
21+
public static void CustomizeForFace(FaceDeployEnvironment deployEnvironment)
2322
{
24-
EditorBuildSettings.scenes = new[] { new EditorBuildSettingsScene(FaceDeployConstants.SecnePath, true) };
25-
26-
Debug.Log("Application identifier" + PlayerSettings.applicationIdentifier);
23+
EditorBuildSettingsScene[] scenes;
2724
switch (deployEnvironment)
2825
{
2926
case FaceDeployEnvironment.Dev:
3027
PlayerSettings.applicationIdentifier = FaceDeployConstants.DevAppId;
28+
scenes = new[] { new EditorBuildSettingsScene(FaceDeployConstants.DevSecnePath, true) };
3129
break;
3230
case FaceDeployEnvironment.Stage:
3331
PlayerSettings.applicationIdentifier = FaceDeployConstants.StageAppId;
32+
scenes = new[] { new EditorBuildSettingsScene(FaceDeployConstants.StageSecnePath, true) };
3433
break;
3534
default:
3635
throw new ArgumentOutOfRangeException(nameof(deployEnvironment), deployEnvironment, null);
3736
}
37+
EditorBuildSettings.scenes = scenes;
38+
Debug.Log("Application identifier" + PlayerSettings.applicationIdentifier);
39+
Debug.Log("Scenes" + EditorBuildSettings.scenes);
3840

3941
#if UNITY_2022_1_OR_NEWER
4042
PlayerSettings.SetIl2CppCompilerConfiguration(BuildTargetGroup.Android, Il2CppCompilerConfiguration.Debug);
@@ -45,13 +47,13 @@ public static void CustomizeForFace(FaceDeployEnvironment deployEnvironment,
4547
#endif
4648
}
4749

50+
// called from CI
4851
public static void Build()
4952
{
5053
// Gather values from args
5154
Dictionary<string, string> options = GetValidatedOptions();
5255
Enum.TryParse(options[FaceDeploymentEnvArgName], out FaceDeployEnvironment deployEnvironment);
53-
var version = VersionUpgrader.Upgrade(deployEnvironment);
54-
CustomizeForFace(deployEnvironment, version);
56+
CustomizeForFace(deployEnvironment);
5557

5658
// Set version for this build
5759
PlayerSettings.bundleVersion = options["buildVersion"];
Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
4-
<dict>
5-
<key>CLIENT_ID</key>
6-
<string>965931844205-tt978gju3l3fa97amqp431falebfrqu7.apps.googleusercontent.com</string>
7-
<key>REVERSED_CLIENT_ID</key>
8-
<string>com.googleusercontent.apps.965931844205-tt978gju3l3fa97amqp431falebfrqu7</string>
9-
<key>ANDROID_CLIENT_ID</key>
10-
<string>965931844205-7ioqn3tai0vdc1mlc6r5728ij3blbttj.apps.googleusercontent.com</string>
11-
<key>API_KEY</key>
12-
<string>AIzaSyAvBatVlo9V73euhDqY6-9rhSidGacttz0</string>
13-
<key>GCM_SENDER_ID</key>
14-
<string>965931844205</string>
15-
<key>PLIST_VERSION</key>
16-
<string>1</string>
17-
<key>BUNDLE_ID</key>
18-
<string>xyz.facewallet.dev.app</string>
19-
<key>PROJECT_ID</key>
20-
<string>sample-unity-9312c</string>
21-
<key>STORAGE_BUCKET</key>
22-
<string>sample-unity-9312c.appspot.com</string>
23-
<key>IS_ADS_ENABLED</key>
24-
<false></false>
25-
<key>IS_ANALYTICS_ENABLED</key>
26-
<false></false>
27-
<key>IS_APPINVITE_ENABLED</key>
28-
<true></true>
29-
<key>IS_GCM_ENABLED</key>
30-
<true></true>
31-
<key>IS_SIGNIN_ENABLED</key>
32-
<true></true>
33-
<key>GOOGLE_APP_ID</key>
34-
<string>1:965931844205:ios:5e72d2a1de14c881cd7564</string>
35-
</dict>
4+
<dict>
5+
<key>CLIENT_ID</key>
6+
<string>478075746592-mkvlpvmo7hgo5bj9qjpbsgetcc6ae377.apps.googleusercontent.com</string>
7+
<key>REVERSED_CLIENT_ID</key>
8+
<string>com.googleusercontent.apps.478075746592-mkvlpvmo7hgo5bj9qjpbsgetcc6ae377</string>
9+
<key>ANDROID_CLIENT_ID</key>
10+
<string>478075746592-98ta7a9j4c1tdlneh6aavquum61fvo9f.apps.googleusercontent.com</string>
11+
<key>API_KEY</key>
12+
<string>AIzaSyD07NPr8EtV-uA5RTKkQbH0eJ2NW8bbjd0</string>
13+
<key>GCM_SENDER_ID</key>
14+
<string>478075746592</string>
15+
<key>PLIST_VERSION</key>
16+
<string>1</string>
17+
<key>BUNDLE_ID</key>
18+
<string>xyz.facewallet.dev.app</string>
19+
<key>PROJECT_ID</key>
20+
<string>prj-d-face</string>
21+
<key>STORAGE_BUCKET</key>
22+
<string>prj-d-face.appspot.com</string>
23+
<key>IS_ADS_ENABLED</key>
24+
<false></false>
25+
<key>IS_ANALYTICS_ENABLED</key>
26+
<false></false>
27+
<key>IS_APPINVITE_ENABLED</key>
28+
<true></true>
29+
<key>IS_GCM_ENABLED</key>
30+
<true></true>
31+
<key>IS_SIGNIN_ENABLED</key>
32+
<true></true>
33+
<key>GOOGLE_APP_ID</key>
34+
<string>1:478075746592:ios:123588656cf50808997f45</string>
35+
</dict>
3636
</plist>

Assets/GoogleService-Info-Dev.plist.meta

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/GoogleService-Info-Prod.plist

Lines changed: 0 additions & 36 deletions
This file was deleted.

Assets/GoogleService-Info-Prod.plist.meta

Lines changed: 0 additions & 3 deletions
This file was deleted.

Assets/GoogleService-Info.plist

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@
33
<plist version="1.0">
44
<dict>
55
<key>CLIENT_ID</key>
6-
<string>965931844205-hdpefgeadompe0kmlgk7c5t7i082g2nk.apps.googleusercontent.com</string>
6+
<string>478075746592-a340dq6qurvkm9ovhv2n4k1hjvb0ttdm.apps.googleusercontent.com</string>
77
<key>REVERSED_CLIENT_ID</key>
8-
<string>com.googleusercontent.apps.965931844205-hdpefgeadompe0kmlgk7c5t7i082g2nk</string>
8+
<string>com.googleusercontent.apps.478075746592-a340dq6qurvkm9ovhv2n4k1hjvb0ttdm</string>
99
<key>ANDROID_CLIENT_ID</key>
10-
<string>965931844205-7ioqn3tai0vdc1mlc6r5728ij3blbttj.apps.googleusercontent.com</string>
10+
<string>478075746592-98ta7a9j4c1tdlneh6aavquum61fvo9f.apps.googleusercontent.com</string>
1111
<key>API_KEY</key>
12-
<string>AIzaSyAvBatVlo9V73euhDqY6-9rhSidGacttz0</string>
12+
<string>AIzaSyD07NPr8EtV-uA5RTKkQbH0eJ2NW8bbjd0</string>
1313
<key>GCM_SENDER_ID</key>
14-
<string>965931844205</string>
14+
<string>478075746592</string>
1515
<key>PLIST_VERSION</key>
1616
<string>1</string>
1717
<key>BUNDLE_ID</key>
1818
<string>xyz.facewallet.unity.app</string>
1919
<key>PROJECT_ID</key>
20-
<string>sample-unity-9312c</string>
20+
<string>prj-d-face</string>
2121
<key>STORAGE_BUCKET</key>
22-
<string>sample-unity-9312c.appspot.com</string>
22+
<string>prj-d-face.appspot.com</string>
2323
<key>IS_ADS_ENABLED</key>
2424
<false></false>
2525
<key>IS_ANALYTICS_ENABLED</key>
@@ -31,6 +31,6 @@
3131
<key>IS_SIGNIN_ENABLED</key>
3232
<true></true>
3333
<key>GOOGLE_APP_ID</key>
34-
<string>1:965931844205:ios:66b6e4cff25a145acd7564</string>
34+
<string>1:478075746592:ios:e914f70491de9971997f45</string>
3535
</dict>
3636
</plist>

0 commit comments

Comments
 (0)