android 点击劫持,如何防止它

j2e*_*nue 5 security android tap malware

试图避免我的观点涉及从覆盖层接收反馈......

以下是某人在 Android 上进行的黑客攻击示例,允许用户无意中按下系统按钮属性,甚至输入凭据来执行与最初意图完全不同的操作:

http://www.youtube.com/watch?v=gCLU7YUXUAY

我想确认设置该属性

android:filterTouchesWhenObscured="true"

在我的 xml 视图中,这会阻碍跨设备发生这种情况,因为我打算制作一个安全的应用程序。

小智 5

public class MyActivity extends Activity {
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        final Button myButton = (Button)findViewById(R.id.button_id);
        myButton.setFilterTouchesWhenObscured(true);
        myButton.setOnClickListener(new View.OnClickListener() {
            // Perform action on click
            public void onClick(View v) {

            }
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

为关键按钮编写此代码