class Objc_Obfuscator::CLI

Public Instance Methods

integrate(encryption_key, project_path) click to toggle source
# File lib/objc-obfuscator/cli.rb, line 51
def integrate(encryption_key, project_path)
  raise Thor::Error, 'A valid project file should be specified' unless File.exist?(project_path)

  podfile_path = File.join File.dirname(project_path), './Podfile'
  unless options[:podfile].empty? 
    podfile_path = options[:podfile]
  end
  raise Thor::Error, 'The project must be using cocoapods' unless File.exist?(podfile_path)

  integrate_xcode encryption_key, project_path, podfile_path, options[:target]

end
obfuscate(key, *file_paths) click to toggle source
# File lib/objc-obfuscator/cli.rb, line 24
def obfuscate(key, *file_paths)
  
  raise Thor::Error, 'A valid key and file must be provided' if key.empty? || file_paths.empty?

  file_paths.each do |file_path| 
    unless File.exist? file_path
      say_status :warning, "File #{file_path} not found!", :yellow
    else
      Dir.mktmpdir { |tmp_dir| obfuscate_file file_path, tmp_dir, key, options[:backup] }
    end
  end
end