Re: music.read-only sandbox entitlement doesn't seem to work
Re: music.read-only sandbox entitlement doesn't seem to work
- Subject: Re: music.read-only sandbox entitlement doesn't seem to work
- From: Michael Crawford <email@hidden>
- Date: Tue, 17 Jan 2012 18:05:28 -0500
I've figured out what is going on (I think). As long as your iTunes library is installed in this path: ~/Music/iTunes/iTunes Media/, the music entitlement works. It is path specific! This makes "com.apple.security.assets.music.*" only sligtly better than "com.apple.security.temporary-exception.files.home-relative-path.*" in that the music entitlement is not temporary. However The user can break it by going into iTunes preferences and moving their media files. I haven't tested it but I assume this will brake the movies entitlement as well.
- Michael
On Jan 15, 2012, at 2:55 PM, Michael Crawford wrote:
> I tried replacing my Core Audio code for reading and decoding the music files with calls to the AV Foundation framework. I was hoping that the defunct assets.music.read-only entitlement would begin working if I used AV Foundation instead. No joy. AVAsset cannot read the file (NO == asset.readable) without the temporary path entitlement in place.
>
> -Michael
>
> On Jan 9, 2012, at 12:52 PM, Michael Crawford wrote:
>
>> I'm converting over a legacy Core-Audio application to run sandboxed. This app normally access files in the iTunes library in order to analyze them for BPM information. Enabling the music.read-only entitlement does not work.
>>
>> com.apple.security.assets.music.read-only
>>
>> I get the following error:
>>
>> deny file-read-data /Users/smj/Music/iTunes/iTunes Music/Depeche Mode/Violator/01 World In My Eyes.mp3
>>
>> I have been able to overcome this problem by adding the temporary exception to perform relative reads from the users home directory using this path:
>>
>> /Music/iTunes/iTunes Music/
>>
>> My issue with this solution is that it is temporary! Can anyone shed light on why the music entitlement is not working? As I indicated I'm using Core Audio APIs. Do I need to switch to AVAsset or something like this to make this work? Some other little detail I'm leaving out?
>>
>> One other thought that just occurred to me is that I'm using the paths I get from iTunes to try and access these files. These paths are absolute from the root directory and look something like this:
>>
>> Unable to open track file://localhost/Users/michael/Music/iTunes/iTunes Music/Depeche Mode/Violator/01 World In My Eyes.mp3 (File not found)
>>
>> Do I need to specify some sort of relative substitute when using *.music.read-only?
>>
>> -Michael
>> _______________________________________________
>>
>> Cocoa-dev mailing list (email@hidden)
>>
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>>
>> Help/Unsubscribe/Update your Subscription:
>>
>> This email sent to email@hidden
>
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden