com.xd.sdk.common 6.29.5 → 6.31.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.
- package/Editor/XDGCommonGradleContextProvider.cs +2 -0
- package/Mobile/Plugins/iOS/XDGTrackUnityBridge.mm +32 -0
- package/Mobile/Plugins/iOS/XDGTrackUnityBridge.mm.meta +42 -0
- package/Mobile/XDGCommonMobile.cs +5 -0
- package/Mobile/XDGCommonMobileImpl.cs +1 -1
- package/Mobile/XDGTrackMobileImpl.cs +44 -0
- package/Mobile/XDGTrackMobileImpl.cs.meta +3 -0
- package/Plugins/Android/libs/XDGCommon_6.31.1.aar +0 -0
- package/Plugins/iOS/XDCommonSDK.framework/Headers/XDGCloudLogHelper.h +2 -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/Runtime/Internal/Http/XDGHost.cs +2 -0
- package/Runtime/Internal/IXDGCommon.cs +2 -0
- package/Runtime/Internal/IXDGTracker.cs +1 -0
- package/Runtime/Internal/IXDGTracker.cs.meta +3 -0
- package/Runtime/Public/XDGInitParam.cs +5 -5
- package/Runtime/Public/XDGTracker.cs +1 -0
- package/Runtime/Public/XDGTracker.cs.meta +3 -0
- package/Runtime/XDGCommon.cs +13 -0
- package/package.json +1 -1
- package/Plugins/Android/libs/XDGCommon_6.29.4.aar +0 -0
- /package/Plugins/Android/libs/{XDGCommon_6.29.4.aar.meta → XDGCommon_6.31.1.aar.meta} +0 -0
|
@@ -29,6 +29,7 @@ namespace XD.SDK.Common.Editor
|
|
|
29
29
|
private const string OkHttp = " implementation \"com.squareup.okhttp3:okhttp:4.7.2\"";
|
|
30
30
|
private const string Okio = " implementation \"com.squareup.okio:okio:2.6.0\"";
|
|
31
31
|
private const string ZXing = " implementation \"com.google.zxing:core:3.5.3\"";
|
|
32
|
+
private const string LocalBroadcastManager = " implementation \"androidx.localbroadcastmanager:localbroadcastmanager:1.0.0\"";
|
|
32
33
|
|
|
33
34
|
private const string ANDROIDX = "android.useAndroidX=true";
|
|
34
35
|
private const string ANDROID_JET = "android.enableJetifier=true";
|
|
@@ -47,6 +48,7 @@ namespace XD.SDK.Common.Editor
|
|
|
47
48
|
GSON_DEP,
|
|
48
49
|
KOTLIN_DEP,
|
|
49
50
|
ADX_COMPAT_DEP,
|
|
51
|
+
LocalBroadcastManager,
|
|
50
52
|
RETROFIT2,
|
|
51
53
|
RETROFIT2_RX,
|
|
52
54
|
RETROFIT2_CONVERTER,
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#import <Foundation/Foundation.h>
|
|
2
|
+
#if __has_include(<XDCommonSDK/XDGCoreService.h>)
|
|
3
|
+
#import <XDCommonSDK/XDGCloudLogHelper.h>
|
|
4
|
+
#else
|
|
5
|
+
#import "XDGCoreService.h"
|
|
6
|
+
#endif
|
|
7
|
+
|
|
8
|
+
extern "C" const char* XDGCoreService_logCommonEvent(const char *propertiesJson) {
|
|
9
|
+
@autoreleasepool {
|
|
10
|
+
NSString *jsonString = propertiesJson ? [NSString stringWithUTF8String:propertiesJson] : nil;
|
|
11
|
+
|
|
12
|
+
if (jsonString == nil) {
|
|
13
|
+
return nil;
|
|
14
|
+
}
|
|
15
|
+
NSData *jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding];
|
|
16
|
+
NSError *err;
|
|
17
|
+
NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:jsonData
|
|
18
|
+
options:NSJSONReadingMutableContainers
|
|
19
|
+
error:&err];
|
|
20
|
+
if (err) {
|
|
21
|
+
return nil;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
NSString *result = [XDGCloudLogHelper logCommonEvent:dic];
|
|
25
|
+
if (result == nil) {
|
|
26
|
+
result = @"";
|
|
27
|
+
}
|
|
28
|
+
const char *utf8 = [result UTF8String];
|
|
29
|
+
char *ret = strdup(utf8 ? utf8 : "");
|
|
30
|
+
return ret;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: 53a58dc1e660049a7b0cc6c860f67d10
|
|
3
|
+
PluginImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
iconMap: {}
|
|
7
|
+
executionOrder: {}
|
|
8
|
+
defineConstraints: []
|
|
9
|
+
isPreloaded: 0
|
|
10
|
+
isOverridable: 0
|
|
11
|
+
isExplicitlyReferenced: 0
|
|
12
|
+
validateReferences: 1
|
|
13
|
+
platformData:
|
|
14
|
+
- first:
|
|
15
|
+
Any:
|
|
16
|
+
second:
|
|
17
|
+
enabled: 0
|
|
18
|
+
settings: {}
|
|
19
|
+
- first:
|
|
20
|
+
Editor: Editor
|
|
21
|
+
second:
|
|
22
|
+
enabled: 0
|
|
23
|
+
settings:
|
|
24
|
+
DefaultValueInitialized: true
|
|
25
|
+
- first:
|
|
26
|
+
VisionOS: VisionOS
|
|
27
|
+
second:
|
|
28
|
+
enabled: 1
|
|
29
|
+
settings: {}
|
|
30
|
+
- first:
|
|
31
|
+
iPhone: iOS
|
|
32
|
+
second:
|
|
33
|
+
enabled: 1
|
|
34
|
+
settings: {}
|
|
35
|
+
- first:
|
|
36
|
+
tvOS: tvOS
|
|
37
|
+
second:
|
|
38
|
+
enabled: 1
|
|
39
|
+
settings: {}
|
|
40
|
+
userData:
|
|
41
|
+
assetBundleName:
|
|
42
|
+
assetBundleVariant:
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
using System.Collections.Generic;
|
|
2
|
+
using UnityEngine;
|
|
3
|
+
using System.Runtime.InteropServices;
|
|
4
|
+
using LC.Newtonsoft.Json;
|
|
5
|
+
|
|
6
|
+
namespace XD.SDK.Common
|
|
7
|
+
{
|
|
8
|
+
public class XDGTrackMobileImpl : IXDGTracker
|
|
9
|
+
{
|
|
10
|
+
public string LogCommonEvent(Dictionary<string, string> properties)
|
|
11
|
+
{
|
|
12
|
+
#if UNITY_ANDROID
|
|
13
|
+
using (AndroidJavaClass clz = new AndroidJavaClass("com.xd.intl.common.tracker.aliyun.CloudLogHelper")) {
|
|
14
|
+
AndroidJavaObject map = null;
|
|
15
|
+
if (properties != null && properties.Count > 0)
|
|
16
|
+
{
|
|
17
|
+
map = new AndroidJavaObject("java.util.HashMap");
|
|
18
|
+
foreach (var kv in properties)
|
|
19
|
+
{
|
|
20
|
+
var key = kv.Key ?? string.Empty;
|
|
21
|
+
var val = kv.Value ?? string.Empty;
|
|
22
|
+
map.Call<AndroidJavaObject>("put", key, val);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return clz.CallStatic<string>("logEvent", map);
|
|
26
|
+
}
|
|
27
|
+
#elif UNITY_IOS
|
|
28
|
+
string json = null;
|
|
29
|
+
if (properties != null && properties.Count > 0)
|
|
30
|
+
{
|
|
31
|
+
json = JsonConvert.SerializeObject(properties);
|
|
32
|
+
}
|
|
33
|
+
System.IntPtr ret = XDGCoreService_logCommonEvent(json);
|
|
34
|
+
return Marshal.PtrToStringAnsi(ret);
|
|
35
|
+
#else
|
|
36
|
+
throw new System.NotImplementedException();
|
|
37
|
+
#endif
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
#if UNITY_IOS
|
|
41
|
+
[DllImport("__Internal")] private static extern System.IntPtr XDGCoreService_logCommonEvent(string propertiesJson);
|
|
42
|
+
#endif
|
|
43
|
+
}
|
|
44
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -10,6 +10,8 @@ namespace XD.SDK.Common.Internal
|
|
|
10
10
|
public static readonly string BASE_HOST_CN_ROLLBACK = "https://xdsdk-cn-prod-gateway2.xd.cn";
|
|
11
11
|
public static readonly string BASE_HOST_GLOBAL_DEFAULT = "https://xdsdk-os-prod-gateway.xd.com";
|
|
12
12
|
public static readonly string BASE_HOST_GLOBAL_ROLLBACK = "https://xdsdk-os-prod-gateway2.xd.com";
|
|
13
|
+
public static readonly string XD_PERSONAL_INFO_CN = "https://accounts.xd.cn";
|
|
14
|
+
public static readonly string XD_PERSONAL_INFO_IO = "https://accounts.xd.com";
|
|
13
15
|
}
|
|
14
16
|
/*
|
|
15
17
|
* 管理多个域名,通过 权重(weight)和 默认顺序(defaultOrder)来决定优先级
|
|
@@ -8,19 +8,19 @@ namespace XD.SDK.Common
|
|
|
8
8
|
public const string PackageTypeDefault = "Default";
|
|
9
9
|
|
|
10
10
|
// App Store 包
|
|
11
|
-
public const string PackageTypeAppStore = "AppStore";
|
|
11
|
+
// public const string PackageTypeAppStore = "AppStore";
|
|
12
12
|
|
|
13
13
|
// 普通 Android 包
|
|
14
|
-
public const string PackageTypeAndroidNormal = "Android-Normal";
|
|
14
|
+
// public const string PackageTypeAndroidNormal = "Android-Normal";
|
|
15
15
|
|
|
16
16
|
// GooglePlay 包
|
|
17
|
-
public const string PackageTypeAndroidGooglePlay = "Android-GooglePlay";
|
|
17
|
+
// public const string PackageTypeAndroidGooglePlay = "Android-GooglePlay";
|
|
18
18
|
|
|
19
19
|
// TapTap 国内包
|
|
20
|
-
public const string PackageTypeAndroidTapTap = "Android-TapTap";
|
|
20
|
+
// public const string PackageTypeAndroidTapTap = "Android-TapTap";
|
|
21
21
|
|
|
22
22
|
// TapTap 海外包
|
|
23
|
-
public const string PackageTypeAndroidTapIO = "Android-TapIO";
|
|
23
|
+
// public const string PackageTypeAndroidTapIO = "Android-TapIO";
|
|
24
24
|
|
|
25
25
|
// 普通 PC 包
|
|
26
26
|
public const string PackageTypePCNormal = "PC-Normal";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
using System;
|
|
2
|
public class XDGTracker
|
|
1
3
|
{
|
|
2
4
|
private static readonly IXDGTracker platformWrapper;
|
|
3
5
|
static XDGTracker()
|
|
4
6
|
{
|
|
5
7
|
var interfaceType = typeof(IXDGTracker);
|
|
6
8
|
var platformInterfaceType = AppDomain.CurrentDomain.GetAssemblies()
|
|
7
9
|
.SelectMany(assembly => assembly.GetTypes())
|
|
8
10
|
.FirstOrDefault(clazz => interfaceType.IsAssignableFrom(clazz) && clazz.IsClass);
|
|
9
11
|
if (platformInterfaceType != null)
|
|
10
12
|
{
|
|
11
13
|
platformWrapper = Activator.CreateInstance(platformInterfaceType) as IXDGTracker;
|
|
12
14
|
}
|
|
13
15
|
else
|
|
14
16
|
{
|
|
15
17
|
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.");
|
|
16
18
|
}
|
|
17
19
|
}
|
|
18
20
|
public static string LogCommonEvent(Dictionary<string, string> properties)
|
|
19
21
|
{
|
|
20
22
|
return platformWrapper?.LogCommonEvent(properties);
|
|
21
23
|
}
|
|
22
24
|
}
|
package/Runtime/XDGCommon.cs
CHANGED
|
@@ -252,5 +252,18 @@ namespace XD.SDK.Common
|
|
|
252
252
|
{
|
|
253
253
|
platformWrapper.PreloadWebPage(url);
|
|
254
254
|
}
|
|
255
|
+
|
|
256
|
+
/// <summary>
|
|
257
|
+
/// 获取当前包体类型
|
|
258
|
+
/// 仅在 PC 平台可用
|
|
259
|
+
/// 1. 当 Steam SDK 启用时,优先返回 XDGPackageType.PackageTypePCSteam
|
|
260
|
+
/// 2. 当 TapTap 平台启用时,返回 XDGPackageType.PackageTypePCTapTap
|
|
261
|
+
/// 3. 否则返回默认 XDGPackageType.PackageTypePCNormal
|
|
262
|
+
/// </summary>
|
|
263
|
+
/// <returns>包体类型</returns>
|
|
264
|
+
public static string GetPackageType()
|
|
265
|
+
{
|
|
266
|
+
return platformWrapper.GetPackageType();
|
|
267
|
+
}
|
|
255
268
|
}
|
|
256
269
|
}
|
package/package.json
CHANGED
|
Binary file
|
|
File without changes
|