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.
- package/Editor/TapSDKCoreCompile.cs +6 -0
- package/Mobile/Editor/NativeDependencies.xml +2 -3
- package/Mobile/Runtime/TapEventMobile.cs +0 -1
- package/{Standalone/Runtime/Internal/Openlog/Bean.meta → Plugins.meta} +1 -1
- package/Resources/TapMessage.prefab +1 -1
- package/Runtime/Internal/Log/TapLog.cs +1 -1
- package/Runtime/Public/TapTapSDK.cs +12 -3
- package/Runtime/Public/TapTapSdkOptions.cs +0 -4
- package/Standalone/Plugins/macOS/libtapsdkcorecpp.dylib +0 -0
- package/Standalone/Plugins/macOS/libtapsdkcorecpp.dylib.meta +80 -0
- package/Standalone/Plugins/x86/tapsdkcore.dll +0 -0
- package/Standalone/Plugins/x86/tapsdkcore.dll.meta +63 -0
- package/Standalone/{Runtime/Internal/Utils.meta → Plugins/x86.meta} +1 -1
- package/Standalone/Plugins/x86_64/tapsdkcore.dll +0 -0
- package/Standalone/Plugins/x86_64/tapsdkcore.dll.meta +63 -0
- package/{link.xml.meta → Standalone/Plugins/x86_64.meta} +3 -2
- 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/TapHttp.cs +12 -6
- package/Standalone/Runtime/Internal/Http/TapHttpUtils.cs +23 -7
- package/Standalone/Runtime/Internal/Openlog/TapAppDurationStandalone.cs +121 -0
- package/Standalone/Runtime/Internal/Openlog/{TapOpenlogQueueBase.cs.meta → TapAppDurationStandalone.cs.meta} +1 -1
- package/Standalone/Runtime/Internal/Openlog/TapOpenlogParamConstants.cs +1 -3
- package/Standalone/Runtime/Internal/Openlog/TapOpenlogStandalone.cs +96 -94
- package/Standalone/Runtime/Internal/Openlog/TapOpenlogStartParamConstants.cs +23 -0
- package/Standalone/Runtime/Internal/Openlog/{Bean/TapOpenlogStoreBean.cs.meta → TapOpenlogStartParamConstants.cs.meta} +1 -1
- package/Standalone/Runtime/Internal/Openlog/TapOpenlogWrapper.cs +178 -0
- package/Standalone/Runtime/Internal/Openlog/{Bean/TapOpenlogLogGroup.cs.meta → TapOpenlogWrapper.cs.meta} +1 -1
- package/Standalone/Runtime/Public/TapCoreStandalone.cs +20 -13
- package/Standalone/Runtime/TapSDK.Core.Standalone.Runtime.asmdef +0 -1
- package/package.json +1 -1
- package/Standalone/Runtime/Internal/Openlog/Bean/TapOpenlogLogGroup.cs +0 -39
- package/Standalone/Runtime/Internal/Openlog/Bean/TapOpenlogStoreBean.cs +0 -33
- package/Standalone/Runtime/Internal/Openlog/TapOpenlogHttpClient.cs +0 -153
- package/Standalone/Runtime/Internal/Openlog/TapOpenlogHttpClient.cs.meta +0 -11
- package/Standalone/Runtime/Internal/Openlog/TapOpenlogQueueBase.cs +0 -198
- package/Standalone/Runtime/Internal/Openlog/TapOpenlogQueueBusiness.cs +0 -17
- package/Standalone/Runtime/Internal/Openlog/TapOpenlogQueueBusiness.cs.meta +0 -11
- package/Standalone/Runtime/Internal/Openlog/TapOpenlogQueueTechnology.cs +0 -15
- package/Standalone/Runtime/Internal/Openlog/TapOpenlogQueueTechnology.cs.meta +0 -11
- package/Standalone/Runtime/Internal/Utils/TapProtoBufffer.cs +0 -28
- package/Standalone/Runtime/Internal/Utils/TapProtoBufffer.cs.meta +0 -11
- 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.
|
|
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.0" bitcodeEnabled="false" addToAllTargets="false"/>
|
|
13
|
+
<iosPod name="TapTapCoreSDK" version="~> 4.5.0" bitcodeEnabled="false" addToAllTargets="false"/>
|
|
15
14
|
</iosPods>
|
|
16
15
|
</dependencies>
|
|
@@ -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
|
|
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.
|
|
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
|
-
|
|
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
|
}
|
|
Binary file
|
|
@@ -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:
|
|
Binary file
|
|
@@ -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:
|
|
Binary file
|
|
@@ -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:
|
|
@@ -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
|
{
|