5555class Keychain
5656 attr_accessor :name , :pass
5757
58+ # Necessary for use of sh call.
59+ include Fastlane ::Helper ::ShHelper
60+
5861 def initialize ( name )
5962 # Local devs will not have KEYCHAIN_PASSWORD set, and will be prompted for password.
6063 return "login.keychain-db" unless ENV [ 'KEYCHAIN_PASSWORD' ]
@@ -74,6 +77,8 @@ class Keychain
7477 lock_after_timeout : true ,
7578 timeout : 1500
7679 )
80+ # Fix certificate access permissions
81+ sh ( "security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k #{ pass } #{ name } " )
7782 end
7883end
7984
@@ -215,13 +220,6 @@ platform :ios do
215220 lane :release do
216221 kc = Keychain . new ( 'fastlane' )
217222
218- # recreate keychain
219- sh ( "security delete-keychain #{ kc . name } " , error_callback : -> ( result ) { } )
220- sh ( "security create-keychain -p #{ kc . pass } #{ kc . name } " )
221- sh ( "security set-keychain-settings -t 3600 -l #{ kc . name } " )
222- sh ( "security unlock-keychain -p #{ kc . pass } #{ kc . name } " )
223- sh ( "security list-keychains -d user -s login.keychain #{ kc . name } " )
224-
225223 match (
226224 type : 'appstore' ,
227225 readonly : true ,
@@ -231,12 +229,6 @@ platform :ios do
231229 keychain_password : kc . pass
232230 )
233231
234- # Fix certificate access permissions
235- sh ( "security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k #{ kc . pass } #{ kc . name } " )
236-
237- # Debug
238- sh ( "security find-identity -v -p codesigning #{ kc . name } " )
239-
240232 build_ios_app (
241233 scheme : 'StatusIm' ,
242234 workspace : 'ios/StatusIm.xcworkspace' ,
0 commit comments