我如何在我的Android应用程序中沙箱中的第三方库?
我在我的应用程序中包括一个来自第三方的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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你不能。操作系统不知道您的应用程序的哪些部分是库以及您写了哪些部分。运行应用程序时,图书馆类别与您自己的一个之间没有区别。如果您不信任库,则不应使用它。
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.