Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我目前正在使用 Android Oreo 提供的自动填充框架开发自动填充服务。我的问题是我可以从触发填充请求的位置获取客户端应用程序的包名称吗?
我想用我拥有的凭证数据对其进行验证,以确保我的服务仅将机密数据注入需要填充的正确应用程序。
感谢 Felipe Leme,我收到了回复。我们可以通过 getIdPackage() 方法从 AssistStructure.ViewNode 中获取客户端应用的包名。我们还应该使用 PackageManager 来检查包的签名以避免网络钓鱼。