From 9796835616be7ae1db254f82d0ed0dc70dea3dfc Mon Sep 17 00:00:00 2001 From: Andy Williams Date: Fri, 27 Nov 2020 10:00:52 +0000 Subject: [PATCH] Complete the package and sign of a macOS app Fixes #1443 --- cmd/fyne/commands/package-darwin.go | 5 +- cmd/fyne/commands/package.go | 2 +- cmd/fyne/commands/release.go | 71 ++++++++++++++++++- cmd/fyne/commands/release_test.go | 10 +++ cmd/fyne/internal/templates/bundled.go | 11 ++- cmd/fyne/internal/templates/data/Info.plist | 4 ++ .../templates/data/entitlements-darwin.plist | 8 +++ ...itlements.plist => entitlements-ios.plist} | 0 cmd/fyne/internal/templates/templates.go | 7 +- 9 files changed, 108 insertions(+), 10 deletions(-) create mode 100644 cmd/fyne/internal/templates/data/entitlements-darwin.plist rename cmd/fyne/internal/templates/data/{entitlements.plist => entitlements-ios.plist} (100%) diff --git a/cmd/fyne/commands/package-darwin.go b/cmd/fyne/commands/package-darwin.go index e96cf63382..abc92a320e 100644 --- a/cmd/fyne/commands/package-darwin.go +++ b/cmd/fyne/commands/package-darwin.go @@ -4,6 +4,7 @@ import ( "image" "os" "path/filepath" + "strings" "fyne.io/fyne/cmd/fyne/internal/templates" "fyne.io/fyne/cmd/fyne/internal/util" @@ -17,6 +18,7 @@ type darwinData struct { AppID string Version string Build int + Category string } func (p *packager) packageDarwin() error { @@ -27,7 +29,8 @@ func (p *packager) packageDarwin() error { info := filepath.Join(contentsDir, "Info.plist") infoFile, _ := os.Create(info) - tplData := darwinData{Name: p.name, ExeName: exeName, AppID: p.appID, Version: p.appVersion, Build: p.appBuild} + tplData := darwinData{Name: p.name, ExeName: exeName, AppID: p.appID, Version: p.appVersion, Build: p.appBuild, + Category: strings.ToLower(p.category)} err := templates.InfoPlistDarwin.Execute(infoFile, tplData) if err != nil { return errors.Wrap(err, "Failed to write plist template") diff --git a/cmd/fyne/commands/package.go b/cmd/fyne/commands/package.go index 5fac8b24f6..28ffb194ae 100644 --- a/cmd/fyne/commands/package.go +++ b/cmd/fyne/commands/package.go @@ -31,7 +31,7 @@ type packager struct { appBuild int install, release bool certificate, profile string // optional flags for releasing - tags string + tags, category string } // NewPackager returns a packager command that can wrap executables into full GUI app packages. diff --git a/cmd/fyne/commands/release.go b/cmd/fyne/commands/release.go index 1473c3f617..8c6ec18667 100644 --- a/cmd/fyne/commands/release.go +++ b/cmd/fyne/commands/release.go @@ -15,6 +15,17 @@ import ( "fyne.io/fyne/cmd/fyne/internal/util" ) +var ( + macAppStoreCategories = []string{ + "business", "developer-tools", "education", "entertainment", "finance", "games", "action-games", + "adventure-games", "arcade-games", "board-games", "card-games", "casino-games", "dice-games", + "educational-games", "family-games", "kids-games", "music-games", "puzzle-games", "racing-games", + "role-playing-games", "simulation-games", "sports-games", "strategy-games", "trivia-games", "word-games", + "graphics-design", "healthcare-fitness", "lifestyle", "medical", "music", "news", "photography", + "productivity", "reference", "social-networking", "sports", "travel", "utilities", "video", "weather", + } +) + // Declare conformity to Command interface var _ Command = (*releaser)(nil) @@ -48,6 +59,7 @@ func (r *releaser) AddFlags() { flag.StringVar(&r.developer, "developer", "", "Windows: the developer identity for your Microsoft store account") flag.StringVar(&r.password, "password", "", "Windows: password for the certificate used to sign the build") flag.StringVar(&r.tags, "tags", "", "A comma-separated list of build tags") + flag.StringVar(&r.category, "category", "", "iOS: category of the app for store listing") } func (r *releaser) PrintHelp(indent string) { @@ -143,7 +155,7 @@ func (r *releaser) packageIOSRelease() error { TeamID: team, AppID: r.appID, } - err = templates.EntitlementsDarwin.Execute(entitlements, entitlementData) + err = templates.EntitlementsDarwinMobile.Execute(entitlements, entitlementData) entitlements.Close() if err != nil { return errors.New("failed to write entitlements plist template") @@ -160,8 +172,40 @@ func (r *releaser) packageIOSRelease() error { } func (r *releaser) packageMacOSRelease() error { - cmd := exec.Command("productbuild", "--component", r.name+".app", "/Applications/", - "--product", r.name+".app/Contents/Info.plist", r.name+".pkg") + appCert := r.certificate // try to derive two certificates from one name (they will be consistent) + if strings.Index(appCert, "Installer") != -1 { + appCert = strings.Replace(appCert, "Installer", "Application", 1) + } + installCert := strings.Replace(appCert, "Application", "Installer", 1) + unsignedPath := r.name + "-unsigned.pkg" + + defer os.RemoveAll(r.name + ".app") // this was the output of package and it can get in the way of future builds + entitlementPath := filepath.Join(r.dir, "entitlements.plist") + entitlements, _ := os.Create(entitlementPath) + err := templates.EntitlementsDarwin.Execute(entitlements, nil) + entitlements.Close() + if err != nil { + return errors.New("failed to write entitlements plist template") + } + defer os.Remove(entitlementPath) + + cmd := exec.Command("codesign", "-vfs", appCert, "--entitlement", "entitlements.plist", r.name+".app") + err = cmd.Run() + if err != nil { + fyne.LogError("Codesign failed", err) + return errors.New("unable to codesign application bundle") + } + + cmd = exec.Command("productbuild", "--component", r.name+".app", "/Applications/", + "--product", r.name+".app/Contents/Info.plist", unsignedPath) + err = cmd.Run() + if err != nil { + fyne.LogError("Product build failed", err) + return errors.New("unable to build macOS app package") + } + defer os.Remove(unsignedPath) + + cmd = exec.Command("productsign", "--sign", installCert, unsignedPath, r.name+".pkg") return cmd.Run() } @@ -265,6 +309,16 @@ func (r *releaser) validate() error { if r.keyStore == "" { return errors.New("missing required -keyStore parameter for android release") } + } else if r.os == "darwin" { + if r.certificate == "" { + r.certificate = "3rd Party Mac Developer Application" + } + if r.category == "" { + return errors.New("missing required -category parameter for macOS release") + } else if !isValidMacOSCategory(r.category) { + return errors.New("category does not match one of the supported list: " + + strings.Join(macAppStoreCategories, ", ")) + } } else if r.os == "ios" { if r.certificate == "" { r.certificate = "Apple Distribution" @@ -305,3 +359,14 @@ func findWindowsSDKBin() (string, error) { return filepath.Dir(matches[0]), nil } + +func isValidMacOSCategory(in string) bool { + found := false + for _, cat := range macAppStoreCategories { + if cat == strings.ToLower(in) { + found = true + break + } + } + return found +} diff --git a/cmd/fyne/commands/release_test.go b/cmd/fyne/commands/release_test.go index e9cb752fd8..92612f9e05 100644 --- a/cmd/fyne/commands/release_test.go +++ b/cmd/fyne/commands/release_test.go @@ -16,3 +16,13 @@ func TestReleaser_nameFromCertInfo(t *testing.T) { badCase := "Cn=Company, O=Company, L=City, S=State, C=Country" assert.Equal(t, "Company", rel.nameFromCertInfo(badCase)) } + +func TestIsValidMacOSCategory(t *testing.T) { + assert.True(t, isValidMacOSCategory("games")) + assert.True(t, isValidMacOSCategory("utilities")) + assert.True(t, isValidMacOSCategory("Games")) + + assert.False(t, isValidMacOSCategory("sporps")) + assert.False(t, isValidMacOSCategory("android-games")) + assert.False(t, isValidMacOSCategory("")) +} diff --git a/cmd/fyne/internal/templates/bundled.go b/cmd/fyne/internal/templates/bundled.go index f3cf32a6e2..4980eb5343 100644 --- a/cmd/fyne/internal/templates/bundled.go +++ b/cmd/fyne/internal/templates/bundled.go @@ -7,7 +7,7 @@ import "fyne.io/fyne" var resourceInfoPlist = &fyne.StaticResource{ StaticName: "Info.plist", StaticContent: []byte{ - 60, 63, 120, 109, 108, 32, 118, 101, 114, 115, 105, 111, 110, 61, 34, 49, 46, 48, 34, 32, 101, 110, 99, 111, 100, 105, 110, 103, 61, 34, 85, 84, 70, 45, 56, 34, 63, 62, 10, 60, 33, 68, 79, 67, 84, 89, 80, 69, 32, 112, 108, 105, 115, 116, 32, 80, 85, 66, 76, 73, 67, 32, 34, 45, 47, 47, 65, 112, 112, 108, 101, 32, 67, 111, 109, 112, 117, 116, 101, 114, 47, 47, 68, 84, 68, 32, 80, 76, 73, 83, 84, 32, 49, 46, 48, 47, 47, 69, 78, 34, 32, 34, 104, 116, 116, 112, 58, 47, 47, 119, 119, 119, 46, 97, 112, 112, 108, 101, 46, 99, 111, 109, 47, 68, 84, 68, 115, 47, 80, 114, 111, 112, 101, 114, 116, 121, 76, 105, 115, 116, 45, 49, 46, 48, 46, 100, 116, 100, 34, 62, 10, 60, 112, 108, 105, 115, 116, 32, 118, 101, 114, 115, 105, 111, 110, 61, 34, 49, 46, 48, 34, 62, 10, 60, 100, 105, 99, 116, 62, 10, 9, 60, 107, 101, 121, 62, 67, 70, 66, 117, 110, 100, 108, 101, 78, 97, 109, 101, 60, 47, 107, 101, 121, 62, 10, 9, 60, 115, 116, 114, 105, 110, 103, 62, 123, 123, 46, 78, 97, 109, 101, 125, 125, 60, 47, 115, 116, 114, 105, 110, 103, 62, 10, 9, 60, 107, 101, 121, 62, 67, 70, 66, 117, 110, 100, 108, 101, 69, 120, 101, 99, 117, 116, 97, 98, 108, 101, 60, 47, 107, 101, 121, 62, 10, 9, 60, 115, 116, 114, 105, 110, 103, 62, 123, 123, 46, 69, 120, 101, 78, 97, 109, 101, 125, 125, 60, 47, 115, 116, 114, 105, 110, 103, 62, 10, 9, 60, 107, 101, 121, 62, 67, 70, 66, 117, 110, 100, 108, 101, 73, 100, 101, 110, 116, 105, 102, 105, 101, 114, 60, 47, 107, 101, 121, 62, 10, 9, 60, 115, 116, 114, 105, 110, 103, 62, 123, 123, 46, 65, 112, 112, 73, 68, 125, 125, 60, 47, 115, 116, 114, 105, 110, 103, 62, 10, 9, 60, 107, 101, 121, 62, 67, 70, 66, 117, 110, 100, 108, 101, 73, 99, 111, 110, 70, 105, 108, 101, 60, 47, 107, 101, 121, 62, 10, 9, 60, 115, 116, 114, 105, 110, 103, 62, 105, 99, 111, 110, 46, 105, 99, 110, 115, 60, 47, 115, 116, 114, 105, 110, 103, 62, 10, 9, 60, 107, 101, 121, 62, 67, 70, 66, 117, 110, 100, 108, 101, 83, 104, 111, 114, 116, 86, 101, 114, 115, 105, 111, 110, 83, 116, 114, 105, 110, 103, 60, 47, 107, 101, 121, 62, 10, 9, 60, 115, 116, 114, 105, 110, 103, 62, 123, 123, 46, 86, 101, 114, 115, 105, 111, 110, 125, 125, 60, 47, 115, 116, 114, 105, 110, 103, 62, 10, 9, 60, 107, 101, 121, 62, 67, 70, 66, 117, 110, 100, 108, 101, 83, 117, 112, 112, 111, 114, 116, 101, 100, 80, 108, 97, 116, 102, 111, 114, 109, 115, 60, 47, 107, 101, 121, 62, 10, 9, 60, 97, 114, 114, 97, 121, 62, 10, 9, 9, 60, 115, 116, 114, 105, 110, 103, 62, 77, 97, 99, 79, 83, 88, 60, 47, 115, 116, 114, 105, 110, 103, 62, 10, 9, 60, 47, 97, 114, 114, 97, 121, 62, 10, 9, 60, 107, 101, 121, 62, 67, 70, 66, 117, 110, 100, 108, 101, 86, 101, 114, 115, 105, 111, 110, 60, 47, 107, 101, 121, 62, 10, 9, 60, 115, 116, 114, 105, 110, 103, 62, 123, 123, 46, 66, 117, 105, 108, 100, 125, 125, 60, 47, 115, 116, 114, 105, 110, 103, 62, 10, 9, 60, 107, 101, 121, 62, 78, 83, 72, 105, 103, 104, 82, 101, 115, 111, 108, 117, 116, 105, 111, 110, 67, 97, 112, 97, 98, 108, 101, 60, 47, 107, 101, 121, 62, 10, 9, 60, 116, 114, 117, 101, 47, 62, 10, 9, 60, 107, 101, 121, 62, 67, 70, 66, 117, 110, 100, 108, 101, 73, 110, 102, 111, 68, 105, 99, 116, 105, 111, 110, 97, 114, 121, 86, 101, 114, 115, 105, 111, 110, 60, 47, 107, 101, 121, 62, 10, 9, 60, 115, 116, 114, 105, 110, 103, 62, 54, 46, 48, 60, 47, 115, 116, 114, 105, 110, 103, 62, 10, 9, 60, 107, 101, 121, 62, 67, 70, 66, 117, 110, 100, 108, 101, 80, 97, 99, 107, 97, 103, 101, 84, 121, 112, 101, 60, 47, 107, 101, 121, 62, 10, 9, 60, 115, 116, 114, 105, 110, 103, 62, 65, 80, 80, 76, 60, 47, 115, 116, 114, 105, 110, 103, 62, 10, 60, 47, 100, 105, 99, 116, 62, 10, 60, 47, 112, 108, 105, 115, 116, 62}} + 60, 63, 120, 109, 108, 32, 118, 101, 114, 115, 105, 111, 110, 61, 34, 49, 46, 48, 34, 32, 101, 110, 99, 111, 100, 105, 110, 103, 61, 34, 85, 84, 70, 45, 56, 34, 63, 62, 10, 60, 33, 68, 79, 67, 84, 89, 80, 69, 32, 112, 108, 105, 115, 116, 32, 80, 85, 66, 76, 73, 67, 32, 34, 45, 47, 47, 65, 112, 112, 108, 101, 32, 67, 111, 109, 112, 117, 116, 101, 114, 47, 47, 68, 84, 68, 32, 80, 76, 73, 83, 84, 32, 49, 46, 48, 47, 47, 69, 78, 34, 32, 34, 104, 116, 116, 112, 58, 47, 47, 119, 119, 119, 46, 97, 112, 112, 108, 101, 46, 99, 111, 109, 47, 68, 84, 68, 115, 47, 80, 114, 111, 112, 101, 114, 116, 121, 76, 105, 115, 116, 45, 49, 46, 48, 46, 100, 116, 100, 34, 62, 10, 60, 112, 108, 105, 115, 116, 32, 118, 101, 114, 115, 105, 111, 110, 61, 34, 49, 46, 48, 34, 62, 10, 60, 100, 105, 99, 116, 62, 10, 9, 60, 107, 101, 121, 62, 67, 70, 66, 117, 110, 100, 108, 101, 78, 97, 109, 101, 60, 47, 107, 101, 121, 62, 10, 9, 60, 115, 116, 114, 105, 110, 103, 62, 123, 123, 46, 78, 97, 109, 101, 125, 125, 60, 47, 115, 116, 114, 105, 110, 103, 62, 10, 9, 60, 107, 101, 121, 62, 67, 70, 66, 117, 110, 100, 108, 101, 69, 120, 101, 99, 117, 116, 97, 98, 108, 101, 60, 47, 107, 101, 121, 62, 10, 9, 60, 115, 116, 114, 105, 110, 103, 62, 123, 123, 46, 69, 120, 101, 78, 97, 109, 101, 125, 125, 60, 47, 115, 116, 114, 105, 110, 103, 62, 10, 9, 60, 107, 101, 121, 62, 67, 70, 66, 117, 110, 100, 108, 101, 73, 100, 101, 110, 116, 105, 102, 105, 101, 114, 60, 47, 107, 101, 121, 62, 10, 9, 60, 115, 116, 114, 105, 110, 103, 62, 123, 123, 46, 65, 112, 112, 73, 68, 125, 125, 60, 47, 115, 116, 114, 105, 110, 103, 62, 10, 9, 60, 107, 101, 121, 62, 67, 70, 66, 117, 110, 100, 108, 101, 73, 99, 111, 110, 70, 105, 108, 101, 60, 47, 107, 101, 121, 62, 10, 9, 60, 115, 116, 114, 105, 110, 103, 62, 105, 99, 111, 110, 46, 105, 99, 110, 115, 60, 47, 115, 116, 114, 105, 110, 103, 62, 10, 9, 60, 107, 101, 121, 62, 67, 70, 66, 117, 110, 100, 108, 101, 83, 104, 111, 114, 116, 86, 101, 114, 115, 105, 111, 110, 83, 116, 114, 105, 110, 103, 60, 47, 107, 101, 121, 62, 10, 9, 60, 115, 116, 114, 105, 110, 103, 62, 123, 123, 46, 86, 101, 114, 115, 105, 111, 110, 125, 125, 60, 47, 115, 116, 114, 105, 110, 103, 62, 10, 9, 60, 107, 101, 121, 62, 67, 70, 66, 117, 110, 100, 108, 101, 83, 117, 112, 112, 111, 114, 116, 101, 100, 80, 108, 97, 116, 102, 111, 114, 109, 115, 60, 47, 107, 101, 121, 62, 10, 9, 60, 97, 114, 114, 97, 121, 62, 10, 9, 9, 60, 115, 116, 114, 105, 110, 103, 62, 77, 97, 99, 79, 83, 88, 60, 47, 115, 116, 114, 105, 110, 103, 62, 10, 9, 60, 47, 97, 114, 114, 97, 121, 62, 10, 9, 60, 107, 101, 121, 62, 67, 70, 66, 117, 110, 100, 108, 101, 86, 101, 114, 115, 105, 111, 110, 60, 47, 107, 101, 121, 62, 10, 9, 60, 115, 116, 114, 105, 110, 103, 62, 123, 123, 46, 66, 117, 105, 108, 100, 125, 125, 60, 47, 115, 116, 114, 105, 110, 103, 62, 10, 9, 60, 107, 101, 121, 62, 78, 83, 72, 105, 103, 104, 82, 101, 115, 111, 108, 117, 116, 105, 111, 110, 67, 97, 112, 97, 98, 108, 101, 60, 47, 107, 101, 121, 62, 10, 9, 60, 116, 114, 117, 101, 47, 62, 10, 9, 60, 107, 101, 121, 62, 67, 70, 66, 117, 110, 100, 108, 101, 73, 110, 102, 111, 68, 105, 99, 116, 105, 111, 110, 97, 114, 121, 86, 101, 114, 115, 105, 111, 110, 60, 47, 107, 101, 121, 62, 10, 9, 60, 115, 116, 114, 105, 110, 103, 62, 54, 46, 48, 60, 47, 115, 116, 114, 105, 110, 103, 62, 10, 9, 60, 107, 101, 121, 62, 67, 70, 66, 117, 110, 100, 108, 101, 80, 97, 99, 107, 97, 103, 101, 84, 121, 112, 101, 60, 47, 107, 101, 121, 62, 10, 9, 60, 115, 116, 114, 105, 110, 103, 62, 65, 80, 80, 76, 60, 47, 115, 116, 114, 105, 110, 103, 62, 10, 9, 60, 107, 101, 121, 62, 76, 83, 65, 112, 112, 108, 105, 99, 97, 116, 105, 111, 110, 67, 97, 116, 101, 103, 111, 114, 121, 84, 121, 112, 101, 60, 47, 107, 101, 121, 62, 10, 9, 60, 115, 116, 114, 105, 110, 103, 62, 112, 117, 98, 108, 105, 99, 46, 97, 112, 112, 45, 99, 97, 116, 101, 103, 111, 114, 121, 46, 123, 123, 46, 67, 97, 116, 101, 103, 111, 114, 121, 125, 125, 60, 47, 115, 116, 114, 105, 110, 103, 62, 10, 9, 60, 107, 101, 121, 62, 76, 83, 77, 105, 110, 105, 109, 117, 109, 83, 121, 115, 116, 101, 109, 86, 101, 114, 115, 105, 111, 110, 60, 47, 107, 101, 121, 62, 10, 9, 60, 115, 116, 114, 105, 110, 103, 62, 49, 48, 46, 49, 49, 60, 47, 115, 116, 114, 105, 110, 103, 62, 10, 60, 47, 100, 105, 99, 116, 62, 10, 60, 47, 112, 108, 105, 115, 116, 62}} var resourceMakefile = &fyne.StaticResource{ StaticName: "Makefile", @@ -29,8 +29,13 @@ var resourceAppxmanifestXML = &fyne.StaticResource{ StaticContent: []byte{ 60, 63, 120, 109, 108, 32, 118, 101, 114, 115, 105, 111, 110, 61, 34, 49, 46, 48, 34, 32, 101, 110, 99, 111, 100, 105, 110, 103, 61, 34, 117, 116, 102, 45, 56, 34, 63, 62, 10, 60, 80, 97, 99, 107, 97, 103, 101, 32, 120, 109, 108, 110, 115, 61, 34, 104, 116, 116, 112, 58, 47, 47, 115, 99, 104, 101, 109, 97, 115, 46, 109, 105, 99, 114, 111, 115, 111, 102, 116, 46, 99, 111, 109, 47, 97, 112, 112, 120, 47, 50, 48, 49, 48, 47, 109, 97, 110, 105, 102, 101, 115, 116, 34, 62, 10, 32, 32, 60, 73, 100, 101, 110, 116, 105, 116, 121, 32, 78, 97, 109, 101, 61, 34, 123, 123, 46, 65, 112, 112, 73, 68, 125, 125, 34, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 86, 101, 114, 115, 105, 111, 110, 61, 34, 123, 123, 46, 86, 101, 114, 115, 105, 111, 110, 125, 125, 34, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 80, 117, 98, 108, 105, 115, 104, 101, 114, 61, 34, 123, 123, 46, 68, 101, 118, 101, 108, 111, 112, 101, 114, 125, 125, 34, 32, 47, 62, 10, 32, 32, 60, 80, 114, 111, 112, 101, 114, 116, 105, 101, 115, 62, 10, 32, 32, 32, 32, 60, 68, 105, 115, 112, 108, 97, 121, 78, 97, 109, 101, 62, 123, 123, 46, 78, 97, 109, 101, 125, 125, 60, 47, 68, 105, 115, 112, 108, 97, 121, 78, 97, 109, 101, 62, 10, 32, 32, 32, 32, 60, 80, 117, 98, 108, 105, 115, 104, 101, 114, 68, 105, 115, 112, 108, 97, 121, 78, 97, 109, 101, 62, 123, 123, 46, 68, 101, 118, 101, 108, 111, 112, 101, 114, 78, 97, 109, 101, 125, 125, 60, 47, 80, 117, 98, 108, 105, 115, 104, 101, 114, 68, 105, 115, 112, 108, 97, 121, 78, 97, 109, 101, 62, 10, 32, 32, 32, 32, 60, 76, 111, 103, 111, 62, 73, 99, 111, 110, 46, 112, 110, 103, 60, 47, 76, 111, 103, 111, 62, 10, 32, 32, 60, 47, 80, 114, 111, 112, 101, 114, 116, 105, 101, 115, 62, 10, 32, 32, 60, 80, 114, 101, 114, 101, 113, 117, 105, 115, 105, 116, 101, 115, 62, 10, 32, 32, 32, 32, 60, 79, 83, 77, 105, 110, 86, 101, 114, 115, 105, 111, 110, 62, 54, 46, 50, 60, 47, 79, 83, 77, 105, 110, 86, 101, 114, 115, 105, 111, 110, 62, 10, 32, 32, 32, 32, 60, 79, 83, 77, 97, 120, 86, 101, 114, 115, 105, 111, 110, 84, 101, 115, 116, 101, 100, 62, 49, 48, 46, 48, 60, 47, 79, 83, 77, 97, 120, 86, 101, 114, 115, 105, 111, 110, 84, 101, 115, 116, 101, 100, 62, 10, 32, 32, 60, 47, 80, 114, 101, 114, 101, 113, 117, 105, 115, 105, 116, 101, 115, 62, 10, 32, 32, 60, 82, 101, 115, 111, 117, 114, 99, 101, 115, 62, 10, 32, 32, 32, 32, 60, 82, 101, 115, 111, 117, 114, 99, 101, 32, 76, 97, 110, 103, 117, 97, 103, 101, 61, 34, 101, 110, 45, 117, 115, 34, 32, 47, 62, 10, 32, 32, 60, 47, 82, 101, 115, 111, 117, 114, 99, 101, 115, 62, 10, 10, 32, 32, 60, 33, 45, 45, 32, 84, 79, 68, 79, 32, 60, 65, 112, 112, 108, 105, 99, 97, 116, 105, 111, 110, 115, 62, 32, 45, 45, 62, 10, 60, 47, 80, 97, 99, 107, 97, 103, 101, 62}} -var resourceEntitlementsPlist = &fyne.StaticResource{ - StaticName: "entitlements.plist", +var resourceEntitlementsDarwinPlist = &fyne.StaticResource{ + StaticName: "entitlements-darwin.plist", + StaticContent: []byte{ + 60, 63, 120, 109, 108, 32, 118, 101, 114, 115, 105, 111, 110, 61, 34, 49, 46, 48, 34, 32, 101, 110, 99, 111, 100, 105, 110, 103, 61, 34, 85, 84, 70, 45, 56, 34, 63, 62, 10, 60, 33, 68, 79, 67, 84, 89, 80, 69, 32, 112, 108, 105, 115, 116, 32, 80, 85, 66, 76, 73, 67, 32, 34, 45, 47, 47, 65, 112, 112, 108, 101, 47, 47, 68, 84, 68, 32, 80, 76, 73, 83, 84, 32, 49, 46, 48, 47, 47, 69, 78, 34, 32, 34, 104, 116, 116, 112, 58, 47, 47, 119, 119, 119, 46, 97, 112, 112, 108, 101, 46, 99, 111, 109, 47, 68, 84, 68, 115, 47, 80, 114, 111, 112, 101, 114, 116, 121, 76, 105, 115, 116, 45, 49, 46, 48, 46, 100, 116, 100, 34, 62, 10, 60, 112, 108, 105, 115, 116, 32, 118, 101, 114, 115, 105, 111, 110, 61, 34, 49, 46, 48, 34, 62, 10, 60, 100, 105, 99, 116, 62, 10, 32, 32, 32, 32, 60, 107, 101, 121, 62, 99, 111, 109, 46, 97, 112, 112, 108, 101, 46, 115, 101, 99, 117, 114, 105, 116, 121, 46, 97, 112, 112, 45, 115, 97, 110, 100, 98, 111, 120, 60, 47, 107, 101, 121, 62, 10, 32, 32, 32, 32, 60, 116, 114, 117, 101, 47, 62, 10, 60, 47, 100, 105, 99, 116, 62, 10, 60, 47, 112, 108, 105, 115, 116, 62}} + +var resourceEntitlementsIosPlist = &fyne.StaticResource{ + StaticName: "entitlements-ios.plist", StaticContent: []byte{ 60, 63, 120, 109, 108, 32, 118, 101, 114, 115, 105, 111, 110, 61, 34, 49, 46, 48, 34, 32, 101, 110, 99, 111, 100, 105, 110, 103, 61, 34, 85, 84, 70, 45, 56, 34, 63, 62, 10, 60, 33, 68, 79, 67, 84, 89, 80, 69, 32, 112, 108, 105, 115, 116, 32, 80, 85, 66, 76, 73, 67, 32, 34, 45, 47, 47, 65, 112, 112, 108, 101, 47, 47, 68, 84, 68, 32, 80, 76, 73, 83, 84, 32, 49, 46, 48, 47, 47, 69, 78, 34, 32, 34, 104, 116, 116, 112, 58, 47, 47, 119, 119, 119, 46, 97, 112, 112, 108, 101, 46, 99, 111, 109, 47, 68, 84, 68, 115, 47, 80, 114, 111, 112, 101, 114, 116, 121, 76, 105, 115, 116, 45, 49, 46, 48, 46, 100, 116, 100, 34, 62, 10, 60, 112, 108, 105, 115, 116, 32, 118, 101, 114, 115, 105, 111, 110, 61, 34, 49, 46, 48, 34, 62, 10, 60, 100, 105, 99, 116, 62, 10, 32, 32, 32, 32, 60, 107, 101, 121, 62, 97, 112, 112, 108, 105, 99, 97, 116, 105, 111, 110, 45, 105, 100, 101, 110, 116, 105, 102, 105, 101, 114, 60, 47, 107, 101, 121, 62, 10, 32, 32, 32, 32, 60, 115, 116, 114, 105, 110, 103, 62, 123, 123, 46, 84, 101, 97, 109, 73, 68, 125, 125, 46, 123, 123, 46, 65, 112, 112, 73, 68, 125, 125, 60, 47, 115, 116, 114, 105, 110, 103, 62, 10, 60, 47, 100, 105, 99, 116, 62, 10, 60, 47, 112, 108, 105, 115, 116, 62}} diff --git a/cmd/fyne/internal/templates/data/Info.plist b/cmd/fyne/internal/templates/data/Info.plist index 18ad740985..9109e67737 100644 --- a/cmd/fyne/internal/templates/data/Info.plist +++ b/cmd/fyne/internal/templates/data/Info.plist @@ -24,5 +24,9 @@ 6.0 CFBundlePackageType APPL + LSApplicationCategoryType + public.app-category.{{.Category}} + LSMinimumSystemVersion + 10.11 \ No newline at end of file diff --git a/cmd/fyne/internal/templates/data/entitlements-darwin.plist b/cmd/fyne/internal/templates/data/entitlements-darwin.plist new file mode 100644 index 0000000000..ebc85653fb --- /dev/null +++ b/cmd/fyne/internal/templates/data/entitlements-darwin.plist @@ -0,0 +1,8 @@ + + + + + com.apple.security.app-sandbox + + + \ No newline at end of file diff --git a/cmd/fyne/internal/templates/data/entitlements.plist b/cmd/fyne/internal/templates/data/entitlements-ios.plist similarity index 100% rename from cmd/fyne/internal/templates/data/entitlements.plist rename to cmd/fyne/internal/templates/data/entitlements-ios.plist diff --git a/cmd/fyne/internal/templates/templates.go b/cmd/fyne/internal/templates/templates.go index 2ad3d84e98..3bf5756ea7 100644 --- a/cmd/fyne/internal/templates/templates.go +++ b/cmd/fyne/internal/templates/templates.go @@ -12,7 +12,10 @@ var ( DesktopFileUNIX = template.Must(template.New("DesktopFile").Parse(string(resourceAppDesktop.StaticContent))) // EntitlementsDarwin is a plist file that lists build entitlements for darwin releases - EntitlementsDarwin = template.Must(template.New("Entitlements").Parse(string(resourceEntitlementsPlist.StaticContent))) + EntitlementsDarwin = template.Must(template.New("Entitlements").Parse(string(resourceEntitlementsDarwinPlist.StaticContent))) + + // EntitlementsDarwinMobile is a plist file that lists build entitlements for iOS releases + EntitlementsDarwinMobile = template.Must(template.New("EntitlementsMobile").Parse(string(resourceEntitlementsIosPlist.StaticContent))) // ManifestWindows is the manifest file for windows packaging ManifestWindows = template.Must(template.New("Manifest").Parse(string(resourceAppManifest.StaticContent))) @@ -21,7 +24,7 @@ var ( AppxManifestWindows = template.Must(template.New("ReleaseManifest").Parse(string(resourceAppxmanifestXML.StaticContent))) // InfoPlistDarwin is the manifest file for darwin packaging - InfoPlistDarwin = template.Must(template.New("Manifest").Parse(string(resourceInfoPlist.StaticContent))) + InfoPlistDarwin = template.Must(template.New("InfoPlist").Parse(string(resourceInfoPlist.StaticContent))) // XCAssetsDarwin is the Contents.json file for darwin xcassets bundle XCAssetsDarwin = template.Must(template.New("XCAssets").Parse(string(resourceXcassetsJSON.StaticContent)))