diff --git a/.gitignore b/.gitignore index 877f52a..5aa13f4 100644 --- a/.gitignore +++ b/.gitignore @@ -13,4 +13,6 @@ sensitive.py /ctabus_venv/* .venv *.json -.dir-locals.el \ No newline at end of file +.dir-locals.el +/build +/dist diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..bb72412 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1 @@ +include ctabus/internal/echo_if_exists.sh \ No newline at end of file diff --git a/ctabus/internal/echo_if_exists.sh b/ctabus/internal/echo_if_exists.sh new file mode 100755 index 0000000..0dbb99b --- /dev/null +++ b/ctabus/internal/echo_if_exists.sh @@ -0,0 +1,4 @@ +#!/system/xbin/ash +if [ -e $2 ]; then + echo -n $1 > $2 +fi diff --git a/ctabus/internal/notification.py b/ctabus/internal/notification.py index 8ece6a6..058021b 100755 --- a/ctabus/internal/notification.py +++ b/ctabus/internal/notification.py @@ -1,5 +1,6 @@ from concurrent.futures import ThreadPoolExecutor import os +import shlex import shutil import subprocess import uuid @@ -79,7 +80,16 @@ class NotificationManager: "--priority", "high", "--on-delete", - "echo {} > {}".format(self.id, self.listen_fifo_path), + "{} {} {}".format( + *map( + shlex.quote, + ( + os.path.join(os.path.dirname(__file__), "echo_if_exists.sh"), + self.id, + self.listen_fifo_path, + ), + ) + ), ] message = self.message if self.message is not None else "Placeholder" diff --git a/setup.py b/setup.py index a719e93..22b9065 100644 --- a/setup.py +++ b/setup.py @@ -11,6 +11,7 @@ setup( author="rlbr", author_email="raphael.roberts48@gmail.com", packages=find_packages(), + include_package_data=True, entry_points={"console_scripts": ["ctabus=ctabus.__main__:main"]}, classifiers=[ "License :: OSI Approved :: MIT License",