Read archived binary plist with plutil
All checks were successful
TestFlight / Build and upload (push) Successful in 1m29s
All checks were successful
TestFlight / Build and upload (push) Successful in 1m29s
This commit is contained in:
@@ -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)
|
default_platform(:ios)
|
||||||
|
|
||||||
platform :ios do
|
platform :ios do
|
||||||
@@ -44,10 +59,10 @@ platform :ios do
|
|||||||
"XION.app",
|
"XION.app",
|
||||||
"Info.plist"
|
"Info.plist"
|
||||||
)
|
)
|
||||||
archived_access_token = get_info_plist_value(
|
archived_access_token = read_plist_value(
|
||||||
path: archived_plist,
|
archived_plist,
|
||||||
key: "HomeAssistantAccessToken"
|
"HomeAssistantAccessToken"
|
||||||
).to_s
|
)
|
||||||
unless archived_access_token == home_assistant_access_token
|
unless archived_access_token == home_assistant_access_token
|
||||||
UI.user_error!("The archived app does not contain the configured Home Assistant access token")
|
UI.user_error!("The archived app does not contain the configured Home Assistant access token")
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user