- Step 1: Download and install StarUML Version 6 from main website https://staruml.io
- Step 2: Download
app.asar
file from https://drive.google.com/file/d/1_sKvHVL6SebnYF73iZxSWD9l48Pddzvj/view?usp=sharing - Step 3: Copy
app.asar
file download in step 2 (Overrideapp.asar
file)- Window:
C:\Program Files\StarUML\resources
- MacOS:
/Applications/StarUML.app/Contents/Resources/
- Linux:
/opt/StartUML/resources
- Window:
- Step 4: Open StarUML app to use
Do not forget to give me⭐
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,
};
}
// 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');
}
// Método para registrar el dominio (si necesitas compatibilidad con domain manager)
initDomainManager(domainManager) {
if (!domainManager) return;
}
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
}
}
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" };
}
}
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" };
}
}
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;
}
}
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;
}
}
async htmlReady() {
try {
const result = await this.validate();
}
// Método adicional para equivaler exactamente al código viejo
async checkLicenseValidity() {
try {
const result = await this.validate();
}
// Método para cambiar entre validación local e IPC
setLocalValidation(enabled) {
const wasEnabled = this.localValidation;
this.localValidation = enabled;
}
// 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;