Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save K1ethoang/83267585235bbb6a55e5479ae969d7a3 to your computer and use it in GitHub Desktop.

Select an option

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

@alexandevcwa
Copy link
Copy Markdown

@kamanrique
Copy link
Copy Markdown

kamanrique commented Sep 11, 2025

Funciona en la versión 7, ahora el archivo que se modifica está alojado en: app.asar\src\engine\license-store.js
Working on 7th version on linux and win, u must modify the archive on app.asar\src\engine\license-store.js

const { ipcRenderer } = require("electron");
const { EventEmitter } = require("events");
const LicenseActivationDialog = require("../dialogs/license-activation-dialog");

class LicenseStore extends EventEmitter {
constructor() {
super();
this.licenseStatus = {
activated: false,
name: null,
product: null,
edition: null,
productDisplayName: null,
deviceId: null,
licenseKey: null,
activationCode: null,
trial: false,
trialDaysLeft: 0,
};

// Configuración de validación local
this.localValidation = true; // Flag para activar validación local por defecto

// Inicializar con validación local si está habilitada
if (this.localValidation) {
  this.initializeLocalLicense();
}

}

// Inicializar con datos de licencia local
initializeLocalLicense() {
const localResult = this.validateLocal();
this.licenseStatus = {
...this.licenseStatus,
activated: true,
name: localResult.name,
product: localResult.product,
edition: "Professional",
productDisplayName: localResult.product,
deviceId: "local-device-id",
licenseKey: localResult.licenseKey,
trial: false,
trialDaysLeft: 0,
};
}

// Método de validación local (adaptado del código original que querías integrar)
validateLocal(PK = null, name = null, product = null, licenseKey = null) {
// Simulación de la validación con NodeRSA (puedes descomentar si tienes node-rsa instalado)
// const NodeRSA = require('node-rsa');

return {
  success: true,
  name: "FullActivated",
  product: "StarUML",
  licenseType: "vip",
  quantity: "unlimited",
  licenseKey: licenseKey || "no, thanks!",
  activated: true,
  trial: false,
  trialDaysLeft: 0
};

}

// Método para registrar el dominio (si necesitas compatibilidad con domain manager)
initDomainManager(domainManager) {
if (!domainManager) return;

if (!domainManager.hasDomain("LicenseManager")) {
  domainManager.registerDomain("LicenseManager", {major: 0, minor: 1});
}

domainManager.registerCommand(
  "LicenseManager", // domain name
  "validate",       // command name
  this.validateLocal.bind(this), // command handler function
  false,            // this command is synchronous in Node
  "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",
      type: "object", 
      description: "result"
    }
  ]
);

}

async fetch() {
if (this.localValidation) {
// Usar validación local en lugar de IPC
const localResult = this.validateLocal();
this.licenseStatus = {
...this.licenseStatus,
activated: true,
name: localResult.name,
product: localResult.product,
licenseKey: localResult.licenseKey,
trial: false,
trialDaysLeft: 0
};
} else {
// Lógica original con IPC
const licenseStatus = await ipcRenderer.invoke(
"license.get-license-status",
);
this.licenseStatus = licenseStatus;
}
this.emit("statusChanged", this.licenseStatus);
}

async getDeviceId() {
if (this.localValidation) {
return "local-device-id-" + Date.now(); // ID único para validación local
}

try {
  const deviceId = await ipcRenderer.invoke("license.get-device-id");
  return deviceId;
} catch (err) {
  console.error(err);
  return null;
}

}

async activate(licenseKey) {
if (this.localValidation) {
// Activación local siempre exitosa
const result = this.validateLocal(null, null, null, licenseKey);
this.licenseStatus = {
...this.licenseStatus,
activated: true,
licenseKey: licenseKey,
name: result.name,
product: result.product,
trial: false,
trialDaysLeft: 0
};
this.emit("statusChanged", this.licenseStatus);
console.log("License activated locally with key:", licenseKey);
return { success: true, message: "License activated successfully" };
}

// Lógica original con IPC
try {
  const result = await ipcRenderer.invoke("license.activate", licenseKey);
  if (!result.success) {
    this.emit("error", result.message || "Activation failed");
  }
} catch (err) {
  console.error(err);
  this.emit("error", "Activation failed");
}
await this.fetch();

}

async deactivate() {
if (this.localValidation) {
// Para validación local, mantener siempre activado
console.log("Deactivation ignored in local validation mode");
this.licenseStatus.activated = true;
this.emit("statusChanged", this.licenseStatus);
return { success: true, message: "License remains active in local mode" };
}

// Lógica original con IPC
try {
  const result = await ipcRenderer.invoke("license.deactivate");
  if (!result.success) {
    this.emit("error", result.message || "Deactivation failed");
  }
} catch (err) {
  console.error(err);
  this.emit("error", "Deactivation failed");
}
await this.fetch();

}

async validate() {
if (this.localValidation) {
// Usar validación local
const result = this.validateLocal();
// Actualizar status con los datos de validación local
this.licenseStatus = {
...this.licenseStatus,
activated: result.activated,
name: result.name,
product: result.product,
licenseKey: result.licenseKey,
trial: result.trial,
trialDaysLeft: result.trialDaysLeft
};
this.emit("statusChanged", this.licenseStatus);
return result;
}

// Lógica original con IPC
const result = await ipcRenderer.invoke("license.validate");
const licenseStatus = await ipcRenderer.invoke(
  "license.get-license-status",
);
this.licenseStatus = licenseStatus;
this.emit("statusChanged", this.licenseStatus);
return result;

}

getLicenseStatus() {
return this.licenseStatus;
}

async checkTrialMode() {
if (this.localValidation) {
// En modo local, nunca mostrar diálogo de activación ya que siempre está activado
console.log("Trial mode check skipped - local validation active");
return;
}

// Lógica original
const licenseStatus = await ipcRenderer.invoke(
  "license.get-license-status",
);
if (licenseStatus.trial) {
  LicenseActivationDialog.showDialog();
}

}

async htmlReady() {
try {
const result = await this.validate();

  if (this.localValidation) {
    // En modo local, siempre activado con datos del validador local
    this.licenseStatus.activated = true;
    this.licenseStatus.name = result.name;
    this.licenseStatus.product = result.product;
    this.licenseStatus.licenseKey = result.licenseKey;
    this.licenseStatus.trial = false;
    this.licenseStatus.trialDaysLeft = 0;
    console.log("License initialized with local validation");
  } else {
    // Lógica original que siempre pone true
    this.licenseStatus.activated = true;
  }
  
  this.emit("statusChanged", this.licenseStatus);
  await this.checkTrialMode();
} catch (err) {
  console.error(err);
  console.log("License validation failed");
  
  // Mantener la lógica original que fuerza true incluso en error
  this.licenseStatus.activated = true;
  
  if (this.localValidation) {
    // En caso de error en modo local, usar valores por defecto
    const defaultResult = this.validateLocal();
    this.licenseStatus.name = defaultResult.name;
    this.licenseStatus.product = defaultResult.product;
    this.licenseStatus.licenseKey = defaultResult.licenseKey;
    console.log("Using default local license due to validation error");
  }
  
  this.emit("statusChanged", this.licenseStatus);
}

}

// Método adicional para equivaler exactamente al código viejo
async checkLicenseValidity() {
try {
const result = await this.validate();

  // Equivalente a setStatus(this, true) - siempre true como en código original
  this.licenseStatus.activated = true;
  
  if (this.localValidation && result) {
    this.licenseStatus.name = result.name;
    this.licenseStatus.product = result.product;
    this.licenseStatus.licenseKey = result.licenseKey;
    this.licenseStatus.trial = result.trial;
    this.licenseStatus.trialDaysLeft = result.trialDaysLeft;
  }
  
  this.emit("statusChanged", this.licenseStatus);
} catch (err) {
  console.error("License validation error:", err);
  
  // Equivalente al catch que fuerza setStatus(this, true)
  this.licenseStatus.activated = true;
  
  if (this.localValidation) {
    // En modo local, usar valores por defecto incluso en error
    const defaultResult = this.validateLocal();
    this.licenseStatus.name = defaultResult.name;
    this.licenseStatus.product = defaultResult.product;
    this.licenseStatus.licenseKey = defaultResult.licenseKey;
  }
  
  this.emit("statusChanged", this.licenseStatus);
}

}

// Método para cambiar entre validación local e IPC
setLocalValidation(enabled) {
const wasEnabled = this.localValidation;
this.localValidation = enabled;

if (enabled && !wasEnabled) {
  // Cambió de IPC a local - inicializar con datos locales
  this.initializeLocalLicense();
  this.emit("statusChanged", this.licenseStatus);
  console.log("Switched to local validation mode");
} else if (!enabled && wasEnabled) {
  // Cambió de local a IPC - limpiar datos y usar IPC
  console.log("Switched to IPC validation mode");
  this.fetch(); // Recargar desde IPC
}

}

// Método para obtener información sobre el modo actual
getValidationMode() {
return {
localValidation: this.localValidation,
mode: this.localValidation ? "local" : "ipc"
};
}

// Método para forzar recarga del estado de licencia
async refresh() {
await this.fetch();
}

// Método de utilidad para debug
debugInfo() {
console.log("LicenseStore Debug Info:");
console.log("- Validation Mode:", this.localValidation ? "Local" : "IPC");
console.log("- License Status:", this.licenseStatus);
console.log("- Activated:", this.licenseStatus.activated);
console.log("- Product:", this.licenseStatus.product);
console.log("- Name:", this.licenseStatus.name);
}
}

module.exports = LicenseStore;

@QuaRaion
Copy link
Copy Markdown

thanks🔥

@k-sketch
Copy link
Copy Markdown

k-sketch commented Oct 1, 2025

It works correctly on MX Linux 23.6, thank you so much!

@ciberocio
Copy link
Copy Markdown

version 7.0 working correctly on windows 11!

@Ismail-EL-haidaoui
Copy link
Copy Markdown

Bro

@yoesefab
Copy link
Copy Markdown

yoesefab commented Oct 7, 2025

thanks bro !

@AbdjalilToumi
Copy link
Copy Markdown

AbdjalilToumi commented Oct 8, 2025

You are my Hero !!!

@Gustavo-Harnisch
Copy link
Copy Markdown

Works in linux mint 22 thanks

@johnny-official
Copy link
Copy Markdown

It's work on the latest version, thank you so much for sharing.

@zakaria-279
Copy link
Copy Markdown

merci

@schtzie
Copy link
Copy Markdown

schtzie commented Nov 13, 2025

mantap~

@sailinhtut
Copy link
Copy Markdown

Great ! It Works even for version 7 as well. Thank a lot.

@DatP2K3
Copy link
Copy Markdown

DatP2K3 commented Nov 26, 2025

it's worrking on mac os arm with version 7. Thanks bro!!!

@basilepagabelem31
Copy link
Copy Markdown

Merci ça fonctionne bien

@shernandez-33
Copy link
Copy Markdown

Excelente, sencillo y efectivo!!! Gracias

@AmbiNtsoah
Copy link
Copy Markdown

Thank you! It worked perfectly!

@aboubacarali
Copy link
Copy Markdown

Thank you very much broh

@StejsiD
Copy link
Copy Markdown

StejsiD commented Jan 26, 2026

Огроменное спасибо! Все работает!

@Ramana-Giri
Copy link
Copy Markdown

It worked brother 🙏. I used this link to download the older v6.3
https://en.softonic.com/download/staruml/windows/post-download/v/6.3.0

@Soyuzbek
Copy link
Copy Markdown

Soyuzbek commented Feb 10, 2026

works for MacOS, Great!

@brenopedro
Copy link
Copy Markdown

you are a god

@hitoribocchii
Copy link
Copy Markdown

thankssss it worked on 7.0.0 ver too

@Dossantosjoel7
Copy link
Copy Markdown

Thanks

@Stup702
Copy link
Copy Markdown

Stup702 commented Apr 12, 2026

Working on version 7.1 on ubuntu. Had to directly use sudo cp.
Thanks!

@14atp
Copy link
Copy Markdown

14atp commented Apr 15, 2026

i love you, bro! TY!

@m-belefqih
Copy link
Copy Markdown

Still working on Linux (version 7.1.0)

@yoesefab
Copy link
Copy Markdown

Thanks again ! still working on linux

@lipajack67-lgtm
Copy link
Copy Markdown

Gracias

@hoangZenKo
Copy link
Copy Markdown

For the latest version of startUML, it can be used.

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