安装npm
brew install node
没有HomeBrew的到官网装下
安装asar
npm install -g asar
安装starUML
解压文件app.asar
cd /Applications/StarUML.app/Contents/Resources/ asar extract app.asar app
修改新生成的app目录下的lisence文件
vim app/src/engine/license-manager.js
checkLicenseValidity () {
this.validate().then(() => {
setStatus(this, true)
}, () => {
//setStatus(this, false)
// UnregisteredDialog.showDialog()
setStatus(this, true)//这个
})
}
/**
* Check the license key in server and store it as license.key file in local
*
* @param {string} licenseKey
*/
register (licenseKey) {
return new Promise((resolve, reject) => {
$.post(app.config.validation_url, {licenseKey: licenseKey})
.done(data => {
var file = path.join(app.getUserPath(), '/license.key')
fs.writeFileSync(file, JSON.stringify(data, 2))
licenseInfo = data
setStatus(this, true)
resolve(data)
})
.fail(err => {
setStatus(this, true)//这个
//if (err.status === 499) { /* License key not exists */
// reject('invalid')
//} else {
// reject()
//}
})
})
}
重新打包替换原来的app.asar
asar pack app app.asar