123-lang 2.1.17 → 2.1.18

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 (27) hide show
  1. package/package.json +1 -1
  2. package/source/Customization/electron/{last → electron-configuration}/electron-configuration/configuration.js +3 -9
  3. package/source/Customization/electron/{last → electron-configuration}/electron-configuration/modules/WhiteLabelUpdater.js +36 -24
  4. package/source/Customization/electron/electron-configuration/electron-configuration/store/store.js +6 -0
  5. package/source/Customization/electron/electron.js +42 -42
  6. package/source/Customization/electron/electron-configuration/configuration.js +0 -121
  7. package/source/Customization/electron/electron-configuration/configuration_.js +0 -120
  8. package/source/Customization/electron/electron-configuration/modules/WhiteLabelUpdater.js +0 -248
  9. package/source/Customization/electron/last/electron-configuration/BitHideRoot.crt +0 -21
  10. package/source/Customization/electron/last/electron-configuration/Wallet.crt +0 -20
  11. package/source/Customization/electron/last/electron-configuration/configuration_.js +0 -120
  12. package/source/Customization/electron/last/electron-configuration/default-assets.js +0 -16
  13. package/source/Customization/electron/last/electron-configuration/messages.js +0 -41
  14. package/source/Customization/electron/last/electron-configuration/modules/WhiteLabelUpdater /342/200/223 default.js" +0 -259
  15. package/source/Customization/electron/last/electron.js +0 -335
  16. package/source/Customization/electron/updated/electron-configuration/BitHideRoot.crt +0 -21
  17. package/source/Customization/electron/updated/electron-configuration/Wallet.crt +0 -20
  18. package/source/Customization/electron/updated/electron-configuration/configuration.js +0 -121
  19. package/source/Customization/electron/updated/electron-configuration/configuration_.js +0 -120
  20. package/source/Customization/electron/updated/electron-configuration/default-assets.js +0 -16
  21. package/source/Customization/electron/updated/electron-configuration/messages.js +0 -41
  22. package/source/Customization/electron/updated/electron-configuration/modules/WhiteLabelUpdater.js +0 -259
  23. package/source/Customization/electron/updated/electron.js +0 -357
  24. /package/source/Customization/electron/electron-configuration/{BitHideRoot.crt → electron-configuration/Root.crt} +0 -0
  25. /package/source/Customization/electron/electron-configuration/{Wallet.crt → electron-configuration/Wallet.crt} +0 -0
  26. /package/source/Customization/electron/electron-configuration/{default-assets.js → electron-configuration/default-assets.js} +0 -0
  27. /package/source/Customization/electron/electron-configuration/{messages.js → electron-configuration/messages.js} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "123-lang",
3
- "version": "2.1.17",
3
+ "version": "2.1.18",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -60,7 +60,7 @@ const config = {
60
60
  isEnableWhiteLabelUpdater: true,
61
61
  certificate: {
62
62
  dir: 'electron-configuration',
63
- fileName: 'BitHideRoot.crt',
63
+ fileName: 'Root.crt',
64
64
  fileNameSecondary: 'Wallet.crt',
65
65
  },
66
66
  macUpdateConfig: {
@@ -83,19 +83,13 @@ const whiteLabelUpdaterConfiguration = {
83
83
  version: '0',
84
84
  enabled: true,
85
85
  productName: 'Wallet',
86
- creditCurrency: 'Credits',
86
+ creditCurrency: 'Service Units',
87
87
  assets: { ...defaultAssets.defaultAssets },
88
88
  },
89
89
  systemDir: 'userData',
90
90
  internalAssetsDir: 'Updates/UI/White-Label/assets/',
91
91
  configFileName: 'config.json',
92
- assetFiles: [
93
- 'logo-dark.svg',
94
- 'logo-light.svg',
95
- 'favicon.png',
96
- 'icon.ico',
97
- 'icon.png',
98
- ],
92
+ assetFiles: ['logo-dark.svg', 'logo-light.svg', 'favicon.png', 'icon.ico', 'icon.png'],
99
93
  localStorageConfigName: 'whiteLabelConfig',
100
94
  tempIconPrefix: 'app-icon-',
101
95
  desktopDir: 'Desktop',
@@ -5,8 +5,13 @@ const log = require('electron-log');
5
5
  const { localStorage } = require('electron-browser-storage');
6
6
  const os = require('os');
7
7
  const axios = require('axios');
8
+ const https = require('https');
9
+ const store = require('../store/store.js');
8
10
 
9
11
  const { whiteLabelUpdaterConfiguration, config } = require('../configuration');
12
+ const agent = new https.Agent({
13
+ rejectUnauthorized: false,
14
+ });
10
15
 
11
16
  class WhiteLabelUpdater {
12
17
  constructor() {
@@ -15,15 +20,16 @@ class WhiteLabelUpdater {
15
20
 
16
21
  async initStore() {
17
22
  try {
18
- const { default: Store } = await import('electron-store');
19
- let store = new Store();
20
23
  if (!store?.has('cache')) {
21
24
  store.set('cache.default', {
22
25
  ...whiteLabelUpdaterConfiguration?.defaultResult,
23
26
  });
27
+ } else {
28
+ store.set('cache.default', {
29
+ ...whiteLabelUpdaterConfiguration?.defaultResult,
30
+ });
24
31
  }
25
32
  log.info('[WL] Store was created successful');
26
- this.store = store;
27
33
  } catch (err) {
28
34
  log.error('[WL] There is some error on Store creation', err);
29
35
  }
@@ -31,7 +37,7 @@ class WhiteLabelUpdater {
31
37
 
32
38
  async checkLoginDomain() {
33
39
  try {
34
- const domainURL = await localStorage.getItem(config.storageNames.domain);
40
+ const domainURL = store.get('domain');
35
41
  log.info('[WL] Domain checked', domainURL);
36
42
  return domainURL;
37
43
  } catch (err) {
@@ -62,17 +68,22 @@ class WhiteLabelUpdater {
62
68
  try {
63
69
  log.info(
64
70
  '[WL] fetch data',
65
- `${domain}${whiteLabelUpdaterConfiguration?.internalAssetsDir}${whiteLabelUpdaterConfiguration?.configFileName}`,
71
+ `${domain}${whiteLabelUpdaterConfiguration?.internalAssetsDir}${whiteLabelUpdaterConfiguration?.configFileName}`
66
72
  );
67
73
  const res = await axios.get(
68
74
  `${domain}${whiteLabelUpdaterConfiguration?.internalAssetsDir}${whiteLabelUpdaterConfiguration?.configFileName}`,
69
- { timeout: whiteLabelUpdaterConfiguration?.timeOutMs },
75
+ {
76
+ timeout: whiteLabelUpdaterConfiguration?.timeOutMs,
77
+ httpsAgent: agent,
78
+ }
70
79
  );
71
- if (res.status === 200) {
80
+ if (res.status === 200 && res.data.version) {
72
81
  log.info('[WL] response', res.status);
73
82
  const remoteConfig = res.data;
74
83
  log.info('[WL] remote config', remoteConfig);
75
84
  return remoteConfig;
85
+ } else {
86
+ return null;
76
87
  }
77
88
  } catch (err) {
78
89
  log.error('[WL] Server unavailable, using cache fallback.', err);
@@ -81,7 +92,7 @@ class WhiteLabelUpdater {
81
92
  }
82
93
 
83
94
  async fetchAssetsData(domain) {
84
- const assets = { ...this.store.get('cache.default.assets') };
95
+ const assets = { ...store.get('cache.default.assets') };
85
96
 
86
97
  const assetResults = await Promise.all(
87
98
  whiteLabelUpdaterConfiguration?.assetFiles?.map(async file => {
@@ -91,7 +102,8 @@ class WhiteLabelUpdater {
91
102
  {
92
103
  responseType: 'arraybuffer',
93
104
  timeout: whiteLabelUpdaterConfiguration?.timeOutMs,
94
- },
105
+ httpsAgent: agent,
106
+ }
95
107
  );
96
108
 
97
109
  const buffer = Buffer.from(res.data);
@@ -113,7 +125,7 @@ class WhiteLabelUpdater {
113
125
  log.error(`[WL] Failed to download asset: ${file}`, err.message);
114
126
  return null;
115
127
  }
116
- }),
128
+ })
117
129
  );
118
130
 
119
131
  assetResults.forEach(result => {
@@ -132,18 +144,18 @@ class WhiteLabelUpdater {
132
144
  const encodedDomain = this.encodeUrl(domain);
133
145
  const config = await this.fetchConfig(domain);
134
146
 
135
- if (this.store.has(`cache.${encodedDomain}`)) {
147
+ if (store.has(`cache.${encodedDomain}`)) {
136
148
  log.info('[WL] cache exists');
137
- const currentConfig = this.store.get(`cache.${encodedDomain}`);
149
+ const currentConfig = store.get(`cache.${encodedDomain}`);
138
150
  log.info(
139
151
  '[WL] compare caches: ',
140
152
  currentConfig?.version,
141
- config?.version,
153
+ config?.version
142
154
  );
143
155
  if (config !== null && config?.version > currentConfig?.version) {
144
156
  log.info('[WL] cache updating ...', domain);
145
157
  const remoteAssets = await this.fetchAssetsData(domain);
146
- this.store.set(`cache.${encodedDomain}`, {
158
+ store.set(`cache.${encodedDomain}`, {
147
159
  ...config,
148
160
  assets: { ...remoteAssets },
149
161
  });
@@ -153,7 +165,7 @@ class WhiteLabelUpdater {
153
165
  if (config !== null) {
154
166
  log.info('[WL] cache creating ...', domain);
155
167
  const remoteAssets = await this.fetchAssetsData(domain);
156
- this.store.set(`cache.${encodedDomain}`, {
168
+ store.set(`cache.${encodedDomain}`, {
157
169
  ...config,
158
170
  assets: { ...remoteAssets },
159
171
  });
@@ -163,9 +175,9 @@ class WhiteLabelUpdater {
163
175
 
164
176
  readCache(domain) {
165
177
  const encodedDomain = this.encodeUrl(domain);
166
- return this.store.has(`cache.${encodedDomain}`)
167
- ? this.store.get(`cache.${encodedDomain}`)
168
- : this.store.get('cache.default');
178
+ return store.has(`cache.${encodedDomain}`)
179
+ ? store.get(`cache.${encodedDomain}`)
180
+ : store.get('cache.default');
169
181
  }
170
182
 
171
183
  encodeUrl(url) {
@@ -176,7 +188,7 @@ class WhiteLabelUpdater {
176
188
 
177
189
  decodeUrl(hexString) {
178
190
  const bytes = new Uint8Array(
179
- hexString.match(/.{1,2}/g).map(byte => parseInt(byte, 16)),
191
+ hexString.match(/.{1,2}/g).map(byte => parseInt(byte, 16))
180
192
  );
181
193
  return new TextDecoder().decode(bytes);
182
194
  }
@@ -194,7 +206,7 @@ class WhiteLabelUpdater {
194
206
  try {
195
207
  await localStorage.setItem(
196
208
  whiteLabelUpdaterConfiguration?.localStorageConfigName,
197
- JSON.stringify(whiteLabelData),
209
+ JSON.stringify(whiteLabelData)
198
210
  );
199
211
  log.info('[WL] Info successful send to web localstorage');
200
212
  } catch (e) {
@@ -228,7 +240,7 @@ class WhiteLabelUpdater {
228
240
  if (
229
241
  file.startsWith(whiteLabelUpdaterConfiguration?.tempIconPrefix) &&
230
242
  file.endsWith(
231
- `.${whiteLabelUpdaterConfiguration?.fileExtension?.ico}`,
243
+ `.${whiteLabelUpdaterConfiguration?.fileExtension?.ico}`
232
244
  )
233
245
  ) {
234
246
  fs.unlinkSync(path.join(userDataPath, file));
@@ -238,13 +250,13 @@ class WhiteLabelUpdater {
238
250
  fs.writeFileSync(
239
251
  iconPath,
240
252
  cleanBase64,
241
- whiteLabelUpdaterConfiguration?.fileExtension?.base64,
253
+ whiteLabelUpdaterConfiguration?.fileExtension?.base64
242
254
  );
243
255
 
244
256
  const desktopPath = path.join(
245
257
  os.homedir(),
246
258
  whiteLabelUpdaterConfiguration?.desktopDir,
247
- `${config?.mainWindow?.title}.${whiteLabelUpdaterConfiguration?.fileExtension?.lnk}`,
259
+ `${config?.mainWindow?.title}.${whiteLabelUpdaterConfiguration?.fileExtension?.lnk}`
248
260
  );
249
261
 
250
262
  const success = shell.writeShortcutLink(desktopPath, 'replace', {
@@ -259,7 +271,7 @@ class WhiteLabelUpdater {
259
271
  fs.utimesSync(desktopPath, now, now);
260
272
 
261
273
  log.info(
262
- `[WL] Shortcut successfully replaced and redrawn with: ${uniqueIconName}`,
274
+ `[WL] Shortcut successfully replaced and redrawn with: ${uniqueIconName}`
263
275
  );
264
276
  } else {
265
277
  log.info('[WL] Failed to replace the shortcut.');
@@ -0,0 +1,6 @@
1
+ const Store = require('electron-store');
2
+
3
+ // You can optionally add a schema or default values here
4
+ const store = new Store();
5
+
6
+ module.exports = store;
@@ -22,6 +22,8 @@ const { autoUpdater } = require('electron-updater');
22
22
  const log = require('electron-log');
23
23
  const forge = require('node-forge');
24
24
  const os = require('os');
25
+ const whiteLabelUpdater = require('./electron-configuration/modules/WhiteLabelUpdater.js');
26
+ const store = require('./electron-configuration/store/store.js');
25
27
 
26
28
  const getLang = async () => localStorage.getItem(config.storageNames.lang);
27
29
 
@@ -30,12 +32,12 @@ const { isEnableDevTools, isAvailableDomainInput, certificate } = config;
30
32
  const rootCertificatePath = path.join(
31
33
  __dirname,
32
34
  certificate.dir,
33
- certificate.fileName,
35
+ certificate.fileName
34
36
  );
35
37
  const rootCertificatePathSecondary = path.join(
36
38
  __dirname,
37
39
  certificate.dir,
38
- certificate.fileNameSecondary,
40
+ certificate.fileNameSecondary
39
41
  );
40
42
 
41
43
  const currentPlatform = platformsNames[os.platform()];
@@ -51,33 +53,8 @@ autoUpdater.autoInstallOnAppQuit = currentPlatform !== platforms.MAC;
51
53
  // the app runs in a Wayland session.
52
54
  app.commandLine.appendSwitch('enable-features', 'GlobalShortcutsPortal');
53
55
 
54
- const serverUrl = 'http://localhost:3100/';
55
-
56
- async function createWindow() {
57
- let appIcon = null;
58
- if (config.isEnableWhiteLabelUpdater && !!config.isEnableWhiteLabelUpdater) {
59
- // White Labels
60
- const whiteLabelUpdater = require('./electron-configuration/modules/WhiteLabelUpdater.js');
61
-
62
- const wlConfig = await whiteLabelUpdater.getWhiteLabelData(serverUrl);
63
- appIcon = whiteLabelUpdater.createAppIcon(wlConfig?.assets['icon.png']);
64
-
65
- await whiteLabelUpdater.sendWhiteLabelDataForWeb(wlConfig);
66
-
67
- if (process.platform === 'win32' && wlConfig?.assets['icon.ico']) {
68
- whiteLabelUpdater?.updateShortcutWithBase64(wlConfig?.assets['icon.ico']);
69
- }
70
-
71
- try {
72
- if (process.platform === 'darwin') {
73
- app.dock.setIcon(appIcon);
74
- log.info('[WL][MAC] Icon successfully changed');
75
- }
76
- } catch (e) {
77
- log.error('[WL][MAC] Icon error', e);
78
- }
79
- }
80
-
56
+ async function createWindow(wlConfig) {
57
+ const appIcon = whiteLabelUpdater.createAppIcon(wlConfig?.assets['icon.png']);
81
58
  // Create the browser window.
82
59
  const win = new BrowserWindow({
83
60
  ...config.mainWindow,
@@ -87,6 +64,19 @@ async function createWindow() {
87
64
  nodeIntegration: true,
88
65
  },
89
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
+ }
90
80
 
91
81
  win.webContents.on('new-window', function (e, url) {
92
82
  e.preventDefault();
@@ -121,7 +111,7 @@ async function createWindow() {
121
111
  win.loadURL(
122
112
  isDev
123
113
  ? 'http://localhost:3000'
124
- : `file://${path.join(__dirname, '../build/index.html')}`,
114
+ : `file://${path.join(__dirname, '../build/index.html')}`
125
115
  );
126
116
 
127
117
  // Open the DevTools.
@@ -153,6 +143,7 @@ async function createWindow() {
153
143
  const generateUpdateConfig = async () => {
154
144
  let status = true;
155
145
  const domainURL = await localStorage.getItem(config.storageNames.domain);
146
+ store.set('domain', domainURL);
156
147
  // Test local server
157
148
  // const domainURL = `http://localhost:3100/`;
158
149
  if (!domainURL) {
@@ -194,14 +185,23 @@ async function createWindow() {
194
185
  autoUpdater.logger = log;
195
186
  autoUpdater.checkForUpdates();
196
187
  }
188
+
189
+ return win;
197
190
  }
198
191
 
199
192
  // This method will be called when Electron has finished
200
193
  // initialization and is ready to create browser windows.
201
194
  // Some APIs can only be used after this event occurs.
202
- app.whenReady().then(() => {
203
- createWindow();
204
-
195
+ app.whenReady().then(async () => {
196
+ if (config.isEnableWhiteLabelUpdater) {
197
+ const wlCache = await whiteLabelUpdater.getWhiteLabelStatus();
198
+ await whiteLabelUpdater.sendWhiteLabelDataForWeb(wlCache);
199
+
200
+ createWindow(wlCache);
201
+ await whiteLabelUpdater.runWhiteLabelUpdater();
202
+ } else {
203
+ createWindow();
204
+ }
205
205
  // MAC OS FIX: Re-create a window in the app when the dock icon is clicked
206
206
  app.on('activate', () => {
207
207
  if (BrowserWindow.getAllWindows().length === 0) createWindow();
@@ -240,12 +240,12 @@ autoUpdater.on('update-available', info => {
240
240
  dialog.showMessageBox(options).then(response => {
241
241
  if (response.response === 0) {
242
242
  shell.openExternal(
243
- `${updatesPath}${config?.macUpdateConfig?.installerName}`,
243
+ `${updatesPath}${config?.macUpdateConfig?.installerName}`
244
244
  );
245
245
  showInfoDialog(lang);
246
246
  } else if (response.response === 1) {
247
247
  shell.openExternal(
248
- `${updatesPath}${config?.macUpdateConfig?.manualMap[lang]}`,
248
+ `${updatesPath}${config?.macUpdateConfig?.manualMap[lang]}`
249
249
  );
250
250
  showInfoDialog(lang);
251
251
  }
@@ -296,32 +296,32 @@ app.on(
296
296
  try {
297
297
  const rootCertificateContent = fs.readFileSync(
298
298
  rootCertificatePath,
299
- 'utf8',
299
+ 'utf8'
300
300
  );
301
301
  const rootCertificateContentSecondary = fs.readFileSync(
302
302
  rootCertificatePathSecondary,
303
- 'utf8',
303
+ 'utf8'
304
304
  );
305
305
  const rootCert = forge.pki.certificateFromPem(rootCertificateContent);
306
306
  const rootCertSecondary = forge.pki.certificateFromPem(
307
- rootCertificateContentSecondary,
307
+ rootCertificateContentSecondary
308
308
  );
309
309
  const clientCert = forge.pki.certificateFromPem(
310
- certificate.data.toString(),
310
+ certificate.data.toString()
311
311
  );
312
312
  callback(
313
- clientCert.isIssuer(rootCert) || clientCert.isIssuer(rootCertSecondary),
313
+ clientCert.isIssuer(rootCert) || clientCert.isIssuer(rootCertSecondary)
314
314
  );
315
315
  } catch (e) {
316
316
  log.error('Certificate validation error:');
317
317
  log.error(e);
318
318
  callback(false);
319
319
  }
320
- },
320
+ }
321
321
  );
322
322
 
323
323
  // Clear Cache
324
- app.on('ready', () => {
324
+ app.on('ready', async () => {
325
325
  session.defaultSession.clearCache().then(() => {
326
326
  log.info('Cache cleared!');
327
327
  });
@@ -1,121 +0,0 @@
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
- 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
- };
@@ -1,120 +0,0 @@
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
- };