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.
This commit is contained in:
Po Lu 2023-07-15 09:53:22 +08:00
parent b6be92ffb6
commit e9a39fd898
4 changed files with 60 additions and 6 deletions

View file

@ -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.

View file

@ -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

View file

@ -25,6 +25,8 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. -->
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 <https://www.gnu.org/licenses/>. -->
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">
<activity android:name="org.gnu.emacs.EmacsActivity"

View file

@ -161,15 +161,24 @@ to provide both debug and release versions.
BUILDING WITH A SHARED USER ID
Sometimes it may be desirable to build Emacs so that it is able to
access executables from another program. To achieve this, that other
program must have a ``shared user ID'', and be signed with the same
signing key used to sign Emacs (normally `emacs.keystore'.)
access executables and application data from another program. To
achieve this, that other program must have a ``shared user ID'', and
be signed with the same signing key used to sign Emacs (normally
`emacs.keystore'.)
Once you have both that signing key and its ``shared user ID'', you
can give it to configure:
./configure --with-shared-user-id=MY.SHARED.USER.ID
For instance,
./configure --with-shared-user-id=com.termux
will result in Termux (https://termux.dev)'s application data being
accessible to Emacs, within its own application data directory located
at `/data/data/com.termux/files'.
Don't do this if you already have Emacs installed with a different
shared user ID, as the system does not allow programs to change their
user IDs after being installed.