android tap jacking,如何防止 [英] android tap jacking, how to prevent it

查看:131
本文介绍了android tap jacking,如何防止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

试图避免我的观点接触到来自叠加层的反馈....

Trying to avoid my views touches receiving feedback from overlays ....

这是一个例子,有人可以在Android上进行黑客入侵,以使用户无意中按下系统按钮属性,甚至输入凭据来执行与最初意图完全不同的操作:

Here is an example of a hack someone could do on Android to allow the user to unintentionally press a system button property or even enter in credentials to do something completely different then the initial intention:

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

我想确认设置属性

android:filterTouchesWhenObscured ="true"

会阻止这种情况在设备间发生,因为我打算制作一个安全的应用程序.

in my xml view would hinder this from happening across devices as im intending to make a secure app.

推荐答案

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) {

            }
        }
    }
}

为关键按钮编写此代码

这篇关于android tap jacking,如何防止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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