chenquincy / app-info-parser

A javascript parser for parsing .ipa or .apk files. IPA/APK文件 js 解析器

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

直接使用文件路径解析报错

Moking1997 opened this issue · comments

const AppInfoParser = require("app-info-parser"); const parser = new AppInfoParser("./packages/dbb.apk"); // or xxx.ipa parser .parse() .then(result => { console.log("app info ----> ", result); console.log("icon base64 ----> ", result.icon); }) .catch(err => { console.log("err ----> ", err); });

报错信息:
main.vue?5faf:137 Uncaught Error: Param error: [file] must be an instance of Blob or File in browser.

我用其他apk解析插件同样的路径是可以解析的,是我的写法有问题么

@Moking1997 你在使用vue对吧,浏览器端没有文件路径这一说法啊

@Moking1997 electron 我没有试过,桌面应用解析安装包,正常来说也应该有一个选择文件的过程吧,你这个用法是用在 Node 端的

我也是electron 这个问题

@grace618 可以用 1.0.1-alpha.1 版本试试

没写过 electron ,看起来是文件系统的规则和 h5 不一样,得等我有空再看看了 在2021年04月22日 11:53,grace618 写道: @grace618 可以用 1.0.1-alpha.1 版本试试 不行,路径使用文件的绝对路径,例如C://xx/xx ,我翻来覆去的测试,怎么都不行 —You are receiving this because you modified the open/close state.Reply to this email directly, view it on GitHub, or unsubscribe. [ { @.": "http://schema.org", @.": "EmailMessage", "potentialAction": { @.": "ViewAction", "target": "#46 (comment)", "url": "#46 (comment)", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { @.": "Organization", "name": "GitHub", "url": "https://github.com" } } ]

现在解决了,代码没问题,这个提问者是因为没分清在浏览器端和node端使用,用electron应该在主进程里面使用