adsedare 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE.txt +21 -0
- data/README.md +35 -0
- data/Rakefile +4 -0
- data/adsedare.gemspec +36 -0
- data/exe/adsedare +3 -0
- data/lib/adsedare/capabilities.rb +138 -0
- data/lib/adsedare/version.rb +5 -0
- data/lib/adsedare.rb +518 -0
- data/lib/appstoreconnect.rb +86 -0
- data/lib/logging.rb +26 -0
- data/lib/starship/2fa_provider.rb +40 -0
- data/lib/starship/auth_helper.rb +450 -0
- data/lib/starship.rb +293 -0
- metadata +145 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 97608657ad78aff5e5e2eb17331c109a2da49dd51a21896a62d46b17fae1f97c
|
4
|
+
data.tar.gz: f937d2f43ac6d13e3801326a88f2b947e7a0a24fce276524c2390a476e1d9085
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 312a6acc6df402f344f6c25b6fb83e04a447f78d3f0df550eb014f1a8897a0075efba50dd4d2813f3823f1ffd9e7c244dbdde790d63bfbe958b76aabedd60890
|
7
|
+
data.tar.gz: 48ac5c37a7c40278bc1c05fad1dba09e1e545d41887658863a8f0353e44bd332cdcff5914a9864aa855d1cc5a75c07d4825f20c127ff76bc41c5855f4de71c27
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2025 alexstrnik
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
# Adsedare
|
2
|
+
|
3
|
+
TODO: Delete this and the text below, and describe your gem
|
4
|
+
|
5
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/adsedare`. To experiment with that code, run `bin/console` for an interactive prompt.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
|
10
|
+
|
11
|
+
Install the gem and add to the application's Gemfile by executing:
|
12
|
+
|
13
|
+
$ bundle add UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG
|
14
|
+
|
15
|
+
If bundler is not being used to manage dependencies, install the gem by executing:
|
16
|
+
|
17
|
+
$ gem install UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
TODO: Write usage instructions here
|
22
|
+
|
23
|
+
## Development
|
24
|
+
|
25
|
+
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
26
|
+
|
27
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
28
|
+
|
29
|
+
## Contributing
|
30
|
+
|
31
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/adsedare.
|
32
|
+
|
33
|
+
## License
|
34
|
+
|
35
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
data/adsedare.gemspec
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "lib/adsedare/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "adsedare"
|
7
|
+
spec.version = Adsedare::VERSION
|
8
|
+
spec.authors = ["alexstrnik"]
|
9
|
+
spec.email = ["alex.str.nik@gmail.com"]
|
10
|
+
|
11
|
+
spec.summary = "A cross-platform library for seamless, pain-free iOS ad-hoc distribution."
|
12
|
+
spec.description = "AdSedare is a powerful library designed to simplify the process of iOS ad-hoc distribution. By automating and streamlining the distribution of builds, it ensures a smooth, pain-free experience for developers and testers. AdSedare is ideal for anyone looking to automate the distribution of iOS apps, without the usual headaches associated with managing provisioning profiles, certificates, and manual setups."
|
13
|
+
spec.homepage = "https://github.com/AlexStrNik/AdSedare"
|
14
|
+
spec.license = "MIT"
|
15
|
+
spec.required_ruby_version = ">= 2.6.0"
|
16
|
+
|
17
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
18
|
+
spec.metadata["source_code_uri"] = "https://github.com/AlexStrNik/AdSedare"
|
19
|
+
|
20
|
+
spec.files = Dir.chdir(__dir__) do
|
21
|
+
`git ls-files -z`.split("\x0").reject do |f|
|
22
|
+
(File.expand_path(f) == __FILE__) ||
|
23
|
+
f.start_with?(*%w[bin/ test/ spec/ features/ .git .circleci appveyor Gemfile])
|
24
|
+
end
|
25
|
+
end
|
26
|
+
spec.bindir = "exe"
|
27
|
+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
28
|
+
spec.require_paths = ["lib"]
|
29
|
+
|
30
|
+
spec.add_dependency "rake", "~> 13.0"
|
31
|
+
spec.add_dependency "xcodeproj", "~> 1.27.0"
|
32
|
+
spec.add_dependency "jwt", "~> 2.7"
|
33
|
+
spec.add_dependency "faraday", "~> 2.7"
|
34
|
+
spec.add_dependency "faraday-cookie_jar", "~> 0.0.7"
|
35
|
+
spec.add_dependency "plist", "~> 3.2.0"
|
36
|
+
end
|
data/exe/adsedare
ADDED
@@ -0,0 +1,138 @@
|
|
1
|
+
require "plist"
|
2
|
+
|
3
|
+
module Adsedare
|
4
|
+
ENTITLEMENTS_MAPPING = {
|
5
|
+
"com.apple.security.application-groups" => "APP_GROUPS",
|
6
|
+
"com.apple.developer.in-app-payments" => "APPLE_PAY",
|
7
|
+
"com.apple.developer.associated-domains" => "ASSOCIATED_DOMAINS",
|
8
|
+
"com.apple.developer.healthkit" => "HEALTHKIT",
|
9
|
+
"com.apple.developer.homekit" => "HOMEKIT",
|
10
|
+
"com.apple.developer.networking.HotspotConfiguration" => "HOTSPOT",
|
11
|
+
"com.apple.developer.networking.multipath" => "MULTIPATH",
|
12
|
+
"com.apple.developer.networking.networkextension" => "NETWORK_EXTENSION",
|
13
|
+
"com.apple.developer.nfc.readersession.formats" => "NFC_TAG_READING",
|
14
|
+
"com.apple.developer.networking.vpn.api" => "PERSONAL_VPN",
|
15
|
+
"com.apple.external-accessory.wireless-configuration" => "WIRELESS_ACCESSORY_CONFIGURATION",
|
16
|
+
"com.apple.developer.siri" => "SIRI",
|
17
|
+
"com.apple.developer.pass-type-identifiers" => "WALLET",
|
18
|
+
"com.apple.developer.icloud-services" => "ICLOUD",
|
19
|
+
"com.apple.developer.icloud-container-identifiers" => "ICLOUD",
|
20
|
+
"com.apple.developer.ubiquity-container-identifiers" => "ICLOUD",
|
21
|
+
"com.apple.developer.ubiquity-kvstore-identifier" => "ICLOUD",
|
22
|
+
"com.apple.developer.ClassKit-environment" => "CLASSKIT",
|
23
|
+
"com.apple.developer.authentication-services.autofill-credential-provider" => "AUTOFILL_CREDENTIAL_PROVIDER",
|
24
|
+
"com.apple.developer.applesignin" => "SIGN_IN_WITH_APPLE",
|
25
|
+
"com.apple.developer.usernotifications.communication" => "COMMUNICATION_NOTIFICATIONS",
|
26
|
+
"com.apple.developer.usernotifications.time-sensitive" => "USERNOTIFICATIONS_TIMESENSITIVE",
|
27
|
+
"com.apple.developer.group-session" => "GROUP_ACTIVITIES",
|
28
|
+
"com.apple.developer.family-controls" => "FAMILY_CONTROLS",
|
29
|
+
"com.apple.developer.devicecheck.appattest-environment" => "APP_ATTEST",
|
30
|
+
"com.apple.developer.game-center" => "GAME_CENTER",
|
31
|
+
"com.apple.developer.carplay-maps" => "CARPLAY_NAVIGATION"
|
32
|
+
}
|
33
|
+
|
34
|
+
class << self
|
35
|
+
private
|
36
|
+
|
37
|
+
def parse_entitlements(path)
|
38
|
+
raise Error, "Entitlements file not found: #{path}" unless File.exist?(path)
|
39
|
+
|
40
|
+
entitlements = Plist.parse_xml(path)
|
41
|
+
capabilities = []
|
42
|
+
|
43
|
+
entitlements.each do |key, value|
|
44
|
+
capability_type = ENTITLEMENTS_MAPPING[key]
|
45
|
+
next unless capability_type
|
46
|
+
|
47
|
+
if key == "com.apple.security.application-groups"
|
48
|
+
capabilities << AppGroupsCapability.new(capability_type, value)
|
49
|
+
else
|
50
|
+
capabilities << SimpleCapability.new(capability_type)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
capabilities
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
class Capability
|
59
|
+
attr_reader :type
|
60
|
+
|
61
|
+
def initialize(type)
|
62
|
+
@type = type
|
63
|
+
end
|
64
|
+
|
65
|
+
def check?(bundle_info)
|
66
|
+
bundle_info["included"].any? {
|
67
|
+
|cap| cap["type"] == "capabilities" && cap["id"] == @type
|
68
|
+
}
|
69
|
+
end
|
70
|
+
|
71
|
+
def to_bundle_capability(bundle_info, team_id)
|
72
|
+
return {
|
73
|
+
"type" => "bundleIdCapabilities",
|
74
|
+
"attributes" => {
|
75
|
+
"enabled" => true,
|
76
|
+
"settings" => []
|
77
|
+
},
|
78
|
+
"relationships" => {
|
79
|
+
"capability" => {
|
80
|
+
"data" => { "type" => "capabilities", "id" => @type }
|
81
|
+
}
|
82
|
+
}
|
83
|
+
}
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
class SimpleCapability < Capability
|
88
|
+
end
|
89
|
+
|
90
|
+
class AppGroupsCapability < Capability
|
91
|
+
attr_reader :groups
|
92
|
+
|
93
|
+
def initialize(type, groups)
|
94
|
+
super(type)
|
95
|
+
@groups = groups
|
96
|
+
end
|
97
|
+
|
98
|
+
def check?(bundle_info)
|
99
|
+
have_capability = bundle_info["included"].any? {
|
100
|
+
|cap| cap["type"] == "capabilities" && cap["id"] == @type
|
101
|
+
}
|
102
|
+
return false unless have_capability
|
103
|
+
|
104
|
+
registered_groups = bundle_info["included"].select {
|
105
|
+
|cap| cap["type"] == "appGroups"
|
106
|
+
}.map {
|
107
|
+
|cap| cap["attributes"]["identifier"]
|
108
|
+
}
|
109
|
+
|
110
|
+
return @groups.all? { |group| registered_groups.include?(group) }
|
111
|
+
end
|
112
|
+
|
113
|
+
def to_bundle_capability(bundle_info, team_id)
|
114
|
+
registered_app_groups = {}
|
115
|
+
|
116
|
+
Starship::Client.get_app_groups(team_id).each {
|
117
|
+
|app_group| registered_app_groups[app_group["identifier"]] = app_group["applicationGroup"]
|
118
|
+
}
|
119
|
+
|
120
|
+
@groups.each do |group|
|
121
|
+
if not registered_app_groups.include?(group)
|
122
|
+
new_app_group = Starship::Client.create_app_group(group, team_id)
|
123
|
+
registered_app_groups[new_app_group["identifier"]] = new_app_group["applicationGroup"]
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
bundle_capability = super(bundle_info, team_id)
|
128
|
+
|
129
|
+
app_groups = {
|
130
|
+
"data" => @groups.map { |group| { "type" => "appGroups", "id" => registered_app_groups[group] } }
|
131
|
+
}
|
132
|
+
|
133
|
+
bundle_capability["relationships"]["appGroups"] = app_groups
|
134
|
+
|
135
|
+
return bundle_capability
|
136
|
+
end
|
137
|
+
end
|
138
|
+
end
|