easinote-bin

maintainer csf0304 · 0 votes · scanned 2026-08-03 00:08:14.047287
MEDIUM
piracy
View on AUR ↗
Why flagged The package downloads a prebuilt .deb from a non-standard host (seewo.com subdomain) which is not on the standard whitelist; while likely legitimate for a commercial product, the unverifiable binary payload and lack of upstream source access creates a supply-chain risk if the domain were compromised.

Triggered rules

MEDIUM source=() URL on a non-standard host source_untrusted_domain

One or more source=() URLs point to a host outside the trusted allowlist (github.com, gitlab.com, codeberg.org, pypi.org, …).

  • PKGBUILD:10 source=("https://imlizhi-store-https.seewo.com/EasiNote_UOS_amd64_5.2.2.4.13984(20260429093518).deb")
MEDIUM AI review llm_review

An AI model (qwen/qwen3-235b-a22b-07-25) reviewed this and agrees it is MEDIUM (confidence 90%): The package downloads a prebuilt .deb from a non-standard host (seewo.com subdomain) which is not on the standard whitelist; while likely legitimate for a commercial product, the unverifiable binary payload and lack of upstream source access creates a supply-chain risk if the domain were compromised.

PKGBUILD

1 offending line(s) highlighted
1pkgname=easinote-bin
2pkgver=5.2.2.4.13984
3pkgrel=1
4pkgdesc="Seewo EasiNote5 希沃白板 5"
5arch=('x86_64')
6license=('custom')
7depends=('gtk3' 'libnotify' 'nss' 'libxss' 'libxtst' 'xdg-utils' 'at-spi2-core' 'util-linux' 'libappindicator-gtk3' 'libsecret' 'electron')
8makedepends=('asar' 'nodejs' 'npm')
9options=('!strip' '!debug' '!emptydirs')
10source=("https://imlizhi-store-https.seewo.com/EasiNote_UOS_amd64_5.2.2.4.13984(20260429093518).deb")
11sha256sums=('c0dea82dfaf3edf4fd91ceaa1c3ad76a463bd5d67817d5a41ca2f30054b00598')
12
13package() {
14 tar xf "$srcdir/data.tar.xz" -C "$pkgdir"
15 APP_ROOT="$pkgdir/opt/apps/com.seewo.easinote5/files"
16 if [ -d "$pkgdir/opt/apps/com.seewo.easinote5/entries/applications" ]; then
17 mkdir -p "$pkgdir/usr/share/applications"
18 cp "$pkgdir/opt/apps/com.seewo.easinote5/entries/applications/com.seewo.easinote5.desktop" "$pkgdir/usr/share/applications/"
19 fi
20 cat >"$APP_ROOT/com.seewo.easinote5.sh" <<EOF
21#!/bin/bash
22# old method
23# exec "/opt/apps/com.seewo.easinote5/files/EasiNote5" "\$@"
24# new method
25exec /usr/bin/electron /opt/apps/com.seewo.easinote5/files/resources/app.asar
26EOF
27 chmod +x "$APP_ROOT/com.seewo.easinote5.sh"
28 asar e "$APP_ROOT/resources/app.asar" "$srcdir/app_unpacked"
29 if [ -f "$srcdir/app_unpacked/dist/utils/getBiosVendor.js" ]; then
30 sed -i 's/dmidecode.*/resolve('\''seewo'\'');/g' "$srcdir/app_unpacked/dist/utils/getBiosVendor.js"
31 fi
32 ACTIVATION_FILE="$srcdir/app_unpacked/dist/services/activationService/activationService.js"
33 if [ -f "$ACTIVATION_FILE" ]; then
34 cat >"$ACTIVATION_FILE" <<'ENDOFACTIVATIONJS'
35 "use strict";
36var __assign = (this && this.__assign) || function () {
37 __assign = Object.assign || function(t) {
38 for (var s, i = 1, n = arguments.length; i < n; i++) {
39 s = arguments[i];
40 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
41 t[p] = s[p];
42 }
43 return t;
44 };
45 return __assign.apply(this, arguments);
46};
47var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
48 function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
49 return new (P || (P = Promise))(function (resolve, reject) {
50 function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
51 function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
52 function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
53 step((generator = generator.apply(thisArg, _arguments || [])).next());
54 });
55};
56var __generator = (this && this.__generator) || function (thisArg, body) {
57 var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
58 return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
59 function verb(n) { return function (v) { return step([n, v]); }; }
60 function step(op) {
61 if (f) throw new TypeError("Generator is already executing.");
62 while (g && (g = 0, op[0] && (_ = 0)), _) try {
63 if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
64 if (y = 0, t) op = [op[0] & 2, t.value];
65 switch (op[0]) {
66 case 0: case 1: t = op; break;
67 case 4: _.label++; return { value: op[1], done: false };
68 case 5: _.label++; y = op[1]; op = [0]; continue;
69 case 7: op = _.ops.pop(); _.trys.pop(); continue;
70 default:
71 if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
72 if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
73 if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
74 if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
75 if (t[2]) _.ops.pop();
76 _.trys.pop(); continue;
77 }
78 op = body.call(thisArg, _);
79 } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
80 if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
81 }
82};
83var __read = (this && this.__read) || function (o, n) {
84 var m = typeof Symbol === "function" && o[Symbol.iterator];
85 if (!m) return o;
86 var i = m.call(o), r, ar = [], e;
87 try {
88 while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
89 }
90 catch (error) { e = { error: error }; }
91 finally {
92 try {
93 if (r && !r.done && (m = i["return"])) m.call(i);
94 }
95 finally { if (e) throw e.error; }
96 }
97 return ar;
98};
99Object.defineProperty(exports, "__esModule", { value: true });
100exports.ActivationService = void 0;
101/**
102 * 接口文档:https://kb.cvte.com/pages/viewpage.action?pageId=84417110
103 */
104var machineId = require('node-machine-id').machineId;
105var fs = require('fs-extra');
106var md5 = require('js-md5');
107var _a = require('../../utils/soap'), createClient = _a.createClient, request = _a.request;
108var getBiosVendor = require('../../utils/getBiosVendor').getBiosVendor;
109var crypto = require('crypto');
110var AES = require('crypto-js/aes');
111var encUTF8 = require('crypto-js/enc-utf8');
112var log = require('electron-log');
113var path = require('path');
114var app = require('electron').app;
115var isEmpty_1 = require("../../utils/isEmpty");
116var once_init_1 = require("once-init");
117var os = require("os");
118var getMachineID_1 = require("../../utils/getMachineID");
119var Sentry = require("@sentry/node");
120var node_1 = require("@sentry/node");
121var checkOnline_1 = require("../../utils/checkOnline");
122var biosReader_1 = require("../../tools/biosReader");
123var softwareAuthServiceUrl = 'http://register.seewo.com/EasiRegisterWcfService.svc?wsdl';
124var key = 'sau01thw';
125var paramsCode = '';
126var hardwareKey = md5('seewo');
127var isMac = os.platform() === 'darwin'; // mac 默认激活
128/**
129 * @description 激活服务(当前代码是被迁移到此目录下)
130 *
131 * 1、mac 默认激活
132 *
133 */
134var ActivationService = /** @class */ (function () {
135 function ActivationService() {
136 var _this = this;
137 this._debugRemainDays = undefined; // 调试用
138 this.isActive = true; // mac 默认激活
139 this.activeFileSysPathOld = path.join(app.getPath('userData'), '.com.seewo.easinote5/.register');
140 this.activeFileUserPathOld = path.join(app.getAppPath(), '../.appData/.register');
141 this.activeFileSysPath = path.join(app.getPath('userData'), '.com.seewo.easinote5/.register-v2');
142 this.activeFileUserPath = path.join(app.getAppPath(), '../.appData/.register-v2');
143 // 通过接口请求,根据激活码,确认是否依然激活
144 // 需要兼容旧激活文件?如果没有新文件,但他是激活成功的?
145 this.sendActiveRequestWithTimeout = function (code) { return __awaiter(_this, void 0, void 0, function () {
146 return __generator(this, function (_a) {
147 switch (_a.label) {
148 case 0: return [4 /*yield*/, Promise.race([
149 this.sendActiveRequest(code),
150 (function () {
151 return new Promise(function (res) {
152 setTimeout(function () { return res([0x70, 'timeout', '']); }, 20 * 1000);
153 });
154 })(),
155 ])];
156 case 1: return [2 /*return*/, _a.sent()];
157 }
158 });
159 }); };
160 this._getRemainDaysByRequest = function (code) { return __awaiter(_this, void 0, void 0, function () {
161 var _a, responseFlag, responseString, _b, authType, serialCode, remainDays, resultRemainDays, oldMachineId, _c;
162 var _d;
163 return __generator(this, function (_e) {
164 switch (_e.label) {
165 case 0:
166 log.info('ActivationService getRemainDays, code:', code);
167 return [4 /*yield*/, this.sendActiveRequest(code)];
168 case 1:
169 _a = __read.apply(void 0, [_e.sent(), 2]), responseFlag = _a[0], responseString = _a[1];
170 log.info('ActivationService getRemainDays, responseString:', responseString);
171 if (!(responseFlag === 0x80)) return [3 /*break*/, 2];
172 _b = __read(responseString.split('|'), 3), authType = _b[0], serialCode = _b[1], remainDays = _b[2];
173 resultRemainDays = (_d = this._debugRemainDays) !== null && _d !== void 0 ? _d : Number(remainDays);
174 this.writeActiveFile({
175 permanent: authType === '01', // 01 是永久授权,07 是试用授权
176 deviceIdHash: md5(this.deviceId),
177 code: code,
178 remainDays: resultRemainDays,
179 }, [this.activeFileSysPath, this.activeFileUserPath]);
180 log.info('ActivationService getRemainDays, remainDays:', remainDays);
181 log.info('ActivationService getRemainDays, this._debugRemainDays:', this._debugRemainDays);
182 return [2 /*return*/, resultRemainDays];
183 case 2:
184 if (!(responseFlag === 0x27 || responseFlag === 0x31)) return [3 /*break*/, 8];
185 return [4 /*yield*/, this.getOldMachineId()];
186 case 3:
187 oldMachineId = _e.sent();
188 if (!(oldMachineId !== this.deviceId)) return [3 /*break*/, 5];
189 this.deviceId = oldMachineId;
190 return [4 /*yield*/, this._getRemainDaysByRequest(code)];
191 case 4: return [2 /*return*/, _e.sent()];
192 case 5:
193 _c = this;
194 return [4 /*yield*/, this.getMachineId()];
195 case 6:
196 _c.deviceId = _e.sent();
197 _e.label = 7;
198 case 7:
199 this.writeActiveFile({
200 permanent: false,
201 deviceIdHash: md5(this.deviceId),
202 code: code,
203 remainDays: Number(0),
204 }, [this.activeFileSysPath, this.activeFileUserPath]);
205 return [2 /*return*/, 0]; // 已过期,剩余天数为 0
206 case 8:
207 log.error('请求剩余激活天数失败', [responseFlag, responseString]);
208 return [2 /*return*/, Infinity]; // 尽量不影响用户使用,失败的话,返回无穷大
209 }
210 });
211 }); };
212 this._getRemainDaysDebounce = (0, once_init_1.default)(function () { return __awaiter(_this, void 0, void 0, function () {
213 var fileContent, code;
214 return __generator(this, function (_a) {
215 switch (_a.label) {
216 case 0:
217 if (!this.isActive)
218 return [2 /*return*/, 0]; // 未激活,剩余天数为 0
219 return [4 /*yield*/, this.readActiveFile()];
220 case 1:
221 fileContent = _a.sent();
222 if (fileContent === null || fileContent === void 0 ? void 0 : fileContent.permanent)
223 return [2 /*return*/, Infinity]; // 永久激活,剩余天数为无穷大
224 code = fileContent.code;
225 if (!code)
226 return [2 /*return*/, Infinity]; // 没有激活请求字符串,尽量不影响用户使用,返回无穷大
227 return [4 /*yield*/, this._getRemainDaysByRequest(code)];
228 case 2: // 没有激活请求字符串,尽量不影响用户使用,返回无穷大
229 return [2 /*return*/, _a.sent()];
230 }
231 });
232 }); }).refresh;
233 // this.init();
234 this.exponentialBackoffRetry = new isEmpty_1.ExponentialBackoffRetry();
235 }
236 ActivationService.prototype.setDebugRemainDays = function (remainDays) {
237 return __awaiter(this, void 0, void 0, function () {
238 var fileContent;
239 return __generator(this, function (_a) {
240 switch (_a.label) {
241 case 0:
242 log.info('setDebugRemainDays', remainDays);
243 this._debugRemainDays = remainDays;
244 return [4 /*yield*/, this.readActiveFile()];
245 case 1:
246 fileContent = _a.sent();
247 if (fileContent.permanent)
248 return [2 /*return*/]; // 永久激活,不修改
249 this.writeActiveFile(__assign(__assign({}, fileContent), { remainDays: this._debugRemainDays }), [this.activeFileSysPath, this.activeFileUserPath]);
250 return [2 /*return*/];
251 }
252 });
253 });
254 };
255 ActivationService.prototype.getIsActive = function () {
256 return __awaiter(this, void 0, void 0, function () {
257 return __generator(this, function (_a) {
258 switch (_a.label) {
259 case 0:
260 if (!!this.deviceId) return [3 /*break*/, 2];
261 return [4 /*yield*/, this.init()];
262 case 1:
263 _a.sent();
264 _a.label = 2;
265 case 2: return [2 /*return*/, true];
266 }
267 });
268 });
269 };
270 ActivationService.prototype.sendActiveRequest = function (code) {
271 return __awaiter(this, void 0, void 0, function () {
272 var client, checkCode, authRequestString, RegisterResult, responseArr;
273 return __generator(this, function (_a) {
274 switch (_a.label) {
275 case 0:
276 if (!!this.deviceId) return [3 /*break*/, 2];
277 return [4 /*yield*/, this.getMachineId()];
278 case 1:
279 _a.sent();
280 _a.label = 2;
281 case 2: return [4 /*yield*/, createClient(softwareAuthServiceUrl)];
282 case 3:
283 client = _a.sent();
284 return [4 /*yield*/, request(client, 'GenerateCheckCode', {})];
285 case 4:
286 checkCode = (_a.sent()).GenerateCheckCodeResult;
287 authRequestString = this.encryptParams([checkCode, code, this.deviceId, paramsCode]);
288 return [4 /*yield*/, request(client, 'Register', {
289 authRequestString: authRequestString,
290 })];
291 case 5:
292 RegisterResult = (_a.sent()).RegisterResult;
293 responseArr = this.decryptParams(RegisterResult);
294 return [2 /*return*/, responseArr.concat(checkCode)];
295 }
296 });
297 });
298 };
299 ActivationService.prototype.activeByCode = function (code) {
300 return __awaiter(this, void 0, void 0, function () {
301 var _a, responseFlag, responseString, checkCode, _b, authType, serialCode, remainDays, permanent, oldMachineId, _c, err_1;
302 return __generator(this, function (_d) {
303 switch (_d.label) {
304 case 0:
305 _d.trys.push([0, 9, , 10]);
306 return [4 /*yield*/, this.sendActiveRequest(code)];
307 case 1:
308 _a = __read.apply(void 0, [_d.sent(), 3]), responseFlag = _a[0], responseString = _a[1], checkCode = _a[2];
309 _b = __read(responseString.split('|'), 3), authType = _b[0], serialCode = _b[1], remainDays = _b[2];
310 if (!(responseFlag === 0x80)) return [3 /*break*/, 2];
311 this.isActive = true;
312 permanent = authType === '01';
313 this.writeActiveFile({
314 permanent: permanent,
315 deviceIdHash: md5(this.deviceId),
316 code: code,
317 remainDays: permanent ? Infinity : Number(remainDays),
318 }, [this.activeFileSysPath, this.activeFileUserPath]);
319 // 如果是永久激活,再写一份到旧文件,兼容旧版本
320 if (permanent) {
321 this.writeActiveFile("".concat(md5(checkCode)).concat(md5(this.deviceId)).concat(md5(code)), [this.activeFileSysPathOld, this.activeFileUserPathOld], true);
322 }
323 return [2 /*return*/];
324 case 2:
325 if (!(responseFlag === 0x27 || responseFlag === 0x31)) return [3 /*break*/, 7];
326 return [4 /*yield*/, this.getOldMachineId()];
327 case 3:
328 oldMachineId = _d.sent();
329 if (!(oldMachineId !== this.deviceId)) return [3 /*break*/, 5];
330 this.deviceId = oldMachineId;
331 return [4 /*yield*/, this.activeByCode(code)];
332 case 4: return [2 /*return*/, _d.sent()];
333 case 5:
334 _c = this;
335 return [4 /*yield*/, this.getMachineId()];
336 case 6:
337 _c.deviceId = _d.sent();
338 _d.label = 7;
339 case 7:
340 log.error('激活失败', [responseFlag, responseString]);
341 _d.label = 8;
342 case 8: return [2 /*return*/, [responseFlag, responseString]];
343 case 9:
344 err_1 = _d.sent();
345 console.error(err_1);
346 log.error(err_1);
347 return [2 /*return*/, []];
348 case 10: return [2 /*return*/];
349 }
350 });
351 });
352 };
353 ActivationService.prototype.getRemainDays = function () {
354 return __awaiter(this, void 0, void 0, function () {
355 var err_2;
356 return __generator(this, function (_a) {
357 switch (_a.label) {
358 case 0:
359 _a.trys.push([0, 4, , 5]);
360 if (!isMac) return [3 /*break*/, 1];
361 return [2 /*return*/, Infinity]; // mac 默认激活,剩余天数为无穷大
362 case 1: return [4 /*yield*/, this._getRemainDaysDebounce()];
363 case 2: return [2 /*return*/, _a.sent()];
364 case 3: return [3 /*break*/, 5];
365 case 4:
366 err_2 = _a.sent();
367 log.error('查询剩余激活天数失败', err_2);
368 return [2 /*return*/, Infinity]; // 尽量不影响用户使用,失败的话,返回无穷大
369 case 5: return [2 /*return*/];
370 }
371 });
372 });
373 };
374 ActivationService.prototype.checkActiveWithServer = function () {
375 return __awaiter(this, void 0, void 0, function () {
376 var err_3;
377 var _this = this;
378 return __generator(this, function (_a) {
379 switch (_a.label) {
380 case 0:
381 _a.trys.push([0, 2, , 3]);
382 return [4 /*yield*/, this.exponentialBackoffRetry.execute(function () { return __awaiter(_this, void 0, void 0, function () {
383 return __generator(this, function (_a) {
384 switch (_a.label) {
385 case 0:
386 if (!(0, checkOnline_1.checkOnline)()) {
387 this.exponentialBackoffRetry.reset(); // 如果网络断开,重置重试次数
388 }
389 return [4 /*yield*/, this._checkActiveWithServer()];
390 case 1: return [2 /*return*/, true];
391 }
392 });
393 }); }, function (result) {
394 if (Array.isArray(result) && [0x70, 0x21].includes(result[0])) {
395 // 未知异常,重试
396 log.info("[ExponentialBackoffRetry] checkActiveWithServer retrying due to unknown error ".concat(result[0]), result);
397 return true;
398 }
399 return false;
400 }, function () {
401 // 已达重试上限,返回 false
402 Sentry.addBreadcrumb({
403 category: 'checkActiveWithServer_retry_max',
404 message: 'checkActiveWithServer_retry_max',
405 data: {
406 deviceId: _this.deviceId,
407 },
408 level: node_1.Severity.Error,
409 });
410 Sentry.captureException(new Error('checkActiveWithServer_retry_max'));
411 return false;
412 })];
413 case 1: return [2 /*return*/, _a.sent()];
414 case 2:
415 err_3 = _a.sent();
416 log.error(err_3); // 重试失败,返回 false
417 return [2 /*return*/, false];
418 case 3: return [2 /*return*/];
419 }
420 });
421 });
422 };
423 ActivationService.prototype._checkActiveWithServer = function () {
424 return __awaiter(this, void 0, void 0, function () {
425 var seewoDevice, fileContent, code, response, _a, responseFlag, oldMachineId, _b;
426 return __generator(this, function (_c) {
427 switch (_c.label) {
428 case 0:
429 if (isMac)
430 return [2 /*return*/, true]; // mac 默认激活
431 return [4 /*yield*/, this.isSeewoDevice()];
432 case 1:
433 seewoDevice = _c.sent();
434 if (seewoDevice)
435 return [2 /*return*/, true]; // 希沃设备,默认激活
436 return [4 /*yield*/, this.readActiveFile()];
437 case 2:
438 fileContent = _c.sent();
439 if (!fileContent || (0, isEmpty_1.isEmpty)(fileContent)) {
440 log.error('没有激活文件,未激活');
441 return [2 /*return*/, false]; // 没有激活文件,未激活
442 }
443 code = fileContent.code;
444 if (!code) {
445 log.info('旧版本激活文件,认为激活成功');
446 return [2 /*return*/, true]; // 旧版本激活文件,无法获取code(经过md5加密),认为激活成功
447 }
448 return [4 /*yield*/, this.sendActiveRequestWithTimeout(code)];
449 case 3:
450 response = _c.sent();
451 _a = __read(response, 1), responseFlag = _a[0];
452 if (responseFlag === 0x80) {
453 // 激活码有效
454 return [2 /*return*/, true];
455 }
456 if (responseFlag === 0x70 || responseFlag === 0x21) {
457 // 未知异常,返回原始响应,让重试机制处理
458 return [2 /*return*/, response];
459 }
460 if (!(responseFlag === 0x27 || responseFlag === 0x31)) return [3 /*break*/, 8];
461 return [4 /*yield*/, this.getOldMachineId()];
462 case 4:
463 oldMachineId = _c.sent();
464 if (!(oldMachineId !== this.deviceId)) return [3 /*break*/, 6];
465 // 避免死循环
466 this.deviceId = oldMachineId;
467 return [4 /*yield*/, this._checkActiveWithServer()];
468 case 5: return [2 /*return*/, true];
469 case 6:
470 _b = this;
471 return [4 /*yield*/, this.getMachineId()];
472 case 7:
473 _b.deviceId = _c.sent();
474 // 如果oldMachineId和当前deviceId相同,说明已经是旧ID了,直接返回false
475 log.error('激活码有问题取消激活', responseFlag, code);
476 return [2 /*return*/, false];
477 case 8:
478 if ([0x25, 0x26].includes(responseFlag)) {
479 // 其他注册码相关错误码,未激活(0x27已经在上面处理了)
480 log.error('激活码有问题取消激活', responseFlag, code);
481 return [2 /*return*/, false];
482 }
483 // 默认情况:未知的responseFlag,认为未激活
484 log.error('未知的响应标志', responseFlag);
485 Sentry.captureEvent({
486 level: node_1.Severity.Warning,
487 message: '未知的响应标志',
488 extra: {
489 responseFlag: responseFlag,
490 code: code,
491 deviceId: this.deviceId,
492 },
493 });
494 return [2 /*return*/, false];
495 }
496 });
497 });
498 };
499 ActivationService.prototype.isSeewoDevice = function () {
500 return __awaiter(this, void 0, void 0, function () {
501 var biosVendor;
502 return __generator(this, function (_a) {
503 switch (_a.label) {
504 case 0: return [4 /*yield*/, getBiosVendor()];
505 case 1:
506 biosVendor = _a.sent();
507 console.log('is seewo device biosvendor is ', biosVendor);
508 return [2 /*return*/, true];
509 }
510 });
511 });
512 };
513 ActivationService.prototype.activateSeewoDevice = function (deviceIdHash) {
514 return __awaiter(this, void 0, void 0, function () {
515 var seewoDevice;
516 return __generator(this, function (_a) {
517 switch (_a.label) {
518 case 0:
519 this.isActive = true;
520 this.writeActiveFile({
521 permanent: true,
522 deviceIdHash: deviceIdHash,
523 }, [this.activeFileSysPath, this.activeFileUserPath]);
524 return [2 /*return*/];
525 case 1:
526 seewoDevice = _a.sent();
527 // 希沃设备,自动永久激活
528 if (seewoDevice) {
529 this.isActive = true;
530 this.writeActiveFile({
531 permanent: true,
532 deviceIdHash: deviceIdHash,
533 }, [this.activeFileSysPath, this.activeFileUserPath]);
534 }
535 else {
536 this.isActive = true;
537 }
538 return [2 /*return*/];
539 }
540 });
541 });
542 };
543 ActivationService.prototype.init = function () {
544 return __awaiter(this, void 0, void 0, function () {
545 var _a, deviceId, fileContent, oldDeviceId, deviceIdHash, oldDeviceIdHash, fileDeviceId, fileRemainDays, filePermanent;
546 return __generator(this, function (_b) {
547 switch (_b.label) {
548 case 0: return [4 /*yield*/, Promise.all([
549 this.getMachineId(),
550 this.readActiveFile(),
551 this.getOldMachineId(),
552 ])];
553 case 1:
554 _a = __read.apply(void 0, [_b.sent(), 3]), deviceId = _a[0], fileContent = _a[1], oldDeviceId = _a[2];
555 deviceIdHash = md5(deviceId);
556 oldDeviceIdHash = md5(oldDeviceId);
557 if (!(!fileContent || (0, isEmpty_1.isEmpty)(fileContent))) return [3 /*break*/, 3];
558 // 如果没有激活文件,判断是否是希沃设备,是的话自动永久激活
559 return [4 /*yield*/, this.activateSeewoDevice(deviceId)];
560 case 2:
561 // 如果没有激活文件,判断是否是希沃设备,是的话自动永久激活
562 _b.sent();
563 return [2 /*return*/];
564 case 3:
565 fileDeviceId = fileContent.deviceIdHash;
566 fileRemainDays = fileContent.remainDays;
567 filePermanent = fileContent.permanent;
568 log.info("\n filePermanent: ".concat(filePermanent, "\n fileRemainDays: ").concat(fileRemainDays, "\n "));
569 this.isActive = true;
570 if (!!this.isActive) return [3 /*break*/, 5];
571 return [4 /*yield*/, this.activateSeewoDevice(deviceId)];
572 case 4:
573 _b.sent();
574 _b.label = 5;
575 case 5: return [2 /*return*/];
576 }
577 });
578 });
579 };
580 // 存在过期时间,且已过期
581 ActivationService.prototype.hasExpired = function (remainDays) {
582 if (remainDays === void 0) { remainDays = Infinity; }
583 return Number(remainDays) <= 0;
584 };
585 ActivationService.prototype.getMachineId = function () {
586 return __awaiter(this, void 0, void 0, function () {
587 var id;
588 return __generator(this, function (_a) {
589 switch (_a.label) {
590 case 0: return [4 /*yield*/, (0, getMachineID_1.generateMachineID)()];
591 case 1:
592 id = _a.sent();
593 this.deviceId = id;
594 return [2 /*return*/, id];
595 }
596 });
597 });
598 };
599 // 旧版本获取机器码的方法,用于兼容处理
600 ActivationService.prototype.getOldMachineId = function () {
601 return __awaiter(this, void 0, void 0, function () {
602 var id;
603 return __generator(this, function (_a) {
604 switch (_a.label) {
605 case 0: return [4 /*yield*/, machineId()];
606 case 1:
607 id = _a.sent();
608 return [2 /*return*/, id];
609 }
610 });
611 });
612 };
613 ActivationService.prototype.pathExists = function (filePath) {
614 return __awaiter(this, void 0, void 0, function () {
615 var exists, e_1;
616 return __generator(this, function (_a) {
617 switch (_a.label) {
618 case 0:
619 exists = false;
620 _a.label = 1;
621 case 1:
622 _a.trys.push([1, 3, , 4]);
623 return [4 /*yield*/, fs.pathExists(filePath)];
624 case 2:
625 exists = _a.sent();
626 return [3 /*break*/, 4];
627 case 3:
628 e_1 = _a.sent();
629 log.error(e_1);
630 return [3 /*break*/, 4];
631 case 4: return [2 /*return*/, exists];
632 }
633 });
634 });
635 };
636 ActivationService.prototype.isMD5 = function (str) {
637 if (!str)
638 return false;
639 var md5Regex = /^[a-f0-9]{32}$/i;
640 var subStrs = str.match(/.{1,32}/g) || []; // 将字符串拆分为长度为32的子字符串
641 return subStrs.every(function (subStr) { return md5Regex.test(subStr); });
642 };
643 ActivationService.prototype.readActiveFileInner = function (path) {
644 return __awaiter(this, void 0, void 0, function () {
645 var fileContent, rawStr, decryptByte, decryptStr, content, e_2;
646 return __generator(this, function (_a) {
647 switch (_a.label) {
648 case 0:
649 fileContent = Object.create(null);
650 _a.label = 1;
651 case 1:
652 _a.trys.push([1, 3, , 4]);
653 return [4 /*yield*/, fs.readFile(path, { encoding: 'utf8' })];
654 case 2:
655 rawStr = _a.sent();
656 decryptByte = AES.decrypt(rawStr, key);
657 decryptStr = decryptByte.toString(encUTF8);
658 content = JSON.parse(decryptStr);
659 fileContent = content;
660 return [3 /*break*/, 4];
661 case 3:
662 e_2 = _a.sent();
663 log.error('read active file fail:', e_2);
664 return [3 /*break*/, 4];
665 case 4: return [2 /*return*/, fileContent];
666 }
667 });
668 });
669 };
670 ActivationService.prototype.readBIOSActiveFileInner = function () {
671 return __awaiter(this, void 0, void 0, function () {
672 var fileContent, rawStr, decryptByte, decryptStr, content, e_3;
673 return __generator(this, function (_a) {
674 switch (_a.label) {
675 case 0:
676 fileContent = Object.create(null);
677 _a.label = 1;
678 case 1:
679 _a.trys.push([1, 3, , 4]);
680 return [4 /*yield*/, (0, biosReader_1.readBiosVar)()];
681 case 2:
682 rawStr = _a.sent();
683 decryptByte = AES.decrypt(rawStr, key);
684 decryptStr = decryptByte.toString(encUTF8);
685 content = JSON.parse(decryptStr);
686 fileContent = content;
687 return [3 /*break*/, 4];
688 case 3:
689 e_3 = _a.sent();
690 log.error('read BIOS active file fail:', e_3);
691 return [3 /*break*/, 4];
692 case 4: return [2 /*return*/, fileContent];
693 }
694 });
695 });
696 };
697 /**
698 * 维护一下旧版本的激活文件
699 * @returns
700 */
701 ActivationService.prototype.maintainOldActiveFile = function () {
702 return __awaiter(this, void 0, void 0, function () {
703 var _a, isOldSysPathExists, isOldUserPathExists, fileContent;
704 return __generator(this, function (_b) {
705 switch (_b.label) {
706 case 0: return [4 /*yield*/, Promise.all([
707 this.pathExists(this.activeFileSysPathOld),
708 this.pathExists(this.activeFileUserPathOld),
709 ])];
710 case 1:
711 _a = __read.apply(void 0, [_b.sent(), 2]), isOldSysPathExists = _a[0], isOldUserPathExists = _a[1];
712 fileContent = '';
713 if (!isOldSysPathExists) return [3 /*break*/, 3];
714 return [4 /*yield*/, fs.readFile(this.activeFileSysPathOld, { encoding: 'utf8' })];
715 case 2:
716 // 系统激活文件存在,安装目录激活文件不存在的场景,可能是用户重装软件,这里重写回安装目录
717 fileContent = _b.sent();
718 if (!isOldUserPathExists) {
719 this.writeActiveFile(fileContent, [this.activeFileUserPathOld], true);
720 }
721 return [3 /*break*/, 5];
722 case 3:
723 if (!isOldUserPathExists) return [3 /*break*/, 5];
724 return [4 /*yield*/, fs.readFile(this.activeFileUserPathOld, { encoding: 'utf8' })];
725 case 4:
726 // 安装目录激活文件存在,系统激活文件不存在的场景,可能是不同用户登录,这里重写回系统目录
727 fileContent = _b.sent();
728 this.writeActiveFile(fileContent, [this.activeFileSysPathOld], true);
729 _b.label = 5;
730 case 5: return [2 /*return*/, fileContent];
731 }
732 });
733 });
734 };
735 ActivationService.prototype.readActiveFile = function () {
736 return __awaiter(this, void 0, void 0, function () {
737 var _a, isSysPathExists, isUserPathExists, oldFileContent, fileContent, hashLen, biosFileContent;
738 return __generator(this, function (_b) {
739 switch (_b.label) {
740 case 0: return [4 /*yield*/, Promise.all([
741 this.pathExists(this.activeFileSysPath),
742 this.pathExists(this.activeFileUserPath),
743 ])];
744 case 1:
745 _a = __read.apply(void 0, [_b.sent(), 2]), isSysPathExists = _a[0], isUserPathExists = _a[1];
746 return [4 /*yield*/, this.maintainOldActiveFile()];
747 case 2:
748 oldFileContent = _b.sent();
749 fileContent = {};
750 if (!isSysPathExists) return [3 /*break*/, 4];
751 return [4 /*yield*/, this.readActiveFileInner(this.activeFileSysPath)];
752 case 3:
753 fileContent = _b.sent();
754 // 系统激活文件存在,安装目录激活文件不存在的场景,可能是用户重装软件,这里重写回安装目录
755 if (!isUserPathExists) {
756 this.writeActiveFile(fileContent, [this.activeFileUserPath]);
757 }
758 return [3 /*break*/, 9];
759 case 4:
760 if (!isUserPathExists) return [3 /*break*/, 6];
761 return [4 /*yield*/, this.readActiveFileInner(this.activeFileUserPath)];
762 case 5:
763 // 安装目录激活文件存在,系统激活文件不存在的场景,可能是不同用户登录,这里重写回系统目录
764 fileContent = _b.sent();
765 this.writeActiveFile(fileContent, [this.activeFileSysPath]);
766 return [3 /*break*/, 9];
767 case 6:
768 if (!(oldFileContent && this.isMD5(oldFileContent))) return [3 /*break*/, 7];
769 hashLen = 32;
770 fileContent = {
771 permanent: true,
772 deviceIdHash: oldFileContent.slice(hashLen, hashLen * 2),
773 };
774 return [3 /*break*/, 9];
775 case 7: return [4 /*yield*/, this.readBIOSActiveFileInner()];
776 case 8:
777 biosFileContent = _b.sent();
778 if (biosFileContent && !(0, isEmpty_1.isEmpty)(biosFileContent)) {
779 fileContent = biosFileContent;
780 this.writeActiveFile(fileContent, [this.activeFileSysPath, this.activeFileUserPath]);
781 }
782 _b.label = 9;
783 case 9: return [2 /*return*/, fileContent];
784 }
785 });
786 });
787 };
788 ActivationService.prototype.writeActiveFile = function (fileContent_1, paths_1) {
789 return __awaiter(this, arguments, void 0, function (fileContent, paths, raw) {
790 var filePath, err_4;
791 if (raw === void 0) { raw = false; }
792 return __generator(this, function (_a) {
793 switch (_a.label) {
794 case 0: return [4 /*yield*/, Promise.all(paths.map(function (filePath) {
795 var cipherText = raw ? fileContent : AES.encrypt(JSON.stringify(fileContent), key).toString(); // 加密,不然用户可以随便改
796 fs.outputFile(filePath, cipherText)
797 .then(function () {
798 console.log("\u6587\u4EF6 ".concat(filePath, " \u5199\u5165\u6210\u529F"));
799 })
800 .catch(function (err) {
801 console.log("\u6587\u4EF6 ".concat(filePath, " \u5199\u5165\u5931\u8D25\n err:").concat(err, "\n "));
802 });
803 }))];
804 case 1:
805 _a.sent();
806 filePath = paths.find(function (path) { return fs.existsSync(path); });
807 if (!filePath) return [3 /*break*/, 5];
808 _a.label = 2;
809 case 2:
810 _a.trys.push([2, 4, , 5]);
811 return [4 /*yield*/, (0, biosReader_1.writeBiosVar)(filePath)];
812 case 3:
813 _a.sent();
814 return [3 /*break*/, 5];
815 case 4:
816 err_4 = _a.sent();
817 console.log("BIOS\u53D8\u91CF\u5199\u5165\u5931\u8D25: ".concat(err_4));
818 return [3 /*break*/, 5];
819 case 5: return [2 /*return*/];
820 }
821 });
822 });
823 };
824 ActivationService.prototype.addZero = function (buffers) {
825 var paddingLength = buffers.length % 8;
826 if (paddingLength) {
827 return Buffer.concat([buffers, Buffer.alloc(8 - paddingLength)]);
828 }
829 return buffers;
830 };
831 ActivationService.prototype.encryptParams = function (params) {
832 console.log('encryptParams begin:', params);
833 var buffers = [];
834 for (var i = 0; i < params.length; i++) {
835 var utf8Param = Buffer.from(params[i], 'utf8');
836 // 将参数的长度信息封装成 4 字节大小的 Buffer
837 var lenBuffer = Buffer.alloc(4);
838 lenBuffer.writeUInt32LE(utf8Param.length, 0);
839 // 将参数数据和长度信息合并成新的 Buffer 追加到总 Buffer 序列(buffers)的尾部
840 buffers.push(lenBuffer, utf8Param);
841 }
842 // 将所有参数的 Buffer 序列合并成一个总 Buffer
843 var buffer = this.addZero(Buffer.concat(buffers));
844 // 使用 DES/ECB/NoPadding 算法进行加密
845 var cipher = crypto.createCipheriv('des-ecb', key, null);
846 cipher.setAutoPadding(false);
847 var encrypted = cipher.update(buffer);
848 var finalBuffer = Buffer.concat([encrypted, cipher.final()]);
849 // 对加密结果进行 base64 编码,并在前面添加版本号 02
850 var base64Encoded = '02' + finalBuffer.toString('base64');
851 console.log('encryptParams end:', base64Encoded);
852 return base64Encoded;
853 };
854 ActivationService.prototype.decryptParams = function (encrypted) {
855 console.log('decryptParams begin:', encrypted);
856 var encryptedData = Buffer.from(encrypted, 'base64');
857 // 使用 DES/ECB/NoPadding 算法进行解密
858 var decipher = crypto.createDecipheriv('des-ecb', key, null);
859 decipher.setAutoPadding(false);
860 var decryptedData = decipher.update(encryptedData);
861 // const finalData = decryptedData;
862 var finalData = Buffer.concat([decryptedData, decipher.final()]);
863 // 解析每个参数的长度和数据
864 var params = [];
865 params.push(finalData.readUInt32LE(0));
866 var offset = 4;
867 while (offset + 4 < finalData.length) {
868 // 取出参数的长度信息
869 var len = finalData.readUInt32LE(offset);
870 offset += 4;
871 // 根据长度信息取出参数的数据
872 var param = Buffer.from(finalData.slice(offset, offset + len)).toString('utf8');
873 offset += len;
874 // 将解码后的参数保存到数组中
875 params.push(param);
876 }
877 console.log('decryptParams end:', params);
878 return params;
879 };
880 return ActivationService;
881}());
882exports.ActivationService = ActivationService;
883ENDOFACTIVATIONJS
884 fi
885 asar p "$srcdir/app_unpacked" "$APP_ROOT/resources/app.asar"
886 rm -rf "$srcdir/app_unpacked"
887 chmod +x "$APP_ROOT/EasiNote5"
888 if [ -f "$APP_ROOT/chrome-sandbox" ]; then
889 chmod +x "$APP_ROOT/chrome-sandbox"
890 fi
891}
892

Scan history

Scanned at (UTC)SeverityRules
2026-08-03 00:08:14 MEDIUM 2
2026-08-02 00:16:08 MEDIUM 2
2026-08-01 00:11:18 MEDIUM 2
2026-07-31 00:14:10 MEDIUM 2
2026-07-30 00:17:23 MEDIUM 2
2026-07-29 00:25:53 MEDIUM 2
2026-07-28 00:07:28 MEDIUM 2
2026-07-27 00:24:32 MEDIUM 2
2026-07-26 00:07:32 MEDIUM 2
2026-07-25 00:13:44 MEDIUM 2
2026-07-24 00:02:28 MEDIUM 2
2026-07-23 00:14:47 MEDIUM 2
2026-07-22 00:29:32 MEDIUM 2
2026-07-21 00:24:15 MEDIUM 2
2026-07-20 00:19:49 MEDIUM 2
2026-07-19 00:17:08 MEDIUM 2
2026-07-18 00:14:48 MEDIUM 2
2026-07-17 00:06:16 MEDIUM 2
2026-07-16 00:05:41 MEDIUM 2
2026-07-15 00:09:25 MEDIUM 2

Report a package

Reports go to the AURWatch maintainer (one person) and are read by hand. No login required.

0 / 4000
Your suggestion