安裝npm
brew install node
沒(méi)有HomeBrew的到官網(wǎng)裝下
安裝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)//這個(gè)
})
}
/**
* 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)//這個(gè)
//if (err.status === 499) { /* License key not exists */
// reject('invalid')
//} else {
// reject()
//}
})
})
}
重新打包替換原來(lái)的app.asar
asar pack app app.asar