mobile-secrets 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/resources/SecretsTemplate.swift +3 -3
- data/lib/src/secrets_handler.rb +1 -1
- metadata +2 -4
- data/test/test_hola.rb +0 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1bb1e6c36ce56b0181aab583f65c8b6935ac47b74ae52f7e3cb5a2bb27ad73f
|
4
|
+
data.tar.gz: f475935731fc3fb87a1f8cac527dabec2553c2a4f297fdc3e626bddb8e27921b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f0906f30fab6cc56ba9f0f3ce263d4fa3027b6bda2fcf7654b0494b1f495694e8bf42591ec16cb0db48eed974c9812d89ecd47f185111d5ac8b191c34ee38dc
|
7
|
+
data.tar.gz: e08c129ba0d265079c9c9a9e7d9207f2e7a1060f76691b22bf344d466a57716493f018c35204077ad8dd48d7bfa7b148d819bf5be81685217b127f5910c01e46
|
@@ -11,9 +11,9 @@ class Secrets {
|
|
11
11
|
private init() {}
|
12
12
|
|
13
13
|
func string(forKey key: String) -> String? {
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
guard let index = bytes.firstIndex(where: { String(data: Data($0), encoding: .utf8) == key }),
|
15
|
+
let value = decrypt(bytes[index + 1]) else { return nil }
|
16
|
+
return String(data: Data(value), encoding: .utf8)
|
17
17
|
}
|
18
18
|
|
19
19
|
private func decrypt(_ input: [UInt8]) -> [UInt8]? {
|
data/lib/src/secrets_handler.rb
CHANGED
@@ -29,7 +29,7 @@ module MobileSecrets
|
|
29
29
|
|
30
30
|
def inject_secrets secret_bytes, file
|
31
31
|
template = IO.read "#{__dir__}/../resources/SecretsTemplate.swift"
|
32
|
-
secret_bytes = "#{secret_bytes}".gsub "],", "],\n
|
32
|
+
secret_bytes = "#{secret_bytes}".gsub "],", "],\n " #Formating the array
|
33
33
|
bytes_variable = "private let bytes: [[UInt8]] = #{secret_bytes}"
|
34
34
|
swift_secrets = template.sub "/* SECRET BYTES */", bytes_variable
|
35
35
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mobile-secrets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cyril Cermak
|
@@ -39,7 +39,6 @@ files:
|
|
39
39
|
- lib/resources/example.yml
|
40
40
|
- lib/src/obfuscator.rb
|
41
41
|
- lib/src/secrets_handler.rb
|
42
|
-
- test/test_hola.rb
|
43
42
|
homepage: https://github.com/CyrilCermak/mobile-secrets
|
44
43
|
licenses:
|
45
44
|
- MIT
|
@@ -63,5 +62,4 @@ rubygems_version: 3.0.6
|
|
63
62
|
signing_key:
|
64
63
|
specification_version: 4
|
65
64
|
summary: mobile-secrets tool for handling your mobile secrets
|
66
|
-
test_files:
|
67
|
-
- test/test_hola.rb
|
65
|
+
test_files: []
|
data/test/test_hola.rb
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
require 'test/unit'
|
2
|
-
require 'hola'
|
3
|
-
|
4
|
-
class HolaTest < Test::Unit::TestCase
|
5
|
-
def test_english_hello
|
6
|
-
assert_equal "hello world", Hola.hi("english")
|
7
|
-
end
|
8
|
-
|
9
|
-
def test_any_hello
|
10
|
-
assert_equal "hello world", Hola.hi("ruby")
|
11
|
-
end
|
12
|
-
|
13
|
-
def test_spanish_hello
|
14
|
-
assert_equal "hola mundo", Hola.hi("spanish")
|
15
|
-
end
|
16
|
-
end
|