fastlane-plugin-roku_app_util 0.1.0 → 0.2.0

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: caca31eb4fd3efe39646aca1255a3f195ba1365de0e27e6ceb135962647d20c8
4
- data.tar.gz: c9252326f8a583f38c216d80ef793e39d7265ad9d97848d7cf426d2edb62c886
3
+ metadata.gz: 424ee79998274794618c63d99727ffd7f782146ae73817d30abbf3f8b87acf2c
4
+ data.tar.gz: a524b24596249c841059a3e9283cb09e02b6c8c2933c3dd8bc7278e497069b65
5
5
  SHA512:
6
- metadata.gz: 5328c864cf08113bfbefab27ef8527821383b05493218915e67ec2036af6eb95710ce77c9949e6ee0fd419ecc2277d294e578f920ef57b2965ff29dd8ca1174b
7
- data.tar.gz: b2b3d89924298efb7b12943562b941a25e7f6f6cff774ed37e82cb6378e272e317eeeca20d9b68cb4e901ae43cfb6ee9b6acad9b32b6e0ca429ef90390bbf966
6
+ metadata.gz: 0ad02fd3884ec16c02fda482c0e93e133d75c03467a54f28380d0ba1b2dcc8f73c7cd907e6ffc9856e919209b8e2e417567f21bad2a7aefc8f9b304ece7cb307
7
+ data.tar.gz: 169c3fecd0cd1610f004ad254a76da73da5c0bc26461c534271c7cd5a36b34bc2ca0786431b4a81e002a2da83efeccc794883bd7ab5cdb92ac4fdc6f6b1a1c0a
data/README.md CHANGED
@@ -1,15 +1,15 @@
1
- # Fastlane roku_app_util plugin
1
+ # Fastlane `roku_app_util` plugin
2
2
 
3
- [![Test](https://github.com/WarnerMedia/fastlane-plugin-roku_app_util/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/WarnerMedia/fastlane-plugin-roku_app_util/actions/workflows/test.yml)
4
- <!-- [![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-roku_app_util) -->
3
+ [![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-roku_app_util)
4
+ [![Gem Version](https://badge.fury.io/rb/fastlane-plugin-roku_app_util.svg)](https://badge.fury.io/rb/fastlane-plugin-roku_app_util)
5
5
 
6
6
  ## Getting Started
7
7
 
8
8
  This project is a [_fastlane_](https://github.com/fastlane/fastlane) plugin. To get started with `fastlane-plugin-roku_app_util`, add it to your project by running:
9
9
 
10
- 1. `bundle exec fastlane add_plugin roku_app_util`
11
- 2. When prompted enter option `1` for providing a **Git URL**
12
- 3. Enter the URL for this repo: `https://github.com/WarnerMedia/fastlane-plugin-roku_app_util`
10
+ `fastlane add_plugin roku_app_util`
11
+
12
+ _If the command prompts you with an option, select Option 3: RubyGems.org._
13
13
 
14
14
  ## About roku_app_util
15
15
 
@@ -17,6 +17,7 @@ Fastlane plugin for Roku app automation. All actions require a Roku dev server o
17
17
 
18
18
  ### Available actions
19
19
  * [`roku_dev_server_check`](#action-roku_dev_server_check) : Checks Roku dev server
20
+ * [`roku_dev_server_rekey`](#action-roku_dev_server_rekey) : Rekeys the dev server to the provided signed package
20
21
  * [`roku_app_install`](#action-roku_app_install) : Installs the app as a dev channel on a Roku target device
21
22
  * [`roku_app_uninstall`](#action-roku_app_uninstall) : Uninstalls any apps/dev channels on a Roku target device
22
23
  * [`roku_app_package`](#action-roku_app_package) : Creates Roku package from application sources
@@ -31,6 +32,20 @@ Key | Environment Variable Equivalent | Description | Required?
31
32
  ------------- | ------------- | ------------- | -------------
32
33
  `dev_target` | `ROKUAPPUTIL_DEV_TARGET` | The IP of the Roku dev target | YES
33
34
 
35
+ #### Action: `roku_dev_server_rekey`
36
+
37
+ ##### Description: Rekeys the dev server to the provided signed package
38
+
39
+ ##### Parameters:
40
+
41
+ Key | Environment Variable Equivalent | Description | Required?
42
+ ------------- | ------------- | ------------- | -------------
43
+ `dev_target` | `ROKUAPPUTIL_DEV_TARGET` | The IP of the Roku dev target | YES
44
+ `dev_user` | `ROKUAPPUTIL_DEV_USER` | Roku development username | NO - Default value: `rokudev`
45
+ `dev_pass` | `ROKUAPPUTIL_DEV_PASS` | Roku development password | YES
46
+ `sign_key` | `ROKUAPPUTIL_SIGN_KEY` | Roku signing key | YES
47
+ `app_path` | `ROKUAPPUTIL_APP_PATH` | Roku signed application file path | YES
48
+
34
49
  #### Action: `roku_app_install`
35
50
 
36
51
  ##### Description: Installs the app as a dev channel on a Roku target device
@@ -0,0 +1,78 @@
1
+ require 'fastlane/action'
2
+ require 'fastlane_core/configuration/config_item'
3
+ require_relative '../helper/roku_app_util_helper'
4
+
5
+ module Fastlane
6
+ module Actions
7
+ class RokuDevServerRekeyAction < Action
8
+ def self.run(params)
9
+ FastlaneCore::PrintTable.print_values(
10
+ config: params,
11
+ title: 'Summary for roku_dev_server_rekey',
12
+ mask_keys: [:dev_pass, :sign_key]
13
+ )
14
+
15
+ Helper::RokuAppUtilHelper.roku_app_rekey(params)
16
+
17
+ UI.success('Roku dev server rekeyed')
18
+ end
19
+
20
+ def self.description
21
+ 'Rekeys Roku dev server'
22
+ end
23
+
24
+ # For each option, optional is set to true to prevent forcing Fastlane to be interactive and prompting for input
25
+ def self.available_options
26
+ [
27
+ FastlaneCore::ConfigItem.new(
28
+ key: :dev_target,
29
+ env_name: 'ROKUAPPUTIL_DEV_TARGET',
30
+ description: 'IP address of the Roku development device',
31
+ optional: true,
32
+ type: String
33
+ ),
34
+ FastlaneCore::ConfigItem.new(
35
+ key: :dev_user,
36
+ env_name: 'ROKUAPPUTIL_DEV_USER',
37
+ description: 'Roku development username',
38
+ optional: true,
39
+ type: String,
40
+ default_value: 'rokudev'
41
+ ),
42
+ FastlaneCore::ConfigItem.new(
43
+ key: :dev_pass,
44
+ env_name: 'ROKUAPPUTIL_DEV_PASS',
45
+ description: 'Roku development password',
46
+ optional: true,
47
+ type: String
48
+ ),
49
+ FastlaneCore::ConfigItem.new(
50
+ key: :app_path,
51
+ env_name: 'ROKUAPPUTIL_APP_PATH',
52
+ description: 'Roku signed application file path',
53
+ optional: true,
54
+ type: String,
55
+ verify_block: proc do |value|
56
+ UI.user_error!('Could not find ZIP file') unless File.exist?(value)
57
+ end
58
+ ),
59
+ FastlaneCore::ConfigItem.new(
60
+ key: :sign_key,
61
+ env_name: 'ROKUAPPUTIL_SIGN_KEY',
62
+ description: 'Roku signing key',
63
+ optional: true,
64
+ type: String
65
+ )
66
+ ]
67
+ end
68
+
69
+ def self.authors
70
+ ['Blair Replogle']
71
+ end
72
+
73
+ def self.is_supported?(platform)
74
+ [:roku].include?(platform)
75
+ end
76
+ end
77
+ end
78
+ end
@@ -171,6 +171,45 @@ module Fastlane
171
171
  return File.expand_path(output_package_file)
172
172
  end
173
173
 
174
+ def self.roku_app_rekey(params)
175
+ validate_params(params, [:dev_target, :dev_user, :dev_pass, :sign_key, :app_path])
176
+
177
+ target = params[:dev_target]
178
+ user = params[:dev_user]
179
+ pass = params[:dev_pass]
180
+ sign_key = params[:sign_key]
181
+ app_path = params[:app_path]
182
+ user_pass = "#{user}:#{pass}"
183
+ current_time = DateTime.now.strftime('%Q')
184
+
185
+ cmd = ['curl']
186
+ cmd << "--user #{user_pass}"
187
+ cmd << "--digest"
188
+ cmd << "--silent"
189
+ cmd << "show-error"
190
+ cmd << "-F mysubmit=Rekey"
191
+ cmd << "-F passwd=#{sign_key}"
192
+ cmd << "-F archive=@#{app_path}"
193
+ cmd << "-F pkg_time=#{current_time}"
194
+ cmd << "http://#{target}/plugin_inspect"
195
+ cmd = cmd.join(' ')
196
+
197
+ response = `#{cmd}`
198
+
199
+ # Check exit code
200
+ if $?.exitstatus != 0
201
+ UI.shell_error!("Curl exit code #{$?.exitstatus}. See URL for meaning: https://everything.curl.dev/usingcurl/returns#available-exit-codes")
202
+ end
203
+
204
+ parsed_responses = validate_response_match(response, %r{<font color="red">(.*?)</font>}m)
205
+ result = parsed_responses[0]
206
+
207
+ # Dev server installation output will display 'Success' if app is packaged successfully
208
+ unless result.include?("Success")
209
+ UI.shell_error!("Error from Roku: #{result}")
210
+ end
211
+ end
212
+
174
213
  # A helper method to check if all the necessary parameters are set
175
214
  # params: An array containing all the parameters to check
176
215
  # keys: An array of keys to use in params
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module RokuAppUtil
3
- VERSION = "0.1.0"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-roku_app_util
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Onyx Mueller
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-28 00:00:00.000000000 Z
11
+ date: 2022-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -163,6 +163,7 @@ files:
163
163
  - lib/fastlane/plugin/roku_app_util/actions/roku_app_package_action.rb
164
164
  - lib/fastlane/plugin/roku_app_util/actions/roku_app_uninstall_action.rb
165
165
  - lib/fastlane/plugin/roku_app_util/actions/roku_dev_server_check_action.rb
166
+ - lib/fastlane/plugin/roku_app_util/actions/roku_dev_server_rekey.rb
166
167
  - lib/fastlane/plugin/roku_app_util/helper/roku_app_util_helper.rb
167
168
  - lib/fastlane/plugin/roku_app_util/version.rb
168
169
  homepage: https://github.com/WarnerMedia/fastlane-plugin-roku_app_util
@@ -184,7 +185,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
184
185
  - !ruby/object:Gem::Version
185
186
  version: '0'
186
187
  requirements: []
187
- rubygems_version: 3.1.2
188
+ rubygems_version: 3.1.6
188
189
  signing_key:
189
190
  specification_version: 4
190
191
  summary: Fastlane plugin for Roku app utility.