Class: Pindo::CertProcess::CustomHttpsCertOperator
- Inherits:
-
BaseCertOperator
- Object
- BaseCertOperator
- Pindo::CertProcess::CustomHttpsCertOperator
- Defined in:
- lib/pindo/module/cert/mode/custom_https_cert_operator.rb
Instance Method Summary collapse
-
#create_and_install_certs(apple_id:, bundle_id_array:, cert_type:, platform_type:) ⇒ Object
HTTPS 模式不支持创建证书.
-
#debug_mode? ⇒ Boolean
检查是否启用调试模式.
-
#fetch_and_install_certs(apple_id:, bundle_id_array:, cert_type:, platform_type:, project_dir: nil) ⇒ Object
主方法:从 HTTPS API 获取并安装证书.
-
#initialize ⇒ CustomHttpsCertOperator
constructor
A new instance of CustomHttpsCertOperator.
Constructor Details
#initialize ⇒ CustomHttpsCertOperator
Returns a new instance of CustomHttpsCertOperator.
15 16 17 18 19 |
# File 'lib/pindo/module/cert/mode/custom_https_cert_operator.rb', line 15 def initialize super @jps_client = nil @has_login = false end |
Instance Method Details
#create_and_install_certs(apple_id:, bundle_id_array:, cert_type:, platform_type:) ⇒ Object
HTTPS 模式不支持创建证书
93 94 95 |
# File 'lib/pindo/module/cert/mode/custom_https_cert_operator.rb', line 93 def create_and_install_certs(apple_id:, bundle_id_array:, cert_type:, platform_type:) raise_unsupported_error("创建证书") end |
#debug_mode? ⇒ Boolean
检查是否启用调试模式
22 23 24 |
# File 'lib/pindo/module/cert/mode/custom_https_cert_operator.rb', line 22 def debug_mode? ENV['PINDO_DEBUG'] == '1' || ENV['PINDO_DEBUG'] == 'true' end |
#fetch_and_install_certs(apple_id:, bundle_id_array:, cert_type:, platform_type:, project_dir: nil) ⇒ Object
主方法:从 HTTPS API 获取并安装证书
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/pindo/module/cert/mode/custom_https_cert_operator.rb', line 27 def fetch_and_install_certs(apple_id:, bundle_id_array:, cert_type:, platform_type:, project_dir: nil) Funlog.instance.("从 HTTPS API 获取并安装证书...") # 1. 验证配置并获取 config_parser config_parser = validate_and_get_config # 2. 初始化 JPSClient initialize_jps_client # 3. 创建临时工作目录 temp_dir = Dir.mktmpdir("pindo_https_certs_") begin # 4. 下载并安装证书到 Keychain cert_info = download_and_install_certificates( apple_id: apple_id, bundle_id_array: bundle_id_array, cert_type: cert_type, platform_type: platform_type, temp_dir: temp_dir ) # 5. 下载并安装 Provisioning Profiles provisioning_info_array = download_and_install_profiles( apple_id: apple_id, bundle_id_array: bundle_id_array, cert_type: cert_type, platform_type: platform_type, temp_dir: temp_dir ) # 6. 验证并保存证书信息,提取 Team ID team_id = validate_and_save_cert_info(provisioning_info_array) # 7. 执行 Swark 授权检查 ( cert_type: cert_type, team_id: team_id, config_parser: config_parser ) # 8. 配置 Xcode 工程 configure_xcode_for_certs( project_dir: project_dir, cert_type: cert_type, platform_type: platform_type, team_id: team_id, provisioning_info_array: provisioning_info_array, config_parser: config_parser ) Funlog.instance.("HTTPS 模式证书安装完成!") provisioning_info_array ensure # 清理临时目录(调试模式下保留) if temp_dir && Dir.exist?(temp_dir) if debug_mode? Funlog.instance.info("调试模式:临时目录已保留: #{temp_dir}") else FileUtils.remove_entry_secure(temp_dir) end end end end |