com.taptap.sdk.core 4.3.0-aplha.12
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/BuildTargetUtils.cs +14 -0
- package/Editor/BuildTargetUtils.cs.meta +11 -0
- package/Editor/LinkXMLGenerator.cs +70 -0
- package/Editor/LinkXMLGenerator.cs.meta +11 -0
- package/Editor/Plist.cs +954 -0
- package/Editor/Plist.cs.meta +3 -0
- package/Editor/SDKLinkProcessBuild.cs +119 -0
- package/Editor/SDKLinkProcessBuild.cs.meta +11 -0
- package/Editor/TapFileHelper.cs +168 -0
- package/Editor/TapFileHelper.cs.meta +3 -0
- package/Editor/TapSDK.Core.Editor.asmdef +15 -0
- package/Editor/TapSDK.Core.Editor.asmdef.meta +7 -0
- package/Editor/TapSDKCoreCompile.cs +284 -0
- package/Editor/TapSDKCoreCompile.cs.meta +3 -0
- package/Editor/TapSDKCoreIOSProcessor.cs +74 -0
- package/Editor/TapSDKCoreIOSProcessor.cs.meta +3 -0
- package/Editor/UI/ScrollViewEditor.cs +267 -0
- package/Editor/UI/ScrollViewEditor.cs.meta +12 -0
- package/Editor/UI/ScrollViewExEditor.cs +34 -0
- package/Editor/UI/ScrollViewExEditor.cs.meta +12 -0
- package/Editor/UI/TapSDK.UI.Editor.asmdef +17 -0
- package/Editor/UI/TapSDK.UI.Editor.asmdef.meta +7 -0
- package/Editor/UI.meta +9 -0
- package/Editor.meta +8 -0
- package/Mobile/Editor/NativeDependencies.xml +22 -0
- package/Mobile/Editor/NativeDependencies.xml.meta +7 -0
- package/Mobile/Editor/TapCommonMobileProcessBuild.cs +20 -0
- package/Mobile/Editor/TapCommonMobileProcessBuild.cs.meta +11 -0
- package/Mobile/Editor/TapSDK.Core.Mobile.Editor.asmdef +17 -0
- package/Mobile/Editor/TapSDK.Core.Mobile.Editor.asmdef.meta +7 -0
- package/Mobile/Editor.meta +8 -0
- package/Mobile/Runtime/AndroidNativeWrapper.cs +50 -0
- package/Mobile/Runtime/AndroidNativeWrapper.cs.meta +11 -0
- package/Mobile/Runtime/Bridge.cs +84 -0
- package/Mobile/Runtime/Bridge.cs.meta +11 -0
- package/Mobile/Runtime/BridgeAndroid.cs +73 -0
- package/Mobile/Runtime/BridgeAndroid.cs.meta +11 -0
- package/Mobile/Runtime/BridgeCallback.cs +35 -0
- package/Mobile/Runtime/BridgeCallback.cs.meta +11 -0
- package/Mobile/Runtime/BridgeIOS.cs +113 -0
- package/Mobile/Runtime/BridgeIOS.cs.meta +11 -0
- package/Mobile/Runtime/Command.cs +119 -0
- package/Mobile/Runtime/Command.cs.meta +11 -0
- package/Mobile/Runtime/Constants.cs +9 -0
- package/Mobile/Runtime/Constants.cs.meta +11 -0
- package/Mobile/Runtime/EngineBridgeInitializer.cs +33 -0
- package/Mobile/Runtime/EngineBridgeInitializer.cs.meta +11 -0
- package/Mobile/Runtime/IBridge.cs +15 -0
- package/Mobile/Runtime/IBridge.cs.meta +11 -0
- package/Mobile/Runtime/IOSNativeWrapper.cs +273 -0
- package/Mobile/Runtime/IOSNativeWrapper.cs.meta +11 -0
- package/Mobile/Runtime/Result.cs +37 -0
- package/Mobile/Runtime/Result.cs.meta +11 -0
- package/Mobile/Runtime/TapCoreMobile.cs +71 -0
- package/Mobile/Runtime/TapCoreMobile.cs.meta +11 -0
- package/Mobile/Runtime/TapEventMobile.cs +265 -0
- package/Mobile/Runtime/TapEventMobile.cs.meta +11 -0
- package/Mobile/Runtime/TapSDK.Core.Mobile.Runtime.asmdef +18 -0
- package/Mobile/Runtime/TapSDK.Core.Mobile.Runtime.asmdef.meta +7 -0
- package/Mobile/Runtime/TapUUID.cs +9 -0
- package/Mobile/Runtime/TapUUID.cs.meta +11 -0
- package/Mobile/Runtime.meta +8 -0
- package/Mobile.meta +8 -0
- package/Plugins/iOS.meta +8 -0
- package/Plugins.meta +8 -0
- package/Resources/Fonts/taptap-sdk-bold.ttf +0 -0
- package/Resources/Fonts/taptap-sdk-bold.ttf.meta +22 -0
- package/Resources/Fonts/taptap-sdk.ttf +0 -0
- package/Resources/Fonts/taptap-sdk.ttf.meta +21 -0
- package/Resources/Fonts.meta +8 -0
- package/Resources/Loading.prefab +260 -0
- package/Resources/Loading.prefab.meta +7 -0
- package/Resources/TapCommonTip.prefab +194 -0
- package/Resources/TapCommonTip.prefab.meta +7 -0
- package/Resources/TapCommonToastBlack.prefab +528 -0
- package/Resources/TapCommonToastBlack.prefab.meta +7 -0
- package/Resources/TapCommonToastWhite.prefab +411 -0
- package/Resources/TapCommonToastWhite.prefab.meta +7 -0
- package/Resources/TapSDKCommonTapIcon-v2.png +0 -0
- package/Resources/TapSDKCommonTapIcon-v2.png.meta +128 -0
- package/Resources/TapSDKCommonTapIcon.png +0 -0
- package/Resources/TapSDKCommonTapIcon.png.meta +128 -0
- package/Resources/TapSDKCommonToastBg.png +0 -0
- package/Resources/TapSDKCommonToastBg.png.meta +128 -0
- package/Resources/TapSDKConstantUIRoot.prefab +100 -0
- package/Resources/TapSDKConstantUIRoot.prefab.meta +7 -0
- package/Resources/TapSDKUIRoot.prefab +100 -0
- package/Resources/TapSDKUIRoot.prefab.meta +7 -0
- package/Resources/TapTapBtn_White.png +0 -0
- package/Resources/TapTapBtn_White.png.meta +128 -0
- package/Resources/TapTapBtn_White_2.png +0 -0
- package/Resources/TapTapBtn_White_2.png.meta +128 -0
- package/Resources/ToastBackground.png +0 -0
- package/Resources/ToastBackground.png.meta +128 -0
- package/Resources/detail_bg.png +0 -0
- package/Resources/detail_bg.png.meta +92 -0
- package/Resources/success.png +0 -0
- package/Resources/success.png.meta +128 -0
- package/Resources/taptap-bg.png +0 -0
- package/Resources/taptap-bg.png.meta +140 -0
- package/Resources/taptap-close.png +0 -0
- package/Resources/taptap-close.png.meta +146 -0
- package/Resources/taptap-router-v2.png +0 -0
- package/Resources/taptap-router-v2.png.meta +128 -0
- package/Resources/taptap-router.png +0 -0
- package/Resources/taptap-router.png.meta +146 -0
- package/Resources/taptap-sdk-refresh 1.png +0 -0
- package/Resources/taptap-sdk-refresh 1.png.meta +128 -0
- package/Resources/taptap-toast-error.png +0 -0
- package/Resources/taptap-toast-error.png.meta +128 -0
- package/Resources/taptap-toast-info.png +0 -0
- package/Resources/taptap-toast-info.png.meta +128 -0
- package/Resources/taptap-toast-success.png +0 -0
- package/Resources/taptap-toast-success.png.meta +128 -0
- package/Resources/taptap-toast-warning.png +0 -0
- package/Resources/taptap-toast-warning.png.meta +128 -0
- package/Resources.meta +8 -0
- package/Runtime/Internal/Http/TapHttpClient.cs +176 -0
- package/Runtime/Internal/Http/TapHttpClient.cs.meta +11 -0
- package/Runtime/Internal/Http/TapHttpUtils.cs +83 -0
- package/Runtime/Internal/Http/TapHttpUtils.cs.meta +11 -0
- package/Runtime/Internal/Http.meta +8 -0
- package/Runtime/Internal/Init/IInitTask.cs +18 -0
- package/Runtime/Internal/Init/IInitTask.cs.meta +11 -0
- package/Runtime/Internal/Init.meta +8 -0
- package/Runtime/Internal/Json/TapJsonConverter.cs +40 -0
- package/Runtime/Internal/Json/TapJsonConverter.cs.meta +11 -0
- package/Runtime/Internal/Json.meta +8 -0
- package/Runtime/Internal/Platform/ITapCorePlatform.cs +12 -0
- package/Runtime/Internal/Platform/ITapCorePlatform.cs.meta +11 -0
- package/Runtime/Internal/Platform/ITapEventPlatform.cs +37 -0
- package/Runtime/Internal/Platform/ITapEventPlatform.cs.meta +11 -0
- package/Runtime/Internal/Platform/PlatformTypeUtils.cs +46 -0
- package/Runtime/Internal/Platform/PlatformTypeUtils.cs.meta +11 -0
- package/Runtime/Internal/Platform.meta +8 -0
- package/Runtime/Internal/UI/Base/Const.cs +27 -0
- package/Runtime/Internal/UI/Base/Const.cs.meta +11 -0
- package/Runtime/Internal/UI/Base/GraphicRaycasterBugFixed.cs +240 -0
- package/Runtime/Internal/UI/Base/GraphicRaycasterBugFixed.cs.meta +3 -0
- package/Runtime/Internal/UI/Base/LoadingPanelController.cs +29 -0
- package/Runtime/Internal/UI/Base/LoadingPanelController.cs.meta +11 -0
- package/Runtime/Internal/UI/Base/MonoSingleton.cs +102 -0
- package/Runtime/Internal/UI/Base/MonoSingleton.cs.meta +11 -0
- package/Runtime/Internal/UI/Base/Singleton.cs +29 -0
- package/Runtime/Internal/UI/Base/Singleton.cs.meta +11 -0
- package/Runtime/Internal/UI/Base/TipPanelController.cs +45 -0
- package/Runtime/Internal/UI/Base/TipPanelController.cs.meta +3 -0
- package/Runtime/Internal/UI/Base/ToastBlackPanelController.cs +95 -0
- package/Runtime/Internal/UI/Base/ToastBlackPanelController.cs.meta +11 -0
- package/Runtime/Internal/UI/Base/ToastWhitePanelController.cs +79 -0
- package/Runtime/Internal/UI/Base/ToastWhitePanelController.cs.meta +3 -0
- package/Runtime/Internal/UI/Base/UIManager.cs +724 -0
- package/Runtime/Internal/UI/Base/UIManager.cs.meta +11 -0
- package/Runtime/Internal/UI/Base.meta +8 -0
- package/Runtime/Internal/UI/BasePanel/BasePanelController.cs +385 -0
- package/Runtime/Internal/UI/BasePanel/BasePanelController.cs.meta +11 -0
- package/Runtime/Internal/UI/BasePanel.meta +8 -0
- package/Runtime/Internal/UI/Params/BasePanelConfig.cs +18 -0
- package/Runtime/Internal/UI/Params/BasePanelConfig.cs.meta +11 -0
- package/Runtime/Internal/UI/Params/IOpenPanelParameter.cs +7 -0
- package/Runtime/Internal/UI/Params/IOpenPanelParameter.cs.meta +11 -0
- package/Runtime/Internal/UI/Params.meta +8 -0
- package/Runtime/Internal/UI/ScrollViewEx/ObjPool/SimpleObjPool.cs +76 -0
- package/Runtime/Internal/UI/ScrollViewEx/ObjPool/SimpleObjPool.cs.meta +12 -0
- package/Runtime/Internal/UI/ScrollViewEx/ObjPool.meta +9 -0
- package/Runtime/Internal/UI/ScrollViewEx/ScrollView/ScrollView.cs +828 -0
- package/Runtime/Internal/UI/ScrollViewEx/ScrollView/ScrollView.cs.meta +12 -0
- package/Runtime/Internal/UI/ScrollViewEx/ScrollView/ScrollViewEx.cs +245 -0
- package/Runtime/Internal/UI/ScrollViewEx/ScrollView/ScrollViewEx.cs.meta +12 -0
- package/Runtime/Internal/UI/ScrollViewEx/ScrollView.meta +9 -0
- package/Runtime/Internal/UI/ScrollViewEx.meta +8 -0
- package/Runtime/Internal/UI.meta +8 -0
- package/Runtime/Internal/Utils/BridgeUtils.cs +29 -0
- package/Runtime/Internal/Utils/BridgeUtils.cs.meta +11 -0
- package/Runtime/Internal/Utils/ImageUtils.cs +147 -0
- package/Runtime/Internal/Utils/ImageUtils.cs.meta +11 -0
- package/Runtime/Internal/Utils/TapLoom.cs +155 -0
- package/Runtime/Internal/Utils/TapLoom.cs.meta +11 -0
- package/Runtime/Internal/Utils/UrlUtils.cs +34 -0
- package/Runtime/Internal/Utils/UrlUtils.cs.meta +11 -0
- package/Runtime/Internal/Utils.meta +8 -0
- package/Runtime/Internal.meta +8 -0
- package/Runtime/Public/DataStorage.cs +141 -0
- package/Runtime/Public/DataStorage.cs.meta +11 -0
- package/Runtime/Public/ITapPropertiesProxy.cs +6 -0
- package/Runtime/Public/ITapPropertiesProxy.cs.meta +11 -0
- package/Runtime/Public/Json.cs +636 -0
- package/Runtime/Public/Json.cs.meta +11 -0
- package/Runtime/Public/Log/TapLogLevel.cs +7 -0
- package/Runtime/Public/Log/TapLogLevel.cs.meta +11 -0
- package/Runtime/Public/Log/TapLogger.cs +48 -0
- package/Runtime/Public/Log/TapLogger.cs.meta +11 -0
- package/Runtime/Public/Log.meta +8 -0
- package/Runtime/Public/Platform.cs +27 -0
- package/Runtime/Public/Platform.cs.meta +11 -0
- package/Runtime/Public/RegionType.cs +8 -0
- package/Runtime/Public/RegionType.cs.meta +11 -0
- package/Runtime/Public/SafeDictionary.cs +27 -0
- package/Runtime/Public/SafeDictionary.cs.meta +11 -0
- package/Runtime/Public/TapError.cs +62 -0
- package/Runtime/Public/TapError.cs.meta +11 -0
- package/Runtime/Public/TapErrorCode.cs +44 -0
- package/Runtime/Public/TapErrorCode.cs.meta +11 -0
- package/Runtime/Public/TapException.cs +24 -0
- package/Runtime/Public/TapException.cs.meta +11 -0
- package/Runtime/Public/TapLanguage.cs +21 -0
- package/Runtime/Public/TapLanguage.cs.meta +11 -0
- package/Runtime/Public/TapLocalizeManager.cs +128 -0
- package/Runtime/Public/TapLocalizeManager.cs.meta +11 -0
- package/Runtime/Public/TapTapEvent.cs +93 -0
- package/Runtime/Public/TapTapEvent.cs.meta +11 -0
- package/Runtime/Public/TapTapSDK.cs +96 -0
- package/Runtime/Public/TapTapSDK.cs.meta +11 -0
- package/Runtime/Public/TapTapSDKCoreOptions.cs +104 -0
- package/Runtime/Public/TapTapSDKCoreOptions.cs.meta +11 -0
- package/Runtime/Public.meta +8 -0
- package/Runtime/TapSDK.Core.Runtime.asmdef +3 -0
- package/Runtime/TapSDK.Core.Runtime.asmdef.meta +7 -0
- package/Runtime.meta +8 -0
- package/Standalone/Editor/TapCoreStandaloneProcessBuild.cs +20 -0
- package/Standalone/Editor/TapCoreStandaloneProcessBuild.cs.meta +11 -0
- package/Standalone/Editor/TapSDK.Core.Standalone.Editor.asmdef +17 -0
- package/Standalone/Editor/TapSDK.Core.Standalone.Editor.asmdef.meta +7 -0
- package/Standalone/Editor.meta +8 -0
- package/Standalone/Plugins/macOS/TapDBDeviceInfo.bundle/Contents/Info.plist +46 -0
- package/Standalone/Plugins/macOS/TapDBDeviceInfo.bundle/Contents/Info.plist.meta +7 -0
- package/Standalone/Plugins/macOS/TapDBDeviceInfo.bundle/Contents/MacOS/TapDBDeviceInfo +0 -0
- package/Standalone/Plugins/macOS/TapDBDeviceInfo.bundle/Contents/MacOS/TapDBDeviceInfo.meta +7 -0
- package/Standalone/Plugins/macOS/TapDBDeviceInfo.bundle/Contents/MacOS.meta +8 -0
- package/Standalone/Plugins/macOS/TapDBDeviceInfo.bundle/Contents/_CodeSignature/CodeResources +115 -0
- package/Standalone/Plugins/macOS/TapDBDeviceInfo.bundle/Contents/_CodeSignature/CodeResources.meta +7 -0
- package/Standalone/Plugins/macOS/TapDBDeviceInfo.bundle/Contents/_CodeSignature.meta +8 -0
- package/Standalone/Plugins/macOS/TapDBDeviceInfo.bundle/Contents.meta +8 -0
- package/Standalone/Plugins/macOS/TapDBDeviceInfo.bundle.meta +33 -0
- package/Standalone/Plugins/macOS.meta +8 -0
- package/Standalone/Plugins.meta +8 -0
- package/Standalone/Runtime/Internal/Constants.cs +37 -0
- package/Standalone/Runtime/Internal/Constants.cs.meta +11 -0
- package/Standalone/Runtime/Internal/DeviceInfo.cs +152 -0
- package/Standalone/Runtime/Internal/DeviceInfo.cs.meta +11 -0
- package/Standalone/Runtime/Internal/EventSender.cs +239 -0
- package/Standalone/Runtime/Internal/EventSender.cs.meta +11 -0
- package/Standalone/Runtime/Internal/Http/HttpClient.cs +211 -0
- package/Standalone/Runtime/Internal/Http/HttpClient.cs.meta +11 -0
- package/Standalone/Runtime/Internal/Http/NetUtils.cs +48 -0
- package/Standalone/Runtime/Internal/Http/NetUtils.cs.meta +11 -0
- package/Standalone/Runtime/Internal/Http/TimeUtil.cs +30 -0
- package/Standalone/Runtime/Internal/Http/TimeUtil.cs.meta +11 -0
- package/Standalone/Runtime/Internal/Http.meta +8 -0
- package/Standalone/Runtime/Internal/Identity.cs +43 -0
- package/Standalone/Runtime/Internal/Identity.cs.meta +11 -0
- package/Standalone/Runtime/Internal/PlayRecorder.cs +53 -0
- package/Standalone/Runtime/Internal/PlayRecorder.cs.meta +11 -0
- package/Standalone/Runtime/Internal/Prefs.cs +85 -0
- package/Standalone/Runtime/Internal/Prefs.cs.meta +11 -0
- package/Standalone/Runtime/Internal/Tracker.cs +318 -0
- package/Standalone/Runtime/Internal/Tracker.cs.meta +11 -0
- package/Standalone/Runtime/Internal/User.cs +51 -0
- package/Standalone/Runtime/Internal/User.cs.meta +11 -0
- package/Standalone/Runtime/Internal.meta +8 -0
- package/Standalone/Runtime/Public/EventManager.cs +41 -0
- package/Standalone/Runtime/Public/EventManager.cs.meta +11 -0
- package/Standalone/Runtime/Public/TapCoreStandalone.cs +197 -0
- package/Standalone/Runtime/Public/TapCoreStandalone.cs.meta +11 -0
- package/Standalone/Runtime/Public/TapEventStandalone.cs +281 -0
- package/Standalone/Runtime/Public/TapEventStandalone.cs.meta +11 -0
- package/Standalone/Runtime/Public.meta +8 -0
- package/Standalone/Runtime/TapSDK.Core.Standalone.Runtime.asmdef +21 -0
- package/Standalone/Runtime/TapSDK.Core.Standalone.Runtime.asmdef.meta +7 -0
- package/Standalone/Runtime.meta +8 -0
- package/Standalone.meta +8 -0
- package/package.json +8 -0
- package/package.json.meta +7 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using System.IO;
|
|
3
|
+
using UnityEngine;
|
|
4
|
+
using UnityEditor;
|
|
5
|
+
using UnityEditor.Build;
|
|
6
|
+
using UnityEditor.Build.Reporting;
|
|
7
|
+
|
|
8
|
+
namespace TapSDK.Core.Editor {
|
|
9
|
+
/// <summary>
|
|
10
|
+
/// 模块 SDK 生成 link.xml 构建过程
|
|
11
|
+
/// </summary>
|
|
12
|
+
public abstract class SDKLinkProcessBuild : IPreprocessBuildWithReport, IPostprocessBuildWithReport {
|
|
13
|
+
/// <summary>
|
|
14
|
+
/// 执行顺序
|
|
15
|
+
/// </summary>
|
|
16
|
+
public abstract int callbackOrder { get; }
|
|
17
|
+
|
|
18
|
+
/// <summary>
|
|
19
|
+
/// 生成 link.xml 路径
|
|
20
|
+
/// </summary>
|
|
21
|
+
public abstract string LinkPath { get; }
|
|
22
|
+
|
|
23
|
+
/// <summary>
|
|
24
|
+
/// 防止被裁剪的 Assembly
|
|
25
|
+
/// </summary>
|
|
26
|
+
public abstract LinkedAssembly[] LinkedAssemblies { get; }
|
|
27
|
+
|
|
28
|
+
/// <summary>
|
|
29
|
+
/// 执行平台委托
|
|
30
|
+
/// </summary>
|
|
31
|
+
public abstract Func<BuildReport, bool> IsTargetPlatform { get; }
|
|
32
|
+
|
|
33
|
+
/// <summary>
|
|
34
|
+
/// 构建时忽略目录,目前主要是 PC 内置浏览器 Vuplex
|
|
35
|
+
/// </summary>
|
|
36
|
+
public virtual string[] BuildingIgnorePaths => null;
|
|
37
|
+
|
|
38
|
+
/// <summary>
|
|
39
|
+
/// 构建前处理
|
|
40
|
+
/// </summary>
|
|
41
|
+
/// <param name="report"></param>
|
|
42
|
+
public void OnPreprocessBuild(BuildReport report) {
|
|
43
|
+
if (!IsTargetPlatform.Invoke(report)) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
Application.logMessageReceived += OnBuildError;
|
|
48
|
+
IgnorePaths();
|
|
49
|
+
|
|
50
|
+
string linkPath = Path.Combine(Application.dataPath, LinkPath);
|
|
51
|
+
LinkXMLGenerator.Generate(linkPath, LinkedAssemblies);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/// <summary>
|
|
55
|
+
/// 构建后处理
|
|
56
|
+
/// </summary>
|
|
57
|
+
/// <param name="report"></param>
|
|
58
|
+
public void OnPostprocessBuild(BuildReport report) {
|
|
59
|
+
if (!IsTargetPlatform.Invoke(report)) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
Application.logMessageReceived -= OnBuildError;
|
|
64
|
+
RecoverIgnoredPaths();
|
|
65
|
+
|
|
66
|
+
string linkPath = Path.Combine(Application.dataPath, LinkPath);
|
|
67
|
+
LinkXMLGenerator.Delete(linkPath);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/// <summary>
|
|
71
|
+
/// 错误日志回调
|
|
72
|
+
/// </summary>
|
|
73
|
+
/// <param name="condition"></param>
|
|
74
|
+
/// <param name="stacktrace"></param>
|
|
75
|
+
/// <param name="logType"></param>
|
|
76
|
+
private void OnBuildError(string condition, string stacktrace, LogType logType) {
|
|
77
|
+
// TRICK: 通过捕获错误日志来监听打包错误事件
|
|
78
|
+
if (logType == LogType.Error) {
|
|
79
|
+
Application.logMessageReceived -= OnBuildError;
|
|
80
|
+
RecoverIgnoredPaths();
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/// <summary>
|
|
85
|
+
/// 忽略目录
|
|
86
|
+
/// </summary>
|
|
87
|
+
private void IgnorePaths() {
|
|
88
|
+
if (BuildingIgnorePaths == null) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
foreach (string ignorePath in BuildingIgnorePaths) {
|
|
93
|
+
if (!Directory.Exists(Path.Combine(Application.dataPath, ignorePath))) {
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
string ignoreName = Path.GetFileName(ignorePath);
|
|
97
|
+
AssetDatabase.RenameAsset(Path.Combine("Assets", ignorePath), $"{ignoreName}~");
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/// <summary>
|
|
102
|
+
/// 恢复目录
|
|
103
|
+
/// </summary>
|
|
104
|
+
private void RecoverIgnoredPaths() {
|
|
105
|
+
if (BuildingIgnorePaths == null) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
foreach (string ignorePath in BuildingIgnorePaths) {
|
|
110
|
+
if (!Directory.Exists(Path.Combine(Application.dataPath, $"{ignorePath}~"))) {
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
Directory.Move(Path.Combine(Application.dataPath, $"{ignorePath}~"),
|
|
114
|
+
Path.Combine(Application.dataPath, $"{ignorePath}"));
|
|
115
|
+
AssetDatabase.ImportAsset(Path.Combine("Assets", ignorePath));
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using System.Collections.Generic;
|
|
3
|
+
using System.IO;
|
|
4
|
+
using UnityEngine;
|
|
5
|
+
|
|
6
|
+
namespace TapSDK.Core.Editor
|
|
7
|
+
{
|
|
8
|
+
public class TapFileHelper : System.IDisposable
|
|
9
|
+
{
|
|
10
|
+
private string filePath;
|
|
11
|
+
|
|
12
|
+
public TapFileHelper(string fPath)
|
|
13
|
+
{
|
|
14
|
+
filePath = fPath;
|
|
15
|
+
if (!System.IO.File.Exists(filePath))
|
|
16
|
+
{
|
|
17
|
+
Debug.LogError(filePath + "路径下文件不存在");
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
public void WriteBelow(string below, string text)
|
|
23
|
+
{
|
|
24
|
+
StreamReader streamReader = new StreamReader(filePath);
|
|
25
|
+
string all = streamReader.ReadToEnd();
|
|
26
|
+
streamReader.Close();
|
|
27
|
+
int beginIndex = all.IndexOf(below, StringComparison.Ordinal);
|
|
28
|
+
if (beginIndex == -1)
|
|
29
|
+
{
|
|
30
|
+
Debug.LogError(filePath + "中没有找到字符串" + below);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
int endIndex = all.LastIndexOf("\n", beginIndex + below.Length, StringComparison.Ordinal);
|
|
35
|
+
all = all.Substring(0, endIndex) + "\n" + text + "\n" + all.Substring(endIndex);
|
|
36
|
+
StreamWriter streamWriter = new StreamWriter(filePath);
|
|
37
|
+
streamWriter.Write(all);
|
|
38
|
+
streamWriter.Close();
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
public void Replace(string below, string newText)
|
|
42
|
+
{
|
|
43
|
+
StreamReader streamReader = new StreamReader(filePath);
|
|
44
|
+
string all = streamReader.ReadToEnd();
|
|
45
|
+
streamReader.Close();
|
|
46
|
+
int beginIndex = all.IndexOf(below, StringComparison.Ordinal);
|
|
47
|
+
if (beginIndex == -1)
|
|
48
|
+
{
|
|
49
|
+
Debug.LogError(filePath + "中没有找到字符串" + below);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
all = all.Replace(below, newText);
|
|
54
|
+
StreamWriter streamWriter = new StreamWriter(filePath);
|
|
55
|
+
streamWriter.Write(all);
|
|
56
|
+
streamWriter.Close();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
public void Dispose()
|
|
60
|
+
{
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
public static void CopyAndReplaceDirectory(string srcPath, string dstPath)
|
|
64
|
+
{
|
|
65
|
+
if (Directory.Exists(dstPath))
|
|
66
|
+
Directory.Delete(dstPath, true);
|
|
67
|
+
if (File.Exists(dstPath))
|
|
68
|
+
File.Delete(dstPath);
|
|
69
|
+
|
|
70
|
+
Directory.CreateDirectory(dstPath);
|
|
71
|
+
|
|
72
|
+
foreach (var file in Directory.GetFiles(srcPath))
|
|
73
|
+
File.Copy(file, Path.Combine(dstPath, Path.GetFileName(file)));
|
|
74
|
+
|
|
75
|
+
foreach (var dir in Directory.GetDirectories(srcPath))
|
|
76
|
+
CopyAndReplaceDirectory(dir, Path.Combine(dstPath, Path.GetFileName(dir)));
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
public static void DeleteFileBySuffix(string dir, string[] suffix)
|
|
81
|
+
{
|
|
82
|
+
if (!Directory.Exists(dir))
|
|
83
|
+
{
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
foreach (var file in Directory.GetFiles(dir))
|
|
88
|
+
{
|
|
89
|
+
foreach (var suffixName in suffix)
|
|
90
|
+
{
|
|
91
|
+
if (file.Contains(suffixName))
|
|
92
|
+
{
|
|
93
|
+
File.Delete(file);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
public static string FilterFileByPrefix(string srcPath, string filterName)
|
|
100
|
+
{
|
|
101
|
+
if (!Directory.Exists(srcPath))
|
|
102
|
+
{
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
foreach (var dir in Directory.GetDirectories(srcPath))
|
|
107
|
+
{
|
|
108
|
+
string fileName = Path.GetFileName(dir);
|
|
109
|
+
if (fileName.StartsWith(filterName))
|
|
110
|
+
{
|
|
111
|
+
return Path.Combine(srcPath, Path.GetFileName(dir));
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return null;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
public static string FilterFileBySuffix(string srcPath, string suffix)
|
|
119
|
+
{
|
|
120
|
+
if (!Directory.Exists(srcPath))
|
|
121
|
+
{
|
|
122
|
+
return null;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
foreach (var dir in Directory.GetDirectories(srcPath))
|
|
126
|
+
{
|
|
127
|
+
string fileName = Path.GetFileName(dir);
|
|
128
|
+
if (fileName.StartsWith(suffix))
|
|
129
|
+
{
|
|
130
|
+
return Path.Combine(srcPath, Path.GetFileName(dir));
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
return null;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
public static FileInfo RecursionFilterFile(string dir, string fileName)
|
|
138
|
+
{
|
|
139
|
+
List<FileInfo> fileInfoList = new List<FileInfo>();
|
|
140
|
+
Director(dir, fileInfoList);
|
|
141
|
+
foreach (FileInfo item in fileInfoList)
|
|
142
|
+
{
|
|
143
|
+
if (fileName.Equals(item.Name))
|
|
144
|
+
{
|
|
145
|
+
return item;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
return null;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
public static void Director(string dir, List<FileInfo> list)
|
|
153
|
+
{
|
|
154
|
+
DirectoryInfo d = new DirectoryInfo(dir);
|
|
155
|
+
FileInfo[] files = d.GetFiles();
|
|
156
|
+
DirectoryInfo[] directs = d.GetDirectories();
|
|
157
|
+
foreach (FileInfo f in files)
|
|
158
|
+
{
|
|
159
|
+
list.Add(f);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
foreach (DirectoryInfo dd in directs)
|
|
163
|
+
{
|
|
164
|
+
Director(dd.FullName, list);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "TapSDK.Core.Editor",
|
|
3
|
+
"references": [],
|
|
4
|
+
"includePlatforms": [
|
|
5
|
+
"Editor"
|
|
6
|
+
],
|
|
7
|
+
"excludePlatforms": [],
|
|
8
|
+
"allowUnsafeCode": false,
|
|
9
|
+
"overrideReferences": false,
|
|
10
|
+
"precompiledReferences": [],
|
|
11
|
+
"autoReferenced": true,
|
|
12
|
+
"defineConstraints": [],
|
|
13
|
+
"versionDefines": [],
|
|
14
|
+
"noEngineReferences": false
|
|
15
|
+
}
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
using System.Collections.Generic;
|
|
2
|
+
using System.IO;
|
|
3
|
+
using System.Linq;
|
|
4
|
+
using UnityEditor;
|
|
5
|
+
using UnityEditor.PackageManager;
|
|
6
|
+
using UnityEngine;
|
|
7
|
+
#if UNITY_IOS
|
|
8
|
+
using System;
|
|
9
|
+
using UnityEditor.iOS.Xcode;
|
|
10
|
+
|
|
11
|
+
#endif
|
|
12
|
+
|
|
13
|
+
namespace TapSDK.Core.Editor
|
|
14
|
+
{
|
|
15
|
+
public static class TapSDKCoreCompile
|
|
16
|
+
{
|
|
17
|
+
#if UNITY_IOS
|
|
18
|
+
public static string GetProjPath(string path)
|
|
19
|
+
{
|
|
20
|
+
return PBXProject.GetPBXProjectPath(path);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
public static PBXProject ParseProjPath(string path)
|
|
24
|
+
{
|
|
25
|
+
var proj = new PBXProject();
|
|
26
|
+
proj.ReadFromString(File.ReadAllText(path));
|
|
27
|
+
return proj;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
public static string GetUnityFrameworkTarget(PBXProject proj)
|
|
31
|
+
{
|
|
32
|
+
#if UNITY_2019_3_OR_NEWER
|
|
33
|
+
string target = proj.GetUnityFrameworkTargetGuid();
|
|
34
|
+
return target;
|
|
35
|
+
#endif
|
|
36
|
+
var unityPhoneTarget = proj.TargetGuidByName("Unity-iPhone");
|
|
37
|
+
return unityPhoneTarget;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
public static string GetUnityTarget(PBXProject proj)
|
|
41
|
+
{
|
|
42
|
+
#if UNITY_2019_3_OR_NEWER
|
|
43
|
+
string target = proj.GetUnityMainTargetGuid();
|
|
44
|
+
return target;
|
|
45
|
+
#endif
|
|
46
|
+
var unityPhoneTarget = proj.TargetGuidByName("Unity-iPhone");
|
|
47
|
+
return unityPhoneTarget;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
public static bool CheckTarget(string target)
|
|
52
|
+
{
|
|
53
|
+
return string.IsNullOrEmpty(target);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
public static string GetUnityPackagePath(string parentFolder, string unityPackageName)
|
|
57
|
+
{
|
|
58
|
+
var request = Client.List(true);
|
|
59
|
+
while (request.IsCompleted == false)
|
|
60
|
+
{
|
|
61
|
+
System.Threading.Thread.Sleep(100);
|
|
62
|
+
}
|
|
63
|
+
var pkgs = request.Result;
|
|
64
|
+
if (pkgs == null)
|
|
65
|
+
return "";
|
|
66
|
+
foreach (var pkg in pkgs)
|
|
67
|
+
{
|
|
68
|
+
if (pkg.name == unityPackageName)
|
|
69
|
+
{
|
|
70
|
+
if (pkg.source == PackageSource.Local)
|
|
71
|
+
return pkg.resolvedPath;
|
|
72
|
+
else if (pkg.source == PackageSource.Embedded)
|
|
73
|
+
return pkg.resolvedPath;
|
|
74
|
+
else
|
|
75
|
+
{
|
|
76
|
+
return pkg.resolvedPath;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return "";
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
public static bool HandlerIOSSetting(string path, string appDataPath, string resourceName,
|
|
85
|
+
string modulePackageName,
|
|
86
|
+
string moduleName, string[] bundleNames, string target, string projPath, PBXProject proj, string podSpecName = "")
|
|
87
|
+
{
|
|
88
|
+
|
|
89
|
+
var resourcePath = Path.Combine(path, resourceName);
|
|
90
|
+
|
|
91
|
+
var parentFolder = Directory.GetParent(appDataPath).FullName;
|
|
92
|
+
|
|
93
|
+
Debug.Log($"ProjectFolder path:{parentFolder}" + " resourcePath: " + resourcePath + " parentFolder: " + parentFolder);
|
|
94
|
+
|
|
95
|
+
if (Directory.Exists(resourcePath))
|
|
96
|
+
{
|
|
97
|
+
Directory.Delete(resourcePath, true);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
var podSpecPath = Path.Combine(path + "/Pods", podSpecName);
|
|
101
|
+
//使用 cocospod 远程依赖
|
|
102
|
+
if (podSpecName != null && podSpecName.Length > 0 && Directory.Exists(podSpecPath))
|
|
103
|
+
{
|
|
104
|
+
resourcePath = Path.Combine(path + "/Pods", podSpecName + "/Frameworks");
|
|
105
|
+
Debug.Log($"Find {moduleName} use pods resourcePath:{resourcePath}");
|
|
106
|
+
}
|
|
107
|
+
else
|
|
108
|
+
{
|
|
109
|
+
Directory.CreateDirectory(resourcePath);
|
|
110
|
+
var remotePackagePath = GetUnityPackagePath(parentFolder, modulePackageName);
|
|
111
|
+
|
|
112
|
+
var assetLocalPackagePath = TapFileHelper.FilterFileByPrefix(parentFolder + "/Assets/TapSDK/", moduleName);
|
|
113
|
+
|
|
114
|
+
var localPackagePath = TapFileHelper.FilterFileByPrefix(parentFolder, moduleName);
|
|
115
|
+
|
|
116
|
+
Debug.Log($"Find {moduleName} path: remote = {remotePackagePath} asset = {assetLocalPackagePath} local = {localPackagePath}");
|
|
117
|
+
var tdsResourcePath = "";
|
|
118
|
+
|
|
119
|
+
if (!string.IsNullOrEmpty(remotePackagePath))
|
|
120
|
+
{
|
|
121
|
+
tdsResourcePath = remotePackagePath;
|
|
122
|
+
}
|
|
123
|
+
else if (!string.IsNullOrEmpty(assetLocalPackagePath))
|
|
124
|
+
{
|
|
125
|
+
tdsResourcePath = assetLocalPackagePath;
|
|
126
|
+
}
|
|
127
|
+
else if (!string.IsNullOrEmpty(localPackagePath))
|
|
128
|
+
{
|
|
129
|
+
tdsResourcePath = localPackagePath;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
if (string.IsNullOrEmpty(tdsResourcePath))
|
|
133
|
+
{
|
|
134
|
+
throw new Exception(string.Format("Can't find tdsResourcePath with module of : {0}", modulePackageName));
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
tdsResourcePath = $"{tdsResourcePath}/Plugins/iOS/Resource";
|
|
138
|
+
|
|
139
|
+
Debug.Log($"Find {moduleName} path:{tdsResourcePath}");
|
|
140
|
+
|
|
141
|
+
if (!Directory.Exists(tdsResourcePath))
|
|
142
|
+
{
|
|
143
|
+
throw new Exception(string.Format("Can't Find {0}", tdsResourcePath));
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
TapFileHelper.CopyAndReplaceDirectory(tdsResourcePath, resourcePath);
|
|
147
|
+
}
|
|
148
|
+
foreach (var name in bundleNames)
|
|
149
|
+
{
|
|
150
|
+
var relativePath = GetRelativePath(Path.Combine(resourcePath, name), path);
|
|
151
|
+
var fileGuid = proj.AddFile(relativePath, relativePath, PBXSourceTree.Source);
|
|
152
|
+
proj.AddFileToBuild(target, fileGuid);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
File.WriteAllText(projPath, proj.WriteToString());
|
|
156
|
+
return true;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
private static string GetRelativePath(string absolutePath, string rootPath)
|
|
160
|
+
{
|
|
161
|
+
if (Directory.Exists(rootPath) && !rootPath.EndsWith(Path.AltDirectorySeparatorChar.ToString()))
|
|
162
|
+
{
|
|
163
|
+
rootPath += Path.AltDirectorySeparatorChar;
|
|
164
|
+
}
|
|
165
|
+
Uri aboslutePathUri = new Uri(absolutePath);
|
|
166
|
+
Uri rootPathUri = new Uri(rootPath);
|
|
167
|
+
var relateivePath = rootPathUri.MakeRelativeUri(aboslutePathUri).ToString();
|
|
168
|
+
Debug.LogFormat($"[TapSDKCoreCompile] GetRelativePath absolutePath:{absolutePath} rootPath:{rootPath} relateivePath:{relateivePath} ");
|
|
169
|
+
return relateivePath;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
public static bool HandlerPlist(string pathToBuildProject, string infoPlistPath, bool macos = false)
|
|
173
|
+
{
|
|
174
|
+
// #if UNITY_2020_1_OR_NEWER
|
|
175
|
+
// var macosXCodePlistPath =
|
|
176
|
+
// $"{pathToBuildProject}/{PlayerSettings.productName}/Info.plist";
|
|
177
|
+
// #elif UNITY_2019_1_OR_NEWER
|
|
178
|
+
// var macosXCodePlistPath =
|
|
179
|
+
// $"{Path.GetDirectoryName(pathToBuildProject)}/{PlayerSettings.productName}/Info.plist";
|
|
180
|
+
// #endif
|
|
181
|
+
|
|
182
|
+
string plistPath;
|
|
183
|
+
|
|
184
|
+
if (pathToBuildProject.EndsWith(".app"))
|
|
185
|
+
{
|
|
186
|
+
plistPath = $"{pathToBuildProject}/Contents/Info.plist";
|
|
187
|
+
}
|
|
188
|
+
else
|
|
189
|
+
{
|
|
190
|
+
var macosXCodePlistPath =
|
|
191
|
+
$"{Path.GetDirectoryName(pathToBuildProject)}/{PlayerSettings.productName}/Info.plist";
|
|
192
|
+
if (!File.Exists(macosXCodePlistPath))
|
|
193
|
+
{
|
|
194
|
+
macosXCodePlistPath = $"{pathToBuildProject}/{PlayerSettings.productName}/Info.plist";
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
plistPath = !macos
|
|
198
|
+
? pathToBuildProject + "/Info.plist"
|
|
199
|
+
: macosXCodePlistPath;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
Debug.Log($"plist path:{plistPath}");
|
|
203
|
+
|
|
204
|
+
var plist = new PlistDocument();
|
|
205
|
+
plist.ReadFromString(File.ReadAllText(plistPath));
|
|
206
|
+
var rootDic = plist.root;
|
|
207
|
+
|
|
208
|
+
var items = new List<string>
|
|
209
|
+
{
|
|
210
|
+
"tapsdk",
|
|
211
|
+
"tapiosdk",
|
|
212
|
+
"taptap"
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
if (!(rootDic["LSApplicationQueriesSchemes"] is PlistElementArray plistElementList))
|
|
216
|
+
{
|
|
217
|
+
plistElementList = rootDic.CreateArray("LSApplicationQueriesSchemes");
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
foreach (var t in items)
|
|
221
|
+
{
|
|
222
|
+
plistElementList.AddString(t);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
if (string.IsNullOrEmpty(infoPlistPath)) return false;
|
|
226
|
+
var dic = (Dictionary<string, object>)Plist.readPlist(infoPlistPath);
|
|
227
|
+
var taptapId = "";
|
|
228
|
+
|
|
229
|
+
foreach (var item in dic)
|
|
230
|
+
{
|
|
231
|
+
if (item.Key.Equals("taptap"))
|
|
232
|
+
{
|
|
233
|
+
var taptapDic = (Dictionary<string, object>)item.Value;
|
|
234
|
+
foreach (var taptapItem in taptapDic.Where(taptapItem => taptapItem.Key.Equals("client_id")))
|
|
235
|
+
{
|
|
236
|
+
taptapId = (string)taptapItem.Value;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
else
|
|
240
|
+
{
|
|
241
|
+
rootDic.SetString(item.Key, item.Value.ToString());
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
//添加url
|
|
246
|
+
var dict = plist.root.AsDict();
|
|
247
|
+
if (!(dict["CFBundleURLTypes"] is PlistElementArray array))
|
|
248
|
+
{
|
|
249
|
+
array = dict.CreateArray("CFBundleURLTypes");
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
if (!macos)
|
|
253
|
+
{
|
|
254
|
+
var dict2 = array.AddDict();
|
|
255
|
+
dict2.SetString("CFBundleURLName", "TapTap");
|
|
256
|
+
var array2 = dict2.CreateArray("CFBundleURLSchemes");
|
|
257
|
+
array2.AddString($"tt{taptapId}");
|
|
258
|
+
}
|
|
259
|
+
else
|
|
260
|
+
{
|
|
261
|
+
var dict2 = array.AddDict();
|
|
262
|
+
dict2.SetString("CFBundleURLName", "TapWeb");
|
|
263
|
+
var array2 = dict2.CreateArray("CFBundleURLSchemes");
|
|
264
|
+
array2.AddString($"open-taptap-{taptapId}");
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
Debug.Log("TapSDK change plist Success");
|
|
268
|
+
File.WriteAllText(plistPath, plist.WriteToString());
|
|
269
|
+
return true;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
public static string GetValueFromPlist(string infoPlistPath, string key)
|
|
273
|
+
{
|
|
274
|
+
if (infoPlistPath == null)
|
|
275
|
+
{
|
|
276
|
+
return null;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
var dic = (Dictionary<string, object>)Plist.readPlist(infoPlistPath);
|
|
280
|
+
return (from item in dic where item.Key.Equals(key) select (string)item.Value).FirstOrDefault();
|
|
281
|
+
}
|
|
282
|
+
#endif
|
|
283
|
+
}
|
|
284
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
using System.IO;
|
|
2
|
+
using UnityEditor;
|
|
3
|
+
# if UNITY_IOS
|
|
4
|
+
using UnityEditor.Callbacks;
|
|
5
|
+
using UnityEditor.iOS.Xcode;
|
|
6
|
+
#endif
|
|
7
|
+
using UnityEngine;
|
|
8
|
+
|
|
9
|
+
namespace TapSDK.Core.Editor
|
|
10
|
+
{
|
|
11
|
+
# if UNITY_IOS
|
|
12
|
+
public static class TapCommonIOSProcessor
|
|
13
|
+
{
|
|
14
|
+
// 添加标签,unity导出工程后自动执行该函数
|
|
15
|
+
[PostProcessBuild(99)]
|
|
16
|
+
public static void OnPostprocessBuild(BuildTarget buildTarget, string path)
|
|
17
|
+
{
|
|
18
|
+
if (buildTarget != BuildTarget.iOS) return;
|
|
19
|
+
|
|
20
|
+
// 获得工程路径
|
|
21
|
+
var projPath = TapSDKCoreCompile.GetProjPath(path);
|
|
22
|
+
var proj = TapSDKCoreCompile.ParseProjPath(projPath);
|
|
23
|
+
var target = TapSDKCoreCompile.GetUnityTarget(proj);
|
|
24
|
+
var unityFrameworkTarget = TapSDKCoreCompile.GetUnityFrameworkTarget(proj);
|
|
25
|
+
|
|
26
|
+
if (TapSDKCoreCompile.CheckTarget(target))
|
|
27
|
+
{
|
|
28
|
+
Debug.LogError("Unity-iPhone is NUll");
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
proj.AddBuildProperty(target, "OTHER_LDFLAGS", "-ObjC");
|
|
33
|
+
proj.AddBuildProperty(unityFrameworkTarget, "OTHER_LDFLAGS", "-ObjC");
|
|
34
|
+
|
|
35
|
+
proj.SetBuildProperty(target, "ENABLE_BITCODE", "NO");
|
|
36
|
+
proj.SetBuildProperty(target, "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES", "YES");
|
|
37
|
+
proj.SetBuildProperty(target, "SWIFT_VERSION", "5.0");
|
|
38
|
+
proj.SetBuildProperty(target, "CLANG_ENABLE_MODULES", "YES");
|
|
39
|
+
|
|
40
|
+
proj.SetBuildProperty(unityFrameworkTarget, "ENABLE_BITCODE", "NO");
|
|
41
|
+
proj.SetBuildProperty(unityFrameworkTarget, "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES", "NO");
|
|
42
|
+
proj.SetBuildProperty(unityFrameworkTarget, "SWIFT_VERSION", "5.0");
|
|
43
|
+
proj.SetBuildProperty(unityFrameworkTarget, "CLANG_ENABLE_MODULES", "YES");
|
|
44
|
+
|
|
45
|
+
proj.AddFrameworkToProject(unityFrameworkTarget, "MobileCoreServices.framework", false);
|
|
46
|
+
proj.AddFrameworkToProject(unityFrameworkTarget, "WebKit.framework", false);
|
|
47
|
+
proj.AddFrameworkToProject(unityFrameworkTarget, "Security.framework", false);
|
|
48
|
+
proj.AddFrameworkToProject(unityFrameworkTarget, "SystemConfiguration.framework", false);
|
|
49
|
+
proj.AddFrameworkToProject(unityFrameworkTarget, "CoreTelephony.framework", false);
|
|
50
|
+
proj.AddFrameworkToProject(unityFrameworkTarget, "SystemConfiguration.framework", false);
|
|
51
|
+
|
|
52
|
+
proj.AddFileToBuild(unityFrameworkTarget,
|
|
53
|
+
proj.AddFile("usr/lib/libc++.tbd", "libc++.tbd", PBXSourceTree.Sdk));
|
|
54
|
+
|
|
55
|
+
proj.AddFileToBuild(unityFrameworkTarget,
|
|
56
|
+
proj.AddFile("usr/lib/libsqlite3.tbd", "libsqlite3.tbd", PBXSourceTree.Sdk));
|
|
57
|
+
|
|
58
|
+
// if (TapSDKCoreCompile.HandlerIOSSetting(path,
|
|
59
|
+
// Application.dataPath,
|
|
60
|
+
// "TapCommonResource",
|
|
61
|
+
// "com.taptap.sdk.core",
|
|
62
|
+
// "TapSDKCore",
|
|
63
|
+
// new[] {"TapCommonResource.bundle"},
|
|
64
|
+
// target, projPath, proj))
|
|
65
|
+
// {
|
|
66
|
+
// Debug.Log("TapCommon add Bundle Success!");
|
|
67
|
+
// return;
|
|
68
|
+
// }
|
|
69
|
+
|
|
70
|
+
// Debug.LogError("TapCommon add Bundle Failed!");
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
#endif
|
|
74
|
+
}
|