gpt4 book ai didi

android - Samsung Knox 兼容应用程序如何判断它是否在 Knox 容器中?

转载 作者:搜寻专家 更新时间:2023-11-01 09:39:02 26 4
gpt4 key购买 nike

我开发了一个在 Samsung Knox 环境中运行的应用程序。由于 Knox 环境的限制,我需要应用程序根据它是在 Knox 容器中还是在 Knox 容器外做出不同的响应。应用程序如何以编程方式判断它是否已部署在容器内?

最佳答案

我有一个类似的问题,虽然我们的应用程序不能在 Knox 环境中工作,但一些用户无论如何都会把它放在那里......所以我正在寻找一个类似的功能。我发现以下可能对您有帮助。遗憾的是,它不起作用,因为它似乎只在包含 Knox Premium SDK 时才起作用: https://seap.samsung.com/faq/how-does-app-detect-if-container-was-created

总之有两种检查方法。要么在代码中调用它:

KnoxContainerManager.getContainers()

或者将此添加到您的 list 并添加一个广播监听器:

    <receiver
android:name=".receiver.KnoxContainerReceiver"
android:exported="true" >
<intent-filter>
<action android:name="com.samsung.knox.container.creation.status" />
</intent-filter>
</receiver>

public class KnoxContainerReceiver extends BroadcastReceiver{
@Override public void onReceive(Context context, Intent intent ){
//do something
}
}

如果有人找到了无需 SDK 即可工作的解决方案,我非常想听听。

关于android - Samsung Knox 兼容应用程序如何判断它是否在 Knox 容器中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41043649/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com