update.sh aktualisiert
This commit is contained in:
70
update.sh
70
update.sh
@@ -1,21 +1,18 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
cd /var/www/html || exit 1
|
cd /var/www/html || exit 1
|
||||||
|
|
||||||
# Fix permissions on config.yml
|
# Fix permissions on config.yml if it exists
|
||||||
chmod 0600 config.yml
|
if [ -f config.yml ]; then
|
||||||
|
chmod 0600 config.yml
|
||||||
|
fi
|
||||||
|
|
||||||
# Create repo icon directory if it doesn't exist
|
# Create repo icon directory if it doesn't exist
|
||||||
mkdir -p repo/icons
|
mkdir -p repo/icons
|
||||||
# Create a basic repo icon if missing
|
# Create a basic repo icon if missing
|
||||||
if [ ! -f repo/icons/icon.png ]; then
|
if [ ! -f repo/icons/icon.png ]; then
|
||||||
echo "Creating placeholder repo icon..."
|
echo "Creating placeholder repo icon..."
|
||||||
# Try to create an icon using ImageMagick if available
|
# Try to download a simple icon
|
||||||
if command -v convert >/dev/null 2>&1; then
|
wget -q -O repo/icons/icon.png "https://f-droid.org/assets/favicon-256.png" || echo "Could not create icon, please add one manually"
|
||||||
convert -size 512x512 xc:blue -fill white -gravity center -pointsize 70 -annotate 0 "F-Droid\nRepo" repo/icons/icon.png
|
|
||||||
else
|
|
||||||
# Fallback to downloading a simple icon
|
|
||||||
wget -q -O repo/icons/icon.png "https://f-droid.org/assets/favicon-256.png" || echo "Could not create icon, please add one manually"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Function to extract version from APK (if aapt is available)
|
# Function to extract version from APK (if aapt is available)
|
||||||
@@ -75,17 +72,8 @@ update_app() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Make sure archive directory exists and check for archived APKs
|
# Make sure archive directory exists
|
||||||
mkdir -p archive/
|
mkdir -p archive/
|
||||||
# Check if any apps are in archive and restore them to repo
|
|
||||||
echo "Checking for archived APKs to restore..."
|
|
||||||
for app in YouTube Reddit SoundCloud Duolingo GoogleNews Instagram Twitter NovaLauncher Busuu Quizlet Telegram; do
|
|
||||||
if [ -f "archive/${app}.apk" ]; then
|
|
||||||
echo "Restoring ${app}.apk from archive to repo"
|
|
||||||
cp "archive/${app}.apk" "repo/${app}.apk"
|
|
||||||
touch -d "$(date +%Y-%m-%d)" "repo/${app}.apk"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# Process each app
|
# Process each app
|
||||||
update_app "YouTube" "https://github.com/FiorenMas/Revanced-And-Revanced-Extended-Non-Root/releases/download/all/youtube-revanced-extended.apk"
|
update_app "YouTube" "https://github.com/FiorenMas/Revanced-And-Revanced-Extended-Non-Root/releases/download/all/youtube-revanced-extended.apk"
|
||||||
@@ -103,37 +91,29 @@ update_app "Telegram" "https://git.felo.gg/FeloStore/Data/releases/download/late
|
|||||||
# Clean up temp directory
|
# Clean up temp directory
|
||||||
rm -rf ./temp
|
rm -rf ./temp
|
||||||
|
|
||||||
# Create or update fdroidserver config to accept unsigned APKs
|
# Check for archived APKs and restore them to repo
|
||||||
mkdir -p ~/.config/fdroidserver/
|
echo "Checking for archived APKs to restore..."
|
||||||
echo "accept_bad_certificate: True" > ~/.config/fdroidserver/config.yml
|
|
||||||
echo "allow_disabled_algorithms: True" >> ~/.config/fdroidserver/config.yml
|
|
||||||
|
|
||||||
# Update config to explicitly allow unsigned APKs
|
|
||||||
if [ -f config.yml ]; then
|
|
||||||
if ! grep -q "disable_apk_signing:" config.yml; then
|
|
||||||
echo "disable_apk_signing: True" >> config.yml
|
|
||||||
fi
|
|
||||||
if ! grep -q "allow_disabled_algorithms:" config.yml; then
|
|
||||||
echo "allow_disabled_algorithms: True" >> config.yml
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Update F-Droid repository with special flags for unsigned APKs
|
|
||||||
echo "Updating F-Droid repository with special settings for unsigned APKs..."
|
|
||||||
fdroid update --create-metadata --no-check-certificate --allow-disabled-algorithms --use-date-from-apk --delete-unsigned --disable-apk-signing
|
|
||||||
|
|
||||||
# After update, copy any moved files back from archive to repo
|
|
||||||
echo "Checking if any APKs were moved to archive..."
|
|
||||||
for app in YouTube Reddit SoundCloud Duolingo GoogleNews Instagram Twitter NovaLauncher Busuu Quizlet Telegram; do
|
for app in YouTube Reddit SoundCloud Duolingo GoogleNews Instagram Twitter NovaLauncher Busuu Quizlet Telegram; do
|
||||||
if [ -f "archive/${app}.apk" ] && [ ! -f "repo/${app}.apk" ]; then
|
if [ -f "archive/${app}.apk" ]; then
|
||||||
echo "Restoring ${app}.apk from archive to repo after update"
|
echo "Restoring ${app}.apk from archive to repo"
|
||||||
cp "archive/${app}.apk" "repo/${app}.apk"
|
cp "archive/${app}.apk" "repo/${app}.apk"
|
||||||
touch -d "$(date +%Y-%m-%d)" "repo/${app}.apk"
|
touch -d "$(date +%Y-%m-%d)" "repo/${app}.apk"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# Final update to include any restored files
|
# Add option to config to accept unsigned APKs
|
||||||
echo "Running final update..."
|
if [ -f config.yml ]; then
|
||||||
fdroid update --no-check-certificate --allow-disabled-algorithms --use-date-from-apk --disable-apk-signing
|
if ! grep -q "allow_disabled_algorithms:" config.yml; then
|
||||||
|
echo "allow_disabled_algorithms: True" >> config.yml
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Update F-Droid repository with only supported flags
|
||||||
|
echo "Updating F-Droid repository..."
|
||||||
|
fdroid update --allow-disabled-algorithms --use-date-from-apk --create-metadata --clean
|
||||||
|
|
||||||
|
# Final update to ensure everything is included
|
||||||
|
echo "Running final update with simpler flags..."
|
||||||
|
fdroid update --allow-disabled-algorithms --use-date-from-apk --nosign
|
||||||
|
|
||||||
echo "Update complete!"
|
echo "Update complete!"
|
||||||
Reference in New Issue
Block a user