Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save K1ethoang/83267585235bbb6a55e5479ae969d7a3 to your computer and use it in GitHub Desktop.
Save K1ethoang/83267585235bbb6a55e5479ae969d7a3 to your computer and use it in GitHub Desktop.
Active StarUml version 6 for Window | MacOS | Linux

Active StarUML on Window/MacOS/Linux

Do not forget to give me⭐

Support version: v6.3.1

Update

  • [2025-01-30]:
    • Update app.asar to v6.3.1
    • Block auto update new version
  • [2024-12-11]: Supports Linux from comment
  • [2024-11-19]: Supports MacOS from comment
  • [2024-11-12]:
    • Block auto update (Beta)
    • Update app.asar file for V6.3.0

Have done! image

Support:

K1ethoang

@bilalop
Copy link

bilalop commented Jan 13, 2025

Hello, the latest version is available. Please correct your app.asar.

@LautaroCavichia
Copy link

It wasn't working for me on 6.3.1 on macOS so I modified the app.asar myself and now works. You can do it yourself by:

  1. Installing asar:
    npm install -g asar

  2. extract the app.asar file (/Applications/StarUML.app/Contents/Resources/app.asar):
    asar extract /path/to/app.asar /path/to/output-directory

  3. Modify the license-manager.js file (/path/to/output-directory/app/src/engine/license-manager.js ):

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

const SK = "DF9B72CC966FBE3A46F99858C5AEE";

// Check License When File Save
const LICENSE_CHECK_PROBABILITY = 0.3;

const PRO_DIAGRAM_TYPES = [
  "SysMLRequirementDiagram",
  "SysMLBlockDefinitionDiagram",
  "SysMLInternalBlockDiagram",
  "SysMLParametricDiagram",
  "BPMNDiagram",
  "WFWireframeDiagram",
  "AWSDiagram",
  "GCPDiagram",
];

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;
  }

  isProDiagram(diagramType) {
    return PRO_DIAGRAM_TYPES.includes(diagramType);
  }

  /**
   * 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) => {
      // Always resolve as valid
      licenseInfo = {
        name: "Always Verified User",
        product: packageJSON.config.product_id,
        licenseType: "Permanent",
        quantity: 1,
        timestamp: Date.now(),
        licenseKey: "ALWAYS_VALID",
      };
      resolve(licenseInfo);
    });
  }

  /**
   * Return evaluation period status
   * @private
   * @return {number} Remaining days
   */
  checkEvaluationPeriod() {
    const file = path.join(window.app.getUserPath(), "lib.so");
    if (!fs.existsSync(file)) {
      const timestamp = Date.now();
      fs.writeFileSync(file, timestamp.toString());
    }
    try {
      const timestamp = parseInt(fs.readFileSync(file, "utf8"));
      const now = Date.now();
      const remains =
        30 - Math.floor((now - timestamp) / (1000 * 60 * 60 * 24));
      return remains;
    } catch (err) {
      console.error(err);
    }
    return -1; // expired
  }

  async checkLicenseValidity() {
    // Always set the status to true
    setStatus(this, true);
  }

  /**
   * Check the license key in server and store it as license.key file in local
   *
   * @param {string} licenseKey
   */
  register(licenseKey) {
    return new Promise((resolve) => {
      // Mock successful registration
      licenseInfo = {
        name: "Always Verified User",
        product: packageJSON.config.product_id,
        licenseType: "Permanent",
        quantity: 1,
        timestamp: Date.now(),
        licenseKey: "ALWAYS_VALID",
      };
      setStatus(this, true);
      resolve(licenseInfo);
    });
  }

  htmlReady() {}

  appReady() {
    this.checkLicenseValidity();
  }
}

module.exports = LicenseManager;
  1. Repack:
    asar pack /path/to/app /path/to/output/app.asar

  2. Replace the old app.asar with the new app.asar we just packed.

  3. Enjoy!

@bilalop
Copy link

bilalop commented Jan 15, 2025

Cela ne fonctionnait pas pour moi sur 6.3.1 sur macOS, j’ai donc modifié moi-même le app.asar et fonctionne maintenant. Vous pouvez le faire vous-même en :

  1. Installation d’asar :
    npm install -g asar
  2. extrayez le fichier app.asar (/Applications/StarUML.app/Contents/Resources/app.asar) :
    asar extract /path/to/app.asar /path/to/output-directory
  3. Modifiez le fichier license-manager.js (/path/to/output-directory/app/src/engine/license-manager.js ) :
const { EventEmitter } = require("events");
const fs = require("fs");
const path = require("path");
const crypto = require("crypto");
const UnregisteredDialog = require("../dialogs/unregistered-dialog");
const packageJSON = require("../../package.json");

const SK = "DF9B72CC966FBE3A46F99858C5AEE";

// Check License When File Save
const LICENSE_CHECK_PROBABILITY = 0.3;

const PRO_DIAGRAM_TYPES = [
  "SysMLRequirementDiagram",
  "SysMLBlockDefinitionDiagram",
  "SysMLInternalBlockDiagram",
  "SysMLParametricDiagram",
  "BPMNDiagram",
  "WFWireframeDiagram",
  "AWSDiagram",
  "GCPDiagram",
];

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;
  }

  isProDiagram(diagramType) {
    return PRO_DIAGRAM_TYPES.includes(diagramType);
  }

  /**
   * 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) => {
      // Always resolve as valid
      licenseInfo = {
        name: "Always Verified User",
        product: packageJSON.config.product_id,
        licenseType: "Permanent",
        quantity: 1,
        timestamp: Date.now(),
        licenseKey: "ALWAYS_VALID",
      };
      resolve(licenseInfo);
    });
  }

  /**
   * Return evaluation period status
   * @private
   * @return {number} Remaining days
   */
  checkEvaluationPeriod() {
    const file = path.join(window.app.getUserPath(), "lib.so");
    if (!fs.existsSync(file)) {
      const timestamp = Date.now();
      fs.writeFileSync(file, timestamp.toString());
    }
    try {
      const timestamp = parseInt(fs.readFileSync(file, "utf8"));
      const now = Date.now();
      const remains =
        30 - Math.floor((now - timestamp) / (1000 * 60 * 60 * 24));
      return remains;
    } catch (err) {
      console.error(err);
    }
    return -1; // expired
  }

  async checkLicenseValidity() {
    // Always set the status to true
    setStatus(this, true);
  }

  /**
   * Check the license key in server and store it as license.key file in local
   *
   * @param {string} licenseKey
   */
  register(licenseKey) {
    return new Promise((resolve) => {
      // Mock successful registration
      licenseInfo = {
        name: "Always Verified User",
        product: packageJSON.config.product_id,
        licenseType: "Permanent",
        quantity: 1,
        timestamp: Date.now(),
        licenseKey: "ALWAYS_VALID",
      };
      setStatus(this, true);
      resolve(licenseInfo);
    });
  }

  htmlReady() {}

  appReady() {
    this.checkLicenseValidity();
  }
}

module.exports = LicenseManager;
  1. Repack:
    asar pack /path/to/app /path/to/output/app.asar
  2. Remplacez l’ancien app.asar par le nouveau app.asar que nous venons d’emballer.
  3. Jouir!

On Windows ?

@JosephMoustaid
Copy link

image
Works

@dainpfx00342
Copy link

Thank you so much!

@bilalop
Copy link

bilalop commented Jan 22, 2025

image

When fix for this version (app.asar) ?

@Aminesassy
Copy link

thank youuu soo mush love you man <3

@TheLime1
Copy link

it works but cant load the pro stuff , also im getting the warning like @bilalop

image

When fix for this version (app.asar) ?

@montasser99
Copy link

Thank you so much <3

@K1ethoang
Copy link
Author

image

When fix for this version (app.asar) ?

I have updated for v6.3.1, you can check it!

@rlan10
Copy link

rlan10 commented Feb 7, 2025

Thank you very much for your

@rathaur7524
Copy link

This really helps me. Thanks a lot!

@kevin9shah
Copy link

Thanks a lot !

@cristina-dos-santos
Copy link

thank you so much.

@jumailwisnu
Copy link

thank you it helpful

@nasserESI
Copy link

god bless you man ! still working the 19/02/2025 !

@afai79
Copy link

afai79 commented Feb 19, 2025

Thanks You

@MinhPhuoccc
Copy link

MinhPhuoccc commented Feb 25, 2025

Uploading {5AC25D55-931A-4301-B3D4-E053633C731C}.png…
Thank you so much! I'd like it!

@anth2392
Copy link

anth2392 commented Mar 1, 2025

Thank you sm, it worked.

@GionksTB
Copy link

GionksTB commented Mar 1, 2025

Installed on 03/01/2025 for Windows and worked perfectly! Thank you.

@Thihasoehlaing
Copy link

It works for license popup but when I open an existing file, it does not work at macOS.
Screenshot 2025-03-06 at 9 33 30 AM

@TrieuThien
Copy link

Thank you so much!!

@ericzager0
Copy link

Hello. I have a doubt. Why is the app.asar size 156MB while the app.asar of the StarUML only 90MB?

@K1ethoang
Copy link
Author

Hello. I have a doubt. Why is the app.asar size 156MB while the app.asar of the StarUML only 90MB?

Hi, You can use this lib https://www.npmjs.com/package/@electron/asar to check my file, I just exact app.asar, override and zip it

@ericzager0
Copy link

Left is your app.asar file. Right is StarUML's app.asar file.
image
Your version contains a 70mb .git folder.
What is it?

@K1ethoang
Copy link
Author

Left is your app.asar file. Right is StarUML's app.asar file. image Your version contains a 70mb .git folder. What is it?

I forgot to delete .git, i use github to tracking source for if StarUML upgrade new version I can know what is changed. Thank you, I will update new .asar file

@21blackjac
Copy link

Thanks brother it works perfectly

@danhtam1168
Copy link

Thanks

@DGIKAI
Copy link

DGIKAI commented Mar 30, 2025

image

Working 6.3.1

Thanks friend

@M-cyber1234
Copy link

it work well thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment