Skip to content

Commit

Permalink
Merged branch hotfix/5.3.0 into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Federico Iosue committed Feb 21, 2017
2 parents c396ae5 + c627854 commit f09011e
Show file tree
Hide file tree
Showing 44 changed files with 833 additions and 357 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Actually the following functions are implemented:
* Export/import notes to backup
* Google Now integration: just tell "write a note" followed by the content
* Multiple widgets, DashClock extension, Android 4.2 lockscreen compatibility
* Multilanguage: 30 languages supported: https://crowdin.com/project/omni-notes
* Multilanguage: 30+ languages supported: https://crowdin.com/project/omni-notes


Further developments will include:
Expand Down
19 changes: 7 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ buildscript {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'me.tatarka:gradle-retrolambda:3.2.5'
classpath 'me.tatarka.retrolambda.projectlombok:lombok.ast:0.2.3.a2'
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.2.1"
}
// Exclude the version that the android plugin depends on.
configurations.classpath.exclude group: 'com.android.tools.external.lombok'
Expand All @@ -38,20 +39,14 @@ allprojects {
}
}

apply plugin: "sonar-runner"
sonarRunner {
sonarProperties {
apply plugin: 'org.sonarqube'
sonarqube {
properties {
property "sonar.projectName", "Omni Notes"
property "sonar.projectKey", "omni-notes"
property 'sonar.projectVersion', project.VERSION_NAME
property "sonar.host.url", "http://localhost:9000"
property "sonar.analysis.mode", "incremental"
property 'sonar.sourceEncoding', 'UTF-8'
property 'sonar.language', 'java'
property 'sonar.profile', 'Default'
}
}
subprojects {
sonarRunner {
sonarProperties {
properties["sonar.sources"] += "omniNotes/src/main/java"
}
}
}
2 changes: 1 addition & 1 deletion etc/translations/play_store_description.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ Actually the following functions are implemented:
☆ Export/import notes to backup
☆ Google Now integration: just tell "write a note" followed by the content
☆ Multiple widgets, DashClock extension, Android 4.2 lockscreen compatibility
☆ Multilanguage: 30 languages supported: https://crowdin.com/project/omni-notes
☆ Multilanguage: 30+ languages supported: https://crowdin.com/project/omni-notes
2 changes: 1 addition & 1 deletion etc/translations/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@
<string name="export_fail">File export failed</string>
<string name="import_success">File imported successfully</string>
<string name="import_fail">File import failed</string>
<string name="file_not_exists">File to be imported doesn\'t exists</string>
<string name="file_not_exists">File to be imported doesn\'t exist</string>
<string name="import_warning">Importing data could overwrite current notes. Proceed?</string>
<string name="export_warning">Exported file will overwrite existing one. Proceed?</string>
<string name="settings_category_gestures">Gestures</string>
Expand Down
15 changes: 11 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,23 @@

MIN_SDK=14
TARGET_SDK=23
VERSION_NAME=5.2.20
VERSION_CODE=230
BUILD_TOOLS=23.0.2

VERSION_NAME=5.3.0
VERSION_CODE=231
PACKAGE=it.feio.android.omninotes

# The following properties are empty defaults to allow build and can EVENTUALLY be overridden to allow:
# Events tracking
ANALYTICS_URL=

# Events tracking (params must be separated by comma)
ANALYTICS_PARAMS=
ANALYTICS_PARAMS_FOSS=

# Crash reporting
CRASH_REPORTING_URL=

# App's version check for update dialog
VERSION_CHECK_URL=

# Google Maps API key to provide addresses autocompletion feature
MAPS_API_KEY=
1 change: 1 addition & 0 deletions omniNotes/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/google-services.json
57 changes: 44 additions & 13 deletions omniNotes/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,24 @@ apply plugin: 'me.tatarka.retrolambda'

android {

compileSdkVersion 23
buildToolsVersion "23.0.2"
compileSdkVersion Integer.parseInt(project.TARGET_SDK)
buildToolsVersion project.BUILD_TOOLS

defaultConfig {
applicationId project.PACKAGE
minSdkVersion project.MIN_SDK
targetSdkVersion project.TARGET_SDK
versionName project.VERSION_NAME
versionCode Integer.parseInt(project.VERSION_CODE)
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
}

packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}

buildTypes {
release {
minifyEnabled true
Expand All @@ -49,26 +53,34 @@ android {
}
}
}

productFlavors {
play {}
foss {
applicationId project.PACKAGE + ".foss"
}
}

lintOptions {
abortOnError false
disable 'MissingTranslation'
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

}

dependencies {
androidTestCompile 'junit:junit:4.12'
androidTestCompile 'com.jayway.android.robotium:robotium-solo:5.5.3'
testCompile 'junit:junit:4.12'
androidTestCompile 'com.android.support:support-annotations:23.4.0'
androidTestCompile 'com.android.support.test:runner:0.4'
androidTestCompile 'com.android.support.test:rules:0.4'

compile fileTree(include: '*.jar', dir: 'libs')
compile 'com.github.flavienlaurent.datetimepicker:library:0.0.2'
compile 'com.larswerkman:HoloColorPicker:1.4'
Expand Down Expand Up @@ -98,28 +110,47 @@ dependencies {
compile('org.mnode.ical4j:ical4j:1.0.6') {
exclude group: 'commons.io'
}
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.3'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.3'
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
compile 'com.pnikosis:materialish-progress:1.5'
compile 'com.github.paolorotolo:appintro:1.3.0'
playCompile 'io.nlopez.smartlocation:library:3.2.4'
fossCompile 'com.github.federicoiosue:smart-location-lib:3.2.5'
compile 'io.reactivex:rxandroid:1.0.1'
compile 'io.reactivex:rxjava:1.0.14'
compile 'com.artemzin.rxjava:proguard-rules:1.0.14.2'
compile 'com.tbruyelle.rxpermissions:rxpermissions:0.4.2@aar'
compile 'org.ocpsoft.prettytime:prettytime:3.2.7.Final'
compile 'org.piwik.sdk:piwik-sdk:0.0.4'

compile 'com.github.federicoiosue:SimpleGallery:1.2.0'
compile 'com.github.federicoiosue:Springpad-Importer:1.0.1'
compile 'com.github.federicoiosue:Omni-Notes-Commons:1.1.0'
compile 'com.github.federicoiosue:checklistview:3.1.3'
compile ('com.github.federicoiosue:checklistview:3.2.1') {
transitive=false
}
compile 'com.github.federicoiosue:pixlui:2.6'

// Flavors specific dependecies
playCompile 'io.nlopez.smartlocation:library:3.2.4'
fossCompile 'com.github.federicoiosue:smart-location-lib:3.2.5'
playCompile ('com.github.federicoiosue:analitica:0.0.2:googleAnalyticsRelease@aar'){
transitive=true
}
fossCompile ('com.github.federicoiosue:analitica:0.0.2:piwikRelease@aar'){
transitive=true
}
playCompile 'com.google.android.gms:play-services-analytics:9.0.2'
fossCompile 'org.piwik.sdk:piwik-sdk:1.0.2'

}

configurations {
all*.exclude group: 'commons-logging', module: 'commons-logging'
}

android.buildTypes.each { type ->
type.buildConfigField 'String', 'ANALYTICS_URL', '"' + ANALYTICS_URL + '"'
type.buildConfigField 'String', 'CRASH_REPORTING_URL', '"' + CRASH_REPORTING_URL + '"'
type.buildConfigField 'String', 'VERSION_CHECK_URL', '"' + VERSION_CHECK_URL + '"'
type.buildConfigField 'String', 'MAPS_API_KEY', '"' + MAPS_API_KEY + '"'
android.productFlavors.each { flavor ->
String analyticsUrl = flavor.name == 'foss' && ANALYTICS_PARAMS_FOSS?.trim() ? ANALYTICS_PARAMS_FOSS : ANALYTICS_PARAMS
flavor.buildConfigField 'String', 'ANALYTICS_PARAMS', '"' + analyticsUrl + '"'
flavor.buildConfigField 'String', 'CRASH_REPORTING_URL', '"' + CRASH_REPORTING_URL + '"'
flavor.buildConfigField 'String', 'VERSION_CHECK_URL', '"' + VERSION_CHECK_URL + '"'
flavor.buildConfigField 'String', 'MAPS_API_KEY', '"' + MAPS_API_KEY + '"'
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,21 @@

package it.feio.android.omninotes.helpers;

import android.test.InstrumentationTestCase;
import android.support.test.runner.AndroidJUnit4;
import it.feio.android.omninotes.models.Note;
import it.feio.android.omninotes.utils.Constants;
import org.apache.commons.lang.StringUtils;
import org.junit.Test;
import org.junit.runner.RunWith;

import java.util.ArrayList;
import java.util.List;

import static junit.framework.Assert.*;

public class NotesHelperTest extends InstrumentationTestCase {

@RunWith(AndroidJUnit4.class)
public class NotesHelperTest {

@Test
public void mergeNotes() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@
import android.test.InstrumentationTestCase;
import it.feio.android.omninotes.OmniNotes;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;

import java.io.IOException;


@Ignore
public class GeocodeHelperTest extends InstrumentationTestCase {

@Test
Expand All @@ -36,4 +38,4 @@ public void testGetAddressFromCoordinates() throws IOException {
Assert.assertTrue(address.length() > 0);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@

package it.feio.android.omninotes.utils;

import android.app.PendingIntent;
import android.content.Intent;
import android.test.InstrumentationTestCase;
import android.util.Log;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import it.feio.android.omninotes.models.Note;
import it.feio.android.omninotes.utils.ReminderHelper;
import org.junit.Test;
import org.junit.runner.RunWith;

import java.util.Calendar;

import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertTrue;
import static org.junit.Assert.assertEquals;


public class ReminderHelperTest extends InstrumentationTestCase {
@RunWith(AndroidJUnit4.class)
public class ReminderHelperTest {

@Test
public void testGetRequestCode() {
Expand All @@ -46,23 +46,26 @@ public void testGetRequestCode() {

public void testAddReminder() {
Note note = buildNote();
ReminderHelper.addReminder(getInstrumentation().getTargetContext(), note);
boolean reminderActive = ReminderHelper.checkReminder(getInstrumentation().getTargetContext(), note);
ReminderHelper.addReminder(InstrumentationRegistry.getTargetContext(), note);
boolean reminderActive = ReminderHelper.checkReminder(InstrumentationRegistry.getTargetContext(), note);
assertTrue(reminderActive);
}


public void testRemoveReminder() {
Note note = buildNote();
ReminderHelper.addReminder(getInstrumentation().getTargetContext(), note);
boolean reminderActive = ReminderHelper.checkReminder(getInstrumentation().getTargetContext(), note);
ReminderHelper.removeReminder(getInstrumentation().getTargetContext(), note);
boolean reminderRemoved = ReminderHelper.checkReminder(getInstrumentation().getTargetContext(), note);
ReminderHelper.addReminder(InstrumentationRegistry.getTargetContext(), note);
boolean reminderActive = ReminderHelper.checkReminder(InstrumentationRegistry.getTargetContext(), note);
ReminderHelper.removeReminder(InstrumentationRegistry.getTargetContext(), note);
boolean reminderRemoved = ReminderHelper.checkReminder(InstrumentationRegistry.getTargetContext(), note);
assertTrue(reminderActive);
assertFalse(reminderRemoved);
}





private Note buildNote() {
Long now = Calendar.getInstance().getTimeInMillis();
Note note = new Note();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,36 @@

package it.feio.android.omninotes.utils;

import android.test.InstrumentationTestCase;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;

import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertFalse;

public class SecurityTest extends InstrumentationTestCase {

@RunWith(AndroidJUnit4.class)
public class SecurityTest {

private final String PASS = "12345uselessPasswords";
private final String TEXT = "Today is a - good - day to test useless things!";
private final String LOREM = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, " +
"sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.";

@Test
public void testEncrypt(){
String encryptedText = Security.encrypt(TEXT, PASS);
assertFalse(TEXT.equals(encryptedText));
}

@Test
public void testDecrypt(){
String encryptedText = Security.encrypt(TEXT, PASS);
assertEquals(TEXT, Security.decrypt(encryptedText, PASS));
assertFalse(TEXT.equals(Security.decrypt(encryptedText, "zaza" + PASS)));
}

@Test
public void testDecryptUnencrypted(){
String result = Security.decrypt(LOREM, PASS);
assertFalse(result.length() == 0);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Copyright (C) 2015 Federico Iosue ([email protected])
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package it.feio.android.omninotes.utils;

public interface Constants extends ConstantsBase {

String TAG = "Omni Notes FOSS";
String EXTERNAL_STORAGE_FOLDER = "Omni Notes Foss";
String PACKAGE = "it.feio.android.omninotes.foss";
String PREFS_NAME = PACKAGE + "_preferences";
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.webkit.WebView;
import it.feio.android.omninotes.helpers.AnalyticsHelper;


public class AboutActivity extends BaseActivity {
Expand All @@ -37,7 +36,7 @@ protected void onCreate(Bundle savedInstanceState) {

@Override
public void onStart() {
AnalyticsHelper.trackScreenView(getClass().getName());
((OmniNotes)getApplication()).getAnalyticsHelper().trackScreenView(getClass().getName());
super.onStart();
}

Expand Down
Loading

0 comments on commit f09011e

Please sign in to comment.