当前位置: 首页 > news >正文

StartUML4.0.1的使用方法

关于StartUML

StarUML是一款开放源码的UML开发工具,是由韩国公司主导开发出来的产品,可以直接到StarUML网站下载。StarUML是一个开源项目之一发展快、灵活、可扩展性强。

便捷下载连接(v4.0.1版软件):传送门

安装过程

安装完毕后打开小工具asar文件管理工具.exe(杀毒软件可能报危险,选择信任就行),将安装路径(默认路径为C:\Program Files\StarUML\resources)下的app.asar,拖入软件“asar文件解包”标签下的指定位置如下图:

然后依次打开左侧目录树的src/engine/license-manager.js,右侧编辑框中会显示文件内容如下图:

接着将下面的代码,完整复制下来,替换掉右侧(即打开的license-manager.js文件)的所有内容,最后点击保存并替换,代码和复制流程如下:

/*
* Copyright (c) 2013-2014 Minkyu Lee. All rights reserved.
*
* NOTICE:  All information contained herein is, and remains the
* property of Minkyu Lee. The intellectual and technical concepts
* contained herein are proprietary to Minkyu Lee and may be covered
* by Republic of Korea and Foreign Patents, patents in process,
* and are protected by trade secret or copyright law.
* Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained
* from Minkyu Lee (niklaus.lee@gmail.com).
*
*/

const {EventEmitter} = require('events')
const fs = require('fs')
const path = require('path')
const crypto = require('crypto')
const UnregisteredDialog = require('../dialogs/unregistered-dialog')
const SK = 'DF9B72CC966FBE3A46F99858C5AEE'
const packageJSON = require('../../package.json')

// Check License When File Save
const LICENSE_CHECK_PROBABILITY = 0.3

var status = false
var licenseInfo = null

/**
 * Set Registration Status
 * This function is out of LicenseManager class for the security reason
 * (To disable changing License status by API)
 * @private
 * @param {boolean} newStat
 * @return {string}
 */
function setStatus (licenseManager, newStat) {
  if (status !== newStat) {
    status = newStat
    licenseManager.emit('statusChanged', status)
  }
}

/**
 * @private
 */
class LicenseManager extends EventEmitter {

  constructor () {
    super()
    this.projectManager = null
  }

  /**
   * Get Registration Status
   * @return {string}
   */
  getStatus () {
    return status
  }

  /**
  * Get License Infomation
  * @return {Object}
  */
  getLicenseInfo () {
    return licenseInfo
  }

  findLicense () {
    var licensePath = path.join(app.getUserPath(), '/license.key')
    if (!fs.existsSync(licensePath)) {
      licensePath = path.join(app.getAppPath(), '../license.key')
    }
    if (fs.existsSync(licensePath)) {
      return licensePath
    } else {
      return null
    }
  }

  /**
   * Check license validity
   *
   * @return {Promise}
   */
  validate () {
    return new Promise((resolve, reject) => {
      try {
        // Local check
        var file = this.findLicense()
        if (!file) {
          reject('License key not found')
        } else {
          var data = fs.readFileSync(file, 'utf8')
          licenseInfo = JSON.parse(data)
          /*if (licenseInfo.product !== packageJSON.config.product_id) {
            app.toast.error(`License key is for old version (${licenseInfo.product})`)
            reject(`License key is not for ${packageJSON.config.product_id}`)
          } else {*/
            var base = SK + licenseInfo.name +
            SK + licenseInfo.product + '-' + licenseInfo.licenseType +
            SK + licenseInfo.quantity +
            SK + licenseInfo.timestamp + SK
            var _key = crypto.createHash('sha1').update(base).digest('hex').toUpperCase()
            if (_key !== licenseInfo.licenseKey) {
              reject('Invalid license key')
            } else {
              // Server check
              $.post(app.config.validation_url, {licenseKey: licenseInfo.licenseKey})
                .done(data => {
                  resolve(data)
                })
                .fail(err => {
                  if (err && err.status === 499) { /* License key not exists */
                    reject(err)
                  } else {
                    // If server is not available, assume that license key is valid
                    resolve(licenseInfo)
                  }
                })
            }
          //}
        }
      } catch (err) {
        reject(err)
      }
    })
  }

  checkLicenseValidity () {
    this.validate().then(() => {
      setStatus(this, true)
    }, () => {
      setStatus(this, true)
      //UnregisteredDialog.showDialog()
    })
  }

  /**
   * 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, false)
          if (err.status === 499) { /* License key not exists */
            reject('invalid')
          } else {
            reject()
          }
        })
    })
  }

  htmlReady () {
    this.projectManager.on('projectSaved', (filename, project) => {
      var val = Math.floor(Math.random() * (1.0 / LICENSE_CHECK_PROBABILITY))
      if (val === 0) {
        this.checkLicenseValidity()
      }
    })
  }

  appReady () {
    this.checkLicenseValidity()
  }

}

module.exports = LicenseManager

完成上述操作步骤后就可以正常使用了

相关文章:

  • 结构型模式--Proxy代理模式
  • C++的Lambda表达式的用法
  • 微信小程序学习之rich-text的嵌入静态HTML
  • 微信小程序CSS Flexbox(弹性盒子)布局模块
  • 语义化版本 2.0.0 -- 如何使用软件版本号
  • 微信小程序css之盒子(box)模型
  • 微信小程序中text标签换行问题
  • 微信小程序无法找到组件的问题 [“usingComponents“][“component1“]:“xxx“未找到
  • git本地仓库新建分支并推送到远端仓库
  • 微信小程序将组件中的文字放置在正中间的方法
  • linux脚本开头的#!/bin/bash有什么作用
  • git如何撤销未提交的更改
  • Qt动态更改界面语言(在运行状态下改变界面语言)
  • .gitignore文件---让git自动忽略指定文件
  • 解决QMYSQL driver not loaded问题
  • 自己简单写的 事件订阅机制
  • [译] 理解数组在 PHP 内部的实现(给PHP开发者的PHP源码-第四部分)
  • ES学习笔记(10)--ES6中的函数和数组补漏
  • input实现文字超出省略号功能
  • JS学习笔记——闭包
  • leetcode讲解--894. All Possible Full Binary Trees
  • Redux系列x:源码分析
  • WebSocket使用
  • 当SetTimeout遇到了字符串
  • 道格拉斯-普克 抽稀算法 附javascript实现
  • 关于extract.autodesk.io的一些说明
  • 关于springcloud Gateway中的限流
  • 基于Dubbo+ZooKeeper的分布式服务的实现
  • 理解在java “”i=i++;”所发生的事情
  • 如何用vue打造一个移动端音乐播放器
  • 腾讯大梁:DevOps最后一棒,有效构建海量运营的持续反馈能力
  • 吴恩达Deep Learning课程练习题参考答案——R语言版
  • 一个SAP顾问在美国的这些年
  • k8s使用glusterfs实现动态持久化存储
  • 宾利慕尚创始人典藏版国内首秀,2025年前实现全系车型电动化 | 2019上海车展 ...
  • 组复制官方翻译九、Group Replication Technical Details
  • ​软考-高级-系统架构设计师教程(清华第2版)【第15章 面向服务架构设计理论与实践(P527~554)-思维导图】​
  • #if和#ifdef区别
  • #我与Java虚拟机的故事#连载03:面试过的百度,滴滴,快手都问了这些问题
  • #我与Java虚拟机的故事#连载14:挑战高薪面试必看
  • (2021|NIPS,扩散,无条件分数估计,条件分数估计)无分类器引导扩散
  • (4)Elastix图像配准:3D图像
  • (Matalb回归预测)PSO-BP粒子群算法优化BP神经网络的多维回归预测
  • (Redis使用系列) Springboot 使用redis的List数据结构实现简单的排队功能场景 九
  • (十一)手动添加用户和文件的特殊权限
  • (原創) 是否该学PetShop将Model和BLL分开? (.NET) (N-Tier) (PetShop) (OO)
  • (转)ABI是什么
  • *p=a是把a的值赋给p,p=a是把a的地址赋给p。
  • .NET CF命令行调试器MDbg入门(三) 进程控制
  • .net core 依赖注入的基本用发
  • .NET Core日志内容详解,详解不同日志级别的区别和有关日志记录的实用工具和第三方库详解与示例
  • .NET Framework Client Profile - a Subset of the .NET Framework Redistribution
  • .NET:自动将请求参数绑定到ASPX、ASHX和MVC(菜鸟必看)
  • .NETCORE 开发登录接口MFA谷歌多因子身份验证
  • .NET程序员迈向卓越的必由之路