com.taptap.sdk.core 4.4.3 → 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.
@@ -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.3"/>
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.3" bitcodeEnabled="false" addToAllTargets="false"/>
13
+ <iosPod name="TapTapCoreSDK" version="~> 4.5.0" bitcodeEnabled="false" addToAllTargets="false"/>
15
14
  </iosPods>
16
15
  </dependencies>
@@ -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.3";
15
+ public static readonly string Version = "4.5.0";
15
16
 
16
17
  public static string SDKPlatform = "TapSDK-Unity";
17
18
 
@@ -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
  {
@@ -50,7 +50,7 @@ namespace TapSDK.Core.Standalone.Internal.Http
50
50
  return new string(nonce);
51
51
  }
52
52
 
53
- internal static string GenerateUserAgent()
53
+ public static string GenerateUserAgent()
54
54
  {
55
55
  return $"TapSDK-Unity/{TapTapSDK.Version}";
56
56
  }
@@ -14,7 +14,7 @@ namespace TapSDK.Core.Standalone.Internal.Openlog
14
14
  public static void Enable()
15
15
  {
16
16
  #if UNITY_STANDALONE
17
- log.Log("Enable");
17
+ // log.Log("Enable");
18
18
  List<string> modules = new List<string> { MODULE_NAME };
19
19
  TapOpenlogWrapper.TdkEnableModules(JsonConvert.SerializeObject(modules));
20
20
  #endif
@@ -23,7 +23,7 @@ namespace TapSDK.Core.Standalone.Internal.Openlog
23
23
  public static void Disable()
24
24
  {
25
25
  #if UNITY_STANDALONE
26
- log.Log("Disable");
26
+ // log.Log("Disable");
27
27
  List<string> modules = new List<string> { MODULE_NAME };
28
28
  TapOpenlogWrapper.TdkDisableModules(JsonConvert.SerializeObject(modules));
29
29
  #endif
@@ -1,4 +1,3 @@
1
-
2
1
  using System;
3
2
  using System.Collections.Generic;
4
3
  using System.IO;
@@ -22,7 +22,6 @@ namespace TapSDK.Core.Standalone
22
22
  internal static Tracker Tracker;
23
23
  internal static User User;
24
24
  internal static TapTapSdkOptions coreOptions;
25
- public static bool isRnd = false;
26
25
  internal static bool enableAutoEvent = true;
27
26
 
28
27
  internal static TapGatekeeper gatekeeperData = new TapGatekeeper();
@@ -41,12 +40,6 @@ namespace TapSDK.Core.Standalone
41
40
  TapLoom.Initialize();
42
41
  }
43
42
 
44
- private static void SetRND(bool isRnd)
45
- {
46
- TapLog.Log("SetRND called = " + isRnd);
47
- TapCoreStandalone.isRnd = isRnd;
48
- }
49
-
50
43
  /// <summary>
51
44
  /// Initializes the TapCore SDK with the specified options.
52
45
  /// </summary>
@@ -72,7 +65,7 @@ namespace TapSDK.Core.Standalone
72
65
  if (File.Exists(path))
73
66
  {
74
67
  var clientSettings = File.ReadAllText(path);
75
- TapLog.Log("本地 clientSettings: " + clientSettings);
68
+ // TapLog.Log("本地 clientSettings: " + clientSettings);
76
69
  try
77
70
  {
78
71
  TapGatekeeper tapGatekeeper = JsonConvert.DeserializeObject<TapGatekeeper>(clientSettings);
@@ -177,7 +170,6 @@ namespace TapSDK.Core.Standalone
177
170
  private void saveClientSettings(TapGatekeeper settings)
178
171
  {
179
172
  string json = JsonConvert.SerializeObject(settings);
180
- Debug.Log("saveClientSettings: " + json);
181
173
  File.WriteAllText(Path.Combine(Application.persistentDataPath, Constants.ClientSettingsFileName), json);
182
174
  }
183
175
 
@@ -191,7 +183,6 @@ namespace TapSDK.Core.Standalone
191
183
  enableAutoEvent = switchData.AutoEvent;
192
184
  }
193
185
  }
194
- Debug.Log("SetAutoEvent enableAutoEvent is: " + enableAutoEvent);
195
186
  }
196
187
  }
197
188
 
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "com.taptap.sdk.core",
3
3
  "displayName": "TapTapSDK Core",
4
4
  "description": "TapTapSDK Core",
5
- "version": "4.4.3",
5
+ "version": "4.5.0",
6
6
  "unity": "2019.4",
7
7
  "license": "MIT",
8
8
  "dependencies": {