Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Privacy Manifest #258

Open
mvn-toantruong-dn opened this issue Mar 5, 2024 · 2 comments
Open

Privacy Manifest #258

mvn-toantruong-dn opened this issue Mar 5, 2024 · 2 comments

Comments

@mvn-toantruong-dn
Copy link

mvn-toantruong-dn commented Mar 5, 2024

Hello,
I am an employee of Monstarlab company. I have a question about the Privacy Manifest

At WWDC23 Apple announced that apps and SDKs that make use of certain "required reason" APIs etc will need to provide a privacy manifest.
Does Zip need to include this manifest?
Please let me know about your upcoming plans to apply the privacy manifest.

Here are some useful references:

https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_data_use_in_privacy_manifests

https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_use_of_required_reason_api

https://developer.apple.com/videos/play/wwdc2023/10060/

Thanks

@haniewais
Copy link

haniewais commented Mar 13, 2024

It seems that there are some system API calls in this codebase
In Zip.swift, the creationDate and modificationDate API's are called.

#if os(Linux)
    // On Linux, setting attributes is not yet really implemented.
    // In Swift 4.2, the only settable attribute is `.posixPermissions`.
    // See https://github.com/apple/swift-corelibs-foundation/blob/swift-4.2-branch/Foundation/FileManager.swift#L182-L196
    directoryAttributes = nil
#else
    directoryAttributes = [.creationDate : creationDate, // ⬅️ ⭐️ System API call 
                           .modificationDate : creationDate] // ⬅️ ⭐️ System API call 
#endif

https://github.com/marmelroy/Zip/blob/bca30f6d6c7d37cbc4aa8f6b0002e281dcc36195/Zip/Zip.swift#L188C1-L197C19


Also here:

do {
    let fileAttributes = try fileManager.attributesOfItem(atPath: filePath)
    if let fileDate = fileAttributes[FileAttributeKey.modificationDate] as? Date {  // ⬅️ ⭐️ System API call 
        let components = Calendar.current.dateComponents([.year, .month, .day, .hour, .minute, .second], from: fileDate)
        zipInfo.tmz_date.tm_sec = UInt32(components.second!)
        zipInfo.tmz_date.tm_min = UInt32(components.minute!)
        zipInfo.tmz_date.tm_hour = UInt32(components.hour!)
        zipInfo.tmz_date.tm_mday = UInt32(components.day!)
        zipInfo.tmz_date.tm_mon = UInt32(components.month!) - 1
        zipInfo.tmz_date.tm_year = UInt32(components.year!)
    }
    if let fileSize = fileAttributes[FileAttributeKey.size] as? Double {
        currentPosition += fileSize
    }
}

https://github.com/marmelroy/Zip/blob/bca30f6d6c7d37cbc4aa8f6b0002e281dcc36195/Zip/Zip.swift#L342C1-L356C18

@linhaosunny
Copy link

@marmelroy Any Plan for support Apple Privacy Manifest for cocoapods?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants