Commit 86e68665 authored by Arturo Jiménez 's avatar Arturo Jiménez

Updated with last stable version of k9

There are problems to fix with color shown in the toolbar and the status bar

Merge branch 'develop' into feature/material-toolbar-pep-activities

Conflicts:
	build.gradle
	gradle/wrapper/gradle-wrapper.jar
	gradle/wrapper/gradle-wrapper.properties
	gradlew
	gradlew.bat
	k9mail-library/src/main/java/com/fsck/k9/mail/internet/MessageExtractor.java
	k9mail-library/src/main/java/com/fsck/k9/mail/internet/MimeMultipart.java
	k9mail-library/src/main/java/com/fsck/k9/mail/transport/SmtpTransport.java
	k9mail-library/src/test/java/com/fsck/k9/mail/store/imap/ImapConnectionTest.java
	k9mail/build.gradle
	k9mail/src/fDroid/res/values/strings.xml
	k9mail/src/main/AndroidManifest.xml
	k9mail/src/main/java/com/fsck/k9/K9.java
	k9mail/src/main/java/com/fsck/k9/account/AndroidAccountOAuth2TokenStore.java
	k9mail/src/main/java/com/fsck/k9/activity/Accounts.java
	k9mail/src/main/java/com/fsck/k9/activity/FolderList.java
	k9mail/src/main/java/com/fsck/k9/activity/K9Activity.java
	k9mail/src/main/java/com/fsck/k9/activity/K9ActivityCommon.java
	k9mail/src/main/java/com/fsck/k9/activity/K9ListActivity.java
	k9mail/src/main/java/com/fsck/k9/activity/MessageCompose.java
	k9mail/src/main/java/com/fsck/k9/activity/MessageList.java
	k9mail/src/main/java/com/fsck/k9/activity/compose/RecipientMvpView.java
	k9mail/src/main/java/com/fsck/k9/activity/compose/RecipientPresenter.java
	k9mail/src/main/java/com/fsck/k9/activity/setup/AccountSettings.java
	k9mail/src/main/java/com/fsck/k9/activity/setup/AccountSetupAccountType.java
	k9mail/src/main/java/com/fsck/k9/activity/setup/AccountSetupBasics.java
	k9mail/src/main/java/com/fsck/k9/activity/setup/AccountSetupCheckSettings.java
	k9mail/src/main/java/com/fsck/k9/activity/setup/AccountSetupIncoming.java
	k9mail/src/main/java/com/fsck/k9/activity/setup/AccountSetupNames.java
	k9mail/src/main/java/com/fsck/k9/activity/setup/AccountSetupOptions.java
	k9mail/src/main/java/com/fsck/k9/activity/setup/AccountSetupOutgoing.java
	k9mail/src/main/java/com/fsck/k9/activity/setup/Prefs.java
	k9mail/src/main/java/com/fsck/k9/controller/MessagingController.java
	k9mail/src/main/java/com/fsck/k9/fragment/MessageListFragment.java
	k9mail/src/main/java/com/fsck/k9/mailstore/AttachmentViewInfo.java
	k9mail/src/main/java/com/fsck/k9/mailstore/LocalMessage.java
	k9mail/src/main/java/com/fsck/k9/mailstore/LocalStore.java
	k9mail/src/main/java/com/fsck/k9/message/MessageBuilder.java
	k9mail/src/main/java/com/fsck/k9/message/PgpMessageBuilder.java
	k9mail/src/main/java/com/fsck/k9/pEp/PEpMessageBuilder.java
	k9mail/src/main/java/com/fsck/k9/pEp/PEpProvider.java
	k9mail/src/main/java/com/fsck/k9/pEp/PEpProviderImpl.java
	k9mail/src/main/java/com/fsck/k9/pEp/PEpUtils.java
	k9mail/src/main/java/com/fsck/k9/pEp/PePUIArtefactCache.java
	k9mail/src/main/java/com/fsck/k9/pEp/models/mappers/PEpIdentityMapper.java
	k9mail/src/main/java/com/fsck/k9/pEp/ui/PEpContactBadge.java
	k9mail/src/main/java/com/fsck/k9/pEp/ui/PepColoredActivity.java
	k9mail/src/main/java/com/fsck/k9/pEp/ui/adapters/PEpIdentitiesAdapter.java
	k9mail/src/main/java/com/fsck/k9/pEp/ui/blacklist/KeysAdapter.java
	k9mail/src/main/java/com/fsck/k9/pEp/ui/blacklist/PepBlacklist.java
	k9mail/src/main/java/com/fsck/k9/pEp/ui/privacy/status/PEpStatus.java
	k9mail/src/main/java/com/fsck/k9/pEp/ui/privacy/status/PEpStatusPresenter.java
	k9mail/src/main/java/com/fsck/k9/pEp/ui/privacy/status/PEpTrustwords.java
	k9mail/src/main/java/com/fsck/k9/preferences/GlobalSettings.java
	k9mail/src/main/java/com/fsck/k9/ui/messageview/AttachmentController.java
	k9mail/src/main/java/com/fsck/k9/ui/messageview/MessageViewFragment.java
	k9mail/src/main/java/com/fsck/k9/view/MessageHeader.java
	k9mail/src/main/java/com/fsck/k9/view/RecipientSelectView.java
	k9mail/src/main/res/drawable/status_lock_closed.xml
	k9mail/src/main/res/layout-land/actionbar_custom.xml
	k9mail/src/main/res/layout/account_setup_basics.xml
	k9mail/src/main/res/layout/actionbar_custom.xml
	k9mail/src/main/res/layout/message_crypto_status_view.xml
	k9mail/src/main/res/layout/message_list_item.xml
	k9mail/src/main/res/layout/pep_blacklist.xml
	k9mail/src/main/res/layout/pep_recipient_row.xml
	k9mail/src/main/res/layout/pep_status.xml
	k9mail/src/main/res/layout/pep_trustwords.xml
	k9mail/src/main/res/layout/pep_trustwords_view.xml
	k9mail/src/main/res/layout/recipient_token_item.xml
	k9mail/src/main/res/layout/toolbar.xml
	k9mail/src/main/res/menu/menu_pep_status.xml
	k9mail/src/main/res/menu/message_compose_option.xml
	k9mail/src/main/res/values-es/pep_strings.xml
	k9mail/src/main/res/values-es/strings.xml
	k9mail/src/main/res/values-iw/strings.xml
	k9mail/src/main/res/values-ja/strings.xml
	k9mail/src/main/res/values-nb/strings.xml
	k9mail/src/main/res/values-nl/strings.xml
	k9mail/src/main/res/values-pl/strings.xml
	k9mail/src/main/res/values-pt-rBR/strings.xml
	k9mail/src/main/res/values-sk/strings.xml
	k9mail/src/main/res/values-sr/strings.xml
	k9mail/src/main/res/values-sv/strings.xml
	k9mail/src/main/res/values-uk/strings.xml
	k9mail/src/main/res/values-zh-rCN/strings.xml
	k9mail/src/main/res/values/colors.xml
	k9mail/src/main/res/values/pep_strings.xml
	k9mail/src/main/res/values/strings.xml
	k9mail/src/main/res/values/styles.xml
	k9mail/src/main/res/values/themes.xml
	k9mail/src/main/res/xml/account_settings_preferences.xml
	k9mail/src/test/java/com/fsck/k9/message/MessageBuilderTest.java
	settings.gradle
parents 885a7940 3997c95d
......@@ -2,10 +2,10 @@ language: android
android:
components:
- tools
- build-tools-23.0.3
- android-23
- build-tools-24.0.3
- android-24
- extra-android-m2repository
jdk: oraclejdk7
jdk: oraclejdk8
script: ./gradlew testDebug
[main]
host = https://www.transifex.com
lang_map = af_ZA: af-rZA, am_ET: am-rET, ar_AE: ar-rAE, ar_BH: ar-rBH, ar_DZ: ar-rDZ, ar_EG: ar-rEG, ar_IQ: ar-rIQ, ar_JO: ar-rJO, ar_KW: ar-rKW, ar_LB: ar-rLB, ar_LY: ar-rLY, ar_MA: ar-rMA, ar_OM: ar-rOM, ar_QA: ar-rQA, ar_SA: ar-rSA, ar_SY: ar-rSY, ar_TN: ar-rTN, ar_YE: ar-rYE, arn_CL: arn-rCL, as_IN: as-rIN, az_AZ: az-rAZ, ba_RU: ba-rRU, be_BY: be-rBY, bg_BG: bg-rBG, bn_BD: bn-rBD, bn_IN: bn-rIN, bo_CN: bo-rCN, br_FR: br-rFR, bs_BA: bs-rBA, ca_ES: ca-rES, co_FR: co-rFR, cs_CZ: cs-rCZ, cy_GB: cy-rGB, da_DK: da-rDK, de_AT: de-rAT, de_CH: de-rCH, de_DE: de-rDE, de_LI: de-rLI, de_LU: de-rLU, dsb_DE: dsb-rDE, dv_MV: dv-rMV, el_GR: el-rGR, en_AU: en-rAU, en_BZ: en-rBZ, en_CA: en-rCA, en_GB: en-rGB, en_IE: en-rIE, en_IN: en-rIN, en_JM: en-rJM, en_MY: en-rMY, en_NZ: en-rNZ, en_PH: en-rPH, en_SG: en-rSG, en_TT: en-rTT, en_US: en-rUS, en_ZA: en-rZA, en_ZW: en-rZW, es_AR: es-rAR, es_BO: es-rBO, es_CL: es-rCL, es_CO: es-rCO, es_CR: es-rCR, es_DO: es-rDO, es_EC: es-rEC, es_ES: es-rES, es_GT: es-rGT, es_HN: es-rHN, es_MX: es-rMX, es_NI: es-rNI, es_PA: es-rPA, es_PE: es-rPE, es_PR: es-rPR, es_PY: es-rPY, es_SV: es-rSV, es_US: es-rUS, es_UY: es-rUY, es_VE: es-rVE, et_EE: et-rEE, eu_ES: eu-rES, fa_IR: fa-rIR, fi_FI: fi-rFI, fil_PH: fil-rPH, fo_FO: fo-rFO, fr_BE: fr-rBE, fr_CA: fr-rCA, fr_CH: fr-rCH, fr_FR: fr-rFR, fr_LU: fr-rLU, fr_MC: fr-rMC, fy_NL: fy-rNL, ga_IE: ga-rIE, gd_GB: gd-rGB, gl_ES: gl-rES, gsw_FR: gsw-rFR, gu_IN: gu-rIN, ha_NG: ha-rNG, hi_IN: hi-rIN, hr_BA: hr-rBA, hr_HR: hr-rHR, hsb_DE: hsb-rDE, hu_HU: hu-rHU, hy_AM: hy-rAM, id_ID: id-rID, ig_NG: ig-rNG, ii_CN: ii-rCN, is_IS: is-rIS, it_CH: it-rCH, it_IT: it-rIT, iu_CA: iu-rCA, ja_JP: ja-rJP, ka_GE: ka-rGE, kk_KZ: kk-rKZ, kl_GL: kl-rGL, km_KH: km-rKH, kn_IN: kn-rIN, ko_KR: ko-rKR, kok_IN: kok-rIN, ky_KG: ky-rKG, lb_LU: lb-rLU, lo_LA: lo-rLA, lt_LT: lt-rLT, lv_LV: lv-rLV, mi_NZ: mi-rNZ, mk_MK: mk-rMK, ml_IN: ml-rIN, mn_CN: mn-rCN, mn_MN: mn-rMN, moh_CA: moh-rCA, mr_IN: mr-rIN, ms_BN: ms-rBN, ms_MY: ms-rMY, mt_MT: mt-rMT, nb_NO: nb-rNO, ne_NP: ne-rNP, nl_BE: nl-rBE, nl_NL: nl-rNL, nn_NO: nn-rNO, nso_ZA: nso-rZA, oc_FR: oc-rFR, or_IN: or-rIN, pa_IN: pa-rIN, pl_PL: pl-rPL, prs_AF: prs-rAF, ps_AF: ps-rAF, pt_BR: pt-rBR, pt_PT: pt-rPT, qut_GT: qut-rGT, quz_BO: quz-rBO, quz_EC: quz-rEC, quz_PE: quz-rPE, rm_CH: rm-rCH, ro_RO: ro-rRO, ru_RU: ru-rRU, rw_RW: rw-rRW, sa_IN: sa-rIN, sah_RU: sah-rRU, se_FI: se-rFI, se_NO: se-rNO, se_SE: se-rSE, si_LK: si-rLK, sk_SK: sk-rSK, sl_SI: sl-rSI, sma_NO: sma-rNO, sma_SE: sma-rSE, smj_NO: smj-rNO, smj_SE: smj-rSE, smn_FI: smn-rFI, sms_FI: sms-rFI, sq_AL: sq-rAL, sr_BA: sr-rBA, sr_CS: sr-rCS, sr_ME: sr-rME, sr_RS: sr-rRS, sv_FI: sv-rFI, sv_SE: sv-rSE, sw_KE: sw-rKE, syr_SY: syr-rSY, ta_IN: ta-rIN, te_IN: te-rIN, tg_TJ: tg-rTJ, th_TH: th-rTH, tk_TM: tk-rTM, tn_ZA: tn-rZA, tr_TR: tr-rTR, tt_RU: tt-rRU, tzm_DZ: tzm-rDZ, ug_CN: ug-rCN, uk_UA: uk-rUA, ur_PK: ur-rPK, uz_UZ: uz-rUZ, vi_VN: vi-rVN, wo_SN: wo-rSN, xh_ZA: xh-rZA, yo_NG: yo-rNG, zh_CN: zh-rCN, zh_HK: zh-rHK, zh_MO: zh-rMO, zh_SG: zh-rSG, zh_TW: zh-rTW, zu_ZA: zu-rZA, no_NO: no-rNO, he_IL: iw-rIL, he: iw
[k9mail.strings]
file_filter = k9mail/src/main/res/values-<lang>/strings.xml
source_file = k9mail/src/main/res/values/strings.xml
source_lang = en
HtmlCleaner is distributed under BSD License. It gives the freedom for
anyone to use, explore, modify, and distribute HtmlCleaner, but without any
warranty.
Copyright (c) 2006-2011, HtmlCleaner team.
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
following conditions are met:
* Redistributions of source code must retain the above
copyright notice, this list of conditions and the
following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the
following disclaimer in the documentation and/or other
materials provided with the distribution.
* The name of HtmlCleaner may not be used to endorse or promote
products derived from this software without specific prior
written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This diff is collapsed.
......@@ -4,24 +4,20 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0-alpha1'
classpath 'com.android.tools.build:gradle:2.3.0-beta1'
}
}
project.ext {
preDexLibs = !project.hasProperty('disablePreDex')
testCoverage = project.hasProperty('testCoverage')
optimizeForDevelopment = project.hasProperty('optimizeForDevelopment') && optimizeForDevelopment == 'true'
compileSdkVersion = 25
buildToolsVersion = '25.0.0'
}
subprojects {
project.plugins.whenPluginAdded { plugin ->
if ("com.android.build.gradle.AppPlugin".equals(plugin.class.name) ||
"com.android.build.gradle.LibraryPlugin".equals(plugin.class.name)) {
project.android.dexOptions.preDexLibraries = rootProject.ext.preDexLibs
project.android.dexOptions.preDexLibraries = !rootProject.hasProperty('disablePreDex')
}
}
}
K-9 Mail is an open source email client with support for multiple accounts, search, IMAP push email, multi-folder sync, flagging, filing, signatures, BCC-self, PGP/MIME & more!
K-9 supports IMAP, POP3 and Exchange 2003/2007 (with WebDAV).
Install the app "OpenKeychain: Easy PGP" to encrypt/decrypt your emails using OpenPGP.
K-9 is a community developed project. If you're interested in helping to make the most popular open source email client on Android even better, please join us! You can find our bug tracker, source code, mailing list and wiki at https://github.com/k9mail/k-9
We're always happy to welcome new developers, designers, documenters, bug triagers and friends.
If you're having trouble with K-9, please report a bug at https://github.com/k9mail/k-9 rather than just leaving a one-star review. We don't mind you telling the world that you're frustrated, but if you use our bug tracker, we have a better chance of fixing whatever's giving you a hard time.
You can find K-9's release notes at: http://bit.ly/new-k9
(People sometimes call K-9: K9, K9 Mail, K-9 Email, K9 Email, K9 E-Mail, k9mail or k9email.)
K-9 Mail is a 100% free and open source email client for Android.
androidCompileSdkVersion=25
androidBuildToolsVersion=25.0.5
androidSupportLibraryVersion=23.1.1
robolectricVersion=3.1.1
junitVersion=4.12
mockitoVersion=1.10.19
okioVersion=1.11.0
#Tue Aug 16 01:22:57 CEST 2016
#Sat Mar 05 16:39:58 GMT 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-3.2-all.zip
#!/usr/bin/env bash
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg id="Capa_1" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" style="enable-background:new 0 0 457.47 457.469;" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" height="457.47px" viewBox="0 0 457.47 457.469" width="457.47px" version="1.1" y="0px" x="0px" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/"><metadata id="metadata41"><rdf:RDF><cc:Work rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/><dc:title/></cc:Work></rdf:RDF></metadata><g id="g3" transform="matrix(0.57627118,0,0,0.57627118,96.921399,96.921399)"><path id="path5" d="M228.75,96.906c-72.8,0-131.84,59.044-131.84,131.84,0,72.8,59.044,131.81,131.84,131.81,72.8,0,131.81-59.01,131.81-131.81s-59.01-131.84-131.81-131.84zm0,76.594c30.51,0,55.22,24.74,55.22,55.25s-24.71,55.22-55.22,55.22-55.25-24.71-55.25-55.22,24.74-55.25,55.25-55.25z" transform="matrix(1.7352942,0,0,1.7352942,-168.18714,-168.18714)"/></g></svg>
......@@ -19,20 +19,20 @@ dependencies {
compile 'commons-io:commons-io:2.4'
compile 'com.jcraft:jzlib:1.0.7'
compile 'com.beetstra.jutf7:jutf7:1.0.0'
compile 'com.android.support:support-annotations:23.3.0'
compile "com.android.support:support-annotations:${androidSupportLibraryVersion}"
androidTestCompile 'com.android.support.test:runner:0.4.1'
androidTestCompile 'com.madgag.spongycastle:pg:1.51.0.0'
testCompile 'com.squareup.okio:okio:1.6.0'
testCompile 'org.robolectric:robolectric:3.0'
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:1.10.19'
testCompile "com.squareup.okio:okio:${okioVersion}"
testCompile "org.robolectric:robolectric:${robolectricVersion}"
testCompile "junit:junit:${junitVersion}"
testCompile "org.mockito:mockito-core:${mockitoVersion}"
}
android {
compileSdkVersion rootProject.compileSdkVersion
buildToolsVersion rootProject.buildToolsVersion
compileSdkVersion androidCompileSdkVersion.toInteger()
buildToolsVersion androidBuildToolsVersion
defaultConfig {
minSdkVersion 15
......
......@@ -145,7 +145,7 @@ public abstract class Message implements Part, Body {
public abstract boolean hasAttachments();
public abstract int getSize();
public abstract long getSize();
public void delete(String trashFolderName) throws MessagingException {}
......
......@@ -47,17 +47,17 @@ public class MessageExtractor {
if ((part != null) && (part.getBody() != null)) {
final Body body = part.getBody();
if (body instanceof TextBody) {
return ((TextBody)body).getRawText();
return ((TextBody) body).getRawText();
}
final String mimeType = part.getMimeType();
if (mimeType != null && MimeUtility.mimeTypeMatches(mimeType, "text/*") ||
part.isMimeType("application/pgp")) {
return getTextFromTextPart(part, body, mimeType, textSizeLimit);
} else {
throw new MessagingException("Provided non-text part: " + part);
throw new MessagingException("Provided non-text part: " + mimeType);
}
} else {
throw new MessagingException("Provided invalid part: " + part);
throw new MessagingException("Provided invalid part");
}
} catch (IOException e) {
Log.e(LOG_TAG, "Unable to getTextFromPart", e);
......
......@@ -4,6 +4,7 @@ package com.fsck.k9.mail.internet;
import com.fsck.k9.mail.Body;
import com.fsck.k9.mail.BodyPart;
import com.fsck.k9.mail.MessagingException;
import com.fsck.k9.mail.Multipart;
import java.io.BufferedWriter;
import java.io.IOException;
......@@ -93,7 +94,14 @@ public class MimeBodyPart extends BodyPart {
@Override
public String getContentType() {
String contentType = getFirstHeader(MimeHeader.HEADER_CONTENT_TYPE);
return (contentType == null) ? "text/plain" : MimeUtility.unfoldAndDecode(contentType);
if (contentType != null) {
return MimeUtility.unfoldAndDecode(contentType);
}
Multipart parent = getParent();
if (parent != null && "multipart/digest".equals(parent.getMimeType())) {
return "message/rfc822";
}
return "text/plain";
}
@Override
......
......@@ -182,7 +182,7 @@ public class MimeMessage extends Message {
}
@Override
public int getSize() {
public long getSize() {
return mSize;
}
......@@ -430,7 +430,7 @@ public class MimeMessage extends Message {
@Override
public InputStream getInputStream() throws MessagingException {
return null;
throw new UnsupportedOperationException();
}
@Override
......
......@@ -106,6 +106,6 @@ public class MimeMultipart extends Multipart {
@Override
public InputStream getInputStream() throws MessagingException {
return null;
throw new UnsupportedOperationException();
}
}
......@@ -1044,7 +1044,7 @@ public class MimeUtility {
}
};
} else {
throw new UnsupportedOperationException("Encoding for RawDataBody not supported: " + encoding);
throw new UnsupportedContentTransferEncodingException(encoding);
}
} else {
inputStream = body.getInputStream();
......
......@@ -146,4 +146,5 @@ public class TextBody implements Body, SizeAware {
public String getEncoding() {
return encoding;
}
}
package com.fsck.k9.mail.internet;
import com.fsck.k9.mail.MessagingException;
public class UnsupportedContentTransferEncodingException extends MessagingException {
public UnsupportedContentTransferEncodingException(String encoding) {
super("Unsupported encoding: "+encoding);
}
}
package com.fsck.k9.mail.store.imap;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.util.Log;
import com.fsck.k9.mail.Authentication;
import com.fsck.k9.mail.AuthenticationFailedException;
import com.fsck.k9.mail.CertificateValidationException;
import com.fsck.k9.mail.ConnectionSecurity;
import com.fsck.k9.mail.K9MailLib;
import com.fsck.k9.mail.MessagingException;
import com.fsck.k9.mail.NetworkType;
import com.fsck.k9.mail.filter.Base64;
import com.fsck.k9.mail.filter.PeekableInputStream;
import com.fsck.k9.mail.oauth.OAuth2TokenProvider;
import com.fsck.k9.mail.ssl.TrustedSocketFactory;
import com.jcraft.jzlib.JZlib;
import com.jcraft.jzlib.ZOutputStream;
import org.apache.commons.io.IOUtils;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.net.ConnectException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
......@@ -27,25 +46,7 @@ import java.util.regex.Pattern;
import java.util.zip.Inflater;
import java.util.zip.InflaterInputStream;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.util.Log;
import com.fsck.k9.mail.Authentication;
import com.fsck.k9.mail.AuthenticationFailedException;
import com.fsck.k9.mail.CertificateValidationException;
import com.fsck.k9.mail.ConnectionSecurity;
import com.fsck.k9.mail.K9MailLib;
import com.fsck.k9.mail.MessagingException;
import com.fsck.k9.mail.NetworkType;
import com.fsck.k9.mail.filter.Base64;
import com.fsck.k9.mail.filter.PeekableInputStream;
import com.fsck.k9.mail.oauth.OAuth2TokenProvider;
import com.fsck.k9.mail.ssl.TrustedSocketFactory;
import com.jcraft.jzlib.JZlib;
import com.jcraft.jzlib.ZOutputStream;
import javax.net.ssl.SSLException;
import org.apache.commons.io.IOUtils;
import static com.fsck.k9.mail.ConnectionSecurity.STARTTLS_REQUIRED;
import static com.fsck.k9.mail.K9MailLib.DEBUG_PROTOCOL_IMAP;
......@@ -75,10 +76,10 @@ class ImapConnection {
private int nextCommandTag;
private Set<String> capabilities = new HashSet<String>();
private ImapSettings settings;
private String authToken = null;
private boolean authTokenExpired = false;
private Exception stacktraceForClose;
private boolean open = false;
private String authToken = null;
private boolean authTokenExpired = false;
public ImapConnection(ImapSettings settings, TrustedSocketFactory socketFactory,
......
......@@ -496,7 +496,7 @@ class ImapFolder extends Folder<ImapMessage> {
@Override
public void delete(boolean recurse) throws MessagingException {
throw new Error("ImapStore.delete() not yet implemented");
throw new Error("ImapFolder.delete() not yet implemented");
}
@Override
......
......@@ -58,7 +58,7 @@ class ImapList extends ArrayList<Object> {
private Date getDate(String value) throws MessagingException {
try {
if (value == null) {
if (value == null || "NIL".equals(value)) {
return null;