cocoapods-pod-sign 1.1.2 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -1
- data/example/podSign/Gemfile.lock +1 -1
- data/example/podSign/Podfile +3 -1
- data/example/podSign/Podfile.lock +16 -0
- data/lib/cocoapods-pod-sign/gem_version.rb +1 -1
- data/lib/cocoapods-pod-sign/pod_installer.rb +20 -14
- data/lib/cocoapods-pod-sign/pod_sign_storage.rb +22 -0
- data/lib/cocoapods-pod-sign/podfile_dsl.rb +9 -2
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae36027d6261be7b237768a00b5522befd9687e7910413a952b38ebce7cfd505
|
4
|
+
data.tar.gz: e1553b504f0c5f5e3b7879451becbd6996f51d54dbb296fab6746a229f5b8b54
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d25d0e96784f72f2f10be216aa2db1d86237fc1af1477df6a2314f6e8f56a8b228a5e355b674f245197869c50950c0ded0258b45b1e0c27258ba5530f092e00
|
7
|
+
data.tar.gz: 326b654ca7da559bb9487dd8b5f4dfd948e68f10938ceb84757ba27a43a268a866025a6a3d16bb3bd47a526c2af53a8780729943181f8dd4803e7ba43ebb8f68
|
data/README.md
CHANGED
@@ -10,11 +10,22 @@ cocoapods-pod-sign is a tool to help you set cocopads bundle identifier and team
|
|
10
10
|
|
11
11
|
## Usage
|
12
12
|
|
13
|
+
### Recommended
|
14
|
+
|
15
|
+
I have received several user feedback encountering errors. I just added a new method to skip the signature. I recommend using the skip signature setting.
|
16
|
+
|
17
|
+
```
|
18
|
+
plugin 'cocoapods-pod-sign'
|
19
|
+
skip_pod_bundle_sign
|
20
|
+
```
|
21
|
+
|
22
|
+
## No recommended
|
23
|
+
|
13
24
|
There are two ways to use it, one is to automatically obtain the bundle identifier and team, and the other is to set it manually.
|
14
25
|
|
15
26
|
### Automatically
|
16
27
|
|
17
|
-
Just write the following code into the Podfile, it will automatically read the bundle identifier and team from the main project.
|
28
|
+
Just write the following code into the Podfile, it will automatically read the bundle identifier(version 2.x.x no longer sets bundle identifier) and team from the main project.
|
18
29
|
|
19
30
|
plugin 'cocoapods-pod-sign'
|
20
31
|
|
data/example/podSign/Podfile
CHANGED
@@ -6,8 +6,10 @@ target 'podSign' do
|
|
6
6
|
# Comment the next line if you don't want to use dynamic frameworks
|
7
7
|
# use_frameworks!
|
8
8
|
|
9
|
-
plugin 'cocoapods-pod-sign'
|
9
|
+
plugin 'cocoapods-pod-sign' # automatically read the bundle identifier(version 2.x.x no longer sets bundle identifier) and team from the main project.
|
10
|
+
skip_pod_bundle_sign # forbid pod sign
|
10
11
|
|
12
|
+
# manually specify the bundle identifier and team under different configs
|
11
13
|
# config_pod_bundle_id_and_team_id({
|
12
14
|
# 'Debug' => {:bundle_id => 'com.aaa.bbb', :team_id => 'ABCDEFG'},
|
13
15
|
# 'Release' => {:bundle_id => 'com.ccc.ddd', :team_id => 'HIJKLMN'},
|
@@ -0,0 +1,16 @@
|
|
1
|
+
PODS:
|
2
|
+
- bundleSign (0.1.0)
|
3
|
+
|
4
|
+
DEPENDENCIES:
|
5
|
+
- bundleSign (from `./bundleSign`)
|
6
|
+
|
7
|
+
EXTERNAL SOURCES:
|
8
|
+
bundleSign:
|
9
|
+
:path: "./bundleSign"
|
10
|
+
|
11
|
+
SPEC CHECKSUMS:
|
12
|
+
bundleSign: 8fa720adfff2d8b5873bb9ca197d670614cce05f
|
13
|
+
|
14
|
+
PODFILE CHECKSUM: 06f86eec5843bf02524d3efd1c1c857234a1aa84
|
15
|
+
|
16
|
+
COCOAPODS: 1.10.2
|
@@ -1,4 +1,5 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
require 'cocoapods-pod-sign/pod_sign_storage'
|
2
3
|
|
3
4
|
module Pod
|
4
5
|
class Installer
|
@@ -6,7 +7,9 @@ module Pod
|
|
6
7
|
alias_method :origin_run_podfile_post_install_hook, :run_podfile_post_install_hook
|
7
8
|
def run_podfile_post_install_hook
|
8
9
|
|
9
|
-
|
10
|
+
storage = PodSignStorage.instance
|
11
|
+
|
12
|
+
pod_sign_extract_team_id_from_user_project if storage.configurations.empty? && !storage.skip_sign
|
10
13
|
|
11
14
|
targets = if installation_options.generate_multiple_pod_projects
|
12
15
|
pod_target_subprojects.flat_map { |p| p.targets }
|
@@ -17,10 +20,14 @@ module Pod
|
|
17
20
|
next unless target.respond_to?('product_type') && target.product_type == 'com.apple.product-type.bundle'
|
18
21
|
|
19
22
|
target.build_configurations.each do |config|
|
20
|
-
|
23
|
+
if storage.skip_sign
|
24
|
+
config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
|
25
|
+
next
|
26
|
+
end
|
27
|
+
sign_config = storage.configurations[config.name]
|
21
28
|
next unless sign_config.instance_of?(Hash)
|
22
29
|
|
23
|
-
config.build_settings['PRODUCT_BUNDLE_IDENTIFIER'] = sign_config[:bundle_id]
|
30
|
+
config.build_settings['PRODUCT_BUNDLE_IDENTIFIER'] = sign_config[:bundle_id] unless sign_config[:bundle_id].nil?
|
24
31
|
config.build_settings['DEVELOPMENT_TEAM'] = sign_config[:team_id]
|
25
32
|
config.build_settings['CODE_SIGN_STYLE'] = if sign_config[:sign_style]
|
26
33
|
sign_config[:sign_style]
|
@@ -41,7 +48,7 @@ module Pod
|
|
41
48
|
|
42
49
|
private
|
43
50
|
|
44
|
-
def
|
51
|
+
def pod_sign_extract_team_id_from_user_project
|
45
52
|
target = aggregate_targets.first.user_project.root_object.targets.first
|
46
53
|
target&.build_configurations&.each do |config|
|
47
54
|
xcconfig_hash ||=
|
@@ -50,23 +57,22 @@ module Pod
|
|
50
57
|
else
|
51
58
|
{}
|
52
59
|
end
|
53
|
-
|
54
|
-
|
60
|
+
pod_sign_extract_team_id(xcconfig_hash, config.name)
|
61
|
+
pod_sign_extract_team_id(config.build_settings, config.name)
|
55
62
|
end
|
56
63
|
end
|
57
64
|
|
58
|
-
def
|
59
|
-
bundle_id = build_settings['PRODUCT_BUNDLE_IDENTIFIER']
|
65
|
+
def pod_sign_extract_team_id(build_settings, config_name)
|
60
66
|
team_id = build_settings['DEVELOPMENT_TEAM']
|
61
67
|
sign_style = build_settings['CODE_SIGN_STYLE']
|
62
68
|
sign_identity = build_settings['CODE_SIGN_IDENTITY']
|
63
|
-
return unless
|
69
|
+
return unless team_id && config_name
|
70
|
+
|
71
|
+
storage = PodSignStorage.instance
|
72
|
+
storage.configurations[config_name] = { team_id: team_id,
|
73
|
+
sign_style: sign_style,
|
74
|
+
sign_identity: sign_identity }
|
64
75
|
|
65
|
-
$pod_sign_configurations_hash[config_name] = { bundle_id: bundle_id,
|
66
|
-
team_id: team_id,
|
67
|
-
sign_style: sign_style,
|
68
|
-
sign_identity: sign_identity }
|
69
|
-
|
70
76
|
end
|
71
77
|
end
|
72
78
|
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'singleton'
|
2
|
+
|
3
|
+
class PodSignStorage
|
4
|
+
include Singleton
|
5
|
+
|
6
|
+
attr_writer :skip_sign
|
7
|
+
attr_writer :configurations
|
8
|
+
|
9
|
+
def skip_sign
|
10
|
+
return @skip_sign if defined?(@skip_sign)
|
11
|
+
|
12
|
+
@skip_sign = false
|
13
|
+
end
|
14
|
+
|
15
|
+
def configurations
|
16
|
+
return @configurations if defined?(@configurations)
|
17
|
+
|
18
|
+
@configurations = {}
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
|
@@ -1,6 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
|
3
|
+
require 'cocoapods-pod-sign/pod_sign_storage'
|
4
|
+
|
4
5
|
module Pod
|
5
6
|
class Podfile
|
6
7
|
module DSL
|
@@ -21,7 +22,13 @@ module Pod
|
|
21
22
|
end
|
22
23
|
end
|
23
24
|
UI.info 'config_pod_bundle_id_and_team_id parameters setup success'
|
24
|
-
|
25
|
+
storage = PodSignStorage.instance
|
26
|
+
storage.configurations = configurations
|
27
|
+
end
|
28
|
+
|
29
|
+
def skip_pod_bundle_sign
|
30
|
+
storage = PodSignStorage.instance
|
31
|
+
storage.skip_sign = true
|
25
32
|
end
|
26
33
|
end
|
27
34
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-pod-sign
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- wosicuanqi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-09-
|
11
|
+
date: 2022-09-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -54,6 +54,7 @@ files:
|
|
54
54
|
- example/podSign/Gemfile
|
55
55
|
- example/podSign/Gemfile.lock
|
56
56
|
- example/podSign/Podfile
|
57
|
+
- example/podSign/Podfile.lock
|
57
58
|
- example/podSign/bundleSign/.gitignore
|
58
59
|
- example/podSign/bundleSign/.travis.yml
|
59
60
|
- example/podSign/bundleSign/Example/Podfile
|
@@ -103,6 +104,7 @@ files:
|
|
103
104
|
- lib/cocoapods-pod-sign.rb
|
104
105
|
- lib/cocoapods-pod-sign/gem_version.rb
|
105
106
|
- lib/cocoapods-pod-sign/pod_installer.rb
|
107
|
+
- lib/cocoapods-pod-sign/pod_sign_storage.rb
|
106
108
|
- lib/cocoapods-pod-sign/podfile_dsl.rb
|
107
109
|
- lib/cocoapods_plugin.rb
|
108
110
|
- spec/command/sign_spec.rb
|