diff --git a/bin/ipa-resign.js b/bin/ipa-resign.js index f704fb8..e1f2a80 100755 --- a/bin/ipa-resign.js +++ b/bin/ipa-resign.js @@ -103,6 +103,7 @@ Example: ${cmd} -L # enumerate codesign identities, grab one and use it with -i ${cmd} -i AD71EB42BC289A2B9FD3C2D5C9F02D923495A23C test-app.ipa + ${cmd} -i AD71EB4... -c --lipo arm64 -w -V test-app.ipa `); } else { const target = (conf.s || conf.single) ? 'signFile' : 'signIPA'; diff --git a/example.js b/example.js index 5e503fb..21bdd18 100644 --- a/example.js +++ b/example.js @@ -1,10 +1,19 @@ const Applesign = require('./'); const as = new Applesign({ - identity: 'A5A2C300FE2A8EAC99A9601FDAAEA811CC80586F' + /* bin/ipa-resign -L to list all available identities in your system */ + identity: 'A5A2C300FE2A8EAC99A9601FDAAEA811CC80586F', + /* clone the entitlements from the mobile provisioning */ + cloneEntitlements: false, + mobileProvisioning: '/tmp/embedded.mobileprovision' }); -const s = as.signIPA('/tmp/ada.ipa', onEnd) +if (process.argv.length < 3) { + console.error('Usage: example.js [path/to/ipa]'); + process.exit(1); +} + +const s = as.signIPA(process.argv[2], onEnd) .on('message', (msg) => { console.log('message', msg); }) diff --git a/package.json b/package.json index 398dfd4..7caa333 100644 --- a/package.json +++ b/package.json @@ -63,5 +63,5 @@ ] }, "name": "applesign", - "version": "0.9.2" + "version": "1.0.0" } diff --git a/session.js b/session.js index b650dfe..b62f00f 100644 --- a/session.js +++ b/session.js @@ -460,15 +460,16 @@ module.exports = class ApplesignSession { let found = false; walk.walkSync(appdir, (basedir, filename, stat) => { const file = path.join(basedir, filename); + /* only walk on files. Symlinks and other special files are forbidden */ + if (!fs.lstatSync(file).isFile()) { + return; + } if (file.endsWith(exe)) { this.emit('message', 'Executable found at ' + file); libraries.push(file); found = true; return; } - if (!fs.lstatSync(file).isFile()) { - return; - } try { const fd = fs.openSync(file, 'r'); let buffer = new Buffer(4); @@ -531,10 +532,10 @@ module.exports = class ApplesignSession { peek(cb); }); }; - if (this.config.dontVerify) { - return next(); - } peek(() => { + if (this.config.dontVerify) { + return next(); + } libsCopy = libs.slice(0); const verify = (cb) => { if (libsCopy.length === 0) {