Skip to content

Commit

Permalink
Merge branch 'hotfix/v2.5.1'
Browse files Browse the repository at this point in the history
* hotfix/v2.5.1:
  Updates readme for release
  Updates screenshot paths and bumps version code
  Fixes issue with empty backups directory causing crash in settings
  • Loading branch information
7LPdWcaW committed Jun 26, 2019
2 parents 17ff5e8 + 946c0a3 commit 116d00b
Show file tree
Hide file tree
Showing 48 changed files with 65 additions and 54 deletions.
46 changes: 23 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

Welcome to grow tracker. This app was created to help record data about growing plants in order to monitor the growing conditions to help make the plants grow better, and identify potential issues during the grow process.

[Latest APK: (MD5) aa3496894c364a766145a576122e3ee6 v2.5](https://github.com/7LPdWcaW/GrowTracker-Android/releases/download/v2.5/v2.5-production.apk)
[Latest APK: (MD5) 2be1b62b6e31193f7036b8e41d9a12db v2.5.1](https://github.com/7LPdWcaW/GrowTracker-Android/releases/download/v2.5.1/v2.5.1-production.apk)

[Latest APK (Discrete): (MD5) 0f68525415eb2fc3c77184cdb3c51443 v2.5](https://github.com/7LPdWcaW/GrowTracker-Android/releases/download/v2.5/v2.5-discrete.apk)
[Latest APK (Discrete): (MD5) 97eb68a4a733b4a59a007ef48609e81c v2.5.1](https://github.com/7LPdWcaW/GrowTracker-Android/releases/download/v2.5.1/v2.5.1-discrete.apk)

[Get it on F-Droid with automatic updates](https://f-droid.org/packages/me.anon.grow/)

Expand Down Expand Up @@ -32,27 +32,27 @@ You can either elect to update manually, or get notified on releases by installi

# Screenshots

[![install](metadata/images/phoneScreenshotsThumbs/install-thumb.png)](metadata/images/phoneScreenshots/install.png)
[![plant list](metadata/images/phoneScreenshotsThumbs/1-thumb.png)](metadata/images/phoneScreenshots/1.png)
[![discrete plant list](metadata/images/phoneScreenshotsThumbs/1b-thumb.png)](metadata/images/phoneScreenshots/1b.png)
[![discrete plant list](metadata/images/phoneScreenshotsThumbs/1c-thumb.png)](metadata/images/phoneScreenshots/1c.png)
[![discrete plant list](metadata/images/phoneScreenshotsThumbs/1d-thumb.png)](metadata/images/phoneScreenshots/1d.png)
[![discrete plant list](metadata/images/phoneScreenshotsThumbs/1e-thumb.png)](metadata/images/phoneScreenshots/1e.png)
[![plant details](metadata/images/phoneScreenshotsThumbs/2-thumb.png)](metadata/images/phoneScreenshots/2.png)
[![feeding](metadata/images/phoneScreenshotsThumbs/3-thumb.png)](metadata/images/phoneScreenshots/3.png)
[![nutrients](metadata/images/phoneScreenshotsThumbs/4-thumb.png)](metadata/images/phoneScreenshots/4.png)
[![nutrients](metadata/images/phoneScreenshotsThumbs/4b-thumb.png)](metadata/images/phoneScreenshots/4b.png)
[![actions](metadata/images/phoneScreenshotsThumbs/5-thumb.png)](metadata/images/phoneScreenshots/5.png)
[![pictures](metadata/images/phoneScreenshotsThumbs/6-thumb.png)](metadata/images/phoneScreenshots/6.png)
[![statistics](metadata/images/phoneScreenshotsThumbs/7-thumb.png)](metadata/images/phoneScreenshots/7.png)
[![past actions](metadata/images/phoneScreenshotsThumbs/8-thumb.png)](metadata/images/phoneScreenshots/8.png)
[![action filters](metadata/images/phoneScreenshotsThumbs/9-thumb.png)](metadata/images/phoneScreenshots/9.png)
[![action options](metadata/images/phoneScreenshotsThumbs/10-thumb.png)](metadata/images/phoneScreenshots/10.png)
[![settings](metadata/images/phoneScreenshotsThumbs/11-thumb.png)](metadata/images/phoneScreenshots/11.png)
[![measurements](metadata/images/phoneScreenshotsThumbs/12-thumb.png)](metadata/images/phoneScreenshots/12.png)
[![schedules](metadata/images/phoneScreenshotsThumbs/13-thumb.png)](metadata/images/phoneScreenshots/13.png)
[![schedule details](metadata/images/phoneScreenshotsThumbs/14-thumb.png)](metadata/images/phoneScreenshots/14.png)
[![schedule date](metadata/images/phoneScreenshotsThumbs/15-thumb.png)](metadata/images/phoneScreenshots/15.png)
[![install](fastlane/metadata/android/en-GB/images/phoneScreenshotsThumbs/install-thumb.png)](fastlane/metadata/android/en-GB/images/phoneScreenshots/install.png)
[![plant list](fastlane/metadata/android/en-GB/images/phoneScreenshotsThumbs/1-thumb.png)](fastlane/metadata/android/en-GB/images/phoneScreenshots/1.png)
[![discrete plant list](fastlane/metadata/android/en-GB/images/phoneScreenshotsThumbs/1b-thumb.png)](fastlane/metadata/android/en-GB/images/phoneScreenshots/1b.png)
[![discrete plant list](fastlane/metadata/android/en-GB/images/phoneScreenshotsThumbs/1c-thumb.png)](fastlane/metadata/android/en-GB/images/phoneScreenshots/1c.png)
[![discrete plant list](fastlane/metadata/android/en-GB/images/phoneScreenshotsThumbs/1d-thumb.png)](fastlane/metadata/android/en-GB/images/phoneScreenshots/1d.png)
[![discrete plant list](fastlane/metadata/android/en-GB/images/phoneScreenshotsThumbs/1e-thumb.png)](fastlane/metadata/android/en-GB/images/phoneScreenshots/1e.png)
[![plant details](fastlane/metadata/android/en-GB/images/phoneScreenshotsThumbs/2-thumb.png)](fastlane/metadata/android/en-GB/images/phoneScreenshots/2.png)
[![feeding](fastlane/metadata/android/en-GB/images/phoneScreenshotsThumbs/3-thumb.png)](fastlane/metadata/android/en-GB/images/phoneScreenshots/3.png)
[![nutrients](fastlane/metadata/android/en-GB/images/phoneScreenshotsThumbs/4-thumb.png)](fastlane/metadata/android/en-GB/images/phoneScreenshots/4.png)
[![nutrients](fastlane/metadata/android/en-GB/images/phoneScreenshotsThumbs/4b-thumb.png)](fastlane/metadata/android/en-GB/images/phoneScreenshots/4b.png)
[![actions](fastlane/metadata/android/en-GB/images/phoneScreenshotsThumbs/5-thumb.png)](fastlane/metadata/android/en-GB/images/phoneScreenshots/5.png)
[![pictures](fastlane/metadata/android/en-GB/images/phoneScreenshotsThumbs/6-thumb.png)](fastlane/metadata/android/en-GB/images/phoneScreenshots/6.png)
[![statistics](fastlane/metadata/android/en-GB/images/phoneScreenshotsThumbs/7-thumb.png)](fastlane/metadata/android/en-GB/images/phoneScreenshots/7.png)
[![past actions](fastlane/metadata/android/en-GB/images/phoneScreenshotsThumbs/8-thumb.png)](fastlane/metadata/android/en-GB/images/phoneScreenshots/8.png)
[![action filters](fastlane/metadata/android/en-GB/images/phoneScreenshotsThumbs/9-thumb.png)](fastlane/metadata/android/en-GB/images/phoneScreenshots/9.png)
[![action options](fastlane/metadata/android/en-GB/images/phoneScreenshotsThumbs/10-thumb.png)](fastlane/metadata/android/en-GB/images/phoneScreenshots/10.png)
[![settings](fastlane/metadata/android/en-GB/images/phoneScreenshotsThumbs/11-thumb.png)](fastlane/metadata/android/en-GB/images/phoneScreenshots/11.png)
[![measurements](fastlane/metadata/android/en-GB/images/phoneScreenshotsThumbs/12-thumb.png)](fastlane/metadata/android/en-GB/images/phoneScreenshots/12.png)
[![schedules](fastlane/metadata/android/en-GB/images/phoneScreenshotsThumbs/13-thumb.png)](fastlane/metadata/android/en-GB/images/phoneScreenshots/13.png)
[![schedule details](fastlane/metadata/android/en-GB/images/phoneScreenshotsThumbs/14-thumb.png)](fastlane/metadata/android/en-GB/images/phoneScreenshots/14.png)
[![schedule date](fastlane/metadata/android/en-GB/images/phoneScreenshotsThumbs/15-thumb.png)](fastlane/metadata/android/en-GB/images/phoneScreenshots/15.png)

# About the app

Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ android {
applicationId "me.anon.grow"
minSdkVersion 17
targetSdkVersion 28
versionCode 21
versionName "2.5"
versionCode 22
versionName "2.5.1"

javaCompileOptions {
annotationProcessorOptions {
Expand Down
26 changes: 11 additions & 15 deletions app/src/main/java/me/anon/grow/fragment/SettingsFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,9 @@ else if ("export".equals(preference.getKey()))
}
else if ("backup_now".equals(preference.getKey()))
{
String currentBackup = findPreference("backup_size").getSharedPreferences().getString("backup_size", "20");
Toast.makeText(getActivity(), "Backed up to " + BackupHelper.backupJson().getPath(), Toast.LENGTH_SHORT).show();
findPreference("backup_size").setSummary("Currently " + currentBackup + "mb / Using " + lengthToString(BackupHelper.backupSize(), false));
}
else if ("restore".equals(preference.getKey()))
{
Expand Down Expand Up @@ -650,15 +652,10 @@ class BackupData
Arrays.sort(backupFiles);
final ArrayList<BackupData> backups = new ArrayList();

BackupData current = null;
Date lastDate = new Date();
BackupData current = new BackupData();
Date lastDate = null;
for (String backup : backupFiles)
{
if (current == null)
{
current = new BackupData();
}

File backupFile = new File(backup);
String[] parts = backupFile.getName().split("\\.");
Date date = new Date();
Expand All @@ -682,23 +679,20 @@ class BackupData
backups.add(backupData);
continue;
}
else

if (lastDate == null || !date.equals(lastDate))
{
lastDate = date;
current = new BackupData();
current.date = date;
backups.add(current);
}
}
else
{
continue;
}

if (!current.date.equals(lastDate))
{
lastDate = current.date;
backups.add(current);
current = new BackupData();
}

File file = new File(backupPath.getPath() + "/" + backup);
if (backup.contains("plants"))
{
Expand Down Expand Up @@ -747,6 +741,8 @@ class BackupData
MainApplication.setFailsafe(false);
}

if (selectedBackup.plantsPath == null) return;

if (selectedBackup.plantsPath.endsWith("dat") && !MainApplication.isEncrypted())
{
SnackBar.show(getActivity(), "You must have encrpted mode enabled with the same password to restore this backup", "Enable", new SnackBarListener()
Expand Down
30 changes: 16 additions & 14 deletions app/src/main/java/me/anon/lib/helper/BackupHelper.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ object BackupHelper
{
if (MainApplication.isFailsafe()) return null

limitBackups()
val isEncrypted = MainApplication.isEncrypted()
val time = System.currentTimeMillis()
val backupPath = File(FILES_PATH)
val ext = isEncrypted T "dat" ?: "bak"
val backupPath = File(FILES_PATH)
backupPath.mkdirs()
limitBackups()

FileManager.getInstance().copyFile("${PlantManager.FILES_DIR}/plants.json", "$FILES_PATH/$time.plants.json.$ext")
FileManager.getInstance().copyFile("${PlantManager.FILES_DIR}/schedules.json", "$FILES_PATH/$time.schedules.json.$ext")
FileManager.getInstance().copyFile("${PlantManager.FILES_DIR}/gardens.json", "$FILES_PATH/$time.gardens.json.$ext")
Expand All @@ -38,24 +39,25 @@ object BackupHelper
public fun backupSize(): Long
{
val path = File(BackupHelper.FILES_PATH)
return path.listFiles().fold(0L, { acc, file -> acc + file.length() })
return path.listFiles()?.fold(0L, { acc, file -> acc + file.length() }) ?: 0L
}

@JvmStatic
public fun limitBackups(size: String = MainApplication.getDefaultPreferences().getString("backup_size", "20")!!)
{
val files = File(BackupHelper.FILES_PATH).listFiles()
val sorted = ArrayList(files.sortedBy { it.lastModified() })
val limit = size.toInt() * 1_048_576

var currentSize = backupSize()
while (currentSize > limit)
{
val remove = sorted.removeAt(0)
val len = remove.length()
if (remove.delete())
File(BackupHelper.FILES_PATH).listFiles()?.let {
val sorted = ArrayList(it.sortedBy { it.lastModified() })
val limit = size.toInt() * 1_048_576

var currentSize = backupSize()
while (currentSize > limit)
{
currentSize -= len
val remove = sorted.removeAt(0)
val len = remove.length()
if (remove.delete())
{
currentSize -= len
}
}
}
}
Expand Down
11 changes: 11 additions & 0 deletions fastlane/metadata/android/en-GB/changelogs/21.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
- New reverse order setting. Requires app restart. Data is still stored as per the readme, this is purely cosmetic.
- Fixes issue with crash when going landscape is statistics view
- Adds seedling stage
- Adds approximate plant stage into photos view and lightbox view - approximate due to the nature of calculating the photo's date, but should always be correct
- Plant date will now always be the same as the planted stage. If either of these are changed, they are both changed.
- Fixes issue with restoring from encrypted backups. This will now warn you of potential encrypted backups you're restoring from. This may not work with files encrypted before this update but will still warn you if it fails to restore that it may be because of the file being encrypted. Restoring from encrypted files requires the app to also be in encrypted mode with *the same password* as the encrypted files.
- Fixes text overlay issues with actions on small screens
- Refactors export functionality so it should work better and have better notifications around it and fixes crash with export
- Adds garden export functionality
- Strain is now an optional field
- Fixes issue with feeding from previous dialog
2 changes: 2 additions & 0 deletions fastlane/metadata/android/en-GB/changelogs/22.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Fixes crash when going into settings for fresh installs
- Fixes issue with restore from backup not showing backups correctly
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes

0 comments on commit 116d00b

Please sign in to comment.