当前位置:网站首页>Explore the authentication mechanism of StarUML

Explore the authentication mechanism of StarUML

2022-07-05 08:31:00 Learn open source together

Choose the right one recently , Lightweight UML Tools and nerves ; Tried many tools , The lightest and simplest is StarUML 了 . Here we mainly introduce its StarUML Scientific installation of tools ( Suitable for development ); This is only for technical exchange experience , It is not recommended that you use it for commercial purposes , If there are conditions, it still supports genuine .


explain

I installed StarUML3.2.2 edition ; Here we mainly introduce how to modify its source code to achieve the purpose of scientific installation ;

Tool technology stack analysis

StarUML Adopted technical framework , In terms of performance , It should be based on H5 Of Electron Framework developed ; Therefore, it means that JavaScript or ES6 There should be no problem ( Of course not, it doesn't matter , Follow the scientific installation steps of this article 䠫 Operation is also possible )

Ideas :

  • The first is to disable its software License check , Theoretically, it is found in the source code License Corresponding code rules
  • Disable the notification of system automatic upgrade monitoring and reminder

preparation

1. install StarUML Software

Go directly to the official website to download and install StarUML Tools , It's better to be consistent with my version ( Except that you want to try a new version ); I won't repeat it here …

2. Install local packaging tools

Before execution , Some preparatory work is needed , Because it uses front-end technology , and Electron So we need to install it on the machine Node Environmental Science ,Electron Packaging tools for .

//  install npm
brew install node
// Install packaging tools 
npm install asar -g

Perform step 䠫

1. Find the resource package that needs to be installed / route

Find the corresponding installer in the application , The author is based on Mac For example ,Windows Also almost (window The default path :C:\Program Files\StarUML\resources),Mac as follows
image.png
Select the icon –> Right click –> Select... From the menu Show package content ;
image.png
Then enter Contents–>Resource Catalog , Find the file
image.png
Copy app.asar file , To any working directory , It will be unzipped and modified

2. Decompress the resource package

I copied the file to a temporary directory , Then enter the directory and execute the following command , Decompress resources

//  adopt asar The order will app.asar Unzip the file into the current directory app Catalog 
asar extract app.asar app

After the execution is completed, it is as follows
image.png
Unzip the directory
image.png

3. Modify the corresponding restriction code

** The key is coming. :** Open it with a development tool or a tool for editing text , Here I use Visual Studio Tools, for example : The results are as follows , Mainly modify the two marked files in the figure :

image.png
1) modify 1License Check :src/engine/license-manager.js

  checkLicenseValidity () {
    this.validate().then(() => {
      setStatus(this, true)
    }, () => {
      // setStatus(this, false)
      // UnregisteredDialog.showDialog()
      //  avoid : Comment out check License Mechanism and pop-up box 
      setStatus(this, true)
      //UnregisteredDialog.showDialog()
    })
  }

2) modify 2 Auto update :src/application.js

    this.on('application:check-for-updates', (arg) => {
    //  autoUpdater.checkForUpdatesAndNotify()
    })
    this.on('application:install-and-restart', (arg) => {
    //  autoUpdater.quitAndInstall(false, true)
    })

image.png

4. Pack and cover

go back to APP Catalog , Perform packaging
asar pack app app.asar
Will create a new app.asar Copy the file and put it in the installation directory , Replace the original file , Then restart StarUML Tools

5. verification

After restart , Get into Help menu , Try entering the activation key

image.png
The following prompt will pop up

image.png

As mentioned above, it has been successful
explain : In fact, even in Help menu , Execution deletion License operation , Finally, it will be activated , It will be the effect just above )


Last , If you think the above operation is too troublesome , You can also download the resource package directly , It has been modified and packaged , Directly overwrite the app.asar File can
Download link

原网站

版权声明
本文为[Learn open source together]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202140543400026.html