com.xd.sdk.account 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/Mobile/Editor/XD.SDK.Account.Mobile.Editor.asmdef +20 -0
  2. package/Mobile/Editor/XD.SDK.Account.Mobile.Editor.asmdef.meta +7 -0
  3. package/Mobile/Editor/XDAccountMobileProcessBuild.cs +20 -0
  4. package/Mobile/Editor/XDAccountMobileProcessBuild.cs.meta +11 -0
  5. package/Mobile/Editor.meta +8 -0
  6. package/Mobile/Http/XDGAccountHttpConfigMobile.cs +36 -0
  7. package/Mobile/Http/XDGAccountHttpConfigMobile.cs.meta +11 -0
  8. package/Mobile/Http.meta +8 -0
  9. package/Mobile/Plugins/Android/com/xd/account/bridge/XDGAccountBridge.java +15 -0
  10. package/Mobile/Plugins/Android/com/xd/account/bridge/XDGAccountBridge.java.meta +32 -0
  11. package/Mobile/Plugins/Android/com/xd/account/bridge.meta +8 -0
  12. package/Mobile/Plugins/Android/com/xd/account.meta +8 -0
  13. package/Mobile/Plugins/Android/com/xd.meta +8 -0
  14. package/Mobile/Plugins/Android/com.meta +8 -0
  15. package/Mobile/Plugins/Android.meta +8 -0
  16. package/Mobile/Plugins/iOS/XDAccountBridge.m +26 -0
  17. package/Mobile/Plugins/iOS/XDAccountBridge.m.meta +37 -0
  18. package/Mobile/Plugins/iOS.meta +8 -0
  19. package/Mobile/Plugins.meta +8 -0
  20. package/Mobile/User/UserManagerMobile.cs +45 -0
  21. package/Mobile/User/UserManagerMobile.cs.meta +3 -0
  22. package/Mobile/User.meta +3 -0
  23. package/Mobile/XD.SDK.Account.Mobile.asmdef +23 -0
  24. package/Mobile/XD.SDK.Account.Mobile.asmdef.meta +7 -0
  25. package/Mobile/XDGAccountMobile.cs +132 -0
  26. package/Mobile/XDGAccountMobile.cs.meta +11 -0
  27. package/Mobile/XDGAccountMobileImpl.cs +421 -0
  28. package/Mobile/XDGAccountMobileImpl.cs.meta +11 -0
  29. package/Mobile/XDGTokenManager.cs +116 -0
  30. package/Mobile/XDGTokenManager.cs.meta +3 -0
  31. package/Mobile/XDGUserWrapper.cs +167 -0
  32. package/Mobile/XDGUserWrapper.cs.meta +11 -0
  33. package/Mobile.meta +8 -0
  34. package/Plugins/Android/libs/XDGAccount_6.21.1.aar +0 -0
  35. package/Plugins/Android/libs/XDGAccount_6.21.1.aar.meta +32 -0
  36. package/Plugins/Android/libs.meta +8 -0
  37. package/Plugins/Android.meta +8 -0
  38. package/Plugins/iOS/XDAccountSDK.framework/Headers/TDSGlobalThirdPartyLoginHelper.h +61 -0
  39. package/Plugins/iOS/XDAccountSDK.framework/Headers/TDSGlobalThirdPartyLoginHelper.h.meta +7 -0
  40. package/Plugins/iOS/XDAccountSDK.framework/Headers/TDSGlobalThirdPartyLoginManager.h +47 -0
  41. package/Plugins/iOS/XDAccountSDK.framework/Headers/TDSGlobalThirdPartyLoginManager.h.meta +7 -0
  42. package/Plugins/iOS/XDAccountSDK.framework/Headers/XDAccountSDK.h +24 -0
  43. package/Plugins/iOS/XDAccountSDK.framework/Headers/XDAccountSDK.h.meta +7 -0
  44. package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGAccount.h +69 -0
  45. package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGAccount.h.meta +7 -0
  46. package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGAccountVersion.h +8 -0
  47. package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGAccountVersion.h.meta +7 -0
  48. package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGLogger+Account.h +21 -0
  49. package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGLogger+Account.h.meta +7 -0
  50. package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGLoginEntriesConfig.h +16 -0
  51. package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGLoginEntriesConfig.h.meta +7 -0
  52. package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGLoginService.h +47 -0
  53. package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGLoginService.h.meta +7 -0
  54. package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGPhoneAuthManager.h +33 -0
  55. package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGPhoneAuthManager.h.meta +7 -0
  56. package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGTapLoginPermissionDialog.h +23 -0
  57. package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGTapLoginPermissionDialog.h.meta +7 -0
  58. package/Plugins/iOS/XDAccountSDK.framework/Headers.meta +8 -0
  59. package/Plugins/iOS/XDAccountSDK.framework/Info.plist +0 -0
  60. package/Plugins/iOS/XDAccountSDK.framework/Info.plist.meta +7 -0
  61. package/Plugins/iOS/XDAccountSDK.framework/Modules/module.modulemap +6 -0
  62. package/Plugins/iOS/XDAccountSDK.framework/Modules/module.modulemap.meta +7 -0
  63. package/Plugins/iOS/XDAccountSDK.framework/Modules.meta +8 -0
  64. package/Plugins/iOS/XDAccountSDK.framework/XDAccountSDK +0 -0
  65. package/Plugins/iOS/XDAccountSDK.framework/XDAccountSDK.meta +7 -0
  66. package/Plugins/iOS/XDAccountSDK.framework.meta +28 -0
  67. package/Plugins/iOS.meta +8 -0
  68. package/Plugins.meta +8 -0
  69. package/README.md +0 -0
  70. package/README.md.meta +7 -0
  71. package/Runtime/Editor/XD.SDK.Account.Editor.asmdef +19 -0
  72. package/Runtime/Editor/XD.SDK.Account.Editor.asmdef.meta +7 -0
  73. package/Runtime/Editor/XDAccountProcessBuild.cs +18 -0
  74. package/Runtime/Editor/XDAccountProcessBuild.cs.meta +11 -0
  75. package/Runtime/Editor.meta +8 -0
  76. package/Runtime/IXDGAccount.cs +42 -0
  77. package/Runtime/IXDGAccount.cs.meta +3 -0
  78. package/Runtime/Internal/Http/IXDAccountHttpConfig.cs +9 -0
  79. package/Runtime/Internal/Http/IXDAccountHttpConfig.cs.meta +11 -0
  80. package/Runtime/Internal/Http/XDAccountHttpConfig.cs +32 -0
  81. package/Runtime/Internal/Http/XDAccountHttpConfig.cs.meta +11 -0
  82. package/Runtime/Internal/Http.meta +8 -0
  83. package/Runtime/Internal/User/IUserManagerPlatformWrapper.cs +7 -0
  84. package/Runtime/Internal/User/IUserManagerPlatformWrapper.cs.meta +3 -0
  85. package/Runtime/Internal/User.meta +3 -0
  86. package/Runtime/Internal.meta +8 -0
  87. package/Runtime/UserManager.cs +35 -0
  88. package/Runtime/UserManager.cs.meta +3 -0
  89. package/Runtime/XD.SDK.Account.asmdef +16 -0
  90. package/Runtime/XD.SDK.Account.asmdef.meta +7 -0
  91. package/Runtime/XDGAccessToken.cs +18 -0
  92. package/Runtime/XDGAccessToken.cs.meta +3 -0
  93. package/Runtime/XDGAccount.cs +123 -0
  94. package/Runtime/XDGAccount.cs.meta +3 -0
  95. package/Runtime/XDGLoginType.cs +28 -0
  96. package/Runtime/XDGLoginType.cs.meta +3 -0
  97. package/Runtime/XDGUser.cs +30 -0
  98. package/Runtime/XDGUser.cs.meta +3 -0
  99. package/Runtime/XDGUserStatusCode.cs +16 -0
  100. package/Runtime/XDGUserStatusCode.cs.meta +3 -0
  101. package/Runtime.meta +3 -0
  102. package/package.json +11 -0
  103. package/package.json.meta +7 -0
@@ -0,0 +1,23 @@
1
+ //
2
+ // XDGTapLoginPermissionDialog.h
3
+ // XDAccountSDK
4
+ //
5
+ // Created by Fattycat on 2023/10/7.
6
+ //
7
+
8
+ #import <UIKit/UIKit.h>
9
+ #import <XDCommonSDK/XDGBaseDialog.h>
10
+
11
+ NS_ASSUME_NONNULL_BEGIN
12
+
13
+ typedef void (^XDGTapLoginPermissionCheckHandler)(NSString *permission, bool checkd);
14
+ typedef void (^XDGTapLoginPermissionHandler)(NSArray *_Nullable permissionArray, bool close);
15
+
16
+ @interface XDGTapLoginPermissionDialog : XDGBaseDialog
17
+ @property (nonatomic, copy)XDGTapLoginPermissionHandler handler;
18
+ - (instancetype)initWithPermissions:(NSArray *)permissions handler:(XDGTapLoginPermissionHandler)handler;
19
+
20
+ + (UIView *)generatePermissionViewWithCheckHandler:(XDGTapLoginPermissionCheckHandler)handler permissions:(NSArray *)permissions;
21
+ @end
22
+
23
+ NS_ASSUME_NONNULL_END
@@ -0,0 +1,7 @@
1
+ fileFormatVersion: 2
2
+ guid: 0f171ffb5053644acb424b8b8560076e
3
+ DefaultImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant:
@@ -0,0 +1,8 @@
1
+ fileFormatVersion: 2
2
+ guid: 3ac66aa6bd48f49b0b20e06dae06f827
3
+ folderAsset: yes
4
+ DefaultImporter:
5
+ externalObjects: {}
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant:
@@ -0,0 +1,7 @@
1
+ fileFormatVersion: 2
2
+ guid: 6a13a2439550e455ab66910eca8a2d09
3
+ DefaultImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant:
@@ -0,0 +1,6 @@
1
+ framework module XDAccountSDK {
2
+ umbrella header "XDAccountSDK.h"
3
+ export *
4
+
5
+ module * { export * }
6
+ }
@@ -0,0 +1,7 @@
1
+ fileFormatVersion: 2
2
+ guid: a120d2dcbb0d74178a545ca273bb0ba2
3
+ DefaultImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant:
@@ -0,0 +1,8 @@
1
+ fileFormatVersion: 2
2
+ guid: 3ccc53369a2174f6da6eeb79c7b27991
3
+ folderAsset: yes
4
+ DefaultImporter:
5
+ externalObjects: {}
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant:
@@ -0,0 +1,7 @@
1
+ fileFormatVersion: 2
2
+ guid: cf552a32a65a84937bc2319a694ee867
3
+ DefaultImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant:
@@ -0,0 +1,28 @@
1
+ fileFormatVersion: 2
2
+ guid: aa2c9c4a67fa44bc1862ebd1f8c700c4
3
+ folderAsset: yes
4
+ PluginImporter:
5
+ externalObjects: {}
6
+ serializedVersion: 2
7
+ iconMap: {}
8
+ executionOrder: {}
9
+ defineConstraints: []
10
+ isPreloaded: 0
11
+ isOverridable: 0
12
+ isExplicitlyReferenced: 0
13
+ validateReferences: 1
14
+ platformData:
15
+ - first:
16
+ Any:
17
+ second:
18
+ enabled: 1
19
+ settings: {}
20
+ - first:
21
+ Editor: Editor
22
+ second:
23
+ enabled: 0
24
+ settings:
25
+ DefaultValueInitialized: true
26
+ userData:
27
+ assetBundleName:
28
+ assetBundleVariant:
@@ -0,0 +1,8 @@
1
+ fileFormatVersion: 2
2
+ guid: 726d804c3a8864751833ecaddfcca99d
3
+ folderAsset: yes
4
+ DefaultImporter:
5
+ externalObjects: {}
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant:
package/Plugins.meta ADDED
@@ -0,0 +1,8 @@
1
+ fileFormatVersion: 2
2
+ guid: 9feaa06939a844b66b6abc373c121767
3
+ folderAsset: yes
4
+ DefaultImporter:
5
+ externalObjects: {}
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant:
package/README.md ADDED
File without changes
package/README.md.meta ADDED
@@ -0,0 +1,7 @@
1
+ fileFormatVersion: 2
2
+ guid: 0bcd50ac8e2f349fa91e40dddb81faff
3
+ TextScriptImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant:
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "XD.SDK.Account.Editor",
3
+ "references": [
4
+ "GUID:616cea76def2d4f059b94440fc8cc03d",
5
+ "GUID:0acc523941302664db1f4e527237feb3",
6
+ "GUID:27619889b8ba8c24980f49ee34dbb44a"
7
+ ],
8
+ "includePlatforms": [
9
+ "Editor"
10
+ ],
11
+ "excludePlatforms": [],
12
+ "allowUnsafeCode": false,
13
+ "overrideReferences": false,
14
+ "precompiledReferences": [],
15
+ "autoReferenced": true,
16
+ "defineConstraints": [],
17
+ "versionDefines": [],
18
+ "noEngineReferences": false
19
+ }
@@ -0,0 +1,7 @@
1
+ fileFormatVersion: 2
2
+ guid: 3707cefbba3dd43a7901cf420e913481
3
+ AssemblyDefinitionImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant:
@@ -0,0 +1,18 @@
1
+ using System;
2
+ using TapTap.Common.Editor;
3
+ using UnityEditor.Build.Reporting;
4
+
5
+ namespace XD.SDK.Account.Editor
6
+ {
7
+ public class XDAccountProcessBuild : SDKLinkProcessBuild {
8
+ public override int callbackOrder => 5;
9
+
10
+ public override string LinkPath => "XDSDK/Gen/Account/link.xml";
11
+
12
+ public override LinkedAssembly[] LinkedAssemblies => new LinkedAssembly[] {
13
+ new LinkedAssembly { Fullname = "XD.SDK.Account" },
14
+ };
15
+
16
+ public override Func<BuildReport, bool> IsTargetPlatform => (report) => true;
17
+ }
18
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 5d05c60017b80487a8f097d8d6eba5da
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,8 @@
1
+ fileFormatVersion: 2
2
+ guid: c534b35c21752465bb2213bd5c12f772
3
+ folderAsset: yes
4
+ DefaultImporter:
5
+ externalObjects: {}
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant:
@@ -0,0 +1,42 @@
1
+ using System;
2
+ using System.Collections.Generic;
3
+ using XD.SDK.Common;
4
+ using LoginType = XD.SDK.Account.LoginType;
5
+
6
+ namespace XD.SDK.Account{
7
+ public interface IXDGAccount
8
+ {
9
+ void Login(List<LoginType> loginTypes, Action<XDGUser> callback,
10
+ Action<XDGError> errorCallback);
11
+
12
+ void LoginByType(LoginType loginType, Action<XDGUser> callback,
13
+ Action<XDGError> errorCallback);
14
+
15
+ /// <summary>
16
+ /// 发行在主机(Steam/PS/Nintendo)上的游戏的自动登录接口
17
+ /// </summary>
18
+ /// <param name="successCallback">该主机的账号注册过心动账号,那么会返回登录成功(第二次登录的时候,如果主机账号没有发生改变,会直接返回登录成功,略过网络请求)</param>
19
+ /// <param name="failCallback">该主机的账号未注册过心动账号,那么会返回失败。这个时候需要调用LoginByType登录</param>
20
+ /// <param name="errorCallback">网络请求错误或者非主机平台的游戏调用,以及其他错误</param>
21
+ void LoginByConsole(Action<XDGUser> successCallback, Action failCallback,
22
+ Action<XDGError> errorCallback);
23
+
24
+
25
+ void Logout();
26
+
27
+ void AddUserStatusChangeCallback(Action<XDGUserStatusCodeType, string> callback);
28
+
29
+ void GetUser(Action<XDGUser> callback, Action<XDGError> errorCallback);
30
+
31
+ void OpenUserCenter();
32
+
33
+ void OpenUnregister();
34
+
35
+ //641 FB token
36
+ void IsTokenActiveWithType(LoginType loginType, Action<bool> callback);
37
+
38
+ //除了 Default 和 Guest
39
+ void BindByType(LoginType loginType, Action<bool, XDGError> callback);
40
+
41
+ }
42
+ }
@@ -0,0 +1,3 @@
1
+ fileFormatVersion: 2
2
+ guid: 8ea1514342024f7d9d492a9ba914bcb7
3
+ timeCreated: 1672754863
@@ -0,0 +1,9 @@
1
+ using System.Collections.Generic;
2
+ using System.Threading.Tasks;
3
+ using System.Net.Http;
4
+
5
+ namespace XD.SDK.Account.Internal {
6
+ public interface IXDAccountHttpConfig {
7
+ Task<Dictionary<string, string>> GetAuthorizationHeaders(HttpRequestMessage request, long timestamp);
8
+ }
9
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 75ab08cb48bba41d1af6f0de4856d893
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,32 @@
1
+ using System;
2
+ using System.Linq;
3
+ using System.Collections.Generic;
4
+ using System.Threading.Tasks;
5
+ using System.Net.Http;
6
+ using XD.SDK.Common;
7
+ using XD.SDK.Common.Internal;
8
+ using UnityEngine;
9
+
10
+ namespace XD.SDK.Account.Internal {
11
+ public class XDAccountHttpConfig {
12
+ private static IXDAccountHttpConfig platformWrapper;
13
+
14
+ public static void Init() {
15
+ var interfaceType = typeof(IXDAccountHttpConfig);
16
+ var platformInterfaceType = AppDomain.CurrentDomain.GetAssemblies()
17
+ .SelectMany(assembly => assembly.GetTypes())
18
+ .FirstOrDefault(clazz => interfaceType.IsAssignableFrom(clazz) && clazz.IsClass);
19
+ if (platformInterfaceType != null) {
20
+ platformWrapper = Activator.CreateInstance(platformInterfaceType) as IXDAccountHttpConfig;
21
+
22
+ XDHttpClientFactory.RegisterHeadersTaskFunc(GetAuthorizationHeaders);
23
+ } else {
24
+ XDGLogger.Error($"No class implements {interfaceType} Type. Current Platform: {Application.platform}, if you are using Editor, please check if you have installed XDSDK pc module.");
25
+ }
26
+ }
27
+
28
+ public static Task<Dictionary<string, string>> GetAuthorizationHeaders(HttpRequestMessage request, long timestamp) {
29
+ return platformWrapper.GetAuthorizationHeaders(request, timestamp);
30
+ }
31
+ }
32
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 826b8a37798b64a36a9c21566c9c7192
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,8 @@
1
+ fileFormatVersion: 2
2
+ guid: d40702510bc8b4c139675c3290a1eded
3
+ folderAsset: yes
4
+ DefaultImporter:
5
+ externalObjects: {}
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant:
@@ -0,0 +1,7 @@
1
+ namespace XD.SDK.Account.Internal
2
+ {
3
+ public interface IUserManagerPlatformWrapper
4
+ {
5
+ XDGUser GetCurrentUser();
6
+ }
7
+ }
@@ -0,0 +1,3 @@
1
+ fileFormatVersion: 2
2
+ guid: 44830d6b009a4877b9e1ae76f2d40341
3
+ timeCreated: 1716359633
@@ -0,0 +1,3 @@
1
+ fileFormatVersion: 2
2
+ guid: ce9cdb82ff6140aaa1f6ff38a58cda76
3
+ timeCreated: 1716359418
@@ -0,0 +1,8 @@
1
+ fileFormatVersion: 2
2
+ guid: 4e09c26405b564b47bdb6137ed3058fe
3
+ folderAsset: yes
4
+ DefaultImporter:
5
+ externalObjects: {}
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant:
@@ -0,0 +1,35 @@
1
+ using System;
2
+ using System.Linq;
3
+ using UnityEngine;
4
+ using XD.SDK.Account.Internal;
5
+ using XD.SDK.Common;
6
+
7
+ namespace XD.SDK.Account
8
+ {
9
+ public class UserManager
10
+ {
11
+ private static IUserManagerPlatformWrapper _platformWrapper;
12
+
13
+ public static void Init()
14
+ {
15
+ var interfaceType = typeof(IUserManagerPlatformWrapper);
16
+ var platformInterfaceType = AppDomain.CurrentDomain.GetAssemblies()
17
+ .SelectMany(assembly => assembly.GetTypes())
18
+ .FirstOrDefault(clazz => interfaceType.IsAssignableFrom(clazz) && clazz.IsClass);
19
+
20
+ if (platformInterfaceType != null)
21
+ {
22
+ _platformWrapper = Activator.CreateInstance(platformInterfaceType) as IUserManagerPlatformWrapper;
23
+ }
24
+ else
25
+ {
26
+ XDGLogger.Error($"No class implements {interfaceType} Type. Current Platform : {Application.platform}, if you are using Editor, , please check if you have installed XDSDK pc module.");
27
+ }
28
+ }
29
+
30
+ public static XDGUser GetCurrentUser()
31
+ {
32
+ return _platformWrapper.GetCurrentUser();
33
+ }
34
+ }
35
+ }
@@ -0,0 +1,3 @@
1
+ fileFormatVersion: 2
2
+ guid: a324bccdf7754263b9974f1b591e6420
3
+ timeCreated: 1716359672
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "XD.SDK.Account",
3
+ "references": [
4
+ "GUID:0b3f64ec33f5b4da98a17367a35b82f2",
5
+ "GUID:271a06ab0780d4a5ea46c9c3be2ab5dc"
6
+ ],
7
+ "includePlatforms": [],
8
+ "excludePlatforms": [],
9
+ "allowUnsafeCode": false,
10
+ "overrideReferences": false,
11
+ "precompiledReferences": [],
12
+ "autoReferenced": true,
13
+ "defineConstraints": [],
14
+ "versionDefines": [],
15
+ "noEngineReferences": false
16
+ }
@@ -0,0 +1,7 @@
1
+ fileFormatVersion: 2
2
+ guid: c72576b1c89c54ea0a0d748ee92b35c2
3
+ AssemblyDefinitionImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant:
@@ -0,0 +1,18 @@
1
+ namespace XD.SDK.Account
2
+ {
3
+ public interface XDGAccessToken
4
+ {
5
+ // 唯一标志
6
+ string kid { get; }
7
+
8
+ // 认证码类型
9
+ string tokenType { get; }
10
+
11
+ // mac密钥
12
+ string macKey { get; }
13
+
14
+ // mac密钥计算方式
15
+ string macAlgorithm { get; }
16
+
17
+ }
18
+ }
@@ -0,0 +1,3 @@
1
+ fileFormatVersion: 2
2
+ guid: 4851d184199c45ecb008cb79693a3f45
3
+ timeCreated: 1672754930
@@ -0,0 +1,123 @@
1
+ using System;
2
+ using System.Collections.Generic;
3
+ using System.Linq;
4
+ using TapTap.Common;
5
+ using UnityEngine;
6
+ using UnityEngine.Scripting;
7
+ using XD.SDK.Account;
8
+ using XD.SDK.Common;
9
+ using XD.SDK.Account.Internal;
10
+
11
+ using LoginType = XD.SDK.Account.LoginType;
12
+
13
+ [assembly: Preserve]
14
+ [assembly: AlwaysLinkAssembly]
15
+ namespace XD.SDK.Account{
16
+ public class XDGAccount
17
+ {
18
+ private static IXDGAccount platformWrapper;
19
+ public static LoginType LoginType { get; set; }
20
+
21
+ static XDGAccount()
22
+ {
23
+ var interfaceType = typeof(IXDGAccount);
24
+ var platformInterfaceType = AppDomain.CurrentDomain.GetAssemblies()
25
+ .SelectMany(assembly => assembly.GetTypes())
26
+ .FirstOrDefault(clazz => interfaceType.IsAssignableFrom(clazz)&& clazz.IsClass);
27
+ if (platformInterfaceType != null) {
28
+ platformWrapper = Activator.CreateInstance(platformInterfaceType) as IXDGAccount;
29
+
30
+ XDAccountHttpConfig.Init();
31
+ UserManager.Init();
32
+ }
33
+ else
34
+ {
35
+ TapLogger.Error($"No class implements {interfaceType} Type. Current Platform: {Application.platform}, if you are using Editor, please check if you have installed XDSDK pc module.");
36
+ }
37
+ }
38
+
39
+ public static void Login(List<LoginType> loginTypes, Action<XDGUser> callback, Action<XDGError> errorCallback)
40
+ {
41
+ platformWrapper.Login(loginTypes, callback, errorCallback);
42
+ }
43
+
44
+ public static void LoginByType(LoginType loginType, Action<XDGUser> callback, Action<XDGError> errorCallback)
45
+ {
46
+ LoginType = loginType;
47
+ platformWrapper.LoginByType(loginType, callback, errorCallback);
48
+ }
49
+
50
+ public static void LoginByConsole(Action<XDGUser> successCallback, Action failCallback, Action<XDGError> errorCallback)
51
+ {
52
+ platformWrapper.LoginByConsole(successCallback, failCallback, errorCallback);
53
+ }
54
+
55
+ public static void Logout()
56
+ {
57
+ platformWrapper.Logout();
58
+ }
59
+
60
+ public static void AddUserStatusChangeCallback(Action<XDGUserStatusCodeType, string> callback){
61
+ platformWrapper.AddUserStatusChangeCallback(callback);
62
+ }
63
+
64
+ public static XDGUser GetCurrentUser()
65
+ {
66
+ return UserManager.GetCurrentUser();
67
+ }
68
+
69
+ public static void GetUser(Action<XDGUser> callback, Action<XDGError> errorCallback)
70
+ {
71
+ platformWrapper.GetUser(callback, errorCallback);
72
+ }
73
+
74
+ public static void OpenUserCenter(){
75
+ platformWrapper.OpenUserCenter();
76
+ }
77
+
78
+ public static void OpenUnregister(){
79
+ platformWrapper.OpenUnregister();
80
+ }
81
+
82
+ //641 FB token
83
+ public static void IsTokenActiveWithType(LoginType loginType, Action<bool> callback){
84
+ platformWrapper.IsTokenActiveWithType(loginType, callback);
85
+ }
86
+
87
+ //除了 Default 和 Guest
88
+ public static void BindByType(LoginType loginType, Action<bool,XDGError> callback){
89
+ platformWrapper.BindByType(loginType, callback);
90
+ }
91
+
92
+ public static string GetLoginTypeString(LoginType loginType)
93
+ {
94
+ switch (loginType)
95
+ {
96
+ case XD.SDK.Account.LoginType.TapTap:
97
+ return "TapTap";
98
+ case XD.SDK.Account.LoginType.Google:
99
+ return "Google";
100
+ case XD.SDK.Account.LoginType.Facebook:
101
+ return "Facebook";
102
+ case XD.SDK.Account.LoginType.Apple:
103
+ return "Apple";
104
+ case XD.SDK.Account.LoginType.LINE:
105
+ return "LINE";
106
+ case XD.SDK.Account.LoginType.Twitter:
107
+ return "Twitter";
108
+ // case XD.SDK.Account.LoginType.QQ:
109
+ // return "QQ";
110
+ // case XD.SDK.Account.LoginType.Twitch:
111
+ // return "Twitch";
112
+ case XD.SDK.Account.LoginType.Steam:
113
+ return "Steam";
114
+ case XD.SDK.Account.LoginType.Guest:
115
+ return "Guest";
116
+ case XD.SDK.Account.LoginType.Phone:
117
+ return "Phone";
118
+ default:
119
+ return "Default";
120
+ }
121
+ }
122
+ }
123
+ }
@@ -0,0 +1,3 @@
1
+ fileFormatVersion: 2
2
+ guid: cc57b1b10f984bc9b5aaa982a332fbc6
3
+ timeCreated: 1672756339
@@ -0,0 +1,28 @@
1
+ namespace XD.SDK.Account
2
+ {
3
+ public enum LoginType
4
+ {
5
+ Guest = 0, // 游客登录
6
+ WeChat = 1, // PC 未实现
7
+ Apple = 2, // 苹果登录
8
+ Google = 3, // Google 登录
9
+ Facebook = 4, // Facebook 登录
10
+ TapTap = 5, // Tap 登录
11
+ LINE = 6, // PC 未实现
12
+ Twitter = 7, // PC 未实现
13
+ // QQ = 8,
14
+ // Twitch = 9,
15
+ Steam = 10, // Steam 登录
16
+ Phone = 11, // 手机号 登陆
17
+ Default = -1, // 自动登录,以上次登录成功的信息登录
18
+ }
19
+ // ios的,要与后台一致!
20
+ // XDGLoginInfoTypeGuest = 0,
21
+ // XDGLoginInfoTypeWeChat = 1,
22
+ // XDGLoginInfoTypeApple = 2,
23
+ // XDGLoginInfoTypeGoogle = 3,
24
+ // XDGLoginInfoTypeFacebook = 4,
25
+ // XDGLoginInfoTypeTapTap = 5,
26
+ // XDGLoginInfoTypeLine = 6,
27
+ // XDGLoginInfoTypeTwitter = 7
28
+ }
@@ -0,0 +1,3 @@
1
+ fileFormatVersion: 2
2
+ guid: 7c79f345353b4b8e95cefcc68ee31e92
3
+ timeCreated: 1686564275
@@ -0,0 +1,30 @@
1
+ using System.Collections.Generic;
2
+
3
+ namespace XD.SDK.Account
4
+ {
5
+ public interface XDGUser
6
+ {
7
+ // The _userStandalone's _userStandalone ID.
8
+ string userId { get; }
9
+
10
+ string sub { get; }
11
+ // The _userStandalone's _userStandalone name.
12
+ string name { get; }
13
+
14
+ string loginType //App传来的是字符串,如 TapTap。 通过 GetLoginType() 方法获取枚举
15
+ {
16
+ get;
17
+ }
18
+
19
+ string avatar { get; }
20
+
21
+ string nickName { get; }
22
+
23
+ List<string> boundAccounts { get; }
24
+
25
+ // The _userStandalone's token.
26
+ XDGAccessToken token { get; }
27
+
28
+ XD.SDK.Account.LoginType getLoginType();
29
+ }
30
+ }