Android的键盘记录键盘记录、Android

2023-09-07 09:11:59 作者:北岸初晴

说明:我想创建Android安全POC的要求,以确定是否有在Android设备或没有运行任何键盘记录程序。而如果是在设备上运行或安装的话,禁用它在我的Andr​​oid应用程序。

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)这是可能创造的Andr​​oid键盘记录其截获键盘事件,并在后台作为服务运行?

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

2)。这是可能的,以确定是否有任何后台进程handelling键盘事件?

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

3)。我可以用我的应用程序code停止任何其他后台服务(不归我)?

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.

推荐答案

研究了1整天我在下面作出结论后。

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

的Andr​​oid不允许你从后台服务截获默认的软键盘输入。只有这样,才能拦截这些事件是自定义键盘。的

Android does not allow you to intercepts default soft keyboard inputs from background services. The only way to intercepts these events are custom keyboards.

我总结如下:

在键盘事件的Andr​​oid键盘记录是不是在后台服务支持。某些环节如下:

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

第一点:谷歌Android开发

Point 1: Google Android Developer

作为软输入的方法可以使用​​输入文本的多个和创造性的方式,但不保证该软键盘上的任意键preSS将生成一个键事件:这是留给IME的决定,并且在实际上发送这样的事件被劝阻。你永远不应该依赖于接收的KeyEvents对软输入法的任意键。特别是,默认的软件键盘将永远不会发送任何关键事件的任何应用程序目标定位果冻豆或更高版本,将只发送了删除一些presses事件和返回键,应用程序的目标定位冰淇淋三明治或更早版本。

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

安卓果冻豆是:4.1至4.3.1 安卓冰淇淋三明治:4.0

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

键presses来触发这个监听器的方法,并在事实上鼓励这样做。默认的Andr​​oid键盘不会触发这些的任意键的任何应用程序目标定位果冻豆或更高版本,将只提供它对于一些关键presses应用程序目标定位冰淇淋三明治或更早版本。

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点:堆栈溢出 的KeyEvent只能由活动来处理,因为它们的界面向用户pressing键和只有当他们在前台。甚至在后台运行的服务并不打算对用户的输入作出反应。

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 - 监听器的硬键preSS的背景

Is它可以创建一个Android服务监听硬件密钥presses?

第3点:罗曼盖伊 罗曼盖伊(http://stackoverflow.com/users/298575/romain-guy)谁的作品为谷歌也证实了这一点 onKeyDown在服务? (全球热键)

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

点4 :其他一些参考:

谷歌Android开发人员组: https://开头群体!.google.com /论坛/#主题/ Android的开发者/ O - GUWmqXdI

Google android-developers Group : https://groups.google.com/forum/#!topic/android-developers/o--GUWmqXdI

可以通过使用自定义键盘只能做到:get pressed键,扔在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.