Skip to content

Commit bcdab71

Browse files
committed
Merge branch 'hotfix/patches'
2 parents d5b8735 + a835707 commit bcdab71

File tree

8 files changed

+93
-42
lines changed

8 files changed

+93
-42
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
Change Log
22
===============================================================================
3+
Version 2.1.7 *(2017-04-18)*
4+
----------------------------
5+
* Properly handle crashes during migration of backup/export files to new location
6+
* Update README and CONTRIBUTORS
7+
38
Version 2.1.6 *(2017-04-15)*
49
----------------------------
510
* Fixed #664: Rotating device in transaction view causes crash

CONTRIBUTORS.md

Lines changed: 53 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,59 @@ project through the early phases (as Google Summer of Code project 2012) and pro
77
* Ngewi Fet <ngewif@gmail.com> - Project maintainer
88
* Yongxin Wang <fefe.wyx@gmail.com>
99
* Oleksandr Tyshkovets <olexandr.tyshkovets@gmail.com>
10-
* Àlex Magaz Graça <rivaldi8@gmail.com>
10+
* Àlex Magaz Graça <alexandre.magaz@gmail.com>
1111

1212
### Other Contributors
13-
The following (incomplete list of) people (in no particular order) contributed (patches and translations) to GnuCash Android:
14-
* Christian Stimming <christian@cstimming.de>
15-
* Cristian Marchi <cri.penta@gmail.com>
16-
* Menelaos Maglis <mmaglis@metacom.gr>
17-
* Kjell Thomas Pedersen <kjelltp@gmail.com>
18-
* Alexander Galanin <al@galanin.nnov.ru>
19-
* Jorge Martínez López <jorgeml@gmail.com>
20-
* Israel Buitron <israel.buitron@gmail.com>
21-
* Geert Janssens <janssens-geert@telenet.be>
22-
* Nicolas Barranger <wicowyn@gmail.com>
23-
* Sigurd Gartmann <sigurdga-github@sigurdga.no>
24-
* Pedro Abel <pedroabel@gmail.com>
25-
* windwarrior <lennartbuit@gmail.com>
26-
* Alex Lei <lxbzmy@gmail.com>
27-
* Matthew Hague <matthewhague@zoho.com>
28-
* Spanti Nicola <rydroid_dev@yahoo.com>
29-
* Jesse Shieh <jesse.shieh.pub@gmail.com>
30-
* Terry Chung <terrywmc@gmail.com>
31-
* Caesar Wirth <cjwirth@gmail.com>
32-
* Alceu Rodrigues Neto <alceurneto@gmail.com>
33-
* Carlo Zancanaro <carlo@zancanaro.id.au>
34-
* Eric Daly <edaly@hpsnet.com>
35-
* Weslly Oliveira <weslly99@hotmail.com>
36-
* Felipe Morato <me@fmorato.com>
37-
* Alceu Rodrigues Neto <alceurneto@gmail.com>
38-
* Salama AB <aksalj@aksalj.me>
39-
* Juan Villa <juan64@gmail.com>
13+
The following people (in alphabetical order) contributed (commits on GitHub) to GnuCash Android:
14+
* aerkefiende
15+
* Alceu Rodrigues Neto
16+
* Aleksey Ivanovski
17+
* Àlex Magaz Graça
18+
* Alexander Galanin
19+
* Alexandr Makaric
20+
* Caesar Wirth
21+
* Carlo Zancanaro
22+
* choni wani@dri-h.net
23+
* Christian Stimming
24+
* Cristian Marchi
25+
* David Landry
26+
* Eric Daly
27+
* Falk Brockmann
28+
* Felipe Morato
29+
* Geert Janssens
30+
* Jörg Möller
31+
* Israel Buitron
32+
* Jesse Shieh
33+
* Jorge Martínez López
34+
* Juan Villa
35+
* Kjell Thomas Pedersen
36+
* Lian Kai
37+
* lxb leixb@agilean.cn
38+
* Alex Lei
39+
* Mark Haanen
40+
* Matthew Hague
41+
* Menelaos Maglis
42+
* moshe.w@invest.com
43+
* Ngewi Fet
44+
* Nicolas Barranger
45+
* Oleg Kosmakov
46+
* Oleksandr Tyshkovets
47+
* PBNeves bastosdasneves@gmail.com
48+
* Pedro Abel
49+
* Salama AB
50+
* Sandro Santilli
51+
* Sigurd Gartmann
52+
* smisger sameer.misger@prospectasoftware.com
53+
* Spanti Nicola
54+
* Stephan Windmüller
55+
* Terry Chung
56+
* thesebas thesebas@thesebas.net
57+
* Vladimir Rutsky
58+
* Weslly Oliveira
59+
* windwarrior lennartbuit@gmail.com
60+
* yapiti wicowyn@gmail.com
61+
* Yongxin Wang
4062

41-
Please visit https://crowdin.com/project/gnucash-android for a more complete list of translation contributions
63+
64+
### Translators
65+
Please visit https://crowdin.com/project/gnucash-android for a more complete list of translation contributions

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
GnuCash Android is a companion expense-tracker application for GnuCash (desktop) designed for Android.
88
It allows you to record transactions on-the-go and later import the data into GnuCash for the desktop.
99

10+
Accounts | Transactions | Reports
11+
:-------------------------:|:-------------------------:|:-------------------------:
12+
![Accounts List](docs/images/v2.0.0_home.png) | ![Transactions List](docs/images/v2.0.0_transactions_list.png) | ![Reports](docs/images/v2.0.0_reports.png)
13+
1014
The application supports Android 2.3.3 Gingerbread (API level 10) and above.
1115

1216
Features include:
@@ -66,7 +70,7 @@ The app is configured to allow you to install a development and production versi
6670

6771
### With Android Studio
6872
The easiest way to build is to install [Android Studio](https://developer.android.com/sdk/index.html) v2.+
69-
with [Gradle](https://www.gradle.org/) v2.10
73+
with [Gradle](https://www.gradle.org/) v3.4.1
7074
Once installed, then you can import the project into Android Studio:
7175

7276
1. Open `File`
@@ -89,7 +93,7 @@ Please visit [CrowdIn](https://crowdin.com/project/gnucash-android) in order to
8993

9094
* You could as well contribute code, fixing bugs, new features or automated tests. Pull requests are always welcome.
9195
Take a look at the [bug tracker](https://github.com/codinguser/gnucash-android/issues?state=open)
92-
for ideas where to start.
96+
for ideas where to start. Also take a look at the [contribution guidlines](https://github.com/codinguser/gnucash-android/blob/master/.github/CONTRIBUTING.md)
9397

9498
For development, it is recommended to use the Android Studio for development which is available for free.
9599
Import the project into the IDE using the build.gradle file. The IDE will resolve dependencies automatically.

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ apply plugin: 'android-apt'
66

77
def versionMajor = 2
88
def versionMinor = 1
9-
def versionPatch = 6
9+
def versionPatch = 7
1010
def versionBuild = 0
1111

1212
def buildTime() {

app/src/main/java/org/gnucash/android/db/MigrationHelper.java

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1488,10 +1488,25 @@ static int upgradeDbToVersion13(SQLiteDatabase db){
14881488
* @param srcDir Source directory which should already exist
14891489
* @param dstDir Destination directory which should already exist
14901490
* @see #moveFile(File, File)
1491+
* @throws IOException if the {@code srcDir} does not exist or {@code dstDir} could not be created
1492+
* @throws IllegalArgumentException if {@code srcDir} is not a directory
14911493
*/
1492-
private static void moveDirectory(File srcDir, File dstDir){
1493-
if (!srcDir.exists() || !srcDir.isDirectory() || !dstDir.isDirectory() || !dstDir.exists()){
1494-
throw new IllegalArgumentException("Source is not a directory, use MigrationHelper.moveFile(...)");
1494+
private static void moveDirectory(File srcDir, File dstDir) throws IOException {
1495+
if (!srcDir.isDirectory()){
1496+
throw new IllegalArgumentException("Source is not a directory: " + srcDir.getPath());
1497+
}
1498+
1499+
if (!srcDir.exists()){
1500+
String msg = String.format(Locale.US, "Source directory %s does not exist", srcDir.getPath());
1501+
Log.e(LOG_TAG, msg);
1502+
throw new IOException(msg);
1503+
}
1504+
1505+
if (!dstDir.exists() || !dstDir.isDirectory()){
1506+
Log.w(LOG_TAG, "Target directory does not exist. Attempting to create..." + dstDir.getPath());
1507+
if (!dstDir.mkdirs()){
1508+
throw new IOException(String.format("Target directory %s does not exist and could not be created", dstDir.getPath()));
1509+
}
14951510
}
14961511

14971512
for (File src : srcDir.listFiles()){
@@ -1521,7 +1536,7 @@ private static void moveDirectory(File srcDir, File dstDir){
15211536
* It moves the backup files to a new backup location which does not require SD CARD write permission
15221537
* </p>
15231538
* @param db SQLite database to be upgraded
1524-
* @return
1539+
* @return New database version
15251540
*/
15261541
public static int upgradeDbToVersion14(SQLiteDatabase db){
15271542
Log.i(DatabaseHelper.LOG_TAG, "Upgrading database to version 14");
@@ -1534,17 +1549,20 @@ public static int upgradeDbToVersion14(SQLiteDatabase db){
15341549
public void run() {
15351550
File srcDir = new File(Exporter.LEGACY_BASE_FOLDER_PATH);
15361551
File dstDir = new File(Exporter.BASE_FOLDER_PATH);
1537-
moveDirectory(srcDir, dstDir);
1538-
File readmeFile = new File(Exporter.LEGACY_BASE_FOLDER_PATH, "README.txt");
1539-
FileWriter writer = null;
15401552
try {
1553+
moveDirectory(srcDir, dstDir);
1554+
File readmeFile = new File(Exporter.LEGACY_BASE_FOLDER_PATH, "README.txt");
1555+
FileWriter writer = null;
15411556
writer = new FileWriter(readmeFile);
15421557
writer.write("Backup files have been moved to " + dstDir.getPath() +
15431558
"\nYou can now delete this folder");
15441559
writer.flush();
1545-
} catch (IOException e) {
1546-
e.printStackTrace();
1547-
Log.e(LOG_TAG, "Error creating README file");
1560+
} catch (IOException | IllegalArgumentException ex) {
1561+
ex.printStackTrace();
1562+
String msg = String.format("Error moving files from %s to %s", srcDir.getPath(), dstDir.getPath());
1563+
Log.e(LOG_TAG, msg);
1564+
Crashlytics.log(msg);
1565+
Crashlytics.logException(ex);
15481566
}
15491567

15501568
}

docs/images/v2.0.0_home.png

116 KB
Loading

docs/images/v2.0.0_reports.png

111 KB
Loading
142 KB
Loading

0 commit comments

Comments
 (0)