少年修仙传客户端基础资源
cehua-HWJ35
2023-11-13 f189e5130e96bd18ef94de9ea302579d720799e8
Assets/Editor/XCodeProjectMod.cs
@@ -32,41 +32,25 @@
        //var _provision = Debug.isDebugBuild ? PROVISIONING_DEVELOPER : PROVISIONING_DISTRIBUTION;
        // BuildSetting里的相关设置
        project.SetBuildProperty(project.ProjectGuid(), "ENABLE_BITCODE", "NO");
        project.SetBuildProperty(targetGUID, "ENABLE_BITCODE", "NO");
        project.SetBuildProperty(targetGUID, "DEVELOPMENT_TEAM", TEAM);
        project.AddBuildProperty(targetGUID, "OTHER_LDFLAGS", "-ObjC");
        project.AddBuildProperty(targetGUID, "GCC_GENERATE_DEBUGGING_SYMBOLS", "NO");
        // 处理 Framework
        // FreeSDK
        project.AddFrameworkToProject(targetGUID, "CoreGraphics.framework", true);
        //_project.AddFrameworkToProject(_targetGUID, "Security.framework", true);
        project.AddFrameworkToProject(targetGUID, "CoreTelephony.framework", true);
        project.AddFrameworkToProject(targetGUID, "StoreKit.framework", true);
        project.AddFrameworkToProject(targetGUID, "MobileCoreServices.framework", true);
        //_project.AddFrameworkToProject(_targetGUID, "SystemConfiguration.framework", true);
        project.AddFrameworkToProject(targetGUID, "AdSupport.framework", true);
        // 极光推送
        // JPush
        project.AddFrameworkToProject(targetGUID, "CFNetwork.framework", true);
        project.AddFrameworkToProject(targetGUID, "CoreFoundation.framework", true);
        project.AddFrameworkToProject(targetGUID, "Foundation.framework", true);
        project.AddFrameworkToProject(targetGUID, "UIKit.framework", true);
        project.AddFrameworkToProject(targetGUID, "UserNotifications.framework", true);
        //wkwebview
        project.AddFrameworkToProject(fwTargetGUID, "WebKit.framework", true);
        //bugly
        project.AddFrameworkToProject(targetGUID, "SystemConfiguration.framework", true);
        project.AddFrameworkToProject(targetGUID, "Security.framework", true);
        project.AddFrameworkToProject(targetGUID, "JavaScriptCore.framework", true);
        project.AddFrameworkToProject(fwTargetGUID, "SystemConfiguration.framework", true);
        project.AddFrameworkToProject(fwTargetGUID, "Security.framework", true);
        project.AddFrameworkToProject(fwTargetGUID, "JavaScriptCore.framework", true);
        // 处理 库文件
        project.AddFileToBuild(targetGUID, project.AddFile("/usr/lib/libz.tbd", "Frameworks/libz.tbd", PBXSourceTree.Sdk));
        project.AddFileToBuild(targetGUID, project.AddFile("/usr/lib/libsqlite3.tbd", "Frameworks/libsqlite3.tbd", PBXSourceTree.Sdk));
        project.AddFileToBuild(targetGUID, project.AddFile("/usr/lib/libc++.tbd", "Frameworks/libc++.tbd", PBXSourceTree.Sdk));
        project.AddFileToBuild(targetGUID, project.AddFile("/usr/lib/libiconv.tbd", "Frameworks/libiconv.tbd", PBXSourceTree.Sdk));
        project.AddFileToBuild(targetGUID, project.AddFile("/usr/lib/libresolv.tbd", "Frameworks/libresolv.tbd", PBXSourceTree.Sdk));
        project.AddFileToBuild(fwTargetGUID, project.AddFile("/usr/lib/libz.tbd", "Frameworks/libz.tbd", PBXSourceTree.Sdk));
        project.AddFileToBuild(fwTargetGUID, project.AddFile("/usr/lib/libsqlite3.tbd", "Frameworks/libsqlite3.tbd", PBXSourceTree.Sdk));
        project.AddFileToBuild(fwTargetGUID, project.AddFile("/usr/lib/libc++.tbd", "Frameworks/libc++.tbd", PBXSourceTree.Sdk));
        project.AddFileToBuild(fwTargetGUID, project.AddFile("/usr/lib/libiconv.tbd", "Frameworks/libiconv.tbd", PBXSourceTree.Sdk));
        project.AddFileToBuild(fwTargetGUID, project.AddFile("/usr/lib/libresolv.tbd", "Frameworks/libresolv.tbd", PBXSourceTree.Sdk));
        //UnityFramework
        project.AddBuildProperty(fwTargetGUID, "OTHER_LDFLAGS", "-ObjC");
@@ -106,9 +90,6 @@
        _rootDict.SetString("NSMicrophoneUsageDescription", "使用麦克风权限");
        _rootDict.SetString("NSPhotoLibraryAddUsageDescription", "使用相册权限,用以存储截屏的账号信息,以防忘记账号密码");
        _rootDict.SetString("YLChannelId", "1000");
        _rootDict.SetString("YLPlatformId", "1000");
        File.WriteAllText(_plistPath, _plist.WriteToString());
    }
@@ -128,8 +109,14 @@
        newCode = "\n" +
                "    _universalSDK = [[UniversalSDK alloc] init];\n    [_universalSDK QuickSDKInit:application didFinishLaunchingWithOptions:launchOptions];";
        _xclass.WriteBelow("[KeyboardDelegate Initialize];", newCode);
        newCode = "\n" +
            "if([SMPCQuickSDK defaultInstance].channelType == 39 ||[SMPCQuickSDK defaultInstance].channelType == 1803 ){\n" +
            "return [[SMPCQuickSDK defaultInstance] application: application supportedInterfaceOrientationsForWindow:window];}\n" +
            "else {\n" +
            "[[SMPCQuickSDK defaultInstance] application: application supportedInterfaceOrientationsForWindow:window];}\n";
        //quick sdk 生命周期
        _xclass.WriteBelow("supportedInterfaceOrientationsForWindow:(UIWindow*)window\n{", "[[SMPCQuickSDK defaultInstance] application:application supportedInterfaceOrientationsForWindow:window];");
        _xclass.WriteBelow("supportedInterfaceOrientationsForWindow:(UIWindow*)window\n{", newCode);
        _xclass.WriteBelow("UnitySendRemoteNotification(userInfo);", "[[SMPCQuickSDK defaultInstance] application:application didReceiveRemoteNotification:userInfo];");
        _xclass.WriteBelow("UnitySendDeviceToken(deviceToken);", "[[SMPCQuickSDK defaultInstance] application:application didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];");
        _xclass.WriteBelow("UnitySendRemoteNotificationError(error);", "[[SMPCQuickSDK defaultInstance] application:application didFailToRegisterForRemoteNotificationsWithError:error];");