Skip to content
This repository has been archived by the owner on Feb 25, 2022. It is now read-only.

Commit

Permalink
add settings screen for debug logging...
Browse files Browse the repository at this point in the history
  • Loading branch information
luelista committed Feb 15, 2019
1 parent d733f31 commit f465f26
Show file tree
Hide file tree
Showing 31 changed files with 263 additions and 79 deletions.
19 changes: 0 additions & 19 deletions .idea/LDAP-Sync.iml

This file was deleted.

5 changes: 0 additions & 5 deletions .idea/codeStyles/codeStyleConfig.xml

This file was deleted.

4 changes: 0 additions & 4 deletions .idea/encodings.xml

This file was deleted.

2 changes: 1 addition & 1 deletion Privacy_Policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The user's LDAP servers will see the IP address from which the connection is mad

No other internet connections are made. The authors of the app do not collect any data about the user, their devices or their behaviour.


If you enable "Debug Logging" in the app settings, a log file will be stored on your SD card for every sync process. Before sharing these log files, you might want to remove personal data from them.

## Note regarding behaviour of other apps
The synchronized LDAP contacts are placed in the address book of the user's phone. Other apps can retrieve them from there and use them according to their privacy policies. For example, many messenger apps will send all phone numbers in your address book to their server, which will then include the phone numbers which LDAP-Sync has placed on your phone according to your configuration. Please check beforehand if that's what you want and if you're allowed to do that.
Expand Down
45 changes: 26 additions & 19 deletions app/app.iml
Original file line number Diff line number Diff line change
Expand Up @@ -117,54 +117,61 @@
<excludeFolder url="file://$MODULE_DIR$/build/reports" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<orderEntry type="jdk" jdkName="Android API 26 Platform" jdkType="Android SDK" />
<orderEntry type="jdk" jdkName="Android API 24 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" scope="TEST" name="Gradle: backport-util-concurrent:backport-util-concurrent:3.1@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.apache.maven:maven-error-diagnostics:2.2.1@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.apache.maven.wagon:wagon-http-lightweight:1.0-beta-6@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.apache.maven:maven-project:2.2.1@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.apache.maven.wagon:wagon-file:1.0-beta-6@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.apache.maven.wagon:wagon-provider-api:1.0-beta-6@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.apache.ant:ant:1.8.0@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: xpp3:xpp3_min:1.1.4c@jar" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:support-compat-24.2.1" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.robolectric:utils:3.8@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: com.google.guava:guava:20.0@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: com.almworks.sqlite4java:sqlite4java:0.282@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.robolectric:shadows-framework:3.8@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.apache.maven:maven-artifact-manager:2.2.1@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.apache.maven:maven-settings:2.2.1@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.robolectric:sandbox:3.8@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.robolectric:shadowapi:3.8@jar" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:support-fragment-24.2.1" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:support-media-compat-24.2.1" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.codehaus.plexus:plexus-container-default:1.0-alpha-9-stable-1@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.bouncycastle:bcprov-jdk15on:1.52@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: com.thoughtworks.xstream:xstream:1.4.8@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.robolectric:annotations:3.8@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.robolectric:robolectric:3.8@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.ow2.asm:asm:5.0.1@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.robolectric:robolectric:3.8@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.apache.maven:maven-plugin-registry:2.2.1@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.ow2.asm:asm-tree:5.0.1@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.apache.maven:maven-error-diagnostics:2.2.1@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.apache.maven:maven-ant-tasks:2.1.3@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: com.ibm.icu:icu4j:53.1@jar" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:support-core-utils-24.2.1" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: com.google.protobuf:protobuf-java:2.6.1@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.apache.maven.wagon:wagon-http-lightweight:1.0-beta-6@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.apache.maven:maven-project:2.2.1@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.apache.maven.wagon:wagon-file:1.0-beta-6@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.apache.maven.wagon:wagon-provider-api:1.0-beta-6@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.apache.maven.wagon:wagon-http-shared:1.0-beta-6@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.apache.ant:ant-launcher:1.8.0@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.ow2.asm:asm-commons:5.0.1@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.apache.ant:ant:1.8.0@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.apache.maven:maven-profile:2.2.1@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: nekohtml:nekohtml:1.9.6.2@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: xpp3:xpp3_min:1.1.4c@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: nekohtml:xercesMinimal:1.9.6.2@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.apache.maven:maven-model:2.2.1@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.robolectric:utils:3.8@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.apache.maven:maven-repository-metadata:2.2.1@jar" level="project" />
<orderEntry type="library" name="Gradle: junit:junit:4.12@jar" level="project" />
<orderEntry type="library" name="Gradle: org.hamcrest:hamcrest-core:1.3@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: com.google.guava:guava:20.0@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.robolectric:resources:3.8@jar" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:support-annotations:24.2.1@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: com.google.android.apps.common.testing.accessibility.framework:accessibility-test-framework:2.1@jar" level="project" />
<orderEntry type="library" name="Gradle: com.unboundid:unboundid-ldapsdk:3.2.1@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.hamcrest:hamcrest-library:1.3@jar" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:support-core-ui-24.2.1" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.robolectric:junit:3.8@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: com.almworks.sqlite4java:sqlite4java:0.282@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.robolectric:shadows-framework:3.8@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.codehaus.plexus:plexus-interpolation:1.11@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.codehaus.plexus:plexus-utils:1.5.15@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.apache.maven:maven-artifact-manager:2.2.1@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.apache.maven:maven-settings:2.2.1@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.robolectric:sandbox:3.8@jar" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:support-v4-24.2.1" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.apache.maven:maven-artifact:2.2.1@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.robolectric:shadowapi:3.8@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: xmlpull:xmlpull:1.1.3.1@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: classworlds:classworlds:1.1-alpha-2@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.bouncycastle:bcprov-jdk15on:1.52@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.codehaus.plexus:plexus-container-default:1.0-alpha-9-stable-1@jar" level="project" />
</component>
</module>
9 changes: 8 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 26
//noinspection GradleCompatible
compileSdkVersion 24
buildToolsVersion "28.0.2"

defaultConfig {
Expand All @@ -12,6 +13,7 @@ android {
sourceCompatibility JavaVersion.VERSION_1_6
targetCompatibility JavaVersion.VERSION_1_6
}
vectorDrawables.useSupportLibrary = true
}

buildTypes {
Expand All @@ -25,11 +27,16 @@ android {
includeAndroidResources = true
}
}
lintOptions {
abortOnError false
}
}

dependencies {
// https://mvnrepository.com/artifact/com.unboundid/unboundid-ldapsdk
implementation group: 'com.unboundid', name: 'unboundid-ldapsdk', version: '3.2.1'
implementation 'junit:junit:4.12'
implementation 'com.android.support:support-v4:24.2.1'
//implementation 'com.android.support:support-vector-drawable:22.0.0'
testImplementation "org.robolectric:robolectric:3.8"
}
1 change: 0 additions & 1 deletion app/release/output.json

This file was deleted.

44 changes: 26 additions & 18 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.wikilab.android.ldapsync"
android:versionCode="16"
android:versionName="2.1.2" android:installLocation="internalOnly">

android:installLocation="internalOnly"
android:versionCode="17"
android:versionName="2.1.3">

<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
Expand All @@ -21,11 +21,11 @@
android:allowBackup="true"
android:icon="@drawable/icon"
android:label="@string/app_name"
android:theme="@style/LightThemeSelector" >
android:theme="@style/LightThemeSelector">
<service
android:name="de.wikilab.android.ldapsync.authenticator.LDAPAuthenticationService"
android:name=".authenticator.LDAPAuthenticationService"
android:exported="true"
android:permission="android.permission.MANAGE_ACCOUNTS" >
android:permission="android.permission.MANAGE_ACCOUNTS">
<intent-filter>
<action android:name="android.accounts.AccountAuthenticator" />
</intent-filter>
Expand All @@ -35,9 +35,9 @@
android:resource="@xml/authenticator" />
</service>
<service
android:name="de.wikilab.android.ldapsync.syncadapter.SyncService"
android:name=".syncadapter.SyncService"
android:exported="true"
android:permission="android.permission.MANAGE_ACCOUNTS" >
android:permission="android.permission.MANAGE_ACCOUNTS">
<intent-filter>
<action android:name="android.content.SyncAdapter" />
</intent-filter>
Expand All @@ -48,24 +48,24 @@
</service>

<activity
android:name="de.wikilab.android.ldapsync.authenticator.LDAPAuthenticatorActivity"
android:name=".authenticator.LDAPAuthenticatorActivity"
android:excludeFromRecents="true"
android:label="@string/ui_activity_title"
android:windowSoftInputMode="stateVisible|adjustResize">
<intent-filter>
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data android:scheme="ldaps" />
</intent-filter>
</activity>

<activity android:name="de.wikilab.android.ldapsync.authenticator.AccountSettingsActivity" >
</activity>

<activity android:name="de.wikilab.android.ldapsync.authenticator.AccountsListActivity" >
<activity android:name=".authenticator.AccountSettingsActivity"></activity>
<activity android:name=".authenticator.AccountsListActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Expand All @@ -85,11 +85,19 @@
</intent-filter>
</activity>
-->
<activity android:name="de.wikilab.android.ldapsync.activity.SyncErrorActivity"
<activity
android:name=".activity.SyncErrorActivity"
android:excludeFromRecents="true"
android:label="UF Phonebook Sync Error"
android:launchMode="singleTask"
android:taskAffinity=""
android:excludeFromRecents="true">
android:taskAffinity=""></activity>
<activity
android:name=".activity.SettingsActivity"
android:label="@string/title_activity_settings"
android:parentActivityName=".authenticator.AccountsListActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="de.wikilab.android.ldapsync.authenticator.AccountsListActivity" />
</activity>
</application>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package de.wikilab.android.ldapsync.activity;

import android.annotation.TargetApi;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.media.Ringtone;
import android.media.RingtoneManager;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.preference.ListPreference;
import android.preference.Preference;
import android.preference.PreferenceActivity;
import android.app.ActionBar;
import android.preference.PreferenceFragment;
import android.preference.PreferenceManager;
import android.preference.RingtonePreference;
import android.provider.Settings;
import android.support.annotation.Nullable;
import android.text.TextUtils;
import android.view.MenuItem;
import android.support.v4.app.NavUtils;

import de.wikilab.android.ldapsync.R;

import java.util.List;

/**
* A {@link PreferenceActivity} that presents a set of application settings. On
* handset devices, settings are presented as a single list. On tablets,
* settings are split by category, with category headers shown to the left of
* the list of settings.
* <p>
* See <a href="http://developer.android.com/design/patterns/settings.html">
* Android Design: Settings</a> for design guidelines and the <a
* href="http://developer.android.com/guide/topics/ui/settings.html">Settings
* API Guide</a> for more information on developing a Settings UI.
*/
public class SettingsActivity extends PreferenceActivity {

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.pref_general);
findPreference("go_to_sys_sync").setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
startActivity(new Intent(Settings.ACTION_SYNC_SETTINGS));
return true;
}
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import de.wikilab.android.ldapsync.Constants;
import de.wikilab.android.ldapsync.R;
import de.wikilab.android.ldapsync.activity.SettingsActivity;

public class AccountsListActivity extends ListActivity {

Expand Down Expand Up @@ -85,4 +86,8 @@ public void onActivityResult(int requestCode, int resultCode, Intent intent) {
}
}
}

public void settings(MenuItem item) {
startActivity(new Intent(this, SettingsActivity.class));
}
}
Loading

0 comments on commit f465f26

Please sign in to comment.