@plasosdk/plaso-electron-sdk 1.1.7 → 1.1.8

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.8",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -18,8 +18,7 @@
18
18
  "@plasosdk/screenshot": "^1.3.4",
19
19
  "@plasosdk/winproxy": "^1.1.5",
20
20
  "adm-zip": "^0.5.16",
21
- "fs-extra": "^11.1.1",
22
- "minimist": "^1.2.5"
21
+ "fs-extra": "^11.1.1"
23
22
  },
24
23
  "author": "",
25
24
  "license": "ISC"
@@ -8,9 +8,12 @@ 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
+ logger.info('cwd', process.cwd());
16
+
14
17
  const { platform, packageVersion, arch } = getConfig();
15
18
 
16
19
  const agora_electron_sdk_v4_x32_in_win32 =
@@ -43,19 +46,21 @@ const ARCH_TYPE = {
43
46
  const oldTrtcPath = path.join(__dirname, '../node_modules', 'trtc-electron-sdk');
44
47
  const newTrtcPath = path.join(__dirname, '../../../', 'trtc-electron-sdk');
45
48
 
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';
49
+ const electron_sdk_plugins_dir = 'https://wwwr.plaso.cn/static/cdn/electron-sdk-plugins/';
50
+
51
+ const getPluginsZipName = () => {
52
+ let flameshotZipName = 'flameshot_win.zip';
53
+ let lameZipName = 'lame_win.zip';
54
+ const plasoALDZipName = 'PlasoALD.zip';
49
55
  if (platform === PLATFORM_TYPE.DARWIN) {
56
+ lameZipName = 'lame_mac_x64.zip';
50
57
  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';
58
+ flameshotZipName = 'flameshot_mac_arm64.zip';
53
59
  } else {
54
- flameshotZipName = 'x64_flameshot.app';
55
- flameshotZipUrl = 'https://hz-public-files.oss-cn-hangzhou.aliyuncs.com/static/flameshot/x64_flameshot.app.zip';
60
+ flameshotZipName = 'flameshot_mac_x64.zip';
56
61
  }
57
62
  }
58
- return [flameshotZipUrl, flameshotZipName];
63
+ return { flameshotZipName, lameZipName, plasoALDZipName };
59
64
  };
60
65
 
61
66
  const installCb = (url, reInstallCb, error, stdout, stderr) => {
@@ -84,7 +89,7 @@ const npmInstall = () => {
84
89
  installCb(agora_electron_sdk_v4, installAgora, error, stdout, stderr);
85
90
  if (!error?.message) {
86
91
  const oldAgoraV4Path = path.join(__dirname, '../node_modules', 'agora-electron-sdk');
87
- const newAgoraV4Path = path.join(__dirname, '../../../', 'agora-electron-sdk-v4');
92
+ const newAgoraV4Path = path.join(process.cwd(), 'node_modules', 'agora-electron-sdk-v4');
88
93
  fs.move(oldAgoraV4Path, newAgoraV4Path, { overwrite: true }, (err) => {
89
94
  if (!err) {
90
95
  logger.info('更新agora_electron_sdk_v4成功');
@@ -119,48 +124,52 @@ const npmInstall = () => {
119
124
  // });
120
125
  };
121
126
 
122
- const downloadFile = (fileUrl, downloadFilePath, outputFilePath) => {
123
- logger.info(`will downloadFile: ${fileUrl}, downloadFilePath is ${downloadFilePath}, outputFilePath is ${outputFilePath}`);
127
+ const downloadFile = (zipFileName, localDir) => {
128
+ const remoteZipFilePath = `${electron_sdk_plugins_dir}${zipFileName}`;
129
+ const localZipFilePath = path.join(localDir, zipFileName);
130
+ logger.info(`will download ${zipFileName} to ${localZipFilePath}`);
124
131
  https
125
- .get(fileUrl, (response) => {
126
- const file = fs.createWriteStream(downloadFilePath);
132
+ .get(remoteZipFilePath, (response) => {
133
+ const file = fs.createWriteStream(localZipFilePath);
127
134
  response.pipe(file);
128
135
  file.on('finish', () => {
129
136
  file.close(() => {
130
- logger.info(`文件${fileUrl}写入完成`);
137
+ logger.info(`文件${zipFileName}写入完成`);
131
138
  // 解压缩
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}解压完成`);
139
+ if (platform === PLATFORM_TYPE.DARWIN) {
140
+ execSync(`unzip -o ${localZipFilePath} -d ${localDir}`);
141
+ } else {
142
+ const zip = new AdmZip(localZipFilePath);
143
+ zip.extractAllTo(localDir, true);
141
144
  }
145
+ fs.unlink(localZipFilePath, () => {});
146
+ logger.info(`文件${zipFileName}解压完成`);
142
147
  });
143
148
  });
144
149
  })
145
150
  .on('error', (err) => {
146
151
  // 删除不完整的文件
147
- fs.unlink(downloadFilePath, () => {});
148
- logger.error(`文件${fileUrl}下载失败,删除不完整的文件`, err.message);
152
+ fs.unlink(localZipFilePath, () => {});
153
+ logger.error(`download ${zipFileName} failed, delete it`, err.message);
149
154
  });
150
155
  };
151
156
 
152
157
  const downloadPrebuild = async () => {
153
- npmInstall();
154
-
155
- const [flameshotUrl, flameshotZipName] = getFlameshotURL();
156
-
157
- /** start download */
158
158
  logger.info('Package Version: %s', packageVersion);
159
159
  logger.info('Platform: %s', platform);
160
160
  if (arch) logger.info('Arch: %s', arch);
161
- const flameshotFilePath = path.join(__dirname, `../lib/${flameshotZipName}.zip`);
162
- const flameshotZipOutputDir = path.join(__dirname, '../lib');
163
161
 
164
- downloadFile(flameshotUrl, flameshotFilePath, flameshotZipOutputDir);
162
+ npmInstall();
163
+
164
+ const { flameshotZipName, plasoALDZipName } = getPluginsZipName();
165
+ const localPluginsDir = path.join(__dirname, '../lib');
166
+ if (!fs.existsSync(localPluginsDir)) {
167
+ fs.mkdirSync(localPluginsDir);
168
+ }
169
+ downloadFile(flameshotZipName, localPluginsDir);
170
+ if (platform === PLATFORM_TYPE.DARWIN) {
171
+ downloadFile(plasoALDZipName, localPluginsDir);
172
+ }
165
173
  };
174
+
166
175
  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