From 3ef8698f429debe4f4c07488f4e2dd7c5afad8ea Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Fri, 2 Aug 2024 20:07:21 -0400 Subject: [PATCH] Put android:versionCode and such back in the static AndroidManifest.xml. I forgot that F-Droid needs to see it. --- GNUmakefile | 15 +++++++++------ src/android/AndroidManifest.xml | 2 ++ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 3d320984..980f586b 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -675,6 +675,15 @@ src/version.h : $(firstword $(MAKEFILE_LIST)) @echo "#define VERSION_NUMBER \"$(VERSION_NUMBER)\"" > $@ @echo "#define VERSION_NAME \"$(VERSION_NAME)\"" >> $@ +src/android/AndroidManifest.xml : $(firstword $(MAKEFILE_LIST)) + @echo "[android_version] $@" + @sed -i \ + -e 's/versionCode=".*"/versionCode="$(VERSION_CODE)"/' \ + -e 's/versionName=".*"/versionName="$(VERSION_NUMBER)"/' \ + -e 's/android:minSdkVersion="[[:digit:]]*"/android:minSdkVersion="$(ANDROID_MIN_SDK_VERSION)"/' \ + -e 's/android:targetSdkVersion="[[:digit:]]*"/android:targetSdkVersion="$(ANDROID_TARGET_SDK_VERSION)"/' \ + $@ + # Android support. out/res/layout_activity_main.xml.flat: src/android/res/layout/activity_main.xml @mkdir -p $(dir $@) @@ -690,8 +699,6 @@ out/apk/res.apk out/gen/com/unprompted/tildefriends/R.java: out/res/layout_activ @echo [aapt2 link] res.apk @mkdir -p out/apk/ @$(ANDROID_BUILD_TOOLS)/aapt2 link -I $(ANDROID_PLATFORM)/android.jar out/res/layout_activity_main.xml.flat out/res/drawable_icon.xml.flat \ - --version-code $(VERSION_CODE) \ - --version-name $(VERSION_NUMBER) \ --min-sdk-version $(ANDROID_MIN_SDK_VERSION) \ --target-sdk-version $(ANDROID_TARGET_SDK_VERSION) \ --manifest src/android/AndroidManifest.xml \ @@ -702,8 +709,6 @@ out/apk/res.fdroid.apk out/gen_fdroid/com/unprompted/tildefriends/R.java: out/re @echo [aapt2 link] res.fdroid.apk @mkdir -p out/apk/ @$(ANDROID_BUILD_TOOLS)/aapt2 link -I $(ANDROID_PLATFORM)/android.jar out/res/layout_activity_main.xml.flat out/res/drawable_icon.xml.flat \ - --version-code $(VERSION_CODE) \ - --version-name $(VERSION_NUMBER) \ --min-sdk-version $(ANDROID_MIN_SDK_VERSION) \ --target-sdk-version $(ANDROID_TARGET_SDK_VERSION) \ --rename-manifest-package com.unprompted.tildefriends.fdroid \ @@ -753,8 +758,6 @@ out/TildeFriends.aab: out/apk/classes.dex $(filter-out %debug%, $(ANDROID_TARGET @mkdir -p out/aab/staging @$(ANDROID_BUILD_TOOLS)/aapt2 link --proto-format -o out/aab/temporary.apk \ -I $(ANDROID_PLATFORM)/android.jar \ - --version-code $(VERSION_CODE) \ - --version-name $(VERSION_NUMBER) \ --min-sdk-version $(ANDROID_MIN_SDK_VERSION) \ --target-sdk-version $(ANDROID_TARGET_SDK_VERSION) \ --manifest src/android/AndroidManifest.xml \ diff --git a/src/android/AndroidManifest.xml b/src/android/AndroidManifest.xml index 7a9a1c0f..9a42a0c8 100644 --- a/src/android/AndroidManifest.xml +++ b/src/android/AndroidManifest.xml @@ -4,6 +4,8 @@