diff --git a/fastlane/Fastfile b/fastlane/Fastfile index c8ec043..cb2e20e 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -1,3 +1,18 @@ +require "open3" + +def read_plist_value(path, key) + value, _error, status = Open3.capture3( + "/usr/bin/plutil", + "-extract", + key, + "raw", + path + ) + UI.user_error!("Unable to read #{key} from the archived app") unless status.success? + + value.strip +end + default_platform(:ios) platform :ios do @@ -44,10 +59,10 @@ platform :ios do "XION.app", "Info.plist" ) - archived_access_token = get_info_plist_value( - path: archived_plist, - key: "HomeAssistantAccessToken" - ).to_s + archived_access_token = read_plist_value( + archived_plist, + "HomeAssistantAccessToken" + ) unless archived_access_token == home_assistant_access_token UI.user_error!("The archived app does not contain the configured Home Assistant access token") end