Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

VSImporter should automatically create publisher folder manifest entries #2307

Closed
rajsesh opened this issue Mar 23, 2017 · 0 comments
Closed
Assignees
Milestone

Comments

@rajsesh
Copy link
Contributor

rajsesh commented Mar 23, 2017

https://developer.apple.com/library/content/documentation/Miscellaneous/Reference/EntitlementKeyReference/Chapters/EnablingAppSandbox.html

From:

<key>com.apple.security.application-groups</key>
<array>
    <string>DG29478A379Q6483R9214.HolstFirstAppSuite</string>
    <string>DG29478A379Q6483R9214.HolstSecondAppSuite</string>
</array>

To:

https://blogs.windows.com/buildingapps/2016/05/24/sharing-your-local-app-data/

<Extensions>
  <Extension Category="windows.publisherCacheFolders">
    <PublisherCacheFolders>
      <Folder Name="HolstFirstAppSuite" />
      <Folder Name="HolstSecondAppSuite" />
    </PublisherCacheFolders>
  </Extension>
</Extensions>

in the appx manifest.

@rajsesh rajsesh added this to the 1704 milestone Mar 23, 2017
aballway added a commit that referenced this issue Apr 4, 2017
The reference platform has a concept of an application-group entitlement which allows apps made by the same publisher to share folders and semaphores. The shared folders can be accessed through -[NSFileManager containerURLForSecurityApplicationGroupIdentifier:] which will return an NSURL pointing to the shared folder with the given name if one exists.

These folders are declared in an entitlements file separate from the main .pbxproj and info.plist where other settings are stored, and is pointed at by the value with key CODE_SIGN_ENTITLEMENTS in the PBXNativeTarget's Build Configurations.

Here, the shared folders are implemented using Windows' Publisher Cache Folders, which also allow files to be shared in designated folders between apps of the same publisher, but with the caveat that users can clear the data at any time so it should not be used as the sole storage for key data.

VSImporter has been modified to check if CODE_SIGN_ENTITLEMENTS exists, and if it does, read the file and look for com.apple.security.application-groups, which will contain an array of folder names which are to be shared. The reference platform specifies the format which folders must be named, but Publisher Cache Folders does not have such a restriction for names so any valid folder names will be taken and used.

-[NSFileManager containerURLForSecurityApplicationGroupIdentifier:] is implemented by checking if a Publisher Cache Folder of the given name, and if it does returning an NSURL to it.

Fixes #2295
Fixes #2307

* Add support for containerURLs through Publisher Cache Folders

* Use absolute path instead

* Leftover includes; comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants