Skip to content

Commit

Permalink
Merge pull request #25 from keefertaylor/upgrade-deps
Browse files Browse the repository at this point in the history
Upgrade deps and fix release
  • Loading branch information
keefertaylor authored Apr 17, 2020
2 parents 8e61453 + cca9074 commit cbc44b5
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 35 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
osx_image: xcode10.2
osx_image: xcode11.3
language: swift
cache:
bundler: true
Expand All @@ -16,7 +16,7 @@ jobs:
install:
- brew outdated cocoapods || brew upgrade cocoapods
script:
- travis_wait 500 pod lib lint
- pod lib lint --verbose --allow-warnings --platforms=ios
- stage: Build - Carthage And Code Coverage
install:
- brew outdated carthage || brew upgrade carthage
Expand Down
2 changes: 1 addition & 1 deletion Cartfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "krzyzanowskim/CryptoSwift" ~> 0.14.0
github "krzyzanowskim/CryptoSwift" ~> 1.3.0
2 changes: 1 addition & 1 deletion Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "krzyzanowskim/CryptoSwift" "0.14.0"
github "krzyzanowskim/CryptoSwift" "1.3.1"
8 changes: 4 additions & 4 deletions MnemonicKit.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "MnemonicKit"
s.version = "1.3.10"
s.version = "1.3.11"
s.summary = "MnemonicKit provides a Swift implementation of BIP39"
s.description = <<-DESC
MnemonicKit provides a Swift implementation of BIP39.
Expand All @@ -11,13 +11,13 @@
s.homepage = "https://github.com/keefertaylor/MnemonicKit"
s.license = { :type => "MIT", :file => "LICENSE" }
s.author = { "Keefer Taylor" => "[email protected]" }
s.source = { :git => "https://github.com/keefertaylor/MnemonicKit.git", :tag => "1.3.10" }
s.source = { :git => "https://github.com/keefertaylor/MnemonicKit.git", :tag => "1.3.11" }
s.source_files = "MnemonicKit/**/*.swift",
s.swift_version = "4.2"
s.swift_version = "5.2"
s.ios.deployment_target = "8.0"
s.osx.deployment_target = "10.10"

s.dependency "CryptoSwift", "~> 0.14.0"
s.dependency "CryptoSwift", "~> 1.3.0"

s.test_spec "Tests" do |test_spec|
test_spec.source_files = "Tests/*.swift"
Expand Down
17 changes: 9 additions & 8 deletions MnemonicKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@
12B9024EB02AB18E1F44789A /* Mnemonic.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Mnemonic.swift; sourceTree = "<group>"; };
1645FE576891F45DC72864F6 /* MnemonicKitTests.xctest */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.cfbundle; path = MnemonicKitTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
1D6F81AB601CF04F3F1E52E3 /* English.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = English.swift; sourceTree = "<group>"; };
23F75813C686C37B78DE459E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
23F75813C686C37B78DE459E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
256E6CB62D82160ACBA1512E /* String+MnemonicData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String+MnemonicData.swift"; sourceTree = "<group>"; };
65B1627123A1131289B4110A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
65B1627123A1131289B4110A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
7DCB97C4881969FDB72C61DB /* MnemonicKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MnemonicKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
BA1EBAC8ABDF9E72ABA1B642 /* CryptoSwift.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = CryptoSwift.framework; sourceTree = "<group>"; };
C3E5287598681E0527694214 /* vectors.json */ = {isa = PBXFileReference; path = vectors.json; sourceTree = "<group>"; };
C3E5287598681E0527694214 /* vectors.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = vectors.json; sourceTree = "<group>"; };
D2D9394FFD7755F40E53D60E /* Data+BitArray.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Data+BitArray.swift"; sourceTree = "<group>"; };
DC7EE929BD11BA8AB38F9C19 /* MnemonicKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MnemonicKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
EBA32888ED203FE1DA16BFF1 /* MnemonicKitTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MnemonicKitTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
Expand Down Expand Up @@ -297,13 +297,14 @@
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1020;
TargetAttributes = {
};
};
buildConfigurationList = F5079FB8BED8C51BDEEB8C7C /* Build configuration list for PBXProject "MnemonicKit" */;
compatibilityVersion = "Xcode 10.0";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
Base,
en,
);
mainGroup = A44468790B8FFF397004AD5A;
Expand Down Expand Up @@ -751,7 +752,7 @@
5EBFFA0D3DC3BC69DCC7B348 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = "";
defaultConfigurationName = Debug;
};
73E41074CEDAECD9E168B6DD /* Build configuration list for PBXNativeTarget "MnemonicKit_iOS" */ = {
isa = XCConfigurationList;
Expand All @@ -760,7 +761,7 @@
502686BD02E44AFEF1774FB6 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = "";
defaultConfigurationName = Debug;
};
8D81EB8096D3E6550D6B8607 /* Build configuration list for PBXNativeTarget "MnemonicKitTests_iOS" */ = {
isa = XCConfigurationList;
Expand All @@ -769,7 +770,7 @@
6639A0D9B2C6E852582873D4 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = "";
defaultConfigurationName = Debug;
};
9F8727B9B5CF1651B5236875 /* Build configuration list for PBXNativeTarget "MnemonicKitTests_macOS" */ = {
isa = XCConfigurationList;
Expand All @@ -778,7 +779,7 @@
7DAB3B5B81521AB12902B597 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = "";
defaultConfigurationName = Debug;
};
F5079FB8BED8C51BDEEB8C7C /* Build configuration list for PBXProject "MnemonicKit" */ = {
isa = XCConfigurationList;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@
</MacroExpansion>
<CommandLineArguments>
</CommandLineArguments>
<AdditionalOptions>
</AdditionalOptions>
<CodeCoverageTargets>
</CodeCoverageTargets>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -78,8 +74,6 @@
</MacroExpansion>
<CommandLineArguments>
</CommandLineArguments>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@
</MacroExpansion>
<CommandLineArguments>
</CommandLineArguments>
<AdditionalOptions>
</AdditionalOptions>
<CodeCoverageTargets>
</CodeCoverageTargets>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -78,8 +74,6 @@
</MacroExpansion>
<CommandLineArguments>
</CommandLineArguments>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
10 changes: 6 additions & 4 deletions MnemonicKit/Mnemonic.swift
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,16 @@ public enum Mnemonic {
return nil
}

// Securely generate random bytes.
// See: https://developer.apple.com/documentation/security/1399291-secrandomcopybytes
let count = strength / 8
let bytes = [UInt8](repeating: 0, count: count)
guard SecRandomCopyBytes(kSecRandomDefault, count, UnsafeMutablePointer<UInt8>(mutating: bytes)) != -1 else {
var bytes = [UInt8](repeating: 0, count: count)
let status = SecRandomCopyBytes(kSecRandomDefault, bytes.count, &bytes)
guard status == errSecSuccess else {
return nil
}
let data = Data(bytes)
let hexString = data.toHexString()

let hexString = bytes.toHexString()
return mnemonicString(from: hexString, language: language)
}

Expand Down
4 changes: 2 additions & 2 deletions project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ targets:
sources: [MnemonicKit]
scheme:
testTargets:
- MnemonicKitTests_$platform
- MnemonicKitTests_${platform}
gatherCoverageData: true
postCompileScripts:
- script: swiftlint autocorrect --config .swiftlint.yml
Expand All @@ -24,4 +24,4 @@ targets:
platform: [iOS, macOS]
sources: [Tests]
dependencies:
- target: MnemonicKit_$platform
- target: MnemonicKit_${platform}

0 comments on commit cbc44b5

Please sign in to comment.