Merge pull request #5601 from electron/team-id
Include team ID in the base bundle ID
This commit is contained in:
commit
f441ba2694
2 changed files with 34 additions and 11 deletions
|
@ -10,6 +10,7 @@
|
||||||
#include "base/mac/foundation_util.h"
|
#include "base/mac/foundation_util.h"
|
||||||
#include "base/mac/scoped_nsautorelease_pool.h"
|
#include "base/mac/scoped_nsautorelease_pool.h"
|
||||||
#include "base/path_service.h"
|
#include "base/path_service.h"
|
||||||
|
#include "base/strings/sys_string_conversions.h"
|
||||||
#include "brightray/common/application_info.h"
|
#include "brightray/common/application_info.h"
|
||||||
#include "brightray/common/mac/main_application_bundle.h"
|
#include "brightray/common/mac/main_application_bundle.h"
|
||||||
#include "content/public/common/content_paths.h"
|
#include "content/public/common/content_paths.h"
|
||||||
|
@ -52,8 +53,13 @@ void AtomMainDelegate::OverrideChildProcessPath() {
|
||||||
|
|
||||||
void AtomMainDelegate::SetUpBundleOverrides() {
|
void AtomMainDelegate::SetUpBundleOverrides() {
|
||||||
base::mac::ScopedNSAutoreleasePool pool;
|
base::mac::ScopedNSAutoreleasePool pool;
|
||||||
NSBundle* base_bundle = brightray::MainApplicationBundle();
|
NSBundle* bundle = brightray::MainApplicationBundle();
|
||||||
base::mac::SetBaseBundleID([[base_bundle bundleIdentifier] UTF8String]);
|
std::string base_bundle_id =
|
||||||
|
base::SysNSStringToUTF8([bundle bundleIdentifier]);
|
||||||
|
NSString* team_id = [bundle objectForInfoDictionaryKey:@"ElectronTeamID"];
|
||||||
|
if (team_id)
|
||||||
|
base_bundle_id = base::SysNSStringToUTF8(team_id) + "." + base_bundle_id;
|
||||||
|
base::mac::SetBaseBundleID(base_bundle_id.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace atom
|
} // namespace atom
|
||||||
|
|
|
@ -19,14 +19,33 @@ how to meet the Mac App Store requirements.
|
||||||
To submit your app to the Mac App Store, you first must get a certificate from
|
To submit your app to the Mac App Store, you first must get a certificate from
|
||||||
Apple. You can follow these [existing guides][nwjs-guide] on web.
|
Apple. You can follow these [existing guides][nwjs-guide] on web.
|
||||||
|
|
||||||
|
### Get Team ID
|
||||||
|
|
||||||
|
Before signing your app, you need to know the Team ID of your account. To locate
|
||||||
|
your Team ID, Sign in to https://developer.apple.com/account/, and click
|
||||||
|
Membership in the sidebar. Your Team ID appears in the Membership Information
|
||||||
|
section under the team name.
|
||||||
|
|
||||||
### Sign Your App
|
### Sign Your App
|
||||||
|
|
||||||
After getting the certificate from Apple, you can package your app by following
|
After finishing the preparation work, you can package your app by following
|
||||||
[Application Distribution](application-distribution.md), and then proceed to
|
[Application Distribution](application-distribution.md), and then proceed to
|
||||||
signing your app. This step is basically the same with other programs, but the
|
signing your app.
|
||||||
key is to sign every dependency of Electron one by one.
|
|
||||||
|
|
||||||
First, you need to prepare two entitlements files.
|
First, you have to add a `ElectronTeamID` key to your app's `Info.plist`, which
|
||||||
|
has your Team ID as key:
|
||||||
|
|
||||||
|
```xml
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
...
|
||||||
|
<key>ElectronTeamID</key>
|
||||||
|
<string>TEAM_ID</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
|
```
|
||||||
|
|
||||||
|
Then, you need to prepare two entitlements files.
|
||||||
|
|
||||||
`child.plist`:
|
`child.plist`:
|
||||||
|
|
||||||
|
@ -53,15 +72,13 @@ First, you need to prepare two entitlements files.
|
||||||
<key>com.apple.security.app-sandbox</key>
|
<key>com.apple.security.app-sandbox</key>
|
||||||
<true/>
|
<true/>
|
||||||
<key>com.apple.security.application-groups</key>
|
<key>com.apple.security.application-groups</key>
|
||||||
<array>
|
<string>TEAM_ID.your.bundle.id</string>
|
||||||
<string>your.bundle.id</string>
|
|
||||||
</array>
|
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
```
|
```
|
||||||
|
|
||||||
_You have to replace `your.bundle.id` with the Bundle ID specified in your app's
|
You have to replace `TEAM_ID` with your Team ID, and replace `your.bundle.id`
|
||||||
`Info.plist`._
|
with the Bundle ID of your app.
|
||||||
|
|
||||||
And then sign your app with the following script:
|
And then sign your app with the following script:
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue