























makepkg leads to this error:
==> ERROR: Integrity checks (sha256) differ in size from the source array.
You missed to remove the first entry of the sha256sums array:
97ff33f11c405f38a6f53311eb2bac193d9de4ed84fdbd52bbb4eddec63744d6 safe_extract_asar.js
@colazcy Thanks for your feedback, fixed it.@homocomputeris Can you try again?
It does not launch:
Error launching app
Unable to find Electron app at /usr/lib/onekey-wallet/app.asar
Cannot find module '/usr/lib/onekey-wallet/app.asar'
and, when reinstalling, it outputs:
Downloading PKGBUILDs...
PKGBUILDs up to date
nothing new to review
fetching devel info...
==> Making package: onekey-wallet-bin 6.1.0-2 (Вс 29 мар 2026 22:59:13)
==> Retrieving sources...
-> Found safe_extract_asar.js
-> Found onekey-wallet.sh
-> Found onekey-wallet-6.1.0-x86_64.AppImage
==> Validating source files with sha256sums...
safe_extract_asar.js ... Passed
onekey-wallet.sh ... Passed
==> Validating source_x86_64 files with sha256sums...
onekey-wallet-6.1.0-x86_64.AppImage ... Passed
==> Making package: onekey-wallet-bin 6.1.0-2 (Вс 29 мар 2026 22:59:14)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
-> Found safe_extract_asar.js
-> Found onekey-wallet.sh
-> Found onekey-wallet-6.1.0-x86_64.AppImage
==> Validating source files with sha256sums...
safe_extract_asar.js ... Passed
onekey-wallet.sh ... Passed
==> Validating source_x86_64 files with sha256sums...
onekey-wallet-6.1.0-x86_64.AppImage ... Passed
==> Removing existing $srcdir/ directory...
==> Extracting sources...
==> Starting prepare()...
The electron version is: 39
📂 创建输出目录:/home/user/.cache/paru/clone/onekey-wallet-bin/src/app.asar.unpacked
🔍 读取asar包文件列表...
📄 检测到 3475 个文件,开始过滤解压...
@zxp19821005
Thanks for your great work on this package! Unfortunately, this version of "safe_extract_asar.js" still does not work because the CLI arguments are wrong. It uses the "-o" flag, but the correct syntax is "asar extract-file|ef <archive> <filename> ".
Additionally, this way of extracting files from asar archives is quite inefficient. I suggest using the native asar module for better performance. Here's an updated version of "safe_extract_asar.js".
NOTE: This script is generated by Google Gemini, and reviewed by Claude and ChatGPT. I've reviewed and tested it manually (and it works well on my machine), but I would appreciate your review since I’m not very familiar with JavaScript and Node.js.
const fs = require('fs');
const path = require('path');
const SRC_DIR = process.env.SRC_DIR || process.cwd();
const ASAR_FILE_PATH = path.join(SRC_DIR, 'squashfs-root/resources/app.asar');
const OUTPUT_DIR = path.join(SRC_DIR, 'app.asar.unpacked');
// Exclude non-Linux prebuilds
const EXCLUDE_PATTERNS = [
/\/prebuilds\/android-/,
/\/prebuilds\/darwin-/,
/\/prebuilds\/win32-/
];
async function nativeExtract() {
try {
// Clean up previous extraction to avoid ENOTDIR conflicts from cached builds
if (fs.existsSync(OUTPUT_DIR)) {
fs.rmSync(OUTPUT_DIR, { recursive: true, force: true });
}
fs.mkdirSync(OUTPUT_DIR, { recursive: true });
console.log('=> Loading system-level @electron/asar module...');
let asar;
try {
const asarModule = await import('file:///usr/lib/node_modules/@electron/asar/lib/asar.js');
asar = asarModule.default || asarModule;
} catch (e) {
console.error(`Error: Failed to load asar module. ${e.message}`);
process.exit(1);
}
console.log('=> Reading flat file index...');
const rawFileList = asar.listPackage(ASAR_FILE_PATH);
// Normalize paths and filter out empty ones
const fileList = rawFileList
.map(f => f.startsWith('/') ? f.substring(1) : f)
.filter(f => f && f !== '.');
// Build a set of all directories to prevent file/directory name collisions
const dirSet = new Set();
for (const file of fileList) {
let currentDir = path.dirname(file);
while (currentDir !== '.' && currentDir !== '') {
dirSet.add(currentDir);
currentDir = path.dirname(currentDir);
}
}
console.log('=> Extracting files to memory and writing to disk...');
let extractedCount = 0;
let skippedCount = 0;
for (const file of fileList) {
// Skip directories
if (dirSet.has(file)) {
continue;
}
// Skip cross-platform prebuilds
if (EXCLUDE_PATTERNS.some(regex => regex.test(file))) {
skippedCount++;
continue;
}
try {
// extractFile throws if the file is a directory or physically missing
const buffer = asar.extractFile(ASAR_FILE_PATH, file);
const destPath = path.join(OUTPUT_DIR, file);
const destDir = path.dirname(destPath);
if (!fs.existsSync(destDir)) {
fs.mkdirSync(destDir, { recursive: true });
}
fs.writeFileSync(destPath, buffer);
extractedCount++;
} catch (err) {
// Silently ignore directories and ghost files
skippedCount++;
}
}
if (extractedCount === 0) {
console.error('Error: No files were extracted. Check safe_extract_asar.js!');
process.exit(1);
}
console.log('=> Extraction complete.');
console.log(` Successfully extracted: ${extractedCount} files`);
console.log(` Skipped (dirs/missing/ignored): ${skippedCount} items`);
} catch (err) {
console.error(`Fatal error during extraction: ${err.message}`);
process.exit(1);
}
}
nativeExtract();
@colazcy Thanks for your feedback, fixed it.
The new script safe_extract_asar.js has hardcoded absolute paths /home/zxp-endeavouros/... on lines 6 and 7. This causes installation to fail for all other users.
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。
@olwig Thanks for your feedback , fixed it .