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

android: add INIT_WITH_AUTHKEY intent #122

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bradfitz
Copy link
Member

@bradfitz bradfitz commented Aug 7, 2023

e.g.
adb shell am broadcast -n com.tailscale.ipn/.IPNReceiver -a com.tailscale.ipn.INIT_WITH_AUTHKEY --es authkey "my-super-secret-authkey"

e.g.
adb shell am broadcast  -n com.tailscale.ipn/.IPNReceiver -a com.tailscale.ipn.INIT_WITH_AUTHKEY --es authkey "my-super-secret-authkey"

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
@bradfitz
Copy link
Member Author

bradfitz commented Aug 7, 2023

Some corners were cut but it seems to work.

@@ -60,6 +60,7 @@
<intent-filter>
<action android:name="com.tailscale.ipn.CONNECT_VPN" />
<action android:name="com.tailscale.ipn.DISCONNECT_VPN" />
<action android:name="com.tailscale.ipn.INIT_WITH_AUTHKEY" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I'm reading this correctly, any app can send a disconnect broadcast, then this and cause the device to join a particular tailnet. We need to make sure this intent is not callable or receivable by other applications.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this be len(b.backend.ListProfiles()) == 0 ? If any authenticated profiles exist, whether actively logged in or not, then we wouldn't accept an authkey?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I didn't finish this part.

@bradfitz
Copy link
Member Author

bradfitz commented Aug 8, 2023

Including video here too. Not shown, the ADB commands...

adb install -r tailscale-debug.apk
adb shell am start -n com.tailscale.ipn/com.tailscale.ipn.IPNActivity
adb shell am broadcast -n com.tailscale.ipn/.IPNReceiver -a com.tailscale.ipn.INIT_WITH_AUTHKEY --es authkey "tskey-auth-......"
Screen.Recording.2023-08-07.at.1.39.03.PM.mov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants