cocoapods-byte-csjm 0.0.5 → 0.0.7

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: b2bf878c15732509bc30dcc30f14147ae2dd6058de8b4e8cf5e18a989ee647c7
4
- data.tar.gz: 97332a49cd1b3f203dbaa2d6b5aafde72042b07d9680ee1f7258884a456ac51b
3
+ metadata.gz: cb0471e5bbc053367670af794e84be30e90ddfc062fea10ea78958b8d58922ed
4
+ data.tar.gz: dc0ec16937e2b23cef36b1888c2c7ff47bb5d02d791f9b9903c41a2d49e8af19
5
5
  SHA512:
6
- metadata.gz: bbedd80456217eb50eb8d7b5dcd1d3d62096fca8e4a81ef0421bb12bfcfbe0c30ade213f09263ba0811ffd6c32ad795979c62b716a3ef11bcd5b9ffe1ad63835
7
- data.tar.gz: 5bcba4e101ff5ede226631888532342df49c223ea412144cb34f7400e32ccc99301ffec34810c737a6b9458cc8e0f4af4bc7b616640a0e9b385c3129d2da65a2
6
+ metadata.gz: 2c27e02bbc40597d5d0a193d45548b3702d12fab937a54bc225426ae6be524b67ca0f50b9c4db9586050211598e1461953b65e8f44d17d3e5130d4774edd5a22
7
+ data.tar.gz: 88b7d4d299514df507d466e2771f3950230e4652ddada6d1bc011ab00f26d43b67abaa106312dfac2160f3856fca3a84b631756717621417f47a2ab66072106b
Binary file
Binary file
Binary file
@@ -1,5 +1,5 @@
1
1
  module CocoapodsByteCsjm
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.7"
3
3
  class Version
4
4
  def self.version
5
5
  VERSION
@@ -8,6 +8,12 @@ require "thread"
8
8
  require_relative 'net'
9
9
  require 'xcodeproj'
10
10
  require 'json'
11
+ require 'cocoapods/command/update'
12
+ require 'time'
13
+ require 'open3'
14
+
15
+
16
+
11
17
 
12
18
 
13
19
  module CSJMPlugin
@@ -17,6 +23,23 @@ module CSJMPlugin
17
23
  yield(recoder) if block_given?
18
24
  end
19
25
  end
26
+
27
+ # def CSJMPlugin.update
28
+ # puts "Checking for updates..."
29
+
30
+ # # output = system('gem update cocoapods-byte-csjm')
31
+
32
+
33
+ # command = 'gem install cocoapods-byte-csjm'
34
+ # stdout, stderr, status = Open3.capture3(command)
35
+
36
+ # if status.success?
37
+ # puts "Gem安装成功"
38
+ # else
39
+ # puts "Gem安装失败"
40
+ # puts "错误信息:#{stderr}"
41
+ # end
42
+ # end
20
43
  end
21
44
 
22
45
  module GM
@@ -443,7 +466,6 @@ module GM
443
466
  } if gm_spec
444
467
  ## 网络请求
445
468
  response_data = request_adapter gm_spec.spec.version.version, adn_info_list
446
-
447
469
  result = GM::SpecificationInfo.get_specfication response_data
448
470
  result.each{|item|
449
471
 
@@ -527,7 +549,12 @@ module GM
527
549
  Pod::UserInterface.section '[DEBUG]CSJM plugin Network request data' do
528
550
  puts "请求信息:#{body}"
529
551
  end
552
+ config_time_start = (Time.now.to_f * 1000).to_i
530
553
  data = GM::Network.request_adapter(body)
554
+ config_time_end = (Time.now.to_f * 1000).to_i
555
+ ## 埋点信息
556
+ push_track config_time_start ,config_time_end ,data,m_version
557
+
531
558
  if data["code"] == "PG0000"
532
559
  ## 请求adn数目和返回adapter 个数不一致时进行报错处理
533
560
  result = data["data"]
@@ -553,6 +580,24 @@ module GM
553
580
  end
554
581
  end
555
582
 
583
+ def self.push_track(config_start_time, config_end_time, response_data, m_version)
584
+ config_duration = config_end_time - config_start_time
585
+ package_name = get_package_name
586
+ event_extra = Hash["package_ids"=>package_name, "mediation_version"=>m_version, "os"=>"ios", "config_time_start" => config_start_time,"config_time_end" => config_end_time,"config_duration"=>config_duration,"response"=>response_data, "plugin_version" => CocoapodsByteCsjm::Version.version]
587
+ event_extra = event_extra.to_json
588
+ stats_list = Array.new << Hash["conn_type" => 1, "event_id" => "3C0BA297-0C19-4F68-949A-3196B6F0B895", "timestamp" =>(Time.now.to_f * 1000).to_i ,"type" => "auto_tools", "event_extra" => event_extra]
589
+ body = Hash["ts" =>Time.now.to_i, "stats_list" => stats_list]
590
+ # Pod::UserInterface.section '[DEBUG]CSJM plugin Network request data' do
591
+ # puts "埋点信息:#{body}"
592
+ # end
593
+ data = GM::Network.push_track(body)
594
+ if data["code"] == "20000"
595
+ ## 埋点成功. 目前什么也不做
596
+ else
597
+ ## 埋点失败
598
+ end
599
+ end
600
+
556
601
  def self.is_update?(value)
557
602
  is_auto_update?(value) || is_stable_update?(value)
558
603
  end
@@ -666,7 +711,11 @@ module Pod
666
711
 
667
712
  alias_method :original_plugin, :plugin
668
713
  def plugin(name, options = {})
669
- GM::Recorder.instance.set_plugin_load true if name == 'cocoapods-byte-csjm'
714
+ if name == 'cocoapods-byte-csjm'
715
+ GM::Recorder.instance.set_plugin_load true
716
+ # CSJMPlugin.update
717
+ end
718
+
670
719
  original_plugin(name, options)
671
720
  end
672
721
  end
@@ -31,5 +31,9 @@ module GM
31
31
  def Network.request_adapter(body)
32
32
  data = post("https://www.csjplatform.com/union_pangle/api/sdk_adapter/query",body)
33
33
  end
34
+
35
+ def Network.push_track(body)
36
+ data = post("https://gromore.pangolin-sdk-toutiao.com/api/ad/union/mediation/stats/",body)
37
+ end
34
38
  end
35
39
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-byte-csjm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - zhangtianhao.1230@bytedance.com
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-04 00:00:00.000000000 Z
11
+ date: 2023-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cocoapods
@@ -69,6 +69,9 @@ files:
69
69
  - LICENSE.txt
70
70
  - README.md
71
71
  - Rakefile
72
+ - cocoapods-byte-csjm-0.0.4.gem
73
+ - cocoapods-byte-csjm-0.0.5.gem
74
+ - cocoapods-byte-csjm-0.0.6.gem
72
75
  - cocoapods-byte-csjm.gemspec
73
76
  - lib/cocoapods-byte-csjm.rb
74
77
  - lib/cocoapods-byte-csjm/config.rb
@@ -98,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
98
101
  - !ruby/object:Gem::Version
99
102
  version: '0'
100
103
  requirements: []
101
- rubygems_version: 3.2.3
104
+ rubygems_version: 3.4.13
102
105
  signing_key:
103
106
  specification_version: 4
104
107
  summary: a plugin for csjm