pindo 5.10.8 → 5.11.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 +4 -4
- data/lib/pindo/command/android/autobuild.rb +38 -22
- data/lib/pindo/command/android/autoresign.rb +332 -0
- data/lib/pindo/command/android/build.rb +19 -12
- data/lib/pindo/command/android/{debug.rb → keystore.rb} +20 -25
- data/lib/pindo/command/android.rb +4 -3
- data/lib/pindo/command/{ipa/output.rb → appstore/adhocbuild.rb} +17 -17
- data/lib/pindo/command/{ipa → appstore}/autoresign.rb +11 -11
- data/lib/pindo/command/appstore/iap.rb +8 -8
- data/lib/pindo/command/{ipa → appstore}/import.rb +18 -18
- data/lib/pindo/command/appstore/itcapp.rb +8 -8
- data/lib/pindo/command/appstore/metadata.rb +8 -8
- data/lib/pindo/command/appstore/screenshots.rb +8 -8
- data/lib/pindo/command/appstore/upload.rb +8 -8
- data/lib/pindo/command/appstore.rb +6 -2
- data/lib/pindo/command/deploy/bundleid.rb +8 -8
- data/lib/pindo/command/deploy/cert.rb +10 -10
- data/lib/pindo/command/deploy/check.rb +8 -8
- data/lib/pindo/command/deploy.rb +1 -3
- data/lib/pindo/command/env/dreamstudio.rb +14 -12
- data/lib/pindo/command/env/quarkenv.rb +13 -11
- data/lib/pindo/command/env/swarkenv.rb +13 -11
- data/lib/pindo/command/env/workhard.rb +14 -12
- data/lib/pindo/command/env.rb +1 -1
- data/lib/pindo/command/gplay.rb +1 -1
- data/lib/pindo/command/ios/autobuild.rb +23 -15
- data/lib/pindo/command/ios/autoresign.rb +16 -16
- data/lib/pindo/command/ios/build.rb +12 -10
- data/lib/pindo/command/ios/{debug.rb → cert.rb} +26 -27
- data/lib/pindo/command/{lib/lint.rb → ios/podlint.rb} +6 -6
- data/lib/pindo/command/{lib/forcepush.rb → ios/podpush.rb} +123 -23
- data/lib/pindo/command/{lib/update.rb → ios/podupdate.rb} +5 -5
- data/lib/pindo/command/ios.rb +6 -2
- data/lib/pindo/command/jps/upload.rb +1 -1
- data/lib/pindo/command/jps.rb +1 -1
- data/lib/pindo/command/repo.rb +1 -1
- data/lib/pindo/command/unity/apk.rb +20 -15
- data/lib/pindo/command/unity/autobuild.rb +15 -21
- data/lib/pindo/command/unity/ipa.rb +21 -17
- data/lib/pindo/command/unity/{pack.rb → packbuild.rb} +17 -10
- data/lib/pindo/command/unity/{initpack.rb → packinit.rb} +10 -16
- data/lib/pindo/command/unity/{upload.rb → packpush.rb} +13 -19
- data/lib/pindo/command/unity/web.rb +19 -13
- data/lib/pindo/command/unity.rb +4 -4
- data/lib/pindo/command/{dev → utils}/feishu.rb +14 -14
- data/lib/pindo/command/{dev → utils}/repoinit.rb +8 -8
- data/lib/pindo/command/{dev → utils}/tag.rb +19 -19
- data/lib/pindo/command/utils.rb +9 -6
- data/lib/pindo/command/web/autobuild.rb +1 -1
- data/lib/pindo/command/web.rb +1 -1
- data/lib/pindo/command.rb +1 -4
- data/lib/pindo/module/android/android_build_config_helper.rb +83 -10
- data/lib/pindo/module/pgyer/pgyerhelper.rb +21 -1
- data/lib/pindo/version.rb +1 -1
- metadata +16 -22
- data/lib/pindo/command/dev.rb +0 -21
- data/lib/pindo/command/feishu/send_message.rb +0 -103
- data/lib/pindo/command/feishu.rb +0 -50
- data/lib/pindo/command/ios/adhoc.rb +0 -245
- data/lib/pindo/command/ipa.rb +0 -16
- data/lib/pindo/command/lib/push.rb +0 -157
- data/lib/pindo/command/lib.rb +0 -16
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9db73f41101f42c5e6c5720c835349fd3cb939a20b39b1545a8465eea3dd3023
|
|
4
|
+
data.tar.gz: ef0b756305492f0d17d941fae20be96468241a8c3c535eed303e8c9fe2cfe11f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 19c0742fc87cc84ae4bfc94a3d9d12f75925cfbb676b7bb918b87f025611e322c0ac6da71bbc2245a0d03790f69ef61b97b6a6b33e404362f95da3f408535c22
|
|
7
|
+
data.tar.gz: d93f7847bee0d02afe1c5b8e422801c4d4aa62e783b100008fb8fe442e1d3971b5a1ae5243725e10760595f785fcfcb358e4e05f91295ac23b5134875fa7fd40
|
|
@@ -13,7 +13,7 @@ module Pindo
|
|
|
13
13
|
include Appselect
|
|
14
14
|
include Pindo::Githelper
|
|
15
15
|
|
|
16
|
-
self.summary = '
|
|
16
|
+
self.summary = '编译APK,自动修改工程配置,支持上传到JPS测试平台'
|
|
17
17
|
|
|
18
18
|
# 启用缓存机制
|
|
19
19
|
def self.use_cache?
|
|
@@ -21,25 +21,33 @@ module Pindo
|
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
self.description = <<-DESC
|
|
24
|
-
|
|
24
|
+
编译Android工程生成APK/AAB并支持上传到JPS测试平台。
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
支持功能:
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
PINDO_TAG_DECISION - 指定Tag策略(new/retag/skip/exit)
|
|
30
|
-
PINDO_FORCE_BUILD - 存在时自动使用缓存选择
|
|
28
|
+
* 自动修改工程配置(Application ID、App Name、URL Schemes)
|
|
31
29
|
|
|
32
|
-
|
|
30
|
+
* 编译生成APK或AAB文件
|
|
33
31
|
|
|
34
|
-
|
|
35
|
-
$ pindo android autobuild --release # 编译Release包
|
|
36
|
-
$ pindo android autobuild --upload # 编译并上传
|
|
37
|
-
$ pindo android autobuild --send # 编译、上传并发送群组通知
|
|
38
|
-
$ pindo android autobuild --bundle_name=com.example.app # 使用指定bundle name的配置
|
|
32
|
+
* 支持上传到JPS测试平台
|
|
39
33
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
34
|
+
* 支持发送测试通知
|
|
35
|
+
|
|
36
|
+
* 支持Unity和原生Android工程
|
|
37
|
+
|
|
38
|
+
使用示例:
|
|
39
|
+
|
|
40
|
+
$ pindo android autobuild # 编译Debug包
|
|
41
|
+
|
|
42
|
+
$ pindo android autobuild --release # 编译Release包
|
|
43
|
+
|
|
44
|
+
$ pindo android autobuild --upload # 编译并上传到JPS
|
|
45
|
+
|
|
46
|
+
$ pindo android autobuild --send # 编译、上传并发送群组通知
|
|
47
|
+
|
|
48
|
+
$ pindo android autobuild --bundle_name=com.example.app # 使用指定bundle name的配置
|
|
49
|
+
|
|
50
|
+
$ pindo android autobuild --proj="My App" # 指定项目名称
|
|
43
51
|
DESC
|
|
44
52
|
|
|
45
53
|
def self.options
|
|
@@ -115,6 +123,16 @@ module Pindo
|
|
|
115
123
|
|
|
116
124
|
pindo_project_dir = Dir.pwd
|
|
117
125
|
|
|
126
|
+
build_helper = Pindo::BuildHelper.share_instance
|
|
127
|
+
if @args_upload_flag
|
|
128
|
+
is_need_add_tag,tag_action_parms = build_helper.check_is_need_add_tag?(pindo_project_dir)
|
|
129
|
+
if is_need_add_tag
|
|
130
|
+
Pindo::Command::Utils::Tag::run(tag_action_parms)
|
|
131
|
+
end
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
118
136
|
app_info_obj = nil
|
|
119
137
|
workflow_info = nil
|
|
120
138
|
proj_name = @args_proj_name
|
|
@@ -211,13 +229,11 @@ module Pindo
|
|
|
211
229
|
end
|
|
212
230
|
end
|
|
213
231
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
end
|
|
220
|
-
end
|
|
232
|
+
# 添加基于 Application ID 的 Scheme
|
|
233
|
+
# 无论是使用 workflow 的默认 Application ID,还是通过 bundle_name 覆盖的,都需要添加对应的 Scheme
|
|
234
|
+
Pindo::AndroidBuildConfigHelper.add_application_id_based_scheme(
|
|
235
|
+
project_dir: pindo_project_dir
|
|
236
|
+
)
|
|
221
237
|
|
|
222
238
|
begin
|
|
223
239
|
android_build_helper = Pindo::AndroidBuildHelper.share_instance
|
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
require 'highline/import'
|
|
2
|
+
require 'fileutils'
|
|
3
|
+
require 'pindo/base/executable'
|
|
4
|
+
|
|
5
|
+
module Pindo
|
|
6
|
+
class Command
|
|
7
|
+
class Android < Command
|
|
8
|
+
class Autoresign < Android
|
|
9
|
+
|
|
10
|
+
include Appselect
|
|
11
|
+
|
|
12
|
+
self.summary = 'APK包重签名工具'
|
|
13
|
+
|
|
14
|
+
self.description = <<-DESC
|
|
15
|
+
使用指定的keystore重新签名APK包。
|
|
16
|
+
|
|
17
|
+
支持功能:
|
|
18
|
+
|
|
19
|
+
* 自动查找APK文件
|
|
20
|
+
|
|
21
|
+
* 使用debug或release keystore签名
|
|
22
|
+
|
|
23
|
+
* 支持指定APK路径
|
|
24
|
+
|
|
25
|
+
* 支持上传到JPS测试平台
|
|
26
|
+
|
|
27
|
+
* 支持发送测试通知
|
|
28
|
+
|
|
29
|
+
* 自动zipalign优化
|
|
30
|
+
|
|
31
|
+
使用示例:
|
|
32
|
+
|
|
33
|
+
$ pindo and autoresign # 重签名当前目录下的APK
|
|
34
|
+
|
|
35
|
+
$ pindo and autoresign demo.apk # 重签名指定APK文件
|
|
36
|
+
|
|
37
|
+
$ pindo and autoresign --release # 使用release keystore签名
|
|
38
|
+
|
|
39
|
+
$ pindo and autoresign --adhoc # 使用adhoc keystore签名
|
|
40
|
+
|
|
41
|
+
$ pindo and autoresign --upload # 重签名并上传到JPS
|
|
42
|
+
|
|
43
|
+
$ pindo and autoresign --send # 重签名、上传并发送通知
|
|
44
|
+
DESC
|
|
45
|
+
|
|
46
|
+
self.arguments = [
|
|
47
|
+
CLAide::Argument.new('path/to/demo.apk', true),
|
|
48
|
+
]
|
|
49
|
+
|
|
50
|
+
def self.options
|
|
51
|
+
[
|
|
52
|
+
['--apk', '指定要重签名的APK文件路径'],
|
|
53
|
+
['--release', '使用release keystore签名'],
|
|
54
|
+
['--adhoc', '使用adhoc keystore签名(默认)'],
|
|
55
|
+
['--proj', '指定上传到测试平台的项目名称'],
|
|
56
|
+
['--upload', '上传重签名后的APK到测试平台'],
|
|
57
|
+
['--send', '上传成功后发送测试通知'],
|
|
58
|
+
].concat(super)
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
def initialize(argv)
|
|
62
|
+
@args_apk_file = argv.shift_argument
|
|
63
|
+
@args_set_apk_name = argv.option('apk')
|
|
64
|
+
@args_release_flag = argv.flag?('release', false)
|
|
65
|
+
@args_adhoc_flag = argv.flag?('adhoc', true)
|
|
66
|
+
|
|
67
|
+
@args_upload_flag = argv.flag?('upload', false)
|
|
68
|
+
@args_send_flag = argv.flag?('send', false)
|
|
69
|
+
@args_proj_name = argv.option('proj')
|
|
70
|
+
|
|
71
|
+
if @args_send_flag
|
|
72
|
+
@args_upload_flag = true
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
super
|
|
76
|
+
@additional_args = argv.remainder!
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
def run
|
|
80
|
+
# 查找APK文件
|
|
81
|
+
apk_file_name = find_apk_file
|
|
82
|
+
|
|
83
|
+
if apk_file_name.nil? || !File.exist?(apk_file_name)
|
|
84
|
+
Funlog.instance.fancyinfo_error("未找到APK文件")
|
|
85
|
+
return
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
puts
|
|
89
|
+
puts "正在重签名的APK: #{apk_file_name}"
|
|
90
|
+
puts "文件大小: #{(File.size(apk_file_name) / 1024.0 / 1024.0).round(2)} MB"
|
|
91
|
+
puts "修改时间: #{File.mtime(apk_file_name)}"
|
|
92
|
+
puts
|
|
93
|
+
|
|
94
|
+
# 获取keystore配置
|
|
95
|
+
keystore_info = get_keystore_info
|
|
96
|
+
|
|
97
|
+
if keystore_info.nil?
|
|
98
|
+
Funlog.instance.fancyinfo_error("无法获取keystore配置")
|
|
99
|
+
return
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# 执行重签名
|
|
103
|
+
resigned_apk = resign_apk(apk_file_name, keystore_info)
|
|
104
|
+
|
|
105
|
+
if resigned_apk.nil?
|
|
106
|
+
Funlog.instance.fancyinfo_error("重签名失败")
|
|
107
|
+
return
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
puts
|
|
111
|
+
Funlog.instance.fancyinfo_success("重签名成功: #{resigned_apk}")
|
|
112
|
+
puts
|
|
113
|
+
|
|
114
|
+
# 上传到JPS
|
|
115
|
+
if @args_upload_flag
|
|
116
|
+
upload_to_jps(resigned_apk)
|
|
117
|
+
end
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
private
|
|
121
|
+
|
|
122
|
+
def find_apk_file
|
|
123
|
+
apk_file_name = @args_apk_file
|
|
124
|
+
if !@args_set_apk_name.nil?
|
|
125
|
+
apk_file_name = @args_set_apk_name
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
if !apk_file_name.nil? && File.exist?(apk_file_name)
|
|
129
|
+
return apk_file_name
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
# 查找当前目录下最新的APK文件
|
|
133
|
+
current_dir = Dir.pwd
|
|
134
|
+
apk_files = Dir.glob(File.join(current_dir, "*.apk"))
|
|
135
|
+
|
|
136
|
+
# 排除已经重签名的文件,优先选择最新的
|
|
137
|
+
apk_file_name = apk_files.max_by do |f|
|
|
138
|
+
if File.basename(f).include?("_resigned")
|
|
139
|
+
Time.local(0, 1, 1)
|
|
140
|
+
else
|
|
141
|
+
File.mtime(f)
|
|
142
|
+
end
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
return apk_file_name
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
def get_keystore_info
|
|
149
|
+
# 根据参数确定使用哪个keystore
|
|
150
|
+
keystore_type = @args_release_flag ? "release" : "adhoc"
|
|
151
|
+
|
|
152
|
+
# 从配置中获取keystore信息
|
|
153
|
+
config_json = load_config_json
|
|
154
|
+
return nil if config_json.nil?
|
|
155
|
+
|
|
156
|
+
keystore_info = {}
|
|
157
|
+
|
|
158
|
+
if keystore_type == "release"
|
|
159
|
+
keystore_info[:path] = config_json['app_android_keystore_release']
|
|
160
|
+
keystore_info[:password] = config_json['app_android_keystore_release_password']
|
|
161
|
+
keystore_info[:alias] = config_json['app_android_keystore_release_alias']
|
|
162
|
+
keystore_info[:alias_password] = config_json['app_android_keystore_release_alias_password']
|
|
163
|
+
else
|
|
164
|
+
keystore_info[:path] = config_json['app_android_keystore_adhoc']
|
|
165
|
+
keystore_info[:password] = config_json['app_android_keystore_adhoc_password']
|
|
166
|
+
keystore_info[:alias] = config_json['app_android_keystore_adhoc_alias']
|
|
167
|
+
keystore_info[:alias_password] = config_json['app_android_keystore_adhoc_alias_password']
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
# 验证keystore文件存在
|
|
171
|
+
if keystore_info[:path].nil? || !File.exist?(keystore_info[:path])
|
|
172
|
+
Funlog.instance.fancyinfo_error("Keystore文件不存在: #{keystore_info[:path]}")
|
|
173
|
+
return nil
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
puts "使用Keystore: #{keystore_info[:path]}"
|
|
177
|
+
puts "Keystore类型: #{keystore_type}"
|
|
178
|
+
|
|
179
|
+
return keystore_info
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
def resign_apk(apk_file, keystore_info)
|
|
183
|
+
# 准备输出文件名
|
|
184
|
+
base_name = File.basename(apk_file, ".apk")
|
|
185
|
+
output_dir = File.dirname(apk_file)
|
|
186
|
+
|
|
187
|
+
# 生成临时文件名
|
|
188
|
+
unsigned_apk = File.join(output_dir, "#{base_name}_unsigned.apk")
|
|
189
|
+
aligned_apk = File.join(output_dir, "#{base_name}_aligned.apk")
|
|
190
|
+
resigned_apk = File.join(output_dir, "#{base_name}_resigned.apk")
|
|
191
|
+
|
|
192
|
+
begin
|
|
193
|
+
# 1. 移除原有签名
|
|
194
|
+
puts "1. 移除原有签名..."
|
|
195
|
+
FileUtils.cp(apk_file, unsigned_apk)
|
|
196
|
+
system("zip -d \"#{unsigned_apk}\" META-INF/\\* > /dev/null 2>&1")
|
|
197
|
+
|
|
198
|
+
# 2. zipalign优化
|
|
199
|
+
puts "2. 执行zipalign优化..."
|
|
200
|
+
zipalign_cmd = "zipalign -v 4 \"#{unsigned_apk}\" \"#{aligned_apk}\""
|
|
201
|
+
|
|
202
|
+
if !system(zipalign_cmd)
|
|
203
|
+
# 如果zipalign失败,尝试使用Android SDK中的zipalign
|
|
204
|
+
android_home = ENV['ANDROID_HOME'] || ENV['ANDROID_SDK_ROOT']
|
|
205
|
+
if android_home
|
|
206
|
+
build_tools_dir = Dir.glob(File.join(android_home, "build-tools", "*")).max
|
|
207
|
+
if build_tools_dir
|
|
208
|
+
zipalign_path = File.join(build_tools_dir, "zipalign")
|
|
209
|
+
if File.exist?(zipalign_path)
|
|
210
|
+
zipalign_cmd = "\"#{zipalign_path}\" -v 4 \"#{unsigned_apk}\" \"#{aligned_apk}\""
|
|
211
|
+
system(zipalign_cmd)
|
|
212
|
+
end
|
|
213
|
+
end
|
|
214
|
+
else
|
|
215
|
+
# 如果没有zipalign,直接使用未对齐的APK
|
|
216
|
+
FileUtils.cp(unsigned_apk, aligned_apk)
|
|
217
|
+
end
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
# 3. 使用apksigner重新签名
|
|
221
|
+
puts "3. 重新签名APK..."
|
|
222
|
+
apksigner_cmd = [
|
|
223
|
+
"apksigner", "sign",
|
|
224
|
+
"--ks", keystore_info[:path],
|
|
225
|
+
"--ks-pass", "pass:#{keystore_info[:password]}",
|
|
226
|
+
"--ks-key-alias", keystore_info[:alias],
|
|
227
|
+
"--key-pass", "pass:#{keystore_info[:alias_password]}",
|
|
228
|
+
"--out", resigned_apk,
|
|
229
|
+
aligned_apk
|
|
230
|
+
].join(" ")
|
|
231
|
+
|
|
232
|
+
if !system(apksigner_cmd)
|
|
233
|
+
# 如果apksigner失败,尝试使用jarsigner
|
|
234
|
+
puts "尝试使用jarsigner..."
|
|
235
|
+
jarsigner_cmd = [
|
|
236
|
+
"jarsigner",
|
|
237
|
+
"-verbose",
|
|
238
|
+
"-sigalg", "SHA256withRSA",
|
|
239
|
+
"-digestalg", "SHA-256",
|
|
240
|
+
"-keystore", keystore_info[:path],
|
|
241
|
+
"-storepass", keystore_info[:password],
|
|
242
|
+
"-keypass", keystore_info[:alias_password],
|
|
243
|
+
aligned_apk,
|
|
244
|
+
keystore_info[:alias]
|
|
245
|
+
].join(" ")
|
|
246
|
+
|
|
247
|
+
if system(jarsigner_cmd)
|
|
248
|
+
FileUtils.mv(aligned_apk, resigned_apk)
|
|
249
|
+
else
|
|
250
|
+
Funlog.instance.fancyinfo_error("签名失败")
|
|
251
|
+
return nil
|
|
252
|
+
end
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
# 4. 验证签名
|
|
256
|
+
puts "4. 验证签名..."
|
|
257
|
+
verify_cmd = "apksigner verify \"#{resigned_apk}\""
|
|
258
|
+
if !system(verify_cmd)
|
|
259
|
+
# 尝试使用jarsigner验证
|
|
260
|
+
system("jarsigner -verify \"#{resigned_apk}\"")
|
|
261
|
+
end
|
|
262
|
+
|
|
263
|
+
return resigned_apk
|
|
264
|
+
|
|
265
|
+
ensure
|
|
266
|
+
# 清理临时文件
|
|
267
|
+
FileUtils.rm_f(unsigned_apk) if File.exist?(unsigned_apk)
|
|
268
|
+
FileUtils.rm_f(aligned_apk) if File.exist?(aligned_apk)
|
|
269
|
+
end
|
|
270
|
+
end
|
|
271
|
+
|
|
272
|
+
def upload_to_jps(apk_file)
|
|
273
|
+
# 上传到JPS平台
|
|
274
|
+
Funlog.instance.fancyinfo_start("开始上传到JPS测试平台...")
|
|
275
|
+
|
|
276
|
+
upload_params = [apk_file]
|
|
277
|
+
upload_params << "--proj=#{@args_proj_name}" if @args_proj_name
|
|
278
|
+
upload_params << "--send" if @args_send_flag
|
|
279
|
+
|
|
280
|
+
# 调用jps upload命令
|
|
281
|
+
Pindo::Command::Jps::Upload.run(upload_params)
|
|
282
|
+
|
|
283
|
+
Funlog.instance.fancyinfo_success("上传完成")
|
|
284
|
+
end
|
|
285
|
+
|
|
286
|
+
def load_config_json
|
|
287
|
+
# 查找并加载配置文件
|
|
288
|
+
config_file = find_config_file
|
|
289
|
+
return nil if config_file.nil?
|
|
290
|
+
|
|
291
|
+
begin
|
|
292
|
+
config_json = JSON.parse(File.read(config_file))
|
|
293
|
+
return config_json
|
|
294
|
+
rescue => e
|
|
295
|
+
Funlog.instance.fancyinfo_error("解析配置文件失败: #{e.message}")
|
|
296
|
+
return nil
|
|
297
|
+
end
|
|
298
|
+
end
|
|
299
|
+
|
|
300
|
+
def find_config_file
|
|
301
|
+
current_dir = Dir.pwd
|
|
302
|
+
|
|
303
|
+
# 查找顺序:当前目录 -> 父目录(向上查找)
|
|
304
|
+
while current_dir != "/"
|
|
305
|
+
config_file = File.join(current_dir, "config.json")
|
|
306
|
+
if File.exist?(config_file)
|
|
307
|
+
return config_file
|
|
308
|
+
end
|
|
309
|
+
|
|
310
|
+
# 检查.pindo目录
|
|
311
|
+
pindo_config = File.join(current_dir, ".pindo", "config.json")
|
|
312
|
+
if File.exist?(pindo_config)
|
|
313
|
+
return pindo_config
|
|
314
|
+
end
|
|
315
|
+
|
|
316
|
+
current_dir = File.dirname(current_dir)
|
|
317
|
+
end
|
|
318
|
+
|
|
319
|
+
# 使用默认配置
|
|
320
|
+
default_config = pindo_single_config.app_config_dir
|
|
321
|
+
if default_config && File.exist?(default_config)
|
|
322
|
+
config_file = File.join(default_config, "config.json")
|
|
323
|
+
return config_file if File.exist?(config_file)
|
|
324
|
+
end
|
|
325
|
+
|
|
326
|
+
return nil
|
|
327
|
+
end
|
|
328
|
+
|
|
329
|
+
end
|
|
330
|
+
end
|
|
331
|
+
end
|
|
332
|
+
end
|
|
@@ -9,27 +9,29 @@ module Pindo
|
|
|
9
9
|
class Android < Command
|
|
10
10
|
class Build < Android
|
|
11
11
|
|
|
12
|
-
self.summary = '
|
|
12
|
+
self.summary = '只编译APK不修改工程'
|
|
13
13
|
self.description = <<-DESC
|
|
14
|
-
|
|
14
|
+
只编译APK不修改工程
|
|
15
15
|
|
|
16
|
-
支持功能:
|
|
16
|
+
支持功能:
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
* 编译Android工程
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
* 生成APK文件
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
* 支持上传到JPS测试平台
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
* 支持发送测试通知
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
使用示例:
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
$ pindo android build # 编译APK
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
$ pindo android build --upload # 编译并上传到JPS
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
$ pindo android build --send # 编译、上传并发送通知
|
|
33
|
+
|
|
34
|
+
$ pindo android build --proj="My App" # 指定项目名称
|
|
33
35
|
DESC
|
|
34
36
|
|
|
35
37
|
def self.options
|
|
@@ -82,7 +84,7 @@ module Pindo
|
|
|
82
84
|
if @args_upload_flag
|
|
83
85
|
is_need_add_tag,tag_action_parms = build_helper.check_is_need_add_tag?(pindo_project_dir)
|
|
84
86
|
if is_need_add_tag
|
|
85
|
-
Pindo::Command::
|
|
87
|
+
Pindo::Command::Utils::Tag::run(tag_action_parms)
|
|
86
88
|
end
|
|
87
89
|
end
|
|
88
90
|
|
|
@@ -109,6 +111,11 @@ module Pindo
|
|
|
109
111
|
project_dir: pindo_project_dir,
|
|
110
112
|
workflow_packname: workflow_packname
|
|
111
113
|
)
|
|
114
|
+
|
|
115
|
+
# 添加基于 Application ID 的 Scheme(在 workflow 设置完成后)
|
|
116
|
+
Pindo::AndroidBuildConfigHelper.add_application_id_based_scheme(
|
|
117
|
+
project_dir: pindo_project_dir
|
|
118
|
+
)
|
|
112
119
|
else
|
|
113
120
|
raise Informative, "未获取到工作流信息"
|
|
114
121
|
end
|
|
@@ -3,38 +3,32 @@ require 'fileutils'
|
|
|
3
3
|
module Pindo
|
|
4
4
|
class Command
|
|
5
5
|
class Android < Command
|
|
6
|
-
class
|
|
6
|
+
class Keystore < Android
|
|
7
7
|
|
|
8
|
-
# Android
|
|
9
|
-
self.summary = '
|
|
8
|
+
# Android签名管理工具
|
|
9
|
+
self.summary = 'Android签名密钥(keystore)管理工具'
|
|
10
10
|
|
|
11
11
|
# 详细说明
|
|
12
12
|
self.description = <<-DESC
|
|
13
|
-
|
|
13
|
+
Android签名密钥(keystore)管理和配置工具。
|
|
14
14
|
|
|
15
|
-
支持功能:
|
|
15
|
+
支持功能:
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
* 管理Debug和Release签名密钥
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
* 配置工程签名设置
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
* 支持AdHoc模式签名
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
* 从配置仓库获取签名文件
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
使用示例:
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
$ pindo android keystore # 使用Debug模式签名
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
$ pindo android keystore --release # 使用Release模式签名
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
$ pindo and debug --release # 编译Release包
|
|
34
|
-
|
|
35
|
-
$ pindo and debug --dsign # 测试获取签名文件
|
|
36
|
-
|
|
37
|
-
$ pindo and debug --direct # 直接打包而不编译 unity 子 Lib
|
|
31
|
+
$ pindo android keystore --adhoc # 使用AdHoc模式签名
|
|
38
32
|
DESC
|
|
39
33
|
|
|
40
34
|
# 命令参数
|
|
@@ -45,12 +39,8 @@ module Pindo
|
|
|
45
39
|
# 命令选项
|
|
46
40
|
def self.options
|
|
47
41
|
[
|
|
48
|
-
['--
|
|
49
|
-
['--
|
|
50
|
-
['--send', '上传成功后发送测试通知'],
|
|
51
|
-
['--release', '使用release模式构建'],
|
|
52
|
-
['--dsign', '获取签名文件'],
|
|
53
|
-
['--direct', '直接打包而不编译 unity 子 Lib']
|
|
42
|
+
['--adhoc', '使用adhoc模式'],
|
|
43
|
+
['--release', '使用release模式'],
|
|
54
44
|
].concat(super)
|
|
55
45
|
end
|
|
56
46
|
|
|
@@ -101,6 +91,11 @@ module Pindo
|
|
|
101
91
|
project_dir: pindo_project_dir,
|
|
102
92
|
workflow_packname: workflow_packname
|
|
103
93
|
)
|
|
94
|
+
|
|
95
|
+
# 添加基于 Application ID 的 Scheme(在 workflow 设置完成后)
|
|
96
|
+
Pindo::AndroidBuildConfigHelper.add_application_id_based_scheme(
|
|
97
|
+
project_dir: pindo_project_dir
|
|
98
|
+
)
|
|
104
99
|
else
|
|
105
100
|
raise Informative, "未获取到工作流信息"
|
|
106
101
|
end
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
|
|
2
|
-
|
|
3
|
-
require 'pindo/command/android/debug'
|
|
4
2
|
require 'pindo/command/android/autobuild'
|
|
3
|
+
require 'pindo/command/android/autoresign'
|
|
5
4
|
require 'pindo/command/android/build'
|
|
5
|
+
require 'pindo/command/android/keystore'
|
|
6
|
+
|
|
6
7
|
|
|
7
8
|
module Pindo
|
|
8
9
|
class Command
|
|
9
10
|
class Android < Command
|
|
10
11
|
self.abstract_command = true
|
|
11
|
-
self.summary = 'Android
|
|
12
|
+
self.summary = 'Android开发相关的命令'
|
|
12
13
|
self.command = 'and'
|
|
13
14
|
# self.command_name = 'and'
|
|
14
15
|
|
|
@@ -8,8 +8,8 @@ require 'pindo/module/xcode/xcodeappconfig'
|
|
|
8
8
|
|
|
9
9
|
module Pindo
|
|
10
10
|
class Command
|
|
11
|
-
class
|
|
12
|
-
class
|
|
11
|
+
class Appstore < Command
|
|
12
|
+
class Adhocbuild < Appstore
|
|
13
13
|
|
|
14
14
|
include Command::DeployOptions
|
|
15
15
|
|
|
@@ -20,27 +20,27 @@ module Pindo
|
|
|
20
20
|
self.summary = '测试时设置Xcode工程编译参数并自动编译及上传'
|
|
21
21
|
|
|
22
22
|
self.description = <<-DESC
|
|
23
|
-
测试时设置Xcode工程编译参数并自动编译及上传。
|
|
23
|
+
测试时设置Xcode工程编译参数并自动编译及上传。
|
|
24
24
|
|
|
25
|
-
支持功能:
|
|
25
|
+
支持功能:
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
* 设置Xcode工程编译参数
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
* 自动编译生成IPA
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
* 上传到测试平台
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
* 发送测试通知
|
|
34
34
|
|
|
35
|
-
使用示例:
|
|
35
|
+
使用示例:
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
$ pindo appstore adhocbuild # 设置参数并编译
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
$ pindo appstore adhocbuild --upload # 编译并上传
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
$ pindo appstore adhocbuild --send # 编译、上传并发送通知
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
$ pindo appstore adhocbuild --increase # 自动增加版本号
|
|
44
44
|
DESC
|
|
45
45
|
|
|
46
46
|
self.arguments = [
|
|
@@ -50,9 +50,9 @@ module Pindo
|
|
|
50
50
|
def self.options
|
|
51
51
|
[
|
|
52
52
|
['--proj', '指定哪个项目(忽略大小写空格等等字符): --proj=\"prancksoundv4\"'],
|
|
53
|
-
['--upload', '编译完成后是否上传ipa到JPS: 用法:pindo
|
|
54
|
-
['--send', '上传到之后是否发送测试信息,用法:pindo
|
|
55
|
-
['--increase', '自动增加编译的app版本号,用法:pindo
|
|
53
|
+
['--upload', '编译完成后是否上传ipa到JPS: 用法:pindo appstore output --upload'],
|
|
54
|
+
['--send', '上传到之后是否发送测试信息,用法:pindo appstore output --send'],
|
|
55
|
+
['--increase', '自动增加编译的app版本号,用法:pindo appstore output --increase'],
|
|
56
56
|
|
|
57
57
|
].concat(super)
|
|
58
58
|
end
|
|
@@ -195,7 +195,7 @@ module Pindo
|
|
|
195
195
|
|
|
196
196
|
|
|
197
197
|
if File.exist?(File.join(pindo_new_project_dir, "Podfile"))
|
|
198
|
-
Pindo::Command::
|
|
198
|
+
Pindo::Command::Ios::Podupdate::run([])
|
|
199
199
|
|
|
200
200
|
begin
|
|
201
201
|
remove_test_pod_modue(project_dir:pindo_new_project_dir)
|