• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

frameworks/base


Commit MetaInfo

修訂71509777b4c16f9e42fae92a287c4287a2fd9a06 (tree)
時間2019-12-17 05:46:39
作者Sterling Huber <hubers@goog...>
CommiterManjae Park

Log Message

RESTRICT AUTOMERGE
Make toasts non-clickable

Since enforcement was only on client-side, in Toast class, an app could
use reflection (or other means) to make the Toast clickable. This is a
security vulnerability since it allows tapjacking, that is, intercept touch
events and do stuff like steal PINs and passwords.

This CL brings the enforcement to the system by applying flag
FLAG_NOT_TOUCHABLE.

Test: Construct app that uses reflection to remove flag FLAG_NOT_TOUCHABLE and

log click events. Then:
1) Observe click events are logged without this CL.
2) Observer click events are not logged with this CL.

Bug: 128674520

Change-Id: Ica346c853dcb9a1e494f7143ba1c38d22c0003d0
(cherry picked from commit 54e6a3c4fbf2eb70541932074ed650dcf22113ed)

Change Summary

差異

--- a/services/core/java/com/android/server/policy/PhoneWindowManager.java
+++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java
@@ -2618,6 +2618,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
26182618 attrs.hideTimeoutMilliseconds = TOAST_WINDOW_TIMEOUT;
26192619 }
26202620 attrs.windowAnimations = com.android.internal.R.style.Animation_Toast;
2621+ // Toasts can't be clickable
2622+ attrs.flags |= WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE;
26212623 break;
26222624 }
26232625