Repo created

This commit is contained in:
Fr4nz D13trich 2025-11-24 18:55:42 +01:00
parent a629de6271
commit 3cef7c5092
2161 changed files with 246605 additions and 2 deletions

68
tools/debian_build.sh Executable file
View file

@ -0,0 +1,68 @@
#!/bin/bash
# This script is intended to be used on Debian systems for building
# the project. It has been tested with Debian 8
USERNAME=$USER
SIGNING_NAME='k-9'
SDK_VERSION='r24.3.3'
SDK_DIR=$HOME/android-sdk
cd ..
PROJECT_HOME=$(pwd)
sudo apt-get install build-essential default-jdk \
lib32stdc++6 lib32z1 lib32z1-dev
if [ ! -d $SDK_DIR ]; then
mkdir -p $SDK_DIR
fi
cd $SDK_DIR
# download the SDK
if [ ! -f $SDK_DIR/android-sdk_$SDK_VERSION-linux.tgz ]; then
wget https://dl.google.com/android/android-sdk_$SDK_VERSION-linux.tgz
tar -xzvf android-sdk_$SDK_VERSION-linux.tgz
fi
SDK_DIR=$SDK_DIR/android-sdk-linux
echo 'Check that you have the SDK tools installed for Android 17, SDK 19.1'
if [ ! -f $SDK_DIR/tools/android ]; then
echo "$SDK_DIR/tools/android not found"
exit -1
fi
cd $SDK_DIR
chmod -R 0755 $SDK_DIR
chmod a+rx $SDK_DIR/tools
ANDROID_HOME=$SDK_DIR
echo "sdk.dir=$SDK_DIR" > $ANDROID_HOME/local.properties
PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
android sdk
cd $PROJECT_HOME
if [ ! -f $SDK_DIR/tools/templates/gradle/wrapper/gradlew ]; then
echo "$SDK_DIR/tools/templates/gradle/wrapper/gradlew not found"
exit -2
fi
. $SDK_DIR/tools/templates/gradle/wrapper/gradlew build
#cd ~/develop/$PROJECT_NAME/build/outputs/apk
#keytool -genkey -v -keystore example.keystore -alias \
# "$SIGNING_NAME" -keyalg RSA -keysize 4096
#jarsigner -verbose -keystore example.keystore \
# k9mail-release-unsigned.apk "$SIGNING_NAME"
# cleaning up
cd $PROJECT_HOME/k9mail/build/outputs/apk
if [ ! -f k9mail-debug.apk ]; then
echo 'k9mail-debug.apk was not found'
exit -3
fi
echo 'Build script ended successfully'
echo -n 'apk is available at: '
echo "$PROJECT_HOME/k9mail/build/outputs/apk/k9mail-debug.apk"
exit 0

View file

@ -0,0 +1,11 @@
#!/bin/bash
SCRIPT=$(readlink -f $0)
SCRIPTPATH=`dirname $SCRIPT`
PROJECTROOT=`dirname $SCRIPTPATH`
cd $PROJECTROOT
find app/ui/legacy/src/main/res/values-* -name "strings.xml" -type f -exec ./tools/fix_transifex_output.sh {} \;
cd -

26
tools/fix_transifex_output.sh Executable file
View file

@ -0,0 +1,26 @@
#!/bin/bash
# What we get from Transifex is unusable and needs some fixing before we're able to use
# the translations.
FILE=$1
# Fix xliff tags
perl -i -pe 's/&lt;xliff:g id=\\?"(.*?)?\\?"&gt;/<xliff:g id="\1">/g' $FILE
perl -i -pe 's/&lt;\/xliff:g&gt;/<\/xliff:g>/g' $FILE
# Escape single and double quotes before and after xliff tags
perl -i -pe 's/([^\\])(["'\''])<xliff/\1\\\2<xliff/g' $FILE
perl -i -pe 's/xliff:g>(["'\''])/xliff:g>\\\1/g' $FILE
# Restore "&lt;" and "&gt;"
perl -i -pe 's/&amp;(lt|gt);/&\1;/g' $FILE
# <string ...></string> -> <string ... />
perl -i -pe 's/"><\/string>/"\/>/g' $FILE
# Escape single and double quotes (but not in comments or the xml tag)
perl -i -pe 's/([^\\])'\''/\1\\'\''/g unless /(<!--|xml)/' $FILE
# Use double quotes for 'message_view_recipient_prefix' value to retain trailing space
perl -i -pe 's/<string name="message_view_recipient_prefix">(.* )<\/string>/<string name="message_view_recipient_prefix">"\1"<\/string>/' $FILE