update.sh aktualisiert
This commit is contained in:
32
update.sh
32
update.sh
@@ -1,12 +1,16 @@
|
||||
#!/bin/bash
|
||||
cd /var/www/html || exit 1
|
||||
|
||||
# First, let's clear the F-Droid index
|
||||
rm -f repo/index*
|
||||
rm -f repo/entry.jar
|
||||
# Fix permissions on config.yml
|
||||
chmod 0600 config.yml
|
||||
|
||||
# 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; }
|
||||
# Create repo icon directory if it doesn't exist
|
||||
mkdir -p repo/icons
|
||||
# Create a basic repo icon if missing (you can replace this with your own icon later)
|
||||
if [ ! -f repo/icons/icon.png ]; then
|
||||
echo "Creating placeholder repo icon..."
|
||||
convert -size 512x512 xc:blue -fill white -gravity center -pointsize 70 -annotate 0 "F-Droid\nRepo" repo/icons/icon.png
|
||||
fi
|
||||
|
||||
# Function to extract version from APK
|
||||
get_version() {
|
||||
@@ -28,6 +32,13 @@ update_app() {
|
||||
# Download to temp file
|
||||
wget -q -O "./temp/${app_name}.apk.new" "$app_url"
|
||||
|
||||
# Check if download was successful
|
||||
if [ ! -s "./temp/${app_name}.apk.new" ]; then
|
||||
echo " ✗ Failed to download $app_name, skipping"
|
||||
rm -f "./temp/${app_name}.apk.new"
|
||||
return
|
||||
fi
|
||||
|
||||
# Extract version info from the new APK
|
||||
new_version=$(get_version "./temp/${app_name}.apk.new")
|
||||
echo " Downloaded version: $new_version"
|
||||
@@ -70,5 +81,12 @@ update_app "Telegram" "https://git.felo.gg/FeloStore/Data/releases/download/late
|
||||
# Clean up temp directory
|
||||
rm -rf ./temp
|
||||
|
||||
# Update the F-Droid repository
|
||||
fdroid update --clean
|
||||
# Add flag to accept unsigned APKs in fdroid
|
||||
echo "Updating F-Droid repository, accepting unsigned APKs..."
|
||||
fdroid update --allow-disabled-algorithms --use-date-from-apk --clean
|
||||
|
||||
# If there are issues, try to force update
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "First update attempt failed, trying with additional flags..."
|
||||
fdroid update --create-metadata --delete-unknown --allow-disabled-algorithms --use-date-from-apk --clean
|
||||
fi
|
||||
Reference in New Issue
Block a user