Skip to content

Commit

Permalink
v0.4
Browse files Browse the repository at this point in the history
v0.4
  • Loading branch information
martinlaizg committed Aug 25, 2019
2 parents bce37e3 + 2498bac commit f9075a8
Show file tree
Hide file tree
Showing 109 changed files with 2,666 additions and 1,524 deletions.
14 changes: 7 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ branches:
only:
- master
- dev
- old-tests

android:
components:
- build-tools-28.0.3
- android-28
- build-tools-29.0.2
- android-29
- extra-google-google_play_services
- extra-google-m2repository
- extra-android-m2repository
Expand All @@ -26,13 +27,12 @@ cache:

before_install:
- touch $HOME/.android/repositories.cfg
- yes | sdkmanager "platforms;android-28"
- yes | sdkmanager "build-tools;28.0.3"
- yes | sdkmanager "platforms;android-29"
- yes | sdkmanager "build-tools;29.0.2"

script:
- ./gradlew clean build
- ./gradlew test
- ./gradlew jacocoTestReport
- ./gradlew clean jacocoTestReport

after_success:
after_success:
- bash <(curl -s https://codecov.io/bash)
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Geo-Find

[![Build Status](https://travis-ci.com/martinlaizg/geo-find-client.svg?token=DcBmhqX7yiqqn53qyXLo&branch=master)](https://travis-ci.com/martinlaizg/geo-find-client)
[![codecov](https://codecov.io/gh/martinlaizg/geo-find-client/branch/master/graph/badge.svg?token=PC3E2A1iZh)](https://codecov.io/gh/martinlaizg/geo-find-client)
<!-- [![codecov](https://codecov.io/gh/martinlaizg/geo-find-client/branch/master/graph/badge.svg?token=PC3E2A1iZh)](https://codecov.io/gh/martinlaizg/geo-find-client) -->


Cliente - Trabajo de Fin de Grado 2018-19 - Ingeniería Informática - Universidad de Alicante
110 changes: 54 additions & 56 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
apply plugin: 'com.android.application'
apply plugin: 'jacoco-android'


android {

signingConfigs {
debug {
storePassword 'android'
Expand All @@ -12,21 +9,20 @@ android {
storeFile file('../android-studio-settings/debug.jks')
}
}
compileSdkVersion 28

compileSdkVersion 29
buildToolsVersion = '29.0.2'

defaultConfig {
applicationId 'com.martinlaizg.geofind'
minSdkVersion 26
targetSdkVersion 28
versionCode 7
versionName 'v0.3.1'
targetSdkVersion 29
versionCode 9
versionName 'v0.4'
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
testCoverageEnabled true
signingConfig signingConfigs.debug
Expand All @@ -37,83 +33,85 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildToolsVersion = '28.0.3'

testOptions {
unitTests {
includeAndroidResources = true
returnDefaultValues = true
}
}
}

apply from: 'jacoco.gradle'

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')

//
// AndroidX
implementation 'androidx.activity:activity:1.1.0-alpha02'
implementation 'androidx.appcompat:appcompat:1.0.2'
testImplementation 'androidx.arch.core:core-testing:2.0.1'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.coordinatorlayout:coordinatorlayout:1.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'androidx.viewpager:viewpager:1.0.0'
// Lifecycle
implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
implementation 'androidx.lifecycle:lifecycle-livedata:2.0.0'
implementation 'androidx.lifecycle:lifecycle-reactivestreams:2.0.0'
annotationProcessor 'androidx.lifecycle:lifecycle-compiler:2.0.0'
// Navigation
implementation 'androidx.navigation:navigation-common:2.0.0'
implementation 'androidx.navigation:navigation-fragment:2.0.0'
implementation 'androidx.navigation:navigation-ui:2.0.0'
implementation 'androidx.preference:preference:1.0.0'
// Room
annotationProcessor 'androidx.lifecycle:lifecycle-common-java8:2.0.0'
implementation 'androidx.navigation:navigation-common:2.1.0-rc01'
implementation 'androidx.navigation:navigation-fragment:2.1.0-rc01'
implementation 'androidx.navigation:navigation-ui:2.1.0-rc01'
implementation 'androidx.preference:preference:1.1.0-rc01'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'androidx.room:room-runtime:2.1.0'
annotationProcessor 'androidx.room:room-compiler:2.1.0'
implementation 'androidx.viewpager:viewpager:1.0.0'

//
// Google services
// Auth
implementation 'com.google.android.gms:play-services-auth:17.0.0'
// Maps
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'com.google.android.gms:play-services-location:17.0.0'

//
// Google Material
implementation 'com.google.android.material:material:1.0.0'

// Android Test
androidTestImplementation 'androidx.test:core:1.2.0'

// AndroidJUnitRunner and JUnit Rules
androidTestImplementation 'androidx.test:runner:1.2.0'
// AndroidX Test
androidTestImplementation 'androidx.test:rules:1.2.0'

// Assertions
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.ext:truth:1.2.0'
androidTestImplementation 'com.google.truth:truth:0.45'

//
// Android Espresso
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-accessibility:3.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-web:3.2.0'
androidTestImplementation 'androidx.test.espresso.idling:idling-concurrent:3.2.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.ext:truth:1.2.0'
testImplementation 'androidx.arch.core:core-testing:2.0.1'
testImplementation 'androidx.test:core:1.2.0'

//
// RetrofitService
implementation 'com.squareup.retrofit2:retrofit:2.6.0'
// Google
implementation 'com.google.android.gms:play-services-auth:17.0.0'
implementation 'com.google.android.gms:play-services-location:17.0.0'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'com.google.android.material:material:1.1.0-alpha09'
androidTestImplementation 'com.google.truth:truth:0.45'

// Retrofit
implementation 'com.squareup.retrofit2:converter-gson:2.6.0'
implementation 'com.squareup.retrofit2:retrofit:2.6.0'

//
// Butter Knife
// Butterknife
implementation 'com.jakewharton:butterknife:10.1.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.1.0'

// Picasso
implementation 'com.squareup.picasso:picasso:2.5.2'

// Tests Junit
// Testing
testImplementation 'junit:junit:4.12'

// Mockito
testImplementation 'org.mockito:mockito-core:3.0.0'

// PowerMock
testImplementation 'org.mockito:mockito-core:3.0.0'
testImplementation 'org.powermock:powermock-core:2.0.2'
testImplementation 'org.powermock:powermock-module-junit4:2.0.2'
testImplementation 'org.powermock:powermock-api-mockito2:2.0.2'
androidTestImplementation 'org.mockito:mockito-core:3.0.0'
androidTestImplementation 'org.powermock:powermock-core:2.0.2'
androidTestImplementation 'org.powermock:powermock-module-junit4:2.0.2'
androidTestImplementation 'org.powermock:powermock-api-mockito2:2.0.2'
}
27 changes: 27 additions & 0 deletions app/jacoco.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apply plugin: 'jacoco'

jacoco {
toolVersion = "0.8.2"
}

tasks.withType(Test) {
jacoco.includeNoLocationClasses = true
}

task jacocoTestReport(type: JacocoReport, dependsOn: ['testDebugUnitTest']) {

reports {
xml.enabled = true
html.enabled = true
}

def fileFilter = ['**/R.class', '**/R$*.class', '**/BuildConfig.*', '**/Manifest*.*', '**/*Test*.*', 'android/**/*.*']
def debugTree = fileTree(dir: "$project.buildDir/intermediates/javac/debug", excludes: fileFilter)
def mainSrc = "$project.projectDir/src/main/java"

sourceDirectories = files([mainSrc])
classDirectories = files([debugTree])
executionData = fileTree(dir: project.buildDir, includes: [
'jacoco/testDebugUnitTest.exec', 'outputs/code_coverage/debugAndroidTest/connected/**/*.ec'
])
}
10 changes: 10 additions & 0 deletions app/sampledata/plays.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"comment" : "Plays",
"data" : [
{
"name" : "Lugar 1",
"description" : "Descripción del lugar 1",
"num_plays" : 5
}
]
}
4 changes: 3 additions & 1 deletion app/sampledata/user.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"data" : {
"name" : "Martin Laiz Gomez",
"username" : "martinlaizg",
"email" : "martinlaizg@gmail.com"
"email" : "martinlaizg@gmail.com",
"progress_tours" : "Tienes 5 tours en progreso",
"completed_tours" : "Has completado 23 tours"
}
}
9 changes: 3 additions & 6 deletions app/src/main/java/com/martinlaizg/geofind/data/Secure.java
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
package com.martinlaizg.geofind.data;

import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

public class Secure {

private static final String TAG = Secure.class.getSimpleName();
private static MessageDigest mdSHA512;

public static String hash(String toHash) {
String hashed = null;
try {
if(mdSHA512 == null) {
mdSHA512 = MessageDigest.getInstance("SHA-512");
}
byte[] bytes = mdSHA512.digest(toHash.getBytes());
MessageDigest mdSHA512 = MessageDigest.getInstance("SHA-512");
byte[] bytes = mdSHA512.digest(toHash.getBytes(StandardCharsets.UTF_8));
StringBuilder sb = new StringBuilder();
for(byte aByte : bytes) {
sb.append(Integer.toString((aByte & 0xff) + 0x100, 16).substring(1));
Expand All @@ -24,6 +22,5 @@ public static String hash(String toHash) {
e.printStackTrace();
}
return hashed;

}
}
Loading

0 comments on commit f9075a8

Please sign in to comment.