Android:为具有 Intent 过滤器的 activity 定义自定义权限是一种好习惯吗?
Android: Is it a good practice to define custom permission for an activity which has intent filters?
我有一个应用程序,其中 activity 应该由消息中的深层链接启动。我是否应该为 activity 定义自定义权限,以便恶意 service/apps 无法调用它?我不确定这是否是一个好习惯。任何帮助将不胜感激。
提前致谢。
Should I define custom permission for that activity so that malicious service/apps cannot call it?
可能不会。如果 activity 只会由您的代码启动,请删除 <intent-filter>
。另一方面,如果 activity 应该由其他东西启动,那么 "something else" 将不会请求您的自定义权限,因此肯定无法启动 activity .
我有一个应用程序,其中 activity 应该由消息中的深层链接启动。我是否应该为 activity 定义自定义权限,以便恶意 service/apps 无法调用它?我不确定这是否是一个好习惯。任何帮助将不胜感激。
提前致谢。
Should I define custom permission for that activity so that malicious service/apps cannot call it?
可能不会。如果 activity 只会由您的代码启动,请删除 <intent-filter>
。另一方面,如果 activity 应该由其他东西启动,那么 "something else" 将不会请求您的自定义权限,因此肯定无法启动 activity .