Commit ede7fd20 authored by Ricki Hirner's avatar Ricki Hirner 🐑

Version 0.7

* new Settings activity
* Settings: display/change user name, password, preemptive auth.
* Settings: display/change sync. interval for contacts and calendars
* requires permission GET_ACCOUNTS to list accounts in Settings
* requires permission READ_SYNC_SETTINGS to display current sync intervals
* remove obsolete files from res/
* update copyright notices
* version bump to 0.7
parent 9682b535
/*
* Copyright (c) 2013 – 2015 Ricki Hirner (bitfire web engineering).
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
*/
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
buildToolsVersion '21.1.2'
defaultConfig {
applicationId "at.bitfire.davdroid"
......@@ -19,7 +27,8 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
dexOptions {
lintOptions {
abortOnError false
}
packagingOptions {
......@@ -36,13 +45,10 @@ dependencies {
// Apache Commons
compile 'commons-lang:commons-lang:2.6'
compile 'commons-io:commons-io:2.4'
// Lombok for useful @helpers
provided 'org.projectlombok:lombok:1.14.8'
// ical4j for parsing/generating iCalendars
compile 'org.mnode.ical4j:ical4j:1.0.6'
// ez-vcard for parsing/generating VCards
compile('com.googlecode.ez-vcard:ez-vcard:0.9.6') {
// hCard functionality not needed
......@@ -51,16 +57,13 @@ dependencies {
// jCard functionality not needed
exclude group: 'com.fasterxml.jackson.core', module: 'jackson-core'
}
// dnsjava for querying SRV/TXT records
compile 'dnsjava:dnsjava:2.1.6'
// HttpClient 4.3, Android flavour for WebDAV operations
// we have to use our own patched build of 4.3.5.2-SNAPSHOT to avoid
// https://issues.apache.org/jira/browse/HTTPCLIENT-1591
compile files('lib/httpclient-android-4.3.5.2-davdroid1.jar')
// compile 'org.apache.httpcomponents:httpclient-android:4.3.5.2-SNAPSHOT'
// SimpleXML for parsing and generating WebDAV messages
compile('org.simpleframework:simple-xml:2.7.1') {
exclude group: 'stax', module: 'stax-api'
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2013 – 2015 Ricki Hirner (bitfire web engineering).
~ All rights reserved. This program and the accompanying materials
~ are made available under the terms of the GNU Public License v3.0
~ which accompanies this distribution, and is available at
~ http://www.gnu.org/licenses/gpl.html
-->
<lint>
<issue id="InvalidPackage" severity="ignore" />
<issue id="MissingTranslation" severity="warning" />
......
/*******************************************************************************
* Copyright (c) 2014 Ricki Hirner (bitfire web engineering).
/*
* Copyright (c) 2013 – 2015 Ricki Hirner (bitfire web engineering).
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
******************************************************************************/
*/
package at.bitfire.davdroid;
import java.util.Arrays;
......
/*******************************************************************************
* Copyright (c) 2014 Ricki Hirner (bitfire web engineering).
/*
* Copyright (c) 2013 – 2015 Ricki Hirner (bitfire web engineering).
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
******************************************************************************/
*/
package at.bitfire.davdroid;
import java.io.IOException;
......
/*
* Copyright (c) 2013 – 2015 Ricki Hirner (bitfire web engineering).
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
*/
package at.bitfire.davdroid;
import java.net.URI;
......
/*******************************************************************************
* Copyright (c) 2014 Ricki Hirner (bitfire web engineering).
/*
* Copyright (c) 2013 – 2015 Ricki Hirner (bitfire web engineering).
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
******************************************************************************/
*/
package at.bitfire.davdroid;
import java.net.URI;
......
/*******************************************************************************
* Copyright (c) 2014 Ricki Hirner (bitfire web engineering).
/*
* Copyright (c) 2013 – 2015 Ricki Hirner (bitfire web engineering).
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
******************************************************************************/
*/
package at.bitfire.davdroid.resource;
import java.io.IOException;
......
/*******************************************************************************
* Copyright (c) 2014 Ricki Hirner (bitfire web engineering).
/*
* Copyright (c) 2013 – 2015 Ricki Hirner (bitfire web engineering).
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
******************************************************************************/
*/
package at.bitfire.davdroid.resource;
import java.io.IOException;
......
/*******************************************************************************
* Copyright (c) 2014 Ricki Hirner (bitfire web engineering).
/*
* Copyright (c) 2013 – 2015 Ricki Hirner (bitfire web engineering).
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
******************************************************************************/
*/
package at.bitfire.davdroid.resource;
import java.util.Calendar;
......
/*
* Copyright (c) 2013 – 2015 Ricki Hirner (bitfire web engineering).
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
*/
package at.bitfire.davdroid.syncadapter;
import java.io.IOException;
......
/*
* Copyright (c) 2013 – 2015 Ricki Hirner (bitfire web engineering).
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
*/
package at.bitfire.davdroid.webdav;
import java.io.IOException;
......
/*
* Copyright (c) 2015 Ricki Hirner (bitfire web engineering).
* Copyright (c) 2013 – 2015 Ricki Hirner (bitfire web engineering).
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
......
/*******************************************************************************
* Copyright (c) 2014 Ricki Hirner (bitfire web engineering).
/*
* Copyright (c) 2013 – 2015 Ricki Hirner (bitfire web engineering).
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
******************************************************************************/
*/
package at.bitfire.davdroid.webdav;
import java.io.InputStream;
......
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (c) 2013 – 2015 Ricki Hirner (bitfire web engineering).
~ All rights reserved. This program and the accompanying materials
~ are made available under the terms of the GNU Public License v3.0
~ which accompanies this distribution, and is available at
~ http://www.gnu.org/licenses/gpl.html
-->
<resources>
<string name="app_name">DavdroidTest</string>
......
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (c) 2013 – 2015 Ricki Hirner (bitfire web engineering).
~ All rights reserved. This program and the accompanying materials
~ are made available under the terms of the GNU Public License v3.0
~ which accompanies this distribution, and is available at
~ http://www.gnu.org/licenses/gpl.html
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="at.bitfire.davdroid"
android:versionCode="54" android:versionName="0.6.12"
android:versionCode="55" android:versionName="0.7"
android:installLocation="internalOnly">
<uses-sdk
......@@ -10,10 +18,12 @@
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
<uses-permission android:name="android.permission.READ_CALENDAR" />
<uses-permission android:name="android.permission.WRITE_CALENDAR" />
<uses-permission android:name="android.permission.READ_SYNC_SETTINGS" />
<uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" />
<application
......@@ -21,7 +31,8 @@
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme"
android:process=":sync" >
android:process=":sync">
<service
android:name=".syncadapter.AccountAuthenticatorService"
android:exported="false" >
......@@ -71,6 +82,13 @@
android:name=".syncadapter.AddAccountActivity"
android:excludeFromRecents="true" >
</activity>
<activity
android:name=".syncadapter.SettingsActivity"
android:label="@string/settings_title" >
<intent-filter>
<action android:name="android.intent.action.MANAGE_NETWORK_USAGE" />
</intent-filter>
</activity>
</application>
</manifest>
/*******************************************************************************
* Copyright (c) 2014 Ricki Hirner (bitfire web engineering).
/*
* Copyright (c) 2013 – 2015 Ricki Hirner (bitfire web engineering).
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
******************************************************************************/
*/
package at.bitfire.davdroid;
import java.lang.reflect.Array;
......
/*******************************************************************************
* Copyright (c) 2014 Ricki Hirner (bitfire web engineering).
/*
* Copyright (c) 2013 – 2015 Ricki Hirner (bitfire web engineering).
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
******************************************************************************/
*/
package at.bitfire.davdroid;
public class Constants {
public static final String
APP_VERSION = "0.6.12",
APP_VERSION = "0.7",
ACCOUNT_TYPE = "bitfire.at.davdroid",
WEB_URL_HELP = "https://davdroid.bitfire.at/configuration?pk_campaign=davdroid-app",
WEB_URL_VIEW_LOGS = "https://github.com/bitfireAT/davdroid/wiki/How-to-view-the-logs";
......
/*******************************************************************************
* Copyright (c) 2014 Ricki Hirner (bitfire web engineering).
/*
* Copyright (c) 2013 – 2015 Ricki Hirner (bitfire web engineering).
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
******************************************************************************/
*/
package at.bitfire.davdroid;
import android.app.Activity;
......@@ -21,6 +21,7 @@ import android.view.View;
import android.widget.TextView;
import at.bitfire.davdroid.syncadapter.AddAccountActivity;
import at.bitfire.davdroid.syncadapter.SettingsActivity;
public class MainActivity extends Activity {
......@@ -51,8 +52,11 @@ public class MainActivity extends Activity {
public void addAccount(MenuItem item) {
Intent intent = new Intent(this, AddAccountActivity.class);
startActivity(intent);
startActivity(new Intent(this, AddAccountActivity.class));
}
public void showSettings(MenuItem item) {
startActivity(new Intent(this, SettingsActivity.class));
}
public void showSyncSettings(MenuItem item) {
......
/*******************************************************************************
* Copyright (c) 2014 Ricki Hirner (bitfire web engineering).
/*
* Copyright (c) 2013 – 2015 Ricki Hirner (bitfire web engineering).
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
******************************************************************************/
*/
package at.bitfire.davdroid;
import android.util.Log;
......
/*******************************************************************************
* Copyright (c) 2014 Ricki Hirner (bitfire web engineering).
/*
* Copyright (c) 2013 – 2015 Ricki Hirner (bitfire web engineering).
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
******************************************************************************/
*/
package at.bitfire.davdroid.resource;
import org.apache.http.impl.client.CloseableHttpClient;
......
/*******************************************************************************
* Copyright (c) 2014 Ricki Hirner (bitfire web engineering).
/*
* Copyright (c) 2013 – 2015 Ricki Hirner (bitfire web engineering).
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
******************************************************************************/
*/
package at.bitfire.davdroid.resource;
import org.apache.http.impl.client.CloseableHttpClient;
......
/*******************************************************************************
* Copyright (c) 2014 Ricki Hirner (bitfire web engineering).
/*
* Copyright (c) 2013 – 2015 Ricki Hirner (bitfire web engineering).
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
******************************************************************************/
*/
package at.bitfire.davdroid.resource;
import android.util.Log;
......
/*******************************************************************************
* Copyright (c) 2014 Ricki Hirner (bitfire web engineering).
/*
* Copyright (c) 2013 – 2015 Ricki Hirner (bitfire web engineering).
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
******************************************************************************/
*/
package at.bitfire.davdroid.resource;
import android.content.Context;
......@@ -67,11 +67,11 @@ public class DavResourceFinder implements Closeable {
Log.i(TAG, "Couldn't find address-book home set", e);
}
if (uriAddressBookHomeSet != null) {
serverInfo.setCardDAV(true);
Log.i(TAG, "Found address-book home set: " + uriAddressBookHomeSet);
WebDavResource homeSetAddressBooks = new WebDavResource(principal, uriAddressBookHomeSet);
if (checkHomesetCapabilities(homeSetAddressBooks, "addressbook")) {
serverInfo.setCardDAV(true);
homeSetAddressBooks.propfind(Mode.CARDDAV_COLLECTIONS);
List<ServerInfo.ResourceInfo> addressBooks = new LinkedList<>();
......@@ -109,11 +109,11 @@ public class DavResourceFinder implements Closeable {
Log.i(TAG, "Couldn't find calendar home set", e);
}
if (uriCalendarHomeSet != null) {
serverInfo.setCalDAV(true);
Log.i(TAG, "Found calendar home set: " + uriCalendarHomeSet);
WebDavResource homeSetCalendars = new WebDavResource(principal, uriCalendarHomeSet);
if (checkHomesetCapabilities(homeSetCalendars, "calendar-access")) {
serverInfo.setCalDAV(true);
homeSetCalendars.propfind(Mode.CALDAV_COLLECTIONS);
List<ServerInfo.ResourceInfo> calendars = new LinkedList<>();
......
/*******************************************************************************
* Copyright (c) 2014 Ricki Hirner (bitfire web engineering).
/*
* Copyright (c) 2013 – 2015 Ricki Hirner (bitfire web engineering).
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
******************************************************************************/
*/
package at.bitfire.davdroid.resource;
import android.text.format.Time;
......
/*******************************************************************************
* Copyright (c) 2014 Ricki Hirner (bitfire web engineering).
/*
* Copyright (c) 2013 – 2015 Ricki Hirner (bitfire web engineering).
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
******************************************************************************/
*/
package at.bitfire.davdroid.resource;
public class InvalidResourceException extends Exception {
......
/*******************************************************************************
* Copyright (c) 2014 Ricki Hirner (bitfire web engineering).
/*
* Copyright (c) 2013 – 2015 Ricki Hirner (bitfire web engineering).
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
******************************************************************************/
*/
package at.bitfire.davdroid.resource;
import android.accounts.Account;
......
/*******************************************************************************
* Copyright (c) 2014 Ricki Hirner (bitfire web engineering).
/*
* Copyright (c) 2013 – 2015 Ricki Hirner (bitfire web engineering).
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
******************************************************************************/
*/
package at.bitfire.davdroid.resource;
import android.accounts.Account;
......
/*******************************************************************************
* Copyright (c) 2014 Ricki Hirner (bitfire web engineering).
/*
* Copyright (c) 2013 – 2015 Ricki Hirner (bitfire web engineering).
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
******************************************************************************/
*/
package at.bitfire.davdroid.resource;
import android.accounts.Account;
......
/*******************************************************************************
* Copyright (c) 2014 Ricki Hirner (bitfire web engineering).
/*
* Copyright (c) 2013 – 2015 Ricki Hirner (bitfire web engineering).
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
******************************************************************************/
*/
package at.bitfire.davdroid.resource;
public class LocalStorageException extends Exception {
......
/*******************************************************************************
* Copyright (c) 2014 Ricki Hirner (bitfire web engineering).
/*
* Copyright (c) 2013 – 2015 Ricki Hirner (bitfire web engineering).
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
******************************************************************************/
*/
package at.bitfire.davdroid.resource;
/**
......
/*******************************************************************************
* Copyright (c) 2014 Ricki Hirner (bitfire web engineering).
/*
* Copyright (c) 2013 – 2015 Ricki Hirner (bitfire web engineering).
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
******************************************************************************/
*/
package at.bitfire.davdroid.resource;
import android.util.Log;
......
/*******************************************************************************
* Copyright (c) 2014 Ricki Hirner (bitfire web engineering).
/*
* Copyright (c) 2013 – 2015 Ricki Hirner (bitfire web engineering).
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
******************************************************************************/
*/
package at.bitfire.davdroid.resource;
import java.io.ByteArrayOutputStream;
......
/*******************************************************************************
* Copyright (c) 2014 Ricki Hirner (bitfire web engineering).
/*
* Copyright (c) 2013 – 2015 Ricki Hirner (bitfire web engineering).
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
******************************************************************************/
*/
package at.bitfire.davdroid.resource;
import java.io.Serializable;
......
/*******************************************************************************
* Copyright (c) 2014 Ricki Hirner (bitfire web engineering).
/*
* Copyright (c) 2013 – 2015 Ricki Hirner (bitfire web engineering).
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
******************************************************************************/
*/
package at.bitfire.davdroid.syncadapter;
import android.accounts.AbstractAccountAuthenticator;
......
/*******************************************************************************
* Copyright (c) 2014 Ricki Hirner (bitfire web engineering).
/*
* Copyright (c) 2013 – 2015 Ricki Hirner (bitfire web engineering).
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
******************************************************************************/
*/
package at.bitfire.davdroid.syncadapter;
import android.accounts.Account;
......