fir-cli 0.2.1.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -1
- data/README.md +2 -40
- data/lib/fir-cli/version.rb +1 -1
- data/lib/fir-cli-commands/01-config.rb +1 -1
- data/lib/fir-cli-commands/100-resign_codesign.rb +57 -57
- data/lib/fir-cli-commands/100-resign_tapbeta.rb +81 -81
- data/lib/fir-cli-commands/101-resign.rb +25 -25
- data/lib/fir-cli-commands/11-publish.rb +10 -10
- data/lib/fir-cli.opt.rb +4 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e059f420fd64676ae5c357a04320f01773846239
|
4
|
+
data.tar.gz: 0c083b4e15c84546142990b0aa22be8b7762c096
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 969ab97b7af3f323c7c47130ece703ff80540163585c13c340d9bcee9557fd3335f1fbf080ae2089c993bfcc763d343890e95b21124ec2db23ecaf567922811a
|
7
|
+
data.tar.gz: 040c0d8535111375505ef66f910a6eb037a7a69c87660fb19b1bfb5eaa134eec007d184e36bb14cb86e4f483b52e223c6e0d41687ee13f70c06f79d78103b4e5
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
FIR.im CLI
|
2
2
|
---
|
3
|
-
> FIR.im CLI
|
3
|
+
> FIR.im CLI 可以通过指令查看、上传、编译应用。
|
4
4
|
|
5
5
|
## 新指令 `build_ipa`
|
6
6
|
> 这个指令对 `xcodebuild` 这个原生指令进行了包装,将常用的参数名简化,同时支持全部的自带参数和设置。
|
@@ -66,7 +66,6 @@ Commands:
|
|
66
66
|
fir login # 登录
|
67
67
|
fir profile # 切换配置文件
|
68
68
|
fir publish APP_FILE_PATH # 将应用文件发布至 FIR.im(支持 ipa 文件和 apk 文件)
|
69
|
-
fir resign IPA_FILE_PATH OUTPUT_PATH # 使用 resign.tapbeta.com 进行企业签名
|
70
69
|
fir upgrade # 更新 fir-cli 的所有组件
|
71
70
|
fir version # 当前版本
|
72
71
|
```
|
@@ -115,7 +114,7 @@ $ fir login
|
|
115
114
|
|
116
115
|
```shell
|
117
116
|
> 欢迎使用 FIR.im 命令行工具,如需帮助请输入: fir help
|
118
|
-
输入你的用户 token:
|
117
|
+
输入你的用户 token:
|
119
118
|
```
|
120
119
|
输入用户 token,系统会自动获取你的用户 email
|
121
120
|
```shell
|
@@ -124,43 +123,6 @@ $ fir login
|
|
124
123
|
> 当前登陆用户为:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
125
124
|
```
|
126
125
|
|
127
|
-
|
128
|
-
### 需要企业签名?
|
129
|
-
|
130
|
-
很多开发者需要一个企业签名的应用,来让更多的用户参与到测试中,这种行为并不符合企业证书的使用规范。但是我们还是集成了第三方签名网站 [resign.tapbeta.com](http://resign.tapbeta.com) 来帮助我们的用户更方便的进行测试。
|
131
|
-
|
132
|
-
```shell
|
133
|
-
$ fir resign ipa文件路径 输出文件路径
|
134
|
-
```
|
135
|
-
|
136
|
-
这条指令会输出一段风险提示;如果没有设置邮件地址,这里会让你输入邮件地址。输入邮件地址后,便开始进行企业签名了
|
137
|
-
|
138
|
-
```
|
139
|
-
> 欢迎使用 FIR.im 命令行工具,如需帮助请输入: fir help
|
140
|
-
! resign.tapbeta.com 签名服务风险提示
|
141
|
-
! 无法保证签名证书的长期有效性,当某种条件满足后
|
142
|
-
! 苹果会禁止该企业账号,所有由该企业账号所签发的
|
143
|
-
! 证书都会失效。你如果使用该网站提供的服务进行应
|
144
|
-
! 用分发,请注意:当证书失效后,所有安装了已失效
|
145
|
-
! 证书签名的用户都会无法正常运行应用;同时托管在
|
146
|
-
! fir.im 的应用将无法正常安装。
|
147
|
-
请输入你的邮件地址: dy@fir.im
|
148
|
-
> 正在申请上传令牌...
|
149
|
-
> 正在上传...
|
150
|
-
> 正在排队...
|
151
|
-
> 正在签名...
|
152
|
-
> 正在下载到 /path/to/output.ipa...
|
153
|
-
```
|
154
|
-
|
155
|
-
|
156
|
-
### 一步到位
|
157
|
-
|
158
|
-
企业签名后自动发布到 [FIR.im](http://fir.im)
|
159
|
-
|
160
|
-
```shell
|
161
|
-
$ fir publish ipa文件路径 -r
|
162
|
-
```
|
163
|
-
|
164
126
|
## 需要帮助?
|
165
127
|
|
166
128
|
输入以下指令获取全面功能介绍
|
data/lib/fir-cli/version.rb
CHANGED
@@ -4,7 +4,7 @@ module Fir
|
|
4
4
|
desc 'config', '配置全局设置'
|
5
5
|
option :token, :aliases => '-t', :desc => '用户 token'
|
6
6
|
option :email, :aliases => '-e', :desc => '邮件地址'
|
7
|
-
option :resign, :aliases => '-r', :desc => '是否以企业签名发布 ios 应用', :type => :boolean
|
7
|
+
# option :resign, :aliases => '-r', :desc => '是否以企业签名发布 ios 应用', :type => :boolean
|
8
8
|
option :private_key, :desc => '私密通道'
|
9
9
|
option :publish, :aliases => '-p', :desc => '编译打包自动发布至 FIR.im', :type => :boolean
|
10
10
|
output_options
|
@@ -1,59 +1,59 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
module Fir
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
1
|
+
# # coding: utf-8
|
2
|
+
# module Fir
|
3
|
+
# class Cli
|
4
|
+
# def self.resign_local_options
|
5
|
+
# option :mobile_provision,
|
6
|
+
# :aliases => '-m'
|
7
|
+
# option :sign,
|
8
|
+
# :aliases => '-s'
|
9
|
+
# end
|
10
|
+
# desc 'resign_codesign IPA_FILE_PATH OUTPUT_PATH', '使用 codesign 指令进行签名'
|
11
|
+
# resign_local_options
|
12
|
+
# output_options
|
13
|
+
# def resign_codesign(ipath, opath)
|
14
|
+
# _chk_os! 'mac'
|
15
|
+
# _chk_opt! :mobile_provision, :sign
|
16
|
+
# mp_path, sign_name = _opt :mobile_provision, :sign
|
17
|
+
# mp_path = _path mp_path
|
18
|
+
# ipath = _path ipath
|
19
|
+
# opath = _path opath
|
20
|
+
# opath += '.ipa' if !opath.to_s.end_with? '.ipa'
|
21
|
+
# _edit(ipath, opath) do |_d|
|
22
|
+
# Dir.chdir(_d) do
|
23
|
+
# apps = Dir['Payload/*.app']
|
24
|
+
# if apps.length != 1
|
25
|
+
# _puts "! #{Paint['输入文件不是一个合法的 ipa 文件', :red]}"
|
26
|
+
# _exit
|
27
|
+
# end
|
28
|
+
# app = apps[0]
|
29
|
+
# _puts "> 替换 mobile provision"
|
30
|
+
# mp_dest_path = "#{app}/embedded.mobileprovision"
|
31
|
+
# File.unlink mp_dest_path if File.file? mp_dest_path
|
32
|
+
# FileUtils.cp mp_path, mp_dest_path
|
33
|
+
# frmwrk_dir = "#{app}/Frameworks"
|
34
|
+
# if File.directory? frmwrk_dir
|
35
|
+
# _puts "> 重签名 dylibs"
|
36
|
+
# Dir["#{frmwrk_dir}/*.dylib"].each do |_dylib|
|
37
|
+
# _exec "codesign -f -s \"#{sign_name}\" \"#{_dylib}\""
|
38
|
+
# end
|
39
|
+
# _puts "> 重签名 frameworks"
|
40
|
+
# Dir["#{frmwrk_dir}/*.framework"].each do |_framework|
|
41
|
+
# _exec "codesign -f -s \"#{sign_name}\" \"#{_framework}\""
|
42
|
+
# end
|
43
|
+
# end
|
44
44
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
end
|
45
|
+
# plugin_dir = "#{app}/PlugIns"
|
46
|
+
# if File.directory? plugin_dir
|
47
|
+
# _puts "> 重签名 plugins"
|
48
|
+
# Dir["#{plugin_dir}/*"].each do |_plugin|
|
49
|
+
# _exec "codesign -f -s \"#{sign_name}\" \"#{_plugin}\""
|
50
|
+
# end
|
51
|
+
# end
|
52
|
+
# _puts "> 重签名 #{app}"
|
53
|
+
# _exec "codesign -f -s \"#{sign_name}\" \"#{app}\" --deep"
|
54
|
+
# end
|
55
|
+
# end
|
56
|
+
# end
|
57
|
+
# end
|
58
|
+
# end
|
59
59
|
|
@@ -1,85 +1,85 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
module Fir
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
1
|
+
# # coding: utf-8
|
2
|
+
# module Fir
|
3
|
+
# class Cli
|
4
|
+
# def self.resign_tapbeta_options
|
5
|
+
# option :email, :aliases => '-e', :desc => '邮件地址'
|
6
|
+
# option :private_key, :desc => '私密通道'
|
7
|
+
# end
|
8
|
+
# desc 'resign_tapbeta IPA_FILE_PATH OUTPUT_PATH', '使用 resign.tapbeta.com 进行企业签名'
|
9
|
+
# resign_tapbeta_options
|
10
|
+
# output_options
|
11
|
+
# def resign_tapbeta(ipath, opath)
|
12
|
+
# _puts "! #{Paint['resign.tapbeta.com 签名服务风险提示', :red]}"
|
13
|
+
# _puts '! tapbeta 无法保证签名证书的长期有效性,苹果随时可'
|
14
|
+
# _puts '! 能封杀他们的企业账号,所有由这个企业账号签发的证'
|
15
|
+
# _puts '! 书都会失效。你如果使用该网站提供的证书进行应用签'
|
16
|
+
# _puts "! 发,请注意:#{Paint['当证书失效后,所有通过已失效证书签名', :red ]}"
|
17
|
+
# _puts "! #{Paint['的应用都会无法正常运行;同时托管在 fir.im 的应用', :red ]}"
|
18
|
+
# _puts "! #{Paint['将无法正常安装。', :red ]}"
|
19
|
+
# if _opt_email == nil
|
20
|
+
# @email = _prompt '请输入你的邮件地址:'
|
21
|
+
# if !@email || @email.length == 0
|
22
|
+
# _puts "! #{Paint['你需要提供邮件地址才能使用 resign.tapbeta.com 的', :red]}"
|
23
|
+
# _puts "! #{Paint['签名服务, 请使用', :red]} fir config --email=EMAIL #{Paint['进行设', :red]}"
|
24
|
+
# _puts "! #{Paint['置', :red]}"
|
25
|
+
# _exit
|
26
|
+
# elsif !_is_email? @email
|
27
|
+
# _puts_invalid_email
|
28
|
+
# _exit
|
29
|
+
# end
|
30
|
+
# end
|
31
|
+
# if !_is_ipa? ipath
|
32
|
+
# _puts "! #{Paint['只能给以 ipa 为扩展名的文件签名', :red]}"
|
33
|
+
# _exit
|
34
|
+
# end
|
35
|
+
# _puts '> 正在申请上传令牌...'
|
36
|
+
# upload_res = RestClient.post 'http://api.resign.tapbeta.com/public/upload',
|
37
|
+
# :email => @email,
|
38
|
+
# :private_key => _opt_private_key,
|
39
|
+
# :file => File.basename(ipath)
|
40
|
+
# form = JSON.parse upload_res.body, :symbolize_names => true
|
41
|
+
# tapbeta = {}
|
42
|
+
# form.each do |f|
|
43
|
+
# if /^tb_/.match f[0]
|
44
|
+
# tapbeta[f[0]] = f[1]
|
45
|
+
# form.delete f[0]
|
46
|
+
# end
|
47
|
+
# end
|
48
|
+
# form[:file] = File.new Pathname.new(Dir.pwd).join(ipath).cleanpath, 'rb'
|
49
|
+
# _puts '> 正在上传...'
|
50
|
+
# res = RestClient.post tapbeta[:tb_upload_url], form
|
51
51
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
52
|
+
# # Upyun's notify is fucking, handle it specific
|
53
|
+
# # if tapbeta[:tb_upload_url].include? 'upyun'
|
54
|
+
# # RestClient.get "#{form[:'notify-url']}?#{URI.encode_www_form JSON.parse res.body}"
|
55
|
+
# # end
|
56
56
|
|
57
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
|
-
end
|
58
|
+
# _puts '> 正在排队...'
|
59
|
+
# nped = true
|
60
|
+
# info = {}
|
61
|
+
# loop do
|
62
|
+
# res = RestClient.get "http://api.resign.tapbeta.com/public/#{tapbeta[:tb_upload_key]}",
|
63
|
+
# :params => { :__mr => 'eyJ1cmwiOiIkKHVybCkiLCAicmVzaWduU3RhdHVzIjogIiQocmVzaWduU3RhdHVzKSIsICJzdGF0dXMiOiAiJChzdGF0dXMpIn0=' }
|
64
|
+
# info = JSON.parse res.body, :symbolize_names => true
|
65
|
+
# if nped && info[:resignStatus] == 'doing'
|
66
|
+
# _puts '> 正在签名...'
|
67
|
+
# nped = false
|
68
|
+
# end
|
69
|
+
# if info[:status] == 'error'
|
70
|
+
# _puts "! #{Paint['签名失败', :red]}"
|
71
|
+
# _exit
|
72
|
+
# elsif info[:status] == 'timeout'
|
73
|
+
# _puts "! #{Paint['签名超时', :red]}"
|
74
|
+
# _exit
|
75
|
+
# end
|
76
|
+
# break if info[:url] != ''
|
77
|
+
# sleep 5
|
78
|
+
# end
|
79
|
+
# opath = Pathname.new(Dir.pwd).join(opath).cleanpath
|
80
|
+
# _puts "> 正在下载到 #{opath}..."
|
81
|
+
# `curl #{info[:url]} -o #{opath} -s`
|
82
|
+
# end
|
83
|
+
# end
|
84
|
+
# end
|
85
85
|
|
@@ -1,26 +1,26 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
module Fir
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
end
|
1
|
+
# # coding: utf-8
|
2
|
+
# module Fir
|
3
|
+
# class Cli
|
4
|
+
# def self.resign_options
|
5
|
+
# option :resign_type,
|
6
|
+
# :desc => '选择使用哪种方式进行重签名,默认使用 tapbeta'
|
7
|
+
# resign_tapbeta_options
|
8
|
+
# resign_local_options
|
9
|
+
# end
|
10
|
+
# desc 'resign ORIGINAL_IPA OUTPUT_IPA [--resign-type=codesign]', '使用指定类型的签名方式'
|
11
|
+
# resign_options
|
12
|
+
# output_options
|
13
|
+
# def resign(ipath, opath)
|
14
|
+
# if !options[:resign_type]
|
15
|
+
# resign_tapbeta ipath, opath
|
16
|
+
# else
|
17
|
+
# begin
|
18
|
+
# method("resign_#{options[:resign_type]}".to_sym).call ipath, opath
|
19
|
+
# rescue NameError => e
|
20
|
+
# _puts "! #{Paint["没有 resign_#{options[:resign_type]} 的重签名方式"]}"
|
21
|
+
# end
|
22
|
+
# end
|
23
|
+
# end
|
24
|
+
# end
|
25
|
+
# end
|
26
26
|
|
@@ -2,28 +2,28 @@
|
|
2
2
|
module Fir
|
3
3
|
class Cli
|
4
4
|
desc 'publish APP_FILE_PATH', '将应用文件发布至 FIR.im(支持 ipa 文件和 apk 文件)'
|
5
|
-
def self.publish_options
|
6
|
-
option :resign, :aliases => '-r', :desc => '设置是否进行企业签名', :type => :boolean
|
5
|
+
def self.publish_options
|
6
|
+
# option :resign, :aliases => '-r', :desc => '设置是否进行企业签名', :type => :boolean
|
7
7
|
option :token, :aliases => '-t', :desc => '用户 token'
|
8
8
|
option :short, :aliases => '-s', :desc => '自定义短地址'
|
9
9
|
option :changelog, :aliases => '-c', :desc => '修改纪录,默认为空字符串', :default => ''
|
10
10
|
end
|
11
11
|
publish_options
|
12
|
-
resign_options
|
12
|
+
# resign_options
|
13
13
|
output_options
|
14
14
|
def publish(path)
|
15
|
-
if _opt_resign && _is_ipa?(path)
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
end
|
15
|
+
# if _opt_resign && _is_ipa?(path)
|
16
|
+
# tfile = Tempfile.new ["resign-#{SecureRandom.hex}", '.ipa']
|
17
|
+
# resign path, tfile.path
|
18
|
+
# path = tfile.path
|
19
|
+
# end
|
20
20
|
app = _info path, true
|
21
21
|
fir_app = _fir_info app[:identifier], app[:type]
|
22
22
|
|
23
23
|
id = fir_app[:id]
|
24
24
|
bundle_app = fir_app[:bundle][:pkg]
|
25
25
|
bundle_icon = fir_app[:bundle][:icon]
|
26
|
-
|
26
|
+
|
27
27
|
if app[:icons] != nil && app[:icons].length > 0
|
28
28
|
icon_path = app[:icons][0][:path]
|
29
29
|
|
@@ -55,7 +55,7 @@ module Fir
|
|
55
55
|
# :desc => options[:describe] || fir_app[:desc]
|
56
56
|
# :show => options[:public] || fir_app[:show]
|
57
57
|
:source => 'fir-cli'
|
58
|
-
|
58
|
+
|
59
59
|
_fir_vput_complete upload_res[:versionOid],
|
60
60
|
:version => app[:version],
|
61
61
|
:versionShort => app[:short_version],
|
data/lib/fir-cli.opt.rb
CHANGED
@@ -2,7 +2,8 @@
|
|
2
2
|
module Fir
|
3
3
|
class Cli
|
4
4
|
no_commands do
|
5
|
-
%w(token email verbose origin branch mobile_provision sign entitlements private_key).each do |_m|
|
5
|
+
# %w(token email verbose origin branch mobile_provision sign entitlements private_key).each do |_m|
|
6
|
+
%w(token email verbose origin branch mobile_provision entitlements private_key).each do |_m|
|
6
7
|
define_method "_opt_#{_m}" do
|
7
8
|
unless instance_variable_get("@#{_m}")
|
8
9
|
instance_variable_set("@#{_m}", options[_m.to_sym] || @config[_m] )
|
@@ -11,7 +12,8 @@ module Fir
|
|
11
12
|
end
|
12
13
|
private "_opt_#{_m}".to_sym
|
13
14
|
end
|
14
|
-
%w(publish resign quiet color trim).each do |_m|
|
15
|
+
# %w(publish resign quiet color trim).each do |_m|
|
16
|
+
%w(publish quiet color trim).each do |_m|
|
15
17
|
define_method "_opt_#{_m}" do
|
16
18
|
return false if options[_m.to_sym] == false
|
17
19
|
unless instance_variable_get("@#{_m}")
|