Sha256: e9d650cc6c4cf7d7e82001664447ccd3bbd6b68e60aea3bf9e0a64d872d0457c
Contents?: true
Size: 1.25 KB
Versions: 12
Compression:
Stored size: 1.25 KB
Contents
# ********** Copyright Viacom, Inc. Apache 2.0 ********** 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 @logger.info("Key did not change") unless newId != oldId 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
12 entries across 12 versions & 1 rubygems