com.xd.sdk.common 7.1.0 → 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 +8 -5
- 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
|
@@ -16,7 +16,7 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
16
16
|
private HyperlinkText _summaryText;
|
|
17
17
|
|
|
18
18
|
private HyperlinkText _promptText;
|
|
19
|
-
|
|
19
|
+
|
|
20
20
|
// private
|
|
21
21
|
private Button _disagreeButton;
|
|
22
22
|
private Button _agreeButton;
|
|
@@ -69,7 +69,7 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
69
69
|
allOptionGameObject.transform.SetParent(_optionGroup.transform);
|
|
70
70
|
allOptionGameObject.transform.localScale = Vector3.one;
|
|
71
71
|
_allOption = allOptionGameObject.AddComponent<AgreementOptionAll>();
|
|
72
|
-
EnableRichText(_allOption.label,LatestAgreement.AgreeAll);
|
|
72
|
+
EnableRichText(_allOption.label, LatestAgreement.AgreeAll);
|
|
73
73
|
_allOption.AddListener(() =>
|
|
74
74
|
{
|
|
75
75
|
var newState = !IsRequiredAndOptionalOptionAgreed();
|
|
@@ -80,6 +80,7 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
80
80
|
option.toggle.isOn = newState;
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
+
|
|
83
84
|
if (_optionalOptions != null && _optionalOptions.Count > 0)
|
|
84
85
|
{
|
|
85
86
|
foreach (var option in _optionalOptions)
|
|
@@ -87,6 +88,7 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
87
88
|
option.toggle.isOn = newState;
|
|
88
89
|
}
|
|
89
90
|
}
|
|
91
|
+
|
|
90
92
|
UpdateUIState();
|
|
91
93
|
});
|
|
92
94
|
}
|
|
@@ -112,10 +114,7 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
112
114
|
var agreementOption = optionGameObject.AddComponent<AgreementOptionNormal>();
|
|
113
115
|
agreementOption.optionName = option.Name;
|
|
114
116
|
EnableRichText(agreementOption.label, option.Title);
|
|
115
|
-
agreementOption.AddListener((isOn) =>
|
|
116
|
-
{
|
|
117
|
-
UpdateUIState();
|
|
118
|
-
});
|
|
117
|
+
agreementOption.AddListener((isOn) => { UpdateUIState(); });
|
|
119
118
|
|
|
120
119
|
if (option.Required)
|
|
121
120
|
{
|
|
@@ -136,14 +135,15 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
136
135
|
|
|
137
136
|
_titleText.text = FirstCheck ? LatestAgreement.TitleFirst : LatestAgreement.Title;
|
|
138
137
|
var summaryText = FirstCheck ? LatestAgreement.SummaryFirst : LatestAgreement.Summary;
|
|
139
|
-
var promptText= FirstCheck ? LatestAgreement.PromptFirst : LatestAgreement.Prompt;
|
|
138
|
+
var promptText = FirstCheck ? LatestAgreement.PromptFirst : LatestAgreement.Prompt;
|
|
140
139
|
if (!string.IsNullOrEmpty(LatestAgreement.Agree))
|
|
141
140
|
{
|
|
142
|
-
_agreeButton.transform.Find("Text").GetComponent<Text>().text = LatestAgreement.Agree;
|
|
141
|
+
_agreeButton.transform.Find("Text").GetComponent<Text>().text = LatestAgreement.Agree;
|
|
143
142
|
}
|
|
143
|
+
|
|
144
144
|
if (!string.IsNullOrEmpty(LatestAgreement.Disagree))
|
|
145
145
|
{
|
|
146
|
-
_disagreeButton.transform.Find("Text").GetComponent<Text>().text = LatestAgreement.Disagree;
|
|
146
|
+
_disagreeButton.transform.Find("Text").GetComponent<Text>().text = LatestAgreement.Disagree;
|
|
147
147
|
}
|
|
148
148
|
|
|
149
149
|
var generator = _summaryText.cachedTextGenerator;
|
|
@@ -162,24 +162,26 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
162
162
|
height = 140;
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
|
+
|
|
165
166
|
var rectTransform = _summaryText.GetComponent<RectTransform>();
|
|
166
167
|
rectTransform.sizeDelta = new Vector2(width, height);
|
|
167
168
|
EnableRichText(_summaryText, summaryText);
|
|
168
169
|
EnableRichText(_promptText, promptText);
|
|
169
|
-
|
|
170
|
+
|
|
170
171
|
// 不知道为啥默认状态不在顶部,只能手动滚动到顶部
|
|
171
172
|
var scrollView = transform.Find("ContentGroup/SummaryGroup/SummaryBG/ScrollView").GetComponent<ScrollRect>();
|
|
172
173
|
scrollView.verticalNormalizedPosition = 1;
|
|
173
|
-
|
|
174
|
+
|
|
174
175
|
UpdateUIState();
|
|
175
176
|
}
|
|
176
|
-
|
|
177
|
+
|
|
177
178
|
private void EnableRichText(HyperlinkText textView, string content)
|
|
178
179
|
{
|
|
179
180
|
if (textView == null || string.IsNullOrEmpty(content))
|
|
180
181
|
{
|
|
181
182
|
return;
|
|
182
183
|
}
|
|
184
|
+
|
|
183
185
|
textView.text = content.Replace("<font color=", "<color=").Replace("</font>", "</color>");
|
|
184
186
|
textView.colorStartStr = "<color=#15C5CE>";
|
|
185
187
|
textView.colorEndStr = "</color>";
|
|
@@ -201,7 +203,8 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
201
203
|
private void OnDisagreeButtonClicked()
|
|
202
204
|
{
|
|
203
205
|
LocalizableString localizableString = XDLocalization.GetCurrentLocalizableString();
|
|
204
|
-
Dictionary<string, object> config = new Dictionary<string, object>
|
|
206
|
+
Dictionary<string, object> config = new Dictionary<string, object>
|
|
207
|
+
{
|
|
205
208
|
{ DisagreeConfirmAlert.CONTENT_KEY, localizableString.AgreementDisagreeConfirmContent },
|
|
206
209
|
{ DisagreeConfirmAlert.SECONDARY_TEXT_KEY, localizableString.AgreementDisagreeConfirmBack },
|
|
207
210
|
{ DisagreeConfirmAlert.PRIMARY_TEXT_KEY, localizableString.AgreementDisagreeConfirmExit }
|
|
@@ -225,7 +228,8 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
225
228
|
if (!IsRequiredOptionAgreed())
|
|
226
229
|
{
|
|
227
230
|
LocalizableString localizable = XDLocalization.GetCurrentLocalizableString();
|
|
228
|
-
Dictionary<string, object> config = new Dictionary<string, object>
|
|
231
|
+
Dictionary<string, object> config = new Dictionary<string, object>
|
|
232
|
+
{
|
|
229
233
|
{ DisagreeConfirmAlert.CONTENT_KEY, localizable.AgreementOptionNotAgreeAlertContent },
|
|
230
234
|
{ DisagreeConfirmAlert.SECONDARY_TEXT_KEY, localizable.AgreementOptionNotAgreeAlertConfirm },
|
|
231
235
|
{ DisagreeConfirmAlert.PRIMARY_TEXT_KEY, localizable.AgreementOptionNotAgreeAlertCancel }
|
|
@@ -235,7 +239,6 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
235
239
|
{
|
|
236
240
|
if (code == 0)
|
|
237
241
|
{
|
|
238
|
-
|
|
239
242
|
UIManager.Dismiss();
|
|
240
243
|
if (_requiredOptions != null && _requiredOptions.Count > 0)
|
|
241
244
|
{
|
|
@@ -244,6 +247,7 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
244
247
|
option.toggle.isOn = true;
|
|
245
248
|
}
|
|
246
249
|
}
|
|
250
|
+
|
|
247
251
|
if (_optionalOptions != null && _optionalOptions.Count > 0)
|
|
248
252
|
{
|
|
249
253
|
foreach (var option in _optionalOptions)
|
|
@@ -251,33 +255,35 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
251
255
|
option.toggle.isOn = true;
|
|
252
256
|
}
|
|
253
257
|
}
|
|
258
|
+
|
|
254
259
|
OnAgreeButtonClicked();
|
|
255
260
|
}
|
|
256
261
|
else if (code == 1)
|
|
257
262
|
{
|
|
258
263
|
UIManager.Dismiss();
|
|
259
264
|
}
|
|
260
|
-
});
|
|
265
|
+
});
|
|
261
266
|
return;
|
|
262
267
|
}
|
|
263
268
|
|
|
264
269
|
var objects = new Dictionary<string, object>();
|
|
265
|
-
|
|
270
|
+
|
|
266
271
|
var dayPush = false;
|
|
267
272
|
var nightPush = false;
|
|
268
|
-
|
|
273
|
+
|
|
269
274
|
ProcessOptions(_requiredOptions, objects, ref dayPush, ref nightPush);
|
|
270
275
|
ProcessOptions(_optionalOptions, objects, ref dayPush, ref nightPush);
|
|
271
|
-
|
|
276
|
+
|
|
272
277
|
OnCallback(0, objects);
|
|
273
278
|
}
|
|
274
|
-
|
|
279
|
+
|
|
275
280
|
private void ProcessOptions(List<AgreementOptionNormal> options, Dictionary<string, object> objects, ref bool dayPush, ref bool nightPush)
|
|
276
281
|
{
|
|
277
282
|
if (options == null || options.Count == 0)
|
|
278
283
|
{
|
|
279
284
|
return;
|
|
280
285
|
}
|
|
286
|
+
|
|
281
287
|
foreach (var option in options)
|
|
282
288
|
{
|
|
283
289
|
objects.Add(option.optionName, option.toggle.isOn);
|
|
@@ -344,9 +350,9 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
344
350
|
|
|
345
351
|
if (_allOption != null && _allOption.toggleButton != null && _allOption.toggleButton.image != null)
|
|
346
352
|
{
|
|
347
|
-
_allOption.toggleButton.image.sprite = sprite;
|
|
353
|
+
_allOption.toggleButton.image.sprite = sprite;
|
|
348
354
|
}
|
|
349
|
-
|
|
355
|
+
|
|
350
356
|
_agreeButton.image.sprite = IsRequiredOptionAgreed() ? _agreeButtonNormalSprite : _agreeButton.spriteState.disabledSprite;
|
|
351
357
|
_agreeButton.transition = IsRequiredAndOptionalOptionAgreed() ? Selectable.Transition.SpriteSwap : Selectable.Transition.None;
|
|
352
358
|
}
|
|
@@ -357,6 +363,7 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
357
363
|
if (_uploadConfigButtonClickedCount >= UploadConfigButtonClickTriggerCount)
|
|
358
364
|
{
|
|
359
365
|
UploadConfigModule.TriggerUploadConfig();
|
|
366
|
+
XDGLogger.EnableFileLog = true;
|
|
360
367
|
}
|
|
361
368
|
}
|
|
362
369
|
}
|
|
@@ -35,7 +35,7 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
35
35
|
UIManager.ShowLoading();
|
|
36
36
|
|
|
37
37
|
string url = extra["url"] as string;
|
|
38
|
-
XDGLogger.Debug($"XDWebViewAlert load url: {url}");
|
|
38
|
+
XDGLogger.Debug($"XDWebViewAlert load url: {url}", XDGLoggerTag.Web);
|
|
39
39
|
canvasWebViewPrefab.WebView.LoadUrl(url);
|
|
40
40
|
|
|
41
41
|
string jsCode = @";(function (window) {
|
|
@@ -63,7 +63,7 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
jsCode += "})(window);";
|
|
66
|
-
XDGLogger.Debug($"ExecuteJavaScript: {jsCode}");
|
|
66
|
+
XDGLogger.Debug($"ExecuteJavaScript: {jsCode}", XDGLoggerTag.Web);
|
|
67
67
|
// 注入 js
|
|
68
68
|
_ = canvasWebViewPrefab.WebView.ExecuteJavaScript(jsCode);
|
|
69
69
|
|
|
@@ -85,10 +85,10 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
85
85
|
errorText = transform.Find("WebView/LoadFailedView/ErrorText").GetComponent<Text>();
|
|
86
86
|
retryButton = transform.Find("WebView/LoadFailedView/RetryButton").GetComponent<Button>();
|
|
87
87
|
retryButtonText = transform.Find("WebView/LoadFailedView/RetryButton/Text").GetComponent<Text>();
|
|
88
|
-
|
|
88
|
+
|
|
89
89
|
var webViewGameObject = Instantiate(Resources.Load(nameof(CanvasWebViewPrefab)), transform.Find("WebView/WebViewContainer"), false) as GameObject;
|
|
90
90
|
canvasWebViewPrefab = webViewGameObject?.GetComponent<CanvasWebViewPrefab>();
|
|
91
|
-
|
|
91
|
+
|
|
92
92
|
ErrorPanelObject.SetActive(false);
|
|
93
93
|
retryButton.onClick.AddListener(Reload);
|
|
94
94
|
}
|
|
@@ -145,7 +145,6 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
145
145
|
|
|
146
146
|
canvasWebViewPrefab.WebView.MessageEmitted += (sender, eventArgs) =>
|
|
147
147
|
{
|
|
148
|
-
XDGLogger.Debug(eventArgs.Value);
|
|
149
148
|
Dictionary<string, string> response =
|
|
150
149
|
JsonConvert.DeserializeObject<Dictionary<string, string>>(eventArgs.Value);
|
|
151
150
|
Dictionary<string, object> data =
|
|
@@ -127,7 +127,7 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
127
127
|
}
|
|
128
128
|
catch (Exception e)
|
|
129
129
|
{
|
|
130
|
-
XDGLogger.Error("当前开启 XD_STEAM_SUPPORT,但没有 Steam 环境");
|
|
130
|
+
XDGLogger.Error("当前开启 XD_STEAM_SUPPORT,但没有 Steam 环境", XDGLoggerTag.Common);
|
|
131
131
|
return null;
|
|
132
132
|
}
|
|
133
133
|
}
|
|
@@ -157,7 +157,7 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
157
157
|
}
|
|
158
158
|
catch (Exception e)
|
|
159
159
|
{
|
|
160
|
-
XDGLogger.Error("当前开启 XD_STEAM_SUPPORT,但没有 Steam 环境");
|
|
160
|
+
XDGLogger.Error("当前开启 XD_STEAM_SUPPORT,但没有 Steam 环境", XDGLoggerTag.Common);
|
|
161
161
|
return null;
|
|
162
162
|
}
|
|
163
163
|
}
|
|
@@ -83,7 +83,7 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
83
83
|
|
|
84
84
|
if (result != 0 || hKey == IntPtr.Zero)
|
|
85
85
|
{
|
|
86
|
-
XDGLogger.Debug($"Failed to open registry key: {keyPath}");
|
|
86
|
+
XDGLogger.Debug($"Failed to open registry key: {keyPath}", XDGLoggerTag.Common);
|
|
87
87
|
return defaultValue;
|
|
88
88
|
}
|
|
89
89
|
|
|
@@ -102,7 +102,7 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
102
102
|
|
|
103
103
|
if (result != 0 && result != 234) // 234 = ERROR_MORE_DATA
|
|
104
104
|
{
|
|
105
|
-
XDGLogger.Debug($"Failed to query registry value size: {valueName}");
|
|
105
|
+
XDGLogger.Debug($"Failed to query registry value size: {valueName}", XDGLoggerTag.Common);
|
|
106
106
|
return defaultValue;
|
|
107
107
|
}
|
|
108
108
|
|
|
@@ -123,7 +123,7 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
123
123
|
|
|
124
124
|
if (result != 0)
|
|
125
125
|
{
|
|
126
|
-
XDGLogger.Debug($"Failed to query registry value: {valueName}");
|
|
126
|
+
XDGLogger.Debug($"Failed to query registry value: {valueName}", XDGLoggerTag.Common);
|
|
127
127
|
return defaultValue;
|
|
128
128
|
}
|
|
129
129
|
|
|
@@ -140,7 +140,7 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
140
140
|
}
|
|
141
141
|
catch (Exception ex)
|
|
142
142
|
{
|
|
143
|
-
XDGLogger.Debug($"Error reading registry: {ex.Message}");
|
|
143
|
+
XDGLogger.Debug($"Error reading registry: {ex.Message}", XDGLoggerTag.Common);
|
|
144
144
|
return defaultValue;
|
|
145
145
|
}
|
|
146
146
|
}
|
|
@@ -172,7 +172,7 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
172
172
|
}
|
|
173
173
|
catch (Exception ex)
|
|
174
174
|
{
|
|
175
|
-
XDGLogger.Debug($"Error checking registry key: {ex.Message}");
|
|
175
|
+
XDGLogger.Debug($"Error checking registry key: {ex.Message}", XDGLoggerTag.Common);
|
|
176
176
|
return false;
|
|
177
177
|
}
|
|
178
178
|
finally
|
|
@@ -189,13 +189,13 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
189
189
|
public static string ReadRegistryValue(string keyPath, string valueName, string defaultValue = "",
|
|
190
190
|
bool useHKLM = false)
|
|
191
191
|
{
|
|
192
|
-
XDGLogger.Debug("Registry functions are only available on Windows platforms");
|
|
192
|
+
XDGLogger.Debug("Registry functions are only available on Windows platforms", XDGLoggerTag.Common);
|
|
193
193
|
return defaultValue;
|
|
194
194
|
}
|
|
195
195
|
|
|
196
196
|
public static bool KeyExists(string keyPath, bool useHKLM = false)
|
|
197
197
|
{
|
|
198
|
-
XDGLogger.Debug("Registry functions are only available on Windows platforms");
|
|
198
|
+
XDGLogger.Debug("Registry functions are only available on Windows platforms", XDGLoggerTag.Common);
|
|
199
199
|
return false;
|
|
200
200
|
}
|
|
201
201
|
#endif
|
|
@@ -16,7 +16,7 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
16
16
|
|
|
17
17
|
public void Handler(IBridgeWebView webView, string data, Action<object> callbackFunction)
|
|
18
18
|
{
|
|
19
|
-
XDGLogger.Debug($"message from javascript by:{GetName()} with data:{data}");
|
|
19
|
+
XDGLogger.Debug($"message from javascript by:{GetName()} with data:{data}", XDGLoggerTag.Web);
|
|
20
20
|
webView.ProviderWebTrans()?.Transparent(GetName(), data);
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -16,7 +16,7 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
16
16
|
|
|
17
17
|
public void Handler(IBridgeWebView webView, string data, Action<object> callbackFunction)
|
|
18
18
|
{
|
|
19
|
-
XDGLogger.Debug($"message from javascript by:{GetName()} with data:{data}");
|
|
19
|
+
XDGLogger.Debug($"message from javascript by:{GetName()} with data:{data}", XDGLoggerTag.Web);
|
|
20
20
|
var bean = JsonConvert.DeserializeObject<ClipboardBean>(data);
|
|
21
21
|
switch (bean.Type.ToLower())
|
|
22
22
|
{
|
|
@@ -14,11 +14,11 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
14
14
|
|
|
15
15
|
public void Handler(IBridgeWebView webView, string data, Action<object> callbackFunction)
|
|
16
16
|
{
|
|
17
|
-
XDGLogger.Debug($"message from javascript by:{GetName()} with data:{data}");
|
|
17
|
+
XDGLogger.Debug($"message from javascript by:{GetName()} with data:{data}", XDGLoggerTag.Web);
|
|
18
18
|
var dic = JsonConvert.DeserializeObject<Dictionary<string, object>>(data);
|
|
19
|
-
webView.ProviderWebTrans()?.TransObserver(WebActionEnum.CLOSE, dic);
|
|
20
19
|
UIManager.Dismiss();
|
|
21
|
-
webView
|
|
20
|
+
webView?.ProviderWebTrans()?.TransObserver(WebActionEnum.CLOSE, dic);
|
|
21
|
+
webView?.Release();
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
}
|
|
@@ -14,7 +14,7 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
14
14
|
|
|
15
15
|
public void Handler(IBridgeWebView webView, string data, Action<object> callbackFunction)
|
|
16
16
|
{
|
|
17
|
-
XDGLogger.Debug($"message from javascript by:{GetName()} with data:{data}");
|
|
17
|
+
XDGLogger.Debug($"message from javascript by:{GetName()} with data:{data}", XDGLoggerTag.Web);
|
|
18
18
|
var dic = XDGCommonInternal.GetCommonQueryParams("", 0);
|
|
19
19
|
callbackFunction(new WebBridgeResponse.Success
|
|
20
20
|
{
|
|
@@ -14,7 +14,7 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
14
14
|
|
|
15
15
|
public void Handler(IBridgeWebView webView, string data, Action<object> callbackFunction)
|
|
16
16
|
{
|
|
17
|
-
XDGLogger.Debug("GameMessageWebFunction.Handler()");
|
|
17
|
+
XDGLogger.Debug($"GameMessageWebFunction.Handler():{data}", XDGLoggerTag.Web);
|
|
18
18
|
var dic = JsonConvert.DeserializeObject<Dictionary<string, object>>(data);
|
|
19
19
|
webView.ProviderWebTrans()?.TransObserver(WebActionEnum.MESSAGE, dic);
|
|
20
20
|
}
|
|
@@ -14,7 +14,7 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
14
14
|
|
|
15
15
|
public void Handler(IBridgeWebView webView, string data, Action<object> callbackFunction)
|
|
16
16
|
{
|
|
17
|
-
XDGLogger.Debug($"message from javascript by:{GetName()} with data:{data}");
|
|
17
|
+
XDGLogger.Debug($"message from javascript by:{GetName()} with data:{data}", XDGLoggerTag.Web);
|
|
18
18
|
var param = new Dictionary<string, object>()
|
|
19
19
|
{
|
|
20
20
|
{ "orientation", 1 },
|
|
@@ -15,7 +15,7 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
15
15
|
|
|
16
16
|
public void Handler(IBridgeWebView webView, string data, Action<object> callbackFunction)
|
|
17
17
|
{
|
|
18
|
-
XDGLogger.Debug($"message from javascript by:{GetName()} with data:{data}");
|
|
18
|
+
XDGLogger.Debug($"message from javascript by:{GetName()} with data:{data}", XDGLoggerTag.Web);
|
|
19
19
|
var dic = JsonConvert.DeserializeObject<Dictionary<string, string>>(data);
|
|
20
20
|
if (!dic.TryGetValue("key", out var key)) return;
|
|
21
21
|
var value = DataStorage.LoadString(key);
|
|
@@ -19,7 +19,7 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
19
19
|
|
|
20
20
|
public async void Handler(IBridgeWebView webView, string data, Action<object> callback)
|
|
21
21
|
{
|
|
22
|
-
XDGLogger.Debug($"message from javascript by:{GetName()} with data:{data}");
|
|
22
|
+
XDGLogger.Debug($"message from javascript by:{GetName()} with data:{data}", XDGLoggerTag.Web);
|
|
23
23
|
var webParams = JsonConvert.DeserializeObject<WebHttpRequest>(data);
|
|
24
24
|
HttpMethod method;
|
|
25
25
|
switch (webParams.RequestType)
|
|
@@ -15,7 +15,7 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
15
15
|
|
|
16
16
|
public async void Handler(IBridgeWebView webView, string data, Action<object> callbackFunction)
|
|
17
17
|
{
|
|
18
|
-
XDGLogger.Debug($"message from javascript by:{GetName()} with data:{data}");
|
|
18
|
+
XDGLogger.Debug($"message from javascript by:{GetName()} with data:{data}", XDGLoggerTag.Web);
|
|
19
19
|
var bean = JsonConvert.DeserializeObject<LoadingBean>(data);
|
|
20
20
|
if (bean == null)
|
|
21
21
|
{
|
|
@@ -15,7 +15,7 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
15
15
|
|
|
16
16
|
public void Handler(IBridgeWebView webView, string data, Action<object> callbackFunction)
|
|
17
17
|
{
|
|
18
|
-
XDGLogger.Debug($"message from javascript by:{GetName()} with data:{data}");
|
|
18
|
+
XDGLogger.Debug($"message from javascript by:{GetName()} with data:{data}", XDGLoggerTag.Web);
|
|
19
19
|
try
|
|
20
20
|
{
|
|
21
21
|
var message = JsonConvert.DeserializeObject<Dictionary<string, object>>(data);
|
|
@@ -23,14 +23,14 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
23
23
|
var text = message["text"] as string;
|
|
24
24
|
switch (logLevel)
|
|
25
25
|
{
|
|
26
|
-
case "DEBUG": XDGLogger.Debug(text); break;
|
|
27
|
-
case "WARN": XDGLogger.Warn(text); break;
|
|
28
|
-
case "ERROR": XDGLogger.Error(text); break;
|
|
26
|
+
case "DEBUG": XDGLogger.Debug(text, XDGLoggerTag.Web); break;
|
|
27
|
+
case "WARN": XDGLogger.Warn(text, XDGLoggerTag.Web); break;
|
|
28
|
+
case "ERROR": XDGLogger.Error(text, XDGLoggerTag.Web); break;
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
catch (Exception e)
|
|
32
32
|
{
|
|
33
|
-
XDGLogger.Debug(JsonConvert.SerializeObject(e));
|
|
33
|
+
XDGLogger.Debug(JsonConvert.SerializeObject(e), XDGLoggerTag.Web);
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
}
|
|
@@ -15,7 +15,7 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
15
15
|
|
|
16
16
|
public void Handler(IBridgeWebView webView, string data, Action<object> callbackFunction)
|
|
17
17
|
{
|
|
18
|
-
XDGLogger.Debug($"message from javascript by:{GetName()} with data:{data}");
|
|
18
|
+
XDGLogger.Debug($"message from javascript by:{GetName()} with data:{data}", XDGLoggerTag.Web);
|
|
19
19
|
webView.ProviderWebTrans()?.Transparent(GetName(), data);
|
|
20
20
|
}
|
|
21
21
|
}
|
|
@@ -16,7 +16,7 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
16
16
|
|
|
17
17
|
public void Handler(IBridgeWebView webView, string data, Action<object> callbackFunction)
|
|
18
18
|
{
|
|
19
|
-
XDGLogger.Debug($"message from javascript by:{GetName()} with data:{data}");
|
|
19
|
+
XDGLogger.Debug($"message from javascript by:{GetName()} with data:{data}", XDGLoggerTag.Web);
|
|
20
20
|
var bean = JsonConvert.DeserializeObject<OpenPageBean>(data);
|
|
21
21
|
if (string.IsNullOrEmpty(bean.URL)) return;
|
|
22
22
|
switch (bean.Type)
|
|
@@ -15,7 +15,7 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
15
15
|
|
|
16
16
|
public void Handler(IBridgeWebView webView, string data, Action<object> callbackFunction)
|
|
17
17
|
{
|
|
18
|
-
XDGLogger.Debug($"message from javascript by:{GetName()} with data:{data}");
|
|
18
|
+
XDGLogger.Debug($"message from javascript by:{GetName()} with data:{data}", XDGLoggerTag.Web);
|
|
19
19
|
try
|
|
20
20
|
{
|
|
21
21
|
var dic = JsonConvert.DeserializeObject<Dictionary<string, string>>(data);
|
|
@@ -15,7 +15,7 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
15
15
|
|
|
16
16
|
public void Handler(IBridgeWebView webView, string data, Action<object> callbackFunction)
|
|
17
17
|
{
|
|
18
|
-
XDGLogger.Debug($"message from javascript by:{GetName()} with data:{data}");
|
|
18
|
+
XDGLogger.Debug($"message from javascript by:{GetName()} with data:{data}", XDGLoggerTag.Web);
|
|
19
19
|
var message = JsonConvert.DeserializeObject<Dictionary<string, object>>(data)["message"] as string;
|
|
20
20
|
UIManager.ShowToast(message);
|
|
21
21
|
}
|
|
@@ -14,7 +14,7 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
14
14
|
|
|
15
15
|
public void Handler(IBridgeWebView webView, string data, Action<object> callbackFunction)
|
|
16
16
|
{
|
|
17
|
-
XDGLogger.Debug($"message from javascript by:{GetName()} with data:{data}");
|
|
17
|
+
XDGLogger.Debug($"message from javascript by:{GetName()} with data:{data}", XDGLoggerTag.Web);
|
|
18
18
|
var trackEventBean = JsonConvert.DeserializeObject<WebTrackEventBean>(data);
|
|
19
19
|
XDGCommon.TrackEvent(trackEventBean.TrackEvent, trackEventBean.EventsMap);
|
|
20
20
|
}
|
|
@@ -42,7 +42,7 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
42
42
|
{
|
|
43
43
|
if (!IsWhiteList())
|
|
44
44
|
{
|
|
45
|
-
XDGLogger.Debug($"WebBridgeController OnMessageEmitted 白名单校验失败");
|
|
45
|
+
XDGLogger.Debug($"WebBridgeController OnMessageEmitted 白名单校验失败", XDGLoggerTag.Bridge);
|
|
46
46
|
return;
|
|
47
47
|
}
|
|
48
48
|
|
|
@@ -50,7 +50,7 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
50
50
|
var dic = JsonConvert.DeserializeObject<Dictionary<string, object>>(content);
|
|
51
51
|
if (dic == null)
|
|
52
52
|
{
|
|
53
|
-
XDGLogger.Debug($"WebBridgeController OnMessageEmitted 解析 jsBridge 参数失败");
|
|
53
|
+
XDGLogger.Debug($"WebBridgeController OnMessageEmitted 解析 jsBridge 参数失败", XDGLoggerTag.Bridge);
|
|
54
54
|
return;
|
|
55
55
|
}
|
|
56
56
|
|
|
@@ -66,13 +66,13 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
66
66
|
}
|
|
67
67
|
catch (Exception e)
|
|
68
68
|
{
|
|
69
|
-
XDGLogger.Debug(e.Message);
|
|
69
|
+
XDGLogger.Debug(e.Message, XDGLoggerTag.Bridge);
|
|
70
70
|
}
|
|
71
71
|
};
|
|
72
72
|
}
|
|
73
73
|
catch (Exception e)
|
|
74
74
|
{
|
|
75
|
-
XDGLogger.Debug(e.Message);
|
|
75
|
+
XDGLogger.Debug(e.Message, XDGLoggerTag.Bridge);
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
|
|
@@ -129,7 +129,7 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
129
129
|
// messageJson = Regex.Replace(messageJson, "%22", HttpUtility.UrlEncode("%22"));
|
|
130
130
|
// messageJson = Regex.Replace(messageJson, "%", HttpUtility.UrlEncode("%"));
|
|
131
131
|
|
|
132
|
-
XDGLogger.Debug($"WebBridge ExecuteJavaScript :{messageJson}");
|
|
132
|
+
XDGLogger.Debug($"WebBridge ExecuteJavaScript :{messageJson}", XDGLoggerTag.Bridge);
|
|
133
133
|
var jsCommand = string.Format(WebBridgeConstants.JsHandleMessageFromCsharp,
|
|
134
134
|
Convert.ToBase64String(Encoding.UTF8.GetBytes(messageJson)));
|
|
135
135
|
webView.ExecuteJavaScript(jsCommand);
|
|
@@ -137,7 +137,6 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
137
137
|
|
|
138
138
|
public void Release()
|
|
139
139
|
{
|
|
140
|
-
webView?.Dispose();
|
|
141
140
|
bridgeCallbacks?.Clear();
|
|
142
141
|
handlerCallbacks?.Clear();
|
|
143
142
|
}
|
|
@@ -163,7 +162,7 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
163
162
|
{
|
|
164
163
|
var bridgeCallback = bridgeCallbacks[responseId];
|
|
165
164
|
if (bridgeCallback == null) return;
|
|
166
|
-
XDGLogger.Debug($"responseData:{JsonConvert.SerializeObject(responseData)}");
|
|
165
|
+
XDGLogger.Debug($"responseData:{JsonConvert.SerializeObject(responseData)}", XDGLoggerTag.Bridge);
|
|
167
166
|
bridgeCallback(JsonConvert.SerializeObject(responseData));
|
|
168
167
|
}
|
|
169
168
|
|
|
@@ -29,7 +29,7 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
XDGLogger.Debug("===> OpenWebPage " + url);
|
|
32
|
+
XDGLogger.Debug("===> OpenWebPage " + url, XDGLoggerTag.Web);
|
|
33
33
|
|
|
34
34
|
UIManager.ShowUI<XDWebBridgeView>("XDWebBridgeView", new Dictionary<string, object>
|
|
35
35
|
{
|
|
@@ -46,7 +46,7 @@ namespace XD.SDK.Common.Internal.Standalone
|
|
|
46
46
|
|
|
47
47
|
private static async void PreloadWithCallback(string url, Action<WebActionEnum, Dictionary<string, object>> callback, bool noUI = false)
|
|
48
48
|
{
|
|
49
|
-
XDGLogger.Debug("===> Preload " + url);
|
|
49
|
+
XDGLogger.Debug("===> Preload " + url, XDGLoggerTag.Web);
|
|
50
50
|
|
|
51
51
|
try
|
|
52
52
|
{
|
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.1.
|
|
4
|
+
"version": "7.1.2",
|
|
5
5
|
"description": "XDGSDK",
|
|
6
6
|
"unity": "2019.3",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"com.xd.sdk.foundation": "7.1.
|
|
9
|
+
"com.xd.sdk.foundation": "7.1.2"
|
|
10
10
|
}
|
|
11
11
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|