Android Key logger

前端 未结 3 1810
春和景丽
春和景丽 2020-12-04 17:12

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

3条回答
  •  日久生厌
    2020-12-04 17:38

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

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

    I have summarized it as follows:

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

    Point 1: Google Android Developer

    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 is: 4.1 to 4.3.1 Android IceCream Sandwich: 4.0

    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/text/method/KeyListener.html

    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 - Listener for hard keys press at background

    Is it possible to create an Android Service that listens for hardware key presses?

    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)

    Point 4: Some Other reference:

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

    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.

提交回复
热议问题