From 6d3e3cdb5bcfccd103aadfcbb4789ce001bad946 Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Sat, 14 Feb 2026 17:11:26 -0500 Subject: [PATCH] Drop Termux support --- clip/arguments.go | 2 +- clip/clipClearProcess.go | 2 +- clip/copy_TERMUX.go | 30 ----------------------- clip/copy_UNIX.go | 2 +- clip/launchClipClearProcessCLI_GENERIC.go | 2 +- clip/launchClipClearProcessGUI_GENERIC.go | 2 +- clip/totp.go | 2 +- wiki/clipboard.md | 3 --- wiki/developers.md | 3 +-- 9 files changed, 7 insertions(+), 41 deletions(-) delete mode 100644 clip/copy_TERMUX.go diff --git a/clip/arguments.go b/clip/arguments.go index 0e14a96..3b911b0 100644 --- a/clip/arguments.go +++ b/clip/arguments.go @@ -1,4 +1,4 @@ -//go:build (!android && !ios) || termux +//go:build !android && !ios package clip diff --git a/clip/clipClearProcess.go b/clip/clipClearProcess.go index 7337574..182d07d 100644 --- a/clip/clipClearProcess.go +++ b/clip/clipClearProcess.go @@ -1,4 +1,4 @@ -//go:build (!android && !ios) || termux +//go:build !android && !ios package clip diff --git a/clip/copy_TERMUX.go b/clip/copy_TERMUX.go deleted file mode 100644 index 2023cf9..0000000 --- a/clip/copy_TERMUX.go +++ /dev/null @@ -1,30 +0,0 @@ -//go:build android && termux - -package clip - -import ( - "errors" - "os/exec" - - "github.com/rwinkhart/go-boilerplate/back" -) - -// CopyBytes copies a byte slice to the clipboard. -func CopyBytes(clearClipboardAutomatically bool, copySubject []byte) error { - cmd := exec.Command("termux-clipboard-set") - _ = back.WriteToStdinAndZeroizeInput(cmd, copySubject) - if err := cmd.Run(); err != nil { - return errors.New("unable to copy to clipboard: " + err.Error()) - } - if clearClipboardAutomatically { - LaunchClearProcess(copySubject) - } - return nil -} - -// getClipCommands returns the commands for pasting and clearing the clipboard contents. -func getClipCommands() (*exec.Cmd, *exec.Cmd, error) { - cmdClear := exec.Command("termux-clipboard-set") - _ = back.WriteToStdinAndZeroizeInput(cmdClear, nil) - return exec.Command("termux-clipboard-get"), cmdClear, nil -} diff --git a/clip/copy_UNIX.go b/clip/copy_UNIX.go index c0348c7..31c1688 100644 --- a/clip/copy_UNIX.go +++ b/clip/copy_UNIX.go @@ -1,4 +1,4 @@ -//go:build !windows && !darwin && !android && !ios && !termux && !wsl +//go:build !windows && !darwin && !android && !ios && !wsl package clip diff --git a/clip/launchClipClearProcessCLI_GENERIC.go b/clip/launchClipClearProcessCLI_GENERIC.go index 4f40514..954dce8 100644 --- a/clip/launchClipClearProcessCLI_GENERIC.go +++ b/clip/launchClipClearProcessCLI_GENERIC.go @@ -1,4 +1,4 @@ -//go:build !ios && (!android || termux) && !interactive +//go:build !ios && !android && !interactive package clip diff --git a/clip/launchClipClearProcessGUI_GENERIC.go b/clip/launchClipClearProcessGUI_GENERIC.go index 98c2c71..ab634b8 100644 --- a/clip/launchClipClearProcessGUI_GENERIC.go +++ b/clip/launchClipClearProcessGUI_GENERIC.go @@ -1,4 +1,4 @@ -//go:build !ios && (!android || termux) && interactive +//go:build !ios && !android && interactive package clip diff --git a/clip/totp.go b/clip/totp.go index 788c2ee..5284158 100644 --- a/clip/totp.go +++ b/clip/totp.go @@ -1,4 +1,4 @@ -//go:build (!android && !ios) || termux +//go:build !android && !ios package clip diff --git a/wiki/clipboard.md b/wiki/clipboard.md index 59a0b14..820f2bb 100644 --- a/wiki/clipboard.md +++ b/wiki/clipboard.md @@ -6,6 +6,3 @@ The intended way for libmutton to interact with the system clipboard is for it t Clipboard managers save a history of what has been copied to the clipboard, which is already a big enough issue on its own for people who copy sensitive information to their clipboard. Some **clipboard managers simply will not allow the clipboard to be empty** and will replace its contents with the last copied item if you attempt to clear it. One such naughty clipboard manager is **KDE Klipper**, which comes **packaged into KDE Plasma** and is typically **enabled by default** on most distributions. Due to this behavior, **KDE Klipper breaks libmutton's clipboard clearing functionality** and should not be left enabled. It is likely other popular clipboard managers exhibit this behavior. I noticed it with KDE Klipper, which is what prompted me to create this wiki page. **Clipboard managers should not be enabled by default in any environment** or distribution due to their **potential security implications**. -### Termux cannot clear the clipboard from the background -*** -If using libmutton on Termux (Android), the clipboard may not successfully be cleared after the 30-second timeout period if Termux is not actively in the foreground when the sleep timer expires. This is an unfortunate side effect of running on Android and cannot be easily fixed. Due to Termux being at the bottom of the platform support priority list, I will not be investing time in working around this. \ No newline at end of file diff --git a/wiki/developers.md b/wiki/developers.md index a84ccf3..f33e10c 100644 --- a/wiki/developers.md +++ b/wiki/developers.md @@ -12,7 +12,6 @@ Custom build tags can (and sometimes must) be used to achieve desired results. These are as follows: - `interactive`: If making an interactive interface (GUI/TUI/interactive CLI), you probably need to use this build tag. Without it, your entire program will exit after any given operation is completed. This behavior is only desired for non-interactive CLI implementations, such as MUTN. - `wsl`: Allows creating a Linux binary that can interact with the Windows clipboard (for WSL) -- `termux`: Allows creating an Android binary that can interact with the Termux clipboard (for Android) ## Required Global Variable Manipulation - `global.GetPassword` must be set to allow for different types of clients (CLI, GUI, TUI) to prompt for the password in the most appropriate way. @@ -23,7 +22,7 @@ These are as follows: - `startrcwd`: Should be accepted by all libmutton implementations making use of the RCW daemon to cache passwords. Please accept a `startrcwd` argument that calls `crypt.RCWDArgument()`. ## Mobile Clipboard Management -In an effort to reduce dependencies not needed in most environments, libmutton no longer provides clipboard management for mobile platforms (except for Termux). This should be handled by your GUI toolkit/framework. +In an effort to reduce dependencies not needed in most environments, libmutton no longer provides clipboard management for mobile platforms. This should be handled by your GUI toolkit/framework. ## Configuration libmutton-based password manager clients should all share the same JSON configuration file.