def unpackBundle(self, path): bundle = ab.Crypt(path, self.outDir) header = self.getHeader(path) if not ab.isBundleDecrypted(header) and ab.isBundleEncrypted(header): self.logWarning("Bundle is not decrypted, decrypting...") # bundle.decrypt() elif not ab.isBundleEncrypted(header) and not ab.isBundleDecrypted( header): self.logWarning("Skipping because it has an unknown header") return bundle.unpack()
def encryptBundle(self, path): bundle = ab.Crypt(path, self.outDir) header = self.getHeader(path) if not ab.isBundleDecrypted(header): self.logWarning("Skipping", bundle.path, "because it's already encrypted") return elif not ab.isBundleEncrypted(header) and not ab.isBundleDecrypted( header): self.logWarning("Skipping", bundle.path, "because it has an unknown header") return bundle.encrypt()
def determineFileType(self, reader): header = self.getHeader(reader) fileType = _UNKNOWN if luacrypt.isLuaEncrypted(header) or luacrypt.isLuaDecrypted(header): fileType = _LUA elif ab.isBundleEncrypted(header) or ab.isBundleDecrypted(header): fileType = _BUNDLE return fileType