为什么奇巧需要使用isValidFragment的?

编程入门 行业动态 更新时间:2024-10-27 18:18:50
本文介绍了为什么奇巧需要使用isValidFragment的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

自从奇巧发布后,我发现了一大堆我的应用程序使用修复崩溃奇巧更新。最近,当我发表我自己的应用程序,我想通了,可能的来源是新的isValidFragment的要求,使用preference活动。我一直没能得到任何人,但是,要解释为什么这个新类是突然需要验证片段。任何人都可以给我的,为什么这是必需的解释?

Ever since KitKat was released, I've noticed a whole bunch of my apps updating with "Fixing a crash in Kit Kat". Recently when I released my own app, I figured out the likely source of that is the new "isValidFragment" requirement for using preference activities. I haven't been able to get anyone, however, to explain why this new class is suddenly needed to validate fragments. Can anyone offer me an explanation of why this is required?

推荐答案

子类应覆盖此方法,并验证给定的片段是一个有效的类型附加到这个活动。默认实现返回true内置的Andr​​oid应用程序:targetSdkVersion超过奇巧。对于以后的版本,它会抛出异常。

Subclasses should override this method and verify that the given fragment is a valid type to be attached to this activity. The default implementation returns true for apps built for android:targetSdkVersion older than KITKAT. For later versions, it will throw an exception.

在Android框架的新漏洞:片段注入   我们最近披露的一个新漏洞到Android安全   球队。这个安全漏洞影响到许多应用程序,包括设置(在   一个是每一个Android设备上找到)时,Gmail,谷歌现在的DropBox   和Evernote的。为了更准确,任何应用程序这延长了   使用导出活动preferenceActivity类是自动   脆弱。补丁已经在Android的奇巧被提供。如果你   想知道为什么你的code现在已经坏了,这是由于Android的奇巧   补丁这需要应用到覆盖新方法,   preferenceActivity.isValidFragment,已加入到   Android框架。

A New Vulnerability in the Android Framework: Fragment Injection We have recently disclosed a new vulnerability to the Android Security Team. The vulnerability affected many apps, including Settings (the one that is found on every Android device), Gmail, Google Now, DropBox and Evernote. To be more accurate, any App which extended the PreferenceActivity class using an exported activity was automatically vulnerable. A patch has been provided in Android KitKat. If you wondered why your code is now broken, it is due to the Android KitKat patch which requires applications to override the new method, PreferenceActivity.isValidFragment, which has been added to the Android Framework.

securityintelligence/new-vulnerability-android-framework-fragment-injection/ securityintelligence/wp-content/uploads/2013/12/android-collapses-into-fragments.pdf

更多推荐

为什么奇巧需要使用isValidFragment的?

本文发布于:2023-06-08 02:59:40,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/572856.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:奇巧   isValidFragment

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!