fir-cli 1.3.4 → 1.3.5
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/CHANGELOG +3 -0
- data/fir-cli.gemspec +2 -3
- data/lib/fir/util.rb +1 -0
- data/lib/fir/util/parser/apk.rb +2 -2
- data/lib/fir/util/parser/bin/pngcrush +0 -0
- data/lib/fir/util/parser/common.rb +12 -2
- data/lib/fir/util/parser/ipa.rb +1 -1
- data/lib/fir/util/parser/pngcrush.rb +23 -0
- data/lib/fir/util/publish.rb +15 -2
- data/lib/fir/version.rb +1 -1
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e2c2eb4c08bfe43c5e1237dda28ad11f9899dce
|
4
|
+
data.tar.gz: edabc62959f3098a21ecf84861d7c7d39a170b65
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c30e3dd5ff254e45401208381ec8d5d0ebd61cf7d56dcab5d353248454c95b4693f1a60ba280224d7585433ac3f81a7eb82a230004a49aa8c7efd0696006975
|
7
|
+
data.tar.gz: 5fb9eaf4199ab0d6c750f25704a2cf5b017691e46120b01a8e4604aa2b8506d23b9523287006cdc097add4c7d2dec91d440d86ee08e6a6e83f491946579f9908
|
data/CHANGELOG
CHANGED
data/fir-cli.gemspec
CHANGED
@@ -27,9 +27,8 @@ Gem::Specification.new do |spec|
|
|
27
27
|
/_/ /___/_/ |_| \____/_____/___/
|
28
28
|
|
29
29
|
## 更新记录
|
30
|
-
### fir-cli 1.3.
|
31
|
-
-
|
32
|
-
- 上传增加 distribution_name 信息
|
30
|
+
### fir-cli 1.3.5
|
31
|
+
- 修复转换 icon 的 bug
|
33
32
|
- 详细更新记录, 请查看: https://github.com/FIRHQ/fir-cli/blob/master/CHANGELOG
|
34
33
|
- [fir-cli](https://github.com/FIRHQ/fir-cli) 已经开源
|
35
34
|
- 欢迎 fork, issue 和 pull request
|
data/lib/fir/util.rb
CHANGED
@@ -4,6 +4,7 @@ require_relative './util/http'
|
|
4
4
|
require_relative './util/config'
|
5
5
|
require_relative './util/parser/apk'
|
6
6
|
require_relative './util/parser/ipa'
|
7
|
+
require_relative './util/parser/pngcrush'
|
7
8
|
require_relative './util/login'
|
8
9
|
require_relative './util/me'
|
9
10
|
require_relative './util/info'
|
data/lib/fir/util/parser/apk.rb
CHANGED
@@ -29,9 +29,9 @@ module FIR
|
|
29
29
|
}
|
30
30
|
end
|
31
31
|
|
32
|
-
# @apk.icon is a hash, { icon_name:
|
32
|
+
# @apk.icon is a hash, { icon_name: icon_binary_data }
|
33
33
|
def tmp_icons
|
34
|
-
@apk.icon.map { |_, data| generate_tmp_icon(data) }
|
34
|
+
@apk.icon.map { |_, data| generate_tmp_icon(data, :apk) }
|
35
35
|
end
|
36
36
|
end
|
37
37
|
end
|
Binary file
|
@@ -4,9 +4,19 @@ module FIR
|
|
4
4
|
module Parser
|
5
5
|
module Common
|
6
6
|
|
7
|
-
|
7
|
+
# when type is ipa, the icon data is a png file.
|
8
|
+
# when type is apk, the icon data is a binary data.
|
9
|
+
def generate_tmp_icon data, type
|
8
10
|
tmp_icon_path = "#{Dir.tmpdir}/icon-#{SecureRandom.hex[4..9]}.png"
|
9
|
-
|
11
|
+
|
12
|
+
if type == :ipa
|
13
|
+
FileUtils.cp(data, tmp_icon_path)
|
14
|
+
elsif type == :apk
|
15
|
+
File.open(tmp_icon_path, 'w+') { |f| f << data }
|
16
|
+
else
|
17
|
+
return
|
18
|
+
end
|
19
|
+
|
10
20
|
tmp_icon_path
|
11
21
|
end
|
12
22
|
end
|
data/lib/fir/util/parser/ipa.rb
CHANGED
@@ -0,0 +1,23 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
module FIR
|
4
|
+
module Parser
|
5
|
+
module Pngcrush
|
6
|
+
|
7
|
+
class << self
|
8
|
+
|
9
|
+
def png_bin
|
10
|
+
@png_bin ||= File.expand_path('../bin/pngcrush', __FILE__)
|
11
|
+
end
|
12
|
+
|
13
|
+
def uncrush_icon crushed_icon_path, uncrushed_icon_path
|
14
|
+
system("#{png_bin} -revert-iphone-optimizations #{crushed_icon_path} #{uncrushed_icon_path} &> /dev/null")
|
15
|
+
end
|
16
|
+
|
17
|
+
def crush_icon uncrushed_icon_path, crushed_icon_path
|
18
|
+
system("#{png_bin} -iphone #{uncrushed_icon_path} #{crushed_icon_path} &> /dev/null")
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/lib/fir/util/publish.rb
CHANGED
@@ -54,12 +54,13 @@ module FIR
|
|
54
54
|
end
|
55
55
|
|
56
56
|
def uploading_icon_info
|
57
|
-
|
57
|
+
large_icon_path = @app_info[:icons].max_by { |f| File.size(f) }
|
58
|
+
uncrushed_icon_path = convert_icon(large_icon_path)
|
58
59
|
|
59
60
|
{
|
60
61
|
key: @icon_cert[:key],
|
61
62
|
token: @icon_cert[:token],
|
62
|
-
file: File.new(
|
63
|
+
file: File.new(uncrushed_icon_path, 'rb')
|
63
64
|
}
|
64
65
|
end
|
65
66
|
|
@@ -163,5 +164,17 @@ module FIR
|
|
163
164
|
check_token_cannot_be_blank(@token)
|
164
165
|
fetch_user_info(@token)
|
165
166
|
end
|
167
|
+
|
168
|
+
def convert_icon origin_path
|
169
|
+
logger.info "Converting app's icon......"
|
170
|
+
|
171
|
+
if @app_info[:type] == 'ios'
|
172
|
+
output_path = Tempfile.new(['uncrushed_icon', '.png']).path
|
173
|
+
FIR::Parser::Pngcrush.uncrush_icon(origin_path, output_path)
|
174
|
+
origin_path = output_path if File.size(output_path) != 0
|
175
|
+
end
|
176
|
+
|
177
|
+
origin_path
|
178
|
+
end
|
166
179
|
end
|
167
180
|
end
|
data/lib/fir/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fir-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- NaixSpirit
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-11-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -173,8 +173,10 @@ files:
|
|
173
173
|
- lib/fir/util/mapping.rb
|
174
174
|
- lib/fir/util/me.rb
|
175
175
|
- lib/fir/util/parser/apk.rb
|
176
|
+
- lib/fir/util/parser/bin/pngcrush
|
176
177
|
- lib/fir/util/parser/common.rb
|
177
178
|
- lib/fir/util/parser/ipa.rb
|
179
|
+
- lib/fir/util/parser/pngcrush.rb
|
178
180
|
- lib/fir/util/publish.rb
|
179
181
|
- lib/fir/version.rb
|
180
182
|
- lib/fir_cli.rb
|
@@ -196,10 +198,9 @@ metadata: {}
|
|
196
198
|
post_install_message: "\n ______________ ________ ____\n /
|
197
199
|
____/ _/ __ \\ / ____/ / / _/\n / /_ / // /_/ /_____/ / / / /
|
198
200
|
/\n / __/ _/ // _, _/_____/ /___/ /____/ /\n /_/ /___/_/ |_| \\____/_____/___/\n\n
|
199
|
-
\ ## 更新记录\n ### fir-cli 1.3.
|
200
|
-
|
201
|
-
|
202
|
-
\ "
|
201
|
+
\ ## 更新记录\n ### fir-cli 1.3.5\n - 修复转换 icon 的 bug\n - 详细更新记录, 请查看: https://github.com/FIRHQ/fir-cli/blob/master/CHANGELOG\n
|
202
|
+
\ - [fir-cli](https://github.com/FIRHQ/fir-cli) 已经开源\n - 欢迎 fork, issue 和 pull
|
203
|
+
request\n "
|
203
204
|
rdoc_options: []
|
204
205
|
require_paths:
|
205
206
|
- lib
|