One thing that Join app can’t do and how to fix it with Tasker

How to fix clipboard sharing with Join and Tasker

Join app is pretty much the first app that I load on any phone. I’m used to a single feature, that I no longer can live without. Seamless clipboard sharing between devices is simply magnificent. It saves times, makes things super simple, and the best thing is: once set, you can forget about it. That was until I discovered, that automatic clipboard share isn’t available for “shared devices”. I guess it’s time for Tasker to step in.

Join & clipboard share

I switched to Android 10 recently, and as part of the move, I got myself a 2nd Join licence to run on my notenoughtech account. I didn’t have a particular reason for it since I can do “family share”, but I wanted to do this and see how shared devices would work.

Android 10 and clipboard

Right off the start, I had to go through the new permission procedure to enable clipboard harvesting on Android 10. This is a one time process, as long as you exclude Android 10 from killing Join app (check the battery optimization settings, reboot your phone to remove the annoying reminder). You can use this guide to setup ADB then run these four lines:

adb -d shell appops set com.joaomgcd.join SYSTEM_ALERT_WINDOW allow
adb shell pm grant com.joaomgcd.join android.permission.WRITE_SECURE_SETTINGS
adb shell pm grant com.joaomgcd.join android.permission.READ_LOGS
adb shell am force-stop com.joaomgcd.join 

Now that you are all set, you can share the clipboard between all devices that run a version of Join (Android, Chrome Browser, Windows 10 and even NodeRED) signed in to the same account.

If you have 2 licences for Join app, this option isn’t possible. What’s possible is to use Tasker to fix this. It’s not as simple as you may think.

Loop me NOT!

My initial approach was to use %CLIP variable as a trigger on both devices and share the clipboard each time a new one is assigned. There is a catch. If you do that on both phones, there is a chance you will create a feedback loop if the Join push is delayed a bit. Setting a clipboard on one phone will share the clipboard with another phone, setting the clipboard there… which… you guessed it… will detect clipboard change and repeat the task the other way around.

That’s the easiest way to get in trouble, so let’s fix this. To solve the puzzle, we need Tasker to know when the clipboard is set by Join, and when it’s set by Android. Thankfully, we can sort out with Join and AutoApps commands.

Tasker Project

To make this work, you have to create this Tasker profile on each android device with a different email licence. This profile will be responsible for sharing the clipboard set by Android system and preventing loops.

(ClipShare) CS share clip

TASKER PROFILE: JOIN Command
Profile: CS Share Clip 
    Restore: no
    Event: Variable Set [ Variable:%CLIP Value:* User Variables Only:Off ]
Enter: CS Share Clip 
    A1: Join Send Push [ Configuration:Device: Mat's Pixel 3
Text: clip=:=%CLIP
Join Command: true Timeout (Seconds):60 ] 

To monitor changes made by Android to the clipboard content, use Event – Variable Set – and %CLIP variable. When a new clipboard is set, simply send a Join push message.

The push message can’t set the clipboard directly, otherwise, you will trigger the loop so I’m sending a text: jointextpush=:=clip=:=%CLIP to another Join device licensed to a different email. (to automatically set jointextpush=:= prefix, go to advanced options of Join Push action).

JOIN Command

TASKER PROFILE: JOIN Command
Profile: JOIN Command 
    Restore: no
    Event: AutoApps Command [ Configuration:Command Filter: jointextpush ]
Enter: CS Set Clip 
    A1: If [ %aacomm1 ~ clip ]
    A2: Profile Status [ Name:CS Share Clip Set:Off ] 
    A3: Wait [ MS:0 Seconds:2 Minutes:0 Hours:0 Days:0 ] 
    A4: Set Clipboard [ Text:%aacomm2 Add:Off ] 
    A5: Wait [ MS:0 Seconds:2 Minutes:0 Hours:0 Days:0 ] 
    A6: Profile Status [ Name:CS Share Clip Set:On ] 
    A7: End If 

Before I can apply the new clipboard, I have to use Profile Status action to disable my CS Share Clip profile. I used AutoApps command system to create a universal Join Command profile which uses the following structure:

jointextpush=:=clip=:=%CLIP 
%aacomm1 = clip
%aacomm2 = %CLIP

This way, I can simply add more commands to my profile later using %aacomm1 in my IF conditions. When the AutoApp command is received, Tasker disables the CS Share Clip, sets a new clipboard according to %aacomm2 and enables the SC Share Clip again for further monitoring. I have added 2 wait actions that you can modify accordingly.

Conclusion

I’m pleased with the final effect. I could go back to Join and family library if I wanted to, but this small Tasker project was worth my time, as I like solving small problems. If you use Join on more than one account – perhaps this could be a useful hack to you too! Let me know what other fun things you do with Join app in this Reddit thread.

Support NotEnoughTech
A lot of time and effort goes into keeping NotEnoughTech alive! If my work helped you out, consider buying me a coffee or check out exclusive rewards available to Patreon supporters.
SHARE