Skip to content

Commit

Permalink
update: v1.0.0-beta2
Browse files Browse the repository at this point in the history
added `permissions` key, added `ConvertToAll` convenience function
  • Loading branch information
asdfzxcvbn committed Dec 20, 2024
1 parent 16ce3d5 commit e5159e0
Show file tree
Hide file tree
Showing 9 changed files with 113 additions and 39 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/cmd/urf/urf
/cmd/urf/urf
/cmd/urf/urf-*
54 changes: 35 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,39 @@ most (if not all) keys are technically optional. here's an example repo with eve

```json
{
"name": "hello!",
"identifier": "fyi.zxcvbn.repo.test",
"iconURL": "https://example.com/path/to/some/icon.png",
"caption": "a *short* description of your repo!",
"description": "this can be a longer description and include stuff like your links or something, idk",
"apps": [
{
"name": "app name",
"developerName": "zx",
"bundleID": "fyi.zxcvbn.app",
"caption": "just like the repo's caption",
"description": "just like the repo's description",
"downloadURL": "https://example.com/path/to/some/app.ipa",
"iconURL": "https://example.com/hopefully/path/to/itunes/icon.png",
"version": "1.2",
"date": "2024-12-18",
"size": 1073741824
}
]
"name": "hello!",
"identifier": "fyi.zxcvbn.repo.test",
"iconURL": "https://example.com/path/to/some/icon.png",
"caption": "a *short* description of your repo!",
"description": "this can be a longer description and include stuff like your links or something, idk",
"apps": [
{
"name": "app name",
"developerName": "zx",
"bundleID": "fyi.zxcvbn.app",
"caption": "just like the repo's caption",
"description": "just like the repo's description",
"downloadURL": "https://example.com/path/to/some/app.ipa",
"iconURL": "https://example.com/hopefully/path/to/itunes/icon.png",
"version": "1.2",
"date": "2024-12-18",
"size": 1073741824
}
],
"permissions": {
"fyi.zxcvbn.app": {
"entitlements": [
"aps-environment",
"com.apple.developer.associated-domains",
"keychain-access-groups",
"com.apple.security.application-groups"
],
"privacy": {
"NSBluetoothAlwaysUsageDescription": "example",
"NSFaceIDUsageDescription": "for face id"
}
}
}
}
```

Expand All @@ -46,6 +60,8 @@ you can see the output for this example in the `examples/` directory.

`description` is the big text describing your repo. this is only shown in some apps so feel free to exclude it.

`permissions` translates to the `appPermissions` key in the AltStore format. this is required according to my memory and [AltStore docs](https://faq.altstore.io/developers/make-a-source#apppermissions-app-permissions-object). if you're going to upload multiple versions of an app with the same bundle id, chances are their permissions are the same too, which is why `permissions` is a map of bundle ids to permissions.

### app
`developerName` is only shown in some apps. exclude it if you want.

Expand Down
Binary file added cmd/.DS_Store
Binary file not shown.
15 changes: 15 additions & 0 deletions converters.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ func ConvertToAltStore(uni *repos.Universal) *repos.AltStore {
IconURL: orig.IconURL,
}

if permissions, ok := uni.Permissions[bundle]; ok {
app.Permissions = permissions
}

for _, idx := range idxs {
origIdx := uni.Apps[idx]
app.Versions = append(app.Versions, repos.AltStoreAppVersion{
Expand Down Expand Up @@ -135,3 +139,14 @@ func ConvertToScarlet(uni *repos.Universal) *repos.Scarlet {

return &r
}

// a convenience function that returns all formatted repos.
func ConvertToAll(uni *repos.Universal) *repos.All {
return &repos.All{
ESign: ConvertToESign(uni),
GBox: ConvertToGBox(uni),
Feather: ConvertToFeather(uni),
AltStore: ConvertToAltStore(uni),
Scarlet: ConvertToScarlet(uni),
}
}
38 changes: 26 additions & 12 deletions example.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,31 @@
"caption": "a *short* description of your repo!",
"description": "this can be a longer description and include stuff like your links or something, idk",
"apps": [
{
"name": "app name",
"developerName": "zx",
"bundleID": "fyi.zxcvbn.app",
"caption": "just like the repo's caption",
"description": "just like the repo's description",
"downloadURL": "https://example.com/path/to/some/app.ipa",
"iconURL": "https://example.com/hopefully/path/to/itunes/icon.png",
"version": "1.2",
"date": "2024-12-18",
"size": 1073741824
{
"name": "app name",
"developerName": "zx",
"bundleID": "fyi.zxcvbn.app",
"caption": "just like the repo's caption",
"description": "just like the repo's description",
"downloadURL": "https://example.com/path/to/some/app.ipa",
"iconURL": "https://example.com/hopefully/path/to/itunes/icon.png",
"version": "1.2",
"date": "2024-12-18",
"size": 1073741824
}
],
"permissions": {
"fyi.zxcvbn.app": {
"entitlements": [
"aps-environment",
"com.apple.developer.associated-domains",
"keychain-access-groups",
"com.apple.security.application-groups"
],
"privacy": {
"NSBluetoothAlwaysUsageDescription": "example",
"NSFaceIDUsageDescription": "for face id"
}
]
}
}
}
14 changes: 13 additions & 1 deletion examples/example.altstore.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,19 @@
"downloadURL": "https://example.com/path/to/some/app.ipa",
"localizedDescription": "just like the repo's description"
}
]
],
"appPermissions": {
"entitlements": [
"aps-environment",
"com.apple.developer.associated-domains",
"keychain-access-groups",
"com.apple.security.application-groups"
],
"privacy": {
"NSBluetoothAlwaysUsageDescription": "example",
"NSFaceIDUsageDescription": "for face id"
}
}
}
]
}
9 changes: 9 additions & 0 deletions repos/all.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package repos

type All struct {
ESign *ESign
GBox *GBox
Feather *Feather
AltStore *AltStore
Scarlet *Scarlet
}
1 change: 1 addition & 0 deletions repos/altstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ type AltStoreApp struct {
Description string `json:"localizedDescription"`
IconURL string `json:"iconURL"`
Versions []AltStoreAppVersion `json:"versions"`
Permissions UniversalPermissions `json:"appPermissions"`
}

type AltStore struct {
Expand Down
18 changes: 12 additions & 6 deletions repos/universal.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
package repos

type UniversalPermissions struct {
Entitlements []string `json:"entitlements"`
Privacy map[string]string `json:"privacy"`
}

type UniversalApp struct {
Name string `json:"name"`
DeveloperName string `json:"developerName"`
Expand All @@ -14,10 +19,11 @@ type UniversalApp struct {
}

type Universal struct {
Name string `json:"name"`
Identifier string `json:"identifier"`
IconURL string `json:"iconURL"`
Caption string `json:"caption"`
Description string `json:"description"`
Apps []UniversalApp `json:"apps"`
Name string `json:"name"`
Identifier string `json:"identifier"`
IconURL string `json:"iconURL"`
Caption string `json:"caption"`
Description string `json:"description"`
Apps []UniversalApp `json:"apps"`
Permissions map[string]UniversalPermissions `json:"permissions"`
}

0 comments on commit e5159e0

Please sign in to comment.