update.sh aktualisiert

This commit is contained in:
2025-05-23 11:13:16 +02:00
parent 71b9c5cca7
commit 74f998e455

View File

@@ -7,6 +7,13 @@ rm -f repo/entry.jar
# Make sure we have the tools we need # Make sure we have the tools we need
command -v aapt >/dev/null 2>&1 || { echo "Error: aapt is required but not installed. Please install Android SDK build tools."; exit 1; } command -v aapt >/dev/null 2>&1 || { echo "Error: aapt is required but not installed. Please install Android SDK build tools."; exit 1; }
command -v jq >/dev/null 2>&1 || { echo "Error: jq is required but not installed. Please install jq for JSON parsing."; exit 1; }
# Configuration
GITEA_URL="https://git.felo.gg"
REPO_OWNER="FeloStore"
REPO_NAME="Data"
RELEASE_TAG="latest"
# Function to extract version from APK # Function to extract version from APK
get_version() { get_version() {
@@ -28,6 +35,13 @@ update_app() {
# Download to temp file # Download to temp file
wget -q -O "./temp/${app_name}.apk.new" "$app_url" wget -q -O "./temp/${app_name}.apk.new" "$app_url"
# Check if download was successful
if [ ! -f "./temp/${app_name}.apk.new" ] || [ ! -s "./temp/${app_name}.apk.new" ]; then
echo "$app_name: Download failed, skipping..."
rm -f "./temp/${app_name}.apk.new"
return
fi
# Extract version info from the new APK # Extract version info from the new APK
new_version=$(get_version "./temp/${app_name}.apk.new") new_version=$(get_version "./temp/${app_name}.apk.new")
echo " Downloaded version: $new_version" echo " Downloaded version: $new_version"
@@ -54,25 +68,54 @@ update_app() {
fi fi
} }
# Process each app # Function to get app name from filename
update_app "FeloStore" "https://git.felo.gg/FeloStore/Data/releases/download/latest/felostore.apk" get_app_name() {
update_app "YouTube" "https://git.felo.gg/FeloStore/Data/releases/download/latest/youtube.apk" filename=$1
update_app "Reddit" "https://git.felo.gg/FeloStore/Data/releases/download/latest/reddit.apk" # Remove .apk extension and convert to proper case
update_app "Duolingo" "https://git.felo.gg/FeloStore/Data/releases/download/latest/duolingo.apk" app_name=$(basename "$filename" .apk)
update_app "Instagram" "https://git.felo.gg/FeloStore/Data/releases/download/latest/instagram.apk" # Convert first letter to uppercase
update_app "Twitter" "https://git.felo.gg/FeloStore/Data/releases/download/latest/twitter.apk" app_name=$(echo "$app_name" | sed 's/^\(.\)/\U\1/')
update_app "NovaLauncher" "https://git.felo.gg/FeloStore/Data/releases/download/latest/novalauncher.apk" echo "$app_name"
update_app "Busuu" "https://git.felo.gg/FeloStore/Data/releases/download/latest/busuu.apk" }
update_app "Quizlet" "https://git.felo.gg/FeloStore/Data/releases/download/latest/quizlet.apk"
update_app "Telegram" "https://git.felo.gg/FeloStore/Data/releases/download/latest/telegram.apk" echo "Fetching release information from Gitea..."
update_app "Yazio" "https://git.felo.gg/FeloStore/Data/releases/download/latest/yazio.apk"
update_app "WetterOnline" "https://git.felo.gg/FeloStore/Data/releases/download/latest/wetteronline.apk" # Get release information from Gitea API
update_app "CapCut" "https://git.felo.gg/FeloStore/Data/releases/download/latest/capcut.apk" RELEASE_API_URL="${GITEA_URL}/api/v1/repos/${REPO_OWNER}/${REPO_NAME}/releases/tags/${RELEASE_TAG}"
update_app "GuitarTuna" "https://git.felo.gg/FeloStore/Data/releases/download/latest/guitartuna.apk" release_info=$(wget -q -O - "$RELEASE_API_URL")
update_app "Yuka" "https://git.felo.gg/FeloStore/Data/releases/download/latest/yuka.apk"
if [ -z "$release_info" ]; then
echo "Error: Could not fetch release information from Gitea API"
exit 1
fi
# Extract APK download URLs from the release
apk_urls=$(echo "$release_info" | jq -r '.assets[] | select(.name | endswith(".apk")) | .browser_download_url')
if [ -z "$apk_urls" ]; then
echo "Error: No APK files found in the latest release"
exit 1
fi
echo "Found APK files in release:"
echo "$apk_urls" | while read -r url; do
filename=$(basename "$url")
echo " - $filename"
done
# Process each APK
echo "$apk_urls" | while read -r url; do
if [ -n "$url" ]; then
filename=$(basename "$url")
app_name=$(get_app_name "$filename")
update_app "$app_name" "$url"
fi
done
# Clean up temp directory # Clean up temp directory
rm -rf ./temp rm -rf ./temp
# Update the F-Droid repository echo "Updating F-Droid repository..."
/root/.local/bin/fdroid update --clean --allow-disabled-algorithms /root/.local/bin/fdroid update --clean --allow-disabled-algorithms
echo "Done! Repository updated with all available apps."