android: migrate from lzma to zip file

pull/5252/head
Martín Fernández 5 years ago
parent a47b3b1a5b
commit 4910dbc6d2

@ -346,11 +346,24 @@ androidupdate: all
-rm $(ANDROID_LAUNCHER_DIR)/assets/module/koreader-*
# in runtime luajit-launcher's libluajit.so will be loaded
-rm $(INSTALL_DIR)/koreader/libs/libluajit.so
# make android update apk
cd $(INSTALL_DIR)/koreader && 7z a -l -m0=lzma2 -mx=1 \
../../$(ANDROID_LAUNCHER_DIR)/assets/module/koreader-$(VERSION).7z * \
-x!resources/fonts -x!resources/icons/src -x!spec
$(MAKE) -C $(ANDROID_LAUNCHER_DIR) $(if $(KODEBUG), debug, release) ANDROID_APPNAME=KOReader ANDROID_VERSION=$(ANDROID_VERSION) ANDROID_NAME=$(ANDROID_NAME) ANDROID_FLAVOR=$(ANDROID_FLAVOR)
# assets are compressed manually and stored inside the APK.
cd $(INSTALL_DIR)/koreader && zip -r9 \
../../$(ANDROID_LAUNCHER_DIR)/assets/module/koreader-$(VERSION).zip * \
--exclude=*resources/fonts* \
--exclude=*resources/icons/src* \
--exclude=*share/man* \
--exclude=*spec* \
--exclude=*COPYING* \
--exclude=*README.md*
# make the android APK
$(MAKE) -C $(ANDROID_LAUNCHER_DIR) $(if $(KODEBUG), debug, release) \
ANDROID_APPNAME=KOReader \
ANDROID_VERSION=$(ANDROID_VERSION) \
ANDROID_NAME=$(ANDROID_NAME) \
ANDROID_FLAVOR=$(ANDROID_FLAVOR)
cp $(ANDROID_LAUNCHER_DIR)/bin/NativeActivity.apk \
koreader-android-$(ANDROID_ARCH)$(KODEDUG_SUFFIX)-$(VERSION).apk

12
kodev

@ -9,15 +9,7 @@ fi
# Default Android build to arm.
ANDROID_ARCH="${ANDROID_ARCH:-arm}"
if [ -z "${ANDROID_FULL_ARCH}" ]; then
if [ "${ANDROID_ARCH}" = "arm" ]; then
ANDROID_FULL_ARCH_APK="${ANDROID_FULL_ARCH_APK:-arm-linux-androideabi}"
elif [ "${ANDROID_ARCH}" = "x86" ]; then
ANDROID_FULL_ARCH_APK="${ANDROID_FULL_ARCH_APK:-i686-linux-android}"
else
ANDROID_FULL_ARCH_APK="${ANDROID_ARCH}"
fi
fi
# Default to Android 4.0+; required for NDK 15 but with a custom NDK the strict minimum is 9.
NDKABI=${NDKABI:-14}
export NDKABI
@ -625,7 +617,7 @@ TARGET:
# uninstall existing package to make sure *everything* is gone from memory
# no assert_ret_zero; uninstall is allowed to fail if there's nothing to uninstall
adb uninstall "org.koreader.launcher"
adb install "koreader-android-${ANDROID_FULL_ARCH_APK}${KODEBUG_SUFFIX}-${VERSION}.apk"
adb install "koreader-android-${ANDROID_ARCH}${KODEBUG_SUFFIX}-${VERSION}.apk"
assert_ret_zero $?
# there's no adb run so we do this…
adb shell monkey -p org.koreader.launcher -c android.intent.category.LAUNCHER 1

Loading…
Cancel
Save