Skip to content
Snippets Groups Projects
Verified Commit cccde71f authored by Julian's avatar Julian :flag_ua:
Browse files

Update

parents
No related branches found
No related tags found
No related merge requests found
Pipeline #682956988 passed
name: Build
on:
push:
branches: [ main ]
paths:
- '.github/workflows/github.yml'
- 'build.sh'
- 'update.sh'
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
jobs:
build:
name: "Build"
runs-on: ubuntu-latest
container:
image: debian:latest
steps:
- uses: actions/checkout@v2
- name: Build
run: |
apt update
apt install fdroidserver git curl aapt -y
curl -q 'https://proget.makedeb.org/debian-feeds/prebuilt-mpr.pub' | gpg --dearmor | tee /usr/share/keyrings/prebuilt-mpr-archive-keyring.gpg 1> /dev/null
echo "deb [signed-by=/usr/share/keyrings/prebuilt-mpr-archive-keyring.gpg] https://proget.makedeb.org prebuilt-mpr bullseye" | tee /etc/apt/sources.list.d/prebuilt-mpr.list
apt update
apt install glab -y
curl -L -o gh_linux_amd64.deb https://github.com/cli/cli/releases/download/$(curl -s https://api.github.com/repos/cli/cli/releases/latest | grep tag_name | sed 's/.*tag_name\":\ \"//' | sed 's/\",//')/gh_$(curl -s https://api.github.com/repos/cli/cli/releases/latest | grep tag_name | sed 's/.*tag_name\":\ \"//' | sed 's/\",//' | sed 's/v//')_linux_amd64.deb
apt install ./gh_linux_amd64.deb -y
rm gh_linux_amd64.deb
echo "$GH_ACCESS_TOKEN" | gh auth login --with-token
glab config set -h gitlab.com git_protocol https
glab config set -h gitlab.com api_protocol https
chmod +x build.sh
./build.sh
mkdir -p fdroid/repo
echo "$KEYSTORE_P12" | base64 -d - > fdroid/keystore.p12
echo "$CONFIG_YML" | base64 -d - > fdroid/config.yml
chmod +x update.sh
./update.sh
mkdir public
rm fdroid/keystore.p12
rm fdroid/config.yml
mv fdroid public/
mv public ../
ls -lah public/
env:
GH_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
KEYSTORE: ${{ secrets.KEYSTORE }}
KEYSTORE_PROPERTIES: ${{ secrets.KEYSTORE_PROPERTIES }}
KEYSTORE_P12: ${{ secrets.KEYSTORE_P12 }}
CONFIG_YML: ${{ secrets.CONFIG_YML }}
KEY: ${{ secrets.KEY }}
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: public
\ No newline at end of file
config.yml
keystore.p12
keystore.keystore
keystore.properties
gl_access_token
gh_access_token
priv.asc
\ No newline at end of file
build:
image: debian:latest
stage: build
script:
- apt update
- apt install fdroidserver git curl aapt -y
- curl -q 'https://proget.makedeb.org/debian-feeds/prebuilt-mpr.pub' | gpg --dearmor | tee /usr/share/keyrings/prebuilt-mpr-archive-keyring.gpg 1> /dev/null
- echo "deb [signed-by=/usr/share/keyrings/prebuilt-mpr-archive-keyring.gpg] https://proget.makedeb.org prebuilt-mpr bullseye" | tee /etc/apt/sources.list.d/prebuilt-mpr.list
- apt update
- apt install glab -y
- glab auth login --token $GL_ACCESS_TOKEN
- glab config set -h gitlab.com git_protocol https
- glab config set -h gitlab.com api_protocol https
- chmod +x build.sh
- ./build.sh
- mkdir -p fdroid/repo
- echo "$KEYSTORE_P12" | base64 -d - > fdroid/keystore.p12
- echo "$CONFIG_YML" | base64 -d - > fdroid/config.yml
- chmod +x update.sh
- ./update.sh
- rm fdroid/keystore.p12
- rm fdroid/config.yml
- mkdir public
- mv fdroid public/
artifacts:
paths:
- public
expire_in: 1 day
only:
changes:
- '.gitlab-ci.yml'
- 'build.sh'
- 'update.sh'
pages:
stage: deploy
script:
- ls -lah public/
artifacts:
paths:
- public
expire_in: 1 day
only:
changes:
- '.gitlab-ci.yml'
- 'build.sh'
- 'update.sh'
\ No newline at end of file
This diff is collapsed.
# F-Droid Repo
Repository for installing apps more easily.
## Updates
This repository is updated every day at 00:00 UTC+2. If updates are available at this time, you will receive them after the building process is completed.
## Apps
The following apps made by others are available from this repo:
- [GeoGebra](https://github.com/geogebra/geogebra), downloaded from the [official](https://wiki.geogebra.org/en/Reference:GeoGebra_Installation#GeoGebra_Calculator_Suite) APK releases
- [GrapheneOS Apps](https://github.com/GrapheneOS/Apps)
- [GrapheneOS Auditor](https://github.com/GrapheneOS/Auditor)
- [GrapheneOS Camera](https://github.com/GrapheneOS/Camera)
- [GrapheneOS PDF Viewer](https://github.com/GrapheneOS/PdfViewer)
- [Proton Mail](https://github.com/ProtonMail/proton-mail-android)
In addition, the following apps made by others, and with patches made by me, are available from this repo:
- [Simple Mobile Tools](https://github.com/SimpleMobileTools), with [patches](/build.sh#L111-295) to support a white icon. I do not make any claim to the source code, and believe these modifications comply with the GPL-3.0 license used by the project, as the changes are disclosed, open source, and under the same license.
- [Simple App Launcher](https://github.com/SimpleMobileTools/Simple-App-Launcher)
- [Simple Calculator](https://github.com/SimpleMobileTools/Simple-Calculator)
- [Simple Calendar](https://github.com/SimpleMobileTools/Simple-Calendar)
- [Simple Camera](https://github.com/SimpleMobileTools/Simple-Camera)
- [Simple Clock](https://github.com/SimpleMobileTools/Simple-Clock)
- [Simple Contacts](https://github.com/SimpleMobileTools/Simple-Contacts)
- [Simple Dialer](https://github.com/SimpleMobileTools/Simple-Dialer)
- [Simple Draw](https://github.com/SimpleMobileTools/Simple-Draw)
- [Simple File Manager](https://github.com/SimpleMobileTools/Simple-File-Manager)
- [Simple Flashlight](https://github.com/SimpleMobileTools/Simple-Flashlight)
- [Simple Gallery](https://github.com/SimpleMobileTools/Simple-Gallery)
- [Simple Keyboard](https://github.com/SimpleMobileTools/Simple-Keyboard)
- [Simple Launcher](https://github.com/SimpleMobileTools/Simple-Launcher)
- [Simple Music Player](https://github.com/SimpleMobileTools/Simple-Music-Player)
- [Simple Notes](https://github.com/SimpleMobileTools/Simple-Notes)
- [Simple SMS Messenger](https://github.com/SimpleMobileTools/Simple-SMS-Messenger)
- [Simple Thank You](https://github.com/SimpleMobileTools/Simple-Thank-You)
- [Simple Voice Recorder](https://github.com/SimpleMobileTools/Simple-Voice-Recorder)
### Anti-Features
- GeoGebra
- Non-free dependencies (Google Play Services, Google Play Services for AR)
- Proton Mail
- Non-free network services (Proton)
- Non-free dependencies (Google Play Services)
## How to use
Copy this link and add it to your F-Droid client:
```
https://julianfairfax.gitlab.io/fdroid-repo/fdroid/repo?fingerprint=561AD800D900CA8EBF3A531C6A860B5AB8569D0D376FD121CBCCFCA9434D7DF7
```
You can also scan this QR code and add the link to your F-Droid client:
![F-Droid repo QR code](https://julianfairfax.gitlab.io/fdroid-repo/fdroid/repo/icons/icon.png)
## Licensing information
The apps hosted on this repository are under the licenses of their developers. This repository's license only applies to the code for the repository itself.
If you believe your code has been unjustly used or has been used without proper credit in this repository, please [contact](https://julianfairfax.gitlab.io/contact.html) me.
## Self-hosting information
If you are going to host a repository like this yourself, it is requested that you remove my content from it and replace it with you own. This includes references to my name, projects, or website.
This repository uses the GitHub API to fetch information and assets from GitHub repositories. If you're hosting this repository on GitHub Pages and building apps on it, the GitHub CLI is also used to create repositories and add secrets to them, and you must set a `GH_ACCESS_TOKEN` GitHub secret, containing a GitHub access token with the required `workflow` and `read:org` permissions.
The GitLab CLI is also used to fetch information and assets from GitLab repositories. If you're hosting this repository on GitLab Pages and building apps on it, the GitLab CLI is also used to create repositories and add secrets to them, and you must set a `GL_ACCESS_TOKEN` GitLab variable or GitHub secret, containing a GitLab access token with the `api` and `write_repository` permissions.
You must also set `CONFIG_YML` and `KEYSTORE_P12` GitLab variables or GitHub secrets, containing the contents of your F-Droid `config.yml` and `keystore.p12 files`, encoded in Base64.
You can create the `config.yml` and `keystore.p12` files by [installing the F-Droid server tools](https://f-droid.org/en/docs/Installing_the_Server_and_Repo_Tools/), creating an `fdroid` directory, and running `fdroid init` in that directory.
To build the apps made by others, and with patches made by me on your own repository, you must set `KEYSTORE` and `KEYSTORE_PROPERTIES` GitLab variables or GitHub secrets, containing the contents of your keystore.keystore and keystore.properties files, encoded in Base64.
To host your repository without building these apps, remove the `chmod +x build.sh` and `./build.sh` lines in your GitLab CI and GitHub action files.
You should modify this README to replace references to my name, projects, and website with your own.
Under the terms of the [GNU General Public License v3.0](http://choosealicense.com/licenses/gpl-3.0/) license used by this project, you are required to use this same license in any and all redistributions of this project's code.
If you wish to host a repository like this on GitHub Pages instead of GitLab Pages, you can do so without issue, as this one is made to be compatible.
build.sh 0 → 100644
#!/bin/bash
if [[ ! -z $GITHUB_REPOSITORY ]]; then
username="$GITHUB_REPOSITORY_OWNER"
elif [[ ! -z $CI_REPOSITORY_URL ]]; then
username="$CI_PROJECT_NAMESPACE"
fi
email="$(git log -1 --pretty=format:'%ae')"
git config --global user.name "$username"
git config --global user.email "$email"
git config --global init.defaultBranch main
if [[ ! -z "$KEY" ]]; then
echo "$KEY" > priv.asc
gpg --import priv.asc
git config --global user.signingkey 6965BB52EBBA8B86
git config --global commit.gpgsign true
fi
declare -a repos=("Simple-App-Launcher" "Simple-Calculator" "Simple-Calendar" "Simple-Camera" "Simple-Clock" "Simple-Contacts" "Simple-Dialer" "Simple-Draw" "Simple-File-Manager" "Simple-Flashlight" "Simple-Gallery" "Simple-Keyboard" "Simple-Launcher" "Simple-Music-Player" "Simple-Notes" "Simple-SMS-Messenger" "Simple-Thank-You" "Simple-Voice-Recorder")
if [[ ! -z $GITHUB_REPOSITORY ]]; then
if [[ ! $(gh repo list | grep Simple-Commons | sed "s/Simple-Commons.*/Simple-Commons/") == $username/Simple-Commons ]]; then
gh repo create Simple-Commons --public --description "$(gh repo view $(echo SimpleMobileTools/Simple-Commons | sed 's|:.*||') | grep description | sed 's/.*\t//')"
fi
elif [[ ! -z $CI_REPOSITORY_URL ]]; then
if [[ -z $(glab repo view $username/Simple-Commons) ]]; then
NO_PROMPT=1 glab repo create $username/Simple-Commons --public --description "$(curl -s https://api.github.com/repos/SimpleMobileTools/Simple-Commons | grep description | sed 's/ "description": "//' | sed 's/",//')"
fi
fi
for repo in ${repos[@]}; do
curl -o latest_$repo https://api.github.com/repos/SimpleMobileTools/$repo/releases/latest
description=$(curl -s https://api.github.com/repos/SimpleMobileTools/$repo | grep description | sed 's/ "description": "//' | sed 's/",//')
release=$(cat latest_$repo | grep tag_name | sed 's/.*tag_name\":\ \"//' | sed 's/\",//')
changelog="$(cat latest_$repo | sed -z 's/"\n}//g' | grep body | sed 's/ "body": "//' | sed 's/",//' | sed 's/\\r//g' | sed 's/\\n/\n/g')"
if [[ ! -z $GITHUB_REPOSITORY ]]; then
if [[ ! $(gh repo list | grep $repo | sed "s/$repo.*/$repo/") == $username/$repo ]]; then
gh repo create $repo --public --description "$description"
while [[ ! $(gh secret list --repo $username/$repo | grep KEYSTORE | grep -v KEYSTORE_PROPERTIES | sed 's/KEYSTORE.*/KEYSTORE/') ]]; do
echo "$KEYSTORE" | gh secret set KEYSTORE --repo $username/$repo
done
while [[ ! $(gh secret list --repo $username/$repo | grep KEYSTORE_PROPERTIES | sed 's/KEYSTORE_PROPERTIES.*/KEYSTORE_PROPERTIES/') ]]; do
echo "$KEYSTORE_PROPERTIES" | gh secret set KEYSTORE_PROPERTIES --repo $username/$repo
done
while [[ ! $(gh secret list --repo $username/$repo | grep GH_ACCESS_TOKEN | sed 's/GH_ACCESS_TOKEN.*/GH_ACCESS_TOKEN/') ]]; do
echo "$GH_ACCESS_TOKEN" | gh secret set GH_ACCESS_TOKEN --repo $username/$repo
done
fi
elif [[ ! -z $CI_REPOSITORY_URL ]]; then
if [[ -z $(glab repo view $username/$repo) ]]; then
NO_PROMPT=1 glab repo create $username/$repo --public --description "$description"
glab variable set KEYSTORE "$KEYSTORE" --repo $username/$repo
glab variable set KEYSTORE_PROPERTIES "$KEYSTORE_PROPERTIES" --repo $username/$repo
glab variable set GL_ACCESS_TOKEN "$GL_ACCESS_TOKEN" --repo $username/$repo
fi
fi
if [[ ! -z $GITHUB_REPOSITORY ]]; then
version=$(gh release list --repo $username/$repo | grep Latest | sed 's/.*Latest\t//' | sed 's/\t.*//')
elif [[ ! -z $CI_REPOSITORY_URL ]]; then
version=$(glab release list --repo $username/$repo | sed -n '3p' | sed 's/\t.*//')
fi
if [[ ! $release == $version ]]; then
if [[ ! -z $GITHUB_REPOSITORY ]]; then
git clone https://github.com/julianfairfax/$repo
elif [[ ! -z $CI_REPOSITORY_URL ]]; then
git clone https://gitlab.com/julianfairfax/$repo
fi
cd $repo
git clone https://github.com/SimpleMobileTools/$repo
cd $repo
git fetch --tags
git checkout tags/$release -b $release
commit=$(cat app/build.gradle | grep Simple-Commons | sed "s/ implementation 'com.github.SimpleMobileTools:Simple-Commons://" | sed "s/'//")
cd ../
rm -rf $repo
if [[ ! -z $GITHUB_REPOSITORY ]]; then
git clone https://github.com/$username/Simple-Commons
elif [[ ! -z $CI_REPOSITORY_URL ]]; then
git clone https://gitlab.com/$username/Simple-Commons
fi
cd Simple-Commons
branch=$(git branch -a | grep $commit | head -n 1 | sed 's|.*/||' | sed 's/.*\ //')
if [[ ! $commit == $branch ]]; then
git clone https://github.com/SimpleMobileTools/Simple-Commons
cd Simple-Commons
git checkout $commit -b $commit
sed -i "s/18 -> getColors(R.array.md_greys)/18 -> getColors(R.array.md_greys)\n 19 -> getColors(R.array.md_greys)/" commons/src/main/kotlin/com/simplemobiletools/commons/dialogs/LineColorPickerDialog.kt
sed -i "s/\".Grey_black\"/\".Grey_black\",\n \".Grey_white\"/" commons/src/main/kotlin/com/simplemobiletools/commons/helpers/Constants.kt
sed -i "0,/<item>@color\/md_grey_black<\/item>/s//<item>@color\/md_grey_black<\/item>\n <item>@color\/md_grey_white<\/item>/" commons/src/main/res/values/arrays.xml
git add .
git commit -m "Automated update"
if [[ ! -z $GITHUB_REPOSITORY ]]; then
git remote set-url origin https://github.com/$username/Simple-Commons
git push https://$GH_ACCESS_TOKEN@github.com/$username/Simple-Commons.git
elif [[ ! -z $CI_REPOSITORY_URL ]]; then
git remote set-url origin https://gitlab.com/$username/Simple-Commons
git push https://$username:$GL_ACCESS_TOKEN@gitlab.com/$username/Simple-Commons.git
fi
export commit=$(git log -n 1 --pretty=format:"%H" | cut -c 1-10)
cd ../
else
git checkout remotes/origin/$commit
export commit=$(git log -n 1 --pretty=format:"%H" | cut -c 1-10)
fi
cd ../
rm -rf Simple-Commons
if [[ ! -z $GITHUB_REPOSITORY ]]; then
mkdir -p .github/workflows
echo "name: Build
on:
push:
branches: [ main ]
jobs:
build:
name: \"Build\"
runs-on: ubuntu-latest
container:
image: debian:latest
steps:
- uses: actions/checkout@v2
- name: Build
run: |
apt update
apt install openjdk-11-jdk git curl gpg android-sdk imagemagick -y
echo \"deb http://deb.debian.org/debian unstable main\" | tee /etc/apt/sources.list
apt update
apt install -t unstable sdkmanager -y
curl -L -o gh_linux_amd64.deb https://github.com/cli/cli/releases/download/\$(curl -s https://api.github.com/repos/cli/cli/releases/latest | grep tag_name | sed 's/.*tag_name\\\":\ \\\"//' | sed 's/\\\",//')/gh_\$(curl -s https://api.github.com/repos/cli/cli/releases/latest | grep tag_name | sed 's/.*tag_name\\\":\ \\\"//' | sed 's/\\\",//' | sed 's/v//')_linux_amd64.deb
apt install ./gh_linux_amd64.deb -y
rm gh_linux_amd64.deb
echo \"\$GH_ACCESS_TOKEN\" | gh auth login --with-token
echo \"\$KEYSTORE_PROPERTIES\" | base64 -d - > keystore.properties
echo \"\$KEYSTORE\" | base64 -d - > keystore.keystore
bash build.sh
env:
GH_ACCESS_TOKEN: \${{ secrets.GH_ACCESS_TOKEN }}
KEYSTORE_PROPERTIES: \${{ secrets.KEYSTORE_PROPERTIES }}
KEYSTORE: \${{ secrets.KEYSTORE }}" | tee .github/workflows/github.yml
elif [[ ! -z $CI_REPOSITORY_URL ]]; then
echo "build:
image: debian:latest
stage: build
script:
- apt update
- apt install openjdk-11-jdk git curl gpg android-sdk imagemagick -y
- curl -q 'https://proget.makedeb.org/debian-feeds/prebuilt-mpr.pub' | gpg --dearmor | tee /usr/share/keyrings/prebuilt-mpr-archive-keyring.gpg 1> /dev/null
- echo \"deb [signed-by=/usr/share/keyrings/prebuilt-mpr-archive-keyring.gpg] https://proget.makedeb.org prebuilt-mpr bullseye\" | tee /etc/apt/sources.list.d/prebuilt-mpr.list
- apt update
- apt install glab -y
- echo \"deb http://deb.debian.org/debian unstable main\" | tee /etc/apt/sources.list
- apt update
- apt install -t unstable sdkmanager -y
- glab auth login --token \$GL_ACCESS_TOKEN
- glab config set -h gitlab.com git_protocol https
- glab config set -h gitlab.com api_protocol https
- echo \"\$KEYSTORE_PROPERTIES\" | base64 -d - > keystore.properties
- echo \"\$KEYSTORE\" | base64 -d - > keystore.keystore
- bash build.sh
only:
- main
except:
- tags" | tee .gitlab-ci.yml
fi
echo "git clone https://github.com/SimpleMobileTools/$repo
cd $repo
git fetch --tags
git checkout tags/$release -b $release
if [[ ! -z \$GITHUB_REPOSITORY ]]; then
sed -i \"s/implementation 'com.github.SimpleMobileTools:Simple-Commons:.*'/implementation 'com.github.$username:Simple-Commons:$commit'/\" app/build.gradle
elif [[ ! -z \$CI_REPOSITORY_URL ]]; then
sed -i \"s/implementation 'com.github.SimpleMobileTools:Simple-Commons:.*'/implementation 'com.gitlab.$username:Simple-Commons:$commit'/\" app/build.gradle
fi
sed -i '0,/android:icon=\"@mipmap\/ic_launcher\"/s//android:icon=\"@mipmap\/ic_launcher_grey_white\"/' app/src/main/AndroidManifest.xml
sed -i '0,/android:roundIcon=\"@mipmap\/ic_launcher\"/s//android:roundIcon=\"@mipmap\/ic_launcher_grey_white\"/' app/src/main/AndroidManifest.xml
sed -i -z \"s/<activity-alias\n android:name=\\\".activities.SplashActivity.Grey_black\\\"\n android:enabled=\\\"false\\\"\n android:exported=\\\"true\\\"\n android:icon=\\\"@mipmap\/ic_launcher_grey_black\\\"\n android:roundIcon=\\\"@mipmap\/ic_launcher_grey_black\\\"\n android:targetActivity=\\\".activities.SplashActivity\\\">\n\n <intent-filter>\n <action android:name=\\\"android.intent.action.MAIN\\\" \/>\n <category android:name=\\\"android.intent.category.LAUNCHER\\\" \/>\n <\/intent-filter>\n <\/activity-alias>/<activity-alias\n android:name=\\\".activities.SplashActivity.Grey_black\\\"\n android:enabled=\\\"false\\\"\n android:exported=\\\"true\\\"\n android:icon=\\\"@mipmap\/ic_launcher_grey_black\\\"\n android:roundIcon=\\\"@mipmap\/ic_launcher_grey_black\\\"\n android:targetActivity=\\\".activities.SplashActivity\\\">\n\n <intent-filter>\n <action android:name=\\\"android.intent.action.MAIN\\\" \/>\n <category android:name=\\\"android.intent.category.LAUNCHER\\\" \/>\n <\/intent-filter>\n <\/activity-alias>\n\n <activity-alias\n android:name=\\\".activities.SplashActivity.Grey_white\\\"\n android:enabled=\\\"false\\\"\n android:exported=\\\"true\\\"\n android:icon=\\\"@mipmap\/ic_launcher_grey_white\\\"\n android:roundIcon=\\\"@mipmap\/ic_launcher_grey_white\\\"\n android:targetActivity=\\\".activities.SplashActivity\\\">\n\n <intent-filter>\n <action android:name=\\\"android.intent.action.MAIN\\\" \/>\n <category android:name=\\\"android.intent.category.LAUNCHER\\\" \/>\n <\/intent-filter>\n <\/activity-alias>/\" app/src/main/AndroidManifest.xml
sed -i -z \"s/<activity-alias\n android:name=\\\".activities.SplashActivity.Grey_black\\\"\n android:clearTaskOnLaunch=\\\"true\\\"\n android:enabled=\\\"false\\\"\n android:excludeFromRecents=\\\"true\\\"\n android:exported=\\\"true\\\"\n android:icon=\\\"@mipmap\/ic_launcher_grey_black\\\"\n android:launchMode=\\\"singleTask\\\"\n android:roundIcon=\\\"@mipmap\/ic_launcher_grey_black\\\"\n android:targetActivity=\\\".activities.SplashActivity\\\">\n <intent-filter>\n <action android:name=\\\"android.intent.action.MAIN\\\" \/>\n\n <category android:name=\\\"android.intent.category.HOME\\\" \/>\n <category android:name=\\\"android.intent.category.LAUNCHER\\\" \/>\n <category android:name=\\\"android.intent.category.DEFAULT\\\" \/>\n <\/intent-filter>\n <\/activity-alias>/<activity-alias\n android:name=\\\".activities.SplashActivity.Grey_black\\\"\n android:clearTaskOnLaunch=\\\"true\\\"\n android:enabled=\\\"false\\\"\n android:excludeFromRecents=\\\"true\\\"\n android:exported=\\\"true\\\"\n android:icon=\\\"@mipmap\/ic_launcher_grey_black\\\"\n android:launchMode=\\\"singleTask\\\"\n android:roundIcon=\\\"@mipmap\/ic_launcher_grey_black\\\"\n android:targetActivity=\\\".activities.SplashActivity\\\">\n <intent-filter>\n <action android:name=\\\"android.intent.action.MAIN\\\" \/>\n\n <category android:name=\\\"android.intent.category.HOME\\\" \/>\n <category android:name=\\\"android.intent.category.LAUNCHER\\\" \/>\n <category android:name=\\\"android.intent.category.DEFAULT\\\" \/>\n <\/intent-filter>\n <\/activity-alias>\n \n <activity-alias\n android:name=\\\".activities.SplashActivity.Grey_white\\\"\n android:clearTaskOnLaunch=\\\"true\\\"\n android:enabled=\\\"false\\\"\n android:excludeFromRecents=\\\"true\\\"\n android:exported=\\\"true\\\"\n android:icon=\\\"@mipmap\/ic_launcher_grey_white\\\"\n android:launchMode=\\\"singleTask\\\"\n android:roundIcon=\\\"@mipmap\/ic_launcher_grey_white\\\"\n android:targetActivity=\\\".activities.SplashActivity\\\">\n <intent-filter>\n <action android:name=\\\"android.intent.action.MAIN\\\" \/>\n\n <category android:name=\\\"android.intent.category.HOME\\\" \/>\n <category android:name=\\\"android.intent.category.LAUNCHER\\\" \/>\n <category android:name=\\\"android.intent.category.DEFAULT\\\" \/>\n <\/intent-filter>\n <\/activity-alias>/\" app/src/main/AndroidManifest.xml
if [[ \"\$(cat \"\$(find -name SimpleActivity.kt)\" | grep \" R.mipmap.ic_launcher_grey_black\")\" == \" R.mipmap.ic_launcher_grey_black\" ]]; then
sed -i \"s/ R.mipmap.ic_launcher_grey_black/ R.mipmap.ic_launcher_grey_black,\n R.mipmap.ic_launcher_grey_white/\" \"\$(find -name SimpleActivity.kt)\"
elif [[ \"\$(cat \"\$(find -name SimpleActivity.kt)\" | grep \" R.mipmap.ic_launcher_grey_black\")\" == \" R.mipmap.ic_launcher_grey_black\" ]]; then
sed -i \"s/ R.mipmap.ic_launcher_grey_black/ R.mipmap.ic_launcher_grey_black,\n R.mipmap.ic_launcher_grey_white/\" \"\$(find -name SimpleActivity.kt)\"
fi
cp app/src/main/res/mipmap-anydpi-v26/ic_launcher_grey_black.xml app/src/main/res/mipmap-anydpi-v26/ic_launcher_grey_white.xml
sed -i 's/grey_black/grey_white/' app/src/main/res/mipmap-anydpi-v26/ic_launcher_grey_white.xml
sed -i 's/ic_launcher_foreground/ic_launcher_foreground_white/' app/src/main/res/mipmap-anydpi-v26/ic_launcher_grey_white.xml
for mipmap in app/src/main/res/*; do
if [[ \$mipmap == *mipmap* && ! \$mipmap == *anydpi-v26 ]]; then
convert \$mipmap/ic_launcher_foreground.png -channel RGB -negate \$mipmap/ic_launcher_foreground_white.png
convert \$mipmap/ic_launcher_grey_black.png -channel RGB -negate \$mipmap/ic_launcher_grey_white.png
fi
done
sed -i -z \"s/\n proprietary {}//\" app/build.gradle
cp ../keystore.properties .
cp ../keystore.keystore .
yes | ANDROID_HOME=\"/usr/lib/android-sdk\" sdkmanager --licenses
ANDROID_HOME=\"/usr/lib/android-sdk\" ./gradlew assembleRelease
while [[ ! -d app/build/outputs/apk/fdroid/release && ! -d app/build/outputs/apk/foss/release ]]; do
ANDROID_HOME=\"/usr/lib/android-sdk\" ./gradlew assembleRelease
done
if [[ -d app/build/outputs/apk/fdroid/release ]]; then
path=\$(ls -1 app/build/outputs/apk/fdroid/release/*-fdroid-release.apk)
elif [[ -d app/build/outputs/apk/foss/release ]]; then
path=\$(ls -1 app/build/outputs/apk/foss/release/*-foss-release.apk)
fi
if [[ -d app/build/outputs/apk/fdroid/release ]]; then
filename=\$(basename \$(ls -1 app/build/outputs/apk/fdroid/release/*-fdroid-release.apk))
elif [[ -d app/build/outputs/apk/foss/release ]]; then
filename=\$(basename \$(ls -1 app/build/outputs/apk/foss/release/*-foss-release.apk))
fi
if [[ ! -z \$GITHUB_REPOSITORY ]]; then
gh release create $release --notes \"$changelog\" \"\$path#\$filename\" --repo $username/$repo
elif [[ ! -z \$CI_REPOSITORY_URL ]]; then
if [[ \$(stat -c %s \$path) -lt 10000000 ]]; then
glab release create $release --notes \"$changelog\" \"\$path#\$filename#other\" --repo $username/$repo
else
split --bytes=10MB \$path \$path
glab release create $release --notes \"$changelog\" \"\$(echo \$path)aa#\$(echo \$filename)aa#other\" --repo $username/$repo
glab release create $release --notes \"$changelog\" \"\$(echo \$path)ab#\$(echo \$filename)ab#other\" --repo $username/$repo
if [[ -f \$(echo \$path)ac ]]; then
glab release create $release --notes \"$changelog\" \"\$(echo \$path)ac#\$(echo \$filename)ac#other\" --repo $username/$repo
fi
fi
fi" | tee build.sh
git add .
git commit -m "Automated update"
if [[ ! -z $GITHUB_REPOSITORY ]]; then
git remote set-url origin https://github.com/$username/$repo
git push https://$GH_ACCESS_TOKEN@github.com/$username/$repo.git
elif [[ ! -z $CI_REPOSITORY_URL ]]; then
git remote set-url origin https://gitlab.com/$username/$repo
git push https://$username:$GL_ACCESS_TOKEN@gitlab.com/$username/$repo.git
fi
cd ../
rm -rf $repo
fi
done
built=0
while [[ $built == *0* ]]; do
built=""
for repo in ${repos[@]}; do
release=$(cat latest_$repo | grep tag_name | sed 's/.*tag_name\":\ \"//' | sed 's/\",//')
if [[ ! -z $GITHUB_REPOSITORY ]]; then
version=$(gh release list --repo $username/$repo | grep Latest | sed 's/.*Latest\t//' | sed 's/\t.*//')
if [[ ! $release == $version ]]; then
built="$built 0"
fi
elif [[ ! -z $CI_REPOSITORY_URL ]]; then
version=$(glab release list --repo $username/$repo | sed -n '3p' | sed 's/\t.*//')
if [[ ! $release == $version ]]; then
built="$built 0"
fi
fi
done
sleep 10s
done
\ No newline at end of file
#!/bin/bash
remote="$(git remote get-url "$(git remote)")"
username="$(echo $remote | sed 's/.*git.*b.com\///' | sed 's/\/.*//')"
description="Repository for installing apps more easily"
ci_repo="fdroid-repo"
if [[ "$remote" == "https://gitlab.com/$username/$ci_repo" ]]; then
if [[ ! -f "${0%/*}"/gl_access_token ]]; then
read -e -p "[rebuild.sh] GL_ACCESS_TOKEN: " GL_ACCESS_TOKEN
fi
if [[ -f "${0%/*}"/gl_access_token ]]; then
GL_ACCESS_TOKEN=$(cat "${0%/*}"/gl_access_token)
else
echo $GL_ACCESS_TOKEN | tee "${0%/*}"/gl_access_token
fi
elif [[ "$remote" == "https://github.com/$username/$ci_repo" ]]; then
if [[ ! -f "${0%/*}"/gh_access_token ]]; then
read -e -p "[rebuild.sh] GH_ACCESS_TOKEN: " GH_ACCESS_TOKEN
fi
if [[ -f "${0%/*}"/gh_access_token ]]; then
GH_ACCESS_TOKEN=$(cat "${0%/*}"/gh_access_token)
else
echo $GH_ACCESS_TOKEN | tee "${0%/*}"/gh_access_token
fi
fi
declare -a repos=("$ci_repo" "Simple-Commons" "Simple-App-Launcher" "Simple-Calculator" "Simple-Calendar" "Simple-Camera" "Simple-Clock" "Simple-Contacts" "Simple-Dialer" "Simple-Draw" "Simple-File-Manager" "Simple-Flashlight" "Simple-Gallery" "Simple-Keyboard" "Simple-Launcher" "Simple-Music-Player" "Simple-Notes" "Simple-SMS-Messenger" "Simple-Thank-You" "Simple-Voice-Recorder")
for repo in ${repos[@]}; do
if [[ "$remote" == "https://github.com/$username/$ci_repo" ]]; then
if [[ $(gh repo list | grep $repo | sed "s/$repo.*/$repo/") == $username/$repo ]]; then
gh repo delete $repo --confirm
fi
elif [[ "$remote" == "https://gitlab.com/$username/$ci_repo" ]]; then
if [[ ! -z $(glab repo view $username/$repo) ]]; then
glab repo delete $repo --yes
fi
fi
if [[ $repo == $ci_repo ]]; then
sleep 10s
if [[ "$remote" == "https://github.com/$username/$repo" ]]; then
gh repo create $repo --public --description "$description"
base64 "${0%/*}"/fdroid/config.yml | gh secret set CONFIG_YML --repo $username/$repo
base64 "${0%/*}"/fdroid/keystore.p12 | gh secret set KEYSTORE_P12 --repo $username/$repo
base64 "${0%/*}"/keystore.keystore | gh secret set KEYSTORE --repo $username/$repo
base64 "${0%/*}"/keystore.properties | gh secret set KEYSTORE_PROPERTIES --repo $username/$repo
echo "$GH_ACCESS_TOKEN" | gh secret set GH_ACCESS_TOKEN --repo $username/$repo
if [[ -f "${0%/*}"/priv.asc ]]; then
cat "${0%/*}"/priv.asc | gh secret set KEY --repo $username/$repo
fi
elif [[ "$remote" == "https://gitlab.com/$username/$repo" ]]; then
NO_PROMPT=1 glab repo create $repo --public --description "$description"
base64 "${0%/*}"/fdroid/config.yml | glab variable set CONFIG_YML --repo $username/$repo
base64 "${0%/*}"/fdroid/keystore.p12 | glab variable set KEYSTORE_P12 --repo $username/$repo
base64 "${0%/*}"/keystore.keystore | glab variable set KEYSTORE --repo $username/$repo
base64 "${0%/*}"/keystore.properties | glab variable set KEYSTORE_PROPERTIES --repo $username/$repo
echo "$GL_ACCESS_TOKEN" | glab variable set GL_ACCESS_TOKEN --repo $username/$repo
if [[ -f "${0%/*}"/priv.asc ]]; then
cat "${0%/*}"/priv.asc | glab variable set KEY --repo $username/$repo
fi
fi
fi
done
cd "${0%/*}"
rm -rf .git
git init
git remote add origin $remote
if [[ "$remote" == "https://github.com/$username/$ci_repo" ]]; then
git add .github/workflows
git commit -m "Update"
git push --set-upstream origin main
fi
git add .
git commit -m "Update"
git push --set-upstream origin main
\ No newline at end of file
update.sh 0 → 100644
#!/bin/bash
declare -a gitlab_repos=("julianfairfax/Simple-App-Launcher:System" "julianfairfax/Simple-Calculator:System" "julianfairfax/Simple-Calendar:System" "julianfairfax/Simple-Camera:System" "julianfairfax/Simple-Clock:System" "julianfairfax/Simple-Contacts:System" "julianfairfax/Simple-Dialer:System" "julianfairfax/Simple-Draw:System" "julianfairfax/Simple-File-Manager:System" "julianfairfax/Simple-Flashlight:System" "julianfairfax/Simple-Gallery:System" "julianfairfax/Simple-Keyboard:System" "julianfairfax/Simple-Launcher:System" "julianfairfax/Simple-Music-Player:System" "julianfairfax/Simple-Notes:System" "julianfairfax/Simple-SMS-Messenger:System" "julianfairfax/Simple-Thank-You:System" "julianfairfax/Simple-Voice-Recorder:System")
declare -a github_repos=("GrapheneOS/Apps:System" "GrapheneOS/Auditor:System" "GrapheneOS/Camera:System" "GrapheneOS/PdfViewer:System" "ProtonMail/proton-mail-android:Internet")
declare -a apk_repos=("geogebra/geogebra:Science&Education;https://download.geogebra.org/package/android-suite")
declare anti_features=("geogebra/geogebra:NonFreeDep" "ProtonMail/proton-mail-android:NonFreeNet" "ProtonMail/proton-mail-android:NonFreeDep")
if [[ ! -d fdroid/metadata ]]; then
mkdir -p fdroid/metadata
fi
if [[ ! -d fdroid/repo ]]; then
mkdir -p fdroid/repo
fi
for gitlab_repo in ${gitlab_repos[@]}; do
description=""
repo=$(echo $gitlab_repo | sed 's|:.*||')
release=$(glab release list --repo $repo | sed -n '3p' | sed 's/\t.*//')
description=$(glab repo view $repo | grep description | sed 's/.*\t//')
changelog="$(glab release view --repo $repo $release | sed -z 's/ASSETS.*//' | sed '1,3d' | sed '/^[[:space:]]*$/d' | sed 's/\x1B\[[0-9;]*[JKmsu]//g')"
asset=$(glab release view --repo $repo $release | grep https://gitlab.com/$repo/-/releases/$release/downloads/.*apk | sed 's/\t.*//')
if [[ $(echo "$asset" | wc -l) == 1 ]]; then
glab release download $release --repo $repo --asset-name="$asset" --dir fdroid/repo
else
glab release download $release --repo $repo --asset-name="$(echo "$asset" | grep .apkaa)" --dir fdroid/repo
glab release download $release --repo $repo --asset-name="$(echo "$asset" | grep .apkab)" --dir fdroid/repo
if [[ $(echo "$asset" | wc -l) == 3 ]]; then
glab release download $release --repo $repo --asset-name="$(echo "$asset" | grep .apkac)" --dir fdroid/repo
cat fdroid/repo/$(echo "$asset" | grep .apkaa) fdroid/repo/$(echo "$asset" | grep .apkab) fdroid/repo/$(echo "$asset" | grep .apkac) > fdroid/repo/$(echo "$asset" | grep .apkab | sed 's/.apkab/.apk/')
rm fdroid/repo/$(echo "$asset" | grep .apkaa)
rm fdroid/repo/$(echo "$asset" | grep .apkab)
rm fdroid/repo/$(echo "$asset" | grep .apkac)
else
cat fdroid/repo/$(echo "$asset" | grep .apkaa) fdroid/repo/$(echo "$asset" | grep .apkab) > fdroid/repo/$(echo "$asset" | grep .apkab | sed 's/.apkab/.apk/')
rm fdroid/repo/$(echo "$asset" | grep .apkaa)
rm fdroid/repo/$(echo "$asset" | grep .apkab)
fi
fi
name=$(aapt dump badging fdroid/repo/$(echo "$asset" | grep -v apkab | grep -v apkac | sed 's/apkaa/apk/') | grep application-label: | sed "s/application-label:'//" | sed "s/'.*//")
version=$(aapt dump badging fdroid/repo/$(echo "$asset" | grep -v apkab | grep -v apkac | sed 's/apkaa/apk/') | grep versionCode | sed "s/.*versionCode='//" | sed "s/'.*//")
id=$(aapt dump badging fdroid/repo/$(echo "$asset" | grep -v apkab | grep -v apkac | sed 's/apkaa/apk/') | grep package:\ name | sed "s/package: name='//" | sed "s/'.*//")
if [[ -z "$description" ]]; then
description="$name"
else
description="$description"
fi
for anti_feature in ${anti_features[@]}; do
if [[ $(echo $anti_feature | sed 's|:.*||') == $repo ]]; then
if [[ ! -f fdroid/metadata/$id.yml ]]; then
echo "AntiFeatures:" | tee fdroid/metadata/$id.yml
fi
if [[ ! $(cat fdroid/metadata/$id.yml | grep $anti_feature) == $anti_feature ]]; then
echo " - $(echo $anti_feature | sed 's|.*:||')" | tee -a fdroid/metadata/$id.yml
fi
fi
done
echo "AuthorName: $(echo $gitlab_repo | sed 's|/.*||')
Categories:
- $(echo $gitlab_repo | sed 's|.*:||')
CurrentVersion: \"$release\"
CurrentVersionCode: $version
Description: |
$description
IssueTracker: https://gitlab.com/$repo/-/issues
License: \"\"
Name: $name
SourceCode: https://gitlab.com/$repo
Summary: \"$(echo $description | cut -c 1-80)\"
WebSite: \"\"" | tee -a fdroid/metadata/$id.yml
if [[ -d fdroid/metadata/$id/en-US/changelogs ]]; then
rm -r fdroid/metadata/$id/en-US/changelogs
fi
mkdir -p fdroid/metadata/$id/en-US/changelogs
echo "$changelog" | tee fdroid/metadata/$id/en-US/changelogs/$version.txt
done
for github_repo in ${github_repos[@]}; do
description=""
repo=$(echo $github_repo | sed 's|:.*||')
curl -o latest https://api.github.com/repos/$repo/releases/latest
release=$(cat latest | grep tag_name | sed 's/.*tag_name\":\ \"//' | sed 's/\",//')
changelog="$(cat latest | sed -z 's/"\n}//g' | grep body | sed 's/ "body": "//' | sed 's/",//' | sed 's/\\r//g' | sed 's/\\n/\n/g')"
asset=$(cat latest | grep browser_download_url | sed 's/ "browser_download_url": "//' | sed 's/"//' | sed 's/.*\///')
curl -o repo https://api.github.com/repos/$repo
if [[ ! $(cat repo | grep description | sed 's/ "description": "//' | sed 's/",//') == *null* ]]; then
description=$(cat repo | grep description | sed 's/ "description": "//' | sed 's/",//')
fi
curl -L -o fdroid/repo/$asset $(cat latest | grep browser_download_url | sed 's/ "browser_download_url": "//' | sed 's/"//')
name=$(aapt dump badging fdroid/repo/$asset | grep application-label: | sed "s/application-label:'//" | sed "s/'.*//")
version=$(aapt dump badging fdroid/repo/$asset | grep versionCode | sed "s/.*versionCode='//" | sed "s/'.*//")
id=$(aapt dump badging fdroid/repo/$asset | grep package:\ name | sed "s/package: name='//" | sed "s/'.*//")
if [[ -z "$description" ]]; then
description="$name"
else
description="$description"
fi
for anti_feature in ${anti_features[@]}; do
if [[ $(echo $anti_feature | sed 's|:.*||') == $repo ]]; then
if [[ ! -f fdroid/metadata/$id.yml ]]; then
echo "AntiFeatures:" | tee fdroid/metadata/$id.yml
fi
if [[ ! $(cat fdroid/metadata/$id.yml | grep $anti_feature) == $anti_feature ]]; then
echo " - $(echo $anti_feature | sed 's|.*:||')" | tee -a fdroid/metadata/$id.yml
fi
fi
done
echo "AuthorName: $(echo $github_repo | sed 's|/.*||')
Categories:
- $(echo $github_repo | sed 's|.*:||')
CurrentVersion: \"$release\"
CurrentVersionCode: $version
Description: |
$description
IssueTracker: https://github.com/$repo/issues
License: \"\"
Name: $name
SourceCode: https://github.com/$repo
Summary: \"$(echo $description | cut -c 1-80)\"
WebSite: \"\"" | tee -a fdroid/metadata/$id.yml
if [[ -d fdroid/metadata/$id/en-US/changelogs ]]; then
rm -r fdroid/metadata/$id/en-US/changelogs
fi
mkdir -p fdroid/metadata/$id/en-US/changelogs
echo "$changelog" | tee fdroid/metadata/$id/en-US/changelogs/$version.txt
rm latest
rm repo
done
for apk_repo in ${apk_repos[@]}; do
description=""
repo=$(echo $apk_repo | sed 's|:.*||')
apk="$(echo $apk_repo | sed 's/.*;//')"
asset=$(curl -Ls -o /dev/null -w %{url_effective} $apk | sed 's/.*\///')
wget --content-disposition $apk
mv $asset fdroid/repo/
release=$(aapt dump badging fdroid/repo/$asset | grep versionName | sed "s/.*versionName='//" | sed "s/'.*//")
name=$(aapt dump badging fdroid/repo/$asset | grep application-label: | sed "s/application-label:'//" | sed "s/'.*//")
version=$(aapt dump badging fdroid/repo/$asset | grep versionCode | sed "s/.*versionCode='//" | sed "s/'.*//")
id=$(aapt dump badging fdroid/repo/$asset | grep package:\ name | sed "s/package: name='//" | sed "s/'.*//")
description="$name"
for anti_feature in ${anti_features[@]}; do
if [[ $(echo $anti_feature | sed 's|:.*||') == $repo ]]; then
if [[ ! -f fdroid/metadata/$id.yml ]]; then
echo "AntiFeatures:" | tee fdroid/metadata/$id.yml
fi
if [[ ! $(cat fdroid/metadata/$id.yml | grep $anti_feature) == $anti_feature ]]; then
echo " - $(echo $anti_feature | sed 's|.*:||')" | tee -a fdroid/metadata/$id.yml
fi
fi
done
echo "AuthorName: $(echo $apk_repo | sed 's|/.*||')
Categories:
- $(echo $apk_repo | sed 's/;.*//' | sed 's|.*:||' | sed 's/&/\ &\ /')
CurrentVersion: \"$release\"
CurrentVersionCode: $version
Description: |
$description
IssueTracker: https://github.com/$repo/issues
License: \"\"
Name: $name
SourceCode: https://github.com/$repo
Summary: \"$(echo $description | cut -c 1-80)\"
WebSite: \"\"" | tee -a fdroid/metadata/$id.yml
curl -o latest https://api.github.com/repos/$repo/releases/latest
if [[ ! $(cat latest) == *"Not Found"* ]]; then
release=$(cat latest | grep tag_name | sed 's/.*tag_name\":\ \"//' | sed 's/\",//')
changelog="$(cat latest | sed -z 's/"\n}//g' | grep body | sed 's/ "body": "//' | sed 's/",//' | sed 's/\\r//g' | sed 's/\\n/\n/g')"
if [[ -d fdroid/metadata/$id/en-US/changelogs ]]; then
rm -r fdroid/metadata/$id/en-US/changelogs
fi
mkdir -p fdroid/metadata/$id/en-US/changelogs
echo "$changelog" | tee fdroid/metadata/$id/en-US/changelogs/$version.txt
fi
rm latest
done
if [[ ! -f fdroid/repo/index-v1.json ]]; then
echo "{\"repo\": {\"timestamp\": $(date +%s%N | cut -b1-13), \"version\": 20000, \"name\": \"Julian's F-Droid Repo\", \"icon\": \"icon.png\", \"address\": \"https://julianfairfax.gitlab.io/fdroid-repo/fdroid/repo?fingerprint=561AD800D900CA8EBF3A531C6A860B5AB8569D0D376FD121CBCCFCA9434D7DF7\", \"description\": \"Repository for installing apps more easily.\"}, \"requests\": {\"install\": [], \"uninstall\": []}, \"apps\": [], \"packages\": {}}" | tee fdroid/repo/index-v1.json
fi
cd fdroid
/usr/bin/fdroid update --pretty --delete-unknown
cd ../
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment