com.xd.sdk.common 7.1.1 → 7.1.2
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/Android/XDCommonAndroidGradleProcessor.cs +2 -0
- package/Plugins/Android/libs/XDGBridgeCommon_v7_7.1.2.aar +0 -0
- package/Plugins/Android/libs/XDGCommon_7.1.2.aar +0 -0
- package/Plugins/Android/libs/XDGTapTapWrapperInternal_7.1.2.aar +0 -0
- package/Plugins/iOS/Resource/TapTapLoginResource.bundle/userProfile/dark/tap_profile_chat.png +0 -0
- package/Plugins/iOS/Resource/TapTapLoginResource.bundle/userProfile/dark/tap_profile_invite.png +0 -0
- package/Plugins/iOS/Resource/TapTapLoginResource.bundle/userProfile/dark/tap_profile_unfollow.png +0 -0
- package/Plugins/iOS/Resource/TapTapLoginResource.bundle/userProfile/light/tap_profile_chat.png +0 -0
- package/Plugins/iOS/Resource/TapTapLoginResource.bundle/userProfile/light/tap_profile_invite.png +0 -0
- package/Plugins/iOS/Resource/TapTapLoginResource.bundle/userProfile/light/tap_profile_unfollow.png +0 -0
- package/Plugins/iOS/Resource/TapTapLoginResource.bundle/userProfile/tap_profile_achievement.png +0 -0
- package/Plugins/iOS/Resource/TapTapLoginResource.bundle/userProfile/tap_profile_achievement_platinum.png +0 -0
- package/Plugins/iOS/Resource/TapTapLoginResource.bundle/userProfile/tap_profile_arrow.png +0 -0
- package/Plugins/iOS/Resource/TapTapLoginResource.bundle/userProfile/tap_profile_close.png +0 -0
- package/Plugins/iOS/Resource/TapTapLoginResource.bundle/userProfile/tap_profile_default_background.png +0 -0
- package/Plugins/iOS/Resource/TapTapLoginResource.bundle/userProfile/tap_profile_logo.png +0 -0
- package/Plugins/iOS/XDCommonSDK.framework/Headers/XDConfigManager.h +1 -1
- package/Plugins/iOS/XDCommonSDK.framework/Headers/XDGAnnouncementConfig.h.meta +7 -0
- package/Plugins/iOS/XDCommonSDK.framework/Headers/XDGAnnouncementManager.h.meta +7 -0
- package/Plugins/iOS/XDCommonSDK.framework/Headers/XDGConfig.h +2 -0
- package/Plugins/iOS/XDCommonSDK.framework/Headers/XDGInitParam.h +5 -0
- package/Plugins/iOS/XDCommonSDK.framework/Headers/XDTapTapInfo.h +4 -1
- 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.h +3 -3
- package/Plugins/iOS/XDTapSDK4WrapperSDK.framework/Info.plist +0 -0
- package/Plugins/iOS/XDTapSDK4WrapperSDK.framework/XDTapSDK4WrapperSDK +0 -0
- package/Runtime/Internal/Events/XDGEventBus.cs +8 -7
- package/Runtime/Internal/Mobile/CommonFeaturesImpl.cs +11 -10
- package/Runtime/Internal/Mobile/Http/CommonParamsInterceptor.cs +1 -1
- package/Runtime/Internal/Standalone/Agreement/AgreementModule.cs +4 -4
- package/Runtime/Internal/Standalone/CommonFeaturesImpl.cs +7 -5
- package/Runtime/Internal/Standalone/Config/AppConfig.cs +3 -1
- package/Runtime/Internal/Standalone/Config/ConfigModule.cs +5 -2
- package/Runtime/Internal/Standalone/Http/Interceptor/MacAuthenticationInterceptor.cs +4 -4
- package/Runtime/Internal/Standalone/Http/Interceptor/StandaloneErrorHandlingInterceptor.cs +5 -5
- package/Runtime/Internal/Standalone/Http/XDHttpUtils.cs +39 -16
- package/Runtime/Internal/Standalone/IPInfo/IPInfoModule.cs +42 -20
- package/Runtime/Internal/Standalone/IPInfo/XDGAreaCode.cs +1 -1
- package/Runtime/Internal/Standalone/Persistence/Persistence.cs +42 -22
- package/Runtime/Internal/Standalone/Steam/SteamUtils.cs +14 -7
- package/Runtime/Internal/Standalone/Track/AliyunTrack.cs +5 -5
- package/Runtime/Internal/Standalone/UI/Base/UIManager.cs +3 -2
- package/Runtime/Internal/Standalone/UI/Controllers/CancelAccountAlert.cs +69 -33
- package/Runtime/Internal/Standalone/UI/Controllers/GeneralAgreementAlert.cs +29 -22
- package/Runtime/Internal/Standalone/UI/Controllers/XDWebViewAlert.cs +4 -5
- package/Runtime/Internal/Standalone/Utils/SteamWrapper.cs +2 -2
- package/Runtime/Internal/Standalone/Utils/TaskDispatcher.cs +1 -1
- package/Runtime/Internal/Standalone/Utils/WindowsRegistryAccess.cs +7 -7
- package/Runtime/Internal/Standalone/Web/Function/BackgroundColorWebFunction.cs +1 -1
- package/Runtime/Internal/Standalone/Web/Function/ClipboardWebFunction.cs +1 -1
- package/Runtime/Internal/Standalone/Web/Function/CloseWebFunction.cs +3 -3
- package/Runtime/Internal/Standalone/Web/Function/DeviceInfoWebFunction.cs +1 -1
- package/Runtime/Internal/Standalone/Web/Function/GameMessageWebFunction.cs +1 -1
- package/Runtime/Internal/Standalone/Web/Function/GetSafeAreaWebFunction.cs +1 -1
- package/Runtime/Internal/Standalone/Web/Function/GetStorageWebFunction.cs +1 -1
- package/Runtime/Internal/Standalone/Web/Function/HttpRequestWebFunction.cs +1 -1
- package/Runtime/Internal/Standalone/Web/Function/LoadingWebFunction.cs +1 -1
- package/Runtime/Internal/Standalone/Web/Function/LogWebFunction.cs +5 -5
- package/Runtime/Internal/Standalone/Web/Function/NavigationWebFunction.cs +1 -1
- package/Runtime/Internal/Standalone/Web/Function/OpenPageWebFunction.cs +1 -1
- package/Runtime/Internal/Standalone/Web/Function/PutStorageWebFunction.cs +1 -1
- package/Runtime/Internal/Standalone/Web/Function/ToastWebFunction.cs +1 -1
- package/Runtime/Internal/Standalone/Web/Function/TrackEventWebFunction.cs +1 -1
- package/Runtime/Internal/Standalone/Web/WebBridgeController.cs +6 -7
- package/Runtime/Internal/Standalone/Web/WebRequest.cs +2 -2
- package/Runtime/Internal/Standalone/Web/XDWebBridgeView.cs +1 -1
- package/Runtime/Internal/XDGCommonInternal.cs +1 -1
- package/package.json +2 -2
- package/Plugins/Android/libs/XDGBridgeCommon_v7_7.1.0.aar +0 -0
- package/Plugins/Android/libs/XDGCommon_7.1.0.aar +0 -0
- package/Plugins/Android/libs/XDGTapTapWrapperInternal_7.1.0.aar +0 -0
- package/Runtime/Internal/Core/ReflectionUtils.cs +0 -640
- package/Runtime/Internal/Core/ReflectionUtils.cs.meta +0 -3
- /package/Plugins/Android/libs/{XDGBridgeCommon_v7_7.1.0.aar.meta → XDGBridgeCommon_v7_7.1.2.aar.meta} +0 -0
- /package/Plugins/Android/libs/{XDGCommon_7.1.0.aar.meta → XDGCommon_7.1.2.aar.meta} +0 -0
- /package/Plugins/Android/libs/{XDGTapTapWrapperInternal_7.1.0.aar.meta → XDGTapTapWrapperInternal_7.1.2.aar.meta} +0 -0
- /package/Plugins/Android/libs/{XDTapTapWrapper_7.1.0.aar → XDTapTapWrapper_7.1.2.aar} +0 -0
- /package/Plugins/Android/libs/{XDTapTapWrapper_7.1.0.aar.meta → XDTapTapWrapper_7.1.2.aar.meta} +0 -0
|
@@ -35,6 +35,8 @@ namespace XD.SDK.Common.Editor
|
|
|
35
35
|
version: VersionCatalog.RecyclerView),
|
|
36
36
|
new AndroidGradleProjectConfig.Dependency(group: "androidx.appcompat", module: "appcompat",
|
|
37
37
|
version: VersionCatalog.AppCompat),
|
|
38
|
+
new AndroidGradleProjectConfig.Dependency(group: "androidx.localbroadcastmanager", module: "localbroadcastmanager",
|
|
39
|
+
version: VersionCatalog.Localbroadcastmanager),
|
|
38
40
|
new AndroidGradleProjectConfig.Dependency(group: "com.google.code.gson", module: "gson",
|
|
39
41
|
version: VersionCatalog.Gson),
|
|
40
42
|
new AndroidGradleProjectConfig.Dependency(group: "com.squareup.retrofit2", module: "retrofit",
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/Plugins/iOS/Resource/TapTapLoginResource.bundle/userProfile/dark/tap_profile_invite.png
ADDED
|
Binary file
|
package/Plugins/iOS/Resource/TapTapLoginResource.bundle/userProfile/dark/tap_profile_unfollow.png
ADDED
|
Binary file
|
package/Plugins/iOS/Resource/TapTapLoginResource.bundle/userProfile/light/tap_profile_chat.png
ADDED
|
Binary file
|
package/Plugins/iOS/Resource/TapTapLoginResource.bundle/userProfile/light/tap_profile_invite.png
ADDED
|
Binary file
|
package/Plugins/iOS/Resource/TapTapLoginResource.bundle/userProfile/light/tap_profile_unfollow.png
ADDED
|
Binary file
|
package/Plugins/iOS/Resource/TapTapLoginResource.bundle/userProfile/tap_profile_achievement.png
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -31,7 +31,7 @@ typedef void (^XDConfigHandler)(BOOL success, NSString *_Nullable msg);
|
|
|
31
31
|
|
|
32
32
|
+ (BOOL)isGlobal;
|
|
33
33
|
|
|
34
|
-
+ (void)readLocalConfigWithChannel:(nullable
|
|
34
|
+
+ (void)readLocalConfigWithChannel:(nullable XDGInitParam *)param handler:(XDConfigHandler)handler;
|
|
35
35
|
|
|
36
36
|
+ (void)initConfigWithParam:(nullable XDGInitParam *)param handler:(XDConfigHandler)handler;
|
|
37
37
|
|
|
@@ -110,6 +110,8 @@ typedef NS_ENUM(NSInteger, XDSDKRegionType) {
|
|
|
110
110
|
@property (nonatomic, assign) BOOL disableSupport;
|
|
111
111
|
/// 关闭网页预热
|
|
112
112
|
@property (nonatomic, assign) BOOL disableWebPreload;
|
|
113
|
+
/// 关闭票据上传
|
|
114
|
+
@property (nonatomic, assign) BOOL disableReceiptUpload;
|
|
113
115
|
|
|
114
116
|
- (BOOL)isCN;
|
|
115
117
|
|
|
@@ -19,6 +19,11 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
19
19
|
/// 包体渠道
|
|
20
20
|
@property (nonatomic, strong, nullable) NSString * channel;
|
|
21
21
|
|
|
22
|
+
/// 额外参数
|
|
23
|
+
/// 会带到 TapDB 的 device_login 和 user_login 事件中
|
|
24
|
+
@property (nonatomic, strong, nullable) NSDictionary * dbProperties;
|
|
25
|
+
|
|
26
|
+
- (NSString *)toString;
|
|
22
27
|
@end
|
|
23
28
|
|
|
24
29
|
NS_ASSUME_NONNULL_END
|
|
@@ -46,11 +46,14 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
46
46
|
@property (nonatomic, assign) bool isCN;
|
|
47
47
|
@property (nonatomic, strong) XDTapDBInfo * dbConfig;
|
|
48
48
|
@property (nonatomic, strong) XDGAntiConfig *antiConfig;
|
|
49
|
+
/// 会带到 TapDB 的 device_login 和 user_login 事件中
|
|
50
|
+
@property (nonatomic, strong) NSDictionary *dbProperties;
|
|
49
51
|
|
|
50
52
|
+ (instancetype)instanceWithInfoDic:(nonnull NSDictionary *)infoDic
|
|
51
53
|
isCN:(BOOL)isCN
|
|
52
54
|
idfaEnable:(BOOL)idfaEnable
|
|
53
|
-
channel:(nullable NSString *)channel
|
|
55
|
+
channel:(nullable NSString *)channel
|
|
56
|
+
prop:(nullable NSDictionary *)prop;
|
|
54
57
|
|
|
55
58
|
- (BOOL)enableAnti;
|
|
56
59
|
@end
|
|
Binary file
|
|
Binary file
|
|
@@ -15,6 +15,6 @@ FOUNDATION_EXPORT const unsigned char XDTapSDK4WrapperSDKVersionString[];
|
|
|
15
15
|
|
|
16
16
|
// In this header, you should import all the public headers of your framework using statements like #import <XDTapSDK4WrapperSDK/PublicHeader.h>
|
|
17
17
|
|
|
18
|
-
#define XDGTapSDK4_VERSION @"7.1.
|
|
19
|
-
#define XDGTapSDK4_VERSION_CODE @"
|
|
20
|
-
// HASH
|
|
18
|
+
#define XDGTapSDK4_VERSION @"7.1.2"
|
|
19
|
+
#define XDGTapSDK4_VERSION_CODE @"7001020"
|
|
20
|
+
// HASH 5355bc04
|
|
Binary file
|
|
Binary file
|
|
@@ -42,12 +42,12 @@ namespace XD.SDK.Common.Internal.Events
|
|
|
42
42
|
}
|
|
43
43
|
catch (Exception ex)
|
|
44
44
|
{
|
|
45
|
-
XDGLogger.Error($"[XDEventBus] Error publishing sync event {eventName}: {ex.Message}");
|
|
45
|
+
XDGLogger.Error($"[XDEventBus] Error publishing sync event {eventName}: {ex.Message}", XDGLoggerTag.Common);
|
|
46
46
|
return default(T);
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
XDGLogger.Debug($"[XDEventBus] No handler found for sync event: {eventName}");
|
|
50
|
+
XDGLogger.Debug($"[XDEventBus] No handler found for sync event: {eventName}", XDGLoggerTag.Common);
|
|
51
51
|
return default(T);
|
|
52
52
|
}
|
|
53
53
|
|
|
@@ -66,7 +66,7 @@ namespace XD.SDK.Common.Internal.Events
|
|
|
66
66
|
AsyncHandlers[eventName] = new List<Func<object[], Task<object>>>();
|
|
67
67
|
|
|
68
68
|
AsyncHandlers[eventName].Add(handler);
|
|
69
|
-
XDGLogger.Debug($"[XDEventBus] Subscribed to async event: {eventName}");
|
|
69
|
+
XDGLogger.Debug($"[XDEventBus] Subscribed to async event: {eventName}", XDGLoggerTag.Common);
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
public static void SubscribeAsync(string eventName, Func<object[], Task> handler)
|
|
@@ -85,16 +85,17 @@ namespace XD.SDK.Common.Internal.Events
|
|
|
85
85
|
try
|
|
86
86
|
{
|
|
87
87
|
var result = await handlers[0](args);
|
|
88
|
+
XDGLogger.Debug($"[XDEventBus] publishing async event {eventName}, result: {result}", XDGLoggerTag.Common);
|
|
88
89
|
return result is T ? (T)result : default(T);
|
|
89
90
|
}
|
|
90
91
|
catch (Exception ex)
|
|
91
92
|
{
|
|
92
|
-
XDGLogger.Error($"[XDEventBus] Error publishing async event {eventName}: {ex.Message}");
|
|
93
|
+
XDGLogger.Error($"[XDEventBus] Error publishing async event {eventName}: {ex.Message}", XDGLoggerTag.Common);
|
|
93
94
|
return default(T);
|
|
94
95
|
}
|
|
95
96
|
}
|
|
96
97
|
|
|
97
|
-
XDGLogger.Debug($"[XDEventBus] No handler found for async event: {eventName}");
|
|
98
|
+
XDGLogger.Debug($"[XDEventBus] No handler found for async event: {eventName}", XDGLoggerTag.Common);
|
|
98
99
|
return default(T);
|
|
99
100
|
}
|
|
100
101
|
|
|
@@ -116,14 +117,14 @@ namespace XD.SDK.Common.Internal.Events
|
|
|
116
117
|
{
|
|
117
118
|
SyncHandlers.Remove(eventName);
|
|
118
119
|
AsyncHandlers.Remove(eventName);
|
|
119
|
-
XDGLogger.Debug($"[XDEventBus] Unsubscribed from event: {eventName}");
|
|
120
|
+
XDGLogger.Debug($"[XDEventBus] Unsubscribed from event: {eventName}", XDGLoggerTag.Common);
|
|
120
121
|
}
|
|
121
122
|
|
|
122
123
|
public static void Clear()
|
|
123
124
|
{
|
|
124
125
|
SyncHandlers.Clear();
|
|
125
126
|
AsyncHandlers.Clear();
|
|
126
|
-
XDGLogger.Debug("[XDEventBus] Cleared all event handlers");
|
|
127
|
+
XDGLogger.Debug("[XDEventBus] Cleared all event handlers", XDGLoggerTag.Common);
|
|
127
128
|
}
|
|
128
129
|
|
|
129
130
|
#endregion
|
|
@@ -54,12 +54,12 @@ namespace XD.SDK.Common.Internal.Mobile
|
|
|
54
54
|
|
|
55
55
|
EngineBridge.GetInstance().CallHandler(command, (result) =>
|
|
56
56
|
{
|
|
57
|
-
XDGLogger.Debug("===> Init XDG SDK result: " + result.ToJson());
|
|
57
|
+
XDGLogger.Debug("===> Init XDG SDK result: " + result.ToJson(), XDGLoggerTag.Bridge);
|
|
58
58
|
var xdgError = result.Parse2XDGError();
|
|
59
59
|
if (!XDGTool.CheckResultSuccess(result))
|
|
60
60
|
{
|
|
61
61
|
callback(false, xdgError?.ErrorMsg ?? "Init SDK Fail");
|
|
62
|
-
XDGLogger.Error("初始化失败 result:" + result.ToJson());
|
|
62
|
+
XDGLogger.Error("初始化失败 result:" + result.ToJson(), XDGLoggerTag.Bridge);
|
|
63
63
|
return;
|
|
64
64
|
}
|
|
65
65
|
|
|
@@ -84,7 +84,7 @@ namespace XD.SDK.Common.Internal.Mobile
|
|
|
84
84
|
#if UNITY_ANDROID
|
|
85
85
|
using (var commonBridgeClass = new AndroidJavaClass(BridgeConstants.Common.BridgeStaticImpl))
|
|
86
86
|
{
|
|
87
|
-
config =
|
|
87
|
+
config = commonBridgeClass.CallStatic<string>("getTapSDKConfig");
|
|
88
88
|
}
|
|
89
89
|
#elif UNITY_IOS
|
|
90
90
|
IntPtr ptr = XDCommonConfigs();
|
|
@@ -92,9 +92,10 @@ namespace XD.SDK.Common.Internal.Mobile
|
|
|
92
92
|
#endif
|
|
93
93
|
if (string.IsNullOrEmpty(config))
|
|
94
94
|
{
|
|
95
|
-
XDGLogger.Warn("[CommonFeature] get Mobile TapSDK Config Empty!");
|
|
95
|
+
XDGLogger.Warn("[CommonFeature] get Mobile TapSDK Config Empty!", XDGLoggerTag.Bridge);
|
|
96
96
|
return;
|
|
97
97
|
}
|
|
98
|
+
|
|
98
99
|
MainThreadDispatcher.RunOnMainThread(() =>
|
|
99
100
|
{
|
|
100
101
|
var commonConfig = JsonConvert.DeserializeObject<CommonConfig>(config);
|
|
@@ -144,7 +145,7 @@ namespace XD.SDK.Common.Internal.Mobile
|
|
|
144
145
|
|
|
145
146
|
public void SetLanguage(LangType langType)
|
|
146
147
|
{
|
|
147
|
-
XDGLogger.Debug("===> SetLanguage langType: " + langType);
|
|
148
|
+
XDGLogger.Debug("===> SetLanguage langType: " + langType, XDGLoggerTag.Bridge);
|
|
148
149
|
var command = new Command.Builder()
|
|
149
150
|
.Service(BridgeConstants.Common.BridgeName)
|
|
150
151
|
.Method("setLanguage")
|
|
@@ -162,7 +163,7 @@ namespace XD.SDK.Common.Internal.Mobile
|
|
|
162
163
|
.OnceTime(true)
|
|
163
164
|
.CommandBuilder();
|
|
164
165
|
EngineBridge.GetInstance().CallHandler(command);
|
|
165
|
-
XDGLogger.Debug("===> StoreReview");
|
|
166
|
+
XDGLogger.Debug("===> StoreReview", XDGLoggerTag.Bridge);
|
|
166
167
|
}
|
|
167
168
|
|
|
168
169
|
public void TrackRole(XDGRoleInfo role)
|
|
@@ -186,7 +187,7 @@ namespace XD.SDK.Common.Internal.Mobile
|
|
|
186
187
|
.OnceTime(true)
|
|
187
188
|
.CommandBuilder();
|
|
188
189
|
EngineBridge.GetInstance().CallHandler(command);
|
|
189
|
-
XDGLogger.Debug($"===> TrackEvent: {eventName} {properties}");
|
|
190
|
+
XDGLogger.Debug($"===> TrackEvent: {eventName} {properties}", XDGLoggerTag.Bridge);
|
|
190
191
|
}
|
|
191
192
|
|
|
192
193
|
public void PreloadWebPage(string url)
|
|
@@ -202,7 +203,7 @@ namespace XD.SDK.Common.Internal.Mobile
|
|
|
202
203
|
|
|
203
204
|
public void OpenWebPage(string url, Action<WebActionEnum, Dictionary<string, object>> callback)
|
|
204
205
|
{
|
|
205
|
-
XDGLogger.Debug("[unity 打开 Web Url:");
|
|
206
|
+
XDGLogger.Debug("[unity 打开 Web Url:", XDGLoggerTag.Bridge);
|
|
206
207
|
var command = new Command.Builder()
|
|
207
208
|
.Service(BridgeConstants.Common.BridgeName)
|
|
208
209
|
.Method("openWebPage")
|
|
@@ -212,7 +213,7 @@ namespace XD.SDK.Common.Internal.Mobile
|
|
|
212
213
|
.CommandBuilder();
|
|
213
214
|
EngineBridge.GetInstance().CallHandler(command, result =>
|
|
214
215
|
{
|
|
215
|
-
XDGLogger.Debug("===> OpenWebPage: " + result.ToJson());
|
|
216
|
+
XDGLogger.Debug("===> OpenWebPage: " + result.ToJson(), XDGLoggerTag.Bridge);
|
|
216
217
|
if (!XDGTool.CheckResultSuccess(result))
|
|
217
218
|
{
|
|
218
219
|
return;
|
|
@@ -290,7 +291,7 @@ namespace XD.SDK.Common.Internal.Mobile
|
|
|
290
291
|
[DllImport("__Internal")]
|
|
291
292
|
private static extern void XDCommonTargetCountryOrRegion(string countryOrRegion);
|
|
292
293
|
#endif
|
|
293
|
-
|
|
294
|
+
|
|
294
295
|
public void DisableAgreementUI()
|
|
295
296
|
{
|
|
296
297
|
#if UNITY_ANDROID
|
|
@@ -29,7 +29,7 @@ namespace XD.SDK.Common.Internal.Mobile
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
XDGLogger.Debug($"[CommonParamsInterceptor] commParams:{JsonConvert.SerializeObject(request.QueryParams)}");
|
|
32
|
+
XDGLogger.Debug($"[CommonParamsInterceptor] commParams:{JsonConvert.SerializeObject(request.QueryParams)}", XDGLoggerTag.Http);
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
}
|
|
@@ -80,14 +80,14 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
80
80
|
}
|
|
81
81
|
catch (Exception e)
|
|
82
82
|
{
|
|
83
|
-
XDGLogger.Warn($"拉取最新协议失败 {e}");
|
|
83
|
+
XDGLogger.Warn($"拉取最新协议失败 {e}", XDGLoggerTag.Common);
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
if (_latestAgreement == null
|
|
87
87
|
|| string.IsNullOrEmpty(_latestAgreement.Title)
|
|
88
88
|
|| string.IsNullOrEmpty(_latestAgreement.TitleFirst))
|
|
89
89
|
{
|
|
90
|
-
XDGLogger.Warn("fetch agreement failed, try to get cache. ");
|
|
90
|
+
XDGLogger.Warn("fetch agreement failed, try to get cache. ", XDGLoggerTag.Common);
|
|
91
91
|
// 服务端拉取失败,读取本地缓存
|
|
92
92
|
_latestAgreement = await LatestAgreementPersistence.Load<Agreement>();
|
|
93
93
|
}
|
|
@@ -96,7 +96,7 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
96
96
|
|| string.IsNullOrEmpty(_latestAgreement.Title)
|
|
97
97
|
|| string.IsNullOrEmpty(_latestAgreement.TitleFirst))
|
|
98
98
|
{
|
|
99
|
-
XDGLogger.Warn("get cache failed, try to get local. ");
|
|
99
|
+
XDGLogger.Warn("get cache failed, try to get local. ", XDGLoggerTag.Common);
|
|
100
100
|
_latestAgreement = await LoadLocalConfig();
|
|
101
101
|
}
|
|
102
102
|
|
|
@@ -184,7 +184,7 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
184
184
|
currentRegion = "DF";
|
|
185
185
|
}
|
|
186
186
|
|
|
187
|
-
XDGLogger.Warn("get local config : " + currentRegion);
|
|
187
|
+
XDGLogger.Warn("get local config : " + currentRegion, XDGLoggerTag.Common);
|
|
188
188
|
|
|
189
189
|
if (currentRegion.Equals("KR", StringComparison.OrdinalIgnoreCase))
|
|
190
190
|
{
|
|
@@ -67,7 +67,7 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
67
67
|
|
|
68
68
|
public void StoreReview()
|
|
69
69
|
{
|
|
70
|
-
XDGLogger.Warn("Standalone not support StoreReview");
|
|
70
|
+
XDGLogger.Warn("Standalone not support StoreReview", XDGLoggerTag.Common);
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
public void TrackUser(string userId)
|
|
@@ -156,13 +156,13 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
156
156
|
{
|
|
157
157
|
if (isIniting)
|
|
158
158
|
{
|
|
159
|
-
XDGLogger.Warn("正在初始化...");
|
|
159
|
+
XDGLogger.Warn("正在初始化...", XDGLoggerTag.Common);
|
|
160
160
|
return;
|
|
161
161
|
}
|
|
162
162
|
|
|
163
163
|
if (isInited)
|
|
164
164
|
{
|
|
165
|
-
XDGLogger.Warn("已经初始化");
|
|
165
|
+
XDGLogger.Warn("已经初始化", XDGLoggerTag.Common);
|
|
166
166
|
return;
|
|
167
167
|
}
|
|
168
168
|
|
|
@@ -212,8 +212,9 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
212
212
|
|
|
213
213
|
await XDGEventBus.PublishAsync(XDGEvents.TapSDKInit,
|
|
214
214
|
initParam.Lang.FormatToXDLangString(),
|
|
215
|
-
initParam.PackageType
|
|
216
|
-
|
|
215
|
+
initParam.PackageType,
|
|
216
|
+
JsonConvert.SerializeObject(initParam.DbProperties));
|
|
217
|
+
|
|
217
218
|
XDGEventBus.Publish(XDGEvents.TdsSDKInit, tapConfig.ClientId,
|
|
218
219
|
tapConfig.ClientToken,
|
|
219
220
|
tapConfig.ServerUrl);
|
|
@@ -240,6 +241,7 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
240
241
|
{
|
|
241
242
|
// ignore
|
|
242
243
|
}
|
|
244
|
+
|
|
243
245
|
if (!ConfigModule.DisableWebPreload)
|
|
244
246
|
{
|
|
245
247
|
WebRequest.Preload(ConfigModule.IsGlobal ? "https://poster.xd.com/r/versions.html" : "https://poster.xd.cn/r/versions.html");
|
|
@@ -55,6 +55,8 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
55
55
|
|
|
56
56
|
[JsonIgnore] public bool DisableWebPreload { get; set; }
|
|
57
57
|
|
|
58
|
+
[JsonIgnore] public Dictionary<string, object> DbProperties { get; set; }
|
|
59
|
+
|
|
58
60
|
/// <summary>
|
|
59
61
|
/// 判断是否为海外
|
|
60
62
|
/// </summary>
|
|
@@ -64,7 +66,7 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
64
66
|
{
|
|
65
67
|
#if UNITY_STANDALONE_WIN
|
|
66
68
|
// win 环境 + packageType 为 tapPC + clientPublicKey 不为空
|
|
67
|
-
XDGLogger.Debug($"UsingTapPC:{IsGlobal} pacakgeType:{PackageType} TapConfig:{TapConfig != null} !clientPublicKey:{!string.IsNullOrEmpty(TapConfig?.ClientPublicKey)}");
|
|
69
|
+
XDGLogger.Debug($"UsingTapPC:{IsGlobal} pacakgeType:{PackageType} TapConfig:{TapConfig != null} !clientPublicKey:{!string.IsNullOrEmpty(TapConfig?.ClientPublicKey)}",XDGLoggerTag.Common);
|
|
68
70
|
return !IsGlobal && string.Equals(PackageType, XDGPackageType.PackageTypePCTapTap) && TapConfig != null && !string.IsNullOrEmpty(TapConfig.ClientPublicKey);
|
|
69
71
|
#endif
|
|
70
72
|
return false;
|
|
@@ -35,7 +35,7 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
35
35
|
private static string LoadConfigText()
|
|
36
36
|
{
|
|
37
37
|
#if UNITY_EDITOR
|
|
38
|
-
|
|
38
|
+
var xdConfigFilePath = GetXDConfigPath(ConfigFile);
|
|
39
39
|
#else
|
|
40
40
|
var xdConfigFilePath = Path.Combine(Application.streamingAssetsPath, $"{ConfigFile}.json");
|
|
41
41
|
#endif
|
|
@@ -92,6 +92,7 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
92
92
|
var txtAsset = LoadConfigText();
|
|
93
93
|
_appConfig = JsonConvert.DeserializeObject<AppConfig>(txtAsset);
|
|
94
94
|
_appConfig.PackageType = param?.PackageType;
|
|
95
|
+
_appConfig.DbProperties = param?.DbProperties;
|
|
95
96
|
if (string.IsNullOrEmpty(_appConfig.WebPayUrl))
|
|
96
97
|
{
|
|
97
98
|
_appConfig.WebPayUrl = _appConfig.IsGlobal ? "https://sdkpay.xd.com" : "https://sdkpay.xd.cn";
|
|
@@ -140,7 +141,7 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
140
141
|
}
|
|
141
142
|
catch (Exception e)
|
|
142
143
|
{
|
|
143
|
-
XDGLogger.Warn($"拉取配置失败: {e}");
|
|
144
|
+
XDGLogger.Warn($"拉取配置失败: {e}", XDGLoggerTag.Common);
|
|
144
145
|
config = await Persistence.Load<Config>();
|
|
145
146
|
}
|
|
146
147
|
|
|
@@ -253,6 +254,8 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
253
254
|
public static bool CustomerDisable => _appConfig.CustomerDisable;
|
|
254
255
|
|
|
255
256
|
public static bool DisableWebPreload => _appConfig.DisableWebPreload;
|
|
257
|
+
|
|
258
|
+
public static Dictionary<string, object> DbProperties => _appConfig.DbProperties;
|
|
256
259
|
}
|
|
257
260
|
}
|
|
258
261
|
#endif
|
|
@@ -54,12 +54,12 @@ namespace XD.SDK.Common.Internal.Standalone.Http.Interceptor
|
|
|
54
54
|
var dataStr = $"{timeStr}\n{nonce}\n{md}\n{pathAndQuery}\n{domain}\n{port}\n";
|
|
55
55
|
var mac = Base64WithSecret(accessToken.MacKey, dataStr);
|
|
56
56
|
var authToken = $"MAC id=\"{accessToken.Kid}\",ts=\"{timeStr}\",nonce=\"{nonce}\",mac=\"{mac}\"";
|
|
57
|
-
|
|
57
|
+
XDGLogger.Debug($"generate MAC token: {authToken}", XDGLoggerTag.Http);
|
|
58
58
|
return authToken;
|
|
59
59
|
}
|
|
60
60
|
catch (Exception ex)
|
|
61
61
|
{
|
|
62
|
-
XDGLogger.Error($"Failed to generate MAC token: {ex.Message}");
|
|
62
|
+
XDGLogger.Error($"Failed to generate MAC token: {ex.Message}", XDGLoggerTag.Http);
|
|
63
63
|
return null;
|
|
64
64
|
}
|
|
65
65
|
}
|
|
@@ -68,7 +68,7 @@ namespace XD.SDK.Common.Internal.Standalone.Http.Interceptor
|
|
|
68
68
|
{
|
|
69
69
|
var sb = new StringBuilder();
|
|
70
70
|
var random = new System.Random();
|
|
71
|
-
|
|
71
|
+
|
|
72
72
|
for (int i = 0; i < length; i++)
|
|
73
73
|
{
|
|
74
74
|
sb.Append(LetterStr.Substring(random.Next(0, LetterStr.Length), 1));
|
|
@@ -89,4 +89,4 @@ namespace XD.SDK.Common.Internal.Standalone.Http.Interceptor
|
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
|
-
#endif
|
|
92
|
+
#endif
|
|
@@ -76,14 +76,14 @@ namespace XD.SDK.Common.Internal.Standalone.Http.Interceptor
|
|
|
76
76
|
});
|
|
77
77
|
|
|
78
78
|
UIManager.DismissLoading();
|
|
79
|
-
|
|
79
|
+
|
|
80
80
|
// 等待用户交互完成
|
|
81
81
|
await tcs.Task;
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
catch (Exception ex)
|
|
85
85
|
{
|
|
86
|
-
XDGLogger.Error($"Failed to handle dialog error: {ex.Message}");
|
|
86
|
+
XDGLogger.Error($"Failed to handle dialog error: {ex.Message}", XDGLoggerTag.Http);
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
}
|
|
@@ -100,7 +100,7 @@ namespace XD.SDK.Common.Internal.Standalone.Http.Interceptor
|
|
|
100
100
|
{
|
|
101
101
|
int httpStatusCode = (int)statusCode;
|
|
102
102
|
string message = responseContent;
|
|
103
|
-
|
|
103
|
+
|
|
104
104
|
try
|
|
105
105
|
{
|
|
106
106
|
// 尝试解析 LeanCloud 返回的错误信息
|
|
@@ -112,7 +112,7 @@ namespace XD.SDK.Common.Internal.Standalone.Http.Interceptor
|
|
|
112
112
|
}
|
|
113
113
|
catch (Exception ex)
|
|
114
114
|
{
|
|
115
|
-
XDGLogger.Debug($"Failed to parse error response: {ex}");
|
|
115
|
+
XDGLogger.Debug($"Failed to parse error response: {ex}", XDGLoggerTag.Http);
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
// 如果解析失败,创建基本的异常
|
|
@@ -120,4 +120,4 @@ namespace XD.SDK.Common.Internal.Standalone.Http.Interceptor
|
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
|
-
#endif
|
|
123
|
+
#endif
|
|
@@ -3,54 +3,77 @@ using System.Linq;
|
|
|
3
3
|
using System.Text;
|
|
4
4
|
using System.Net.Http;
|
|
5
5
|
|
|
6
|
-
namespace XD.SDK.Common.Internal.Standalone
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
namespace XD.SDK.Common.Internal.Standalone
|
|
7
|
+
{
|
|
8
|
+
public class XDHttpUtils
|
|
9
|
+
{
|
|
10
|
+
public static void PrintRequest(HttpClient client, HttpRequestMessage request, string content = null)
|
|
11
|
+
{
|
|
12
|
+
if (XDGLogger.LogDelegate == null)
|
|
13
|
+
{
|
|
10
14
|
return;
|
|
11
15
|
}
|
|
12
|
-
|
|
16
|
+
|
|
17
|
+
if (client == null)
|
|
18
|
+
{
|
|
13
19
|
return;
|
|
14
20
|
}
|
|
15
|
-
|
|
21
|
+
|
|
22
|
+
if (request == null)
|
|
23
|
+
{
|
|
16
24
|
return;
|
|
17
25
|
}
|
|
26
|
+
|
|
18
27
|
StringBuilder sb = new StringBuilder();
|
|
19
28
|
sb.AppendLine("=== HTTP Request Start ===");
|
|
20
29
|
sb.AppendLine($"URL: {request.RequestUri}");
|
|
21
30
|
sb.AppendLine($"Method: {request.Method}");
|
|
22
31
|
sb.AppendLine($"Headers: ");
|
|
23
|
-
foreach (var header in client.DefaultRequestHeaders)
|
|
32
|
+
foreach (var header in client.DefaultRequestHeaders)
|
|
33
|
+
{
|
|
24
34
|
sb.AppendLine($"\t{header.Key}: {string.Join(",", header.Value.ToArray())}");
|
|
25
35
|
}
|
|
26
|
-
|
|
36
|
+
|
|
37
|
+
foreach (var header in request.Headers)
|
|
38
|
+
{
|
|
27
39
|
sb.AppendLine($"\t{header.Key}: {string.Join(",", header.Value.ToArray())}");
|
|
28
40
|
}
|
|
29
|
-
|
|
30
|
-
|
|
41
|
+
|
|
42
|
+
if (request.Content != null)
|
|
43
|
+
{
|
|
44
|
+
foreach (var header in request.Content.Headers)
|
|
45
|
+
{
|
|
31
46
|
sb.AppendLine($"\t{header.Key}: {string.Join(",", header.Value.ToArray())}");
|
|
32
47
|
}
|
|
33
48
|
}
|
|
34
|
-
|
|
49
|
+
|
|
50
|
+
if (!string.IsNullOrEmpty(content))
|
|
51
|
+
{
|
|
35
52
|
sb.AppendLine($"Content: {content}");
|
|
36
53
|
}
|
|
54
|
+
|
|
37
55
|
sb.AppendLine("=== HTTP Request End ===");
|
|
38
|
-
XDGLogger.Debug(sb.ToString());
|
|
56
|
+
XDGLogger.Debug(sb.ToString(), XDGLoggerTag.Http);
|
|
39
57
|
}
|
|
40
58
|
|
|
41
|
-
public static void PrintResponse(HttpResponseMessage response, string content = null)
|
|
42
|
-
|
|
59
|
+
public static void PrintResponse(HttpResponseMessage response, string content = null)
|
|
60
|
+
{
|
|
61
|
+
if (XDGLogger.LogDelegate == null)
|
|
62
|
+
{
|
|
43
63
|
return;
|
|
44
64
|
}
|
|
65
|
+
|
|
45
66
|
StringBuilder sb = new StringBuilder();
|
|
46
67
|
sb.AppendLine("=== HTTP Response Start ===");
|
|
47
68
|
sb.AppendLine($"URL: {response.RequestMessage.RequestUri}");
|
|
48
69
|
sb.AppendLine($"Status Code: {response.StatusCode}");
|
|
49
|
-
if (!string.IsNullOrEmpty(content))
|
|
70
|
+
if (!string.IsNullOrEmpty(content))
|
|
71
|
+
{
|
|
50
72
|
sb.AppendLine($"Content: {content}");
|
|
51
73
|
}
|
|
74
|
+
|
|
52
75
|
sb.AppendLine("=== HTTP Response End ===");
|
|
53
|
-
XDGLogger.Debug(sb.ToString());
|
|
76
|
+
XDGLogger.Debug(sb.ToString(), XDGLoggerTag.Http);
|
|
54
77
|
}
|
|
55
78
|
}
|
|
56
79
|
}
|