Sha256: 2bf11082947878b101845c545218a8483e9c0f678c730794bd7a20471c03b80c

Contents?: true

Size: 1.14 KB

Versions: 3

Compression:

Stored size: 1.14 KB

Contents

require  'zip'
module LgPodPlugin
  class LUtils
    def self.unzip_file (zip_file, dest_dir)
      begin
        Zip::File.open(zip_file) do |file|
          file.each do |f|
            file_path = File.join(dest_dir, f.name)
            FileUtils.mkdir_p(File.dirname(file_path))
            next if file_path.include?("Example")
            # next if file_path.include?("LICENSE")
            next if file_path.include?(".gitignore")
            next if file_path.include?("node_modules")
            next if file_path.include?("package.json")
            next if file_path.include?(".swiftlint.yml")
            next if file_path.include?("_Pods.xcodeproj")
            next if file_path.include?("package-lock.json")
            file.extract(f, file_path)
          end
        end
        return true
      rescue => err
        puts err
        return false
      end

    end

    def self.aes_decrypt(key, data)
      de_cipher = OpenSSL::Cipher::Cipher.new("AES-128-CBC")
      de_cipher.decrypt
      de_cipher.key = [key].pack('H*')
      # de_cipher.iv = [iv].pack('H*');
      puts de_cipher.update([data].pack('H*')) << de_cipher.final
    end


  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
lg_pod_plugin-1.0.8 lib/lg_pod_plugin/l_util.rb
lg_pod_plugin-1.0.7 lib/lg_pod_plugin/l_util.rb
lg_pod_plugin-1.0.6 lib/lg_pod_plugin/l_util.rb