def sign(self, signer): # first sign all the dylibs frameworks_path = join(self.path, 'Frameworks') if exists(frameworks_path): dylib_paths = glob.glob(join(frameworks_path, '*.dylib')) for dylib_path in dylib_paths: dylib = signable.Dylib(dylib_path) dylib.sign(self, signer) # then create the seal # TODO maybe the app should know what its seal path should be... self.seal_path = code_resources.make_seal(self.get_executable_path(), self.path) # then sign the app executable = signable.Executable(self.get_executable_path()) executable.sign(self, signer)
def sign(self, signer): """ Sign everything in this bundle, recursively with sub-bundles """ # log.debug("SIGNING: %s" % self.path) frameworks_path = join(self.path, 'Frameworks') if exists(frameworks_path): # log.debug("SIGNING FRAMEWORKS: %s" % frameworks_path) # sign all the frameworks for framework_name in os.listdir(frameworks_path): framework_path = join(frameworks_path, framework_name) # log.debug("checking for framework: %s" % framework_path) try: framework = Framework(framework_path) # log.debug("resigning: %s" % framework_path) framework.resign(signer) except NotMatched: # log.debug("not a framework: %s" % framework_path) continue # sign all the dylibs dylib_paths = glob.glob(join(frameworks_path, '*.dylib')) for dylib_path in dylib_paths: dylib = signable.Dylib(dylib_path) dylib.sign(self, signer) plugins_path = join(self.path, 'PlugIns') if exists(plugins_path): # sign the appex executables appex_paths = glob.glob(join(plugins_path, '*.appex')) for appex_path in appex_paths: plist_path = join(appex_path, 'Info.plist') if not exists(plist_path): continue plist = biplist.readPlist(plist_path) appex_exec_path = join(appex_path, plist['CFBundleExecutable']) appex = signable.Appex(appex_exec_path) appex.sign(self, signer) # then create the seal # TODO maybe the app should know what its seal path should be... self.seal_path = code_resources.make_seal(self.get_executable_path(), self.path) # then sign the app executable = self.executable_class(self.get_executable_path()) executable.sign(self, signer)
def sign_dylibs(self, signer, path): """ Sign all the dylibs in this directory """ for dylib_path in glob.glob(join(path, '*.dylib')): dylib = signable.Dylib(self, dylib_path, signer) dylib.sign(self, signer)