使用node.js安装asar和反编译app.asar

本文介绍如何使用asar工具解压Electron应用中的app.asar文件,通过安装node.js的npm包管理工具,以管理员身份运行WindowsPowerShell,安装asar并执行解压命令,最终实现对app.asar文件的反编译。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

背景:app.asar文件是Electron加密打包时的中间产物,electron.exe调用resources文件夹下的app.asar从而实现不用解压缩而直接读取文件内容的高效。

一、需要先安装node.js的npm包管理工具,具体参见:https://www.cnblogs.com/xuhai/p/9955236.html

二、以管理员身份打开Windows PowerShell

输入以下指令安装asar

npm install -g asar

三、进行反编译

用Windows PowerShell切换到app.asar所在文件夹,然后输入

asar extract app.asar ./

 

没有报错便表示解压成功。

四、到解压文件夹可以看到反编译的文件,也可以修改里面的文件,至此解压完成。

 

转载于:https://www.cnblogs.com/xuhai/p/9955310.html

\admin-project\guangxi-quan-vue3>npm run build:linux > flowoutdemo@0.0.0 build:linux > electron-builder --linux • electron-builder version=26.0.12 os=10.0.26100 • loaded configuration file=package.json ("build" field) ⨯ Invalid configuration object. electron-builder 26.0.12 has been initialized using a configuration object that does not match the API schema. - configuration.linux should be one of these: object { appId?, artifactName?, asar?, asarUnpack?, category?, compression?, cscKeyPassword?, cscLink?, defaultArch?, description?, desktop?, detectUpdateChannel?, disableDefaultIgnoredFiles?, electronLanguages?, electronUpdaterCompatibility?, executableArgs?, executableName?, extraFiles?, extraResources?, fileAssociations?, files?, forceCodeSigning?, generateUpdatesFilesForAllChannels?, icon?, maintainer?, mimeTypes?, packageCategory?, protocols?, publish?, releaseInfo?, synopsis?, target?, vendor? } | null -> Options related to how build Linux targets. Details: * configuration.linux has an unknown property 'mksquashfsPath'. These properties are valid: object { appId?, artifactName?, asar?, asarUnpack?, category?, compression?, cscKeyPassword?, cscLink?, defaultArch?, description?, desktop?, detectUpdateChannel?, disableDefaultIgnoredFiles?, electronLanguages?, electronUpdaterCompatibility?, executableArgs?, executableName?, extraFiles?, extraResources?, fileAssociations?, files?, forceCodeSigning?, generateUpdatesFilesForAllChannels?, icon?, maintainer?, mimeTypes?, packageCategory?, protocols?, publish?, releaseInfo?, synopsis?, target?, vendor? } * configuration.linux has an unknown property 'binaries'. These properties are valid: object { appId?, artifactName?, asar?, asarUnpack?, category?, compression?, cscKeyPassword?, cscLink?, defaultArch?, description?, desktop?, detectUpdateChannel?, disableDefaultIgnoredFiles?, electronLanguages?, electronUpdaterCompatibility?, executableArgs?, executableName?, extraFiles?, extraResources?, fileAssociations?, files?, forceCodeSigning?, generateUpdatesFilesForAllChannels?, icon?, maintainer?, mimeTypes?, packageCategory?, protocols?, publish?, releaseInfo?, synopsis?, target?, vendor? } How to fix: 1. Open https://www.electron.build/linux 2. Search the option name on the page (or type in into Search to find across the docs). * Not found? The option was deprecated or not exists (check spelling). * Found? Check that the option in the appropriate place. e.g. "title" only in the "dmg", not in the root. failedTask=build stackTrace=ValidationError: Invalid configuration object. electron-builder 26.0.12 has been initialized using a configuration object that does not match the API schema. - configuration.linux should be one of these: object { appId?, artifactName?, asar?, asarUnpack?, category?, compression?, cscKeyPassword?, cscLink?, defaultArch?, description?, desktop?, detectUpdateChannel?, disableDefaultIgnoredFiles?, electronLanguages?, electronUpdaterCompatibility?, executableArgs?, executableName?, extraFiles?, extraResources?, fileAssociations?, files?, forceCodeSigning?, generateUpdatesFilesForAllChannels?, icon?, maintainer?, mimeTypes?, packageCategory?, protocols?, publish?, releaseInfo?, synopsis?, target?, vendor? } | null -> Options related to how build Linux targets. Details: * configuration.linux has an unknown property 'mksquashfsPath'. These properties are valid: object { appId?, artifactName?, asar?, asarUnpack?, category?, compression?, cscKeyPassword?, cscLink?, defaultArch?, description?, desktop?, detectUpdateChannel?, disableDefaultIgnoredFiles?, electronLanguages?, electronUpdaterCompatibility?, executableArgs?, executableName?, extraFiles?, extraResources?, fileAssociations?, files?, forceCodeSigning?, generateUpdatesFilesForAllChannels?, icon?, maintainer?, mimeTypes?, packageCategory?, protocols?, publish?, releaseInfo?, synopsis?, target?, vendor? } * configuration.linux has an unknown property 'binaries'. These properties are valid: object { appId?, artifactName?, asar?, asarUnpack?, category?, compression?, cscKeyPassword?, cscLink?, defaultArch?, description?, desktop?, detectUpdateChannel?, disableDefaultIgnoredFiles?, electronLanguages?, electronUpdaterCompatibility?, executableArgs?, executableName?, extraFiles?, extraResources?, fileAssociations?, files?, forceCodeSigning?, generateUpdatesFilesForAllChannels?, icon?, maintainer?, mimeTypes?, packageCategory?, protocols?, publish?, releaseInfo?, synopsis?, target?, vendor? } How to fix: 1. Open https://www.electron.build/linux 2. Search the option name on the page (or type in into Search to find across the docs). * Not found? The option was deprecated or not exists (check spelling). * Found? Check that the option in the appropriate place. e.g. "title" only in the "dmg", not in the root. at validate (D:\admin-project\guangxi-quan-vue3\node_modules\@develar\schema-utils\dist\validate.js:86:11) at validateConfiguration (D:\admin-project\guangxi-quan-vue3\node_modules\app-builder-lib\src\util\config\config.ts:239:3) at Packager.validateConfig (D:\admin-project\guangxi-quan-vue3\node_modules\app-builder-lib\src\packager.ts:384:5) at Packager.build (D:\admin-project\guangxi-quan-vue3\node_modules\app-builder-lib\src\packager.ts:392:5) at executeFinally (D:\admin-project\guangxi-quan-vue3\node_modules\builder-util\src\promise.ts:12:14)
最新发布
06-07
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值