com.taptap.sdk.core 4.4.2 → 4.5.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.
Files changed (44) hide show
  1. package/Editor/TapSDKCoreCompile.cs +6 -0
  2. package/Mobile/Editor/NativeDependencies.xml +2 -3
  3. package/Mobile/Runtime/TapEventMobile.cs +0 -1
  4. package/{Standalone/Runtime/Internal/Openlog/Bean.meta → Plugins.meta} +1 -1
  5. package/Resources/TapMessage.prefab +1 -1
  6. package/Runtime/Internal/Log/TapLog.cs +1 -1
  7. package/Runtime/Public/TapTapSDK.cs +12 -3
  8. package/Runtime/Public/TapTapSdkOptions.cs +0 -4
  9. package/Standalone/Plugins/macOS/libtapsdkcorecpp.dylib +0 -0
  10. package/Standalone/Plugins/macOS/libtapsdkcorecpp.dylib.meta +80 -0
  11. package/Standalone/Plugins/x86/tapsdkcore.dll +0 -0
  12. package/Standalone/Plugins/x86/tapsdkcore.dll.meta +63 -0
  13. package/Standalone/{Runtime/Internal/Utils.meta → Plugins/x86.meta} +1 -1
  14. package/Standalone/Plugins/x86_64/tapsdkcore.dll +0 -0
  15. package/Standalone/Plugins/x86_64/tapsdkcore.dll.meta +63 -0
  16. package/{link.xml.meta → Standalone/Plugins/x86_64.meta} +3 -2
  17. package/Standalone/Runtime/Internal/Constants.cs +0 -17
  18. package/Standalone/Runtime/Internal/DeviceInfo.cs +93 -89
  19. package/Standalone/Runtime/Internal/EventSender.cs +2 -2
  20. package/Standalone/Runtime/Internal/Http/TapHttp.cs +12 -6
  21. package/Standalone/Runtime/Internal/Http/TapHttpUtils.cs +23 -7
  22. package/Standalone/Runtime/Internal/Openlog/TapAppDurationStandalone.cs +121 -0
  23. package/Standalone/Runtime/Internal/Openlog/{TapOpenlogQueueBase.cs.meta → TapAppDurationStandalone.cs.meta} +1 -1
  24. package/Standalone/Runtime/Internal/Openlog/TapOpenlogParamConstants.cs +1 -3
  25. package/Standalone/Runtime/Internal/Openlog/TapOpenlogStandalone.cs +96 -94
  26. package/Standalone/Runtime/Internal/Openlog/TapOpenlogStartParamConstants.cs +23 -0
  27. package/Standalone/Runtime/Internal/Openlog/{Bean/TapOpenlogStoreBean.cs.meta → TapOpenlogStartParamConstants.cs.meta} +1 -1
  28. package/Standalone/Runtime/Internal/Openlog/TapOpenlogWrapper.cs +178 -0
  29. package/Standalone/Runtime/Internal/Openlog/{Bean/TapOpenlogLogGroup.cs.meta → TapOpenlogWrapper.cs.meta} +1 -1
  30. package/Standalone/Runtime/Public/TapCoreStandalone.cs +20 -13
  31. package/Standalone/Runtime/TapSDK.Core.Standalone.Runtime.asmdef +0 -1
  32. package/package.json +1 -1
  33. package/Standalone/Runtime/Internal/Openlog/Bean/TapOpenlogLogGroup.cs +0 -39
  34. package/Standalone/Runtime/Internal/Openlog/Bean/TapOpenlogStoreBean.cs +0 -33
  35. package/Standalone/Runtime/Internal/Openlog/TapOpenlogHttpClient.cs +0 -153
  36. package/Standalone/Runtime/Internal/Openlog/TapOpenlogHttpClient.cs.meta +0 -11
  37. package/Standalone/Runtime/Internal/Openlog/TapOpenlogQueueBase.cs +0 -198
  38. package/Standalone/Runtime/Internal/Openlog/TapOpenlogQueueBusiness.cs +0 -17
  39. package/Standalone/Runtime/Internal/Openlog/TapOpenlogQueueBusiness.cs.meta +0 -11
  40. package/Standalone/Runtime/Internal/Openlog/TapOpenlogQueueTechnology.cs +0 -15
  41. package/Standalone/Runtime/Internal/Openlog/TapOpenlogQueueTechnology.cs.meta +0 -11
  42. package/Standalone/Runtime/Internal/Utils/TapProtoBufffer.cs +0 -28
  43. package/Standalone/Runtime/Internal/Utils/TapProtoBufffer.cs.meta +0 -11
  44. package/link.xml +0 -4
@@ -17,11 +17,13 @@ namespace TapSDK.Core.Editor
17
17
  #if UNITY_IOS
18
18
  public static string GetProjPath(string path)
19
19
  {
20
+ Debug.Log($"SDX , GetProjPath path:{path}");
20
21
  return PBXProject.GetPBXProjectPath(path);
21
22
  }
22
23
 
23
24
  public static PBXProject ParseProjPath(string path)
24
25
  {
26
+ Debug.Log($"SDX , ParseProjPath path:{path}");
25
27
  var proj = new PBXProject();
26
28
  proj.ReadFromString(File.ReadAllText(path));
27
29
  return proj;
@@ -30,9 +32,11 @@ namespace TapSDK.Core.Editor
30
32
  public static string GetUnityFrameworkTarget(PBXProject proj)
31
33
  {
32
34
  #if UNITY_2019_3_OR_NEWER
35
+ Debug.Log("SDX , GetUnityFrameworkTarget UNITY_2019_3_OR_NEWER");
33
36
  string target = proj.GetUnityFrameworkTargetGuid();
34
37
  return target;
35
38
  #endif
39
+ Debug.Log("SDX , GetUnityFrameworkTarget");
36
40
  var unityPhoneTarget = proj.TargetGuidByName("Unity-iPhone");
37
41
  return unityPhoneTarget;
38
42
  }
@@ -40,9 +44,11 @@ namespace TapSDK.Core.Editor
40
44
  public static string GetUnityTarget(PBXProject proj)
41
45
  {
42
46
  #if UNITY_2019_3_OR_NEWER
47
+ Debug.Log("SDX , GetUnityTarget UNITY_2019_3_OR_NEWER");
43
48
  string target = proj.GetUnityMainTargetGuid();
44
49
  return target;
45
50
  #endif
51
+ Debug.Log("SDX , GetUnityTarget");
46
52
  var unityPhoneTarget = proj.TargetGuidByName("Unity-iPhone");
47
53
  return unityPhoneTarget;
48
54
  }
@@ -4,13 +4,12 @@
4
4
  <repositories>
5
5
  <repository>https://repo.maven.apache.org/maven2</repository>
6
6
  </repositories>
7
- <androidPackage spec="com.taptap.sdk:tap-core-unity:4.4.2"/>
7
+ <androidPackage spec="com.taptap.sdk:tap-core-unity:4.5.0"/>
8
8
  </androidPackages>
9
9
  <iosPods>
10
10
  <sources>
11
11
  <source>https://github.com/CocoaPods/Specs.git</source>
12
12
  </sources>
13
- <iosPod name="Protobuf" version="~> 3.0" bitcodeEnabled="false" addToAllTargets="false"/>
14
- <iosPod name="TapTapCoreSDK" version="~> 4.4.0" bitcodeEnabled="false" addToAllTargets="false"/>
13
+ <iosPod name="TapTapCoreSDK" version="~> 4.5.0" bitcodeEnabled="false" addToAllTargets="false"/>
15
14
  </iosPods>
16
15
  </dependencies>
@@ -87,7 +87,6 @@ namespace TapSDK.Core.Mobile
87
87
  .Method("deviceUpdate")
88
88
  .Args("deviceUpdate", properties)
89
89
  .CommandBuilder());
90
- IOSNativeWrapper.DeviceUpdate(properties);
91
90
  #else
92
91
  Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
93
92
  .Method("deviceUpdate")
@@ -1,5 +1,5 @@
1
1
  fileFormatVersion: 2
2
- guid: 7e49d7f2e1e5b4eaf90b7cf14770d8f8
2
+ guid: 9b372fd6a570748ddbf4c96d16ebbc2b
3
3
  folderAsset: yes
4
4
  DefaultImporter:
5
5
  externalObjects: {}
@@ -58,7 +58,7 @@ Canvas:
58
58
  m_SortingBucketNormalizedSize: 0
59
59
  m_AdditionalShaderChannelsFlag: 0
60
60
  m_SortingLayerID: 0
61
- m_SortingOrder: 0
61
+ m_SortingOrder: 32767
62
62
  m_TargetDisplay: 0
63
63
  --- !u!114 &114668005265195872
64
64
  MonoBehaviour:
@@ -93,7 +93,7 @@ namespace TapSDK.Core.Internal.Log
93
93
  private static string GetThreadInfo()
94
94
  {
95
95
  bool isMainThread = System.Threading.Thread.CurrentThread.IsAlive && System.Threading.Thread.CurrentThread.ManagedThreadId == 1;
96
- string threadInfo = isMainThread ? "Main Thread" : $"IO Thread {System.Threading.Thread.CurrentThread.ManagedThreadId}";
96
+ string threadInfo = isMainThread ? "Main" : $"IO {System.Threading.Thread.CurrentThread.ManagedThreadId}";
97
97
 
98
98
  if (IsMobilePlatform())
99
99
  {
@@ -8,10 +8,11 @@ using UnityEngine;
8
8
  using System.Reflection;
9
9
  using TapSDK.Core.Internal.Init;
10
10
  using TapSDK.Core.Internal.Log;
11
+ using System.ComponentModel;
11
12
 
12
13
  namespace TapSDK.Core {
13
14
  public class TapTapSDK {
14
- public static readonly string Version = "4.4.2";
15
+ public static readonly string Version = "4.5.0";
15
16
 
16
17
  public static string SDKPlatform = "TapSDK-Unity";
17
18
 
@@ -61,10 +62,13 @@ namespace TapSDK.Core {
61
62
  throw new ArgumentException("[TapSDK] options is null!");
62
63
  if (string.IsNullOrEmpty(coreOption.clientId))
63
64
  throw new ArgumentException("[TapSDK] clientID is null or empty!");
64
-
65
+ long startTime = DateTime.Now.Ticks;
65
66
  TapTapSDK.taptapSdkOptions = coreOption;
66
67
  TapLog.Enabled = coreOption.enableLog;
68
+ long startCore = DateTime.Now.Ticks;
67
69
  platformWrapper?.Init(coreOption,otherOptions);
70
+ long costCore = DateTime.Now.Ticks - startCore;
71
+ // TapLog.Log($"Init core cost time: {costCore / 10000}ms");
68
72
 
69
73
  Type[] initTaskTypes = GetInitTypeList();
70
74
  if (initTaskTypes != null) {
@@ -74,10 +78,15 @@ namespace TapSDK.Core {
74
78
  }
75
79
  initTasks = initTasks.OrderBy(task => task.Order).ToList();
76
80
  foreach (IInitTask task in initTasks) {
77
- TapLogger.Debug($"Init: {task.GetType().Name}");
81
+ TapLog.Log($"Init: {task.GetType().Name}");
82
+ long startModule = DateTime.Now.Ticks;
78
83
  task.Init(coreOption,otherOptions);
84
+ long costModule = DateTime.Now.Ticks - startModule;
85
+ // TapLog.Log($"Init {task.GetType().Name} cost time: {costModule / 10000}ms");
79
86
  }
80
87
  }
88
+ long costTime = DateTime.Now.Ticks - startTime;
89
+ // TapLog.Log($"Init cost time: {costTime / 10000}ms");
81
90
  }
82
91
 
83
92
  // UpdateLanguage 方法
@@ -6,8 +6,6 @@ namespace TapSDK.Core
6
6
  public interface TapTapSdkBaseOptions
7
7
  {
8
8
  string moduleName { get; }
9
-
10
- AndroidJavaObject androidObject{get;}
11
9
  }
12
10
 
13
11
  public enum TapTapRegionType
@@ -98,7 +96,5 @@ namespace TapSDK.Core
98
96
  {
99
97
  get => _moduleName;
100
98
  }
101
-
102
- public AndroidJavaObject androidObject => throw new System.NotImplementedException();
103
99
  }
104
100
  }
@@ -0,0 +1,80 @@
1
+ fileFormatVersion: 2
2
+ guid: 49c295e8cfb414b76aa3bdc07368e922
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
+ Exclude Android: 1
20
+ Exclude Editor: 0
21
+ Exclude Linux64: 1
22
+ Exclude OSXUniversal: 0
23
+ Exclude Win: 1
24
+ Exclude Win64: 1
25
+ Exclude iOS: 1
26
+ - first:
27
+ Android: Android
28
+ second:
29
+ enabled: 0
30
+ settings:
31
+ CPU: ARMv7
32
+ - first:
33
+ Any:
34
+ second:
35
+ enabled: 0
36
+ settings: {}
37
+ - first:
38
+ Editor: Editor
39
+ second:
40
+ enabled: 1
41
+ settings:
42
+ CPU: AnyCPU
43
+ DefaultValueInitialized: true
44
+ OS: OSX
45
+ - first:
46
+ Standalone: Linux64
47
+ second:
48
+ enabled: 0
49
+ settings:
50
+ CPU: AnyCPU
51
+ - first:
52
+ Standalone: OSXUniversal
53
+ second:
54
+ enabled: 1
55
+ settings:
56
+ CPU: x86_64
57
+ - first:
58
+ Standalone: Win
59
+ second:
60
+ enabled: 0
61
+ settings:
62
+ CPU: x86
63
+ - first:
64
+ Standalone: Win64
65
+ second:
66
+ enabled: 0
67
+ settings:
68
+ CPU: x86_64
69
+ - first:
70
+ iPhone: iOS
71
+ second:
72
+ enabled: 0
73
+ settings:
74
+ AddToEmbeddedBinaries: false
75
+ CPU: AnyCPU
76
+ CompileFlags:
77
+ FrameworkDependencies:
78
+ userData:
79
+ assetBundleName:
80
+ assetBundleVariant:
@@ -0,0 +1,63 @@
1
+ fileFormatVersion: 2
2
+ guid: 5bfe079fe35ffa74f814bfa7df1d75f8
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
+ Exclude Editor: 0
20
+ Exclude Linux64: 0
21
+ Exclude OSXUniversal: 0
22
+ Exclude Win: 0
23
+ Exclude Win64: 0
24
+ - first:
25
+ Any:
26
+ second:
27
+ enabled: 0
28
+ settings: {}
29
+ - first:
30
+ Editor: Editor
31
+ second:
32
+ enabled: 1
33
+ settings:
34
+ CPU: x86
35
+ DefaultValueInitialized: true
36
+ OS: Windows
37
+ - first:
38
+ Standalone: Linux64
39
+ second:
40
+ enabled: 1
41
+ settings:
42
+ CPU: None
43
+ - first:
44
+ Standalone: OSXUniversal
45
+ second:
46
+ enabled: 1
47
+ settings:
48
+ CPU: x86
49
+ - first:
50
+ Standalone: Win
51
+ second:
52
+ enabled: 1
53
+ settings:
54
+ CPU: AnyCPU
55
+ - first:
56
+ Standalone: Win64
57
+ second:
58
+ enabled: 1
59
+ settings:
60
+ CPU: None
61
+ userData:
62
+ assetBundleName:
63
+ assetBundleVariant:
@@ -1,5 +1,5 @@
1
1
  fileFormatVersion: 2
2
- guid: 784d8481ab7574753a09c8c392b59d06
2
+ guid: 9b86a68828e7ee54f95d29d7d9a077fd
3
3
  folderAsset: yes
4
4
  DefaultImporter:
5
5
  externalObjects: {}
@@ -0,0 +1,63 @@
1
+ fileFormatVersion: 2
2
+ guid: f426835f028130348aec138e80a35b77
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
+ Exclude Editor: 0
20
+ Exclude Linux64: 1
21
+ Exclude OSXUniversal: 1
22
+ Exclude Win: 0
23
+ Exclude Win64: 0
24
+ - first:
25
+ Any:
26
+ second:
27
+ enabled: 0
28
+ settings: {}
29
+ - first:
30
+ Editor: Editor
31
+ second:
32
+ enabled: 1
33
+ settings:
34
+ CPU: x86_64
35
+ DefaultValueInitialized: true
36
+ OS: Windows
37
+ - first:
38
+ Standalone: Linux64
39
+ second:
40
+ enabled: 0
41
+ settings:
42
+ CPU: None
43
+ - first:
44
+ Standalone: OSXUniversal
45
+ second:
46
+ enabled: 0
47
+ settings:
48
+ CPU: None
49
+ - first:
50
+ Standalone: Win
51
+ second:
52
+ enabled: 1
53
+ settings:
54
+ CPU: None
55
+ - first:
56
+ Standalone: Win64
57
+ second:
58
+ enabled: 1
59
+ settings:
60
+ CPU: x86_64
61
+ userData:
62
+ assetBundleName:
63
+ assetBundleVariant:
@@ -1,6 +1,7 @@
1
1
  fileFormatVersion: 2
2
- guid: ef7292ae11c174302b02e26403a50f1b
3
- TextScriptImporter:
2
+ guid: a7af5496cfd95834aa62ec556b3dfd83
3
+ folderAsset: yes
4
+ DefaultImporter:
4
5
  externalObjects: {}
5
6
  userData:
6
7
  assetBundleName:
@@ -15,23 +15,6 @@ namespace TapSDK.Core.Standalone.Internal {
15
15
 
16
16
  internal static string ClientSettingsFileName = "TapSDKClientSettings.json";
17
17
  internal static string ClientSettingsEventKey = "ClientSettingsEventKey";
18
-
19
- public static string TAPSDK_HOST {
20
- get {
21
- if (TapCoreStandalone.isRnd) {
22
- if (TapCoreStandalone.coreOptions.region == TapTapRegionType.CN)
23
- return "https://tapsdk.api.xdrnd.cn";
24
- else
25
- return "https://tapsdk.api.xdrnd.com";
26
- } else {
27
- if (TapCoreStandalone.coreOptions.region == TapTapRegionType.CN)
28
- return "https://tapsdk.tapapis.cn";
29
- else
30
- return "https://tapsdk.tapapis.com";
31
- }
32
- }
33
- }
34
-
35
18
  }
36
19
 
37
20
  }
@@ -1,27 +1,29 @@
1
1
  using System;
2
2
  using System.Runtime.InteropServices;
3
3
  using System.Globalization;
4
- using System.Diagnostics;
5
- using System.Collections;
6
4
  using System.Collections.Generic;
7
5
  using System.Net.NetworkInformation;
8
6
  using UnityEngine;
7
+ using System.Diagnostics;
9
8
 
10
- namespace TapSDK.Core.Standalone.Internal {
11
- public class DeviceInfo {
9
+ namespace TapSDK.Core.Standalone.Internal
10
+ {
11
+ public class DeviceInfo
12
+ {
12
13
 
13
14
  #if UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX
14
- [DllImport("TapDBDeviceInfo", CallingConvention = CallingConvention.Cdecl)]
15
- private static extern IntPtr GetDeviceLanguage();
15
+ [DllImport("TapDBDeviceInfo", CallingConvention = CallingConvention.Cdecl)]
16
+ private static extern IntPtr GetDeviceLanguage();
16
17
  #endif
17
18
 
18
- public static string GetLanguage() {
19
+ public static string GetLanguage()
20
+ {
19
21
  #if UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX
20
- return Marshal.PtrToStringAnsi(GetDeviceLanguage());
22
+ return Marshal.PtrToStringAnsi(GetDeviceLanguage());
21
23
  #else
22
24
  return CultureInfo.CurrentUICulture.IetfLanguageTag;
23
25
  #endif
24
- }
26
+ }
25
27
 
26
28
  #if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN
27
29
  [DllImport("kernel32.dll")]
@@ -48,9 +50,9 @@ namespace TapSDK.Core.Standalone.Internal {
48
50
  }
49
51
  #endif
50
52
 
51
- //安全组提供的设备识别 ID 算法,用于后续数据串联
52
- public static string GetLaunchUniqueID()
53
- {
53
+ //安全组提供的设备识别 ID 算法,用于后续数据串联
54
+ public static string GetLaunchUniqueID()
55
+ {
54
56
  #if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN
55
57
  // 获取当前进程对象
56
58
  Process currentProcess = Process.GetCurrentProcess();
@@ -58,95 +60,97 @@ namespace TapSDK.Core.Standalone.Internal {
58
60
  DateTime startTime = GetProcessStartTime();
59
61
  return toMd5(startTime.ToFileTime().ToString() + "-" + currentProcess.Id.ToString());
60
62
  #else
61
- return "";
63
+ return "";
62
64
  #endif
63
65
 
64
- }
66
+ }
65
67
 
66
- public static void GetMacAddress(out string macAddressList, out string firstMacAddress)
67
- {
68
- List<string> mac_addrs = new List<string>();
69
-
70
- try
71
- {
72
- NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces();
73
- foreach (NetworkInterface adapter in nics)
74
- {
75
- string physicalAddress = adapter.GetPhysicalAddress().ToString();
76
- if (string.IsNullOrEmpty(physicalAddress))
77
- continue;
78
-
79
- physicalAddress = $"\"{physicalAddress}\"";
80
- if (mac_addrs.IndexOf(physicalAddress) == -1)
81
- mac_addrs.Add(physicalAddress);
82
- }
83
- // sort
84
- mac_addrs.Sort();
85
- }
86
- catch (Exception e)
87
- {
88
- UnityEngine.Debug.Log("GetMacAddress Exception " + e.Message);
89
- }
90
- macAddressList = $"[{string.Join(",", mac_addrs)}]";
91
- firstMacAddress = mac_addrs.Count > 0 ? mac_addrs[0].Replace("\"", "") : string.Empty;
92
- }
68
+ public static void GetMacAddress(out string macAddressList, out string firstMacAddress)
69
+ {
70
+ List<string> mac_addrs = new List<string>();
93
71
 
94
- private static string toMd5(string data)
72
+ try
73
+ {
74
+ NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces();
75
+ foreach (NetworkInterface adapter in nics)
95
76
  {
96
- byte[] buffer = System.Text.Encoding.Default.GetBytes(data);
97
- try
98
- {
99
- System.Security.Cryptography.MD5CryptoServiceProvider chk = new System.Security.Cryptography.MD5CryptoServiceProvider();
100
- byte[] some = chk.ComputeHash(buffer);
101
- string ret = "";
102
- foreach(byte a in some)
103
- {
104
- if (a < 16)
105
- ret += "0" + a.ToString("X");
106
- else
107
- ret += a.ToString("X");
108
- }
109
- return ret.ToLower();
110
- }
111
- catch
112
- {
113
- throw;
114
- }
77
+ string physicalAddress = adapter.GetPhysicalAddress().ToString();
78
+ if (string.IsNullOrEmpty(physicalAddress))
79
+ continue;
80
+
81
+ physicalAddress = $"\"{physicalAddress}\"";
82
+ if (mac_addrs.IndexOf(physicalAddress) == -1)
83
+ mac_addrs.Add(physicalAddress);
115
84
  }
85
+ // sort
86
+ mac_addrs.Sort();
87
+ }
88
+ catch (Exception e)
89
+ {
90
+ UnityEngine.Debug.Log("GetMacAddress Exception " + e.Message);
91
+ }
92
+ macAddressList = $"[{string.Join(",", mac_addrs)}]";
93
+ firstMacAddress = mac_addrs.Count > 0 ? mac_addrs[0].Replace("\"", "") : string.Empty;
94
+ }
116
95
 
117
- public static string RAM
96
+ private static string toMd5(string data)
97
+ {
98
+ byte[] buffer = System.Text.Encoding.Default.GetBytes(data);
99
+ try
100
+ {
101
+ System.Security.Cryptography.MD5CryptoServiceProvider chk = new System.Security.Cryptography.MD5CryptoServiceProvider();
102
+ byte[] some = chk.ComputeHash(buffer);
103
+ string ret = "";
104
+ foreach (byte a in some)
118
105
  {
119
- get {
120
- return (SystemInfo.systemMemorySize * 1024L * 1024L).ToString();
121
- }
106
+ if (a < 16)
107
+ ret += "0" + a.ToString("X");
108
+ else
109
+ ret += a.ToString("X");
122
110
  }
123
-
124
- // 获取系统的 ROM 存储容量,单位为 Byte
125
- public static string ROM
111
+ return ret.ToLower();
112
+ }
113
+ catch
114
+ {
115
+ throw;
116
+ }
117
+ }
118
+
119
+ public static string RAM
120
+ {
121
+ get
122
+ {
123
+ return (SystemInfo.systemMemorySize * 1024L * 1024L).ToString();
124
+ }
125
+ }
126
+
127
+ // 获取系统的 ROM 存储容量,单位为 Byte
128
+ public static string ROM
129
+ {
130
+ get
131
+ {
132
+ string path = Application.persistentDataPath;
133
+ if (string.IsNullOrEmpty(path))
134
+ return "0";
135
+
136
+ try
126
137
  {
127
- get {
128
- string path = Application.persistentDataPath;
129
- if (string.IsNullOrEmpty(path))
130
- return "0";
131
-
132
- try
133
- {
134
- System.IO.DriveInfo drive = new System.IO.DriveInfo(path);
135
- return drive.TotalSize.ToString();
136
- }
137
- catch (Exception e)
138
- {
139
- UnityEngine.Debug.Log("GetROMInByte Exception " + e.Message);
140
- return "0";
141
- }
142
- }
138
+ System.IO.DriveInfo drive = new System.IO.DriveInfo(path);
139
+ return drive.TotalSize.ToString();
143
140
  }
144
-
145
- public static string Local
141
+ catch (Exception)
146
142
  {
147
- get {
148
- return CultureInfo.CurrentCulture.Name.Replace('-', '_');
149
- }
143
+ return "0";
150
144
  }
145
+ }
146
+ }
147
+
148
+ public static string Local
149
+ {
150
+ get
151
+ {
152
+ return CultureInfo.CurrentCulture.Name.Replace('-', '_');
153
+ }
151
154
  }
155
+ }
152
156
  }
@@ -14,7 +14,7 @@ using UnityEngine.Networking;
14
14
 
15
15
  namespace TapSDK.Core.Standalone.Internal
16
16
  {
17
- public class EventSender : MonoBehaviour
17
+ public class EventSender
18
18
  {
19
19
  private const string EventFilePath = "events.json";
20
20
 
@@ -86,7 +86,7 @@ namespace TapSDK.Core.Standalone.Internal
86
86
  var resonse = await tapHttp.PostJsonAsync<Boolean>(path: $"{domain}/v2/batch", json: body);
87
87
  if (resonse.IsSuccess)
88
88
  {
89
- log.Log("Events sent successfully");
89
+ // log.Log("Events sent successfully");
90
90
  }
91
91
  else
92
92
  {