fir-cli 2.0.23 → 2.0.25

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1c011300ea4b44b86f962e17518370f57d514d1808122ffccad155d53ad14428
4
- data.tar.gz: 62a7644a395535ab0191981bb209c729c1feb52f0b9e687c7a87c8c362331369
3
+ metadata.gz: ac9ebd4d15eba52e807875a875e4d56b0b814303937a5faa3a708dccebb9267f
4
+ data.tar.gz: be3231c934be27664cc3ed7e7f63fc82eef71350e429df9b3033d8116373ad7f
5
5
  SHA512:
6
- metadata.gz: 5d51764f556d550244c97859a1b9812ac249dfec5cba7eeee163fff8e77c6c2712d88d584f2262c7a05c1abe3a8d4245e5381db2c3843d4390ced37433cd8e4d
7
- data.tar.gz: afe62117b421d338f0c7e5f048026e633f64a9b9841f1df8352a7ee27c94e423cedcc860d4b0f8747d7c6e0d885b40fc73b89249a6d3ccedfc7d8326d913fe30
6
+ metadata.gz: 52401a32d81393c5eebb3cf587ad69cb5760d17b9b6dbfe51a41e5e38b73bd54b372b85256d5ebce3778e3c0d519a71e055b7d7ef4cd8814bc57aa6678984e18
7
+ data.tar.gz: 1ee68d93cada9a8a6cb3c727acc65a852f2061a9361df0e56643af04922281571bfad5e0bf54b2987a58e45a04755b5ee8d4d9e2373727c6544a7e06280d6654
@@ -5,31 +5,45 @@ on:
5
5
  branches: [ "master" ]
6
6
  pull_request:
7
7
  branches: [ "master" ]
8
+ workflow_dispatch:
8
9
 
9
10
  jobs:
10
-
11
11
  build:
12
-
13
12
  runs-on: ubuntu-latest
14
13
 
15
14
  steps:
16
- - uses: actions/checkout@v3
17
- - name: Build the Docker image
18
- run: docker buildx create --use && docker buildx build --platform=linux/arm64,linux/amd64 . --file Dockerfile --tag firhq/fir-cli:latest
19
-
20
- - name: get version Number
21
- id: show-version
22
- run: echo "::set-output name=result::$(docker run firhq/fir-cli:latest version | awk '{print $3}')"
23
-
24
- - name: check version number
25
- run: echo "the version is ${{ steps.show-version.outputs.result }}"
26
-
27
- - name: Tag image
28
- run: docker tag firhq/fir-cli:latest firhq/fir-cli:${{ steps.show-version.outputs.result }}
29
-
30
- - name: Login Docker
31
- run: docker login -u atpking -p ${{ secrets.DOCKER_ACCESS_TOKEN }}
32
-
33
- - name: Publish docker
34
- run: docker push firhq/fir-cli:latest && docker push firhq/fir-cli:${{ steps.show-version.outputs.result }}
35
-
15
+ - name: Checkout
16
+ uses: actions/checkout@v4
17
+
18
+ - name: Extract version
19
+ id: version
20
+ run: |
21
+ v=$(awk -F'"' '/VERSION/{print $2; exit}' lib/fir/version.rb)
22
+ echo "result=$v" >> "$GITHUB_OUTPUT"
23
+ echo "fir-cli version: $v"
24
+
25
+ - name: Set up QEMU
26
+ uses: docker/setup-qemu-action@v3
27
+
28
+ - name: Set up Docker Buildx
29
+ uses: docker/setup-buildx-action@v3
30
+
31
+ - name: Login to Docker Hub
32
+ if: github.event_name != 'pull_request'
33
+ uses: docker/login-action@v3
34
+ with:
35
+ username: atpking
36
+ password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
37
+
38
+ - name: Build and push
39
+ uses: docker/build-push-action@v6
40
+ with:
41
+ context: .
42
+ file: ./Dockerfile
43
+ platforms: linux/amd64,linux/arm64
44
+ push: ${{ github.event_name != 'pull_request' }}
45
+ tags: |
46
+ firhq/fir-cli:latest
47
+ firhq/fir-cli:${{ steps.version.outputs.result }}
48
+ cache-from: type=gha
49
+ cache-to: type=gha,mode=max
data/.gitignore CHANGED
@@ -27,3 +27,5 @@ lib/.byebug_history
27
27
  TAGS
28
28
  .vscode
29
29
  fir-cli-answer.json
30
+ mise.toml
31
+ .claude/
data/Dockerfile CHANGED
@@ -1,6 +1,9 @@
1
- FROM ruby:2.7.1
1
+ FROM ruby:3.2-slim
2
+ RUN apt-get update \
3
+ && apt-get install -y --no-install-recommends git ca-certificates build-essential \
4
+ && rm -rf /var/lib/apt/lists/*
2
5
  RUN gem install bundler
3
- ENV LANG=C.UTF-8
6
+ ENV LANG=C.UTF-8
4
7
  ENV WORKDIR=/fir-cli
5
8
  ENV HOME=/fir-cli
6
9
  RUN mkdir -p $WORKDIR
data/Gemfile CHANGED
@@ -8,3 +8,7 @@ end
8
8
  # Specify your gem's dependencies in fir.gemspec
9
9
  gemspec
10
10
  gem 'codeclimate-test-reporter', group: :test, require: nil
11
+
12
+ # Fix compatibility with Ruby 3.2.2
13
+ # mime-types 3.2.2 uses _1, _2, _3 as parameter names which are reserved in Ruby 2.7+
14
+ gem 'mime-types', '>= 3.3.0'
data/README.md CHANGED
@@ -19,6 +19,8 @@ fir.im-cli 可以通过指令查看, 上传, iOS/Android 应用.
19
19
  - 我们也提供 docker 版本的 fir-cli, 具体使用方式参见 **Docker 运行 fir-cli** 章节
20
20
 
21
21
  # 最近更新
22
+ - (2.0.25) 兼容 rubyzip 3.x: 修复 Ruby 3.2+ 环境下解析 ipa 报 `Info.plist not readable!` 的问题
23
+ - (2.0.24) 修复部分 APK 包含非法 XML 控制字符导致解析失败的问题
22
24
  - (2.0.23) 增强上传稳定性
23
25
  - (2.0.22) 支持自定义下载文件名称 --user_download_file_name=具体文件名称 注意, 此参数无法与switch_to_qiniu 一起使用
24
26
  - (2.0.21) 修正 publish 的结果不返回导致 fastlane-plugin-fir_cli 命令执行结果为nil 的问题
data/fir-cli.gemspec CHANGED
@@ -46,4 +46,8 @@ Gem::Specification.new do |spec|
46
46
  spec.add_dependency 'rexml'
47
47
  spec.add_dependency 'CFPropertyList'
48
48
  spec.add_dependency 'api_tools', '~> 0.1.1'
49
+ # rubyzip is pulled in transitively by ruby_android_apk (>= 1.1.6, no upper
50
+ # bound). We support 2.x and 3.x in lib/fir/util/parser/ipa.rb; pin upper to
51
+ # < 4 so future major bumps don't silently break end users on `gem install`.
52
+ spec.add_dependency 'rubyzip', '>= 1.1.6', '< 4'
49
53
  end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Fix for rest-client 2.1.0 compatibility with Ruby 2.6/2.7
4
+ # The bug: In some cases, @response is a String instead of a response object,
5
+ # causing NoMethodError when calling @response.code in http_code method.
6
+ #
7
+ # See: https://github.com/rest-client/rest-client/issues/...
8
+ module RestClient
9
+ class Exception
10
+ def http_code
11
+ # return integer for compatibility
12
+ if @response
13
+ # Handle case where @response is a String (e.g., "401 Unauthorized")
14
+ # or when @response is a proper response object
15
+ code = if @response.respond_to?(:code)
16
+ @response.code
17
+ else
18
+ @response.to_s[/\d{3}/]
19
+ end
20
+ code.to_i
21
+ else
22
+ @initial_response_code
23
+ end
24
+ end
25
+ end
26
+ end
data/lib/fir/patches.rb CHANGED
@@ -9,3 +9,4 @@ require_relative './patches/os_patch'
9
9
  require_relative './patches/try'
10
10
  require_relative './patches/default_headers'
11
11
  require_relative './patches/progress'
12
+ require_relative './patches/rest_client_fix'
@@ -1,6 +1,25 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative './common'
4
+
5
+ # Monkey patch to fix illegal character issues in AXML parsing
6
+ # Some APKs contain control characters in strings that REXML cannot handle
7
+ module Android
8
+ class AXMLParser
9
+ alias_method :original_parse_strings, :parse_strings
10
+
11
+ def parse_strings
12
+ original_parse_strings
13
+ # Remove illegal XML control characters from strings
14
+ @strings = @strings.map do |str|
15
+ next str unless str.is_a?(String)
16
+ # Keep only valid XML characters: #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]
17
+ str.gsub(/[^\x09\x0A\x0D\x20-\uD7FF\uE000-\uFFFD]/, '')
18
+ end
19
+ end
20
+ end
21
+ end
22
+
4
23
  module FIR
5
24
  module Parser
6
25
  class Apk
@@ -18,13 +37,18 @@ module FIR
18
37
  end
19
38
 
20
39
  def basic_info
21
- @basic_info ||= {
22
- type: 'android',
23
- name: fetch_label,
24
- identifier: @apk.manifest.package_name,
25
- build: @apk.manifest.version_code.to_s,
26
- version: @apk.manifest.version_name.to_s
27
- }
40
+ @basic_info ||= begin
41
+ manifest = @apk.manifest
42
+ raise 'Failed to parse AndroidManifest.xml. The APK may be corrupted, repacked, or contain unsupported characters.' unless manifest
43
+
44
+ {
45
+ type: 'android',
46
+ name: fetch_label,
47
+ identifier: manifest.package_name,
48
+ build: manifest.version_code.to_s,
49
+ version: manifest.version_name.to_s
50
+ }
51
+ end
28
52
  @basic_info.reject! { |_k, v| v.nil? }
29
53
  @basic_info
30
54
  end
@@ -46,11 +46,22 @@ module FIR
46
46
  return if @contents
47
47
  @contents = "#{Dir.tmpdir}/ipa_files-#{Time.now.to_i}"
48
48
 
49
+ # rubyzip 3.x changed Zip::File#extract: the second positional arg is now
50
+ # the entry path; the destination dir moved to a keyword arg. Detect by
51
+ # signature so we don't depend on Zip::VERSION (not auto-loaded in 2.x).
52
+ zip3 = Zip::File.instance_method(:extract).parameters.any? { |_t, n| n == :destination_directory }
53
+
49
54
  Zip::File.open(@path) do |zip_file|
50
55
  zip_file.each do |f|
51
56
  f_path = File.join(@contents, f.name)
57
+ next if File.exist?(f_path)
58
+
52
59
  FileUtils.mkdir_p(File.dirname(f_path))
53
- zip_file.extract(f, f_path) unless File.exist?(f_path)
60
+ if zip3
61
+ f.extract(File.basename(f.name), destination_directory: File.dirname(f_path))
62
+ else
63
+ zip_file.extract(f, f_path)
64
+ end
54
65
  end
55
66
  end
56
67
 
data/lib/fir/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module FIR
4
- VERSION = "2.0.23"
4
+ VERSION = "2.0.25"
5
5
  end
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fir-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.23
4
+ version: 2.0.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - NaixSpirit
8
8
  - atpking
9
+ autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2025-10-16 00:00:00.000000000 Z
12
+ date: 2026-05-11 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: bundler
@@ -178,6 +179,26 @@ dependencies:
178
179
  - - "~>"
179
180
  - !ruby/object:Gem::Version
180
181
  version: 0.1.1
182
+ - !ruby/object:Gem::Dependency
183
+ name: rubyzip
184
+ requirement: !ruby/object:Gem::Requirement
185
+ requirements:
186
+ - - ">="
187
+ - !ruby/object:Gem::Version
188
+ version: 1.1.6
189
+ - - "<"
190
+ - !ruby/object:Gem::Version
191
+ version: '4'
192
+ type: :runtime
193
+ prerelease: false
194
+ version_requirements: !ruby/object:Gem::Requirement
195
+ requirements:
196
+ - - ">="
197
+ - !ruby/object:Gem::Version
198
+ version: 1.1.6
199
+ - - "<"
200
+ - !ruby/object:Gem::Version
201
+ version: '4'
181
202
  description: fir.im command tool, support iOS and Android
182
203
  email:
183
204
  - atpking@gmail.com
@@ -225,6 +246,7 @@ files:
225
246
  - lib/fir/patches/native_patch.rb
226
247
  - lib/fir/patches/os_patch.rb
227
248
  - lib/fir/patches/progress.rb
249
+ - lib/fir/patches/rest_client_fix.rb
228
250
  - lib/fir/patches/try.rb
229
251
  - lib/fir/util.rb
230
252
  - lib/fir/util/ali_uploader.rb
@@ -289,7 +311,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
289
311
  - !ruby/object:Gem::Version
290
312
  version: '0'
291
313
  requirements: []
292
- rubygems_version: 3.6.9
314
+ rubygems_version: 3.1.6
315
+ signing_key:
293
316
  specification_version: 4
294
317
  summary: fir.im command tool
295
318
  test_files: