akabekobeko / npm-icon-gen

Icon file generator for Windows, macOS, Web
MIT License
157 stars 29 forks source link

Implement ICNS plist binary writes #76

Closed akabekobeko closed 6 years ago

akabekobeko commented 7 years ago

High Sierra's iconutil is writing plist. header is info id and size is plist + header (8 byte).

<?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>$archiver</key>
    <string>NSKeyedArchiver</string>
    <key>$objects</key>
    <array>
        <string>$null</string>
        <dict>
            <key>$class</key>
            <dict>
                <key>CF$UID</key>
                <integer>4</integer>
            </dict>
            <key>NS.keys</key>
            <array>
                <dict>
                    <key>CF$UID</key>
                    <integer>2</integer>
                </dict>
            </array>
            <key>NS.objects</key>
            <array>
                <dict>
                    <key>CF$UID</key>
                    <integer>3</integer>
                </dict>
            </array>
        </dict>
        <string>name</string>
        <string>icon</string>
        <dict>
            <key>$classes</key>
            <array>
                <string>NSDictionary</string>
                <string>NSObject</string>
            </array>
            <key>$classname</key>
            <string>NSDictionary</string>
        </dict>
    </array>
    <key>$top</key>
    <dict>
        <key>root</key>
        <dict>
            <key>CF$UID</key>
            <integer>1</integer>
        </dict>
    </dict>
    <key>$version</key>
    <integer>100000</integer>
</dict>
</plist>
akabekobeko commented 7 years ago

It is easier and safer to write the plist binary (259byte) generated by iconutil than to implement plutil.

akabekobeko commented 6 years ago

Even if it is not displayed, it will not be a problem and disapprove it.