diff --git a/mobile/extract-version.py b/mobile/extract-version.py new file mode 100755 index 0000000..72eb49f --- /dev/null +++ b/mobile/extract-version.py @@ -0,0 +1,12 @@ +#!/usr/bin/python3 + +import json + +with open("package.json", "r") as f: + version = json.load(f)["version"] + +with open("version.txt", "w") as f: + f.write("version: {}\n".format(version)) + versionCode = sum([int(x) if len(x) > 1 else int(x) * 10 + for x in version.split(".")]) + f.write("versionCode: {}\n".format(versionCode)) diff --git a/mobile/fdroid-prepare.sh b/mobile/fdroid-prepare.sh new file mode 100755 index 0000000..ca43c35 --- /dev/null +++ b/mobile/fdroid-prepare.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +dir="./node_modules/@capacitor/android/capacitor" + +# remove lines related to play service/firebase dependencies +sed -i '/playServices/d' "$dir/build.gradle" +sed -i '/firebase/d' "$dir/build.gradle" + +# remove the files that rely on the proprietary services +rm -f "$dir/src/main/java/com/getcapacitor/plugin/Geolocation.java" +rm -f "$dir/src/main/java/com/getcapacitor/plugin/PushNotifications.java" +rm -f "$dir/src/main/java/com/getcapacitor/CapacitorFirebaseMessagingService.java" + +# remove the references to the plugins in Bridge.java +sed -i '/Geolocation/d' "$dir/src/main/java/com/getcapacitor/Bridge.java" +sed -i '/PushNotifications/d' "$dir/src/main/java/com/getcapacitor/Bridge.java" + +# remove unecessary permissions and now redundant lines from manifest +sed -i '/WAKE_LOCK/d' "$dir/src/main/AndroidManifest.xml" +sed -i '/RECEIVE_BOOT_COMPLETED/d' "$dir/src/main/AndroidManifest.xml" +i=$(grep -n "firebase_messaging_auto_init_enabled" "$dir/src/main/AndroidManifest.xml" | cut -d : -f 1) +sed -i "$i,$(($i+12))d" "$dir/src/main/AndroidManifest.xml" 2> /dev/null diff --git a/mobile/version.txt b/mobile/version.txt new file mode 100644 index 0000000..2e31ee4 --- /dev/null +++ b/mobile/version.txt @@ -0,0 +1,2 @@ +version: 2.0.3 +versionCode: 50