Module: JPSClient::API::AndroidJks
- Included in:
- Client
- Defined in:
- lib/jpsclient/api/android_jks.rb
Overview
Android JKS 证书相关 API 处理 /api/android_jks/* 路径的所有接口
支持的功能:
-
创建 JKS 证书(异步)
-
更新 JKS 证书信息
-
删除 JKS 证书
-
获取 JKS 证书列表
-
获取 JKS 证书详情
-
重命名 JKS 证书(异步)
-
APK 重签名(异步)
Instance Method Summary collapse
-
#create_android_jks(alias_name:, bundle_id:, store_password: nil, key_password: nil, validity: nil, distinguished_name: nil, google_account: nil, project_id: nil, remark: nil) ⇒ Hash
创建 Android JKS 证书(异步接口).
-
#delete_android_jks(id:) ⇒ Hash
删除 Android JKS 证书.
-
#get_android_jks_detail(bundle_id:) ⇒ Hash
获取 Android JKS 证书详情.
-
#get_android_jks_list(page_no: 1, page_size: 20, alias_name: nil, google_account: nil, project_id: nil) ⇒ Hash
获取 Android JKS 证书列表.
-
#rename_android_jks(id:, new_alias:, new_store_password:) ⇒ Hash
重命名 Android JKS 证书(异步接口).
-
#rewrite_apk(input_s3_key:, output_s3_key:, new_package:, jks_id:, s3_bucket: nil, use_aapt2: nil, skip_verify: nil) ⇒ Hash
APK 重签名(异步接口).
-
#update_android_jks(id:, bundle_id: nil, google_account: nil, project_id: nil, remark: nil) ⇒ Hash
更新 Android JKS 证书信息.
Instance Method Details
#create_android_jks(alias_name:, bundle_id:, store_password: nil, key_password: nil, validity: nil, distinguished_name: nil, google_account: nil, project_id: nil, remark: nil) ⇒ Hash
创建 Android JKS 证书(异步接口)
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/jpsclient/api/android_jks.rb', line 28 def create_android_jks(alias_name:, bundle_id:, store_password: nil, key_password: nil, validity: nil, distinguished_name: nil, google_account: nil, project_id: nil, remark: nil) config = @request_config && @request_config["android_jks_create"] raise JPSClient::ExceptionError, "Missing config for android_jks_create" unless config && config["url"] path = config["url"] body_params = { aliasName: alias_name, bundleId: bundle_id } body_params[:storePassword] = store_password if store_password body_params[:keyPassword] = key_password if key_password body_params[:validity] = validity if validity body_params[:distinguishedName] = distinguished_name if distinguished_name body_params[:googleAccount] = google_account if google_account body_params[:projectId] = project_id if project_id body_params[:remark] = remark if remark return request_with_auth(:post, path, body: body_params) end |
#delete_android_jks(id:) ⇒ Hash
删除 Android JKS 证书
73 74 75 76 77 78 79 80 81 |
# File 'lib/jpsclient/api/android_jks.rb', line 73 def delete_android_jks(id:) config = @request_config && @request_config["android_jks_delete"] raise JPSClient::ExceptionError, "Missing config for android_jks_delete" unless config && config["url"] path = config["url"] body_params = { id: id } return request_with_auth(:post, path, body: body_params) end |
#get_android_jks_detail(bundle_id:) ⇒ Hash
获取 Android JKS 证书详情
108 109 110 111 112 113 114 115 116 |
# File 'lib/jpsclient/api/android_jks.rb', line 108 def get_android_jks_detail(bundle_id:) config = @request_config && @request_config["android_jks_detail"] raise JPSClient::ExceptionError, "Missing config for android_jks_detail" unless config && config["url"] path = config["url"] get_params = { bundleId: bundle_id } return request_with_auth(:get, path, params: get_params) end |
#get_android_jks_list(page_no: 1, page_size: 20, alias_name: nil, google_account: nil, project_id: nil) ⇒ Hash
获取 Android JKS 证书列表
91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'lib/jpsclient/api/android_jks.rb', line 91 def get_android_jks_list(page_no: 1, page_size: 20, alias_name: nil, google_account: nil, project_id: nil) config = @request_config && @request_config["android_jks_list"] raise JPSClient::ExceptionError, "Missing config for android_jks_list" unless config && config["url"] path = config["url"] get_params = { pageNo: page_no, pageSize: page_size } get_params[:aliasName] = alias_name if alias_name get_params[:googleAccount] = google_account if google_account get_params[:projectId] = project_id if project_id return request_with_auth(:get, path, params: get_params) end |
#rename_android_jks(id:, new_alias:, new_store_password:) ⇒ Hash
重命名 Android JKS 证书(异步接口)
124 125 126 127 128 129 130 131 132 133 134 135 136 |
# File 'lib/jpsclient/api/android_jks.rb', line 124 def rename_android_jks(id:, new_alias:, new_store_password:) config = @request_config && @request_config["android_jks_rename"] raise JPSClient::ExceptionError, "Missing config for android_jks_rename" unless config && config["url"] path = config["url"] body_params = { id: id, newAlias: new_alias, newStorePassword: new_store_password } return request_with_auth(:post, path, body: body_params) end |
#rewrite_apk(input_s3_key:, output_s3_key:, new_package:, jks_id:, s3_bucket: nil, use_aapt2: nil, skip_verify: nil) ⇒ Hash
APK 重签名(异步接口)
148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 |
# File 'lib/jpsclient/api/android_jks.rb', line 148 def rewrite_apk(input_s3_key:, output_s3_key:, new_package:, jks_id:, s3_bucket: nil, use_aapt2: nil, skip_verify: nil) config = @request_config && @request_config["android_jks_rewrite_apk"] raise JPSClient::ExceptionError, "Missing config for android_jks_rewrite_apk" unless config && config["url"] path = config["url"] body_params = { inputS3Key: input_s3_key, outputS3Key: output_s3_key, newPackage: new_package, jksId: jks_id } body_params[:s3Bucket] = s3_bucket if s3_bucket body_params[:useAapt2] = use_aapt2 unless use_aapt2.nil? body_params[:skipVerify] = skip_verify unless skip_verify.nil? return request_with_auth(:post, path, body: body_params) end |
#update_android_jks(id:, bundle_id: nil, google_account: nil, project_id: nil, remark: nil) ⇒ Hash
更新 Android JKS 证书信息
55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/jpsclient/api/android_jks.rb', line 55 def update_android_jks(id:, bundle_id: nil, google_account: nil, project_id: nil, remark: nil) config = @request_config && @request_config["android_jks_update"] raise JPSClient::ExceptionError, "Missing config for android_jks_update" unless config && config["url"] path = config["url"] body_params = { id: id } body_params[:bundleId] = bundle_id if bundle_id body_params[:googleAccount] = google_account if google_account body_params[:projectId] = project_id if project_id body_params[:remark] = remark if remark return request_with_auth(:post, path, body: body_params) end |