private static void UpdatePlist(string path)
        {
            const string fileName = "Info.plist";
            string       fullPath = Path.Combine(path, fileName);

            if (string.IsNullOrEmpty(OKSettings.AppId))
            {
                Debug.LogError("Could not parse URL schema: ProjectConfig.bundleId not specified");
                return;
            }

            var parser = new PListParser(fullPath);

            foreach (var schema in InternalSchemas)
            {
                parser.AddSchema(schema, true);
            }

            foreach (var schema in ExternalSchemas)
            {
                parser.AddSchema(schema, false);
            }

            //parser.AddExceptionDomains(TLSDomains, subDomains: true, skipForwardSecrecy: true, allowHttp: false);
            parser.AddExceptionDomains(HTTPDomains, subDomains: true, skipForwardSecrecy: false, allowHttp: true);
            parser.WriteToFile();
        }
        private static void UpdatePlist(string path)
        {
            const string fileName = "Info.plist";
            string fullPath = Path.Combine(path, fileName);

            if (string.IsNullOrEmpty(OKSettings.AppId))
            {
                Debug.LogError("Could not parse URL schema: ProjectConfig.bundleId not specified");
                return;
            }

            var parser = new PListParser(fullPath);
            foreach (var schema in InternalSchemas)
            {
                parser.AddSchema(schema, true);
            }

            foreach (var schema in ExternalSchemas)
            {
                parser.AddSchema(schema, false);
            }

            //parser.AddExceptionDomains(TLSDomains, subDomains: true, skipForwardSecrecy: true, allowHttp: false);
            parser.AddExceptionDomains(HTTPDomains, subDomains: true, skipForwardSecrecy: false, allowHttp: true);
            parser.WriteToFile();
        }
示例#3
0
    private void ParseData(string data)
    {
        Hashtable table = new Hashtable();

        if (PListParser.ParsePListFileFromContent(data, ref table))
        {
            int version = (int)table["Version"];
            if (version > _config.Version)
            {
                ParseNewData(table);
                SaveConfigToLocal();
                OnSDKNewConfig();
            }
        }
    }
示例#4
0
    public void LoadDataConfig()
    {
        // Load from local
        bool haveLocalConfig = LoadDataFromLocal();

        if (_config == null)
        {
            _config = new ConfigData();
        }
        //
        foreach (var item in _modules)
        {
            item.Value.SetConfig(_config, haveLocalConfig);
        }
        // plist default
        if (!haveLocalConfig && PLIST_DEFAULT_ENABLE)
        {
            string plist_offline = Native.GetDefaultPlist();
            if (plist_offline != null)
            {
                Hashtable table = new Hashtable();
                PListParser.ParsePListFileFromContent(plist_offline, ref table);
                Debug.Log("Plist offline: " + plist_offline);
                ParseNewData(table);
            }
        }
        // OnReady with default or local plist
                #if UNITY_EDITOR_OSX
        if (haveLocalConfig || PLIST_DEFAULT_ENABLE)
        {
            OnSDKReady();
        }
                #endif
                #if !UNITY_EDITOR_OSX // good job, who are reading my code
        if (haveLocalConfig || PLIST_DEFAULT_ENABLE)
        {
            OnSDKReady();
        }
                #endif
        // get new plist
        StartCoroutine(LoadDataConfig_WWW());
    }
 public PListIndirectNode(PListParser parser)
 {
     _parser = parser;
 }