Some APKs overwrite others. Also download most recent f-droid
diff --git a/update.sh b/update.sh
index 7e3ac57..5ccb3ae 100644
--- a/update.sh
+++ b/update.sh
@@ -5,14 +5,14 @@
 addCopy() {
 cat >> Android.mk <<EOF
 include \$(CLEAR_VARS)
-
 LOCAL_MODULE := $2
 LOCAL_MODULE_TAGS := optional
 LOCAL_SRC_FILES := bin/$1
 LOCAL_MODULE_CLASS := APPS
 LOCAL_CERTIFICATE := PRESIGNED
-
+PACKAGES.$2.OVERRIDES := $3
 include \$(BUILD_PREBUILT)
+
 EOF
 echo -e "\t$2 \\" >> apps.mk
 }
@@ -25,6 +25,7 @@
 echo -e 'PRODUCT_PACKAGES += \\' > apps.mk
 
 mkdir -p bin
+#downloadFromFdroid packageName overrides
 downloadFromFdroid() {
 	mkdir -p tmp
 	if [ ! -f tmp/index.xml ];then
@@ -34,38 +35,37 @@
 	fi
 	apk="$(xmlstarlet sel -t -m '//application[id="'"$1"'"]/package[1]' -v ./apkname tmp/index.xml)"
 	wget $repo/$apk -O bin/$apk
-	addCopy $apk $1
+	addCopy $apk $1 "$2"
 }
 
 
 #YouTube viewer
 downloadFromFdroid org.schabi.newpipe
 #Ciphered SMS
-downloadFromFdroid org.smssecure.smssecure
+downloadFromFdroid org.smssecure.smssecure "messaging"
 #Navigation
 downloadFromFdroid net.osmand.plus
 #Web browser
-downloadFromFdroid org.mozilla.fennec_fdroid
+downloadFromFdroid org.mozilla.fennec_fdroid "Browser2 QuickSearchBox"
 #Calendar
-downloadFromFdroid ws.xsoh.etar
+downloadFromFdroid ws.xsoh.etar Calendar
 #Public transportation
 downloadFromFdroid de.grobox.liberario
 #Pdf viewer
 downloadFromFdroid com.artifex.mupdfdemo
 #Keyboard/IME
-downloadFromFdroid com.menny.android.anysoftkeyboard
+downloadFromFdroid com.menny.android.anysoftkeyboard "LatinIME OpenWnn"
 #Play Store download
 downloadFromFdroid com.github.yeriomin.yalpstore
 #Mail client
-downloadFromFdroid com.fsck.k9
+downloadFromFdroid com.fsck.k9 "Email"
 #Ciphered Instant Messaging
 downloadFromFdroid im.vector.alpha
 
 #TODO: Some social network?
 #Facebook? Twitter? Reddit? Mastodon?
 
-wget https://f-droid.org/FDroid.apk -O bin/FDroid.apk
-addCopy FDroid.apk FDroid
+downloadFromFdroid org.fdroid.fdroid
 echo >> apps.mk
 
 rm -Rf tmp