如何列出Expo项目中的所有Android依赖性?

发布于 2025-02-10 18:00:39 字数 1139 浏览 3 评论 0原文

正如大多数熟悉博览会的人都知道的那样,由于其许多抽象层次,发展变得轻而易举。

但是,我撞到了一堵墙,需要摆脱我的博览会泡沫。我并不是说弹出或重写整个应用程序。我的意思是开始对引擎盖下的情况感到震惊。这个问题专门指依赖管理&捆绑。

我不是Android开发方面的专家,但是我确实有一些基本知识。据我了解,依赖性以类似Java的方式进行管理。带有诸如Java软件包之类的概念,以及Gradle等工具。

使用Nodejs时尚管理依赖关系。带有诸如package.json和npm/yarn等工具之类的概念。

当构建Android二进制文件时,Expo使用JavaScript代码来做一些事情。沿该项目运行所需的几个andRIOD依赖项捆绑。

因此,我需要获得的是所有Android本地依赖性的完整列表 由此产生的二进制将包括。即:com.com.pany.example:标识符:xyz

我使用jadx从expo中删除结果.aab,虽然结果非常有见地,但它缺少可靠的清单列出所有捆绑包。所述清单甚至可能都不存在,因为所有捆绑的软件包都可能包含在源代码的其余部分中,因此无需分开列出它们。在建造之前,这样的清单将是最有意义的。它确实具有Android清单,但没有列出依赖性。

不过,我所做的是将CD降低到删除的项目中并运行命令:

grep -rh . -e '^package.\+;' | sort -u > packages.log

输出看起来很有希望,但是我不是专家,我需要100%确定,然后再告诉老板。由于某些代码无法解码,分解并不总是100%可靠。

我还尝试了Expo Prebuild,但所得的Gradle文件不会直接列出所有依赖项。相反,他们需要在软件包中定义的依赖项。JSON使用类似怪异的指令使用:

url(new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim(), "../android"))

不确定如何手动执行该指令,或者最终如何将其转换为本机Android依赖项(即com.facebook.reaeact.uimanager)。

请,我需要帮助列出世博项目的所有Android依赖项,并且对此有100%的肯定。

As most people familiar with Expo are aware, development has been a breeze thanks to its many layers of abstraction.

However, I've hit a wall and need to break out of my Expo bubble. I don't mean ejecting or re-writing the entire app. What I mean is to start gaining awereness of what's going on under the hood. This question specifically refers to dependency management & bundling.

I'm no expert on Android development, but I do have some basics. As far as I understand, dependencies are managed in a Java-like fashion. With concepts like the Java package, and tools like Gradle.

Expo manages dependencies using a NodeJS fashion. With concepts like the package.json and tools like npm/yarn.

When the time comes to build the android binary, Expo does something with the Javascript code & bundles it along several Andriod dependencies required for the project to run.

Therefore, what I need to get is a full list of all the Android native dependencies the
resulting binary will include. i.e: com.company.example:identifier:x.y.z

I've used JADX to de-compile a resulting .aab from Expo and while the result is quite insightful, it's missing a reliable manifest listing all the bundled packages. Said manifest might not even exist, as all the bundled packages will probably be included along the rest of the source code, so there's no need to list them separetly. A manifest like that would make most sense before building. It does have an Android Manifest, but that one doesn't list dependencies.

What I did though, is to cd into the de-compiled project and run the command:

grep -rh . -e '^package.\+;' | sort -u > packages.log

The output looks promising, but I'm no expert and I need to be 100% sure before telling my boss. Decompiling isn't always 100% reliable due to some code being impossible to decode.

I've also tried expo prebuild but the resulting gradle files will not list all dependencies directly. Instead they require dependencies defined in a package.json using a weird directive like so:

url(new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim(), "../android"))

Not sure how to manually execute that directive, or how that gets eventually translated to native android dependencies (i.e com.facebook.react.uimanager).

Please, I need help listing all the Android dependencies for an Expo project and being 100% sure about it.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文