How to use the bplist-parser.parseFile function in bplist-parser

To help you get started, we’ve selected a few bplist-parser examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github motioncrypto / masternode-installer / src / renderer / components / LandingPage.vue View on Github external
'0777', (err) => {
        if (err) {
          console.log(err);
        }

        if (os.platform() === 'darwin') {
          if (existsSync(`${os.userInfo().homedir}/Library/Preferences/org.motion.Motion-Qt.plist`)) {
            bplist.parseFile(`${os.userInfo().homedir}/Library/Preferences/org.motion.Motion-Qt.plist`, (err, plistData) => {
              if (err) throw err;

              this.$store.commit('SET_MNCONFPATH', {
                mnConfPath: plistData[0].strDataDir,
              });
              this.runDaemon();
            });
          } else {
            this.runDaemon();
          }
        } else if (os.platform() === 'win32') {
          // regedit.list('HKCU\\SOFTWARE\\MOTION\\MOTION-QT', (err, registryData) => {
          //   if (err) throw err;

          //   this.$store.commit('SET_MNCONFPATH', {
          //     mnConfPath: registryData[Object.keys(registryData)[0]].values.strDataDir.value,
github little-core-labs / pkg-packager / lib / builders / macos / dmg / index.js View on Github external
steps.push(next => {
      const targetInfoPlistPath = path.resolve(stageDirectory, appBundleName, 'Contents/Info.plist')
      bplist.parseFile(targetInfoPlistPath, (err, plistArray) => {
        if (err) return next(err)
        const plist = plistArray[0]
        plist.CFBundleIdentifier = opts.bundleId || 'org.littlecorelabs.pkgpackager'
        plist.CFBundleShortVersionString = opts.version || '1.0.0'
        plist.CFBundleVersion = opts.version || '1.0.0'
        plist.CFBundleExecutable = opts.productName
        plist.NSHumanReadableCopyright = opts.copyright
        plist.CFBundleName = opts.productName
        const plistBuf = bplistCtor([plist])
        fs.writeFile(targetInfoPlistPath, plistBuf, next)
      })
    })
github appium / appium / lib / devices / ios / ios.js View on Github external
var parsePlistFile = function (plist, cb) {
  bplistParse.parseFile(plist, function (err, obj) {
    if (err) {
      logger.debug("Could not parse plist file (as binary) at " + plist);
      logger.info("Will try to parse the plist file as XML");
      parseXmlPlistFile(plist, function (err, obj) {
        if (err) {
          logger.debug("Could not parse plist file (as XML) at " + plist);
          return cb(err, null);
        } else {
          logger.debug("Parsed app Info.plist (as XML)");
          binaryPlist = false;
          cb(null, obj);
        }
      });
    } else {
      binaryPlist = true;
      if (obj.length) {
github wix / Detox / src / ios / simulator.js View on Github external
function getBundleIdFromApp(appPath, onComplete) {
  try {
    const absPath = getAppAbsolutePath(appPath);
    const infoPlistPath = path.join(absPath, '/Info.plist');
    bplist.parseFile(infoPlistPath, function (err, obj) {
      if (err) {
        onComplete(err);
        return;
      }
      if (Array.isArray(obj)) obj = obj[0];
      const bundleId = obj['CFBundleIdentifier'];
      if (!bundleId) {
        onComplete(new Error(`Field CFBundleIdentifier not found inside Info.plist of app binary at ${absPath}`));
        return;
      }
      onComplete(null, bundleId);
    });
  } catch (e) {
    onComplete(e);
    return;
  }
github HiJesse / Demeter / util / IPAUtil.js View on Github external
export const parseBinaryPList = (filePath, cb) => {
    BPList.parseFile(filePath, (err, data) => {
        if (err) {
            LogUtil.e(`${TAG} parseBinaryPList ${JSON.stringify(err)}`);
            cb(err);
            return;
        }

        if (CheckerUtil.isArrayEmpty(data)) {
            LogUtil.e(`${TAG} parseBinaryPList invalid array`);
            cb(new Error('invalid array'));
            return;
        }
        cb(null, data[0]);
    });
};
github sandeepmistry / node-core-bluetooth / lib / uuid-to-address.js View on Github external
function processPlist() {
  bplist.parseFile(PLIST_FILE, function (err, obj) {
    if (err) {
      return;
    }

    coreBluetoothCache = obj[0].CoreBluetoothCache || {};
  });
}
github appium / appium / lib / devices / ios / ios.js View on Github external
IOS.prototype.parseLocalizableStrings = function (cb) {
  if (this.args.app === null) {
    logger.info("Localizable.strings is not currently supported when using real devices.");
    cb();
  } else {
    var strings = path.resolve(this.args.app, "Localizable.strings");

    if (!fs.existsSync(strings)) {
      strings = path.resolve(this.args.app, "en.lproj", "Localizable.strings");
    }

    bplistParse.parseFile(strings, function (err, obj) {
      if (err) {
        xmlPlistFile(strings, function (err, obj) {
          if (err) {
            logger.warn("Could not parse plist file at " + strings);
          } else {
            logger.info("Parsed app Localizable.strings");
            this.localizableStrings = obj;
          }
          cb();
        }.bind(this));
      } else {
        logger.info("Parsed app Localizable.strings");
        this.localizableStrings = obj;
        cb();
      }
    }.bind(this));

bplist-parser

Binary plist parser.

MIT
Latest version published 2 years ago

Package Health Score

70 / 100
Full package analysis

Popular bplist-parser functions