const findProv = async () => { const matchProv = f => reg.mobileprovision.test(f); const { entry } = await findEntry(zip, matchProv); if (!entry) { return null; } const file = await zip.openReadStreamAsync(entry); return collect(file); }
zip.on('error', (err) => { throw err; });
yauzl.open(this.path, { lazyEntries: true }, function (err, zipfile) { if (err) { callback(err); return; } function next() { zipfile.readEntry(); } zipfile.on('entry', function (entry) { callback(null, zipfile, entry, next); }); zipfile.on('end', function () { if (utils.isFunction(onEnd)) { onEnd(); } }); next(); });
openedZipArchive.on('entry', function(entry) { openedZipArchive.openReadStream(entry, function(error, readStream) {
return callback(err); zipfile.on('end', function () { zipfile.close(); return callback(null, _unzippedFiles); }); zipfile.on('error', callback); zipfile.readEntry(); zipfile.on('entry', function (entry) { var _unzippedFile = { name : entry.fileName, zipfile.readEntry(); zipfile.openReadStream(entry, function (err, readStream) { if (err) { zipfile.close(); return callback(err); readStream.on('end', function () { _unzippedFile.data = Buffer.concat(buffers); zipfile.readEntry(); }); readStream.on('error', function (err) { zipfile.close(); return callback(err); });
const findInfo = async () => { const matchInfo = f => reg.info.test(f); const { entry } = await findEntry(zip, matchInfo); if (!entry) { return null; } const file = await zip.openReadStreamAsync(entry); const src = await collect(file); let parsed; if (src[0] === chrOpenChevron) { parsed = plistParse(src.toString()); } else if (src[0] === chrLowercaseB) { parsed = bplistParse(src); } else { throw new Error(`unknown plist type byte (0x${src[0].toString(16)})`); } return parsed; }
zipFile.on("entry", function(entry) { const fileName = entry.fileName.toString("utf8") if(fileName.endsWith("/")){ const folderPath = join(modulePath, fileName) if(!fs.existsSync(folderPath))fs.mkdirSync(folderPath, {recursive: true}) zipFile.readEntry(); }else{ if(!exists){ const filePath = join(modulePath, fileName) zipFile.openReadStream(entry, function(err, readStream) { if (err) throw err; readStream.on("end", function() { }else{ let filePath = join(modulePath, fileName) if(filePath.endsWith(".asar"))return zipFile.readEntry(); if(fileName.endsWith(".node")){ hasNode = true extractFile() }else if(join(filePath, "..") === modulePath && filePath.endsWith(".js")){ if(patchedJS.includes(filePath))return zipFile.readEntry(); patchedJS.push(filePath) extractFile(() => { extractFile() }else{ zipFile.readEntry(); zipFile.openReadStream(entry, function(err, readStream) {