com.taptap.sdk.core 4.6.0-beta.1 → 4.6.1-alpha.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/Mobile/Editor/NativeDependencies.xml +3 -2
  2. package/Mobile/Runtime/TapCoreMobile.cs +5 -0
  3. package/Mobile/Runtime/TapEventMobile.cs +21 -0
  4. package/Runtime/Internal/Platform/ITapCorePlatform.cs +2 -0
  5. package/Runtime/Internal/Platform/ITapEventPlatform.cs +4 -0
  6. package/Runtime/Internal/Utils/BridgeUtils.cs +126 -8
  7. package/Runtime/Internal/Utils/EventManager.cs +2 -0
  8. package/Runtime/Public/TapTapEvent.cs +7 -0
  9. package/Runtime/Public/TapTapSDK.cs +7 -1
  10. package/Runtime/Public/TapTapSdkOptions.cs +14 -0
  11. package/Standalone/Plugins/x86/tapsdkcore.dll +0 -0
  12. package/Standalone/Plugins/x86_64/tapsdkcore.dll +0 -0
  13. package/Standalone/Plugins/x86_64/taptap_api.dll +0 -0
  14. package/Standalone/Plugins/x86_64/taptap_api.dll.meta +52 -0
  15. package/Standalone/Resources/Prefabs/TapClient/TapClientConnectTipPanel.prefab +983 -0
  16. package/Standalone/Resources/Prefabs/TapClient/TapClientConnectTipPanel.prefab.meta +7 -0
  17. package/Standalone/Resources/Prefabs/TapClient.meta +8 -0
  18. package/Standalone/Resources/Prefabs.meta +8 -0
  19. package/Standalone/Resources/Texures/TapClientConnectError.png +0 -0
  20. package/Standalone/Resources/Texures/TapClientConnectError.png.meta +128 -0
  21. package/Standalone/Resources/Texures.meta +8 -0
  22. package/Standalone/Resources.meta +8 -0
  23. package/Standalone/Runtime/Internal/Openlog/TapCoreTracker.cs +107 -0
  24. package/Standalone/Runtime/Internal/Openlog/TapCoreTracker.cs.meta +11 -0
  25. package/Standalone/Runtime/Internal/TapClientBridge.cs +224 -0
  26. package/Standalone/Runtime/Internal/TapClientBridge.cs.meta +11 -0
  27. package/Standalone/Runtime/Internal/TapClientBridgePoll.cs +36 -0
  28. package/Standalone/Runtime/Internal/TapClientBridgePoll.cs.meta +11 -0
  29. package/Standalone/Runtime/Internal/UI/TapClientConnectTipController.cs +59 -0
  30. package/Standalone/Runtime/Internal/UI/TapClientConnectTipController.cs.meta +11 -0
  31. package/Standalone/Runtime/Internal/UI/TapUnderLineText.cs +76 -0
  32. package/Standalone/Runtime/Internal/UI/TapUnderLineText.cs.meta +11 -0
  33. package/Standalone/Runtime/Internal/UI.meta +8 -0
  34. package/Standalone/Runtime/Public/TapCoreStandalone.cs +366 -0
  35. package/Standalone/Runtime/Public/TapEventStandalone.cs +27 -0
  36. package/package.json +1 -1
@@ -3,13 +3,14 @@
3
3
  <androidPackages>
4
4
  <repositories>
5
5
  <repository>https://repo.maven.apache.org/maven2</repository>
6
+ <repository>https://nexus.xmxdev.com/repository/maven-public</repository>
6
7
  </repositories>
7
- <androidPackage spec="com.taptap.sdk:tap-core-unity:4.6.0-beta.1"/>
8
+ <androidPackage spec="com.taptap.sdk:tap-core-unity:4.6.1-alpha.13"/>
8
9
  </androidPackages>
9
10
  <iosPods>
10
11
  <sources>
11
12
  <source>https://github.com/CocoaPods/Specs.git</source>
12
13
  </sources>
13
- <iosPod name="TapTapCoreSDK" version="~> 4.5.2" bitcodeEnabled="false" addToAllTargets="false"/>
14
+ <iosPod name="TapTapCoreSDK" version="~> 4.5.5" bitcodeEnabled="false" addToAllTargets="false"/>
14
15
  </iosPods>
15
16
  </dependencies>
@@ -67,5 +67,10 @@ namespace TapSDK.Core.Mobile
67
67
  .Args("language", (int)language)
68
68
  .CommandBuilder());
69
69
  }
70
+
71
+ public Task<bool> IsLaunchedFromTapTapPC()
72
+ {
73
+ return Task.FromResult(false);
74
+ }
70
75
  }
71
76
  }
@@ -258,6 +258,27 @@ namespace TapSDK.Core.Mobile
258
258
  IOSNativeWrapper.RegisterDynamicProperties(callback);
259
259
  #else
260
260
  AndroidNativeWrapper.RegisterDynamicProperties(callback);
261
+ #endif
262
+ }
263
+
264
+ public void SetOAID(string value)
265
+ {
266
+ Debug.Log("TapEventMobile SetOAID" + value);
267
+ #if UNITY_ANDROID
268
+ Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
269
+ .Method("setOAID")
270
+ .Args("oaid", value)
271
+ .CommandBuilder());
272
+ #endif
273
+ }
274
+
275
+ public void LogDeviceLoginEvent()
276
+ {
277
+ Debug.Log("TapEventMobile LogDeviceLoginEvent");
278
+ #if UNITY_ANDROID
279
+ Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
280
+ .Method("logDeviceLoginEvent")
281
+ .CommandBuilder());
261
282
  #endif
262
283
  }
263
284
  }
@@ -8,5 +8,7 @@ namespace TapSDK.Core.Internal {
8
8
  void Init(TapTapSdkOptions coreOption, TapTapSdkBaseOptions[] otherOptions);
9
9
 
10
10
  void UpdateLanguage(TapTapLanguageType language);
11
+
12
+ Task<bool> IsLaunchedFromTapTapPC();
11
13
  }
12
14
  }
@@ -33,5 +33,9 @@ namespace TapSDK.Core.Internal {
33
33
  void LogChargeEvent(string orderID, string productName, long amount, string currencyType, string paymentMethod, string properties);
34
34
 
35
35
  void RegisterDynamicProperties(Func<string> callback);
36
+
37
+ void SetOAID(string value);
38
+
39
+ void LogDeviceLoginEvent();
36
40
  }
37
41
  }
@@ -1,5 +1,6 @@
1
1
  using System;
2
2
  using System.Linq;
3
+ using System.Collections.Generic;
3
4
  using UnityEngine;
4
5
 
5
6
  namespace TapSDK.Core.Internal.Utils {
@@ -12,18 +13,135 @@ namespace TapSDK.Core.Internal.Utils {
12
13
  Application.platform == RuntimePlatform.LinuxPlayer;
13
14
 
14
15
  public static object CreateBridgeImplementation(Type interfaceType, string startWith) {
16
+ Debug.Log($"[TapTap] 开始查找实现类: interfaceType={interfaceType.FullName}, startWith={startWith}, 当前平台={Application.platform}");
17
+
15
18
  // 跳过初始化直接使用 TapLoom会在子线程被TapSDK.Core.BridgeCallback.Invoke 初始化
16
19
  TapLoom.Initialize();
17
- Type bridgeImplementationType = AppDomain.CurrentDomain.GetAssemblies()
18
- .Where(asssembly => asssembly.GetName().FullName.StartsWith(startWith))
19
- .SelectMany(assembly => assembly.GetTypes())
20
- .SingleOrDefault(clazz => interfaceType.IsAssignableFrom(clazz) && clazz.IsClass);
21
- if (bridgeImplementationType == null){
22
- Debug.LogWarningFormat(
23
- $"[TapTap] TapSDK Can't find bridge implementation for {interfaceType} on platform {Application.platform}.");
20
+
21
+ // 获取所有程序集
22
+ var allAssemblies = AppDomain.CurrentDomain.GetAssemblies();
23
+ Debug.Log($"[TapTap] 已加载的程序集总数: {allAssemblies.Length}");
24
+
25
+ // 查找以 startWith 开头的程序集
26
+ var matchingAssemblies = allAssemblies
27
+ .Where(assembly => assembly.GetName().FullName.StartsWith(startWith))
28
+ .ToList();
29
+
30
+ Debug.Log($"[TapTap] 找到匹配 '{startWith}' 的程序集数量: {matchingAssemblies.Count}");
31
+
32
+ // 打印匹配的程序集名称
33
+ foreach (var assembly in matchingAssemblies) {
34
+ Debug.Log($"[TapTap] 匹配的程序集: {assembly.GetName().FullName}");
35
+ }
36
+
37
+ // 如果没有找到匹配的程序集,打印所有TapSDK相关的程序集
38
+ if (matchingAssemblies.Count == 0) {
39
+ var tapAssemblies = allAssemblies
40
+ .Where(assembly => assembly.GetName().FullName.Contains("TapSDK") ||
41
+ assembly.GetName().FullName.Contains("TapTap"))
42
+ .ToList();
43
+
44
+ Debug.Log($"[TapTap] 未找到匹配的程序集,但找到 {tapAssemblies.Count} 个相关程序集:");
45
+ foreach (var assembly in tapAssemblies) {
46
+ Debug.Log($"[TapTap] - {assembly.GetName().FullName}");
47
+ }
48
+ }
49
+
50
+ // 从匹配的程序集中查找实现指定接口的类
51
+ List<Type> allCandidateTypes = new List<Type>();
52
+ foreach (var assembly in matchingAssemblies) {
53
+ try {
54
+ var types = assembly.GetTypes()
55
+ .Where(type => type.IsClass && interfaceType.IsAssignableFrom(type))
56
+ .ToList();
57
+
58
+ Debug.Log($"[TapTap] 在程序集 {assembly.GetName().Name} 中找到 {types.Count} 个实现 {interfaceType.Name} 的类");
59
+
60
+ foreach (var type in types) {
61
+ Debug.Log($"[TapTap] - {type.FullName} (IsPublic: {type.IsPublic}, IsAbstract: {type.IsAbstract})");
62
+ allCandidateTypes.Add(type);
63
+ }
64
+ }
65
+ catch (Exception ex) {
66
+ Debug.LogError($"[TapTap] 获取程序集 {assembly.GetName().Name} 中的类型时出错: {ex.Message}");
67
+ }
68
+ }
69
+
70
+ // 使用原始逻辑查找实现类
71
+ Type bridgeImplementationType = null;
72
+ try {
73
+ bridgeImplementationType = matchingAssemblies
74
+ .SelectMany(assembly => {
75
+ try {
76
+ return assembly.GetTypes();
77
+ } catch {
78
+ return Type.EmptyTypes;
79
+ }
80
+ })
81
+ .SingleOrDefault(clazz => interfaceType.IsAssignableFrom(clazz) && clazz.IsClass);
82
+
83
+ Debug.Log($"[TapTap] SingleOrDefault 查找结果: {(bridgeImplementationType != null ? bridgeImplementationType.FullName : "null")}");
84
+
85
+ // 如果使用 SingleOrDefault 没找到,尝试使用 FirstOrDefault
86
+ if (bridgeImplementationType == null && allCandidateTypes.Count > 0) {
87
+ Debug.Log($"[TapTap] SingleOrDefault 未找到实现,但有 {allCandidateTypes.Count} 个候选类型,尝试使用 FirstOrDefault");
88
+ bridgeImplementationType = allCandidateTypes.FirstOrDefault();
89
+ Debug.Log($"[TapTap] FirstOrDefault 查找结果: {(bridgeImplementationType != null ? bridgeImplementationType.FullName : "null")}");
90
+ }
91
+
92
+ // 如果找到多个实现,可能是 SingleOrDefault 失败的原因
93
+ if (allCandidateTypes.Count > 1) {
94
+ Debug.LogWarning($"[TapTap] 找到多个实现 {interfaceType.Name} 的类,这可能导致 SingleOrDefault 返回 null");
95
+ foreach (var type in allCandidateTypes) {
96
+ Debug.LogWarning($"[TapTap] - {type.FullName}");
97
+ }
98
+ }
99
+ }
100
+ catch (Exception ex) {
101
+ Debug.LogError($"[TapTap] 在查找实现类时发生异常: {ex.Message}\n{ex.StackTrace}");
102
+ }
103
+
104
+ if (bridgeImplementationType == null) {
105
+ Debug.LogWarning($"[TapTap] TapSDK 无法为 {interfaceType} 找到平台 {Application.platform} 上的实现类。");
106
+
107
+ // 尝试在所有程序集中查找实现(不限制命名空间前缀)
108
+ if (matchingAssemblies.Count == 0) {
109
+ Debug.Log("[TapTap] 尝试在所有程序集中查找实现...");
110
+ List<Type> implementationsInAllAssemblies = new List<Type>();
111
+
112
+ foreach (var assembly in allAssemblies) {
113
+ try {
114
+ var types = assembly.GetTypes()
115
+ .Where(type => type.IsClass && !type.IsAbstract && interfaceType.IsAssignableFrom(type))
116
+ .ToList();
117
+
118
+ if (types.Count > 0) {
119
+ Debug.Log($"[TapTap] 在程序集 {assembly.GetName().Name} 中找到 {types.Count} 个实现");
120
+ implementationsInAllAssemblies.AddRange(types);
121
+ }
122
+ }
123
+ catch { /* 忽略错误 */ }
124
+ }
125
+
126
+ if (implementationsInAllAssemblies.Count > 0) {
127
+ Debug.Log($"[TapTap] 在所有程序集中找到 {implementationsInAllAssemblies.Count} 个实现:");
128
+ foreach (var type in implementationsInAllAssemblies) {
129
+ Debug.Log($"[TapTap] - {type.FullName} (在程序集 {type.Assembly.GetName().Name} 中)");
130
+ }
131
+ }
132
+ }
133
+
134
+ return null;
135
+ }
136
+
137
+ try {
138
+ Debug.Log($"[TapTap] 创建 {bridgeImplementationType.FullName} 的实例");
139
+ return Activator.CreateInstance(bridgeImplementationType);
140
+ }
141
+ catch (Exception ex) {
142
+ Debug.LogError($"[TapTap] 创建实例时出错: {ex.Message}");
24
143
  return null;
25
144
  }
26
- return Activator.CreateInstance(bridgeImplementationType);
27
145
  }
28
146
  }
29
147
  }
@@ -10,6 +10,8 @@ namespace TapSDK.Core.Internal.Utils
10
10
  public const string OnApplicationQuit = "OnApplicationQuit";
11
11
 
12
12
  public const string OnComplianceUserChanged = "OnComplianceUserChanged";
13
+
14
+ public const string IsLaunchedFromTapTapPCFinished = "IsLaunchedFromTapTapPCFinished";
13
15
  private Dictionary<string, Action<object>> eventRegistries = new Dictionary<string, Action<object>>();
14
16
 
15
17
  public static void AddListener(string eventName, Action<object> listener) {
@@ -89,5 +89,12 @@ namespace TapSDK.Core {
89
89
  platformWrapper?.RegisterDynamicProperties(callback);
90
90
  }
91
91
 
92
+ public static void SetOAID(string value){
93
+ platformWrapper?.SetOAID(value);
94
+ }
95
+
96
+ public static void LogDeviceLoginEvent(){
97
+ platformWrapper?.LogDeviceLoginEvent();
98
+ }
92
99
  }
93
100
  }
@@ -12,7 +12,7 @@ using System.ComponentModel;
12
12
 
13
13
  namespace TapSDK.Core {
14
14
  public class TapTapSDK {
15
- public static readonly string Version = "4.6.0-beta.1";
15
+ public static readonly string Version = "4.6.1-alpha.13";
16
16
 
17
17
  public static string SDKPlatform = "TapSDK-Unity";
18
18
 
@@ -89,6 +89,12 @@ namespace TapSDK.Core {
89
89
  public static void UpdateLanguage(TapTapLanguageType language){
90
90
  platformWrapper?.UpdateLanguage(language);
91
91
  }
92
+
93
+ // 是否通过 PC 启动器唤起游戏
94
+ public static Task<bool> IsLaunchedFromTapTapPC()
95
+ {
96
+ return platformWrapper?.IsLaunchedFromTapTapPC();
97
+ }
92
98
 
93
99
  private static Type[] GetInitTypeList(){
94
100
  Type interfaceType = typeof(IInitTask);
@@ -45,6 +45,10 @@ namespace TapSDK.Core
45
45
  /// </summary>
46
46
  public string clientToken;
47
47
  /// <summary>
48
+ /// PC 客户端公钥
49
+ /// </summary>
50
+ public string clientPublicKey;
51
+ /// <summary>
48
52
  /// 地区,CN 为国内,Overseas 为海外
49
53
  /// </summary>
50
54
  public TapTapRegionType region = TapTapRegionType.CN;
@@ -89,6 +93,16 @@ namespace TapSDK.Core
89
93
  /// </summary>
90
94
  public bool enableLog = false;
91
95
 
96
+ /// <summary>
97
+ /// 是否禁用 OAID 反射
98
+ /// </summary>
99
+ public bool disableReflectionOAID = true;
100
+
101
+ /// <summary>
102
+ /// 是否即用禁用自动上报设备登录事件
103
+ /// </summary>
104
+ public bool disableAutoLogDeviceLogin = false;
105
+
92
106
  /// <summary>
93
107
  /// 屏幕方向:0-竖屏 1-横屏
94
108
  /// </summary>
@@ -0,0 +1,52 @@
1
+ fileFormatVersion: 2
2
+ guid: b6f09ef7ffe9442c3a59f378a3a15005
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: 1
18
+ settings: {}
19
+ - first:
20
+ Editor: Editor
21
+ second:
22
+ enabled: 0
23
+ settings:
24
+ CPU: x86_64
25
+ DefaultValueInitialized: true
26
+ - first:
27
+ Standalone: Linux64
28
+ second:
29
+ enabled: 1
30
+ settings:
31
+ CPU: x86_64
32
+ - first:
33
+ Standalone: OSXUniversal
34
+ second:
35
+ enabled: 0
36
+ settings:
37
+ CPU: x86_64
38
+ - first:
39
+ Standalone: Win
40
+ second:
41
+ enabled: 0
42
+ settings:
43
+ CPU: None
44
+ - first:
45
+ Standalone: Win64
46
+ second:
47
+ enabled: 1
48
+ settings:
49
+ CPU: AnyCPU
50
+ userData:
51
+ assetBundleName:
52
+ assetBundleVariant: