liqiang 的博客.

StarUML 自定义用户名和序列号

Word count: 535 / Reading time: 3 min
2018/08/14 Share

好吧,虽然标题看上去没啥邪恶的,但是其实这就是个破解 StarUML 的教程,因为看不爽时不时就给我弹出个确认框,虽然我本来是想找个序列号就行了,但是没想到居然有简单可行的处理方式,所以就随手记录一番。根据我的实验,2.5 和 3.0 版本的都可以用,不过不通用,这是两种不同的解决方式,3.0 的麻烦一些,2.5 的简单。

StarUML 2.5 破解

  1. 将下面的文件保存为 LicenseManagerDomain.js
  2. sudo cp /Applications/StarUML.app/Contents/www/license/node/LicenseManagerDomain.js LicenseManagerDomain.js.backup
  3. cp LicenseManagerDomain.js /Applications/StarUML.app/Contents/www/license/node/LicenseManagerDomain.js
  4. Open StarUML and go to Help > Enter License.
  5. Enter the name and the License Key in the LicenseManagerDomain.js.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/**
* File name: LicenseManagerDomain.js
* Mac OS: /Applications/StarUML.app/Contents/www/license/node/
* Linux: /opt/staruml/www/license/node/
*/

(function () {
"use strict";

var NodeRSA = require('node-rsa');

function validate(PK, name, product, licenseKey) {
return{
name: "liqiang",
product: "StarUML",
licenseType: "vip",
quantity: "unlimited",
licenseKey: "https://liqiang.io"
};
}

function init(domainManager) {
if (!domainManager.hasDomain("LicenseManager")) {
domainManager.registerDomain("LicenseManager", {major: 0, minor: 1});
}
domainManager.registerCommand(
"LicenseManager", // domain name
"validate", // command name
validate, // command handler function
false, // this command is synchronous in Node ("false" means synchronous")
"Validate License",
[
{
name: "PK",
type: "string",
description: "PK"
},
{
name: "name",
type: "string",
description: "name of license owner"
},
{
name: "product",
type: "string",
description: "product name"
},
{
name: "licenseKey",
type: "string",
description: "license key"
}
],
[
{
name: "result", // return values
type: "object",
description: "result"
}
]
);
}

exports.init = init;

}());

StarUML 3.0.1 破解

升级到 3.0.1 之后,验证文件不再放在本地的目录中了,而是放在了打包文件里面了,所以需要先解压出应用,然后替换文件之后,再打包回去。

  1. 安装asar

    1
    # npm install -g asar
  2. 解压app.asar

  3. 修改验证文件

    1
    2
    3
    4
    5
    6
    7
    8
        # vim app/src/engine/license-manager.js
    ```

    将第 124 行修改成以下形式:

    ![](http://oo6jmf58s.bkt.clouddn.com/2018-08-14-15342562173361.jpg)

    4. 打包 app

    asar pack app app.asar

    `

  4. 重启 StarUML 即可。

Reference

  1. StarUML
  2. StarUML 3.0 破解方法
CATALOG
  1. 1. StarUML 2.5 破解
  2. 2. StarUML 3.0.1 破解
  • asar pack app app.asar
    1. Reference