@plasosdk/plaso-electron-sdk 1.1.7 → 1.1.9

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.
package/README.md CHANGED
@@ -355,7 +355,7 @@ type onSaveBoardFn = (
355
355
 
356
356
  fileInfo 格式如下:
357
357
 
358
- ![img](./lib/image/备课1.png)
358
+ ![img](./image/备课1.png)
359
359
 
360
360
 
361
361
 
package/js/main.js CHANGED
@@ -5,7 +5,7 @@ if (isElectron) {
5
5
  require('@plasosdk/screenshot');
6
6
  require('@plasosdk/rtmpplayer');
7
7
 
8
- const { RENDER_TO_MAIN_MESG_TYPE } = require('./code');
8
+ const { RENDER_TO_MAIN_MESG_TYPE } = require('./macro');
9
9
 
10
10
  const { app, ipcMain, crashReporter } = require('electron');
11
11
 
package/js/render.js CHANGED
@@ -1,6 +1,6 @@
1
1
  const LogFormatter = require('../scripts/logger');
2
2
  const path = require('path');
3
- const { getElectronRemote, parseUrlParams, getEnvironment, getDisplayMatching } = require('./common');
3
+ const { getElectronRemote, parseUrlParams, getEnvironment, getDisplayMatching } = require('./util');
4
4
  const remote = getElectronRemote();
5
5
  const defaultLoggerPath = remote ? path.join(remote.app.getPath('userData'), '/P403FileTemp/') : '';
6
6
 
@@ -12,7 +12,7 @@ const { platform } = getConfig();
12
12
 
13
13
  const isMac = platform === 'darwin';
14
14
 
15
- const { ERROR_CODE, LESSON_TYPE, CLASS_WINDOW_MESG_TYPE, RENDER_TO_MAIN_MESG_TYPE, FILE_TYPE } = require('./code');
15
+ const { ERROR_CODE, LESSON_TYPE, CLASS_WINDOW_MESG_TYPE, RENDER_TO_MAIN_MESG_TYPE, FILE_TYPE } = require('./macro');
16
16
 
17
17
 
18
18
  let currentWinId = null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plasosdk/plaso-electron-sdk",
3
- "version": "1.1.7",
3
+ "version": "1.1.9",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -8,9 +8,17 @@ const { exec, execSync } = require('child_process');
8
8
  const AdmZip = require('adm-zip');
9
9
 
10
10
  const getConfig = require('./getConfig');
11
+
11
12
  const LogFormatter = require('./logger');
12
13
  const logger = new LogFormatter();
13
14
 
15
+ const minimist = require('minimist');
16
+ const { INIT_CWD } = minimist(process.argv.slice(2), {
17
+ string: ['INIT_CWD'],
18
+ default: {},
19
+ });
20
+ logger.info(`pass INIT_CWD ${INIT_CWD}`);
21
+
14
22
  const { platform, packageVersion, arch } = getConfig();
15
23
 
16
24
  const agora_electron_sdk_v4_x32_in_win32 =
@@ -43,19 +51,21 @@ const ARCH_TYPE = {
43
51
  const oldTrtcPath = path.join(__dirname, '../node_modules', 'trtc-electron-sdk');
44
52
  const newTrtcPath = path.join(__dirname, '../../../', 'trtc-electron-sdk');
45
53
 
46
- const getFlameshotURL = () => {
47
- let flameshotZipName = 'win_flameshot';
48
- let flameshotZipUrl = 'https://hz-public-files.oss-cn-hangzhou.aliyuncs.com/static/flameshot/win_flameshot.zip';
54
+ const electron_sdk_plugins_dir = 'https://wwwr.plaso.cn/static/cdn/electron-sdk-plugins/';
55
+
56
+ const getPluginsZipName = () => {
57
+ let flameshotZipName = 'flameshot_win.zip';
58
+ let lameZipName = 'lame_win.zip';
59
+ const plasoALDZipName = 'PlasoALD.zip';
49
60
  if (platform === PLATFORM_TYPE.DARWIN) {
61
+ lameZipName = 'lame_mac_x64.zip';
50
62
  if (arch.includes('arm')) {
51
- flameshotZipName = 'arm64_flameshot.app';
52
- flameshotZipUrl = 'https://hz-public-files.oss-cn-hangzhou.aliyuncs.com/static/flameshot/arm64_flameshot.app.zip';
63
+ flameshotZipName = 'flameshot_mac_arm64.zip';
53
64
  } else {
54
- flameshotZipName = 'x64_flameshot.app';
55
- flameshotZipUrl = 'https://hz-public-files.oss-cn-hangzhou.aliyuncs.com/static/flameshot/x64_flameshot.app.zip';
65
+ flameshotZipName = 'flameshot_mac_x64.zip';
56
66
  }
57
67
  }
58
- return [flameshotZipUrl, flameshotZipName];
68
+ return { flameshotZipName, lameZipName, plasoALDZipName };
59
69
  };
60
70
 
61
71
  const installCb = (url, reInstallCb, error, stdout, stderr) => {
@@ -84,7 +94,7 @@ const npmInstall = () => {
84
94
  installCb(agora_electron_sdk_v4, installAgora, error, stdout, stderr);
85
95
  if (!error?.message) {
86
96
  const oldAgoraV4Path = path.join(__dirname, '../node_modules', 'agora-electron-sdk');
87
- const newAgoraV4Path = path.join(__dirname, '../../../', 'agora-electron-sdk-v4');
97
+ const newAgoraV4Path = path.join(INIT_CWD, 'node_modules', 'agora-electron-sdk-v4');
88
98
  fs.move(oldAgoraV4Path, newAgoraV4Path, { overwrite: true }, (err) => {
89
99
  if (!err) {
90
100
  logger.info('更新agora_electron_sdk_v4成功');
@@ -119,48 +129,52 @@ const npmInstall = () => {
119
129
  // });
120
130
  };
121
131
 
122
- const downloadFile = (fileUrl, downloadFilePath, outputFilePath) => {
123
- logger.info(`will downloadFile: ${fileUrl}, downloadFilePath is ${downloadFilePath}, outputFilePath is ${outputFilePath}`);
132
+ const downloadFile = (zipFileName, localDir) => {
133
+ const remoteZipFilePath = `${electron_sdk_plugins_dir}${zipFileName}`;
134
+ const localZipFilePath = path.join(localDir, zipFileName);
135
+ logger.info(`will download ${zipFileName} to ${localZipFilePath}`);
124
136
  https
125
- .get(fileUrl, (response) => {
126
- const file = fs.createWriteStream(downloadFilePath);
137
+ .get(remoteZipFilePath, (response) => {
138
+ const file = fs.createWriteStream(localZipFilePath);
127
139
  response.pipe(file);
128
140
  file.on('finish', () => {
129
141
  file.close(() => {
130
- logger.info(`文件${fileUrl}写入完成`);
142
+ logger.info(`文件${zipFileName}写入完成`);
131
143
  // 解压缩
132
- if (outputFilePath) {
133
- if(platform === PLATFORM_TYPE.DARWIN){
134
- execSync(`unzip -o ${downloadFilePath} -d ${outputFilePath}`)
135
- }else{
136
- const zip = new AdmZip(downloadFilePath);
137
- zip.extractAllTo(outputFilePath, true);
138
- }
139
- fs.unlink(downloadFilePath, () => {});
140
- logger.info(`文件${fileUrl}解压完成`);
144
+ if (platform === PLATFORM_TYPE.DARWIN) {
145
+ execSync(`unzip -o ${localZipFilePath} -d ${localDir}`);
146
+ } else {
147
+ const zip = new AdmZip(localZipFilePath);
148
+ zip.extractAllTo(localDir, true);
141
149
  }
150
+ fs.unlink(localZipFilePath, () => {});
151
+ logger.info(`文件${zipFileName}解压完成`);
142
152
  });
143
153
  });
144
154
  })
145
155
  .on('error', (err) => {
146
156
  // 删除不完整的文件
147
- fs.unlink(downloadFilePath, () => {});
148
- logger.error(`文件${fileUrl}下载失败,删除不完整的文件`, err.message);
157
+ fs.unlink(localZipFilePath, () => {});
158
+ logger.error(`download ${zipFileName} failed, delete it`, err.message);
149
159
  });
150
160
  };
151
161
 
152
162
  const downloadPrebuild = async () => {
153
- npmInstall();
154
-
155
- const [flameshotUrl, flameshotZipName] = getFlameshotURL();
156
-
157
- /** start download */
158
163
  logger.info('Package Version: %s', packageVersion);
159
164
  logger.info('Platform: %s', platform);
160
165
  if (arch) logger.info('Arch: %s', arch);
161
- const flameshotFilePath = path.join(__dirname, `../lib/${flameshotZipName}.zip`);
162
- const flameshotZipOutputDir = path.join(__dirname, '../lib');
163
166
 
164
- downloadFile(flameshotUrl, flameshotFilePath, flameshotZipOutputDir);
167
+ npmInstall();
168
+
169
+ const { flameshotZipName, plasoALDZipName } = getPluginsZipName();
170
+ const localPluginsDir = path.join(__dirname, '../lib');
171
+ if (!fs.existsSync(localPluginsDir)) {
172
+ fs.mkdirSync(localPluginsDir);
173
+ }
174
+ downloadFile(flameshotZipName, localPluginsDir);
175
+ if (platform === PLATFORM_TYPE.DARWIN) {
176
+ downloadFile(plasoALDZipName, localPluginsDir);
177
+ }
165
178
  };
179
+
166
180
  downloadPrebuild();
@@ -1,21 +1,10 @@
1
1
 
2
- const LogFormatter = require('./logger');
3
- const path = require('path');
4
-
5
- const minimist = require('minimist');
6
- const logger = new LogFormatter();
7
-
8
-
9
- const { INIT_CWD } = minimist(process.argv.slice(2));
10
- logger.info(`pass INIT_CWD ${INIT_CWD}`);
11
- logger.info(`__dirname ${__dirname}`);
12
-
13
2
  const getConfig = () => {
3
+ const path = require('path');
14
4
  const { version } = require(path.join(__dirname, '../package.json'));
15
- var os = require('os');
5
+ const os = require('os');
16
6
  const platform = process.env.npm_config_plaso_electron_sdk_platform || os.platform();
17
7
  const arch = process.env.npm_config_plaso_electron_sdk_arch || os.arch();
18
- logger.info(`platform is ${platform}, arch is ${arch}`);
19
8
 
20
9
  return {
21
10
  platform,
@@ -23,4 +12,5 @@ const getConfig = () => {
23
12
  packageVersion: version,
24
13
  };
25
14
  };
15
+
26
16
  module.exports = getConfig;
package/scripts/logger.js CHANGED
@@ -1,4 +1,4 @@
1
- const { LEVEL } = require('../js/code');
1
+ const { LEVEL } = require('../js/macro');
2
2
  const LEVEL_FORMAT_LENGTH = Math.max(...Object.keys(LEVEL).map((key) => key.length)) + 1;
3
3
 
4
4
  class LogFormatter {
@@ -1,60 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
- <plist version="1.0">
4
- <dict>
5
- <key>BuildMachineOSBuild</key>
6
- <string>22G120</string>
7
- <key>CFBundleDevelopmentRegion</key>
8
- <string>English</string>
9
- <key>CFBundleExecutable</key>
10
- <string>PlasoALD</string>
11
- <key>CFBundleIdentifier</key>
12
- <string>io.agora.audioloopback</string>
13
- <key>CFBundleInfoDictionaryVersion</key>
14
- <string>6.0</string>
15
- <key>CFBundleName</key>
16
- <string>PlasoALD</string>
17
- <key>CFBundlePackageType</key>
18
- <string>BNDL</string>
19
- <key>CFBundleShortVersionString</key>
20
- <string>1.0.1</string>
21
- <key>CFBundleSignature</key>
22
- <string>????</string>
23
- <key>CFBundleSupportedPlatforms</key>
24
- <array>
25
- <string>MacOSX</string>
26
- </array>
27
- <key>CFBundleVersion</key>
28
- <string>1</string>
29
- <key>CFPlugInFactories</key>
30
- <dict>
31
- <key>99A15A8B-DA3C-42C3-BD5D-D035A0C2488B</key>
32
- <string>AgoraALD_Create</string>
33
- </dict>
34
- <key>CFPlugInTypes</key>
35
- <dict>
36
- <key>443ABAB8-E7B3-491A-B985-BEB9187030DB</key>
37
- <array>
38
- <string>99A15A8B-DA3C-42C3-BD5D-D035A0C2488B</string>
39
- </array>
40
- </dict>
41
- <key>DTCompiler</key>
42
- <string>com.apple.compilers.llvm.clang.1_0</string>
43
- <key>DTPlatformBuild</key>
44
- <string></string>
45
- <key>DTPlatformName</key>
46
- <string>macosx</string>
47
- <key>DTPlatformVersion</key>
48
- <string>14.2</string>
49
- <key>DTSDKBuild</key>
50
- <string>23C53</string>
51
- <key>DTSDKName</key>
52
- <string>macosx14.2</string>
53
- <key>DTXcode</key>
54
- <string>1520</string>
55
- <key>DTXcodeBuild</key>
56
- <string>15C500b</string>
57
- <key>LSMinimumSystemVersion</key>
58
- <string>10.10</string>
59
- </dict>
60
- </plist>
@@ -1,139 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
- <plist version="1.0">
4
- <dict>
5
- <key>files</key>
6
- <dict>
7
- <key>Resources/en.lproj/Localizable.strings</key>
8
- <dict>
9
- <key>hash</key>
10
- <data>
11
- aI7+tBMa+Z7cUeSmCY117BTN0ss=
12
- </data>
13
- <key>optional</key>
14
- <true/>
15
- </dict>
16
- </dict>
17
- <key>files2</key>
18
- <dict>
19
- <key>Resources/en.lproj/Localizable.strings</key>
20
- <dict>
21
- <key>hash</key>
22
- <data>
23
- aI7+tBMa+Z7cUeSmCY117BTN0ss=
24
- </data>
25
- <key>hash2</key>
26
- <data>
27
- NIkKaq8G8yOoz4aKtnScbCvPzN7ObfJM2z1AEz2UsEY=
28
- </data>
29
- <key>optional</key>
30
- <true/>
31
- </dict>
32
- </dict>
33
- <key>rules</key>
34
- <dict>
35
- <key>^Resources/</key>
36
- <true/>
37
- <key>^Resources/.*\.lproj/</key>
38
- <dict>
39
- <key>optional</key>
40
- <true/>
41
- <key>weight</key>
42
- <real>1000</real>
43
- </dict>
44
- <key>^Resources/.*\.lproj/locversion.plist$</key>
45
- <dict>
46
- <key>omit</key>
47
- <true/>
48
- <key>weight</key>
49
- <real>1100</real>
50
- </dict>
51
- <key>^Resources/Base\.lproj/</key>
52
- <dict>
53
- <key>weight</key>
54
- <real>1010</real>
55
- </dict>
56
- <key>^version.plist$</key>
57
- <true/>
58
- </dict>
59
- <key>rules2</key>
60
- <dict>
61
- <key>.*\.dSYM($|/)</key>
62
- <dict>
63
- <key>weight</key>
64
- <real>11</real>
65
- </dict>
66
- <key>^(.*/)?\.DS_Store$</key>
67
- <dict>
68
- <key>omit</key>
69
- <true/>
70
- <key>weight</key>
71
- <real>2000</real>
72
- </dict>
73
- <key>^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/</key>
74
- <dict>
75
- <key>nested</key>
76
- <true/>
77
- <key>weight</key>
78
- <real>10</real>
79
- </dict>
80
- <key>^.*</key>
81
- <true/>
82
- <key>^Info\.plist$</key>
83
- <dict>
84
- <key>omit</key>
85
- <true/>
86
- <key>weight</key>
87
- <real>20</real>
88
- </dict>
89
- <key>^PkgInfo$</key>
90
- <dict>
91
- <key>omit</key>
92
- <true/>
93
- <key>weight</key>
94
- <real>20</real>
95
- </dict>
96
- <key>^Resources/</key>
97
- <dict>
98
- <key>weight</key>
99
- <real>20</real>
100
- </dict>
101
- <key>^Resources/.*\.lproj/</key>
102
- <dict>
103
- <key>optional</key>
104
- <true/>
105
- <key>weight</key>
106
- <real>1000</real>
107
- </dict>
108
- <key>^Resources/.*\.lproj/locversion.plist$</key>
109
- <dict>
110
- <key>omit</key>
111
- <true/>
112
- <key>weight</key>
113
- <real>1100</real>
114
- </dict>
115
- <key>^Resources/Base\.lproj/</key>
116
- <dict>
117
- <key>weight</key>
118
- <real>1010</real>
119
- </dict>
120
- <key>^[^/]+$</key>
121
- <dict>
122
- <key>nested</key>
123
- <true/>
124
- <key>weight</key>
125
- <real>10</real>
126
- </dict>
127
- <key>^embedded\.provisionprofile$</key>
128
- <dict>
129
- <key>weight</key>
130
- <real>20</real>
131
- </dict>
132
- <key>^version\.plist$</key>
133
- <dict>
134
- <key>weight</key>
135
- <real>20</real>
136
- </dict>
137
- </dict>
138
- </dict>
139
- </plist>
@@ -1 +0,0 @@
1
- do shell script "sudo cp -av ./PlasoALD.driver /Library/Audio/Plug-Ins/HAL/ && sudo kill -9 `ps ax|grep 'coreaudio[a-z]' |awk '{print $1}'` " with administrator privileges with prompt "如果需要录课或共享电脑声音,请输入您的电脑密码用以安装音频驱动"
package/lib/lame/lame DELETED
Binary file
package/lib/lame/lame.exe DELETED
Binary file
File without changes
File without changes