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

@TranNhan2004
Copy link

It works in v6.3.2 (Linux Mint 22.1). Thanks bro very much!!!

@kayes351
Copy link

thanks dude...it works

@MalikHoubbi
Copy link

It works thanks you !!!

@EPALENWENYOH
Copy link

thanks a lot. peace

@shaimaHamila
Copy link

It work well thanks

@angelli1210
Copy link

It works! thanks

@KeitlynLilimp
Copy link

don't work on 6.3.3

@KeitlynLilimp
Copy link

Alguien tiene el archivo 6.3.2 para linux?

@zapsys
Copy link

zapsys commented Jun 25, 2025

I updated StarUML to version 6.3.3 on Arch Linux and using this app.asar (version 6.3.1) it works! Thanks!

@HoaiTuyen
Copy link

wow, thanks

@mrwilllordwill
Copy link

thank u

@leobossa10
Copy link

leobossa10 commented Aug 10, 2025

Hi! Working on 7.0.0 version. Thank you!

@crepin7
Copy link

crepin7 commented Aug 19, 2025

thanks bro! Working in 7.0.0 version.

@jaime-dz
Copy link

Working on Linux mint 7.0.0 version

@kemuriz
Copy link

kemuriz commented Sep 4, 2025

Goat

@MOHAMED-AMINE11
Copy link

2025, still working

@alexandevcwa
Copy link

@kamanelbuho
Copy link

kamanelbuho 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

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;

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