Skip to content

Commit 9825ca5

Browse files
author
GauthamAsir
committed
Use Prebuilt Library for App Updates
Signed-off-by: GauthamAsir <gauthamasir@gmail.com>
1 parent 6111086 commit 9825ca5

File tree

28 files changed

+1050
-17
lines changed

28 files changed

+1050
-17
lines changed

.idea/gradle.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ android {
99
minSdkVersion 21
1010
targetSdkVersion 29
1111
versionCode 2
12-
versionName "2.7"
12+
versionName "2.6"
1313

1414
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1515
}
@@ -21,6 +21,11 @@ android {
2121
}
2222
}
2323

24+
compileOptions {
25+
sourceCompatibility JavaVersion.VERSION_1_8
26+
targetCompatibility JavaVersion.VERSION_1_8
27+
}
28+
2429
}
2530

2631
dependencies {
@@ -39,7 +44,6 @@ dependencies {
3944

4045
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.0.0'
4146
implementation 'de.hdodenhof:circleimageview:3.1.0'
42-
43-
implementation 'com.github.javiersantos:AppUpdater:2.7'
47+
implementation project(path: ':library')
4448

4549
}

app/src/main/AndroidManifest.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools"
34
package="a.gautham.statusdownloader">
45

56
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
@@ -28,10 +29,12 @@
2829
android:name="androidx.core.content.FileProvider"
2930
android:authorities="a.gautham.statusdownloader.provider"
3031
android:exported="false"
32+
tools:replace="android:authorities"
3133
android:grantUriPermissions="true">
3234
<meta-data
3335
android:name="android.support.FILE_PROVIDER_PATHS"
34-
android:resource="@xml/provider_paths" />
36+
android:resource="@xml/provider_paths"
37+
tools:replace="android:resource"/>
3538
</provider>
3639
</application>
3740

app/src/main/java/a/gautham/statusdownloader/MainActivity.java

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,15 @@
2020
import androidx.viewpager.widget.PagerAdapter;
2121
import androidx.viewpager.widget.ViewPager;
2222

23-
import com.github.javiersantos.appupdater.AppUpdater;
24-
import com.github.javiersantos.appupdater.enums.Display;
25-
import com.github.javiersantos.appupdater.enums.UpdateFrom;
2623
import com.google.android.material.appbar.MaterialToolbar;
2724
import com.google.android.material.snackbar.Snackbar;
2825
import com.google.android.material.tabs.TabLayout;
2926

3027
import java.io.File;
3128
import java.util.Objects;
3229

30+
import a.gautham.library.AppUpdater;
31+
import a.gautham.library.Display;
3332
import a.gautham.statusdownloader.Adapter.PageAdapter;
3433
import a.gautham.statusdownloader.Utils.Common;
3534

@@ -170,13 +169,9 @@ private class GetLatestAppVersion extends AsyncTask{
170169
@Override
171170
protected Object doInBackground(Object[] objects) {
172171

173-
final AppUpdater appUpdater = new AppUpdater(MainActivity.this)
174-
.setDisplay(Display.DIALOG)
175-
.setUpdateFrom(UpdateFrom.XML)
176-
.setUpdateXML("https://raw.githubusercontent.com/GauthamAsir/WhatsApp_Status_Saver/master/update.xml")
177-
.setCancelable(false)
178-
.setButtonDoNotShowAgain(null);
179-
172+
AppUpdater appUpdater = new AppUpdater(MainActivity.this);
173+
appUpdater.setDisplay(Display.DIALOG);
174+
appUpdater.setUpGithub("GauthamAsir","WhatsApp_Status_Saver");
180175
appUpdater.start();
181176

182177
return null;

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55
repositories {
66
google()
77
jcenter()
8-
8+
99
}
1010
dependencies {
1111
classpath 'com.android.tools.build:gradle:3.6.3'

library/.gitignore

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

library/build.gradle

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
apply plugin: 'com.android.library'
2+
3+
android {
4+
compileSdkVersion 29
5+
buildToolsVersion "29.0.3"
6+
7+
defaultConfig {
8+
minSdkVersion 21
9+
targetSdkVersion 29
10+
versionCode 1
11+
versionName "1.0"
12+
13+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
14+
consumerProguardFiles 'consumer-rules.pro'
15+
}
16+
17+
buildTypes {
18+
release {
19+
minifyEnabled false
20+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
21+
}
22+
}
23+
24+
compileOptions {
25+
sourceCompatibility JavaVersion.VERSION_1_8
26+
targetCompatibility JavaVersion.VERSION_1_8
27+
}
28+
29+
}
30+
31+
dependencies {
32+
implementation fileTree(dir: 'libs', include: ['*.jar'])
33+
34+
implementation 'androidx.appcompat:appcompat:1.1.0'
35+
testImplementation 'junit:junit:4.12'
36+
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
37+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
38+
39+
//RetroFit
40+
implementation 'com.squareup.retrofit2:retrofit:2.8.1'
41+
implementation 'com.squareup.retrofit2:converter-gson:2.8.1'
42+
43+
//Recycler View
44+
implementation 'androidx.recyclerview:recyclerview:1.1.0'
45+
46+
//Card View
47+
implementation 'androidx.cardview:cardview:1.0.0'
48+
49+
//Material Themes
50+
implementation 'com.google.android.material:material:1.1.0'
51+
52+
}

library/consumer-rules.pro

Whitespace-only changes.

library/proguard-rules.pro

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile

0 commit comments

Comments
 (0)