Sha256: d675b2945439a818af99a73c318c5159117272a21d6676134b269401c7d9d9a2
Contents?: true
Size: 1.13 KB
Versions: 4
Compression:
Stored size: 1.13 KB
Contents
module RokuBuilder # Change or get dev key class Keyer < Util # Sets the key on the roku device # @param keyed_pkg [String] Path for a package signed with the desired key # @param password [String] Password for the package # @return [Boolean] True if key changed, false otherwise def rekey(keyed_pkg:, password:) oldId = dev_id # upload new key with password path = "/plugin_inspect" conn = multipart_connection payload = { mysubmit: "Rekey", passwd: password, archive: Faraday::UploadIO.new(keyed_pkg, 'application/octet-stream') } conn.post path, payload # check key newId = dev_id newId != oldId end # Get the current dev id # @return [String] The current dev id def dev_id path = "/plugin_package" conn = simple_connection response = conn.get path dev_id = /Your Dev ID:\s*<font[^>]*>([^<]*)<\/font>/.match(response.body) if dev_id dev_id = dev_id[1] else dev_id = /Your Dev ID:[^>]*<\/label> ([^<]*)/.match(response.body)[1] end dev_id end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
roku_builder-3.4.2 | lib/roku_builder/keyer.rb |
roku_builder-3.4.1 | lib/roku_builder/keyer.rb |
roku_builder-3.4.0 | lib/roku_builder/keyer.rb |
roku_builder-3.3.4 | lib/roku_builder/keyer.rb |