Exemplo n.º 1
0
    public static void OnPostProcessBuild(BuildTarget buildTarget, string pathToBuiltProject)
    {
        if (buildTarget == BuildTarget.iOS)
        {
            Debug.Log("Add URL SCHEME TO IOS");

            // Get plist
            string plistPath = pathToBuiltProject + "/Info.plist";

            // read plist
            Dictionary <string, object> dict;
            dict = (Dictionary <string, object>)Plist.readPlist(plistPath);

            // update plist
            dict["CFBundleURLTypes"] = new List <object> {
                new Dictionary <string, object> {
                    { "CFBundleURLName", "com.george.pmmap.url_scheme" },
                    { "CFBundleURLSchemes", new List <object> {
                          "pmmap"
                      } }
                }
            };

            // write plist
            Plist.writeXml(dict, plistPath);
        }
    }
Exemplo n.º 2
0
        public void Move()
        {
            Point last = Plist.Last();
            Point head = new Point(Plist.First().X, Plist.First().Y, Plist.First().Symbol);

            switch (D)
            {
            case Direction.UP:
                Plist.Insert(1, head);
                --Plist.First().Y;
                Plist.First().Draw();
                break;

            case Direction.LEFT:
                Plist.Insert(1, head);
                --Plist.First().X;
                Plist.First().Draw();
                break;

            case Direction.RIGHT:
                Plist.Insert(1, head);
                ++Plist.First().X;
                Plist.First().Draw();
                break;

            case Direction.DOWN:
                Plist.Insert(1, head);
                ++Plist.First().Y;
                Plist.First().Draw();
                break;
            }
            Plist.Last().Clear();
            Plist.Remove(last);
        }
Exemplo n.º 3
0
        public bool NextStepWithFood(Point p)
        {
            switch (D)
            {
            case Direction.UP:
                if (Plist.First().X == p.X && Plist.First().Y - 1 == p.Y)
                {
                    return(true);
                }
                break;

            case Direction.LEFT:
                if (Plist.First().X - 1 == p.X && Plist.First().Y == p.Y)
                {
                    return(true);
                }
                break;

            case Direction.RIGHT:
                if (Plist.First().X + 1 == p.X && Plist.First().Y == p.Y)
                {
                    return(true);
                }
                break;

            case Direction.DOWN:
                if (Plist.First().X == p.X && Plist.First().Y + 1 == p.Y)
                {
                    return(true);
                }
                break;
            }
            return(false);
        }
Exemplo n.º 4
0
 public void Eat(Point p)
 {
     Plist.Insert(0, new Point(p.X, p.Y, 'o'));
     Plist.First().Draw();
     Lenght++;
     Console.Title = $"Счет: {Lenght}";
 }
Exemplo n.º 5
0
    public static void OnPostprocessBuild(BuildTarget target, string pathToBuiltProject)
    {
        if (target == BuildTarget.iOS)
        {
            // set plist path
            string plistPath = pathToBuiltProject + "/info.plist";

            // read plist
            Dictionary <string, object> dict;
            dict = (Dictionary <string, object>)Plist.readPlist(plistPath);

            dict.Add("NSCameraUsageDescription", "Use camera for QR code");

            /*
             * // update plist
             * dict["CFBundleURLTypes"] = new List<object> {
             *      new Dictionary<string,object> {
             *              { "CFBundleURLName", PlayerSettings.iPhoneBundleIdentifier },
             *              { "CFBundleURLSchemes", new List<object> { "fategoar" } }
             *      }
             * };
             *
             * //Push run in background
             * dict["UIBackgroundModes"] = new List<object>{
             * "remote-notification"
             * };
             *
             * //Push run in background
             * dict["CFBundleDisplayName"] = "Fate/GO AR";
             */

            // write plist
            Plist.writeXml(dict, plistPath);
        }
    }
        public static void bplist_to_xml(string bplist, string xml)
        {
            Dictionary <string, object> dictionary = (Dictionary <string, object>)Plist.readPlist(bplist);

            Plist.writeXml(dictionary, xml);
            dictionary.Clear();
        }
Exemplo n.º 7
0
    public void Plist_Binary_TEST()
    {
        Xorshift random = new Xorshift(Seed);

        // Trailer
        for (int i = 0; i < 100000; ++i)
        {
            var trailer = new Plist.Trailer();
            trailer.ShortVersion      = (byte)(random.Generate() & 0xFF);
            trailer.OffsetIntSize     = (byte)(random.Generate() & 0xFF);
            trailer.ObjectRefSize     = (byte)(random.Generate() & 0xFF);
            trailer.NumObjects        = (ulong)random.Generate() | ((ulong)random.Generate() << 32);
            trailer.TopObject         = (ulong)random.Generate() | ((ulong)random.Generate() << 32);
            trailer.OffsetTableOffset = (ulong)random.Generate() | ((ulong)random.Generate() << 32);

            var ms = new MemoryStream();
            Plist.WriteTrailerBinary(ms, trailer);
            var read = Plist.ReadTrailerBinary(ms.ToArray());
            Assert.AreEqual(trailer.GetHashCode(), read.GetHashCode());
            Assert.AreEqual(trailer, read);
        }

        for (int i = 0; i < 5000; ++i)
        {
            object value1 = Arbitrary.Plist();
            var    data   = Plist.WriteObjectBinary(value1);
            object value2 = Plist.ReadObjectBinary(data);
            Assert.IsTrue(Plist.EqualObject(value1, value2, 1.0e-9, 1.0e-3), string.Format("serialize error [{0}]", i));
        }
    }
Exemplo n.º 8
0
 public void Clear()
 {
     Plist.Clear();
     Type  = 1;
     Line  = 1;
     Index = 0;
 }
Exemplo n.º 9
0
 public HorizontalLine(int x, int y, char symbol, int lenght) : base(x, y, symbol, lenght)
 {
     for (int i = 0; i <= lenght; i++)
     {
         Plist.Add(new Point(x++, y, symbol));
     }
 }
Exemplo n.º 10
0
    static void EdittingInfoPlist(string plistPath)
    {
        // plist 읽기.
        var plst = (Dictionary <string, object>)Plist.readPlist(plistPath);

        // App Icon 설정.
        var CFBundleIconFiles = (List <object>)plst["CFBundleIconFiles"];

        CFBundleIconFiles.Add(PlistValue.APP_ICON_76);
        CFBundleIconFiles.Add(PlistValue.APP_ICON_120);
        CFBundleIconFiles.Add(PlistValue.APP_ICON_152);

        // URL scheme 설정.
        plst["CFBundleURLTypes"] = new List <object> {
            new Dictionary <string, object> {
                { "CFBundleTypeRole", PlistValue.URL_TYPE_ROLE_NONE },
                { "CFBundleURLName", PlistValue.URL_TYPE_ID },
                { "CFBundleURLSchemes", new List <object> {
                      PlistValue.URL_TYPE_ID
                  } },
            }
        };

        // plist 덮어 씌우기
        Plist.writeXml(plst, plistPath);
    }
Exemplo n.º 11
0
        private static void ExecutePostProcessAction(string buildPath)
        {
            // Load plist
            string _infoPlistFilePath = GetInfoPlistFilePath(buildPath);

            infoPlist = Plist.LoadPlistAtPath(_infoPlistFilePath);

            // Prepare project
            CleanupProject();
            CreateTempFolder();

            Features _supportedFeatures = NPSettings.Application.SupportedFeatures;

            if (_supportedFeatures.UsesTwitter)
            {
                DecompressTwitterSDKFiles();
            }

            if (_supportedFeatures.UsesBilling)
            {
                AddBuildInfoToBillingClass();
            }

            // execute actions specific to features used within app
            GenerateXcodeModFiles();
            UpdateInfoPlist(buildPath);
            ModifyPchFile(buildPath);

            // release properties
            infoPlist = null;
        }
Exemplo n.º 12
0
        static IDictionary <string, object> RetrieveFromMac()
        {
            var playerPrefsPath = PlayerPrefsPathForMac();

            if (!File.Exists(playerPrefsPath))
            {
                return(new Dictionary <string, object>());
            }

            // Parse the plist then cast it to a Dictionary
            object plist = Plist.readPlist(playerPrefsPath);
            Dictionary <string, object> parsed = plist as Dictionary <string, object>;

            Dictionary <string, object> result = new Dictionary <string, object>();

            foreach (KeyValuePair <string, object> pair in parsed)
            {
                // Some float values may come back as double, so convert them back to floats
                if (pair.Value is double)
                {
                    result.Add(pair.Key, PlayerPrefs.GetFloat(pair.Key));
                }
                else
                {
                    result.Add(pair.Key, pair.Value);
                }
            }
            return(result);
        }
Exemplo n.º 13
0
        //////////////////////////////////////////////////////////////////////////////

        public bool Load()
        {
            lock (this)
            {
                try
                {
                    if (m_path == null)
                    {
                        Log.e("Can't load settings: path is null");
                        return(false);
                    }

                    if (FileUtils.FileExists(m_path))
                    {
                        m_data = Plist.readPlist(m_path) as Dictionary <string, object>;
                        return(true);
                    }
                }
                catch (Exception e)
                {
                    Log.error(e, "Can't read settings: {0}", m_path);
                }

                m_data = new Dictionary <string, object>();
                return(false);
            }
        }
Exemplo n.º 14
0
        public static void Save(string path, IEnumerable <ConnectionEntry> list)
        {
            var computers   = new List <ComputerInfo>();
            var credentials = new List <CredentialsInfo>();
            var webServices = new List <WebServiceInfo>();

            var usedCredentials = new Dictionary <CredentialsInfo, int>();
            var usedWebServices = new Dictionary <WebServiceInfo, int>();

            foreach (var item in list)
            {
                var cred = new CredentialsInfo()
                {
                    userName = item.UserName
                };
                var ws = new WebServiceInfo()
                {
                    url = item.WebServiceURL
                };

                if (!usedCredentials.ContainsKey(cred))
                {
                    credentials.Add(cred);
                    usedCredentials.Add(cred, usedCredentials.Count);
                }

                if (!usedWebServices.ContainsKey(ws))
                {
                    webServices.Add(ws);
                    usedWebServices.Add(ws, usedWebServices.Count);
                }

                var comp = new ComputerInfo()
                {
                    displayName      = item.Description,
                    hostName         = item.HostName,
                    authentication   = item.UseCredSSP ? 4 : 0,
                    executionPolicy  = item.ExecutionPolicy,
                    group            = item.GroupName,
                    startupScript    = item.StartupScript,
                    showAvailability = item.ShowAvailability,
                    credentialsIndex = usedCredentials[cred],
                    webServiceIndex  = usedWebServices[ws]
                };

                computers.Add(comp);
            }

            var data = new WinRMXFileStruct()
            {
                version     = "1.9", // compatible version
                computers   = computers,
                credentials = credentials,
                webServices = webServices
            };

            var plist = JsonConvert.DeserializeObject <Dictionary <string, object> >(JsonConvert.SerializeObject(data));

            File.WriteAllBytes(path, Compress(Encoding.UTF8.GetBytes(Plist.writeXml(plist))));
        }
Exemplo n.º 15
0
        private static string InitiateAsk(string userName, string computerName, UriBuilder uriBuilder)
        {
            uriBuilder.Path = "/ods-ask";

            HttpWebRequest wreq = (HttpWebRequest)WebRequest.Create(uriBuilder.Uri);

            wreq.Method = "POST";

            Dictionary <string, object> req = new Dictionary <string, object>();

            req["askDevice"] = string.Empty;
            req["computer"]  = computerName;
            req["user"]      = userName;

            using (Stream outStream = wreq.GetRequestStream())
                using (StreamWriter w = new StreamWriter(outStream, Encoding.UTF8))
                {
                    Plist.Write(outStream, req);
                }

            string      askId;
            WebResponse wrsp = wreq.GetResponse();

            using (Stream inStream = wrsp.GetResponseStream())
            {
                Dictionary <string, object> plist = Plist.Parse(inStream);
                askId = ((int)plist["askID"]).ToString();
            }

            return(askId);
        }
Exemplo n.º 16
0
        public void CanParseCarOutput()
        {
            const string input = @"<?xml version=""1.0"" encoding=""UTF-8""?>
<!DOCTYPE plist PUBLIC ""-//Apple//DTD PLIST 1.0//EN"" ""http://www.apple.com/DTDs/PropertyList-1.0.dtd"">
<plist version=""1.0"">
<dict>
    <key>com.apple.actool.compilation-results</key>
    <dict>
        <key>output-files</key>
        <array>
            <string>/var/folders/d2/6gjz1w057hzgs1fktks2r6000000gp/T/a18844708d9944bca2160809039462a3/Assets.car</string>
        </array>
    </dict>
</dict>
</plist>";
            var          plist = Plist.ReadFromString(input);
            var          dict  = plist.root["com.apple.actool.compilation-results"];

            Assert.NotNull(dict);

            var outputFiles = dict["output-files"].AsArray();

            Assert.AreEqual(1, outputFiles.Length);
            Assert.AreEqual("/var/folders/d2/6gjz1w057hzgs1fktks2r6000000gp/T/a18844708d9944bca2160809039462a3/Assets.car", outputFiles[0].AsString());
        }
Exemplo n.º 17
0
    private void Export(bool onlySelected)
    {
        Dictionary <string, object> entries = new Dictionary <string, object>();

        for (int i = 0; i < filteredPpeList.Count; i++)
        {
            if (onlySelected == false)
            {
                entries.Add(this.filteredPpeList[i].Key, this.filteredPpeList[i].Value);
            }
            else if (this.filteredPpeList[i].IsSelected)
            {
                entries.Add(this.filteredPpeList[i].Key, this.filteredPpeList[i].Value);
            }
        }

        if (onlySelected && entries.Count == 0)
        {
            Debug.Log("Cannot export selected entries as no entries has been selected");
        }
        else
        {
            string exportPath = EditorUtility.SaveFilePanelInProject("Export all PlayerPrefs entries", PlayerSettings.productName +
                                                                     "_PlayerPrefs", "ppe", "Export all PlayerPrefs entries");

            if (!string.IsNullOrEmpty(exportPath))
            {
                string xml = Plist.writeXml(entries);
                File.WriteAllText(exportPath, xml);
                AssetDatabase.Refresh();
            }
        }
    }
Exemplo n.º 18
0
        public bool Save()
        {
            lock (this)
            {
                try
                {
                    if (m_path == null)
                    {
                        Log.e("Can't save settings: path is null");
                        return(false);
                    }

                    using (Stream stream = FileUtils.OpenWrite(m_path))
                    {
                        Plist.writeBinary(m_data, stream);
                        return(true);
                    }
                }
                catch (Exception e)
                {
                    Log.error(e, "Can't save settings: {0}", m_path);
                    return(false);
                }
            }
        }
Exemplo n.º 19
0
    private void OnImport()
    {
        string importPath = EditorUtility.OpenFilePanel("Import PlayerPrefs", "", "ppe");

        if (!string.IsNullOrEmpty(importPath))
        {
            FileInfo fi = new FileInfo(importPath);
            Dictionary <string, object> plist = (Dictionary <string, object>)Plist.readPlist(fi.FullName);
            foreach (KeyValuePair <string, object> kvp in plist)
            {
                PlayerPrefsEntry entry = null;
                if (kvp.Value is float)
                {
                    entry = new PlayerPrefsEntry(kvp.Key, (float)kvp.Value);
                }
                else if (kvp.Value is int)
                {
                    entry = new PlayerPrefsEntry(kvp.Key, (int)kvp.Value);
                }
                else if (kvp.Value is string)
                {
                    entry = new PlayerPrefsEntry(kvp.Key, (string)kvp.Value);
                }
                if (entry != null)
                {
                    ppeList.Add(entry);
                    entry.SaveChanges();
                }
            }
            Sort();
            Repaint();
        }
    }
Exemplo n.º 20
0
    private static Dictionary <string, object> GetMacPrefs()
    {
        string prefsFileName = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal)
                               + "/Library/Preferences/unity."
                               + PlayerSettings.companyName + "."
                               + PlayerSettings.productName + ".plist";

        Dictionary <string, object> plist;

        try
        {
            plist = Plist.createDictionaryFromBinaryFile(prefsFileName);
        }
        catch (System.Exception eouter)
        {
            Debug.Log("Couldn't read binary prefs: " + eouter.ToString());
            try
            {
                plist = Plist.createDictionaryFromXmlFile(prefsFileName);
            }
            catch (System.Exception einner)
            {
                Debug.Log("Couldn't read xml prefs: " + einner.ToString());
                return(null);
            }
        }
        return(plist);
    }
Exemplo n.º 21
0
        public static void OnPostProcessBuild(BuildTarget buildTarget, string path)
        {
            if (buildTarget == BuildTarget.iOS)
            {
                // set plist path
                string projectPath = path + "/Unity-iPhone.xcodeproj/project.pbxproj";
                string plistPath   = path + "/info.plist";

                // read plist
                Dictionary <string, object> dict;
                dict = (Dictionary <string, object>)Plist.readPlist(plistPath);

                // update plist
                dict["CFBundleURLTypes"] = new List <object> {
                    new Dictionary <string, object> {
                        { "CFBundleURLName", PlayerSettings.iPhoneBundleIdentifier },
                        { "CFBundleURLSchemes", new List <object> {
                              PlayerSettings.iPhoneBundleIdentifier
                          } }
                    }
                };

                // write plist
                Plist.writeXml(dict, plistPath);
            }
        }
Exemplo n.º 22
0
        public static List <ConnectionEntry> Load(string path)
        {
            var plist = Plist.readPlist(Decompress(File.ReadAllBytes(path)));

            // map dictionary to object using JsonConvert
            var data = JsonConvert.DeserializeObject <WinRMXFileStruct>(JsonConvert.SerializeObject(plist));

            var result = new List <ConnectionEntry>();

            foreach (var comp in data.computers)
            {
                var entry = new ConnectionEntry()
                {
                    Description      = comp.displayName,
                    HostName         = comp.hostName,
                    WebServiceURL    = data.webServices[comp.webServiceIndex].url,
                    ExecutionPolicy  = comp.executionPolicy,
                    GroupName        = comp.group,
                    StartupScript    = comp.startupScript,
                    UseCredSSP       = comp.authentication == 4,
                    UserName         = data.credentials[comp.credentialsIndex].userName,
                    ShowAvailability = comp.showAvailability
                };

                result.Add(entry);
            }

            return(result);
        }
Exemplo n.º 23
0
        public Snake(int xhead, int yhead, char symbol, int lenght, Direction d) : base(xhead, yhead, symbol, lenght)
        {
            D = d;
            switch (D)
            {
            case Direction.UP:
                for (int i = 0; i < lenght; i++)
                {
                    Plist.Add(new Point(xhead, yhead++, symbol));
                }
                break;

            case Direction.LEFT:
                for (int i = 0; i < lenght; i++)
                {
                    Plist.Add(new Point(xhead++, yhead, symbol));
                }
                break;

            case Direction.RIGHT:
                for (int i = 0; i < lenght; i++)
                {
                    Plist.Add(new Point(xhead--, yhead, symbol));
                }
                break;

            case Direction.DOWN:
                for (int i = 0; i < lenght; i++)
                {
                    Plist.Add(new Point(xhead, yhead--, symbol));
                }
                break;
            }
        }
Exemplo n.º 24
0
    private static void UpdatePlist(string path)
    {
        const string fileName = "Info.plist";
        string       fullPath = Path.Combine(path, fileName);

        Dictionary <string, object> dict;

        dict = (Dictionary <string, object>)Plist.readPlist(fullPath);

        dict["CFBundleURLTypes"] = new List <object> {
            new Dictionary <string, object> {
                { "CFBundleURLName", "vk-sdk" },
                { "CFBundleURLSchemes", new List <object> {
                      "vk6227224"
                  } }
            },
            new Dictionary <string, object> {
                { "CFBundleURLName", "com.FinnAndJake.GogoGosha" },
                { "CFBundleURLSchemes", new List <object> {
                      "goshaapp"
                  } }
            }
        };

        Plist.writeXml(dict, fullPath);
    }
Exemplo n.º 25
0
    public void Plist_OSXCompatibilityTEST()
    {
        var path = Path.Combine(Application.streamingAssetsPath, "tmp.plist");

        for (int i = 0; i < 100; ++i)
        {
            object value1 = Arbitrary.Plist(3);

            var bytes = Plist.WriteObjectBinary(value1);
            File.WriteAllBytes(path, bytes);

            OSXPlist.ConvertToXml(path);
            OSXPlist.ConvertToBinary(path);

            bytes = File.ReadAllBytes(path);
            File.Delete(path);

            var value2 = Plist.ReadObjectBinary(bytes);

            // because of xml serialization, lost milisecond acculacy...
            Assert.IsTrue(Plist.EqualObject(value1, value2, 1.0e-9, 1.5), string.Format("serialize error [{0}]", i));
        }

        for (int i = 0; i < 100; ++i)
        {
            object value1 = Arbitrary.Plist(3);

            var bytes = Plist.WriteObjectBinary(value1);
            File.WriteAllBytes(path, bytes);

            OSXPlist.ConvertToXml(path);

            bytes = File.ReadAllBytes(path);
            File.Delete(path);

            var value2 = Plist.ReadObjectXML(bytes);

            // because of xml serialization, lost milisecond acculacy...
            Assert.IsTrue(Plist.EqualObject(value1, value2, 1.0e-9, 1.5), string.Format("serialize error [{0}]", i));
        }

        for (int i = 0; i < 100; ++i)
        {
            object value1 = Arbitrary.Plist(3);

            var bytes = Plist.WriteObjectXML(value1);
            File.WriteAllBytes(path, bytes);

            OSXPlist.ConvertToBinary(path);

            bytes = File.ReadAllBytes(path);
            File.Delete(path);

            var value2 = Plist.ReadObjectBinary(bytes);

            // because of xml serialization, lost milisecond acculacy...
            Assert.IsTrue(Plist.EqualObject(value1, value2, 1.0e-9, 1.5), string.Format("serialize error [{0}]", i));
        }
    }
Exemplo n.º 26
0
 public override void Save()
 {
     if (PlistPath == null)
     {
         throw new InvalidOperationException("未指定需要保存到的plist文件路径(PlistPath属性)");
     }
     Plist.writeXml(Dict, PlistPath);
 }
Exemplo n.º 27
0
        static private void WritePrefs(List <object> prefs)
        {
            Dictionary <string, object> plist = new Dictionary <string, object>();

            plist["PreferenceSpecifiers"] = prefs;
            plist.Add("StringsTable", "Root");
            Plist.writeXml(plist, "Assets/Build/iOS/.Native/Settings.bundle/Root.plist");
        }
Exemplo n.º 28
0
        public static void FixSimulator(string path)
        {
            string fullPath = Path.Combine(path, Path.Combine("Libraries", "RegisterMonoModules.cpp"));
            string data     = Load(fullPath);


            data = Regex.Replace(data, @"\s+void\s+mono_dl_register_symbol\s+\(const\s+char\*\s+name,\s+void\s+\*addr\);", "");
            data = Regex.Replace(data, "typedef int gboolean;", "typedef int gboolean;\n\tvoid mono_dl_register_symbol (const char* name, void *addr);");

            //this only need to be done for unity 4, unity 5 declares user functions correctly
            if (GetUnityVersionNumber() < 500)
            {
                data = Regex.Replace(data,
                                     @"#endif\s+//\s*!\s*\(\s*TARGET_IPHONE_SIMULATOR\s*\)\s*}\s*void RegisterAllStrippedInternalCalls\s*\(\s*\)",
                                     "}\n\nvoid RegisterAllStrippedInternalCalls()");
                data = Regex.Replace(data,
                                     @"mono_aot_register_module\(mono_aot_module_mscorlib_info\);",
                                     "mono_aot_register_module(mono_aot_module_mscorlib_info);\n#endif // !(TARGET_IPHONE_SIMULATOR)");
            }
            Save(fullPath, data);
            fullPath = Path.Combine(path, Path.Combine("Classes", "UnityAppController.mm"));
            data     = Load(fullPath);

            data = Regex.Replace(data, @"AppController_SendNotificationWithArg\(kUnityOnOpenURL, notifData\);\n",
                                 " AppController_SendNotificationWithArg(kUnityOnOpenURL, notifData);\n\t[VKSdk processOpenURL:url fromApplication:sourceApplication];\n");

            data = Regex.Replace(data, @"#include\s" + "\"PluginBase/AppDelegateListener.h\"",
                                 " #include \"PluginBase/AppDelegateListener.h\"\n#include \"VKSDK/VKSdk.h\"");

            Save(fullPath, data);
            fullPath = Path.Combine(path, "Info.plist");
            Dictionary <string, object> dict = (Dictionary <string, object>)Plist.readPlist(fullPath);


            var urltipe = new Dictionary <string, object> ();

            urltipe.Add("CFBundleTypeRole", "Editor");
            urltipe.Add("CFBundleURLName", "vk" + PlayerPrefs.GetString("appid", ""));
            urltipe.Add("CFBundleURLSchemes", new List <object> {
                "vk" + PlayerPrefs.GetString("appid", "")
            });
            var listofurltipe = new List <object> {
                urltipe
            };
            object cfbundleurltypes;

            if (dict.TryGetValue("CFBundleURLTypes", out cfbundleurltypes))
            {
                var _urltypes = (List <object>)cfbundleurltypes;
                _urltypes.AddRange(listofurltipe);
            }
            else
            {
                dict.Add("CFBundleURLTypes", listofurltipe);
            }
            Plist.writeXml(dict, fullPath);
        }
Exemplo n.º 29
0
    void Start()
    {
        var bytes_binary = Plist.WriteObjectBinary(Arbitrary.Plist());

        File.WriteAllBytes(Path.Combine(Application.streamingAssetsPath, "arbitrary-binary.plist"), bytes_binary);
        var bytes_xml = Plist.WriteObjectXML(Arbitrary.Plist());

        File.WriteAllBytes(Path.Combine(Application.streamingAssetsPath, "arbitrary-xml.plist"), bytes_xml);
    }
Exemplo n.º 30
0
        HttpResponse getPlaybackInfo()
        {
            Logger.Debug("Airplay Session: Playback info requested");
            PlaybackInfoEventArgs e = new PlaybackInfoEventArgs(SessionId);

            OnPlaybackInfoRequested(e);
            Logger.Debug("Airplay Session: Playback Info\r\n'{0}'", Plist.writeXml(e.PlaybackInfo.GetPlist()));
            return(getPlistResponse(e.PlaybackInfo));
        }
Exemplo n.º 31
0
		private void LoadPlistAtPath ()
		{
			if (string.IsNullOrEmpty(m_input))
			{
				m_result	= "Failed to load plist";
				return;
			}

			// Load plist
			m_plist		= Plist.LoadPlistAtPath(m_input);			

			// Result
			m_result	= "Plist=" + JSONUtility.ToJSON(m_plist);
		}
Exemplo n.º 32
0
 private void iDevice_Connected(object sender, ConnectEventArgs e)
 {
     if (new[] { "iPhone1,1", "iPhone1,2", "iPhone2,1", "iPod1,1", "iPod2,1", "iPod3,1" }.Contains(iDevice.DeviceProductType) || iDevice.DeviceProductType.StartsWith("iPad", true, System.Globalization.CultureInfo.CreateSpecificCulture("en")))
         lblPlug.Text = "An iDevice has been plugged in!\r\nHowever, Jaku Theme does not support your device yet!";
     else if (!iDevice.IsJailbreak)
         lblPlug.Text = "Your iDevice must be jailbroken in order to install custom themes!";
     else
     {
         this.Invoke((MethodInvoker)delegate
         {
             lblPlug.Visible = false;
             wBrowser.Visible = true;
             btnBrowse.Enabled = true;
             btnRespring.Enabled = true;
             txtSearch.Enabled = true;
             // User Apps
             foreach (var dir in iDevice.GetDirectories("/var/mobile/Applications"))
                 foreach (var dir2 in iDevice.GetDirectories("/var/mobile/Applications/" + dir))
                     if (dir2.EndsWith(".app"))
                     {
                         string finalPath = "/var/mobile/Applications/" + dir + "/" + dir2;
                         getFile(finalPath + "/Info.plist", "tmp\\Info.plist"); // Get Info.plist so we can continue
                         // Use iTunes PlUtil from iTunes Libraries to convert bplist to plist
                         ProcessStartInfo procStartInfo = new ProcessStartInfo(Path.Combine(ApplicationSupportDirectory, "plutil.exe"), @"-convert xml1 """ +
                             Path.Combine(Environment.CurrentDirectory, "tmp\\Info.plist") + @"""")
                         {
                             UseShellExecute = false,
                             CreateNoWindow = true,
                             RedirectStandardOutput = true,
                             Verb = "runas"
                         };
                         var p = new Process();
                         p.StartInfo = procStartInfo;
                         p.Start();
                         string output = p.StandardOutput.ReadToEnd();
                         p.WaitForExit();
                         //MessageBox.Show(output);
                         Plist plist = new Plist();
                         plist.Load("tmp\\Info.plist"); //now load
                         dynamic search;
                         // get icon names, download them until we found perfect 114x114 image size
                         if (plist.ContainsKey("CFBundleIconFiles"))
                             search = plist["CFBundleIconFiles"];
                         else
                             search = plist["CFBundleIcons"]["CFBundlePrimaryIcon"]["CFBundleIconFiles"];
                         foreach (var item in search)
                         {
                             string appName = plist["CFBundleDisplayName"];
                             string bundleName = plist["CFBundleIdentifier"];
                             getFile(finalPath + "/" + item, "tmp\\" + appName + ".png");
                             using (Bitmap bitmap = new Bitmap("tmp\\" + appName + ".png"))
                                 if (bitmap.Height == 114)
                                 {
                                     Data.dictIcon[appName] = new string[] { item, bundleName }; //1st: icon name, 2nd: bundle name
                                     break;
                                 }
                         }
                     }
             // Start iPIN to de-optimize PNGs
             Process p2 = new Process();
             p2.StartInfo.CreateNoWindow = true;
             p2.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
             p2.StartInfo.FileName = "tmp\\ipin.exe";
             p2.Start();
         });
     }
 }