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.
- package/Mobile/Editor/NativeDependencies.xml +2 -3
- package/Runtime/Public/TapTapSDK.cs +2 -1
- package/Standalone/Runtime/Internal/Constants.cs +0 -17
- package/Standalone/Runtime/Internal/DeviceInfo.cs +93 -89
- package/Standalone/Runtime/Internal/EventSender.cs +2 -2
- package/Standalone/Runtime/Internal/Http/TapHttpUtils.cs +1 -1
- package/Standalone/Runtime/Internal/Openlog/TapAppDurationStandalone.cs +2 -2
- package/Standalone/Runtime/Internal/Openlog/TapOpenlogStandalone.cs +0 -1
- package/Standalone/Runtime/Public/TapCoreStandalone.cs +1 -10
- package/package.json +1 -1
|
@@ -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.
|
|
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="
|
|
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.
|
|
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
|
-
|
|
9
|
+
namespace TapSDK.Core.Standalone.Internal
|
|
10
|
+
{
|
|
11
|
+
public class DeviceInfo
|
|
12
|
+
{
|
|
12
13
|
|
|
13
14
|
#if UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
[DllImport("TapDBDeviceInfo", CallingConvention = CallingConvention.Cdecl)]
|
|
16
|
+
private static extern IntPtr GetDeviceLanguage();
|
|
16
17
|
#endif
|
|
17
18
|
|
|
18
|
-
|
|
19
|
+
public static string GetLanguage()
|
|
20
|
+
{
|
|
19
21
|
#if UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX
|
|
20
|
-
|
|
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
|
-
|
|
52
|
-
|
|
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
|
-
|
|
63
|
+
return "";
|
|
62
64
|
#endif
|
|
63
65
|
|
|
64
|
-
|
|
66
|
+
}
|
|
65
67
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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
|
-
|
|
72
|
+
try
|
|
73
|
+
{
|
|
74
|
+
NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces();
|
|
75
|
+
foreach (NetworkInterface adapter in nics)
|
|
95
76
|
{
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
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
|
-
|
|
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
|
-
|
|
120
|
-
|
|
121
|
-
|
|
106
|
+
if (a < 16)
|
|
107
|
+
ret += "0" + a.ToString("X");
|
|
108
|
+
else
|
|
109
|
+
ret += a.ToString("X");
|
|
122
110
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
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
|
-
|
|
128
|
-
|
|
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
|
-
|
|
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
|
|
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
|
{
|
|
@@ -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
|
|
@@ -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
|
|