license updating
This commit is contained in:
@@ -31,15 +31,35 @@ class MyAesCrypt
|
||||
file_path = "config/shops.json"
|
||||
aes_key, aes_iv = export_key(passphrase)
|
||||
tmpHash = {
|
||||
"lookup" => passphrase,
|
||||
"key" => aes_key,
|
||||
"iv" => aes_iv
|
||||
"lookup" => passphrase = {
|
||||
"key" => aes_key,
|
||||
"iv" => aes_iv
|
||||
}
|
||||
}
|
||||
|
||||
File.open(file_path, "w") { |io|
|
||||
io.write(tmpHash.to_json)
|
||||
}
|
||||
shop_data = File.read(file_path)
|
||||
if shop_data != ""
|
||||
shop_json = JSON.parse(shop_data)
|
||||
byebug
|
||||
shop_json.each do |j|
|
||||
if j == passphrase
|
||||
j.each do |k|
|
||||
return k["key"], k["iv"]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
shop_json << tmpHash
|
||||
|
||||
File.open(file_path, "w") { |io|
|
||||
io.puts JSON.pretty_generate(shop_json)
|
||||
}
|
||||
else
|
||||
File.open(file_path, "w") { |io|
|
||||
io.write(tmpHash.to_json)
|
||||
}
|
||||
end
|
||||
return aes_key, aes_iv
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
Reference in New Issue
Block a user