diff --git a/lib/sshyp.py b/lib/sshyp.py index 644041a..31886c8 100755 --- a/lib/sshyp.py +++ b/lib/sshyp.py @@ -569,7 +569,8 @@ def copy_data(): # Termux (Android) clipboard detection elif isdir("/data/data/com.termux"): run(('termux-clipboard-set', _copy_subject)) - Popen("sleep 30; termux-clipboard-set ''", shell=True) + Popen(f"sleep 30; test \'{_hash.hexdigest() + 2 * ' ' + '-'}\' = \"$(printf \"$(termux-clipboard-get)\" | " + f"sha512sum)\" && termux-clipboard-set ''", shell=True) # X11 clipboard detection elif 'DISPLAY' in environ: run(('xclip', '-sel', 'c'), stdin=Popen(('printf', _copy_subject.replace('\\', '\\\\') diff --git a/port-jobs/CLIPBOARD.py b/port-jobs/CLIPBOARD.py index a9ee081..c3f5503 100755 --- a/port-jobs/CLIPBOARD.py +++ b/port-jobs/CLIPBOARD.py @@ -22,7 +22,8 @@ if len(arguments) > 0: Popen('sleep 30; clipboard -r', shell=True)""" elif arguments[0] == 'TERMUX': replacement = """run(('termux-clipboard-set', _copy_subject)) - Popen("sleep 30; termux-clipboard-set ''", shell=True)""" + Popen(f"sleep 30; test \\'{_hash.hexdigest() + 2 * ' ' + '-'}\\' = \\"$(printf \\"$(termux-clipboard-get)\\" | " + f"sha512sum)\\" && termux-clipboard-set ''", shell=True)""" elif arguments[0] == 'LINUX': replacement = """if 'WAYLAND_DISPLAY' in environ: run('wl-copy', stdin=Popen(('printf', _copy_subject