Skip to content
This repository was archived by the owner on Feb 21, 2025. It is now read-only.

Commit cc83851

Browse files
7LPdWcaW7LPdWcaW
authored andcommitted
Merge branch 'release/v1.0'
* release/v1.0: (31 commits) Updated readme and added binary Changed download folder and fixed issue with installer not launching If the app isn't installed, offer download Fixed checker Re-wrote comparison methods Fixed addon spec Finish download activity Added latest stable support Added experimental option Removed remind action and added auto cancel Added 1 day check limit and force update respond toast Updated style Added download functionality and UI population Fixed issue with API failing and notifications not updating Added toString override for version Added provider info Added permission helper class Added basic download activity Added update notification Added version unit test ...
2 parents a6a02b4 + 7671d1f commit cc83851

34 files changed

+1357
-0
lines changed

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Read me
2+
3+
Welcome to grow updater. This is an application addon for the [Grow Tracker](https://github.com/7LPdWcaW/GrowTracker-Android).
4+
5+
This addon periodically (1 day, only checks when using GrowTracker) checks for updates for the Grow Tracker application.
6+
7+
Downloaded updates are saved in `/sdcard/Download/`
8+
9+
[Latest APK: (MD5) 4daf947e4009a8975d7a5fd7c4b8607c v1.0](https://github.com/7LPdWcaW/GrowUpdater-Android/raw/master/app/app-release.apk)
10+
11+
# Installation
12+
13+
Install the APK. You must have Grow Tracker version 2.2 or above, inside the Grow Tracker app, go to Settings from the sidebar, and you should see listed under `Addons` the addon. You can tap to configure the addon.
14+
15+
## How to install
16+
17+
1. Follow [this guide](https://gameolith.uservoice.com/knowledgebase/articles/76902-android-4-0-tablets-allowing-app-installs-from) to enable unknown sources
18+
2. Download the APK from [here](https://github.com/7LPdWcaW/GrowUpdater-Android/raw/master/app/app-release.apk)
19+
3. Click on downloaded app and install
20+
21+
#License
22+
23+
Copyright 2014-2016 7LPdWcaW
24+
25+
Licensed under the Apache License, Version 2.0 (the "License");
26+
you may not use this file except in compliance with the License.
27+
You may obtain a copy of the License at
28+
29+
http://www.apache.org/licenses/LICENSE-2.0
30+
31+
Unless required by applicable law or agreed to in writing, software
32+
distributed under the License is distributed on an "AS IS" BASIS,
33+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
34+
See the License for the specific language governing permissions and
35+
limitations under the License.

app/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

app/app-release.apk

1.71 MB
Binary file not shown.

app/build.gradle

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
apply plugin: 'com.android.application'
2+
3+
android {
4+
compileSdkVersion 25
5+
buildToolsVersion "25.0.2"
6+
7+
defaultConfig {
8+
applicationId "me.anon.grow.updater"
9+
10+
minSdkVersion 17
11+
targetSdkVersion 25
12+
13+
versionCode 1
14+
versionName "v1.0"
15+
16+
manifestPlaceholders = [versionName: versionName]
17+
}
18+
19+
buildTypes {
20+
release {
21+
}
22+
}
23+
}
24+
25+
dependencies {
26+
compile fileTree(dir: 'libs', include: ['*.jar'])
27+
28+
compile 'com.android.support:appcompat-v7:25.1.0'
29+
compile 'com.google.code.gson:gson:2.4'
30+
compile 'com.loopj.android:android-async-http:1.4.9'
31+
testCompile 'junit:junit:4.12'
32+
}

app/src/main/AndroidManifest.xml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<manifest
2+
xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="me.anon.grow.updater"
4+
>
5+
<uses-permission android:name="android.permission.INTERNET" />
6+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
7+
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
8+
9+
<application
10+
android:allowBackup="true"
11+
android:supportsRtl="true"
12+
android:icon="@mipmap/ic_launcher"
13+
android:label="Grow Updater"
14+
>
15+
<provider
16+
android:name="android.support.v4.content.FileProvider"
17+
android:authorities="${applicationId}.provider"
18+
android:exported="false"
19+
android:grantUriPermissions="true"
20+
>
21+
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/provider_paths" />
22+
</provider>
23+
24+
<receiver android:name=".CheckUpdateReceiver" android:exported="true" android:enabled="true">
25+
<intent-filter>
26+
<action android:name="me.anon.grow.ACTION_UPDATER" />
27+
</intent-filter>
28+
</receiver>
29+
30+
<activity android:name="me.anon.grow.updater.ConfigureActivity" android:theme="@style/AppTheme">
31+
<intent-filter>
32+
<category android:name="me.anon.grow.ADDON_CONFIGURATION" />
33+
<action android:name="me.anon.grow.ACTION_UPDATER" />
34+
</intent-filter>
35+
</activity>
36+
37+
<activity android:name=".DownloadActivity" android:theme="@style/AppTheme" />
38+
39+
<meta-data android:name="me.anon.grow.ADDON_NAME" android:value="Updater" />
40+
<meta-data android:name="me.anon.grow.ADDON_VERSION" android:value="${versionName}" />
41+
</application>
42+
</manifest>

app/src/main/assets/readme.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<html>
2+
<body>
3+
<h1>Read me</h1>
4+
<div>
5+
Welcome to grow updater. This is a simple addon for Grow Tracker that periodically checks the Releases page on github for updates and automatically downloads ans prompts for install. This app does not do any other website requests.
6+
</div>
7+
</body>
8+
</html>

app/src/main/ic_launcher-web.png

28.9 KB
Loading
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
package me.anon.grow.helper;
2+
3+
import android.annotation.TargetApi;
4+
import android.app.Activity;
5+
import android.app.AlertDialog;
6+
import android.app.Fragment;
7+
import android.content.Context;
8+
import android.content.DialogInterface;
9+
import android.content.pm.PackageManager;
10+
import android.os.Build;
11+
import android.support.v4.content.PermissionChecker;
12+
13+
public class PermissionHelper
14+
{
15+
@TargetApi(Build.VERSION_CODES.M)
16+
public static boolean doPermissionCheck(final Fragment fragment, final String permission, final int requestCode, String dialogMessage)
17+
{
18+
if (PermissionChecker.checkSelfPermission(fragment.getActivity(), permission) != PackageManager.PERMISSION_GRANTED)
19+
{
20+
if (fragment.shouldShowRequestPermissionRationale(permission) && dialogMessage != null)
21+
{
22+
new AlertDialog.Builder(fragment.getActivity())
23+
.setMessage(dialogMessage)
24+
.setPositiveButton("OK", new DialogInterface.OnClickListener()
25+
{
26+
@Override public void onClick(DialogInterface dialog, int which)
27+
{
28+
fragment.requestPermissions(new String[]{permission}, requestCode);
29+
}
30+
})
31+
.setNegativeButton("Cancel", null)
32+
.show();
33+
34+
return false;
35+
}
36+
37+
fragment.requestPermissions(new String[]{permission}, requestCode);
38+
return false;
39+
}
40+
41+
return true;
42+
}
43+
44+
@TargetApi(Build.VERSION_CODES.M)
45+
public static boolean doPermissionCheck(final Activity activity, final String permission, final int requestCode, String dialogMessage)
46+
{
47+
if (PermissionChecker.checkSelfPermission(activity, permission) != PackageManager.PERMISSION_GRANTED)
48+
{
49+
if (activity.shouldShowRequestPermissionRationale(permission) && dialogMessage != null)
50+
{
51+
new AlertDialog.Builder(activity)
52+
.setMessage(dialogMessage)
53+
.setPositiveButton("OK", new DialogInterface.OnClickListener()
54+
{
55+
@Override public void onClick(DialogInterface dialog, int which)
56+
{
57+
activity.requestPermissions(new String[]{permission}, requestCode);
58+
}
59+
})
60+
.setNegativeButton("Cancel", null)
61+
.show();
62+
63+
return false;
64+
}
65+
66+
activity.requestPermissions(new String[]{permission}, requestCode);
67+
return false;
68+
}
69+
70+
return true;
71+
}
72+
73+
public static boolean hasPermission(Context context, String permission)
74+
{
75+
return Build.VERSION.SDK_INT < 23 || PermissionChecker.checkSelfPermission(context, permission) == PackageManager.PERMISSION_GRANTED;
76+
}
77+
}

0 commit comments

Comments
 (0)