示例#1
0
    //修正PList
    static void EditorPlist(string filePath)
    {
        XCPlist list    = new XCPlist(filePath);
        string  bundle  = "com.afeiyingyou.dragonball";
        string  appname = "七龙珠";


        string PlistAdd = @"
			<key>UIViewControllerBasedStatusBarAppearance</key>
			<false/>
			<key>NSLocationWhenInUseDescription</key>
			<string>YES</string>
			<key>NSLocationAlwaysUsageDescription</key>
			<string>YES</string>"            ;

        //在plist里面增加一行
        list.AddKey(PlistAdd);

        list.ReplaceKey("<string>dragonball</string>", "<string>" + appname + "</string>");

        //在plist里面替换Bundle ID
        list.ReplaceKey("<string>com.afeiyingyou.${PRODUCT_NAME}</string>", "<string>" + bundle + "</string>");
        //保存
        list.Save();
    }
示例#2
0
    private static void EditorPlist(string filePath)
    {
        XCPlist list     = new XCPlist(filePath);
        string  PlistAdd = @"
            <key>CFBundleIdentifier</key>
            <string>com.scbczx.luckystar</string>
			<key>XUPORTER</key>
			<string>XUPorter XCodePostProcess Add</string>
			<key>CFBundleDisplayName</key>
			<string>掌上游乐场</string>
			<key>CFBundleURLTypes</key>
			<array>
				<dict>
					<key>CFBundleTypeRole</key>
					<string>Editor</string>
					<key>CFBundleURLName</key>
					<string>wechat</string>
					<key>CFBundleURLSchemes</key>
					<array>
						<string>wx801def83edbb80a3</string>
					</array>
				</dict>
				<dict>
					<key>CFBundleTypeRole</key>
					<string>Editor</string>
					<key>CFBundleURLName</key>
					<string></string>
					<key>CFBundleURLSchemes</key>
					<array>
						<string>com.scbczx.luckystar</string>
					</array>
				</dict>
			</array>
			<key>LSApplicationQueriesSchemes</key>
			<array>
				<string>weixin</string>
				<string>wechat</string>
			</array>
			<key>NSAppTransportSecurity</key>
			<dict>
				<key>NSAllowsArbitraryLoads</key>
				<true/>
			</dict>	
			<key>NSLocationAlwaysUsageDescription</key>
			<string>若允许,“个人信息”面板中将显示精准的位置信息;否则,“个人信息”面板中的位置信息可能有误</string>
			<key>NSLocationUsageDescription</key>
			<string>若允许,“个人信息”面板中将显示精准的位置信息;否则,“个人信息”面板中的位置信息可能有误</string>
			<key>NSLocationWhenInUseUsageDescription</key>
			<string>若允许,“个人信息”面板中将显示精准的位置信息;否则,“个人信息”面板中的位置信息可能有误</string>
			<key>NSMicrophoneUsageDescription</key>
			<string>microphoneDesciption</string>
			"            ;

        list.AddKey(PlistAdd);
        list.ReplaceKey("<string>en</string>", "<string>zh_CN</string>");
        list.ReplaceKey("<string>Hydra</string>", "<string>????</string>");
        list.ReplaceKey("<string>0.0.0</string>", "<string>0.0.0</string>");
        list.ReplaceKey("<string>1.0</string>", "<string>0</string>");
        list.Save();
    }
示例#3
0
    private static void EditorPlist(string filePath)
    {
        XCPlist list   = new XCPlist(filePath);
        string  bundle = "com.yusong.momo";

        string PlistAdd = @"  
            <key>CFBundleURLTypes</key>
            <array>
            <dict>
            <key>CFBundleTypeRole</key>
            <string>Editor</string>
            <key>CFBundleURLIconFile</key>
            <string>Icon@2x</string>
            <key>CFBundleURLName</key>
            <string>" + bundle + @"</string>
            <key>CFBundleURLSchemes</key>
            <array>
            <string>ww123456</string>
            </array>
            </dict>
            </array>";

        //在plist里面增加一行
        list.AddKey(PlistAdd);
        //在plist里面替换一行
        list.ReplaceKey("<string>com.yusong.${PRODUCT_NAME}</string>", "<string>" + bundle + "</string>");
        //保存
        list.Save();
    }
示例#4
0
    private static void EditorPlist(string filePath)
    {
        XCPlist list   = new XCPlist(filePath);
        string  bundle = "com.ema.SSWWIOS";

        string PlistAdd = @"  
            <key>CFBundleURLTypes</key>
            <array>
            <dict>
            <key>CFBundleTypeRole</key>
            <string>Editor</string>
            <key>CFBundleURLIconFile</key>
            <string>Icon@2x</string>
            <key>CFBundleURLName</key>
            <string>" + bundle + @"</string>
            <key>CFBundleURLSchemes</key>
            <array>
            <string>ww123456</string>
            </array>
            </dict>
            </array>";

        list.AddKey(PlistAdd);
        list.ReplaceKey("<string>com.koramgame.${PRODUCT_NAME}</string>", "<string>" + bundle + "</string>");
        //淇濆瓨
        list.Save();
    }
示例#5
0
    private static void ConfigXcodeProject(string projectPath)
    {
        string    projectname = projectPath + "/" + CN_APP_NAME + "/Unity-iPhone.xcodeproj";
        string    plistPath   = Path.GetFullPath(projectname);
        XCProject project     = new XCProject(projectname);

        string[] files = Directory.GetFiles(Path.Combine(Application.dataPath, "Plugins/iOSProjectMods"), "*.projmods", SearchOption.AllDirectories);
        {
            var __array1       = files;
            var __arrayLength1 = __array1.Length;
            for (int __i1 = 0; __i1 < __arrayLength1; ++__i1)
            {
                var file = (string)__array1[__i1];
                {
                    project.ApplyMod(file);
                }
            }
        }
        project.overwriteBuildSetting("GCC_ENABLE_CPP_EXCEPTIONS", "YES", "Release");
        project.overwriteBuildSetting("GCC_ENABLE_OBJC_EXCEPTIONS", "YES", "Release");
        project.overwriteBuildSetting("GCC_ENABLE_CPP_RTTI", "YES", "Release");
        project.overwriteBuildSetting("ENABLE_BITCODE", "NO", "Release");

        project.overwriteBuildSetting("GCC_ENABLE_CPP_EXCEPTIONS", "YES", "Debug");
        project.overwriteBuildSetting("GCC_ENABLE_OBJC_EXCEPTIONS", "YES", "Debug");
        project.overwriteBuildSetting("GCC_ENABLE_CPP_RTTI", "YES", "Debug");
        project.overwriteBuildSetting("ENABLE_BITCODE", "NO", "Debug");

        //debug generate dSYM
        project.overwriteBuildSetting("DEBUG_INFORMATION_FORMAT", "dwarf-with-dsym", "Debug");

        plistPath = Path.Combine(projectPath + "/" + CN_APP_NAME, "info.plist");
        XCPlist list = new XCPlist(plistPath);

        list.ReplaceKey("<string>en</string>", "<string>zh_CN</string>");

        string plistAdd = @"	
	<key>NSAppTransportSecurity</key>
	<dict>
		<key>NSAllowsArbitraryLoads</key>
		<true/>
	</dict>
	<key>LSApplicationQueriesSchemes</key>
	<array>
		<string>sinaweibo</string>
		<string>sinaweibohd</string>
		<string>sinaweibosso</string>
		<string>sinaweibohdsso</string>
		<string>weibosdk</string>
		<string>weibosdk2.5</string>
		<string>wechat</string>
		<string>weixin</string>
		<string>fbauth2</string>
	</array>
	<key>CFBundleURLTypes</key>
	<array>
		<dict>
			<key>CFBundleTypeRole</key>
			<string>Editor</string>
			<key>CFBundleURLSchemes</key>
			<array>
				<string>wb568898243</string>
			</array>
		</dict>
		<dict>
			<key>CFBundleTypeRole</key>
			<string>Editor</string>
			<key>CFBundleURLSchemes</key>
			<array>
				<string>wx4868b35061f87885</string>
			</array>
		</dict>
	</array>"    ;


        list.AddKey(plistAdd);
        list.Save();
        project.Save();

        CopyLunchImage(projectPath);
    }