def set_application_binary(self, binary: str = None) -> None:
"""
Sets the binary that will be patched.
If a binary is not defined, the applications Info.plist is parsed
and the CFBundleIdentifier key read.
:param binary:
:return:
"""
if binary is not None:
click.secho('Using user provided binary name of: {0}'.format(binary))
self.app_binary = os.path.join(self.app_folder, binary)
return
with open(os.path.join(self.app_folder, 'Info.plist'), 'rb') as f:
info_plist = plistlib.load(f)
# print the bundle identifier
click.secho('Bundle identifier is: {0}'.format(info_plist['CFBundleIdentifier']),
fg='green', bold=True)
self.app_binary = os.path.join(self.app_folder, info_plist['CFBundleExecutable'])
评论列表
文章目录