|
|
@@ -208,53 +208,24 @@ namespace Pack
|
|
|
string unityFmwkGUid = pbxProject.GetUnityFrameworkTargetGuid();
|
|
|
Debug.Log($"=================== targetGuid = {targetGuid} ===============");
|
|
|
|
|
|
- //pbxProject.AddCopyFilesBuildPhase(targetGuid, "SSBundle.bundle", Application.dataPath + "/Plugins/iOS", "");
|
|
|
-
|
|
|
- //pbxProject.SetBuildProperty(targetGuid, "DEBUG_INFORMATION_FORMAT", "dwarf-with-dsym");
|
|
|
- //pbxProject.SetBuildProperty(targetGuid, "GCC_GENERATE_DEBUGGING_SYMBOLS", "YES");
|
|
|
- //pbxProject.SetBuildProperty(targetGuid, "COPY_PHASE_STRIP", "NO");
|
|
|
- //pbxProject.SetBuildProperty(targetGuid, "GCC_ENABLE_OBJC_EXCEPTIONS", "YES");
|
|
|
- //pbxProject.SetBuildProperty(targetGuid, "GCC_ENABLE_CPP_EXCEPTIONS", "YES");
|
|
|
|
|
|
pbxProject.SetBuildProperty(targetGuid, "ENABLE_BITCODE", "NO");
|
|
|
- pbxProject.AddBuildProperty(targetGuid, "OTHER_LDFLAGS", "-ObjC -lz");
|
|
|
- pbxProject.AddBuildProperty(unityFmwkGUid, "OTHER_LDFLAGS", "-ObjC");
|
|
|
-
|
|
|
- /*
|
|
|
- //pbxProject.SetBuildProperty(targetGuid, "SWIFT_VERSION", "5.0");
|
|
|
- //pbxProject.AddBuildProperty(targetGuid, "Library Search Path", "$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)");
|
|
|
- //pbxProject.AddBuildProperty(targetGuid, "Library Search Path", "$(SDKROOT)/usr/lib/swift");
|
|
|
- //pbxProject.AddBuildProperty(unityFmwkGUid, "LIBRARY_SEARCH_PATHS", "$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)");
|
|
|
- //pbxProject.AddBuildProperty(targetGuid, "LIBRARY_SEARCH_PATHS", "$(SDKROOT)/usr/lib/swift");
|
|
|
- //pbxProject.AddBuildProperty(unityFmwkGUid, "LIBRARY_SEARCH_PATHS", "$(SDKROOT)/usr/lib/swift");
|
|
|
- //pbxProject.AddBuildProperty(targetGuid, "Runpath Search Path", "/usr/lib/swift");
|
|
|
- //pbxProject.AddBuildProperty(targetGuid, "RUNPATH_SEARCH_PATHS", "/usr/lib/swift");
|
|
|
- //AdSupport.framework AuthenticationServices.framework, Accelerate.framework
|
|
|
- */
|
|
|
+
|
|
|
+ pbxProject.AddBuildProperty(targetGuid, "OTHER_LDFLAGS", "-all_load -ObjC -lc++");
|
|
|
+ pbxProject.AddBuildProperty(unityFmwkGUid, "OTHER_LDFLAGS", "-all_load -ObjC -lc++");
|
|
|
+ // 设置 Allow Non-modular Includes in Framework Modules 为 true
|
|
|
+ pbxProject.SetBuildProperty(targetGuid, "CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES", "YES");
|
|
|
+ pbxProject.SetBuildProperty(unityFmwkGUid, "CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES", "YES");
|
|
|
+
|
|
|
|
|
|
//内购
|
|
|
pbxProject.AddCapability(targetGuid,PBXCapabilityType.InAppPurchase);
|
|
|
pbxProject.AddCapability(targetGuid,PBXCapabilityType.SignInWithApple);
|
|
|
|
|
|
|
|
|
-
|
|
|
- /*
|
|
|
- * SDK 依赖库
|
|
|
- * -libz.tbd -libbz2.tbd -libxml2.tbd -libresolv.9.tbd
|
|
|
- * -libsqlite3.tbd -libc++.tbd -lbc++abi.tbd
|
|
|
- * -Accelerate.framework -CoreImage.framework -CoreLocation.framework -JavaScriptCore.framework -AppTrackingTransparency.framework
|
|
|
- * -EventKit.framework -EventKitUI.framework -Security.framework
|
|
|
- */
|
|
|
- AddFrameworkToProject(pbxProject, targetGuid,new string[]
|
|
|
- {
|
|
|
- "libz.tbd","libbz2.tbd", "libxml2.tbd","libresolv.9.tbd",
|
|
|
- "libsqlite3.tbd","libc++.tbd","lbc++abi.tbd",
|
|
|
- "Accelerate.framework","CoreImage.framework","CoreLocation.framework","JavaScriptCore.framework","AppTrackingTransparency.framework",
|
|
|
- "EventKit.framework","EventKitUI.framework","Security.framework"
|
|
|
- },false);
|
|
|
|
|
|
|
|
|
- AddFrameworkToProject(pbxProject, unityFmwkGUid, new string[] { "Accelerate.framework" },false);
|
|
|
+ //AddFrameworkToProject(pbxProject, unityFmwkGUid, new string[] { "Accelerate.framework" },false);
|
|
|
|
|
|
//pbxProject.AddAssetTagToDefaultInstall
|
|
|
pbxProject.WriteToFile(pbxprojPath);
|
|
|
@@ -263,14 +234,44 @@ namespace Pack
|
|
|
string plistPath = Path.Combine(outPath, "Info.plist");
|
|
|
PlistDocument plistDocument = new PlistDocument();
|
|
|
plistDocument.ReadFromFile(plistPath);
|
|
|
-
|
|
|
+ /*<key>UIAppFonts</key>
|
|
|
+ <array>
|
|
|
+ <string>Inter-Black.ttf</string>
|
|
|
+ <string>Inter-Bold.ttf</->
|
|
|
+ <string>Inter-ExtraBold.ttf</string>
|
|
|
+ <string>Inter-Light.ttf</string>
|
|
|
+ <string>Inter-Medium.ttf</string>
|
|
|
+ <string>Inter-Regular.ttf</string>
|
|
|
+ <string>Inter-SemiBold.ttf</string>
|
|
|
+ <string>Inter-Thin.ttf</string>
|
|
|
+ </array>
|
|
|
+ */
|
|
|
PlistCreateArray(plistDocument, "LSApplicationQueriesSchemes", new string[] { "fbauth2", "fbapi", "fb-messenger-share-api", "fbshareextension", "fb-messenger-api" , "vk", "vk-share", "vkauthorize" });
|
|
|
+ PlistCreateArray(plistDocument, "UIAppFonts", new string[]
|
|
|
+ {
|
|
|
+ "Inter-Black.ttf",
|
|
|
+ "Inter-Bold.ttf",
|
|
|
+ "Inter-ExtraBold.ttf",
|
|
|
+ "Inter-Light.ttf",
|
|
|
+ "Inter-Medium.ttf",
|
|
|
+ "Inter-Regular.ttf",
|
|
|
+ "Inter-SemiBold.ttf",
|
|
|
+ "Inter-Thin.ttf"
|
|
|
+ });
|
|
|
//PlistCreateArray(plistDocument, "Queried URL Schemes", new string[] { "vk", "vk-share", "vkauthorize" });
|
|
|
PlistCreateDict(plistDocument, "NSAppTransportSecurity", new Dictionary<string, DictItem>() { { "NSAllowsArbitraryLoads", new DictItem("bool",true)} });
|
|
|
|
|
|
+ //Facebook AppID IOS: 1734387583815032
|
|
|
+ PlistCreateDict(plistDocument,"",new Dictionary<string, DictItem>()
|
|
|
+ {
|
|
|
+ { "FacebookAppID", new DictItem("string", "1734387583815032") },
|
|
|
+ { "FacebookDisplayName",new DictItem("string","FacebookDisplayName") },
|
|
|
+ { "NSUserTrackingUsageDescription",new DictItem("string","App would like to access IDFA for tracking purpose") },
|
|
|
+ },true);
|
|
|
|
|
|
- PlistElementArray urlTs = PlistAddUrlType(plistDocument,null,"vk","Editor", "vk51712598");
|
|
|
+ PlistElementArray urlTs = PlistAddUrlType(plistDocument,null, "Bundle_Identifier", "Editor", "Bundle_Identifier");
|
|
|
PlistAddUrlType(plistDocument, urlTs, "google", "Editor", "com.googleusercontent.apps.629791852483-g1ldf9nkll5ntqvtau1f7853pvqa4fol");
|
|
|
+ PlistAddUrlType(plistDocument, urlTs, "facebook", "Editor", "fb1734387583815032");
|
|
|
|
|
|
|
|
|
plistDocument.WriteToFile(plistPath);
|
|
|
@@ -285,46 +286,68 @@ namespace Pack
|
|
|
"_VendorID = AllocCString([WentingSDK GetUUID]);");
|
|
|
script.Save();
|
|
|
|
|
|
- //if (plugins.Contains("Lebian"))
|
|
|
- //{
|
|
|
- // string unityAppControllerMMPath = Path.Combine(outPath, "Classes/UnityAppController.mm");
|
|
|
- // script = new ObjCScript(unityAppControllerMMPath);
|
|
|
- // script.AddImport("LBSDK/LBInit.h", true);
|
|
|
- // int idx = script.FindLine("::printf(\"-> applicationDidFinishLaunching()\\n\");");
|
|
|
- // script.InsertLine(idx, idx + 1);
|
|
|
- // script.InsertLine(idx, idx + 2, "// 请务必在方法的最前面调用该接口,否则很容易出问题");
|
|
|
- // script.InsertLine(idx, idx + 3, "if ([[LBInit sharedInstance] LBSDKShouldInitWithLaunchOptions:launchOptions]) {");
|
|
|
- // script.InsertLine(idx, idx + 4, "\treturn YES;");
|
|
|
- // script.InsertLine(idx, idx + 5, "}");
|
|
|
- // script.InsertLine(idx, idx + 6);
|
|
|
- // script.Save();
|
|
|
- //}
|
|
|
-
|
|
|
- //if (plugins.Contains("WentingLicense"))
|
|
|
- //{
|
|
|
- // string unityAppControllerMMPath = Path.Combine(outPath, "Classes/UnityAppController.mm");
|
|
|
- // script = new ObjCScript(unityAppControllerMMPath);
|
|
|
- // script.AddImport("WentingLicense.h", false);
|
|
|
- // int idx = script.FindLine("::printf(\"-> applicationDidFinishLaunching()\\n\");");
|
|
|
- // script.InsertLine(idx, idx + 1);
|
|
|
- // script.InsertLine(idx, idx + 2, "if ([[WentingLicense sharedInstance] CheckAgreeWithLaunchOptions:launchOptions]) {");
|
|
|
- // script.InsertLine(idx, idx + 3, "\treturn YES;");
|
|
|
- // script.InsertLine(idx, idx + 4, "}");
|
|
|
- // script.InsertLine(idx, idx + 5);
|
|
|
- // script.Save();
|
|
|
- //}
|
|
|
-
|
|
|
- //if (!string.IsNullOrEmpty(plugins.Find((x) => x.StartsWith("YOUYI"))))
|
|
|
- //{
|
|
|
- // string unityAppControllerMMPath = Path.Combine(outPath, "Classes/UnityAppController.mm");
|
|
|
- // script = new ObjCScript(unityAppControllerMMPath);
|
|
|
- // script.AddImport("YWBeginSDK.h", false);
|
|
|
- // int idx = script.FindLine("::printf(\"-> applicationWillEnterForeground()\\n\");");
|
|
|
- // script.InsertLine(idx, idx + 1);
|
|
|
- // script.InsertLine(idx, idx + 2, "[[YWBeginSDK standardDeafaults] ywInterfaceApplicationWillEnterForeground];");
|
|
|
- // script.InsertLine(idx, idx + 3);
|
|
|
- // script.Save();
|
|
|
- //}
|
|
|
+
|
|
|
+ string unityAppControllerMMPath = Path.Combine(outPath, "Classes/UnityAppController.mm");
|
|
|
+ script = new ObjCScript(unityAppControllerMMPath);
|
|
|
+
|
|
|
+ script.AddImport("OEGFramework", true,true);
|
|
|
+
|
|
|
+ int idx = script.FindLine("::printf(\"-> applicationDidFinishLaunching()\\n\");");
|
|
|
+ script.InsertLine(idx, idx + 1);
|
|
|
+ script.InsertLine(idx, idx + 2, "[OEGManager handleDidFinishLaunchingWithOptions:launchOptions];");
|
|
|
+ script.InsertLine(idx, idx + 3, "// If you want to control Firebase push message you can add below code");
|
|
|
+ script.InsertLine(idx, idx + 4, "[[FirebaseService sharedManager] messagingDelegate:self];");
|
|
|
+ script.InsertLine(idx, idx + 5);
|
|
|
+
|
|
|
+
|
|
|
+ idx = script.FindLine("::printf(\"-> applicationWillResignActive()\\n\");");
|
|
|
+ script.InsertLine(idx, idx + 1);
|
|
|
+ script.InsertLine(idx, idx + 2, "[OEGManager handleWillResignActive];");
|
|
|
+ script.InsertLine(idx, idx + 3);
|
|
|
+
|
|
|
+ idx = script.FindLine("::printf(\"-> applicationDidEnterBackground()\\n\");");
|
|
|
+ script.InsertLine(idx, idx + 1);
|
|
|
+ script.InsertLine(idx, idx + 2, " [OEGManager handleDidEnterBackground];");
|
|
|
+ script.InsertLine(idx, idx + 3);
|
|
|
+
|
|
|
+ idx = script.FindLine("::printf(\"-> applicationWillEnterForeground()\\n\");");
|
|
|
+ script.InsertLine(idx, idx + 1);
|
|
|
+ script.InsertLine(idx, idx + 2, "[OEGManager handleWillEnterForeground];");
|
|
|
+ script.InsertLine(idx, idx + 3);
|
|
|
+
|
|
|
+ idx = script.FindLine("::printf(\"-> applicationDidBecomeActive()\\n\");");
|
|
|
+ script.InsertLine(idx, idx + 1);
|
|
|
+ script.InsertLine(idx, idx + 2, "[OEGManager handleDidBecomeActive];");
|
|
|
+ script.InsertLine(idx, idx + 3);
|
|
|
+
|
|
|
+ idx = script.FindLine("::printf(\"-> applicationWillTerminate()\\n\");");
|
|
|
+ script.InsertLine(idx, idx + 1);
|
|
|
+ script.InsertLine(idx, idx + 2, "[OEGManager handleWillTerminate];");
|
|
|
+ script.InsertLine(idx, idx + 3);
|
|
|
+
|
|
|
+ idx = script.FindLine("@end") - 1;
|
|
|
+ //script.InsertLine(idx, idx + 1);
|
|
|
+ //script.InsertLine(idx, idx + 2, "- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {");
|
|
|
+ //script.InsertLine(idx, idx + 3, " [OEGManager handleDidRegisterForRemoteNotificationsWithDeviceToken:deviceToken];\n}");
|
|
|
+ script.InsertLine(idx, idx + 1);
|
|
|
+ script.InsertLine(idx, idx + 2, "- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {");
|
|
|
+ script.InsertLine(idx, idx + 3, " return [OEGManager handleOpenURL:url options:options];\n}");
|
|
|
+ script.InsertLine(idx, idx + 4);
|
|
|
+ script.InsertLine(idx, idx + 5);
|
|
|
+
|
|
|
+ //
|
|
|
+
|
|
|
+ idx = script.FindLine("- (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken") + 1;
|
|
|
+ script.InsertLine(idx, idx + 1);
|
|
|
+ script.InsertLine(idx, idx + 2, "[OEGManager handleDidRegisterForRemoteNotificationsWithDeviceToken:deviceToken];");
|
|
|
+ script.InsertLine(idx, idx + 3);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ script.Save();
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
EditorUtility.DisplayProgressBar("修改XCodeProject", "完成修改XCodeProject", 1);
|
|
|
@@ -364,7 +387,7 @@ namespace Pack
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public void AddImport(string name, bool isframework = false)
|
|
|
+ public void AddImport(string name, bool isframework = false,bool ismode = false)
|
|
|
{
|
|
|
if (m_Lines == null)
|
|
|
{
|
|
|
@@ -391,7 +414,15 @@ namespace Pack
|
|
|
if (isframework)
|
|
|
{
|
|
|
idx = idx + 1;
|
|
|
- m_Lines.Insert(idx, "#import <" + name + ">");
|
|
|
+
|
|
|
+ if (ismode)
|
|
|
+ {
|
|
|
+ m_Lines.Insert(idx, "@import " + name + ";");
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ m_Lines.Insert(idx, "#import <" + name + ">");
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|