Skip to content

Commit

Permalink
[Chore] Generate & update sample project
Browse files Browse the repository at this point in the history
  • Loading branch information
bot-nimble committed Aug 23, 2023
1 parent d31fefd commit ed7140a
Show file tree
Hide file tree
Showing 14 changed files with 207 additions and 144 deletions.
2 changes: 2 additions & 0 deletions sample/android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="co.nimblehq.kmm.template.android">

<uses-permission android:name="android.permission.INTERNET"/>

<application
android:name=".MyApplication"
android:allowBackup="false"
Expand Down
2 changes: 1 addition & 1 deletion sample/ios/ArkanaKeys/ArkanaKeys/Sources/ArkanaKeys.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import ArkanaKeysInterfaces
public enum ArkanaKeys {
@inline(__always)
fileprivate static let salt: [UInt8] = [
0xe8, 0x37, 0x3c, 0xbb, 0xbb, 0xac, 0x85, 0x23, 0x4f, 0xa6, 0x69, 0x57, 0xc7, 0xf3, 0xd6, 0x1e, 0xa, 0xd, 0xf7, 0xf2, 0xeb, 0x18, 0x42, 0xcd, 0x89, 0xdf, 0xd9, 0xdf, 0x78, 0x80, 0x44, 0xc6, 0x58, 0x8c, 0xe, 0xfc, 0x3, 0x98, 0x9d, 0x71, 0xc4, 0xc5, 0x1c, 0x9a, 0xfc, 0xd4, 0x6a, 0x3b, 0x86, 0xa6, 0xe2, 0xe, 0xf0, 0xd3, 0xf6, 0x4c, 0x3f, 0x15, 0x64, 0x8e, 0xf4, 0x25, 0x61, 0xfe
0x98, 0x66, 0x3d, 0x1d, 0xc3, 0xe3, 0x7b, 0x47, 0x44, 0x20, 0x54, 0xc0, 0x5a, 0xd1, 0xc5, 0x23, 0xd3, 0x5b, 0xd6, 0xa1, 0xbb, 0x7d, 0x6, 0x3d, 0x65, 0xdc, 0x55, 0x6b, 0x76, 0x2a, 0x56, 0x86, 0xce, 0x8c, 0x1e, 0x8f, 0x43, 0xd7, 0x5c, 0x30, 0xc1, 0x11, 0x70, 0x93, 0xac, 0xef, 0xab, 0x4a, 0x79, 0x2c, 0xde, 0x6c, 0x3c, 0x73, 0x35, 0xcc, 0x28, 0xe4, 0x24, 0xcd, 0x44, 0xf9, 0xfb, 0x46
]

static func decode(encoded: [UInt8], cipher: [UInt8]) -> String {
Expand Down
22 changes: 11 additions & 11 deletions sample/ios/ArkanaKeys/ArkanaKeys/Tests/ArkanaKeysTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ final class ArkanaKeysTests: XCTestCase {
override func setUp() {
super.setUp()
salt = [
0xe8, 0x37, 0x3c, 0xbb, 0xbb, 0xac, 0x85, 0x23, 0x4f, 0xa6, 0x69, 0x57, 0xc7, 0xf3, 0xd6, 0x1e, 0xa, 0xd, 0xf7, 0xf2, 0xeb, 0x18, 0x42, 0xcd, 0x89, 0xdf, 0xd9, 0xdf, 0x78, 0x80, 0x44, 0xc6, 0x58, 0x8c, 0xe, 0xfc, 0x3, 0x98, 0x9d, 0x71, 0xc4, 0xc5, 0x1c, 0x9a, 0xfc, 0xd4, 0x6a, 0x3b, 0x86, 0xa6, 0xe2, 0xe, 0xf0, 0xd3, 0xf6, 0x4c, 0x3f, 0x15, 0x64, 0x8e, 0xf4, 0x25, 0x61, 0xfe
0x98, 0x66, 0x3d, 0x1d, 0xc3, 0xe3, 0x7b, 0x47, 0x44, 0x20, 0x54, 0xc0, 0x5a, 0xd1, 0xc5, 0x23, 0xd3, 0x5b, 0xd6, 0xa1, 0xbb, 0x7d, 0x6, 0x3d, 0x65, 0xdc, 0x55, 0x6b, 0x76, 0x2a, 0x56, 0x86, 0xce, 0x8c, 0x1e, 0x8f, 0x43, 0xd7, 0x5c, 0x30, 0xc1, 0x11, 0x70, 0x93, 0xac, 0xef, 0xab, 0x4a, 0x79, 0x2c, 0xde, 0x6c, 0x3c, 0x73, 0x35, 0xcc, 0x28, 0xe4, 0x24, 0xcd, 0x44, 0xf9, 0xfb, 0x46
]
globalSecrets = ArkanaKeys.Global()
}
Expand All @@ -26,49 +26,49 @@ final class ArkanaKeysTests: XCTestCase {

func test_decodeRandomHexKey_shouldDecode() {
let encoded: [UInt8] = [
0xde, 0xf, 0x8, 0x8d, 0x82, 0x9d, 0xb0, 0x16, 0x76, 0x91, 0x50, 0x33, 0xf6, 0xca, 0xe3, 0x2e, 0x3a, 0x39, 0xc7, 0xc3, 0x8f, 0x7b, 0x77, 0xaf, 0xea, 0xe9, 0xe8, 0xbe, 0x48, 0xe1, 0x21, 0xf2, 0x61, 0xbf, 0x6b, 0xcd, 0x65, 0xfa, 0xab, 0x47, 0xf4, 0xa1, 0x2c, 0xa8, 0xcf, 0xe7, 0xb, 0x8, 0xb4, 0x91, 0xd2, 0x39, 0x93, 0xe2, 0xc3, 0x7b, 0x8, 0x2d, 0, 0xb7, 0x96, 0x12, 0x56, 0x9b, 0x8d, 0x5, 0xc, 0xde, 0x8e, 0x9f, 0xb3, 0x47, 0x7a, 0x91, 0x5c, 0x60, 0xf0, 0xc3, 0xef, 0x2b, 0x3a, 0x68, 0x93, 0xc1, 0xde, 0x2b, 0x73, 0xaf, 0xb9, 0xe8, 0xbf, 0xe7, 0x40, 0xe1, 0x76, 0xa5, 0x6b, 0xba, 0x3b, 0x99, 0x61, 0xac, 0xf9, 0x15, 0xf6, 0xa7, 0x2e, 0xae, 0xcc, 0xe5, 0x53, 0x5e, 0xbf, 0xc0, 0x86, 0x68, 0x95, 0xb1, 0x93, 0x2a, 0xf, 0x2d, 0x2, 0xbc, 0x91, 0x41, 0, 0x9b
0xab, 0x7, 0xc, 0x2a, 0xa7, 0xd4, 0x42, 0x25, 0x70, 0x16, 0x6d, 0xf4, 0x6c, 0xe3, 0xf1, 0x16, 0xb6, 0x6e, 0xef, 0xc0, 0x8a, 0x1f, 0x36, 0x58, 0, 0xe9, 0x60, 0x5b, 0x14, 0x49, 0x65, 0xb7, 0xaa, 0xbc, 0x78, 0xeb, 0x77, 0xb1, 0x69, 0x4, 0xf4, 0x73, 0x16, 0xa6, 0x9d, 0xdf, 0x9d, 0x2b, 0x48, 0x1d, 0xbd, 0x9, 0x5e, 0x42, 0x50, 0xfe, 0x4e, 0x86, 0x46, 0xa8, 0x20, 0x98, 0xca, 0x76, 0xfa, 0x5f, 0xf, 0x7f, 0xf4, 0xdb, 0x4b, 0x70, 0x77, 0x11, 0x37, 0xa3, 0x6c, 0xe2, 0xa4, 0x45, 0xe7, 0x3f, 0xe1, 0xc4, 0x8b, 0x4c, 0x33, 0xa, 0x5c, 0xbe, 0x66, 0x58, 0x44, 0x1c, 0x60, 0xb3, 0xfa, 0xee, 0x78, 0xbe, 0x25, 0xb4, 0x69, 0x9, 0xa0, 0x27, 0x42, 0xab, 0xca, 0x8e, 0x98, 0x7d, 0x4c, 0x1f, 0xee, 0xd, 0x5d, 0x43, 0x4, 0xfb, 0x10, 0xdd, 0x47, 0xfb, 0x21, 0x98, 0xc9, 0x25
]
XCTAssertEqual(ArkanaKeys.decode(encoded: encoded, cipher: salt), "68469155979d19500401dc5bc61a0ae493e1fb660d0233a32707c15778d9b77ee20e536d575770950ed3531b07f88a2c365eb4dd2b24019e9fdfebef08f2edae")
XCTAssertEqual(ArkanaKeys.decode(encoded: encoded, cipher: salt), "3a17d79b46946245e59a1b0ee550bc31d0fd4f545bf5106a11ceb1e2fbbeda10b92b780731cc63af4d7e01579b3326654bf1fc59a628fa37530aa01789c6ea2c")
}

func test_decodeRandomBase64Key_shouldDecode() {
let encoded: [UInt8] = [
0x84, 0x53, 0x72, 0xd1, 0xcc, 0xfe, 0xe6, 0xc, 0x20, 0xfe, 0x5e, 0x64, 0x86, 0xdc, 0xe7, 0x73, 0x58, 0x44, 0xd8, 0xba, 0x93, 0x2c, 0x1b, 0x98, 0xc3, 0xbb, 0xae, 0x86, 0x1d, 0xd4, 0x31, 0x90, 0x17, 0xbd, 0x49, 0xc8, 0x72, 0xab, 0xd1, 0x1, 0xf5, 0x82, 0x48, 0xdf, 0x9e, 0xe0, 0x3, 0x7e, 0xf6, 0xf0, 0x92, 0x61, 0x97, 0xe4, 0x8e, 0x2, 0x6d, 0x61, 0x12, 0xfe, 0xb8, 0x49, 0x57, 0xd5, 0x9a, 0x63, 0x13, 0xef, 0xff, 0x98, 0xfd, 0x59, 0x28, 0x92, 0x27, 0x15, 0xfe, 0x94, 0x8f, 0x7d, 0x39, 0x60, 0x81, 0x8a, 0xd8, 0x7f, 0x7f, 0xf0
0xce, 0x1, 0x47, 0x59, 0x8a, 0xab, 0xd, 0x24, 0x33, 0x15, 0x2c, 0xb7, 0x9, 0xe5, 0xb7, 0x49, 0xa4, 0x1f, 0xe4, 0xea, 0xd0, 0x25, 0x47, 0x7b, 0x54, 0x9a, 0x27, 0x26, 0x39, 0x4f, 0x2e, 0xcf, 0xf7, 0xc2, 0x74, 0xe2, 0x37, 0x8e, 0x19, 0x62, 0x84, 0x58, 0x1d, 0xc9, 0xf8, 0xbf, 0xe2, 0x6, 0x38, 0x6d, 0x91, 0, 0x9, 0x34, 0x45, 0x8e, 0x1b, 0xbd, 0x74, 0xac, 0x7, 0x8e, 0xc3, 0x20, 0xc8, 0x3c, 0x6a, 0x73, 0xf1, 0x84, 0xd, 0x1e, 0x77, 0x51, 0x6d, 0xaf, 0x71, 0x95, 0xa2, 0x62, 0x94, 0x1, 0xb9, 0x96, 0xd2, 0x2c, 0x3b, 0
]
XCTAssertEqual(ArkanaKeys.decode(encoded: encoded, cipher: salt), "ldNjwRc/oX73A/1mRI/Hx4YUJdwYeTuVO1G4q3Lp1GTEb4iEpVpog7xNRtvpLl6+rT/TD4xzg4NB9gYc3mvx3g==")
XCTAssertEqual(ArkanaKeys.decode(encoded: encoded, cipher: salt), "VgzDIHvcw5xwS4rjwD2KkXAF1FrMOexI9NjmtYEREImZTPILAAOl5GpB3YPaCw8fPZWn2gvY3q9o+DgAGZo7iQ==")
}

func test_decodeUUIDKey_shouldDecode() {
let encoded: [UInt8] = [
0x89, 0x52, 0x8, 0x83, 0x8f, 0xc9, 0xb0, 0x46, 0x62, 0x97, 0x5d, 0x60, 0xf7, 0xde, 0xe2, 0x2b, 0x3d, 0x6e, 0xda, 0x90, 0x8e, 0x2b, 0x24, 0xe0, 0xeb, 0xe9, 0xb8, 0xed, 0x4c, 0xb3, 0x27, 0xfe, 0x69, 0xe8, 0x68, 0x9a
0xaa, 0x53, 0x5c, 0x7e, 0xfb, 0x81, 0x4c, 0x71, 0x69, 0x17, 0x36, 0xf5, 0x39, 0xfc, 0xf1, 0x47, 0xb0, 0x6d, 0xfb, 0xc3, 0x8f, 0x48, 0x34, 0x10, 0x56, 0xbe, 0x61, 0x5a, 0x17, 0x48, 0x62, 0xb7, 0xf9, 0xbb, 0x7b, 0xec
]
XCTAssertEqual(ArkanaKeys.decode(encoded: encoded, cipher: salt), "ae484e5e-1470-457c-be3f-b6a243c81dff")
XCTAssertEqual(ArkanaKeys.decode(encoded: encoded, cipher: salt), "25ac8b76-7b5c-4dc6-b452-3b41ab4177ec")
}

func test_decodeTrueBoolValue_shouldDecode() {
let encoded: [UInt8] = [
0x9c, 0x45, 0x49, 0xde
0xec, 0x14, 0x48, 0x78
]
XCTAssertTrue(ArkanaKeys.decode(encoded: encoded, cipher: salt))
}

func test_decodeFalseBoolValue_shouldDecode() {
let encoded: [UInt8] = [
0x8e, 0x56, 0x50, 0xc8, 0xde
0xfe, 0x7, 0x51, 0x6e, 0xa6
]
XCTAssertFalse(ArkanaKeys.decode(encoded: encoded, cipher: salt))
}

func test_decodeIntValue_shouldDecode() {
let encoded: [UInt8] = [
0xdc, 0x5
0xac, 0x54
]
XCTAssertEqual(ArkanaKeys.decode(encoded: encoded, cipher: salt), 42)
}

func test_encodeAndDecodeValueWithDollarSign_shouldDecode() {
let encoded: [UInt8] = [
0x9a, 0x52, 0x5d, 0xd7, 0xe4, 0x88, 0xe9, 0x4a, 0x22, 0xf9, 0x1a, 0x3f, 0xa6, 0x97, 0xaf
0xea, 0x3, 0x5c, 0x71, 0x9c, 0xc7, 0x17, 0x2e, 0x29, 0x7f, 0x27, 0xa8, 0x3b, 0xb5, 0xbc
]
XCTAssertEqual(ArkanaKeys.decode(encoded: encoded, cipher: salt), "real_$lim_shady")
}
Expand Down
Loading

0 comments on commit ed7140a

Please sign in to comment.