为什么奇巧需要使用isValidFragment的?(Why does Kit Kat require the use of the isValidFragment?)
2017-07-13 16:22
597 查看
问 题
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?
自从奇巧发布后,我发现了一大堆我的应用程序使用“修复崩溃奇巧”更新。最近,当我发布我自己的应用程序时,我想通了,我发现可能的来源是使用preference
activities的新要求“isValidFragment”。然而没有人能给我解释为什么这个新类是突然需要验证片段。谁可以给我解释为什么需要这个?
解决方案
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.
子类应覆盖此方法,并验证给定的fragment是一个有效的类型附加到这个活动。对于targetSdkVersion在KITKAT之前的Android默认返回true。对于以后的版本,它会抛出异常。
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.
在Android框架的新漏洞:片段注入
我们最近披露的一个新漏洞到Android安全团队。这个安全漏洞影响到许多应用程序,包括设置(每个Android设备上都能找到),Gmail,Google
Now,DropBox 和Evernote。为了更准确,任何使用exported activity扩展PreferenceActivity类的应用程序自动易受攻击。补丁已经在Android的奇巧被提供。如果你想知道为什么你的code现在已经坏了,这是由于Android
奇巧的补丁需要应用到覆盖新方法,preferenceActivity.isValidFragment,已加入到Android
Framework。
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?
自从奇巧发布后,我发现了一大堆我的应用程序使用“修复崩溃奇巧”更新。最近,当我发布我自己的应用程序时,我想通了,我发现可能的来源是使用preference
activities的新要求“isValidFragment”。然而没有人能给我解释为什么这个新类是突然需要验证片段。谁可以给我解释为什么需要这个?
解决方案
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.
子类应覆盖此方法,并验证给定的fragment是一个有效的类型附加到这个活动。对于targetSdkVersion在KITKAT之前的Android默认返回true。对于以后的版本,它会抛出异常。
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.
在Android框架的新漏洞:片段注入
我们最近披露的一个新漏洞到Android安全团队。这个安全漏洞影响到许多应用程序,包括设置(每个Android设备上都能找到),Gmail,Google
Now,DropBox 和Evernote。为了更准确,任何使用exported activity扩展PreferenceActivity类的应用程序自动易受攻击。补丁已经在Android的奇巧被提供。如果你想知道为什么你的code现在已经坏了,这是由于Android
奇巧的补丁需要应用到覆盖新方法,preferenceActivity.isValidFragment,已加入到Android
Framework。
相关文章推荐
- Why does Quora use MySQL as the data store instead of NoSQLs such as Cassandra, MongoDB, or CouchDB?
- why we use _MainText_ST and what does the mean of TRANSFORM_TEX
- The Java™ Tutorials — Generics :Why Use Generics? 为什么使用泛型
- Why does Quora use MySQL as the data store instead of NoSQLs such as Cassandra, MongoDB, CouchDB etc?
- 解决android - Why does use of multiDexEnabled (true) allow the app to build but constantly crash?
- Why does MariaDB 10.2 use InnoDB instead of XtraDB?
- 编码解码器无法使用提供的流类型 The codec cannot use the type of stream provided
- eclipse生成Webservice提示does not eomply to one or more requiremets of the JAX-RPC 1.1 specification
- [zz]Why does the compiler generate a MOV EDI, EDI instruction at the beginning of functions?
- In which of the following does a C++ developer use the placement new syntax to make new allocate an
- Why does the method of Lagrange multipliers work for optimization in multivariable calculus?
- Why do a lot of #defines in the kernel use do { ... } while(0)?
- ADO.NET Entity Framework: The version of SQL Server in use does not support datatype 'datetime2'
- Why does the compiler generate a MOV EDI, EDI instruction at the beginning of functions?
- Why does a statically built Qt use the dynamic Visual Studio runtime libraries ? Do I need to deploy
- Why do a lot of #defines in the kernel use do { ... } while(0)?
- Error: The version of SQL Server in use does not support datatype 'datetime2'
- ERROR: The version of SQL Server in use does not support datatype 'datetime2'.
- 为什么JavaScript有能力成为未来企业级编程语言?Why JavaScript Will Become The Dominant Programming Language Of The Ente
- Error: The version of SQL Server in use does not support datatype 'datetime2