我如何在我的Android应用程序中沙箱中的第三方库?

发布于 2025-01-28 04:43:18 字数 175 浏览 1 评论 0原文

我在我的应用程序中包括一个来自第三方的AAR。我的应用程序宣布了很多权限,并且可以访问API,这些API有可能用于访问敏感信息或执行恶意操作。据我了解,这意味着第三方库可以访问(并可能滥用)所有这些API,即使它不声明其清单中所需的权限。
我如何在应用程序中限制/沙盒第三方库,以便他们可以访问其陈述目的所需的API,而不再是?

I include an AAR in my app which comes from a third party. My app declares lots of permissions, and has access to APIs that could potentially be used to access sensitive info or perform malicious actions. As I understand it, this means that the third-party library can access (and potentially abuse) all these same APIs, even if it does not declare the required permissions in its manifest.
How can I restrict/sandbox third party libraries in my app so they have access to the APIs needed for their stated purposes, and no more?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

茶底世界 2025-02-04 04:43:18

你不能。操作系统不知道您的应用程序的哪些部分是库以及您写了哪些部分。运行应用程序时,图书馆类别与您自己的一个之间没有区别。如果您不信任库,则不应使用它。

You can't. The OS doesn't know what parts of your app are a library and what parts are written by you. When running an app there's no difference between a library class and one of your own. If you don't trust a library, you shouldn't use it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文