fastlane-plugin-zhuixi_build_app 0.1.7 → 0.1.9

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: e35b5a597c94cdfdb7ccf8ca3666dc93ac5cc806e601ffd95a6d000135739356
4
- data.tar.gz: cb4f08d916fe9145ef62e50a4201f3bf3d0ca0e396411be47cf8fa71ca2edc78
3
+ metadata.gz: 529bdf9e85e5e3d03ae548d237eb467e4519ea27176df36df46f6f574ef6e7e7
4
+ data.tar.gz: df7ddc010651f6ebbb44f6fd91cbf1fe65f53aabbcc3636784846e35bdd358c6
5
5
  SHA512:
6
- metadata.gz: d5316538c8adac306b0b6073e1b1f3b2ac5d7bbdd59f1fbddfe5253ce39d369d394978e4540d104f9fe70e05fb5e5dc01034810848a318ceb7289c52cb744bea
7
- data.tar.gz: 05c9bd2c5c6b69c240ad141e08833fa14117f0f4a6a952b24db66d86d80434aaa8d05f387cb206b03e40ce494b6357e6a0bbc08d4917488332379139ac51ab7a
6
+ metadata.gz: 7c5e809eb35175040c07b4bc623963e4e1eafeca9fd242c8c6612001e74907e2617a013a0c0dcf99dc8cc0a95e624542e125e7a4eefbf163f873662e19e8a5ec
7
+ data.tar.gz: c178d4fbc23bf881b7f69c1ce4da6edd91b01a800930a52e3a9fd7cb2efe50cb4ec65162ed9850450680462af73529196840df9c5e44a7cfae7421f4d5020c63
@@ -0,0 +1,63 @@
1
+ module Fastlane
2
+ module Actions
3
+ class LoginAction < Action
4
+ def self.run(params)
5
+ login_and_get_user_id_and_token(params[:credentials][:account], params[:credentials][:password], "2")
6
+ end
7
+
8
+ def login_and_get_user_id_and_token(account, password, packet_os)
9
+ uri = URI.parse("http://xg.yutennet.com/issuesy/pack/user_login")
10
+ request = Net::HTTP::Post.new(uri)
11
+ request.content_type = "application/json"
12
+ request.body = JSON.dump({
13
+ "account" => account,
14
+ "password" => password,
15
+ "packet_os" => packet_os,
16
+ })
17
+
18
+ response = Net::HTTP.start(uri.hostname, uri.port) do |http|
19
+ http.request(request)
20
+ end
21
+
22
+ if response.code == "200"
23
+ result = JSON.parse(response.body)
24
+ if result["code"] == 200
25
+ user_id = result["data"]["user_id"]
26
+ token = result["data"]["token"]
27
+ platforms = result["data"]["platform_lists"]
28
+ puts "登陆成功:platform:" + platforms.to_s
29
+ for platform in platforms
30
+ if @selectPlatformName == platform["platform_name"]
31
+ platformId = platform["platform_id"]
32
+ return user_id, token, platformId
33
+ end
34
+ end
35
+ else
36
+ puts "登录失败:#{result["msg"]}"
37
+ end
38
+ else
39
+ puts "登录失败:HTTP #{response.code}"
40
+ end
41
+
42
+ return nil, nil
43
+ end
44
+
45
+ def self.available_options
46
+ [
47
+ FastlaneCore::ConfigItem.new(key: :credentials,
48
+ env_name: "ZHUIXI_BUILD_APP_YOUR_OPTION",
49
+ description: "LoginAction",
50
+ optional: false,
51
+ type: String),
52
+ ]
53
+ end
54
+ def self.is_supported?(platform)
55
+ # Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example)
56
+ # See: https://docs.fastlane.tools/advanced/#control-configuration-by-lane-and-by-platform
57
+ #
58
+ # [:ios, :mac, :android].include?(platform)
59
+ true
60
+ end
61
+ end
62
+ end
63
+ end
@@ -3,7 +3,6 @@ module Fastlane
3
3
  class ReadConfigAction < Action
4
4
  def self.run(params)
5
5
  # 读取配置文件
6
- puts "ddd"
7
6
  app_file_path = params[:app_file_path]
8
7
  app_file = File.open(app_file_path).read
9
8
  app_file_config = eval(app_file)
@@ -13,9 +12,15 @@ module Fastlane
13
12
  @selectGameName = app_file_config[:selectGameName]
14
13
  @selectPlatformName = app_file_config[:platform]
15
14
  @ori_xcodeproj_path = app_file_config[:ori_xcodeproj_path]
16
- UI.message("读取配置成功!")
15
+ UI.message("读取配置成功!app_file_path:#{app_file_path}")
16
+ # 返回 account 和 password
17
+ return { account: account, password: password }
17
18
  end
18
19
 
20
+ def self.return_value
21
+ # If your method provides a return value, you can describe here what it does
22
+ "包含账号和密码的哈希表"
23
+ end
19
24
  def self.available_options
20
25
  [
21
26
  FastlaneCore::ConfigItem.new(key: :app_file_path,
@@ -5,28 +5,16 @@ module Fastlane
5
5
  module Actions
6
6
  class ZhuixiBuildAppAction < Action
7
7
  def self.run(params)
8
- other_action.read_config(
8
+ config = other_action.read_config(
9
9
  app_file_path: params[:app_file_path],
10
10
  )
11
- end
12
-
13
- def self.description
14
- "build ios app from different channel"
15
- end
16
-
17
- def self.authors
18
- ["RedSevenMale"]
11
+ other_action.login(credentials: config)
19
12
  end
20
13
 
21
14
  def self.return_value
22
15
  # If your method provides a return value, you can describe here what it does
23
16
  end
24
17
 
25
- def self.details
26
- # Optional:
27
- "build ios app from different channel"
28
- end
29
-
30
18
  def self.available_options
31
19
  [
32
20
  FastlaneCore::ConfigItem.new(key: :app_file_path,
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module ZhuixiBuildApp
3
- VERSION = "0.1.7"
3
+ VERSION = "0.1.9"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-zhuixi_build_app
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - RedSevenMale
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-24 00:00:00.000000000 Z
11
+ date: 2023-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -159,6 +159,7 @@ files:
159
159
  - LICENSE
160
160
  - README.md
161
161
  - lib/fastlane/plugin/zhuixi_build_app.rb
162
+ - lib/fastlane/plugin/zhuixi_build_app/actions/login_action.rb
162
163
  - lib/fastlane/plugin/zhuixi_build_app/actions/read_config_action.rb
163
164
  - lib/fastlane/plugin/zhuixi_build_app/actions/zhuixi_build_app_action.rb
164
165
  - lib/fastlane/plugin/zhuixi_build_app/helper/zhuixi_build_app_helper.rb