为什么奇巧需要使用isValidFragment的? [英] Why does Kit Kat require the use of the isValidFragment?

查看:720
本文介绍了为什么奇巧需要使用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.

<一个href="http://securityintelligence.com/new-vulnerability-android-framework-fragment-injection/">http://securityintelligence.com/new-vulnerability-android-framework-fragment-injection/ <一href="http://securityintelligence.com/wp-content/uploads/2013/12/android-collapses-into-fragments.pdf">http://securityintelligence.com/wp-content/uploads/2013/12/android-collapses-into-fragments.pdf

这篇关于为什么奇巧需要使用isValidFragment的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆