From e9a39fd89831e83708928409ec473b493845196f Mon Sep 17 00:00:00 2001 From: Po Lu Date: Sat, 15 Jul 2023 09:53:22 +0800 Subject: [PATCH] Update Android port * doc/emacs/android.texi (Android): Add new node to menu. (Android Environment): Add footnote pointing to new node. (Android Software): New node. * doc/emacs/emacs.texi (Top): Add new node to menu. * java/AndroidManifest.xml.in (manifest): Fix location of sharedUserId property. * java/INSTALL: Improve documentation of shared user ID support. --- doc/emacs/android.texi | 45 ++++++++++++++++++++++++++++++++++++- doc/emacs/emacs.texi | 1 + java/AndroidManifest.xml.in | 5 +++-- java/INSTALL | 15 ++++++++++--- 4 files changed, 60 insertions(+), 6 deletions(-) diff --git a/doc/emacs/android.texi b/doc/emacs/android.texi index 3e27c019257..df73ee60c5d 100644 --- a/doc/emacs/android.texi +++ b/doc/emacs/android.texi @@ -21,6 +21,7 @@ about using such devices with Emacs, @pxref{Other Input Devices}. * Android Windowing:: The Android window system. * Android Fonts:: Font selection under Android. * Android Troubleshooting:: Dealing with problems. +* Android Software:: Getting extra software. @end menu @node What is Android? @@ -254,7 +255,12 @@ operating system; however, from the perspective of applications and Emacs, the system has an overwhelming number of users. Each application runs in its own user, with its home directory set -to its app data directory (@pxref{Android File System}.) +to its app data directory (@pxref{Android File +System}.)@footnote{Except in cases where a ``shared user ID'' is +specified and other applications signed using the same ``package +signing key'' are installed, in which case Emacs runs as the same user +and has access to the same files as each of the aformentioned +applications.} Each application is also prohibited from accessing many system directories and the app data directories of other applications. @@ -663,3 +669,40 @@ can then be accessed by any file manager program. If you can find out how to open that documents provider in the file manager that comes with your device, you can rename, delete, or edit your initialization or dump files from there instead. + +@node Android Software +@section Installing extra software on Android +@cindex installing extra software on Android +@cindex installing Unix software on Android + + Android includes an extremely limited set of Unix-like command line +tools in a default installation. Several projects exist to argument +this selection, providing options that range from improved +reproductions of Unix command-line utilities to package repositories +containing extensive collections of free GNU and Unix software. + + @uref{http://busybox.net, Busybox} provides Unix utilities and +limited replicas of certain popular GNU programs such as +@command{wget} in a single statically-linked Linux binary, which is +capable of running under Android. + + @uref{https://termux.dev, Termux} provides a package manager based +on the Debian project's @command{dpkg} system and a set of package +repositories containing substantial amounts of free software for Unix +systems, including compilers, debuggers, and runtimes for languages +such as C, C++, Java, Python and Common Lisp. These packages are +normally installed from within a purpose-built terminal emulator +application, but Emacs can access them if it is built with the same +application signing key as the Termux terminal emulator, and with its +``shared user ID'' set to the package name of the terminal emulator +program. The @file{java/INSTALL} within the Emacs distribution +explains how to build Emacs in this fashion. + + @uref{https://github.com/termux/termux-packages, termux-packages} +provides the package definitions that are used by Termux to generate +their package repositories, which may also be independently compiled +for installation within Emacs's home directory. + + In addition to the projects mentioned above, statically linked +binaries for most Linux kernel-based systems can also be run on +Android. diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi index 7ce1a53f934..92be9f9b9a9 100644 --- a/doc/emacs/emacs.texi +++ b/doc/emacs/emacs.texi @@ -1271,6 +1271,7 @@ Emacs and Android * Android Windowing:: The Android window system. * Android Fonts:: Font selection under Android. * Android Troubleshooting:: Dealing with problems. +* Android Software:: Getting extra software. Emacs and unconventional input devices diff --git a/java/AndroidManifest.xml.in b/java/AndroidManifest.xml.in index 3aae2032fff..895e7f88c57 100644 --- a/java/AndroidManifest.xml.in +++ b/java/AndroidManifest.xml.in @@ -25,6 +25,8 @@ along with GNU Emacs. If not, see . --> android:targetSandboxVersion="1" android:installLocation="auto" android:requestLegacyExternalStorage="true" + @ANDROID_SHARED_USER_ID@ + @ANDROID_SHARED_USER_NAME@ android:versionCode="@emacs_major_version@" android:versionName="@version@"> @@ -74,8 +76,7 @@ along with GNU Emacs. If not, see . --> android:supportsRtl="true" android:theme="@style/EmacsStyle" android:debuggable="@ANDROID_DEBUGGABLE@" - @ANDROID_SHARED_USER_ID@ - @ANDROID_SHARED_USER_NAME@ + android:allowBackup="true" android:extractNativeLibs="true">