bolsinga / itunes_json

This uses the iTunesLibrary or MusicKit framework to emit JSON representing the music library.
2 stars 0 forks source link

Linking MusicKit / iTunesLibrary always asks for permission in Sequoia #410

Open bolsinga opened 1 day ago

bolsinga commented 1 day ago

It did not do this with the previous macOS release, unless that code path was hit. Need to learn why it needs early permission, and learn how to set it so that once it is granted, it is kept.

bolsinga commented 1 day ago
music-permissions
bolsinga commented 1 day ago

If I load/unload my LaunchAgent, here is what is in the logs. itunes_json.log

bolsinga commented 1 day ago
AMPLibraryAgent 10:48:29.489944-0700    xpc Connection from framework client invalidated pid:57606 clientname:iTunesLibrary(itunes_json)
AMPLibraryAgent 10:48:29.492763-0700    service Unloading domains(14) for ClientID:iTunesLibrary(itunes_json)-1229 previous open:15 new open:1
itunes_json 10:48:59.980864-0700    connection  [0x157f05800] activating connection: mach=true listener=false peer=false name=com.apple.amp.library.framework
tccd    10:48:59.982568-0700    access  AUTHREQ_ATTRIBUTION: msgID=1795.214, attribution={accessing={TCCDProcess: identifier=itunes_json, pid=57652, auid=501, euid=501, binary_path=/Users/bolsinga/Applications/itunes_json/Products/usr/local/bin/itunes_json}, requesting={TCCDProcess: identifier=com.apple.AMPLibraryAgent, pid=1795, auid=501, euid=501, binary_path=/System/Library/PrivateFrameworks/AMPLibrary.framework/Versions/A/Support/AMPLibraryAgent}, },
tccd    10:48:59.982651-0700    access  requestor: TCCDProcess: identifier=com.apple.AMPLibraryAgent, pid=1795, auid=501, euid=501, binary_path=/System/Library/PrivateFrameworks/AMPLibrary.framework/Versions/A/Support/AMPLibraryAgent is checking access for accessor TCCDProcess: identifier=itunes_json, pid=57652, auid=501, euid=501, binary_path=/Users/bolsinga/Applications/itunes_json/Products/usr/local/bin/itunes_json
tccd    10:48:59.995636-0700    access  AUTHREQ_SUBJECT: msgID=1795.214, subject=/Users/bolsinga/Applications/itunes_json/Products/usr/local/bin/itunes_json,
tccd    10:48:59.996283-0700    access  -[TCCDAccessIdentity staticCode]: static code for: identifier /Users/bolsinga/Applications/itunes_json/Products/usr/local/bin/itunes_json, type: 1: 0xc00341b00 at /Users/bolsinga/Applications/itunes_json/Products/usr/local/bin/itunes_json
tccd    10:49:00.018205-0700    access  Failed to match existing code requirement for subject /Users/bolsinga/Applications/itunes_json/Products/usr/local/bin/itunes_json and service kTCCServiceMediaLibrary
    cdhash H"6bc380972f4df49b337a2a05308fb7b98fbe6473" or cdhash H"0708bcaabbfbab8770522050f7e2642d4d864f31"
    cdhash H"6bc380972f4df49b337a2a05308fb7b98fbe6473" or cdhash H"0708bcaabbfbab8770522050f7e2642d4d864f31"
tccd    10:49:00.018997-0700    access  AUTHREQ_PROMPTING: msgID=1795.214, service=kTCCServiceMediaLibrary, subject=Sub:{/Users/bolsinga/Applications/itunes_json/Products/usr/local/bin/itunes_json}Resp:{TCCDProcess: identifier=itunes_json, pid=57652, auid=501, euid=501, binary_path=/Users/bolsinga/Applications/itunes_json/Products/usr/local/bin/itunes_json},
AMPLibraryAgent 10:49:02.489170-0700    xpc ampld> register framework ClientName:iTunesLibrary(itunes_json)
tccd    10:49:02.488189-0700    events  Publishing <TCCDEvent: type=Create, service=kTCCServiceMediaLibrary, identifier_type=Path, identifier=/Users/bolsinga/Applications/itunes_json/Products/usr/local/bin/itunes_json> to 4 subscribers: {
    633 = "<TCCDEventSubscriber: token=633, state=Initial, csid=(null)>";
    628 = "<TCCDEventSubscriber: token=628, state=Passed, csid=com.apple.chronod>";
    464 = "<TCCDEventSubscriber: token=464, state=Passed, csid=com.apple.cloudd>";
    513 = "<TCCDEventSubscriber: token=513, state=Passed, csid=com.apple.photolibraryd>";
}
AMPLibraryAgent 10:49:02.490391-0700    xpc ampld> registered framework ClientName:iTunesLibrary(itunes_json) with clientID:1230
itunes_json 10:49:02.792084-0700    connection  [0x147e04340] activating connection: mach=true listener=false peer=false name=com.apple.amp.artworkd
itunes_json 10:49:02.801482-0700    <Missing Description>   openDatabase 0xe4af30f4493e5ef5 artwork folder Y '<private>'
itunes_json 10:49:02.805087-0700    <Missing Description>   openDatabase 0xf2db6e8d7672edc9 artwork folder Y '<private>'
itunes_json 10:49:02.806736-0700    <Missing Description>   openDatabase 0xfb2acd898c951851 artwork folder Y '<private>'
itunes_json 10:49:02.813286-0700    <Missing Description>   openDatabase 0xf0f4919c5ff0e88 artwork folder Y '<private>'
itunes_json 10:49:09.634928-0700    connection  [0x600002b6a0d0] activating connection: mach=true listener=false peer=false name=com.apple.cfprefsd.daemon
itunes_json 10:49:09.635019-0700    connection  [0x600002b78000] activating connection: mach=true listener=false peer=false name=com.apple.cfprefsd.agent
AMPLibraryAgent 10:49:12.382878-0700    xpc Connection from framework client invalidated pid:57652 clientname:iTunesLibrary(itunes_json)
AMPLibraryAgent 10:49:12.383474-0700    service Unloading domains(14) for ClientID:iTunesLibrary(itunes_json)-1230 previous open:15 new open:1
bolsinga commented 1 day ago

It seems to do this when it just links with iTunesLibrary too. This is because removing MusicKit did not affect the unload/load behavior of putting up this alert.

bolsinga commented 1 day ago

It is both allowed to run in the background and to access music.

Screenshot 2024-10-25 at 11 14 20 AM Screenshot 2024-10-25 at 11 12 11 AM
bolsinga commented 1 day ago

Filed FB15592660.

bolsinga commented 1 day ago

Forum: Linking to iTunesLibrary requires … | Apple Developer Forums