├── app ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── drawable │ │ │ │ └── icon.png │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-ldpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── drawable-hdpi │ │ │ │ ├── ic_done_white_48dp.png │ │ │ │ ├── ic_backup_white_48dp.png │ │ │ │ ├── ic_file_upload_white_24dp.png │ │ │ │ └── ic_error_outline_white_48dp.png │ │ │ ├── drawable-mdpi │ │ │ │ ├── ic_done_white_48dp.png │ │ │ │ ├── ic_backup_white_48dp.png │ │ │ │ ├── ic_file_upload_white_24dp.png │ │ │ │ └── ic_error_outline_white_48dp.png │ │ │ ├── drawable-xhdpi │ │ │ │ ├── ic_done_white_48dp.png │ │ │ │ ├── ic_backup_white_48dp.png │ │ │ │ ├── ic_error_outline_white_48dp.png │ │ │ │ └── ic_file_upload_white_24dp.png │ │ │ ├── drawable-xxhdpi │ │ │ │ ├── ic_done_white_48dp.png │ │ │ │ ├── ic_backup_white_48dp.png │ │ │ │ ├── ic_file_upload_white_24dp.png │ │ │ │ └── ic_error_outline_white_48dp.png │ │ │ ├── drawable-xxxhdpi │ │ │ │ ├── ic_backup_white_48dp.png │ │ │ │ ├── ic_done_white_48dp.png │ │ │ │ ├── ic_file_upload_white_24dp.png │ │ │ │ └── ic_error_outline_white_48dp.png │ │ │ ├── values-v21 │ │ │ │ └── styles.xml │ │ │ ├── values-v11 │ │ │ │ └── styles.xml │ │ │ ├── menu │ │ │ │ └── main_menu.xml │ │ │ ├── values-v14 │ │ │ │ └── styles.xml │ │ │ ├── values │ │ │ │ ├── styles.xml │ │ │ │ ├── arrays.xml │ │ │ │ ├── servers_params.xml │ │ │ │ └── strings.xml │ │ │ ├── layout │ │ │ │ ├── server_list_row.xml │ │ │ │ ├── list_row.xml │ │ │ │ ├── activity_about.xml │ │ │ │ └── activity_journal.xml │ │ │ ├── xml │ │ │ │ ├── server_preferences.xml │ │ │ │ └── preferences.xml │ │ │ ├── values-ja │ │ │ │ └── strings.xml │ │ │ ├── values-de │ │ │ │ └── strings.xml │ │ │ ├── values-cs │ │ │ │ └── strings.xml │ │ │ └── values-fr │ │ │ │ └── strings.xml │ │ ├── java │ │ │ └── fr │ │ │ │ └── s13d │ │ │ │ └── photobackup │ │ │ │ ├── interfaces │ │ │ │ ├── PBMediaStoreInterface.java │ │ │ │ └── PBMediaSenderInterface.java │ │ │ │ ├── PBConstants.java │ │ │ │ ├── PBBootBroadcastReceiver.java │ │ │ │ ├── about │ │ │ │ └── PBAboutActivity.java │ │ │ │ ├── PBActivity.java │ │ │ │ ├── PBApplication.java │ │ │ │ ├── PBWifiBroadcastReceiver.java │ │ │ │ ├── media │ │ │ │ ├── PBMedia.java │ │ │ │ ├── PBSyncMediaStoreTask.java │ │ │ │ ├── PBMediaStore.java │ │ │ │ └── PBMediaSender.java │ │ │ │ ├── Log.java │ │ │ │ ├── preferences │ │ │ │ ├── PBServerListPreference.java │ │ │ │ ├── PBServerPreferenceFragment.java │ │ │ │ └── PBPreferenceFragment.java │ │ │ │ ├── journal │ │ │ │ ├── PBJournalActivity.java │ │ │ │ └── PBJournalAdapter.java │ │ │ │ └── PBService.java │ │ └── AndroidManifest.xml │ ├── debug │ │ └── res │ │ │ └── values │ │ │ └── strings.xml │ └── androidTest │ │ └── java │ │ └── fr │ │ └── s13d │ │ └── photobackup │ │ └── ApplicationTest.java ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── codecov.yml ├── .gitignore ├── README.md ├── .travis.yml ├── gradlew.bat ├── CHANGELOG.md ├── gradlew └── LICENSE /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PhotoBackup/client-android/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/drawable/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PhotoBackup/client-android/HEAD/app/src/main/res/drawable/icon.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PhotoBackup/client-android/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-ldpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PhotoBackup/client-android/HEAD/app/src/main/res/mipmap-ldpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PhotoBackup/client-android/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PhotoBackup/client-android/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PhotoBackup/client-android/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PhotoBackup/client-android/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/debug/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | PB Debug 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_done_white_48dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PhotoBackup/client-android/HEAD/app/src/main/res/drawable-hdpi/ic_done_white_48dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_done_white_48dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PhotoBackup/client-android/HEAD/app/src/main/res/drawable-mdpi/ic_done_white_48dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_backup_white_48dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PhotoBackup/client-android/HEAD/app/src/main/res/drawable-hdpi/ic_backup_white_48dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_backup_white_48dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PhotoBackup/client-android/HEAD/app/src/main/res/drawable-mdpi/ic_backup_white_48dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_done_white_48dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PhotoBackup/client-android/HEAD/app/src/main/res/drawable-xhdpi/ic_done_white_48dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_done_white_48dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PhotoBackup/client-android/HEAD/app/src/main/res/drawable-xxhdpi/ic_done_white_48dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_backup_white_48dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PhotoBackup/client-android/HEAD/app/src/main/res/drawable-xhdpi/ic_backup_white_48dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_backup_white_48dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PhotoBackup/client-android/HEAD/app/src/main/res/drawable-xxhdpi/ic_backup_white_48dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_backup_white_48dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PhotoBackup/client-android/HEAD/app/src/main/res/drawable-xxxhdpi/ic_backup_white_48dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_done_white_48dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PhotoBackup/client-android/HEAD/app/src/main/res/drawable-xxxhdpi/ic_done_white_48dp.png -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | codecov: 2 | token: 0f71e8cd-b2e6-4da7-924a-4c815b7923b7 3 | branch: master 4 | 5 | coverage: 6 | precision: 2 7 | round: down 8 | range: "70...100" 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_file_upload_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PhotoBackup/client-android/HEAD/app/src/main/res/drawable-hdpi/ic_file_upload_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_file_upload_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PhotoBackup/client-android/HEAD/app/src/main/res/drawable-mdpi/ic_file_upload_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_error_outline_white_48dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PhotoBackup/client-android/HEAD/app/src/main/res/drawable-hdpi/ic_error_outline_white_48dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_error_outline_white_48dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PhotoBackup/client-android/HEAD/app/src/main/res/drawable-mdpi/ic_error_outline_white_48dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_error_outline_white_48dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PhotoBackup/client-android/HEAD/app/src/main/res/drawable-xhdpi/ic_error_outline_white_48dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_file_upload_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PhotoBackup/client-android/HEAD/app/src/main/res/drawable-xhdpi/ic_file_upload_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_file_upload_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PhotoBackup/client-android/HEAD/app/src/main/res/drawable-xxhdpi/ic_file_upload_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_file_upload_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PhotoBackup/client-android/HEAD/app/src/main/res/drawable-xxxhdpi/ic_file_upload_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_error_outline_white_48dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PhotoBackup/client-android/HEAD/app/src/main/res/drawable-xxhdpi/ic_error_outline_white_48dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_error_outline_white_48dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PhotoBackup/client-android/HEAD/app/src/main/res/drawable-xxxhdpi/ic_error_outline_white_48dp.png -------------------------------------------------------------------------------- /app/src/main/res/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Aug 24 21:37:03 CEST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip 7 | -------------------------------------------------------------------------------- /app/src/main/res/values-v11/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/menu/main_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/values-v14/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 11 | 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # Files for the Dalvik VM 6 | *.dex 7 | 8 | # Java class files 9 | *.class 10 | 11 | # Generated files 12 | bin/ 13 | gen/ 14 | 15 | # Local configuration file (sdk path, etc) 16 | local.properties 17 | 18 | # Eclipse project files 19 | .classpath 20 | .project 21 | 22 | # Proguard folder generated by Eclipse 23 | proguard/ 24 | 25 | # Log Files 26 | *.log 27 | 28 | # Gradle files 29 | .gradle/ 30 | build/ 31 | /*/build/ 32 | 33 | # Android Studio files 34 | .idea/ 35 | project.properties 36 | /*/local.properties 37 | /*/out 38 | /*/*/build 39 | build/ 40 | /*/*/production 41 | *.iml 42 | *.iws 43 | *.ipr 44 | *~ 45 | *.swp 46 | 47 | # Mac oS X 48 | .DS_Store 49 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 14 | 15 | 16 | 19 | 20 | -------------------------------------------------------------------------------- /app/src/main/java/fr/s13d/photobackup/interfaces/PBMediaStoreInterface.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2013-2016 Stéphane Péchard. 3 | * 4 | * This file is part of PhotoBackup. 5 | * 6 | * PhotoBackup is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PhotoBackup is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package fr.s13d.photobackup.interfaces; 21 | 22 | 23 | public interface PBMediaStoreInterface { 24 | void onSyncMediaStoreTaskPostExecute(); 25 | } 26 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /home/stephane/Android/Sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # do not print notes 20 | -dontnote 21 | 22 | # keep attributes 23 | -keepattributes EnclosingMethod 24 | 25 | # keep class from included classes 26 | -dontwarn java.nio.file.** 27 | -keep class java.nio.file.** { *; } 28 | 29 | -dontwarn org.codehaus.mojo.** 30 | -keep class org.codehaus.mojo.** { *; } 31 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Build Status](https://travis-ci.org/PhotoBackup/client-android.svg?branch=master)](https://travis-ci.org/PhotoBackup/client-android) 2 | # PhotoBackup Android client 3 | 4 | The PhotoBackup Android application is a simple service always running 5 | silently in background and sending photos to the associated server 6 | as soon as you take them. An upload journal allows you to see the status 7 | of each photo in your device. It does not backup videos. 8 | 9 | It is available on the 10 | [Google Play](https://play.google.com/store/apps/details?id=fr.s13d.photobackup) 11 | and on [F-Droid](https://f-droid.org/app/fr.s13d.photobackup). 12 | 13 | It does not use services like Google Drive/Dropbox/SkyDrive/... **on purpose**, 14 | as you don't know what they do with your photos. With PhotoBackup, only you should do. 15 | 16 | Join our dedicated online chat at [![Gitter](https://badges.gitter.im/PhotoBackup/client-android.svg)](https://gitter.im/PhotoBackup/client-android). 17 | 18 | Screenshot 19 | -------------------------------------------------------------------------------- /app/src/main/java/fr/s13d/photobackup/interfaces/PBMediaSenderInterface.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2013-2016 Stéphane Péchard. 3 | * 4 | * This file is part of PhotoBackup. 5 | * 6 | * PhotoBackup is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PhotoBackup is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package fr.s13d.photobackup.interfaces; 20 | 21 | 22 | public interface PBMediaSenderInterface { 23 | 24 | void onMessage(final String message); 25 | 26 | void onSendSuccess(); 27 | void onSendFailure(); 28 | 29 | void onTestSuccess(); 30 | void onTestFailure(); 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/res/layout/server_list_row.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 15 | 16 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /app/src/main/java/fr/s13d/photobackup/PBConstants.java: -------------------------------------------------------------------------------- 1 | package fr.s13d.photobackup; 2 | 3 | 4 | /** 5 | * Delivers all public constants to the application. 6 | */ 7 | public class PBConstants { 8 | 9 | // should correspond to what is in preferences.xml 10 | public static final String PREF_SERVICE_RUNNING = "PREF_SERVICE_RUNNING"; 11 | public static final String PREF_SERVER = "PREF_SERVER"; 12 | public static final String PREF_WIFI_ONLY = "PREF_WIFI_ONLY"; 13 | public static final String PREF_MEDIAS_TO_BACKUP = "PREF_MEDIAS_TO_BACKUP"; 14 | public static final String PREF_RECENT_UPLOAD_ONLY = "PREF_RECENT_UPLOAD_ONLY"; 15 | public static final String PREF_PICTURE_FOLDER_LIST = "PREF_PICTURE_FOLDER_LIST"; 16 | public static final String PREF_MEDIA_BACKUP_VIDEO = "PREF_MEDIA_BACKUP_VIDEO"; 17 | public static final String PREF_UPLOAD_JOURNAL = "PREF_UPLOAD_JOURNAL"; 18 | public static final String PREF_ABOUT = "PREF_ABOUT"; 19 | 20 | // origin to permission asking, to be able to reroute 21 | public static final int PERM_ORIGIN_SERVICE = 0; 22 | public static final int PERM_ORIGIN_MEDIAS = 1; 23 | 24 | 25 | // Prevent from constructing objects of this class 26 | private PBConstants() { throw new AssertionError(); } 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/res/values/arrays.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | PhotoBackup 7 | 8 | 9 | 10 | R.mipmap.ic_launcher 11 | 12 | 13 | 14 | 15 | 16 | @string/only_wifi 17 | @string/not_only_wifi 18 | 19 | 20 | @string/only_wifi 21 | @string/not_only_wifi 22 | 23 | 24 | 25 | 26 | @string/only_recent_upload 27 | @string/not_only_recent_upload 28 | 29 | 30 | @string/only_recent_upload 31 | @string/not_only_recent_upload 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /app/src/main/res/values/servers_params.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 20 | 21 | 22 | PREF_SERVER_LOGIN 23 | 24 | 25 | 26 | PREF_SERVER_BASICAUTH 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | ext.supportLibVersion = '25.0.0' 4 | 5 | 6 | android { 7 | compileSdkVersion 25 8 | buildToolsVersion "24.0.3" 9 | dataBinding.enabled = true 10 | 11 | defaultConfig { 12 | applicationId "fr.s13d.photobackup" 13 | minSdkVersion 16 14 | targetSdkVersion 25 15 | versionCode 33 16 | versionName "0.11.0" 17 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 18 | } 19 | buildTypes { 20 | debug { 21 | debuggable true 22 | minifyEnabled false 23 | applicationIdSuffix ".debug" 24 | versionNameSuffix '-dev' 25 | } 26 | release { 27 | debuggable false 28 | minifyEnabled true 29 | shrinkResources true 30 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 31 | } 32 | } 33 | lintOptions { 34 | abortOnError false 35 | } 36 | 37 | // to force Gradle version conflicts resolving 38 | configurations.all { 39 | resolutionStrategy.force 'com.google.code.findbugs:jsr305:2.0.1' 40 | } 41 | } 42 | 43 | dependencies { 44 | // compile 45 | compile fileTree(dir: 'libs', include: ['*.jar']) 46 | compile "com.android.support:appcompat-v7:${supportLibVersion}" 47 | compile 'com.squareup.okhttp3:okhttp:3.2.0' 48 | compile('de.psdev.licensesdialog:licensesdialog:1.8.1') 49 | 50 | // jUnit 51 | testCompile 'junit:junit:4.12' 52 | 53 | // androidTestCompile 54 | androidTestCompile 'com.android.support.test:runner:0.5' 55 | androidTestCompile 'com.android.support.test:rules:0.5' 56 | androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2' 57 | androidTestCompile "com.android.support:appcompat-v7:${supportLibVersion}" 58 | } 59 | -------------------------------------------------------------------------------- /app/src/main/java/fr/s13d/photobackup/PBBootBroadcastReceiver.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2013-2016 Stéphane Péchard. 3 | * 4 | * This file is part of PhotoBackup. 5 | * 6 | * PhotoBackup is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PhotoBackup is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package fr.s13d.photobackup; 21 | 22 | import android.content.BroadcastReceiver; 23 | import android.content.Context; 24 | import android.content.Intent; 25 | import android.content.SharedPreferences; 26 | import android.preference.PreferenceManager; 27 | 28 | 29 | /** 30 | * Receives boot broadcast intents and start PB service if required. 31 | */ 32 | public class PBBootBroadcastReceiver extends BroadcastReceiver { 33 | 34 | @Override 35 | public void onReceive(final Context context, final Intent intent) { 36 | 37 | if (intent != null && "android.intent.action.BOOT_COMPLETED".equals(intent.getAction())) { 38 | final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context); 39 | final boolean shouldRun = preferences.getBoolean(PBConstants.PREF_SERVICE_RUNNING, false); 40 | if (shouldRun) { 41 | final Intent startServiceIntent = new Intent(context, PBService.class); 42 | context.startService(startServiceIntent); 43 | } 44 | } 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /app/src/main/res/xml/server_preferences.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 11 | 12 | 17 | 18 | 23 | 24 | 27 | 28 | 34 | 35 | 41 | 42 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: android 2 | jdk: oraclejdk8 3 | # Turn off caching to avoid any caching problems 4 | cache: false 5 | # Use the Travis Container-Based Infrastructure 6 | sudo: false 7 | env: 8 | global: 9 | - ANDROID_API_LEVEL=25 10 | - ANDROID_BUILD_TOOLS_VERSION=25.0.0 11 | - ANDROID_ABI=armeabi-v7a 12 | - ADB_INSTALL_TIMEOUT=10 # minutes (2 minutes by default) 13 | 14 | android: 15 | components: 16 | - tools 17 | - build-tools-$ANDROID_BUILD_TOOLS_VERSION 18 | - android-$ANDROID_API_LEVEL 19 | - extra-android-m2repository 20 | # Support library 21 | - extra-android-support 22 | # Specify at least one system image 23 | - sys-img-armeabi-v7a-android-$ANDROID_API_LEVEL 24 | 25 | before_script: 26 | # Create emulator 27 | - echo no | android create avd --force -n test -t android-$ANDROID_API_LEVEL --abi $ANDROID_ABI 28 | # Start emulator 29 | - emulator -avd test -no-skin -no-audio -no-window & 30 | - adb wait-for-device & 31 | - adb shell input keyevent 82 & 32 | # inject Falcon dependency (to take screenshots) 33 | # - sed -i "s/^dependencies {/dependencies { compile 'com.jraska:falcon:1.0.1'/g" build.gradle 34 | # - sed -i "s/^repositories {/repositories { jcenter()/g" build.gradle 35 | 36 | script: 37 | # Build the app 38 | - chmod +x gradlew 39 | - ./gradlew build -PdisablePreDex 40 | # - ./gradlew connectedAndroidTest 41 | 42 | # after_script: 43 | # - adb install build/outputs/apk/client-android-debug.apk 44 | # - adb shell am start -n fr.s13d.photobackup/.PBActivity 45 | # Go to About activity 46 | # - adb shell input tap 500 1300 47 | # - bash <(curl -s https://codecov.io/bash) 48 | 49 | 50 | # gitter integration 51 | notifications: 52 | webhooks: 53 | urls: 54 | - https://webhooks.gitter.im/e/78e5e3847120190ddae2 55 | on_success: change # options: [always|never|change] default: always 56 | on_failure: always # options: [always|never|change] default: always 57 | on_start: never # options: [always|never|change] default: always 58 | -------------------------------------------------------------------------------- /app/src/main/res/layout/list_row.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 15 | 16 | 26 | 27 | 38 | 39 | 46 | 47 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_about.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | 20 | 21 | 27 | 28 | 36 | 37 | 44 | 45 | 48 | 49 |