http://php-note.com/article/749.html
http://www.macupdate.com/app/mac/55571/staruml/download
Revisar:https://blog.csdn.net/qq_33833327/article/details/78027431
npm install asar -g
cd /Applications/StarUML.app/Contents/Resources asar extract app.asar app
nano app/src/engine/license-manager.js
``
checkLicenseValidity () {
this.validate().then(() => {
setStatus(this, true)
}, () => {
// setStatus(this, false)
// UnregisteredDialog.showDialog()
setStatus(this, true)
})
}
``
asar pack app app.asar
Listo!!!
Con este archivo license-store.js modificado de esta manera, funciona perfecto version 7.0
const { ipcRenderer } = require("electron");
const { EventEmitter } = require("events");
const LicenseActivationDialog = require("../dialogs/license-activation-dialog");
class LicenseStore extends EventEmitter {
constructor() {
super();
this.licenseStatus = {
activated: true,
name: null,
product: null,
edition: null,
productDisplayName: null,
deviceId: null,
licenseKey: null,
activationCode: null,
trial: false,
trialDaysLeft: 0,
};
}
async fetch() {
const licenseStatus = await ipcRenderer.invoke(
"license.get-license-status",
);
//this.licenseStatus = licenseStatus;
this.licenseStatus = {
activated: true,
name: null,
product: null,
edition: null,
productDisplayName: null,
deviceId: null,
licenseKey: null,
activationCode: null,
trial: false,
trialDaysLeft: 0,
};
this.emit("statusChanged", this.licenseStatus);
}
async getDeviceId() {
try {
const deviceId = await ipcRenderer.invoke("license.get-device-id");
return deviceId;
} catch (err) {
console.error(err);
return null;
}
}
async activate(licenseKey) {
try {
const result = await ipcRenderer.invoke("license.activate", licenseKey);
if (!result.success) {
app.toast.error(result.message || "Activation failed");
}
} catch (err) {
console.error(err);
app.toast.error("Activation failed");
}
await this.fetch();
}
async deactivate() {
try {
const result = await ipcRenderer.invoke("license.deactivate");
if (!result.success) {
app.toast.error(result.message || "Deactivation failed");
}
} catch (err) {
console.error(err);
app.toast.error("Deactivation failed");
}
await this.fetch();
}
async validate() {
const result = await ipcRenderer.invoke("license.validate");
const licenseStatus = await ipcRenderer.invoke(
"license.get-license-status",
);
//this.licenseStatus = licenseStatus;
this.licenseStatus = {
activated: true,
name: null,
product: null,
edition: null,
productDisplayName: null,
deviceId: null,
licenseKey: null,
activationCode: null,
trial: false,
trialDaysLeft: 0,
};
return result;
}
getLicenseStatus() {
return this.licenseStatus;
}
async checkTrialMode() {
const licenseStatus = await ipcRenderer.invoke(
"license.get-license-status",
);
licenseStatus.trial = false;
if (licenseStatus.trial) {
LicenseActivationDialog.showDialog();
}
}
async htmlReady() {
try {
await this.fetch();
const result = await this.validate();
if (!result.success) {
app.toast.error(result.message || "License validation failed");
}
await this.checkTrialMode();
await this.fetch();
} catch (err) {
console.error(err);
console.log("License validation failed");
}
}
}
module.exports = LicenseStore;