Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept data via Intent and pass them on to the host as keystrokes #19

Closed
wants to merge 1 commit into from

Conversation

DanielWeigl
Copy link
Contributor

@DanielWeigl DanielWeigl commented Nov 19, 2020

Adds new functionality to the MousepadPlugin to accept data via Intent and pass them on to the host as keystrokes via the existing MousePadPlugin.PACKET_TYPE_MOUSEPAD_REQUEST PackageType

This allows other apps to send a Intent:

        Intent sendIntent = new Intent(Intent.ACTION_SEND);
        sendIntent.setType("text/keystrokes");
        sendIntent.putExtra(Intent.EXTRA_TEXT, textToSend);
        if (sendIntent.resolveActivity(this.context.getPackageManager()) != null) {
            this.context.startActivity(sendIntent);
        }

which then shows a confirm dialog and allows to pass the text as keystrokes to the host.
The confirm dialog also has the option to white-list a sending application (by its package name) and allow it to send without confirmation.

This could be used by other apps like password managers or OTP Tools to easily send the code to the desktop.

See here for a screen recording on how it works: https://imgur.com/a/uwjbESq / https://imgur.com/a/cBm5yOi

…t and pass them on to the host as keystrokes via the existing MousePadPlugin.PACKET_TYPE_MOUSEPAD_REQUEST PackageType

 eg. to easily send OTP codes from the phone to the Desktop
@DanielWeigl
Copy link
Contributor Author

Im open for comments/feedback in general and especial on the idea of the Intent.ACTION_SEND with mime type text/keystrokes. Somehow it feels a bit like a hack, but on the other hand i think its a quite general way, that other apps could also implement and then the Android Intent-Chooser allows the user to easily select the app he wants to use to send the keystrokes

DanielWeigl added a commit to DanielWeigl/andOTP that referenced this pull request Nov 19, 2020
…al mime-type "text/keystrokes"

Other apps (like KDE/kdeconnect-android#19 ) could listen for this intents and pass the date on to a connected desktop or other device where the 2FA code is needed
@idoqo
Copy link
Contributor

idoqo commented Nov 19, 2020

Hi, this is actually just a mirror, so I think you'd be better off sending a merge request on GitLab (https://invent.kde.org/network/kdeconnect-android).

See #14 (comment)

@DanielWeigl
Copy link
Contributor Author

Okay, thanks for the headsup... ive moved the PR over to https://invent.kde.org/network/kdeconnect-android/-/merge_requests/220

DanielWeigl added a commit to DanielWeigl/andOTP that referenced this pull request Jan 6, 2021
…al mime-type "text/keystrokes"

Other apps (like KDE/kdeconnect-android#19 ) could listen for this intents and pass the date on to a connected desktop or other device where the 2FA code is needed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants