@walkerch/wxecho 1.0.2 → 1.0.4

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 (2) hide show
  1. package/dist/cli.js +20 -6
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -272,9 +272,18 @@ function detectWeChatDbDir() {
272
272
  const home = process.env.HOME || "";
273
273
  let bestDir = null;
274
274
  let bestMtime = 0;
275
- try {
276
- const xwechatRoot = path2.join(home, "Documents", "xwechat_files");
277
- if (!fs.existsSync(xwechatRoot)) return null;
275
+ const wechatContainerRoot = path2.join(
276
+ home,
277
+ "Library",
278
+ "Containers",
279
+ "com.tencent.xinWeChat",
280
+ "Data",
281
+ "Documents",
282
+ "xwechat_files"
283
+ );
284
+ const docsRoot = path2.join(home, "Documents", "xwechat_files");
285
+ for (const xwechatRoot of [wechatContainerRoot, docsRoot]) {
286
+ if (!fs.existsSync(xwechatRoot)) continue;
278
287
  const accounts = fs.readdirSync(xwechatRoot);
279
288
  for (const account of accounts) {
280
289
  const dbStorage = path2.join(xwechatRoot, account, "db_storage");
@@ -286,12 +295,10 @@ function detectWeChatDbDir() {
286
295
  bestMtime = mtime;
287
296
  bestDir = dbStorage;
288
297
  }
289
- } catch {
298
+ } catch (_) {
290
299
  }
291
300
  }
292
301
  }
293
- } catch {
294
- return null;
295
302
  }
296
303
  return bestDir;
297
304
  }
@@ -371,7 +378,14 @@ function findCC() {
371
378
  function compileBinary() {
372
379
  return new Promise((resolve2, reject) => {
373
380
  const ccPath = findCC();
381
+ let sysroot = "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk";
382
+ try {
383
+ sysroot = execSync("xcrun --show-sdk-path", { encoding: "utf8" }).trim();
384
+ } catch {
385
+ }
374
386
  const compile = spawn2(ccPath, [
387
+ "-isysroot",
388
+ sysroot,
375
389
  "-O2",
376
390
  "-o",
377
391
  path3.join(PY_DIR2, "find_all_keys_macos"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@walkerch/wxecho",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "macOS native chat history export tool with local database decryption support",
5
5
  "keywords": [
6
6
  "macos",