vicr123 / QNearbyShare

Nearby Share implementation for Linux
MIT License
115 stars 6 forks source link

Supporting outgoing transfer (sending) to Android #5

Open mochaaP opened 1 year ago

mochaaP commented 1 year ago

See https://github.com/grishka/NearDrop/commit/8f0eccd7b62b380cdff045ef53fe40f087e50e9d for a reference implementation.

mochaaP commented 1 year ago

https://github.com/grishka/NearDrop/issues/4 BLE Stuff: https://github.com/alex9099/SimpleNearby

vicr123 commented 1 year ago

I believe sending is mostly working but it doesn't work with Android and NearDrop for some reason - will have to figure out why :)

ilobilo commented 11 months ago

hello any updates on this?

vicr123 commented 11 months ago

Hi, I haven't started working on this yet. I'll have a look once I have some time :)

vicr123 commented 10 months ago

Did a bit of work on this but now I'm a bit stuck. Android seems to be understanding all the messages until the file payload is actually sent - and then throws an error in logcat.

Read an unencrypted and invalid frame when we expected an encrypted one, discarding. Protocol message contained an invalid tag (zero).

I'll keep digging and post updates when I have something to share :)

vicr123 commented 10 months ago

I believe sending to Android is working now. Please let me know if you come across anything weird!

mochaaP commented 10 months ago

Should also update README for this change.

vicr123 commented 10 months ago

Updated. Not sure if this works with NS on Windows but it would be great if someone could let me know :)

ilobilo commented 10 months ago

I tried sending with qnearbyshare-send to "Nearby Share" on windows and it works but the file name is just random numbers. If I try it the other way around, nearby share says that connection failed.

mochaaP commented 10 months ago

More info: https://github.com/google/nearby/commit/1072030be85a61cef5e0a72b925bd6728e18f320

mochaaP commented 10 months ago

I tried sending with qnearbyshare-send to "Nearby Share" on windows and it works but the file name is just random numbers. If I try it the other way around, nearby share says that connection failed.

Can reproduce on my side with Nearby Share for Windows 1.0.1184.0

mochaaP commented 10 months ago

Sending files from Windows works, though.

vicr123 commented 10 months ago

Guess I'll do some digging - anyone know if NearDrop does the same thing?

mochaaP commented 10 months ago

All good so far (send/recv to Android/Windows), it's just Nearby Share for Windows reporting the wrong filename when receiving from QNearbyShare.

marjus45 commented 8 months ago

Hi @vicr123 , thanks a lot for this project. I am using Arch Linux and I have successfully transferred from Android and received by the QNearbyShare. However when I try to send from QNearbyShare the scan returns no targets:

[mcako@myarch]$ qnearbyshare-send test.pdf
:: Scanning for devices...
  No targets found.

I was wandering if you can give some pointers of how I could debug this. I am thinking if this might be a Permissions/iptables issue. Any input will be appreciated!

vicr123 commented 8 months ago

Hey, they used to have a button in the Google Files app that would open Nearby Share in receive mode, but it looks like they've moved it somewhere and I can't find where they've moved it.

If you can find it though, you'll need to open Nearby Share in receive mode before QNearbyShare can find it.

mentalAdventurer commented 8 months ago

This is very unfortunate. They have completely rearranged the settings for nearby share on my Samsung S20. It's now merged with quick share and for now i can't find any solution to open nearby share in receive mode. Do you have any plans to make qnearbyshare work with pop up notification like it does when sharing with another android phone?

vicr123 commented 8 months ago

I'd love to make that work but I probably need some help with someone who's more familiar than BLE than I am

This seems to also be reported at grishka/NearDrop#150

insalada commented 2 months ago

Neither working for me: I can send files from my Pixel 8 to my Macbook M1, but I can't the other way around. It can't find my phone although quickshare visibility is set to everybody. Weird:

image
ilobilo commented 2 months ago

Neither working for me: I can send files from my Pixel 8 to my Macbook M1, but I can't the other way around. It can't find my phone although quickshare visibility is set to everybody. Weird:

image

try opening activity com.google.android.gms.nearby.sharing.ReceiveSurfaceActivity on your phone. I recommend using Activity Launcher from the play store and setting a shortcut for it on your home screen.