XZMRBin 1.0.0 → 1.1.0

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: b675706f4f7dd63cbcbb7f81c822064b292ede4f53ebdabf362ed9065632c558
4
- data.tar.gz: 3f3b79ddd97bbca8a1d09d94e24115665a05e0853383673e3a1882320ff2068f
3
+ metadata.gz: ac3bd4cbc3a61f5751ed19c81d9437aa004c66799c3a8483a0407768d79b74e9
4
+ data.tar.gz: 3c696cd7c47d25a05392ae73f465abae72cdc38b623cec6fdc244742d8711b2c
5
5
  SHA512:
6
- metadata.gz: 8762f7259b4a1eaeba5bc3ee1d464bacc122cb4030436106c72294b61a5bb15b246bc7618f078d04a93b9aaaf59a5349e8e94d7612e8ad2f95198cf8552b8587
7
- data.tar.gz: 8747e5736e17ad5fd56af239085d9c0e57f21af275dd662f7004474b0527bc8b2b72c18e743e17df5e351bc91f75a5fb531fc63cbd9ff90020b08a958769abee
6
+ metadata.gz: c5c6e0a262ec4d3786f363abfd43fe56ca257054789ebb681e93c650bc202c8f46a7d58db486ccb354bf653025d82a981d979190c2e808ff24f06f9b9b4da056
7
+ data.tar.gz: d1f11fdca14a890c37075546f322b85f74a2150383fd5caf9287d48807295e10ebd3efc3938759af2242490ce3c1b2bcedba7e6194e53e7ee54c76b41c260981
Binary file
@@ -0,0 +1,25 @@
1
+ Bag Attributes
2
+ friendlyName: imgsec.xiaozhustatic1.com
3
+ localKeyID: 9E 6C 12 26 46 73 85 F7 15 BC 1C F9 D9 F1 01 42 E1 AD 56 EA
4
+ subject=/C=cn/ST=Beijing/O=xiaozhu.com/OU=develop/CN=imgsec.xiaozhustatic1.com
5
+ issuer=/C=cn/ST=Beijing/L=Beijing/O=xiaozhu.com/OU=develop/CN=imgsec.xiaozhustatic1.com
6
+ -----BEGIN CERTIFICATE-----
7
+ MIIDVzCCAsCgAwIBAgIBKTANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJ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V2oG+ulwqmuDcJoyY9i17Apc6/ak6aZPUyekft6f
24
+ zV8WevZO1u3BmPViMiV0ws3TUIMXAcj0xIhp3RiFnFqT5lv8jrrjZvvscA==
25
+ -----END CERTIFICATE-----
Binary file
@@ -51,4 +51,7 @@ module XZGit
51
51
  end
52
52
  end
53
53
  require 'mrbin/xzcommand/xzmr'
54
+ require 'mrbin/xzcommand/xzintegratecommit'
55
+ require 'mrbin/xzcommand/xzdevgit'
56
+ require 'mrbin/xzcommand/xzupversion'
54
57
  end
@@ -1,3 +1,3 @@
1
1
  module XZGit
2
- VERSION = '1.0.0'.freeze
2
+ VERSION = '1.1.0'.freeze
3
3
  end
@@ -0,0 +1,68 @@
1
+ require 'set'
2
+ require 'find'
3
+ module XZGit
4
+ class XZDevGit < XZGit::Command
5
+ self.summary = 'DevPods git command'
6
+
7
+ def self.options
8
+ [
9
+ ['--exclude','exclude pod name']
10
+ ].concat(super)
11
+ end
12
+
13
+ def initialize(argv)
14
+ @exclude = argv.option('exclude','').split(',')
15
+ @gitcommands = argv.arguments
16
+ super
17
+ end
18
+
19
+ def validate!
20
+ root_path = Dir.pwd()
21
+ dev_path = "#{root_path}/DevPods"
22
+ if File.directory?(dev_path) && !Dir.empty?(dev_path)
23
+ puts "devpods path --> #{dev_path}"
24
+ else
25
+ puts "DevPods does not exist or DevPods is empty"
26
+ exit(1)
27
+ end
28
+ end
29
+
30
+ def run
31
+ pods = excutepods()
32
+ excutecommand(pods)
33
+ end
34
+
35
+ private
36
+ def excutepods
37
+ root_path = Dir.pwd()
38
+ dev_path = "#{root_path}/DevPods"
39
+ pods = Set.new
40
+ Find.find(dev_path) do |file|
41
+ filename = File.basename(file)
42
+ if filename.end_with?('.podspec')
43
+ filepath = File.dirname(file)
44
+ pods << filepath
45
+ podname = filename.split('.')[0]
46
+ if @exclude.include?(podname)
47
+ pods.delete(filepath)
48
+ end
49
+ end
50
+ end
51
+ pods
52
+ end
53
+
54
+ def excutecommand(paths)
55
+ if @gitcommands.count > 0 && paths.count > 0
56
+ paths.each do |path|
57
+ commandarr = []
58
+ commandarr << 'git'
59
+ commandarr << '-C'
60
+ commandarr << path
61
+ commandarr << @gitcommands
62
+ commandstr = commandarr.join(' ')
63
+ system(commandstr)
64
+ end
65
+ end
66
+ end
67
+ end
68
+ end
@@ -0,0 +1,40 @@
1
+
2
+ module XZGit
3
+ class XZInteCommit < XZGit::Command
4
+ self.summary = 'read all commit pods from podfile'
5
+
6
+ def self.options
7
+ [
8
+ ['--std','target branch name'],
9
+ ].concat(super)
10
+ end
11
+
12
+ def initialize(argv)
13
+ @std = argv.flag?('std',false)
14
+ super
15
+ end
16
+
17
+ def validate!
18
+ super
19
+ pwdpath = Dir.pwd.strip
20
+ podfilepath = "#{pwdpath}/Podfile"
21
+ if !File.exist?(podfilepath)
22
+ puts "can not found Podfile, please inspect your project path"
23
+ exit(1)
24
+ end
25
+ end
26
+
27
+ def run
28
+ pwdpath = Dir.pwd.strip
29
+ podfilepath = "#{pwdpath}/Podfile"
30
+ if @std
31
+ res = `cat #{podfilepath} | grep commit | grep -v MJRefresh | grep -v XZMonitor`
32
+ puts res
33
+ else
34
+ `cat #{podfilepath} | grep commit | grep -v MJRefresh | grep -v XZMonitor > commit.txt`
35
+ end
36
+
37
+ end
38
+
39
+ end
40
+ end
@@ -2,7 +2,7 @@ require 'net/http'
2
2
  require 'json'
3
3
  module XZGit
4
4
  class XZMr < XZGit::Command
5
- self.summary = 'inspect mr if no conflicts create mr to target branch, otherwise output conflicts'
5
+ self.summary = 'create merge request'
6
6
 
7
7
  def self.options
8
8
  [
@@ -0,0 +1,126 @@
1
+ require 'uri'
2
+ require 'digest'
3
+ require 'net/http'
4
+ require 'find'
5
+ require 'json'
6
+ module XZGit
7
+ class XZUpVersion < XZGit::Command
8
+ self.summary = 'update xzteanant version && update global api'
9
+ def self.options
10
+ [
11
+ ['--version','new version']
12
+ ].concat(super)
13
+ end
14
+ def initialize(argv)
15
+ @version = argv.option('version','')
16
+ super
17
+ end
18
+
19
+ def validate!
20
+ super
21
+ if @version.empty?
22
+ puts "--version is required"
23
+ exit(1)
24
+ end
25
+ root_path = Dir.pwd()
26
+ dev_path = "#{root_path}/Podfile"
27
+ if !File.exist?(dev_path)
28
+ puts "not found podfile,must excute in podfile directory"
29
+ exit(1)
30
+ end
31
+ end
32
+
33
+ def run
34
+ update_app_version(@version)
35
+ updateserver(@version)
36
+ end
37
+
38
+ private
39
+
40
+ def update_app_version(version)
41
+ Find.find(Dir.pwd()) do |file|
42
+ filename = File.basename(file)
43
+ if !file.include?('DevPods')
44
+ if filename == 'XZAppDelegate.m'
45
+ content = File.read(file)
46
+ content = content.gsub(/setGlobalAPIVersion\(@"(.)+?"\);/,"setGlobalAPIVersion(@\"#{version}\");")
47
+ File.open(file,'w') do |wf|
48
+ wf.write(content)
49
+ end
50
+ elsif filename == 'XZTenant-Info.plist'
51
+ `plutil -replace CFBundleShortVersionString -string #{version} #{file}`
52
+ elsif filename == 'Info.plist' && file.include?('SiriShortcuts')
53
+ `plutil -replace CFBundleShortVersionString -string #{version} #{file}`
54
+ end
55
+ end
56
+
57
+ end
58
+ end
59
+
60
+ def updateserver(version)
61
+ timestamp = Time.now.to_i
62
+ urlpath = "https://securewireless.xiaozhu.com/app/xzfk/ios/#{version}/global/preInformation?"
63
+ idfap = "uniqueId=8D6CCD72-D9C3-4949-A719-959F8EDFA396&"
64
+ bundletype = "bundleType=xiaozhu&"
65
+ timestap = "_={#{timestamp}}&"
66
+ typestr = "type=serverSideContents"
67
+ url = urlpath+idfap+bundletype+timestap+typestr
68
+ uri = parseurl(url)
69
+ startrequest(uri)
70
+ end
71
+
72
+ def parseurl(urlstr)
73
+ uri = URI(urlstr)
74
+ querystr = uri.query
75
+ queryarr = querystr.split('&')
76
+ parameters = Hash.new
77
+ queryarr.each do |para|
78
+ paraarr = para.split('=')
79
+ parameters[paraarr[0]] = paraarr[1]
80
+ end
81
+ allkeys = parameters.keys.sort()
82
+ kw = uri.path
83
+ allkeys.each do |key|
84
+ kw = kw + '|' + key
85
+ kw = kw + '|' + parameters[key]
86
+ end
87
+ kw += '|2016v001'
88
+ kcount = URI.encode_www_form_component(kw).length
89
+ kcount = kcount % 5 + 2
90
+ sign = kw
91
+ while kcount > 0
92
+ sign = Digest::MD5.hexdigest(sign)
93
+ kcount -= 1
94
+ end
95
+ parameters['xzsign'] = 'md5_' + sign
96
+ new_query = URI.encode_www_form(parameters)
97
+ uri.query = new_query
98
+ uri
99
+ end
100
+
101
+ def startrequest(uri)
102
+ https = Net::HTTP.new(uri.host, Net::HTTP.https_default_port)
103
+ https.use_ssl = true
104
+ https.ssl_timeout = 2
105
+ https.verify_mode = OpenSSL::SSL::VERIFY_PEER
106
+ libpath = File.expand_path('../../../../lib',__FILE__)
107
+ https.cert = OpenSSL::X509::Certificate.new(File.read("#{libpath}/filename.crt"))
108
+ https.key = OpenSSL::PKey::RSA.new(File.read("#{libpath}/newfile.key.pem"))
109
+ https.start do |http|
110
+ req = Net::HTTP::Get.new(uri)
111
+ res = https.request(req)
112
+ if res.code == '200'
113
+ jsres = JSON.parse(res.body)
114
+ if jsres['status'] == 200
115
+ File.open('XZServerContents.json','w') do |resf|
116
+ JSON.dump(jsres,resf)
117
+ end
118
+ `plutil -convert xml1 XZServerContents.json -o XZServerContents.plist`
119
+ `rm XZServerContents.json`
120
+ `mv XZServerContents.plist XZTenant/XZServerContents.plist`
121
+ end
122
+ end
123
+ end
124
+ end
125
+ end
126
+ end
@@ -0,0 +1,20 @@
1
+ Bag Attributes
2
+ friendlyName: 5370DDFC
3
+ localKeyID: 9E 6C 12 26 46 73 85 F7 15 BC 1C F9 D9 F1 01 42 E1 AD 56 EA
4
+ Key Attributes: <No Attributes>
5
+ -----BEGIN PRIVATE KEY-----
6
+ MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBANVL9qeLh4Yu7VTf
7
+ /i+iY0GRsUz/vKObZUI7+NgQ/zrbdXpYVBnnia5f2JJRRrcnFG/f1F9flgOdMVyH
8
+ Qu+Y2ty1DiOTQ0ufdaAEtKZeGoDcbgHFsfTFY+JfiUtO5UpuwMglz5OdIwRsp6vU
9
+ jDaBhW34o3jlk6/3a6VmbQZ8E5V/AgMBAAECgYAY9aOuZXh9bj5dgTyobFM7GAZs
10
+ YTy81HFb99Kdzhdf1tB/eZiV029cFWEtdg9VXWBZ2xJp+rB+ScW98yIVEYkCtgXq
11
+ Jgxc4DT3NnJmlW6T4Gc7M4QnrmorrKH4IdiOEiNPPEkDMd1sEHN0dBEHSDlDOJqh
12
+ 776ntBSQK/n9F3C38QJBAO5tiG0JBsYZBlSkdZpcv9ysBMU2ephW7GxhHYzQVOdt
13
+ zNNPQgSCHzXcUbulX1Gfus5X/AeGo8RuMO/awowgVAkCQQDlBEbDVek7cNlD2r8K
14
+ Z1prX/6USDsIgNLfcMpjfXpt4AEtcJ0TN4Nx5SAYyRYaJeCAUq4XjAO6rO5i8Bj2
15
+ Ic9HAkBJrKj6YE6qifMN1p/MahqTOshilDn/tuRpfPzflUSXGrOvHA+fSwIP55uN
16
+ 60Tv+PaFamSjgrQ6L36Jr0RsflTZAkAes84QzemwsFZQRHksGeMDViE5G93eK/cZ
17
+ QXPAlsfdBxThVKGaO+0BTehZqkuuQbmxOmRgf8LYOerTlMCj7rBtAkEAoCwQoGUo
18
+ /HLqV+1uJ+LV2BmxUqoPfxbMTqQWTMLoXVwlDhAGr21Ex0Se3+HkCkfs1t+irIiJ
19
+ DX/3bvS9RjyuQA==
20
+ -----END PRIVATE KEY-----
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: XZMRBin
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - liushuhua
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-05 00:00:00.000000000 Z
11
+ date: 2019-11-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -46,14 +46,21 @@ executables:
46
46
  extensions: []
47
47
  extra_rdoc_files: []
48
48
  files:
49
+ - ".DS_Store"
49
50
  - LICENSE.txt
50
51
  - XZMRBin.gemspec
51
52
  - bin/xzmr
53
+ - lib/filename.crt
52
54
  - lib/mrbin.rb
55
+ - lib/mrbin/.DS_Store
53
56
  - lib/mrbin/command.rb
54
57
  - lib/mrbin/config.rb
55
58
  - lib/mrbin/gemversion.rb
59
+ - lib/mrbin/xzcommand/xzdevgit.rb
60
+ - lib/mrbin/xzcommand/xzintegratecommit.rb
56
61
  - lib/mrbin/xzcommand/xzmr.rb
62
+ - lib/mrbin/xzcommand/xzupversion.rb
63
+ - lib/newfile.key.pem
57
64
  homepage: https://github.com/EXAMPLE/cocoapods-xzdevelop
58
65
  licenses:
59
66
  - MIT