func newFromProfileContent(content string) (Model, error) {
	var mobileProvision Model
	if _, err := plist.Unmarshal([]byte(content), &mobileProvision); err != nil {
		return Model{}, fmt.Errorf("failed to mobileprovision, error: %s", err)
	}

	return mobileProvision, nil
}
Beispiel #2
0
func (p *adiumImporter) readAccountMappings(s string) (map[string]adiumAccountMapping, bool) {
	contents, _ := ioutil.ReadFile(s)
	var res map[string]interface{}
	plist.Unmarshal(contents, &res)

	result := make(map[string]adiumAccountMapping)

	acs := res["Accounts"].([]interface{})

	for _, v := range acs {
		vals := v.(map[string]interface{})

		var m adiumAccountMapping
		m.uid = vals["UID"].(string)
		m.objectID = vals["ObjectID"].(string)
		m.accountType = vals["Type"].(string)
		result[m.objectID] = m
	}

	return result, true
}