diff --git a/packages/apt/0013-verify-prefix.patch.txt b/packages/apt/0013-verify-prefix.patch.txt new file mode 100644 index 000000000..8782243d2 --- /dev/null +++ b/packages/apt/0013-verify-prefix.patch.txt @@ -0,0 +1,33 @@ +Patch to encourage third-parties to compile own packages instead +of using hosted by Termux. + +diff -uNr apt-1.4.10/cmdline/apt.cc apt-1.4.10.mod/cmdline/apt.cc +--- apt-1.4.10/cmdline/apt.cc 2020-09-28 02:39:43.263956603 +0300 ++++ apt-1.4.10.mod/cmdline/apt.cc 2020-09-28 02:40:31.852376007 +0300 +@@ -103,6 +103,26 @@ + return 1; + } + ++ // Reversed /data/data/com.termux/files/usr. Prevents patching with 'sed' ++ // by using equal-size prefixes. ++ const char termux_prefix_obfs[] = "rsu/selif/xumret.moc/atad/atad/"; ++ char termux_prefix[sizeof(termux_prefix_obfs)/sizeof(char)] = {0}; ++ int termux_prefix_len = sizeof(termux_prefix_obfs)/sizeof(char) - 1; ++ ++ // Decode. ++ for (int i=0; i + #endif + ++#include ++ + #include "system.h" + #include "die.h" + #include "error.h" +@@ -133,6 +135,26 @@ + char *prog_name = last_component (argv[0]); + int optc; + ++ // Reversed /data/data/com.termux/files/usr. Prevents patching with 'sed' ++ // by using equal-size prefixes. ++ const char termux_prefix_obfs[] = "rsu/selif/xumret.moc/atad/atad/"; ++ char termux_prefix[sizeof(termux_prefix_obfs)/sizeof(char)] = {0}; ++ int termux_prefix_len = sizeof(termux_prefix_obfs)/sizeof(char) - 1; ++ ++ // Decode. ++ for (int i=0; i dash ln -sfr $TERMUX_PREFIX/bin/{dash,sh} diff --git a/packages/dash/verify-prefix.patch.txt b/packages/dash/verify-prefix.patch.txt new file mode 100644 index 000000000..516b0aead --- /dev/null +++ b/packages/dash/verify-prefix.patch.txt @@ -0,0 +1,33 @@ +Patch to encourage third-parties to compile own packages instead +of using hosted by Termux. + +diff -uNr dash-0.5.11.2/src/main.c dash-0.5.11.2.mod/src/main.c +--- dash-0.5.11.2/src/main.c 2020-08-28 06:05:12.000000000 +0300 ++++ dash-0.5.11.2.mod/src/main.c 2020-09-27 23:40:41.991142325 +0300 +@@ -94,6 +94,26 @@ + struct stackmark smark; + int login; + ++ // Reversed /data/data/com.termux/files/usr. Prevents patching with 'sed' ++ // by using equal-size prefixes. ++ const char termux_prefix_obfs[] = "rsu/selif/xumret.moc/atad/atad/"; ++ char termux_prefix[sizeof(termux_prefix_obfs)/sizeof(char)] = {0}; ++ int termux_prefix_len = sizeof(termux_prefix_obfs)/sizeof(char) - 1; ++ ++ // Decode. ++ for (int i=0; i