Merge branch 'master' into 'master'

switch nightly repo to finalized `fdroid nightly` command

See merge request fdroid/fdroidclient!623
This commit is contained in:
Hans-Christoph Steiner 2018-01-11 22:45:46 +00:00
commit eda48c09c7
10 changed files with 20 additions and 118 deletions

2
.gitignore vendored
View File

@ -46,3 +46,5 @@ junit-report.xml
# Screen dumps from Android Studio/DDMS
captures/
/fdroid/

View File

@ -89,7 +89,18 @@ deploy_nightly:
only:
- master
script:
- "[ -z \"$DEBUG_KEYSTORE\" ] || ./config/nightly-repo/deploy"
- sed -i
's,<string name="app_name">.*</string>,<string name="app_name">F-Nightly</string>,'
app/src/main/res/values*/strings.xml
# add this nightly repo as a enabled repo
- sed -i -e '/<\/string-array>/d' -e '/<\/resources>/d' app/src/main/res/values/default_repos.xml
- echo "<item>${CI_PROJECT_PATH}-nightly</item>" >> app/src/main/res/values/default_repos.xml
- echo "<item>${CI_PROJECT_URL}-nightly/raw/master/fdroid/repo</item>" >> app/src/main/res/values/default_repos.xml
- cat config/nightly-repo/repo.xml >> app/src/main/res/values/default_repos.xml
# build the APKs!
- ./gradlew assembleDebug
- apt update; apt install -y --no-install-recommends fdroidserver python3-qrcode openssh-client
- fdroid nightly -v
after_script:
# this file changes every time but should not be cached

View File

@ -28,7 +28,7 @@ public class CrashReportSender implements ReportSender {
throws ReportSenderException {
Intent emailIntent = new Intent("android.intent.action.SENDTO");
emailIntent.setData(Uri.fromParts("mailto", this.config.mailTo(), (String) null));
emailIntent.addFlags(268435456);
emailIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
String[] subjectBody = this.buildSubjectBody(context, errorContent);
emailIntent.putExtra("android.intent.extra.SUBJECT", subjectBody[0]);
emailIntent.putExtra("android.intent.extra.TEXT", subjectBody[1]);

View File

@ -102,7 +102,7 @@ public class SwapService extends Service {
* a different network.
*/
private SharedPreferences persistence() {
return getSharedPreferences(SHARED_PREFERENCES, MODE_APPEND);
return getSharedPreferences(SHARED_PREFERENCES, MODE_PRIVATE);
}
// ==========================================================

View File

@ -1,18 +0,0 @@
repo_icon = "fdroid-icon.png"
repo_description = """
This repo is nightly builds, it should only be used for testing!
"""
archive_older = 10
archive_icon = "fdroid-icon.png"
archive_description = """
The repository of older versions of applications from the main repository.
"""
make_current_version_link = False
accepted_formats = ('txt', 'yml')
repo_keyalias = "androiddebugkey"
keystorepass = "android"
keypass = "android"
keydname = "CN=Android Debug,O=Android,C=US"

View File

@ -1,82 +0,0 @@
#!/bin/bash
set -e
set -x
echo "deb http://deb.debian.org/debian stretch-backports main" \
> /etc/apt/sources.list.d/stretch-backports.list
apt-get update
apt-get install -y --no-install-recommends -t stretch-backports \
fdroidserver openssh-client rsync python3-qrcode
repo_git_base=${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}-nightly
repo_base=https://gitlab.com/${repo_git_base}
repo_url=${repo_base}/raw/master/fdroid/repo
archive_url=${repo_base}/raw/master/fdroid/archive
mkdir -p $HOME/.android
keystore=$HOME/.android/debug.keystore
echo "repo_name = '$repo_git_base'" >> config/nightly-repo/config.py
echo "repo_url = '$repo_url'" >> config/nightly-repo/config.py
echo "archive_name = '$repo_git_base archive'" >> config/nightly-repo/config.py
echo "archive_url = '$archive_url'" >> config/nightly-repo/config.py
echo "servergitmirrors = 'git@gitlab.com:$repo_git_base'" >> config/nightly-repo/config.py
echo "keystore = '$keystore'" >> config/nightly-repo/config.py
chmod 0600 config/nightly-repo/config.py
sed -i -e '/<\/string-array>/d' -e '/<\/resources>/d' \
app/src/main/res/values/default_repos.xml
echo "<item>$repo_git_base</item>" >> app/src/main/res/values/default_repos.xml
echo "<item>$repo_url</item>" >> app/src/main/res/values/default_repos.xml
cat config/nightly-repo/repo.xml >> app/src/main/res/values/default_repos.xml
echo "</string-array></resources>" >> app/src/main/res/values/default_repos.xml
set +x # do not show contents of secret variables!
echo $DEBUG_KEYSTORE | base64 --decode --ignore-garbage > $keystore
set -x
./gradlew assembleDebug -PdisablePreDex
mkdir config/nightly-repo/repo/
mv app/build/outputs/apk/app-debug.apk config/nightly-repo/repo/
cd config/nightly-repo
pw=android
alias=androiddebugkey
keytool -v -importkeystore \
-srckeystore $keystore -srcalias $alias -srcstorepass $pw -srckeypass $pw \
-destkeystore keystore.p12 -destalias $alias -deststorepass $pw -destkeypass $pw -deststoretype PKCS12
ssh_private_key=$HOME/.ssh/id_rsa
mkdir -p $(dirname $ssh_private_key)
openssl pkcs12 -in keystore.p12 -out key.pem -passin pass:$pw -passout pass:$pw
openssl rsa -in key.pem -out ${ssh_private_key} -passin pass:$pw
chmod 600 ${ssh_private_key}
ssh-keygen -y -f ${ssh_private_key} > ${ssh_private_key}.pub
echo "SSH public deploy key:"
cat ${ssh_private_key}.pub
eval $(ssh-agent -s)
ssh-add ${ssh_private_key}
if git clone $repo_base git-mirror; then
cd git-mirror
git remote rm origin
qr $repo_url > qr.png
echo "# $repo_git_base" > README.md
echo "[![$repo_url](qr.png)]($repo_url)" >> README.md
printf "\n\nLast updated: " >> README.md
date >> README.md
git add README.md
git config user.email "$CI_PROJECT_NAMESPACE@$CI_PROJECT_NAME"
git config user.name "$CI_PROJECT_NAMESPACE $CI_PROJECT_NAME"
git commit README.md -m README
cd ..
fi
if [ -d git-mirror/fdroid/repo ]; then
rsync -axv git-mirror/fdroid/repo/ repo/
fi
fdroid update --rename-apks
ssh-add -l
echo -e "Host *\n\tStrictHostKeyChecking no\n\n" >> ~/.ssh/config
fdroid server update --verbose

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -1,15 +0,0 @@
Categories: System
License: GPL-3.0+
WebSite: https://f-droid.org
SourceCode: https://gitlab.com/fdroid/fdroidclient
IssueTracker: https://gitlab.com/fdroid/fdroidclient/issues
Changelog: https://gitlab.com/fdroid/fdroidclient/raw/HEAD/CHANGELOG.md
Donate: https://f-droid.org/about
FlattrID: 343053
Bitcoin: 15u8aAPK4jJ5N8wpWJ5gutAyyeHtKX5i18
AutoName: F-Droid Nightly
Summary: Nightly test build of F-Droid
RepoType: srclib
Repo: fdroidclient

View File

@ -12,3 +12,7 @@
<item>
308201e53082014ea0030201020204503d3768300d06092a864886f70d01010505003037310b30090603550406130255533110300e060355040a1307416e64726f6964311630140603550403130d416e64726f6964204465627567301e170d3132303832383231323630305a170d3432303832313231323630305a3037310b30090603550406130255533110300e060355040a1307416e64726f6964311630140603550403130d416e64726f696420446562756730819f300d06092a864886f70d010101050003818d0030818902818100b5ba553eacbc4de5b45af812d9695140dafbc0a8a9c13ac9a7e24b2665371ce5072e5dfef60f705d58fdb2d0e2190264e42d83a6fd80cfd54690e9e3c3735fa8dce684ee99ac879b1b11e1c8a9cbb9dc6b23064b025f9db7dc87d48ee4bc038affd80d854c0ed5d88d93d6e8127e62344727e23886b97f5d10e2265c9c9b5bd10203010001300d06092a864886f70d0101050500038181006dae218bdbff79801b1935448c663319843a7b2eb5f5c8837f010e58da25ba4d23bc6650b53c93f9c42b379299f4659b4cc3c505aa1a7c08c8a1a58fffe78d29df2cf69b27c34a0ab5f44cf7e323e34f8252d9f6e4d67171ce38bab64623910811dae6b12203385b32d962dbd51e8a6b0dcab3fa4d1f4020cee69a5f3c6ddf69
</item>
</string-array>
</resources>

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB