diff --git a/GNUmakefile b/GNUmakefile
index 980f586b..7e533fda 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -735,7 +735,7 @@ PACKAGE_DIRS := \
deps/prettier/ \
deps/lit/
-RAW_FILES := $(filter-out apps/blog% apps/issues% apps/welcome% apps/journal% %.map, $(shell find $(PACKAGE_DIRS) -type f))
+RAW_FILES := $(filter-out apps/blog% apps/issues% apps/welcome% apps/journal% %.map, $(shell find $(PACKAGE_DIRS) -type f | sort))
out/apk/TildeFriends-arm-debug.unsigned.apk: BUILD_TYPE := debug
out/apk/TildeFriends-arm-release.unsigned.apk: BUILD_TYPE := release
@@ -828,6 +828,7 @@ out/apk/TildeFriends-x86-%.unsigned.apk:
@$(ANDROID_BUILD_TOOLS)/zipalign -f 4 $@.zip $@
out/apk/TildeFriends-%.fdroid.unsigned.apk:
+ @rm -rf out/apk-fdroid-$(BUILD_TYPE) out/apk-fdroid-$(BUILD_TYPE)-raw
@mkdir -p $(dir $@) out/apk-fdroid-$(BUILD_TYPE)/lib/x86_64/ out/apk-fdroid-$(BUILD_TYPE)/lib/x86/ out/apk-fdroid-$(BUILD_TYPE)/lib/arm64-v8a/ out/apk-fdroid-$(BUILD_TYPE)/lib/armeabi-v7a/
@echo "[aapt] $@"
@cp out/android$(BUILD_TYPE)-x86_64/tildefriends out/apk-fdroid-$(BUILD_TYPE)/lib/x86_64/libtildefriends.so
@@ -840,8 +841,11 @@ out/apk/TildeFriends-%.fdroid.unsigned.apk:
@$(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip out/apk-fdroid-$(BUILD_TYPE)/lib/armeabi-v7a/libtildefriends.so
@cp out/apk/res.fdroid.apk $@.zip
@cp out/apk/classes.dex out/apk-fdroid-$(BUILD_TYPE)/classes.dex
- @cd out/apk-fdroid-$(BUILD_TYPE) && zip -u ../../$@.zip -q -9 -r . && cd ../../
- @zip -u $@.zip -q -9 $(RAW_FILES)
+ @touch -d @0 out/apk-fdroid-$(BUILD_TYPE)/lib/*/libtildefriends.so
+ @cd out/apk-fdroid-$(BUILD_TYPE) && zip -X -u ../../$@.zip -q lib/*/libtildefriends.so && cd ../../
+ @mkdir out/apk-fdroid-$(BUILD_TYPE)-raw
+ @for i in $(RAW_FILES); do mkdir -p $$(dirname out/apk-fdroid-$(BUILD_TYPE)-raw/$$i) && cp $$i out/apk-fdroid-$(BUILD_TYPE)-raw/$$i && touch -d @0 out/apk-fdroid-$(BUILD_TYPE)-raw/$$i; done
+ @cd out/apk-fdroid-$(BUILD_TYPE)-raw && pwd && ls && zip -X -u ../../$@.zip -q $$(find . -type f | sort) && cd ../../
@$(ANDROID_BUILD_TOOLS)/zipalign -f 4 $@.zip $@
out/%.apk: out/apk/%.unsigned.apk
diff --git a/src/android/AndroidManifest.xml b/src/android/AndroidManifest.xml
index 9a42a0c8..d95dc2ed 100644
--- a/src/android/AndroidManifest.xml
+++ b/src/android/AndroidManifest.xml
@@ -4,8 +4,8 @@