123-lang 2.1.13 → 2.1.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (18) hide show
  1. package/package.json +1 -1
  2. package/source/Customization/electron/last/electron-configuration/BitHideRoot.crt +21 -0
  3. package/source/Customization/electron/last/electron-configuration/Wallet.crt +20 -0
  4. package/source/Customization/electron/last/electron-configuration/configuration.js +121 -0
  5. package/source/Customization/electron/last/electron-configuration/configuration_.js +120 -0
  6. package/source/Customization/electron/last/electron-configuration/default-assets.js +16 -0
  7. package/source/Customization/electron/last/electron-configuration/messages.js +41 -0
  8. package/source/Customization/electron/last/electron-configuration/modules/WhiteLabelUpdater /342/200/223 default.js" +259 -0
  9. package/source/Customization/electron/last/electron-configuration/modules/WhiteLabelUpdater.js +273 -0
  10. package/source/Customization/electron/last/electron.js +335 -0
  11. package/source/Customization/electron/updated/electron-configuration/BitHideRoot.crt +21 -0
  12. package/source/Customization/electron/updated/electron-configuration/Wallet.crt +20 -0
  13. package/source/Customization/electron/updated/electron-configuration/configuration.js +121 -0
  14. package/source/Customization/electron/updated/electron-configuration/configuration_.js +120 -0
  15. package/source/Customization/electron/updated/electron-configuration/default-assets.js +16 -0
  16. package/source/Customization/electron/updated/electron-configuration/messages.js +41 -0
  17. package/source/Customization/electron/updated/electron-configuration/modules/WhiteLabelUpdater.js +259 -0
  18. package/source/Customization/electron/updated/electron.js +357 -0
@@ -0,0 +1,335 @@
1
+ const path = require('path');
2
+
3
+ const {
4
+ app,
5
+ BrowserWindow,
6
+ shell,
7
+ dialog,
8
+ session,
9
+ globalShortcut,
10
+ } = require('electron');
11
+ const isDev = require('electron-is-dev');
12
+ // Auto updater
13
+ const fs = require('fs');
14
+ const { localStorage } = require('electron-browser-storage');
15
+ const { t } = require('./electron-configuration/messages');
16
+ const {
17
+ config,
18
+ platforms,
19
+ platformsNames,
20
+ whiteLabelUpdaterConfiguration,
21
+ } = require('./electron-configuration/configuration');
22
+ const { autoUpdater } = require('electron-updater');
23
+ const log = require('electron-log');
24
+ const forge = require('node-forge');
25
+ const os = require('os');
26
+ const whiteLabelUpdater = require('./electron-configuration/modules/WhiteLabelUpdater.js');
27
+
28
+ const getLang = async () => localStorage.getItem(config.storageNames.lang);
29
+
30
+ const { isEnableDevTools, isAvailableDomainInput, certificate } = config;
31
+
32
+ const rootCertificatePath = path.join(
33
+ __dirname,
34
+ certificate.dir,
35
+ certificate.fileName,
36
+ );
37
+ const rootCertificatePathSecondary = path.join(
38
+ __dirname,
39
+ certificate.dir,
40
+ certificate.fileNameSecondary,
41
+ );
42
+
43
+ const currentPlatform = platformsNames[os.platform()];
44
+ let updatesPath;
45
+
46
+ log.info(`Current Platform: ${currentPlatform}`);
47
+
48
+ // Disable downloading and installation updates for the MAC
49
+ autoUpdater.autoDownload = currentPlatform !== platforms.MAC;
50
+ autoUpdater.autoInstallOnAppQuit = currentPlatform !== platforms.MAC;
51
+
52
+ // Enable usage of Portal's globalShortcuts. This is essential for cases when
53
+ // the app runs in a Wayland session.
54
+ app.commandLine.appendSwitch('enable-features', 'GlobalShortcutsPortal');
55
+
56
+ async function createWindow(wlConfig) {
57
+ const appIcon = whiteLabelUpdater.createAppIcon(wlConfig?.assets['icon.png']);
58
+ // Create the browser window.
59
+ const win = new BrowserWindow({
60
+ ...config.mainWindow,
61
+ icon: appIcon,
62
+ webPreferences: {
63
+ devTools: true,
64
+ nodeIntegration: true,
65
+ },
66
+ });
67
+ // White Label
68
+ if (process.platform === 'win32' && wlConfig?.assets['icon.ico']) {
69
+ whiteLabelUpdater?.updateShortcutWithBase64(wlConfig?.assets['icon.ico']);
70
+ }
71
+
72
+ try {
73
+ if (process.platform === 'darwin') {
74
+ app.dock.setIcon(appIcon);
75
+ log.info('[WL][MAC] Icon successfully changed');
76
+ }
77
+ } catch (e) {
78
+ log.error('[WL][MAC] Icon error', e);
79
+ }
80
+
81
+ win.webContents.on('new-window', function (e, url) {
82
+ e.preventDefault();
83
+ shell.openExternal(url);
84
+ });
85
+ // Set Links Settings
86
+
87
+ win.webContents.setWindowOpenHandler(details => {
88
+ shell.openExternal(details.url); // Open URL in user's Browser
89
+ return { action: 'deny' };
90
+ });
91
+
92
+ if (!isEnableDevTools) {
93
+ win.removeMenu();
94
+ }
95
+
96
+ // Register a config?.shortCuts?.devTools shortcut listener.
97
+ const ret = globalShortcut.register(config?.shortCuts?.devTools, () => {
98
+ log.info(`${config?.shortCuts?.devTools} is pressed`);
99
+ if (win) {
100
+ const isOpen = win.webContents.isDevToolsOpened();
101
+ if (isOpen) {
102
+ win.webContents.closeDevTools();
103
+ } else {
104
+ win.webContents.openDevTools({ mode: 'detach' });
105
+ }
106
+ }
107
+ });
108
+
109
+ // and load the index.html of the app.
110
+ // win.loadFile("index.html");
111
+ win.loadURL(
112
+ isDev
113
+ ? 'http://localhost:3000'
114
+ : `file://${path.join(__dirname, '../build/index.html')}`,
115
+ );
116
+
117
+ // Open the DevTools.
118
+ if (isEnableDevTools) {
119
+ win.webContents.openDevTools({ mode: 'detach' });
120
+ }
121
+
122
+ // Check up for updates
123
+ // Verify certificate for the autoUpdater
124
+ autoUpdater.netSession.setCertificateVerifyProc((request, callback) => {
125
+ const certStatuses = {
126
+ trusted: 0,
127
+ failed: -2,
128
+ browserChecked: -3,
129
+ };
130
+ const { hostname: hostName, verificationResult: e, certificate } = request;
131
+ let subjectName = certificate?.subjectName?.split('\n')[0];
132
+ subjectName = subjectName?.replace('*.', '');
133
+ const status = hostName?.includes(subjectName)
134
+ ? certStatuses.trusted
135
+ : certStatuses.failed;
136
+ if (status === certStatuses.failed) {
137
+ log.error('Certificate validation error:');
138
+ log.error(e);
139
+ }
140
+ callback(status);
141
+ });
142
+
143
+ const generateUpdateConfig = async () => {
144
+ let status = true;
145
+ const domainURL = await localStorage.getItem(config.storageNames.domain);
146
+ // Test local server
147
+ // const domainURL = `http://localhost:3100/`;
148
+ if (!domainURL) {
149
+ status = false;
150
+ return status;
151
+ }
152
+ const platformPath =
153
+ config?.updatesPathForPlatform[currentPlatform] ??
154
+ config?.updatesPathForPlatform[platforms.WINDOWS];
155
+
156
+ updatesPath = `${domainURL}${platformPath}`;
157
+
158
+ try {
159
+ log.info('domain: ', domainURL);
160
+ log.info('updates path: ', updatesPath);
161
+ autoUpdater.setFeedURL({
162
+ url: updatesPath,
163
+ provider: config.provider,
164
+ });
165
+ } catch (err) {
166
+ log.error(err);
167
+ status = false;
168
+ }
169
+ return status;
170
+ };
171
+
172
+ if (app.isPackaged) {
173
+ if (isAvailableDomainInput) {
174
+ generateUpdateConfig()
175
+ .then(status => {
176
+ if (status) {
177
+ autoUpdater.logger = log;
178
+ autoUpdater.checkForUpdates();
179
+ }
180
+ })
181
+ .catch(e => log.error(e));
182
+ return;
183
+ }
184
+ autoUpdater.logger = log;
185
+ autoUpdater.checkForUpdates();
186
+ }
187
+
188
+ return win;
189
+ }
190
+
191
+ // This method will be called when Electron has finished
192
+ // initialization and is ready to create browser windows.
193
+ // Some APIs can only be used after this event occurs.
194
+ app.whenReady().then(async () => {
195
+ if (config.isEnableWhiteLabelUpdater) {
196
+ const wlCache = await whiteLabelUpdater.getWhiteLabelStatus();
197
+ await whiteLabelUpdater.sendWhiteLabelDataForWeb(wlCache);
198
+
199
+ createWindow(wlCache);
200
+ await whiteLabelUpdater.runWhiteLabelUpdater();
201
+ } else {
202
+ createWindow();
203
+ }
204
+ // MAC OS FIX: Re-create a window in the app when the dock icon is clicked
205
+ app.on('activate', () => {
206
+ if (BrowserWindow.getAllWindows().length === 0) createWindow();
207
+ });
208
+ });
209
+
210
+ // Quit when all windows are closed, except on macOS. There, it's common
211
+ // for applications and their menu bar to stay active until the user quits
212
+ // explicitly with Cmd + Q.
213
+ app.on('window-all-closed', () => {
214
+ if (process.platform !== 'darwin') {
215
+ app.quit();
216
+ }
217
+ });
218
+
219
+ // Auto updater events
220
+ // Check is auto update available
221
+ autoUpdater.on('update-available', info => {
222
+ log.info('Update available:', info);
223
+ log.info('Updates path:', updatesPath);
224
+
225
+ const showInfoDialog = (lang = 'en') => {
226
+ log.info('showInfoDialog lang', lang);
227
+ const options = {
228
+ type: 'info',
229
+ buttons: [
230
+ t('Download installer', lang),
231
+ t('Download manual', lang),
232
+ t('Cancel', lang),
233
+ ],
234
+ defaultId: 2,
235
+ title: t('Update is available', lang),
236
+ message: t('Update is available', lang),
237
+ detail: '',
238
+ };
239
+ dialog.showMessageBox(options).then(response => {
240
+ if (response.response === 0) {
241
+ shell.openExternal(
242
+ `${updatesPath}${config?.macUpdateConfig?.installerName}`,
243
+ );
244
+ showInfoDialog(lang);
245
+ } else if (response.response === 1) {
246
+ shell.openExternal(
247
+ `${updatesPath}${config?.macUpdateConfig?.manualMap[lang]}`,
248
+ );
249
+ showInfoDialog(lang);
250
+ }
251
+ });
252
+ };
253
+ if (currentPlatform === platforms.MAC) {
254
+ getLang()
255
+ .then(lang => {
256
+ showInfoDialog(lang);
257
+ })
258
+ .catch(() => {
259
+ log.error('Unable get language');
260
+ showInfoDialog();
261
+ });
262
+ }
263
+ });
264
+ autoUpdater.on('update-downloaded', (_event, releaseNotes, releaseName) => {
265
+ const showTranslatedDialog = lang => {
266
+ const dialogOpts = {
267
+ type: 'info',
268
+ buttons: [t('Ok', lang), t('Later', lang)],
269
+ title: t('Update is available', lang),
270
+ message: process.platform === 'win32' ? releaseNotes : releaseName,
271
+ detail: t('Now application will start updating and restart.', lang),
272
+ };
273
+ dialog.showMessageBox(dialogOpts).then(returnValue => {
274
+ if (returnValue.response === 0) autoUpdater.quitAndInstall();
275
+ });
276
+ };
277
+ getLang()
278
+ .then(lang => {
279
+ showTranslatedDialog(lang);
280
+ })
281
+ .catch(() => {
282
+ log.error('Unable get language');
283
+ showTranslatedDialog();
284
+ });
285
+ });
286
+
287
+ autoUpdater.on('error', message => {
288
+ log.error(t('There was a problem updating the application'));
289
+ log.error(message);
290
+ });
291
+
292
+ app.on(
293
+ 'certificate-error',
294
+ (event, webContents, url, error, certificate, callback) => {
295
+ try {
296
+ const rootCertificateContent = fs.readFileSync(
297
+ rootCertificatePath,
298
+ 'utf8',
299
+ );
300
+ const rootCertificateContentSecondary = fs.readFileSync(
301
+ rootCertificatePathSecondary,
302
+ 'utf8',
303
+ );
304
+ const rootCert = forge.pki.certificateFromPem(rootCertificateContent);
305
+ const rootCertSecondary = forge.pki.certificateFromPem(
306
+ rootCertificateContentSecondary,
307
+ );
308
+ const clientCert = forge.pki.certificateFromPem(
309
+ certificate.data.toString(),
310
+ );
311
+ callback(
312
+ clientCert.isIssuer(rootCert) || clientCert.isIssuer(rootCertSecondary),
313
+ );
314
+ } catch (e) {
315
+ log.error('Certificate validation error:');
316
+ log.error(e);
317
+ callback(false);
318
+ }
319
+ },
320
+ );
321
+
322
+ // Clear Cache
323
+ app.on('ready', async () => {
324
+ session.defaultSession.clearCache().then(() => {
325
+ log.info('Cache cleared!');
326
+ });
327
+ });
328
+
329
+ app.on('will-quit', () => {
330
+ // Unregister a shortcut.
331
+ globalShortcut.unregister(config?.shortCuts?.devTools);
332
+
333
+ // Unregister all shortcuts.
334
+ globalShortcut.unregisterAll();
335
+ });
@@ -0,0 +1,21 @@
1
+ -----BEGIN CERTIFICATE-----
2
+ MIIDajCCAlKgAwIBAgIJAJrliUVEXNDeMA0GCSqGSIb3DQEBCwUAMCQxEDAOBgNV
3
+ BAsMB0JpdEhpZGUxEDAOBgNVBAMMB0JpdEhpZGUwHhcNMjQwMTE2MTE1ODAxWhcN
4
+ MzQwMTEzMTE1ODAxWjAkMRAwDgYDVQQLDAdCaXRIaWRlMRAwDgYDVQQDDAdCaXRI
5
+ aWRlMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAulwiwQsTls1dv52t
6
+ UeZWLMIEfiUxvz3VCl6tmtbNEZKgXw+l8lyGxBgLWXVek6nUIk4/eXhSwa0YeOms
7
+ Z3gn7yi+nknMPx24Av6+kJG6GShEOHDynf6a3GADffwI5oXiluWh+EW6ZEm4CsfV
8
+ vAiQwUM7pUROy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= require('./default-assets.js');
2
+
3
+ const size = {
4
+ defaultWidth: 1366,
5
+ defaultHeight: 768,
6
+ resizeWidthFactor: 0.5,
7
+ resizeHeightFactor: 0.75,
8
+ };
9
+
10
+ const platforms = {
11
+ WINDOWS: 'WINDOWS',
12
+ MAC: 'MAC',
13
+ LINUX: 'LINUX',
14
+ SUN: 'SUN',
15
+ OPENBSD: 'OPENBSD',
16
+ ANDROID: 'ANDROID',
17
+ AIX: 'AIX',
18
+ };
19
+
20
+ const platformsNames = {
21
+ win32: platforms.WINDOWS,
22
+ darwin: platforms.MAC,
23
+ linux: platforms.LINUX,
24
+ sunos: platforms.SUN,
25
+ openbsd: platforms.OPENBSD,
26
+ android: platforms.ANDROID,
27
+ aix: platforms.AIX,
28
+ };
29
+
30
+ const config = {
31
+ mainWindow: {
32
+ width: size.defaultWidth,
33
+ height: size.defaultHeight,
34
+ center: true,
35
+ useContentSize: true,
36
+ minWidth: Math.floor(size.defaultWidth * size.resizeWidthFactor),
37
+ minHeight: Math.floor(size.defaultHeight * size.resizeHeightFactor),
38
+ title: 'Wallet',
39
+ },
40
+ provider: 'generic',
41
+ updaterCacheDirName: 'wallet-updater',
42
+ storageNames: {
43
+ lang: 'lang',
44
+ domain: 'domain_server',
45
+ },
46
+ updatesPath: 'Updates/UI/',
47
+ updatesLocalPath: '../../',
48
+ updatesPathForPlatform: {
49
+ WINDOWS: 'Updates/UI/Windows/',
50
+ MAC: 'Updates/UI/MacOS/',
51
+ LINUX: 'Updates/UI/Linux/',
52
+ SUN: 'Updates/UI/',
53
+ OPENBSD: 'Updates/UI/',
54
+ ANDROID: 'Updates/UI/',
55
+ AIX: 'Updates/UI/',
56
+ },
57
+ updatesFileName: 'app-update.yml',
58
+ isEnableDevTools: false,
59
+ isAvailableDomainInput: true,
60
+ isEnableWhiteLabelUpdater: true,
61
+ certificate: {
62
+ dir: 'electron-configuration',
63
+ fileName: 'BitHideRoot.crt',
64
+ fileNameSecondary: 'Wallet.crt',
65
+ },
66
+ macUpdateConfig: {
67
+ installerName: 'installer.dmg',
68
+ manualMap: {
69
+ en: 'installing_guide_en.pdf',
70
+ ru: 'installing_guide_ru.pdf',
71
+ uk: 'installing_guide_ua.pdf',
72
+ },
73
+ },
74
+ shortCuts: {
75
+ devTools: 'CommandOrControl+Shift+I',
76
+ },
77
+ };
78
+
79
+ const whiteLabelUpdaterConfiguration = {
80
+ cacheDirName: 'wl-cache',
81
+ timeOutMs: 5000,
82
+ defaultResult: {
83
+ version: '0',
84
+ enabled: true,
85
+ productName: 'Wallet',
86
+ creditCurrency: 'Credits',
87
+ assets: { ...defaultAssets.defaultAssets },
88
+ },
89
+ systemDir: 'userData',
90
+ internalAssetsDir: '/Updates/UI/White-Label/assets/',
91
+ configFileName: 'config.json',
92
+ assetFiles: [
93
+ 'logo-dark.svg',
94
+ 'logo-light.svg',
95
+ 'favicon.png',
96
+ 'icon.ico',
97
+ 'icon.png',
98
+ ],
99
+ localStorageConfigName: 'whiteLabelConfig',
100
+ tempIconPrefix: 'app-icon-',
101
+ desktopDir: 'Desktop',
102
+ fileExtension: {
103
+ ico: 'ico',
104
+ svg: 'svg',
105
+ png: 'png',
106
+ jpg: 'jpg',
107
+ jpeg: 'jpeg',
108
+ lnk: 'lnk',
109
+ base64: 'base64',
110
+ tmp: 'tmp',
111
+ json: 'json',
112
+ },
113
+ imageSize: { width: 256, height: 256 },
114
+ };
115
+
116
+ module.exports = {
117
+ config,
118
+ platforms,
119
+ platformsNames,
120
+ whiteLabelUpdaterConfiguration,
121
+ };
@@ -0,0 +1,120 @@
1
+ const defaultAssets = require('./default-assets.js');
2
+
3
+ const size = {
4
+ defaultWidth: 1366,
5
+ defaultHeight: 768,
6
+ resizeWidthFactor: 0.5,
7
+ resizeHeightFactor: 0.75,
8
+ };
9
+
10
+ const platforms = {
11
+ WINDOWS: 'WINDOWS',
12
+ MAC: 'MAC',
13
+ LINUX: 'LINUX',
14
+ SUN: 'SUN',
15
+ OPENBSD: 'OPENBSD',
16
+ ANDROID: 'ANDROID',
17
+ AIX: 'AIX',
18
+ };
19
+
20
+ const platformsNames = {
21
+ win32: platforms.WINDOWS,
22
+ darwin: platforms.MAC,
23
+ linux: platforms.LINUX,
24
+ sunos: platforms.SUN,
25
+ openbsd: platforms.OPENBSD,
26
+ android: platforms.ANDROID,
27
+ aix: platforms.AIX,
28
+ };
29
+
30
+ const config = {
31
+ mainWindow: {
32
+ width: size.defaultWidth,
33
+ height: size.defaultHeight,
34
+ center: true,
35
+ useContentSize: true,
36
+ minWidth: Math.floor(size.defaultWidth * size.resizeWidthFactor),
37
+ minHeight: Math.floor(size.defaultHeight * size.resizeHeightFactor),
38
+ title: 'Wallet',
39
+ },
40
+ provider: 'generic',
41
+ updaterCacheDirName: 'wallet-updater',
42
+ storageNames: {
43
+ lang: 'lang',
44
+ domain: 'domain_server',
45
+ },
46
+ updatesPath: 'Updates/UI/',
47
+ updatesLocalPath: '../../',
48
+ updatesPathForPlatform: {
49
+ WINDOWS: 'Updates/UI/Windows/',
50
+ MAC: 'Updates/UI/MacOS/',
51
+ LINUX: 'Updates/UI/Linux/',
52
+ SUN: 'Updates/UI/',
53
+ OPENBSD: 'Updates/UI/',
54
+ ANDROID: 'Updates/UI/',
55
+ AIX: 'Updates/UI/',
56
+ },
57
+ updatesFileName: 'app-update.yml',
58
+ isEnableDevTools: false,
59
+ isAvailableDomainInput: true,
60
+ certificate: {
61
+ dir: 'electron-configuration',
62
+ fileName: 'BitHideRoot.crt',
63
+ fileNameSecondary: 'Wallet.crt',
64
+ },
65
+ macUpdateConfig: {
66
+ installerName: 'installer.dmg',
67
+ manualMap: {
68
+ en: 'installing_guide_en.pdf',
69
+ ru: 'installing_guide_ru.pdf',
70
+ uk: 'installing_guide_ua.pdf',
71
+ },
72
+ },
73
+ shortCuts: {
74
+ devTools: 'CommandOrControl+Shift+I',
75
+ },
76
+ };
77
+
78
+ const whiteLabelUpdaterConfiguration = {
79
+ cacheDirName: 'wl-cache',
80
+ timeOutMs: 5000,
81
+ defaultResult: {
82
+ version: '0',
83
+ enabled: true,
84
+ productName: 'Wallet',
85
+ creditCurrency: 'Credits',
86
+ assets: { ...defaultAssets.defaultAssets },
87
+ },
88
+ systemDir: 'userData',
89
+ internalAssetsDir: '/Updates/UI/White-Label/assets/',
90
+ configFileName: 'config.json',
91
+ assetFiles: [
92
+ 'logo-dark.svg',
93
+ 'logo-light.svg',
94
+ 'favicon.png',
95
+ 'icon.ico',
96
+ 'icon.png',
97
+ ],
98
+ localStorageConfigName: 'whiteLabelConfig',
99
+ tempIconPrefix: 'app-icon-',
100
+ desktopDir: 'Desktop',
101
+ fileExtension: {
102
+ ico: 'ico',
103
+ svg: 'svg',
104
+ png: 'png',
105
+ jpg: 'jpg',
106
+ jpeg: 'jpeg',
107
+ lnk: 'lnk',
108
+ base64: 'base64',
109
+ tmp: 'tmp',
110
+ json: 'json',
111
+ },
112
+ imageSize: { width: 256, height: 256 },
113
+ };
114
+
115
+ module.exports = {
116
+ config,
117
+ platforms,
118
+ platformsNames,
119
+ whiteLabelUpdaterConfiguration,
120
+ };