StarUML是用nodejs写的。确切的说是用Electron前端框架写的。新版本中所有的starUML源代码是通过asar工具打包而成。确切的代码位置在“%LOCALAPPDATA%ProgramsStarURML esourcesapp.asar”
我们可以通过asar工具解压修改达到破解目的。
StarUML安装
官网:http://staruml.io
安装NodeJs
1,HomeBrew安装
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew -V
2,Nodebrew安装
brew install nodebrew
nodebrew -v
3,Nodejs安装
$ nodebrew ls-remote
如果出现以下异常
Fetching: https://nodejs.org/dist/v7.10.0/node-v7.10.0-darwin-x64.tar.gz
Warning: Failed to create the file
Warning: /Users/whoami/.nodebrew/src/v7.10.0/node-v7.10.0-darwin-x64.ta
Warning: r.gz: No such file or directory
curl: (23) Failed writing body (0 != 941)
download failed: https://nodejs.org/dist/v7.10.0/node-v7.10.0-darwin-x64.tar.gz
需要创建文件夹
mkdir -p ~/.nodebrew/src
$ nodebrew install-binary latest
4,Nodejs有效化
$ nodebrew ls
$ nodebrew use v7.1.0
5,环境变量设置
$ echo 'export PATH=$HOME/.nodebrew/current/bin:$PATH' >> ~/.bash_profile
$ node -v
提取 app.asar
StarUML右键显示包内容
进入Contents/Resources/
把app.asar复制出来
解压app.asar
asar extract app.asar app
修改解压出来的app/src/engine/license-manager.js
checkLicenseValidity
函数,将
setStatus(this,false)
改成setStatus(this,true)
,并注释
UnregisteredDialog.showDialog()
重新打包放回目录
asar pack app app.asar
将app.asar放回Contents/Resources/