From: Po Lu Date: Sun, 14 Jul 2024 04:46:23 +0000 (+0800) Subject: Do not set LD_LIBRARY_PATH during Android initialization X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8e72547582c215aa99bdb34b67ad4d5194b83f44;p=emacs.git Do not set LD_LIBRARY_PATH during Android initialization * doc/emacs/android.texi (Android Environment): Adjust documentation to match. * java/org/gnu/emacs/EmacsNoninteractive.java (main1): New function. Remove initialization of EmacsNative hither. (main): Acquire an ApplicationInfo or LoadedApk, as the case may be on the host system, derive a ClassLoader from the result, and load and call `main1' from within this class loader. * src/android-emacs.c (main): * src/android.c (setEmacsParams): Do not override LD_LIBRARY_PATH or set EMACS_LD_LIBRARY_PATH. This enables Emacs to execute subprocesses in certain "fortified" Android systems, amongst other things. (cherry picked from commit b00fc31dd1d4543f8b017e8d7fef7686cd430bcc) --- diff --git a/doc/emacs/android.texi b/doc/emacs/android.texi index 250e07d9279..a374d13d67e 100644 --- a/doc/emacs/android.texi +++ b/doc/emacs/android.texi @@ -378,20 +378,18 @@ definition documents, so your mileage may vary. @cindex EMACS_CLASS_PATH environment variable, Android Even when the location of the @command{libandroid-emacs.so} command is -known in advance, special configuration is required to run Emacs from +known in advance, special preparation is required to run Emacs from elsewhere than a subprocess of an existing Emacs session, as it must be made to understand the location of resources and shared libraries in or extracted from the installed application package. The OS command @command{pm path org.gnu.emacs} will print the location of the -application package, and the adjacent @file{lib} directory will hold -shared libraries extracted from the same, though the said command must -be invoked in a peculiar manner to satisfy system restrictions on -communication between pseudoterminal devices created by user -applications and system services such as the package manager, which is -to say, with the standard IO streams redirected to a real file or a -pipe. Such values, once established, must be specified in the -environment variables @code{EMACS_CLASS_PATH} and -@code{EMACS_LD_LIBRARY_PATH}, so that this sample shell script may be +application package, though the said command must be invoked in a +peculiar manner to satisfy system restrictions on communication between +pseudoterminal devices created by user applications and system services +such as the package manager, which is to say, with the standard IO +streams redirected to a real file or a pipe. This value, once +established, must be specified in the environment variables +@code{EMACS_CLASS_PATH}, so that this sample shell script may be installed as @code{emacs} in any location that is accessible: @example @@ -400,7 +398,6 @@ installed as @code{emacs} in any location that is accessible: package_name=`pm path org.gnu.emacs 2>/dev/null