Repository navigation
Closed
Labels
L2 FewLikelihoodOS-androidIssues involving Tailscale for AndroidOS-chromeosP2 AggravatingPriority levelT0 New featureIssue type
Description
Tracking bug for sending/receiving files on Android.
Sending:
- add intent filter, e.g.
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT"/>
<data android:mimeType="application/*" />
<data android:mimeType="audio/*" />
<data android:mimeType="image/*" />
<data android:mimeType="message/*" />
<data android:mimeType="multipart/*" />
<data android:mimeType="text/*" />
<data android:mimeType="video/*" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND_MULTIPLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="application/*" />
<data android:mimeType="audio/*" />
<data android:mimeType="image/*" />
<data android:mimeType="message/*" />
<data android:mimeType="multipart/*" />
<data android:mimeType="text/*" />
<data android:mimeType="video/*" />
<data android:mimeType="text/plain" />
</intent-filter>- upon starting that intent activity, choose a target device to share with (see
tailscale push --targetsimplementation infunc runPushTargetsand how it callstailscale.FileTargets):tailscale/cmd/tailscale/cli/push.go
Line 200 in 3c9dea8
func runPushTargets(ctx context.Context, args []string) error {
Then either do the HTTP PUT to the peer's peerapi URL directly (e.g.
tailscale/cmd/tailscale/cli/push.go
Line 110 in 3c9dea8
| dstURL := peerAPIBase + "/v0/put/" + url.PathEscape(name) |
tailscale/ipn/localapi/localapi.go
Line 334 in 3c9dea8
| func (h *Handler) serveFilePut(w http.ResponseWriter, r *http.Request) { |
Reacted by mx1up
Metadata
Metadata
Assignees
Labels
L2 FewLikelihoodOS-androidIssues involving Tailscale for AndroidOS-chromeosP2 AggravatingPriority levelT0 New featureIssue type
Activity
bradfitz commentedon Apr 27, 2021
For recieving:
tailscale/ipn/backend.go
Line 74 in 3c9dea8
Once a file is fully arrived; fetch it from the "inbox" (app-owned scratch dir) and copy it to the sdcard files/photos area with
tailscale/cmd/tailscale/cli/debug.go
Line 105 in 3c9dea8
bradfitz commentedon Apr 27, 2021
If you have any questions on UI, @rosszurowski can answer questions or share resources from other platforms.
eliasnaur commentedon Apr 27, 2021
Thanks. @rosszurowski if you have iOS designs I'd like to see them so that our implementations won't needlessly differ.
rosszurowski commentedon Apr 27, 2021
Yep! Best to get in sync up-front :)
Our general approach for this feature is using as much native UI as possible.
For sending files, we'll want to hook into Android's native share menu. It looks like apps get to open up a custom view with the selected media/files as an input. We'll leverage that system and introduce a custom view that looks something like the iOS view:
Notes on this design:
CapabilityFileSharingisn't present on the MapResponse)For receiving files, the ideal UI is… practically no UI. Since file transfers are restricted to your own devices for now (no inter-user file transfers), it's fine to automatically accept files and put them in the relevant places.
Here are our iOS designs:
Notes:
tmpfolder and move to the destination once completed. If we need to buffer on Android too, that's perfectly okay :)Phew. Let me know if you have questions or need more context. If there's any piece of this that introduces a lot of complexity, we can figure out a way to scope it down.
I'll let @bradfitz speak to timing, but we're not planning on including this in the v1.8 launch happening soon. This will likely be part of a follow-up patch release or v1.10, so there should be some time to work through the details.
bradfitz commentedon Apr 27, 2021
Note that online/offline is via the new
tailcfg.Node.Online *boolfield. It's nil for devices whose online/offline you're not allowed to know. But it should generally be non-nil for your own devices (the only ones that are valid file sharing targets for now).soniaappasamy commentedon May 4, 2021
We actually have not brought this in on iOS yet, but will probably do so in a future release (unless it makes it in time for 1.8.0). The plan is to do a 5-second poll approach, like Ross said.
Yep, we show the "combined" progress of all of the selected files - so
total bytes transferred / total bytes to send.Yeah, on the iOS side, we show a notification in two cases currently: 1. when a send fails (we notify you that your files could not send) or 2. when receiving files. Both are just using the default iOS persistence length (they dismiss themselves, but are still accessible from the notification center).
Let me know if you need any more context here!
DentonGentry commentedon May 18, 2021
Is there anything more needed to support this for Android?
eliasnaur commentedon May 19, 2021
Nope, the ball is in my court @DentonGentry.
However, now that I'm working on the feature, I'd like to get the device icons for the share dialog and the status icons (error, checkmark). Can you help me here, @rosszurowski? Thanks.
wip: debugging tailscale#1809
eliasnaur commentedon May 31, 2021
I'm stuck. Connection attempts to the peerapi HTTP service seems to be dropped on Android if I connect from Tailscale peers. Local connections to the service does work. Help or pointers are greatly appreciated.
Details:
I'm working on the https://github.com/tailscale/tailscale-android/tree/file-sharing branch, which has a replace to a debugging branch of tailscale.
Netcat works locally:
but not from my tailscaled Linux:
Packages do arrive for remote connections:
but apparently they never reach the listener.
31 remaining items
cmd/tailscale,java: implement file sharing
cmd/tailscale,java: implement file sharing
cmd/tailscale,java: implement file sharing
cmd/tailscale,java: implement file sharing
cmd/tailscale,java: implement file sharing
cmd/tailscale,java: implement file sharing
cmd/tailscale,java: implement file sharing
cmd/tailscale,java: implement file sharing
Maltahl commentedon Jun 30, 2021
The update broke tailscale on my phone. GUI wont load like on #1965
OnePlus 8T running Android 11
danackerson commentedon Jun 30, 2021
Ditto on Pixel 4 XL running Android 11.
DentonGentry commentedon Jun 30, 2021
We'll look at the issue with the 1.10.1 release in #2290.
I had built an APK locally containing the file sharing code tailscale/tailscale-android#14 and didn't run into the issue, presumably the problem is something not directly related to that.
Update to Tailscale 1.10.
Fix routing loop prevention, MagicDNS forwarding over Tailscale.
cmd/tailscale,java: implement file sharing