Skip to content

Commit

Permalink
Merge branch 'release/v2.3'
Browse files Browse the repository at this point in the history
* release/v2.3: (68 commits)
  Bumped version and updated documentation
  Fixed issue with clone not deed cloning
  Bumped gradle
  Bumped version
  Try and prevent image flickering
  Fixed issue with lag
  Fixed issue with delete not working correctly
  Fixed issue with sharing images
  Fixed issue with exporting data not working correctly
  Bumped version and updated apks, apks will be hosted via github releases instead of this project
  Re-wrote filtering system to prevent dataloss
  Bumped version and added apks
  Fixed issue with null plant ids causing crash and added queue based saving system
  Added intent provider documentation
  Bumped version and generate RC1
  Fixed readme
  Fixed issue with backup service not starting immediately
  Fixed issue with NPE and rare instance where dismissing dialog will cause an invalid application state
  Fixed issue with page not being selected properly from waking from sleep
  Temp remove synchronisation to improve latency
  ...
  • Loading branch information
7LPdWcaW committed Aug 26, 2017
2 parents 5162a72 + 09c3afc commit 5469952
Show file tree
Hide file tree
Showing 67 changed files with 1,415 additions and 632 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,5 @@ gradle-app.setting
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar

app/app-discrete-release.apk
app/app-production-release.apk
16 changes: 16 additions & 0 deletions ADDONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,19 @@ You can register an activity with the receiver for configuration purposes by usi
</intent-filter>
</activity>
```

## Available intent providers

You can request all the data from the app using the request intent as follows

```
<action android:name="me.anon.grow.ACTION_REQUEST_PLANTS" />
<category android:name="android.intent.category.DEFAULT" />
```

The activity will return a bundle with the apps data as a JSON string

|key|type|description|
|---|---|---|
|`me.anon.grow.PLANT_LIST`|String|Full json-encoded array of plants and its data.|
|`me.anon.grow.ENCRYPTED`|Boolean|If this is true, `me.anon.grow.PLANT_LIST` will be encrypted and base64 encoded, images will be encrypted on disk|
18 changes: 11 additions & 7 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) cbdf6ad0cfd4d87159fd0c2f762d142c v2.2.1](https://github.com/7LPdWcaW/GrowTracker-Android/raw/master/app/app-production-release.apk)
[Latest APK: (MD5) bc9a631d80af4ac0d5ff6b49292219dd v2.3](https://github.com/7LPdWcaW/GrowTracker-Android/releases/download/v2.3/v2.3-production.apk)

[Latest APK (Discrete): (MD5) 1099cc60eb90568074d6ca3ee230f0da v2.2.1](https://github.com/7LPdWcaW/GrowTracker-Android/raw/master/app/app-discrete-release.apk)
[Latest APK (Discrete): (MD5) f7ccf060a0ddc7356e67a7e6f23bbfbb v2.3](https://github.com/7LPdWcaW/GrowTracker-Android/releases/download/v2.3/v2.3-discrete.apk)

# Installation

Expand Down Expand Up @@ -47,6 +47,10 @@ The app uses a simple JSON structure to store all the data about the plants that

The structure is very simple. Note: date timestamps are all unix timestamps from 1/1/1970 in milliseconds. All objects in arrays are in date order, where index 0 is the oldest and index (size - 1) is the newest.

## Prerequisites

Lombok is required for this project before you are able to compile. You can install it by going to `preferences->plugins->browse repositories->lombok plugin`

### Plant object

```
Expand All @@ -67,13 +71,13 @@ The structure is very simple. Note: date timestamps are all unix timestamps from

One of,

`SOIL`, `HYDRO`
`SOIL`, `HYDRO`, `COCO`, `AERO`

### Plant Stage (ENUM)

One of,

`PLANTED`, `GERMINATION`, `VEGETATION`, `FLOWER`, `CURING`, `HARVESTED`
`PLANTED`, `GERMINATION`, `CUTTING`, `VEGETATION`, `FLOWER`, `DRYING`, `CURING`, `HARVESTED`

### Action object (feeding)

Expand Down Expand Up @@ -112,7 +116,7 @@ Water action for waterings

Action can be one of,

`TRIM`, `TOP`, `FIM`, `LST`, `LOLLIPOP`, `FLUSH`, `FOLIAR_FEED`, `PESTICIDE_APPLICATION`
`FIM`, `FLUSH`, `FOLIAR_FEED`, `LST`, `LOLLIPOP`, `PESTICIDE_APPLICATION`, `TOP`, `TRANSPLANTED`, `TRIM`

```
{
Expand Down Expand Up @@ -144,15 +148,15 @@ Action can be one of,

Image object is a simple string path to an image. Each image is named by the timestamp when it was taken, in milliseconds.

#Encryption
# Encryption

Note that this is **not** a guarantee form of encryption from law enforcement agencies.

Encryption in the app uses basic AES for encryption using the provided passphrase. If the passphrase is less than 128 bits (16 UTF-8 chars), it will be padded with `0x0` bytes. You can view the key generator method [here](https://github.com/7LPdWcaW/GrowTracker-Android/blob/master/app/src/main/java/me/anon/lib/helper/EncryptionHelper.java#L27)

You can decrypt your files using your passphrase either by writing a script that uses AES decryption, or an online tool such as [Online-Domain-Tools](http://aes.online-domain-tools.com/).

#License
# License

Copyright 2014-2017 7LPdWcaW

Expand Down
Binary file removed app/app-discrete-release.apk
Binary file not shown.
Binary file removed app/app-production-release.apk
Binary file not shown.
23 changes: 15 additions & 8 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ android {
applicationId "me.anon.grow"
minSdkVersion 17
targetSdkVersion 25
versionCode 9
versionName "2.2.1"
versionCode 14
versionName "2.3"
}

lintOptions {
Expand All @@ -37,17 +37,24 @@ android {
]
}
}

buildTypes {
debug {
applicationIdSuffix = ".debug"
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.android.support:recyclerview-v7:25.1.0'
compile 'com.android.support:cardview-v7:25.1.0'
compile 'com.android.support:design:25.1.0'
compile "com.android.support:exifinterface:25.1.0"
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.android.support:recyclerview-v7:25.2.0'
compile 'com.android.support:cardview-v7:25.2.0'
compile 'com.android.support:design:25.2.0'
compile "com.android.support:exifinterface:25.2.0"

compile 'com.google.code.gson:gson:2.4'
compile 'com.esotericsoftware:kryo:3.0.3'
compile 'com.google.code.gson:gson:2.7'
compile 'com.squareup:otto:1.3.8'
compile 'com.kennyc:snackbar:2.0.2'
compile 'com.github.PhilJay:MPAndroidChart:v2.1.0'
Expand Down
10 changes: 9 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
/>
</provider>

<receiver android:name="me.anon.controller.receiver.BackupService" />

<receiver android:name="me.anon.controller.provider.PlantWidgetProvider">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
Expand All @@ -36,7 +38,7 @@
/>
</receiver>

<activity android:name=".BootActivity">
<activity android:name=".BootActivity" android:finishOnTaskLaunch="true">
<intent-filter>
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.intent.action.MAIN" />
Expand All @@ -59,6 +61,12 @@
<activity android:name=".SettingsActivity" />
<activity android:name=".fragment.ImageLightboxDialog" android:theme="@style/fullscreen" android:windowSoftInputMode="stateHidden|adjustResize" />
<activity android:name=".PlantDetailsActivity" android:windowSoftInputMode="stateAlwaysHidden" />
<activity android:name=".RequestActivity" android:windowSoftInputMode="stateAlwaysHidden" android:theme="@style/Theme.Transparent" android:exported="true">
<intent-filter>
<action android:name="me.anon.grow.ACTION_REQUEST_PLANTS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>

<meta-data android:name="me.anon.grow.APP_TYPE" android:value="${appType}" />
</application>
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/assets/readme.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ <h3>Medium (ENUM)</h3>
<p>One of, <pre>SOIL, HYDRO</pre></p>

<h3>Plant Stage (ENUM)</h3>
<p>One of, <pre>PLANTED, GERMINATION, VEGETATION, FLOWER, CURING, HARVESTED</pre></p>
<p>One of, <pre>PLANTED, GERMINATION, CUTTING, VEGETATION, FLOWER, CURING, HARVESTED</pre></p>

<h3>Action object (feeding)</h3>
<p>Temperature measured in ºC</p>
Expand Down Expand Up @@ -61,7 +61,7 @@ <h3>Additive object</h3>
</pre>

<h3>Action object (other)</h3>
<p>Action can be one of, <pre>TRIM, TOP, FIM, LST, LOLLIPOP, FLUSH, FOLIAR_FEED, PESTICIDE_APPLICATION</pre></p>
<p>Action can be one of, <pre>FIM, FLUSH, FOLIAR_FEED, LST, LOLLIPOP, PESTICIDE_APPLICATION, TOP, TRANSPLANTED, TRIM</pre></p>
<pre>
{
"action": &lt;Action&gt;,
Expand Down
39 changes: 32 additions & 7 deletions app/src/main/java/me/anon/controller/adapter/ActionAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import android.app.AlertDialog;
import android.content.DialogInterface;
import android.preference.PreferenceManager;
import android.support.v7.widget.PopupMenu;
import android.support.v7.widget.RecyclerView;
import android.text.Html;
Expand All @@ -12,6 +13,8 @@
import android.view.View;
import android.view.ViewGroup;

import com.esotericsoftware.kryo.Kryo;

import java.text.DateFormat;
import java.util.ArrayList;
import java.util.Calendar;
Expand All @@ -25,8 +28,8 @@
import lombok.Setter;
import me.anon.grow.R;
import me.anon.lib.DateRenderer;
import me.anon.lib.TempUnit;
import me.anon.lib.Unit;
import me.anon.lib.helper.ModelHelper;
import me.anon.lib.helper.TimeHelper;
import me.anon.model.Action;
import me.anon.model.Additive;
Expand All @@ -37,6 +40,7 @@
import me.anon.model.Water;
import me.anon.view.ActionHolder;

import static me.anon.lib.TempUnit.CELCIUS;
import static me.anon.lib.Unit.ML;

/**
Expand All @@ -60,6 +64,8 @@ public interface OnActionSelectListener
@Getter private Plant plant;
@Getter private List<Action> actions = new ArrayList<>();
@Getter private Unit measureUnit, deliveryUnit;
@Getter private TempUnit tempUnit;
private boolean usingEc = false;

public void setActions(Plant plant, List<Action> actions)
{
Expand All @@ -86,6 +92,13 @@ public void setActions(Plant plant, List<Action> actions)
deliveryUnit = Unit.getSelectedDeliveryUnit(viewHolder.itemView.getContext());
}

if (tempUnit == null)
{
tempUnit = TempUnit.getSelectedTemperatureUnit(viewHolder.itemView.getContext());
}

usingEc = PreferenceManager.getDefaultSharedPreferences(viewHolder.itemView.getContext()).getBoolean("tds_ec", false);

if (action == null) return;

DateFormat dateFormat = android.text.format.DateFormat.getDateFormat(viewHolder.getDate().getContext());
Expand Down Expand Up @@ -206,8 +219,18 @@ else if (previous == null)

if (((Water)action).getPpm() != null)
{
waterStr.append("<b>PPM: </b>");
waterStr.append(((Water)action).getPpm());
String ppm = String.valueOf(((Water)action).getPpm().longValue());
if (usingEc)
{
waterStr.append("<b>EC: </b>");
ppm = String.valueOf((((Water)action).getPpm() * 2d) / 1000d);
}
else
{
waterStr.append("<b>PPM: </b>");
}

waterStr.append(ppm);
waterStr.append(", ");
}

Expand All @@ -222,8 +245,8 @@ else if (previous == null)
if (((Water)action).getTemp() != null)
{
waterStr.append("<b>Temp: </b>");
waterStr.append(((Water)action).getTemp());
waterStr.append("ºC, ");
waterStr.append(CELCIUS.to(tempUnit, ((Water)action).getTemp()));
waterStr.append("º").append(tempUnit.getLabel()).append(", ");
}

summary += waterStr.toString().length() > 0 ? waterStr.toString().substring(0, waterStr.length() - 2) + "<br/>" : "";
Expand Down Expand Up @@ -300,7 +323,8 @@ else if (action instanceof StageChange)
{
if (onActionSelectListener != null)
{
onActionSelectListener.onActionDuplicate((Action)ModelHelper.copy(action));
Kryo kryo = new Kryo();
onActionSelectListener.onActionDuplicate(kryo.copy(action));
}

return true;
Expand All @@ -309,7 +333,8 @@ else if (item.getItemId() == R.id.copy)
{
if (onActionSelectListener != null)
{
onActionSelectListener.onActionCopy((Action)ModelHelper.copy(action));
Kryo kryo = new Kryo();
onActionSelectListener.onActionCopy(kryo.copy(action));
}

return true;
Expand Down
Loading

0 comments on commit 5469952

Please sign in to comment.