cocoapods-vbbuildsource 0.0.1 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 583106b2fcf0d5b22a0fd75d64be82462a83906f09f8a5bd02c86ccc6ce3fd06
4
- data.tar.gz: 819bc37d0bc7ed3a8c650e6ace66fca9a97ea1467023c0be70ffd9288e4d2981
3
+ metadata.gz: 9f5697037deb821c9fb00801c9da7f8deaa9af0ded40945ce5e1b217d9f80047
4
+ data.tar.gz: e34810ace7739921845288e968cb74aa35bcc86e4ebac9f1f1f077762c622d30
5
5
  SHA512:
6
- metadata.gz: ee0fca905427587e05f35d6ba910b30a0c44562d45ba827bad66a4cc7ef4878ad68fea25519f5e46ba0000c5fdf463b904d5b9ec6440d540337e2eba1905c0af
7
- data.tar.gz: c17e79c9b8ba2b767ac8d0cb076075a7a9d2ecff3925d0782cc3658cd643febb5b0ca884e4c2f27dd35977fc51a5657ad9427fd88d1ef9240d99b1499a7b35df
6
+ metadata.gz: f2a2ee54c27a53f2691c2d0984ae41f70443b1d7ede8d48ba2587b37a4073c0265d3d6a752547effaf76d40bfe0e7b161cbbd5bb7b538c1d6f63ce6fce13fd2e
7
+ data.tar.gz: 0b07c1b2561a009de21a100faeb79c1495c1cd04923f54d1488a6e477ded49805043f972ca0d6ff47dacac61bc7900da6734cb66dee4c187c33b6abb23edb369
data/Gemfile.lock ADDED
@@ -0,0 +1,114 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ cocoapods-vbbuildsource (0.0.6)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ CFPropertyList (3.0.3)
10
+ activesupport (5.2.6)
11
+ concurrent-ruby (~> 1.0, >= 1.0.2)
12
+ i18n (>= 0.7, < 2)
13
+ minitest (~> 5.1)
14
+ tzinfo (~> 1.1)
15
+ addressable (2.8.0)
16
+ public_suffix (>= 2.0.2, < 5.0)
17
+ algoliasearch (1.27.5)
18
+ httpclient (~> 2.8, >= 2.8.3)
19
+ json (>= 1.5.1)
20
+ atomos (0.1.3)
21
+ bacon (1.2.0)
22
+ claide (1.0.3)
23
+ cocoapods (1.10.0)
24
+ addressable (~> 2.6)
25
+ claide (>= 1.0.2, < 2.0)
26
+ cocoapods-core (= 1.10.0)
27
+ cocoapods-deintegrate (>= 1.0.3, < 2.0)
28
+ cocoapods-downloader (>= 1.4.0, < 2.0)
29
+ cocoapods-plugins (>= 1.0.0, < 2.0)
30
+ cocoapods-search (>= 1.0.0, < 2.0)
31
+ cocoapods-trunk (>= 1.4.0, < 2.0)
32
+ cocoapods-try (>= 1.1.0, < 2.0)
33
+ colored2 (~> 3.1)
34
+ escape (~> 0.0.4)
35
+ fourflusher (>= 2.3.0, < 3.0)
36
+ gh_inspector (~> 1.0)
37
+ molinillo (~> 0.6.6)
38
+ nap (~> 1.0)
39
+ ruby-macho (~> 1.4)
40
+ xcodeproj (>= 1.19.0, < 2.0)
41
+ cocoapods-core (1.10.0)
42
+ activesupport (> 5.0, < 6)
43
+ addressable (~> 2.6)
44
+ algoliasearch (~> 1.0)
45
+ concurrent-ruby (~> 1.1)
46
+ fuzzy_match (~> 2.0.4)
47
+ nap (~> 1.0)
48
+ netrc (~> 0.11)
49
+ public_suffix
50
+ typhoeus (~> 1.0)
51
+ cocoapods-deintegrate (1.0.5)
52
+ cocoapods-downloader (1.4.0)
53
+ cocoapods-plugins (1.0.0)
54
+ nap
55
+ cocoapods-search (1.0.1)
56
+ cocoapods-trunk (1.5.0)
57
+ nap (>= 0.8, < 2.0)
58
+ netrc (~> 0.11)
59
+ cocoapods-try (1.2.0)
60
+ colored2 (3.1.2)
61
+ concurrent-ruby (1.1.9)
62
+ escape (0.0.4)
63
+ ethon (0.14.0)
64
+ ffi (>= 1.15.0)
65
+ ffi (1.15.3)
66
+ fourflusher (2.3.1)
67
+ fuzzy_match (2.0.4)
68
+ gh_inspector (1.1.3)
69
+ httpclient (2.8.3)
70
+ i18n (1.8.10)
71
+ concurrent-ruby (~> 1.0)
72
+ json (2.5.1)
73
+ minitest (5.14.4)
74
+ mocha (1.13.0)
75
+ mocha-on-bacon (0.2.3)
76
+ mocha (>= 0.13.0)
77
+ molinillo (0.6.6)
78
+ nanaimo (0.3.0)
79
+ nap (1.1.0)
80
+ netrc (0.11.0)
81
+ prettybacon (0.0.2)
82
+ bacon (~> 1.2)
83
+ public_suffix (4.0.6)
84
+ rake (13.0.6)
85
+ rexml (3.2.5)
86
+ ruby-macho (1.4.0)
87
+ thread_safe (0.3.6)
88
+ typhoeus (1.4.0)
89
+ ethon (>= 0.9.0)
90
+ tzinfo (1.2.9)
91
+ thread_safe (~> 0.1)
92
+ xcodeproj (1.21.0)
93
+ CFPropertyList (>= 2.3.3, < 4.0)
94
+ atomos (~> 0.1.3)
95
+ claide (>= 1.0.2, < 2.0)
96
+ colored2 (~> 3.1)
97
+ nanaimo (~> 0.3.0)
98
+ rexml (~> 3.2.4)
99
+
100
+ PLATFORMS
101
+ ruby
102
+
103
+ DEPENDENCIES
104
+ bacon
105
+ bundler (~> 1.3)
106
+ cocoapods (= 1.10.0)
107
+ cocoapods-vbbuildsource!
108
+ mocha
109
+ mocha-on-bacon
110
+ prettybacon
111
+ rake
112
+
113
+ BUNDLED WITH
114
+ 1.17.3
data/README.md CHANGED
@@ -1,11 +1,39 @@
1
- # cocoapods-vbbuildsource
1
+ #
2
2
 
3
- A description of cocoapods-vbbuildsource.
3
+
4
+ 本插件用于腾讯视频iOS端cocoapods二进制库一键切换为源代码调试,无需重新编译
4
5
 
5
6
  ## Installation
6
7
 
7
- $ gem install cocoapods-vbbuildsource
8
+ ```
9
+ $ gem install cocoapods-vbbuildsource
10
+ ```
11
+
12
+ 如果报ruby源 timeout 错误请自行切换ruby的源
13
+
14
+ ```
15
+ gem source --remove https://rubygems.org
16
+ ```
17
+ 先删除当前的ruby 源地址
18
+
19
+ ```
20
+ gem source -a https://gems.ruby-china.com
21
+ ```
22
+
23
+ 切换源到ruby中国
8
24
 
9
25
  ## Usage
26
+ 调试到二进制库的时候打一个符号断点,让断点停在该库汇编代码里面。之后打开命令行运行:
27
+
28
+ ```
29
+ $ pod vbbuildsource POD_NAME
30
+ ```
31
+
32
+ 运行完之后刷新一下xcode(切换一下页面或者点一下单步调试)源代码就会自动展示。
33
+
34
+ 效果如下:
35
+ ![](./image/image.gif)
36
+
37
+ ## 删除
38
+ 由于现在还没有做删除功能。调试完可以去控制台打印的路径 ![](./image/filepath.png) 下将源代码删除
10
39
 
11
- $ pod spec vbbuildsource POD_NAME
Binary file
data/image/image.gif ADDED
Binary file
@@ -51,11 +51,17 @@ module Pod
51
51
 
52
52
  help! "该pod库 #{@module_name} 未找到" unless pod_target
53
53
 
54
- framework_file_path = pod_target.all_files.first
55
-
56
- framework_file_path = Pathname.new(framework_file_path) if framework_file_path.is_a? String
54
+ file_list = Array.new(pod_target.all_files.count) { |index|
55
+ file = pod_target.all_files[index]
56
+ if file.is_a? String
57
+ Pathname.new(file)
58
+ else
59
+ file
60
+ end
61
+ }
62
+ framework_file_path = file_list.detect {|each| each.extname.end_with? 'framework'}
57
63
 
58
- help! "该pod库 #{@module_name} 不是一个framework" unless pod_target.all_files.count == 1 and framework_file_path.extname.end_with? 'framework'
64
+ help! "该pod库 #{@module_name} 不是一个framework" unless framework_file_path
59
65
 
60
66
  binary_build_path = find_binary_build_path framework_file_path
61
67
 
@@ -82,8 +88,8 @@ module Pod
82
88
  binary_file_path = find_binary_file_in_framework framework_file_path
83
89
  help! "未找到库 #{@module_name} 的二进制文件" unless binary_file_path
84
90
  # 找到framework里面的某一个.h头文件的 DW_AT_decl_file 字段
85
- first_head_file = find_first_head_file_in_framework framework_file_path
86
- binary_build_path_string = `dwarfdump #{binary_file_path.to_path} | grep #{File.basename(first_head_file)} | grep 'DW_AT_decl_file'`.gsub!(/\s/, '')
91
+ binary_build_path_string = find_file_path_string_in_binary(framework_file_path,binary_file_path)
92
+ help! "未找到库 #{@module_name} 的二进制path路径" unless binary_build_path_string
87
93
  binary_build_path_list = binary_build_path_string.split('DW_AT_decl_file').delete_if(&:empty?).uniq
88
94
  # 删掉所有的括号引号
89
95
  binary_build_path_list = binary_build_path_list.each { |item| item.gsub!('("','').gsub!('")', '') }
@@ -124,13 +130,14 @@ module Pod
124
130
  return Pathname.new("#{framework_file_path.to_path}/#{framework_file_path.basename.to_path.gsub!('.framework', '')}")
125
131
  end
126
132
 
127
- def find_first_head_file_in_framework(framework_file_path, end_name='.h')
133
+ def find_file_path_string_in_binary(framework_file_path, binary_file_path)
128
134
  framework_file_path.children.collect do |child|
129
- if child.file? && child.extname.end_with?(end_name)
130
- return child
135
+ if child.file? && child.extname.end_with?('.h')
136
+ binary_build_path_string = `dwarfdump #{binary_file_path.to_path} | grep #{File.basename(child)} | grep 'DW_AT_decl_file'`.gsub!(/\s/, '')
137
+ return binary_build_path_string if binary_build_path_string
131
138
  elsif child.directory?
132
- filePath = find_first_head_file_in_framework child
133
- return filePath if filePath
139
+ binary_build_path_string = find_file_path_string_in_binary(child, binary_file_path)
140
+ return binary_build_path_string if binary_build_path_string
134
141
  end
135
142
  end
136
143
  return nil
@@ -147,6 +154,9 @@ module Pod
147
154
  end
148
155
  def find_spec_source_file_path specification
149
156
  source_path = specification.specification.attributes_hash['source_files']
157
+ source_path = specification.specification.subspecs.first.attributes_hash['source_files'] unless source_path
158
+ source_path = specification.specification.subspecs.first.attributes_hash['ios']['source_files'] unless source_path
159
+ help! "该库 #{@module_name} 的spec文件没填 source_file,暂不支持" unless source_path
150
160
  dir_list = source_path.split('/')
151
161
  help! "源码路径错误 #{source_path}" unless dir_list.count >= 2
152
162
  return "/#{dir_list.first}/#{dir_list[1]}"
@@ -1,3 +1,3 @@
1
1
  module CocoapodsVbbuildsource
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-vbbuildsource
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - faliu
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-30 00:00:00.000000000 Z
11
+ date: 2021-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -47,10 +47,13 @@ extra_rdoc_files: []
47
47
  files:
48
48
  - ".gitignore"
49
49
  - Gemfile
50
+ - Gemfile.lock
50
51
  - LICENSE.txt
51
52
  - README.md
52
53
  - Rakefile
53
54
  - cocoapods-vbbuildsource.gemspec
55
+ - image/filepath.png
56
+ - image/image.gif
54
57
  - lib/cocoapods-vbbuildsource.rb
55
58
  - lib/cocoapods-vbbuildsource/command.rb
56
59
  - lib/cocoapods-vbbuildsource/command/vbbuildsource.rb