Sha256: 2f788ff8041b4561fb0f4200bbfd00a9041a3526b38192dda753532bba445bb0

Contents?: true

Size: 1.07 KB

Versions: 1

Compression:

Stored size: 1.07 KB

Contents

#!/usr/bin/env ruby
require 'fastlane'
require 'match'
# CLI to decrypt files using fastlane match encryption layer

def usage
  puts("USAGE: ruby math_decrypt.rb [password] [input_path] [output_path]")
  exit(-1)
end

if ARGV.count < 2 || ARGV.count > 3
  usage
end

method_name = 'decrypt'
password = ARGV.shift
input_file = ARGV.shift

if ARGV.count > 0
  output_file = ARGV.shift
else
  output_file = input_file
end

unless File.exist?(input_file)
  puts "input_file:#{input_file} doesn't exist".red
  exit
end
exit if password.empty?

begin
  puts "match Encryption method_name:#{method_name} password:#{password} input_file:#{input_file} output_file:#{output_file}"
  Match::Encryption::MatchFileEncryption.new.send(method_name, file_path: input_file, password: password, output_path: output_file)
  puts "match decrypted mobileprovision finish!"
  # if File.exist?(output_file)
  #   puts("Couldn't decrypted certificates repo")
  # else
  #   puts("🔓  Successfully decrypted certificates repo")
  # end
rescue => e
  puts("ERROR #{method_name}ing. [#{e}]. Check your password")
  usage
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cocoapods-bb-PodAssistant-0.3.5.0 bin/match_decrypt