Add Emacs icon for Android package

* java/AndroidManifest.xml.in: Add new icon.
* java/Makefile.in (srcdir): New variable.
(JAVA_FILES, RESOURCE_FILES): Update variables.
(emacs.apk-in): Apply resources.
* java/README: Describe directory tree.
This commit is contained in:
Po Lu 2023-02-02 10:31:10 +08:00
parent 718b1d73d7
commit aa32c9b78b
3 changed files with 15 additions and 5 deletions

View file

@ -62,6 +62,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. -->
<application android:name="org.gnu.emacs.EmacsApplication"
android:label="Emacs"
android:icon="@drawable/emacs"
android:hardwareAccelerated="true"
android:supportsRtl="true"
android:theme="@android:style/Theme"

View file

@ -19,6 +19,7 @@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
srcdir = @srcdir@
version = @version@
# This is the host lib-src and lib, not the cross compiler's lib-src.
@ -56,7 +57,8 @@ SIGN_EMACS = -keystore emacs.keystore -storepass emacs1 $(JARSIGNER_FLAGS)
SIGN_EMACS_V2 = sign --v2-signing-enabled --ks emacs.keystore \
--debuggable-apk-permitted --ks-pass pass:emacs1
JAVA_FILES = $(shell find . -type f -name *.java)
JAVA_FILES = $(wildcard $(srcdir)/org/gnu/emacs/*.java)
RESOURCE_FILES = $(wildcard $(srcdir)/res/drawable/*)
CLASS_FILES = $(foreach file,$(JAVA_FILES),$(basename $(file)).class)
# Compute the name for the Emacs application package. This should be:
@ -112,7 +114,7 @@ $(libsrc)/asset-directory-tool:
$(MAKE) -C $(libsrc) $(notdir $@)
emacs.apk-in: $(CROSS_BINS) $(CROSS_LIBS) $(libsrc)/asset-directory-tool \
AndroidManifest.xml $(NDK_BUILD_SHARED)
AndroidManifest.xml $(NDK_BUILD_SHARED) $(RESOURCE_FILES)
# Make the working directory for this stuff
rm -rf install_temp
mkdir -p install_temp/lib/$(ANDROID_ABI)
@ -158,9 +160,11 @@ ifneq ($(NDK_BUILD_SHARED),)
endif
# Package everything. Specifying the assets on this command line is
# necessary for AAssetManager_getNextFileName to work on old versions
# of Android.
$(AAPT) package -I "$(ANDROID_JAR)" -F $@ -f \
-M AndroidManifest.xml -A install_temp/assets
# of Android. Make sure not to generate R.java, as it's not required
# by Emacs.
$(AAPT) package -I "$(ANDROID_JAR)" -F $@ -f \
-M AndroidManifest.xml -A install_temp/assets \
-S res -J install_temp
pushd install_temp; $(AAPT) add ../$@ `find lib -type f`; popd
rm -rf install_temp

View file

@ -2,6 +2,11 @@ This directory holds the Java sources of the port of GNU Emacs to
Android-like systems, along with files needed to create an application
package out of them.
The ``org/gnu/emacs'' subdirectory contains the Java sources under the
``org.gnu.emacs'' package identifier.
The ``res'' directory contains resources, mainly the Emacs icon.
`emacs.keystore' is the signing key used to build Emacs. It is kept
here, and we encourage all people redistributing Emacs to use this
key. It holds no security value, and otherwise it will be impossible