编辑 iPhone 通讯录 .contacts 导出文档

问题

通过PP助手导出通讯录,生成xxx.contacts文件,直接用Notepad++打开乱码

解决方法

可以把xxx.contacts改名为xxx.contacts.zip,然后用WinRAR等解压缩工具打开,打开后里面有几个xxx.plist文件(从Contacts_0.plistContacts_7.plist)。姓名和号码分别在Contacts_0.plistContacts_2.plist中(可以直接用Notepad++打开):

Contacts_0.plist

<?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">
<array>
    <string>SDMessageProcessChanges</string>
    <string>com.apple.Contacts</string>
    <dict>
        <key>10</key>
        <dict>
            <key>com.apple.syncservices.RecordEntityName</key>
            <string>com.apple.contacts.Contact</string>
            <key>display as company</key>
            <string>person</string>
            <key>last name</key>
            <string>刘校</string>
        </dict>
    </dict>
    <true/>
    <string>___EmptyParameterString___</string>
</array>
</plist>

Contacts_2.plist

<?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">
<array>
    <string>SDMessageProcessChanges</string>
    <string>com.apple.Contacts</string>
    <dict>
        <key>3/10/0</key>
        <dict>
            <key>value</key>
            <string>13300001111</string>
            <key>com.apple.syncservices.RecordEntityName</key>
            <string>com.apple.contacts.Phone Number</string>
            <key>type</key>
            <string>home</string>
            <key>contact</key>
            <array>
                <string>10</string>
            </array>
        </dict>
    </dict>
    <true/>
    <string>___EmptyParameterString___</string>
</array>
</plist>
    原文作者:刘校
    原文地址: https://segmentfault.com/a/1190000011133713
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞