com.xd.sdk.common 7.1.2 → 7.2.0
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.
- package/Editor/XD.SDK.Common.Editor.asmdef +2 -1
- package/Plugins/Android/libs/{XDGBridgeCommon_v7_7.1.2.aar → XDGBridgeCommon_v7_7.2.0.aar} +0 -0
- package/Plugins/Android/libs/XDGCommon_7.2.0.aar +0 -0
- package/Plugins/Android/libs/{XDGTapTapWrapperInternal_7.1.2.aar → XDGTapTapWrapperInternal_7.2.0.aar} +0 -0
- package/Plugins/Android/libs/{XDTapTapWrapper_7.1.2.aar → XDTapTapWrapper_7.2.0.aar} +0 -0
- package/Plugins/iOS/Resource/TapTapLoginResource.bundle/userProfile/dark/tap_profile_chat.png.meta +7 -0
- package/Plugins/iOS/Resource/TapTapLoginResource.bundle/userProfile/dark/tap_profile_invite.png.meta +7 -0
- package/Plugins/iOS/Resource/TapTapLoginResource.bundle/userProfile/dark/tap_profile_unfollow.png.meta +7 -0
- package/Plugins/iOS/Resource/TapTapLoginResource.bundle/userProfile/dark.meta +8 -0
- package/Plugins/iOS/Resource/TapTapLoginResource.bundle/userProfile/light/tap_profile_chat.png.meta +7 -0
- package/Plugins/iOS/Resource/TapTapLoginResource.bundle/userProfile/light/tap_profile_invite.png.meta +7 -0
- package/Plugins/iOS/Resource/TapTapLoginResource.bundle/userProfile/light/tap_profile_unfollow.png.meta +7 -0
- package/Plugins/iOS/Resource/TapTapLoginResource.bundle/userProfile/light.meta +8 -0
- package/Plugins/iOS/Resource/TapTapLoginResource.bundle/userProfile/tap_profile_achievement.png.meta +7 -0
- package/Plugins/iOS/Resource/TapTapLoginResource.bundle/userProfile/tap_profile_achievement_platinum.png.meta +7 -0
- package/Plugins/iOS/Resource/TapTapLoginResource.bundle/userProfile/tap_profile_arrow.png.meta +7 -0
- package/Plugins/iOS/Resource/TapTapLoginResource.bundle/userProfile/tap_profile_close.png.meta +7 -0
- package/Plugins/iOS/Resource/TapTapLoginResource.bundle/userProfile/tap_profile_default_background.png.meta +7 -0
- package/Plugins/iOS/Resource/TapTapLoginResource.bundle/userProfile/tap_profile_logo.png.meta +7 -0
- package/Plugins/iOS/Resource/TapTapLoginResource.bundle/userProfile.meta +8 -0
- package/Plugins/iOS/XDCommonSDK.framework/Headers/NSError+XDG.h +1 -0
- package/Plugins/iOS/XDCommonSDK.framework/Headers/TDSGlobalRouterSchemes.h +2 -0
- package/Plugins/iOS/XDCommonSDK.framework/Headers/XDGCloudLogHelper.h +4 -0
- package/Plugins/iOS/XDCommonSDK.framework/Headers/XDTapTapInfo.h +3 -0
- package/Plugins/iOS/XDCommonSDK.framework/Headers/XDVersion.h +3 -3
- package/Plugins/iOS/XDCommonSDK.framework/Info.plist +0 -0
- package/Plugins/iOS/XDCommonSDK.framework/XDCommonSDK +0 -0
- package/Plugins/iOS/XDTapSDK4WrapperSDK.framework/Headers/XDTapSDK4WrapperSDK-Swift.h +1 -1
- package/Plugins/iOS/XDTapSDK4WrapperSDK.framework/Headers/XDTapSDK4WrapperSDK.h +3 -3
- package/Plugins/iOS/XDTapSDK4WrapperSDK.framework/Info.plist +0 -0
- package/Plugins/iOS/XDTapSDK4WrapperSDK.framework/Modules/XDTapSDK4WrapperSDK.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
- package/Plugins/iOS/XDTapSDK4WrapperSDK.framework/Modules/XDTapSDK4WrapperSDK.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/Plugins/iOS/XDTapSDK4WrapperSDK.framework/Modules/XDTapSDK4WrapperSDK.swiftmodule/arm64-apple-ios.swiftmodule +0 -0
- package/Plugins/iOS/XDTapSDK4WrapperSDK.framework/XDTapSDK4WrapperSDK +0 -0
- package/Resources/Prefabs/AccountCell.prefab +24 -15
- package/Resources/Prefabs/AgreementOptionAll.prefab +15 -9
- package/Resources/Prefabs/AgreementOptionNormal.prefab +16 -10
- package/Resources/Prefabs/AreaCodeCell.prefab +13 -8
- package/Resources/Prefabs/CancelAccountAlert.prefab +23 -23
- package/Resources/Prefabs/CenterErrorView.prefab +8 -8
- package/Resources/Prefabs/ConfirmDialog.prefab +20 -20
- package/Resources/Prefabs/DeleteAccountAlert.prefab +48 -45
- package/Resources/Prefabs/DeleteCell.prefab +6 -6
- package/Resources/Prefabs/Dialog.prefab +24 -24
- package/Resources/Prefabs/DisagreeConfirmAlert.prefab +15 -15
- package/Resources/Prefabs/GeneralAgreementAlert.prefab +53 -31
- package/Resources/Prefabs/LoadFailedView.prefab +12 -12
- package/Resources/Prefabs/LoadingView.prefab +9 -6
- package/Resources/Prefabs/PayHintAlert.prefab +17 -15
- package/Resources/Prefabs/PayLoadFailedView.prefab +13 -13
- package/Resources/Prefabs/PaymentAlert.prefab +9 -5
- package/Resources/Prefabs/SmallLoadingView.prefab +4 -4
- package/Resources/Prefabs/UserCenterAlert.prefab +76 -46
- package/Resources/Prefabs/XDCodeUnbindAlert.prefab +56 -34
- package/Resources/Prefabs/XDEmailAlert.prefab +84 -49
- package/Resources/Prefabs/XDPhoneAlertIO.prefab +129 -65
- package/Resources/Prefabs/XDPhoneNumberInputAlert.prefab +46 -28
- package/Resources/Prefabs/XDRiskControlAlert.prefab +12 -7
- package/Resources/Prefabs/XDSDKUI.prefab +3 -3
- package/Resources/Prefabs/XDVerifyCodeInputAlert.prefab +47 -28
- package/Resources/Prefabs/XDWebBridgeView.prefab +11 -11
- package/Resources/Prefabs/XDWebViewAlert.prefab +10 -10
- package/Resources/Shaders/UI/UI-Default-Gamma.shader +129 -0
- package/Resources/Shaders/UI/UI-Default-Gamma.shader.meta +9 -0
- package/Resources/Shaders/UI/UI_Default-Gamma.mat +36 -0
- package/Resources/Shaders/UI/UI_Default-Gamma.mat.meta +8 -0
- package/Resources/Shaders/UI/UI_Default-Mask.mat +36 -0
- package/Resources/Shaders/UI/UI_Default-Mask.mat.meta +8 -0
- package/Resources/Shaders/UI.meta +8 -0
- package/Resources/Shaders.meta +8 -0
- package/Runtime/Internal/Events/XDGEventBus.cs +135 -13
- package/Runtime/Internal/Standalone/Http/Interceptor/MacAuthenticationInterceptor.cs +4 -4
- package/Runtime/Internal/Standalone/Track/AliyunTrack.cs +36 -29
- package/Runtime/Internal/Standalone/UI/Base/UIManager.cs +1 -1
- package/Runtime/Internal/Standalone/UI/Base/XDGCommonUIResources.cs +107 -0
- package/Runtime/Internal/Standalone/UI/Base/XDGCommonUIResources.cs.meta +11 -0
- package/Runtime/Internal/Standalone/Web/Function/CloseWebFunction.cs +10 -1
- package/Runtime/Internal/Standalone/Web/WebRequest.cs +1 -1
- package/package.json +2 -2
- package/Plugins/Android/libs/XDGCommon_7.1.2.aar +0 -0
- /package/Plugins/Android/libs/{XDGBridgeCommon_v7_7.1.2.aar.meta → XDGBridgeCommon_v7_7.2.0.aar.meta} +0 -0
- /package/Plugins/Android/libs/{XDGCommon_7.1.2.aar.meta → XDGCommon_7.2.0.aar.meta} +0 -0
- /package/Plugins/Android/libs/{XDGTapTapWrapperInternal_7.1.2.aar.meta → XDGTapTapWrapperInternal_7.2.0.aar.meta} +0 -0
- /package/Plugins/Android/libs/{XDTapTapWrapper_7.1.2.aar.meta → XDTapTapWrapper_7.2.0.aar.meta} +0 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
%YAML 1.1
|
|
2
|
+
%TAG !u! tag:unity3d.com,2011:
|
|
3
|
+
--- !u!21 &2100000
|
|
4
|
+
Material:
|
|
5
|
+
serializedVersion: 6
|
|
6
|
+
m_ObjectHideFlags: 0
|
|
7
|
+
m_CorrespondingSourceObject: {fileID: 0}
|
|
8
|
+
m_PrefabInstance: {fileID: 0}
|
|
9
|
+
m_PrefabAsset: {fileID: 0}
|
|
10
|
+
m_Name: UI_Default-Gamma
|
|
11
|
+
m_Shader: {fileID: 4800000, guid: 09659b2e9120d6a4490f5e5a7f7619c0, type: 3}
|
|
12
|
+
m_ShaderKeywords:
|
|
13
|
+
m_LightmapFlags: 4
|
|
14
|
+
m_EnableInstancingVariants: 0
|
|
15
|
+
m_DoubleSidedGI: 0
|
|
16
|
+
m_CustomRenderQueue: -1
|
|
17
|
+
stringTagMap: {}
|
|
18
|
+
disabledShaderPasses: []
|
|
19
|
+
m_SavedProperties:
|
|
20
|
+
serializedVersion: 3
|
|
21
|
+
m_TexEnvs:
|
|
22
|
+
- _MainTex:
|
|
23
|
+
m_Texture: {fileID: 0}
|
|
24
|
+
m_Scale: {x: 1, y: 1}
|
|
25
|
+
m_Offset: {x: 0, y: 0}
|
|
26
|
+
m_Floats:
|
|
27
|
+
- _ColorMask: 15
|
|
28
|
+
- _Stencil: 0
|
|
29
|
+
- _StencilComp: 8
|
|
30
|
+
- _StencilOp: 0
|
|
31
|
+
- _StencilReadMask: 255
|
|
32
|
+
- _StencilWriteMask: 255
|
|
33
|
+
- _UseUIAlphaClip: 0
|
|
34
|
+
m_Colors:
|
|
35
|
+
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
|
36
|
+
m_BuildTextureStacks: []
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
%YAML 1.1
|
|
2
|
+
%TAG !u! tag:unity3d.com,2011:
|
|
3
|
+
--- !u!21 &2100000
|
|
4
|
+
Material:
|
|
5
|
+
serializedVersion: 6
|
|
6
|
+
m_ObjectHideFlags: 0
|
|
7
|
+
m_CorrespondingSourceObject: {fileID: 0}
|
|
8
|
+
m_PrefabInstance: {fileID: 0}
|
|
9
|
+
m_PrefabAsset: {fileID: 0}
|
|
10
|
+
m_Name: UI_Default-Mask
|
|
11
|
+
m_Shader: {fileID: 4800000, guid: 09659b2e9120d6a4490f5e5a7f7619c0, type: 3}
|
|
12
|
+
m_ShaderKeywords:
|
|
13
|
+
m_LightmapFlags: 4
|
|
14
|
+
m_EnableInstancingVariants: 0
|
|
15
|
+
m_DoubleSidedGI: 0
|
|
16
|
+
m_CustomRenderQueue: -1
|
|
17
|
+
stringTagMap: {}
|
|
18
|
+
disabledShaderPasses: []
|
|
19
|
+
m_SavedProperties:
|
|
20
|
+
serializedVersion: 3
|
|
21
|
+
m_TexEnvs:
|
|
22
|
+
- _MainTex:
|
|
23
|
+
m_Texture: {fileID: 0}
|
|
24
|
+
m_Scale: {x: 1, y: 1}
|
|
25
|
+
m_Offset: {x: 0, y: 0}
|
|
26
|
+
m_Floats:
|
|
27
|
+
- _ColorMask: 15
|
|
28
|
+
- _Stencil: 1
|
|
29
|
+
- _StencilComp: 8
|
|
30
|
+
- _StencilOp: 3
|
|
31
|
+
- _StencilReadMask: 255
|
|
32
|
+
- _StencilWriteMask: 255
|
|
33
|
+
- _UseUIAlphaClip: 0
|
|
34
|
+
m_Colors:
|
|
35
|
+
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
|
36
|
+
m_BuildTextureStacks: []
|
|
@@ -2,9 +2,90 @@ using System;
|
|
|
2
2
|
using System.Collections.Generic;
|
|
3
3
|
using System.Threading.Tasks;
|
|
4
4
|
using UnityEngine;
|
|
5
|
+
using XD.SDK.Common;
|
|
5
6
|
|
|
6
7
|
namespace XD.SDK.Common.Internal.Events
|
|
7
8
|
{
|
|
9
|
+
/// <summary>
|
|
10
|
+
/// 事件执行结果包装类,使用 XDGError 统一封装错误信息。
|
|
11
|
+
/// </summary>
|
|
12
|
+
/// <typeparam name="T">返回值类型</typeparam>
|
|
13
|
+
public class EventResult<T>
|
|
14
|
+
{
|
|
15
|
+
public bool IsSuccess { get; private set; }
|
|
16
|
+
|
|
17
|
+
public T Value { get; private set; }
|
|
18
|
+
|
|
19
|
+
/// <summary>
|
|
20
|
+
/// 业务错误信息(包含错误码、错误文案等)。
|
|
21
|
+
/// </summary>
|
|
22
|
+
public XDGError Error { get; private set; }
|
|
23
|
+
|
|
24
|
+
public string ErrorMessage
|
|
25
|
+
{
|
|
26
|
+
get { return Error != null ? Error.ErrorMsg : null; }
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
private EventResult(bool isSuccess, T value, XDGError error)
|
|
30
|
+
{
|
|
31
|
+
IsSuccess = isSuccess;
|
|
32
|
+
Value = value;
|
|
33
|
+
Error = error;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
public static EventResult<T> Success(T value)
|
|
37
|
+
{
|
|
38
|
+
return new EventResult<T>(true, value, null);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
public static EventResult<T> Failure(XDGError error)
|
|
42
|
+
{
|
|
43
|
+
return new EventResult<T>(false, default(T), error);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
public static EventResult<T> Failure(Exception exception)
|
|
47
|
+
{
|
|
48
|
+
if (exception is XDGError xdError)
|
|
49
|
+
{
|
|
50
|
+
return Failure(xdError);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// 非 XDGError 的异常,统一包装成一个 UnknownError,detail 中保留原始异常信息
|
|
54
|
+
var wrapped = new XDGError(
|
|
55
|
+
code: ResponseCode.Common.Failed,
|
|
56
|
+
errorMsg: exception != null ? exception.Message : "Unknown error",
|
|
57
|
+
detail: exception != null ? exception.ToString() : null);
|
|
58
|
+
|
|
59
|
+
return Failure(wrapped);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
public static EventResult<T> Failure(string errorMessage)
|
|
63
|
+
{
|
|
64
|
+
return Failure(new XDGError(errorMessage));
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/// <summary>
|
|
68
|
+
/// 获取值,如果失败则抛出 XDGError。
|
|
69
|
+
/// </summary>
|
|
70
|
+
public T GetValueOrThrow()
|
|
71
|
+
{
|
|
72
|
+
if (!IsSuccess)
|
|
73
|
+
{
|
|
74
|
+
throw Error ?? new XDGError("Event execution failed.");
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return Value;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/// <summary>
|
|
81
|
+
/// 获取值,如果失败则返回默认值。
|
|
82
|
+
/// </summary>
|
|
83
|
+
public T GetValueOrDefault(T defaultValue = default(T))
|
|
84
|
+
{
|
|
85
|
+
return IsSuccess ? Value : defaultValue;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
8
89
|
public static class XDGEventBus
|
|
9
90
|
{
|
|
10
91
|
private static readonly Dictionary<string, List<Func<object[], object>>> SyncHandlers = new Dictionary<string, List<Func<object[], object>>>();
|
|
@@ -31,29 +112,50 @@ namespace XD.SDK.Common.Internal.Events
|
|
|
31
112
|
});
|
|
32
113
|
}
|
|
33
114
|
|
|
34
|
-
|
|
115
|
+
/// <summary>
|
|
116
|
+
/// 发布带返回值的同步事件,直接返回 EventResult(破坏性变更:原来返回 T)。
|
|
117
|
+
/// </summary>
|
|
118
|
+
public static EventResult<T> Publish<T>(string eventName, params object[] args)
|
|
35
119
|
{
|
|
36
120
|
if (SyncHandlers.TryGetValue(eventName, out var handlers) && handlers.Count > 0)
|
|
37
121
|
{
|
|
38
122
|
try
|
|
39
123
|
{
|
|
40
124
|
var result = handlers[0](args);
|
|
41
|
-
|
|
125
|
+
var typedResult = result is T ? (T)result : default(T);
|
|
126
|
+
return EventResult<T>.Success(typedResult);
|
|
42
127
|
}
|
|
43
128
|
catch (Exception ex)
|
|
44
129
|
{
|
|
45
|
-
XDGLogger.Error($"[XDEventBus] Error publishing sync event {eventName}: {ex
|
|
46
|
-
return
|
|
130
|
+
XDGLogger.Error($"[XDEventBus] Error publishing sync event {eventName}: {ex}", XDGLoggerTag.Common);
|
|
131
|
+
return EventResult<T>.Failure(ex);
|
|
47
132
|
}
|
|
48
133
|
}
|
|
49
134
|
|
|
50
135
|
XDGLogger.Debug($"[XDEventBus] No handler found for sync event: {eventName}", XDGLoggerTag.Common);
|
|
51
|
-
return
|
|
136
|
+
return EventResult<T>.Failure($"No handler found for event: {eventName}");
|
|
52
137
|
}
|
|
53
138
|
|
|
139
|
+
/// <summary>
|
|
140
|
+
/// 发布不关心返回值的同步事件,保持原有 fire-and-forget 行为。
|
|
141
|
+
/// </summary>
|
|
54
142
|
public static void Publish(string eventName, params object[] args)
|
|
55
143
|
{
|
|
56
|
-
|
|
144
|
+
if (SyncHandlers.TryGetValue(eventName, out var handlers) && handlers.Count > 0)
|
|
145
|
+
{
|
|
146
|
+
try
|
|
147
|
+
{
|
|
148
|
+
handlers[0](args);
|
|
149
|
+
}
|
|
150
|
+
catch (Exception ex)
|
|
151
|
+
{
|
|
152
|
+
XDGLogger.Error($"[XDEventBus] Error publishing sync event {eventName}: {ex}", XDGLoggerTag.Common);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
else
|
|
156
|
+
{
|
|
157
|
+
XDGLogger.Debug($"[XDEventBus] No handler found for sync event: {eventName}", XDGLoggerTag.Common);
|
|
158
|
+
}
|
|
57
159
|
}
|
|
58
160
|
|
|
59
161
|
#endregion
|
|
@@ -78,30 +180,50 @@ namespace XD.SDK.Common.Internal.Events
|
|
|
78
180
|
});
|
|
79
181
|
}
|
|
80
182
|
|
|
81
|
-
|
|
183
|
+
/// <summary>
|
|
184
|
+
/// 发布带返回值的异步事件,直接返回 EventResult(破坏性变更:原来返回 Task<T>)。
|
|
185
|
+
/// </summary>
|
|
186
|
+
public static async Task<EventResult<T>> PublishAsync<T>(string eventName, params object[] args)
|
|
82
187
|
{
|
|
83
188
|
if (AsyncHandlers.TryGetValue(eventName, out var handlers) && handlers.Count > 0)
|
|
84
189
|
{
|
|
85
190
|
try
|
|
86
191
|
{
|
|
87
192
|
var result = await handlers[0](args);
|
|
88
|
-
|
|
89
|
-
return
|
|
193
|
+
var typedResult = result is T ? (T)result : default(T);
|
|
194
|
+
return EventResult<T>.Success(typedResult);
|
|
90
195
|
}
|
|
91
196
|
catch (Exception ex)
|
|
92
197
|
{
|
|
93
|
-
XDGLogger.
|
|
94
|
-
return
|
|
198
|
+
XDGLogger.Warn($"[XDEventBus] Error publishing async event {eventName}: {ex}", XDGLoggerTag.Common);
|
|
199
|
+
return EventResult<T>.Failure(ex);
|
|
95
200
|
}
|
|
96
201
|
}
|
|
97
202
|
|
|
98
203
|
XDGLogger.Debug($"[XDEventBus] No handler found for async event: {eventName}", XDGLoggerTag.Common);
|
|
99
|
-
return
|
|
204
|
+
return EventResult<T>.Failure($"No handler found for event: {eventName}");
|
|
100
205
|
}
|
|
101
206
|
|
|
207
|
+
/// <summary>
|
|
208
|
+
/// 发布不关心返回值的异步事件,保持原有 fire-and-forget 行为。
|
|
209
|
+
/// </summary>
|
|
102
210
|
public static async Task PublishAsync(string eventName, params object[] args)
|
|
103
211
|
{
|
|
104
|
-
|
|
212
|
+
if (AsyncHandlers.TryGetValue(eventName, out var handlers) && handlers.Count > 0)
|
|
213
|
+
{
|
|
214
|
+
try
|
|
215
|
+
{
|
|
216
|
+
await handlers[0](args);
|
|
217
|
+
}
|
|
218
|
+
catch (Exception ex)
|
|
219
|
+
{
|
|
220
|
+
XDGLogger.Error($"[XDEventBus] Error publishing async event {eventName}: {ex}", XDGLoggerTag.Common);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
else
|
|
224
|
+
{
|
|
225
|
+
XDGLogger.Debug($"[XDEventBus] No handler found for async event: {eventName}", XDGLoggerTag.Common);
|
|
226
|
+
}
|
|
105
227
|
}
|
|
106
228
|
|
|
107
229
|
#endregion
|
|
@@ -36,12 +36,12 @@ namespace XD.SDK.Common.Internal.Standalone.Http.Interceptor
|
|
|
36
36
|
{
|
|
37
37
|
try
|
|
38
38
|
{
|
|
39
|
-
var
|
|
39
|
+
var accessTokenResult = await XDGEventBus.PublishAsync<XDGAccessToken>(XDGEvents.AccountGetAccessToken);
|
|
40
|
+
var accessToken = accessTokenResult.GetValueOrThrow();
|
|
40
41
|
if (accessToken == null)
|
|
41
42
|
{
|
|
42
43
|
return null;
|
|
43
44
|
}
|
|
44
|
-
|
|
45
45
|
var uri = new Uri(url);
|
|
46
46
|
var timeStr = ServerTime.GetTimestamp();
|
|
47
47
|
var nonce = GetRandomStr(5);
|
|
@@ -57,9 +57,9 @@ namespace XD.SDK.Common.Internal.Standalone.Http.Interceptor
|
|
|
57
57
|
XDGLogger.Debug($"generate MAC token: {authToken}", XDGLoggerTag.Http);
|
|
58
58
|
return authToken;
|
|
59
59
|
}
|
|
60
|
-
catch (
|
|
60
|
+
catch (XDGError ex)
|
|
61
61
|
{
|
|
62
|
-
XDGLogger.Error($"Failed to generate MAC token: {ex.
|
|
62
|
+
XDGLogger.Error($"Failed to generate MAC token: {ex.ErrorMsg}", XDGLoggerTag.Http);
|
|
63
63
|
return null;
|
|
64
64
|
}
|
|
65
65
|
}
|
|
@@ -199,14 +199,18 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
199
199
|
var isInit = XDGCommon.IsInitialized();
|
|
200
200
|
if (!isInit) return;
|
|
201
201
|
|
|
202
|
-
content["device_id_in_db"] = DeviceIdInDB == null ? string.Empty : DeviceIdInDB;
|
|
202
|
+
content["device_id_in_db"] = DeviceIdInDB() == null ? string.Empty : DeviceIdInDB();
|
|
203
203
|
|
|
204
|
-
var
|
|
205
|
-
|
|
204
|
+
var userResult = XDGEventBus.Publish<XDGUser>(XDGEvents.AccountGetCurrentUser);
|
|
205
|
+
var user = userResult.GetValueOrDefault();
|
|
206
|
+
if (user == null)
|
|
207
|
+
{
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
206
210
|
|
|
207
211
|
content["account"] = user.UserId;
|
|
208
212
|
if (!content.ContainsKey("isLoginModule") || content["isLoginModule"] != "true")
|
|
209
|
-
content["login_type"] = !string.IsNullOrEmpty(
|
|
213
|
+
content["login_type"] = !string.IsNullOrEmpty(userResult.Value.LoginTypeName) ? userResult.Value.LoginTypeName : userResult.Value.GetLoginType().ToString();
|
|
210
214
|
}
|
|
211
215
|
else
|
|
212
216
|
{
|
|
@@ -351,31 +355,34 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
351
355
|
}
|
|
352
356
|
}
|
|
353
357
|
|
|
354
|
-
private static string DeviceIdInDB
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
358
|
+
private static string DeviceIdInDB()
|
|
359
|
+
{
|
|
360
|
+
var deviceResult = XDGEventBus.Publish<string>(XDGEvents.TapSDKGetDeviceID);
|
|
361
|
+
return deviceResult.GetValueOrDefault();
|
|
362
|
+
}
|
|
363
|
+
// Type TapDBType = typeof(TapDB);
|
|
364
|
+
// FieldInfo dbField = TapDBType.GetField("db", BindingFlags.Static | BindingFlags.NonPublic);
|
|
365
|
+
// object db = dbField.GetValue(null);
|
|
366
|
+
//
|
|
367
|
+
// Type dbType = db.GetType();
|
|
368
|
+
// FieldInfo identityField = dbType.GetField("Identity", BindingFlags.Static | BindingFlags.NonPublic);
|
|
369
|
+
// object identity = identityField.GetValue(null);
|
|
370
|
+
//
|
|
371
|
+
// if (identity == null)
|
|
372
|
+
// {
|
|
373
|
+
// return null;
|
|
374
|
+
// }
|
|
375
|
+
//
|
|
376
|
+
// Type identityType = identity.GetType();
|
|
377
|
+
// PropertyInfo deviceIdProperty = identityType.GetProperty("DeviceId");
|
|
378
|
+
// object deviceId = deviceIdProperty.GetValue(identity);
|
|
379
|
+
//
|
|
380
|
+
// if (deviceId == null)
|
|
381
|
+
// {
|
|
382
|
+
// return null;
|
|
383
|
+
// }
|
|
384
|
+
//
|
|
385
|
+
// return deviceId as string;
|
|
379
386
|
}
|
|
380
387
|
}
|
|
381
388
|
|
|
@@ -137,7 +137,6 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
137
137
|
managerObject.AddComponent<ContainerWindow>();
|
|
138
138
|
|
|
139
139
|
instance.mask = managerObject.transform.Find("Background").gameObject;
|
|
140
|
-
|
|
141
140
|
instance.windowStack = managerObject.transform.Find("WindowStack");
|
|
142
141
|
|
|
143
142
|
instance.toast = managerObject.transform.Find("Toast").gameObject;
|
|
@@ -198,6 +197,7 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
198
197
|
if (uiElements.Count == 0)
|
|
199
198
|
{
|
|
200
199
|
XDGLogger.Debug("没有 UIElement 子类可处理.", XDGLoggerTag.Common);
|
|
200
|
+
UpdateMask();
|
|
201
201
|
}
|
|
202
202
|
else
|
|
203
203
|
{
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
#if UNITY_EDITOR || UNITY_STANDALONE
|
|
2
|
+
using UnityEngine;
|
|
3
|
+
|
|
4
|
+
namespace XD.SDK.Common.Internal.Standalone
|
|
5
|
+
{
|
|
6
|
+
/// <summary>
|
|
7
|
+
/// 提供 Common 模块内部统一使用的 UI 材质访问接口。
|
|
8
|
+
/// 默认会优先根据当前 ColorSpace 选择对应的材质,如果找不到 Linear 版本则回退到 Gamma 版本。
|
|
9
|
+
/// 实际材质文件放在任意包的 Resources/Shaders/UI 目录下即可(例如 Common 或 BuildTools),
|
|
10
|
+
/// 但路径必须保持与常量中定义的一致。
|
|
11
|
+
/// </summary>
|
|
12
|
+
public static class XDGCommonUIResources
|
|
13
|
+
{
|
|
14
|
+
// 贴图渲染用的默认 UI 材质
|
|
15
|
+
private const string SpriteGammaPath = "Shaders/UI/UI_Default-Gamma";
|
|
16
|
+
private const string SpriteLinearPath = "Shaders/UI/UI_Default-Linear";
|
|
17
|
+
|
|
18
|
+
// 蒙版用的默认 UI 材质
|
|
19
|
+
private const string MaskGammaPath = "Shaders/UI/UI_Default-Mask";
|
|
20
|
+
private const string MaskLinearPath = "Shaders/UI/UI_Default-Mask-Linear";
|
|
21
|
+
|
|
22
|
+
private static Material spriteGamma;
|
|
23
|
+
private static Material spriteLinear;
|
|
24
|
+
|
|
25
|
+
private static Material maskGamma;
|
|
26
|
+
private static Material maskLinear;
|
|
27
|
+
|
|
28
|
+
/// <summary>
|
|
29
|
+
/// 获取当前 ColorSpace 下推荐使用的 UI Sprite 材质。
|
|
30
|
+
/// </summary>
|
|
31
|
+
public static Material GetDefaultSpriteMaterial()
|
|
32
|
+
{
|
|
33
|
+
if (QualitySettings.activeColorSpace == ColorSpace.Linear)
|
|
34
|
+
{
|
|
35
|
+
if (spriteLinear == null)
|
|
36
|
+
{
|
|
37
|
+
spriteLinear = LoadMaterialWithFallback(SpriteLinearPath, SpriteGammaPath, "Sprite Linear");
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (spriteLinear != null)
|
|
41
|
+
{
|
|
42
|
+
return spriteLinear;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (spriteGamma == null)
|
|
47
|
+
{
|
|
48
|
+
spriteGamma = LoadMaterial(SpriteGammaPath, "Sprite Gamma");
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return spriteGamma;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/// <summary>
|
|
55
|
+
/// 获取当前 ColorSpace 下推荐使用的 UI Mask 材质。
|
|
56
|
+
/// </summary>
|
|
57
|
+
internal static Material GetDefaultMaskMaterial()
|
|
58
|
+
{
|
|
59
|
+
if (QualitySettings.activeColorSpace == ColorSpace.Linear)
|
|
60
|
+
{
|
|
61
|
+
if (maskLinear == null)
|
|
62
|
+
{
|
|
63
|
+
maskLinear = LoadMaterialWithFallback(MaskLinearPath, MaskGammaPath, "Mask Linear");
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (maskLinear != null)
|
|
67
|
+
{
|
|
68
|
+
return maskLinear;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if (maskGamma == null)
|
|
73
|
+
{
|
|
74
|
+
maskGamma = LoadMaterial(MaskGammaPath, "Mask Gamma");
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return maskGamma;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
private static Material LoadMaterialWithFallback(string primaryPath, string fallbackPath, string label)
|
|
81
|
+
{
|
|
82
|
+
Material material = LoadMaterial(primaryPath, label);
|
|
83
|
+
if (material != null)
|
|
84
|
+
{
|
|
85
|
+
return material;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return LoadMaterial(fallbackPath, label + " Fallback");
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
private static Material LoadMaterial(string path, string label)
|
|
92
|
+
{
|
|
93
|
+
Material material = Resources.Load<Material>(path);
|
|
94
|
+
if (material == null)
|
|
95
|
+
{
|
|
96
|
+
Debug.LogWarning(
|
|
97
|
+
"[XDGCommonUIResources] 未找到 UI 材质: \"" + label +
|
|
98
|
+
"\",Resources 路径: \"" + path + "\"");
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return material;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
#endif
|
|
106
|
+
|
|
107
|
+
|
|
@@ -16,7 +16,16 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
16
16
|
{
|
|
17
17
|
XDGLogger.Debug($"message from javascript by:{GetName()} with data:{data}", XDGLoggerTag.Web);
|
|
18
18
|
var dic = JsonConvert.DeserializeObject<Dictionary<string, object>>(data);
|
|
19
|
-
|
|
19
|
+
if (webView?.ProviderWebView()?.Url != null)
|
|
20
|
+
{
|
|
21
|
+
var url = webView?.ProviderWebView()?.Url;
|
|
22
|
+
var queryParams = WebRequest.ParseQueryString(url);
|
|
23
|
+
var noUI = WebRequest.GetValueOrDefault(queryParams, "xdNoUI", "0") == "1";
|
|
24
|
+
if (!noUI)
|
|
25
|
+
{
|
|
26
|
+
UIManager.Dismiss();
|
|
27
|
+
}
|
|
28
|
+
}
|
|
20
29
|
webView?.ProviderWebTrans()?.TransObserver(WebActionEnum.CLOSE, dic);
|
|
21
30
|
webView?.Release();
|
|
22
31
|
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "com.xd.sdk.common",
|
|
3
3
|
"displayName": "XDGSDK Common",
|
|
4
|
-
"version": "7.
|
|
4
|
+
"version": "7.2.0",
|
|
5
5
|
"description": "XDGSDK",
|
|
6
6
|
"unity": "2019.3",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"com.xd.sdk.foundation": "7.
|
|
9
|
+
"com.xd.sdk.foundation": "7.2.0"
|
|
10
10
|
}
|
|
11
11
|
}
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/Plugins/Android/libs/{XDTapTapWrapper_7.1.2.aar.meta → XDTapTapWrapper_7.2.0.aar.meta}
RENAMED
|
File without changes
|