Android 按键记录器 [英] Android Key logger

查看:26
本文介绍了Android 按键记录器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

简介:我想在 Android Security 上创建一个 POC,它需要确定是否有任何 KeyLogger 在 Android 设备上运行.如果它正在运行或安装在设备上,请在我的 Android 应用程序中禁用它.

Intro: I want to create a POC on Android Security which requires to identify if there is any KeyLogger running on Android device or not. And if it is running or installed on device then, disable it throughout my Android application.

查询:

1.) 是否可以创建拦截键盘事件并作为服务在后台运行的 Android 键盘记录器?

1.) Is this possible to create Android keyloggers which intercepts keyboard events and running in background as services?

2.) 这是否可以确定是否有任何后台进程处理键盘事件?

2.) Is this possible to identify if any of the background process handelling keyboard events?

3.) 我可以通过我的应用程序代码停止任何其他后台服务(不属于我所有)吗?

3.) Can I stop any other background service (not owned by me) by my application code?

如果您有合适的链接,请帮助我.

Please help me with suitable links if you have.

推荐答案

经过一整天的研究,我得出了以下结论.

After research for 1 whole day I reached at below conclusion.

Android 不允许您拦截来自后台服务的默认软键盘输入.拦截这些事件的唯一方法是自定义键盘.

我总结如下:

在 Android 中,后台服务不支持键盘事件的按键记录.部分链接如下:

In Android Key logging for keyboard events is not supported in background services. Some of the links are as follows:

第 1 点:Google Android 开发者

Point 1: Google Android Developer

由于软输入法可以使用多种创造性的文本输入方式,因此不能保证软键盘上的任何按键按下都会产生按键事件:这由 IME 自行决定,实际上发送此类事件是灰心.对于软输入法上的任何键,您永远不应该依赖接收 KeyEvents.特别是,默认的软件键盘永远不会向任何以 Jelly Bean 或更高版本为目标的应用程序发送任何键事件,并且只会向以 Ice Cream Sandwich 或更早版本为目标的应用程序发送某些删除和返回键的事件.

As soft input methods can use multiple and inventive ways of inputting text, there is no guarantee that any key press on a soft keyboard will generate a key event: this is left to the IME's discretion, and in fact sending such events is discouraged. You should never rely on receiving KeyEvents for any key on a soft input method. In particular, the default software keyboard will never send any key event to any application targetting Jelly Bean or later, and will only send events for some presses of the delete and return keys to applications targetting Ice Cream Sandwich or earlier.

http://developer.android.com/reference/android/view/KeyEvent.html

Android Jelly Bean 是:4.1 到 4.3.1Android 冰淇淋三明治:4.0

Android Jelly Bean is: 4.1 to 4.3.1 Android IceCream Sandwich: 4.0

软输入法上的按键不需要触发此侦听器中的方法,实际上不鼓励这样做.默认的 android 键盘不会为针对 Jelly Bean 或更高版本的任何应用程序的任何键触发这些,并且只会将其传递给针对 Ice Cream Sandwich 或更早版本的应用程序的某些按键.

Key presses on soft input methods are not required to trigger the methods in this listener, and are in fact discouraged to do so. The default android keyboard will not trigger these for any key to any application targetting Jelly Bean or later, and will only deliver it for some key presses to applications targetting Ice Cream Sandwich or earlier.

http://developer.android.com/reference/android/文本/方法/KeyListener.html

第 2 点: 堆栈溢出KeyEvents 只能由活动处理,因为它们是用户按下按键的界面,并且只有当它们在前台时.即使在后台运行的服务也不打算对用户输入做出反应.

Point 2: Stack Overflow KeyEvents can only be handled by Activities as they are the interface to the user pressing the keys and only when they are in the foreground. Even Services that run in the background are not intended to react on user input.

​​Android - 在后台按下硬键的监听器

是可以创建一个监听硬件按键的 Android 服务吗?

第 3 点: Romain Guy也为 Google 工作的 Romain Guy (https://stackoverflow.com/users/298575/romain-guy)确认了服务中的onKeyDown?(全局热键)

Point 3: Romain Guy Romain Guy (https://stackoverflow.com/users/298575/romain-guy) who works for Google also confirms it onKeyDown in a service? (Global Hot Keys)

第 4 点:一些其他参考:

谷歌安卓开发者组:https://groups.google.com/forum/#!topic/android-developers/o--GUWmqXdI

只能通过使用自定义键盘来完成:get按下键并在android中抛出另一个键

It can be done only by using Custom KeyBoard: get pressed key and throw another key in android

如果您认为我遗漏了任何内容,请添加您的评论.

Please add your comments if you think that I have missed anything.

这篇关于Android 按键记录器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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