From 75a44fb30a241cf6f09d3fc3a7356fcf45627008 Mon Sep 17 00:00:00 2001 From: Kartikey Kushwaha Date: Sat, 11 Aug 2018 19:13:52 +0530 Subject: [PATCH 01/29] Added HTTPS request to get version data. Added APK flaor for github and fdroid. --- app/build.gradle | 17 +++ .../java/org/schabi/newpipe/MainActivity.java | 111 ++++++++++++++++++ build.gradle | 2 +- 3 files changed, 129 insertions(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index a5ff67bee..7264c0ab9 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -14,12 +14,14 @@ android { testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" vectorDrawables.useSupportLibrary = true } + buildTypes { release { minifyEnabled true shrinkResources true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } + debug { multiDexEnabled true @@ -34,10 +36,25 @@ android { // but continue the build even when errors are found: abortOnError false } + compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } + + flavorDimensions "apkSource" + productFlavors { + github { + dimension "apkSource" + applicationIdSuffix ".github" + + } + + fdroid { + dimension "apkSource" + applicationIdSuffix ".fdroid" + } + } } ext { diff --git a/app/src/main/java/org/schabi/newpipe/MainActivity.java b/app/src/main/java/org/schabi/newpipe/MainActivity.java index 0ce6772bb..4dba91706 100644 --- a/app/src/main/java/org/schabi/newpipe/MainActivity.java +++ b/app/src/main/java/org/schabi/newpipe/MainActivity.java @@ -24,6 +24,7 @@ import android.content.Intent; import android.content.SharedPreferences; import android.content.pm.PackageManager; import android.net.Uri; +import android.os.AsyncTask; import android.os.Bundle; import android.os.Handler; import android.os.Looper; @@ -47,6 +48,8 @@ import android.widget.Button; import android.widget.ImageButton; import android.widget.TextView; +import org.json.JSONException; +import org.json.JSONObject; import org.schabi.newpipe.extractor.NewPipe; import org.schabi.newpipe.extractor.StreamingService; import org.schabi.newpipe.fragments.BackPressable; @@ -61,6 +64,13 @@ import org.schabi.newpipe.util.ServiceHelper; import org.schabi.newpipe.util.StateSaver; import org.schabi.newpipe.util.ThemeHelper; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.HttpURLConnection; +import java.net.MalformedURLException; +import java.net.URL; + public class MainActivity extends AppCompatActivity { private static final String TAG = "MainActivity"; public static final boolean DEBUG = !BuildConfig.BUILD_TYPE.equals("release"); @@ -80,6 +90,10 @@ public class MainActivity extends AppCompatActivity { ThemeHelper.setTheme(this, ServiceHelper.getSelectedServiceId(this)); + if (BuildConfig.FLAVOR.equals("github")) { + new versionCheckTask().execute(); + } + super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); @@ -409,4 +423,101 @@ public class MainActivity extends AppCompatActivity { NavigationHelper.gotoMainFragment(getSupportFragmentManager()); } } + + /** + * AsyncTask to check if there is a newer version of the github apk available or not. + * If there is a newer version we show a notification, informing the user. On tapping + * the notification, the user will be directed to download link. + */ + private static class versionCheckTask extends AsyncTask { + + String newPipeApiUrl = "https://api.myjson.com/bins/19gx44"; + int timeoutPeriod = 10000; + + @Override + protected String doInBackground(Void... voids) { + + String output; + + HttpURLConnection connection = null; + + try { + + URL url = new URL(newPipeApiUrl); + + connection = (HttpURLConnection) url.openConnection(); + connection.setRequestMethod("GET"); + connection.setConnectTimeout(timeoutPeriod); + connection.setReadTimeout(timeoutPeriod); + connection.setRequestProperty("Content-length", "0"); + connection.setUseCaches(false); + connection.setAllowUserInteraction(false); + connection.connect(); + + int responseStatus = connection.getResponseCode(); + + switch (responseStatus) { + + case 200: + case 201: + BufferedReader bufferedReader + = new BufferedReader( + new InputStreamReader(connection.getInputStream())); + + StringBuilder stringBuilder = new StringBuilder(); + + String line; + + while ((line = bufferedReader.readLine()) != null) { + stringBuilder.append(line + "\n"); + } + + bufferedReader.close(); + output = stringBuilder.toString(); + + return output; + } + } catch (MalformedURLException ex) { + ex.printStackTrace(); + } catch (IOException ex) { + ex.printStackTrace(); + } finally { + if (connection != null) { + try { + connection.disconnect(); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + } + + return null; + } + + @Override + protected void onPostExecute(String output) { + + if (output != null) { + + Log.i("output---", output); + + try { + JSONObject mainObject = new JSONObject(output); + JSONObject flavoursObject = mainObject.getJSONObject("flavors"); + JSONObject githubObject = flavoursObject.getJSONObject("github"); + JSONObject githubStableObject = githubObject.getJSONObject("stable"); + + String version = githubStableObject.getString("version"); + // String versionCode = githubStableObject.getString("version_code"); + String apkLocationUrl = githubStableObject.getString("apk"); + + Log.i("jsonConvert---", version + " " + apkLocationUrl); + } catch (JSONException ex) { + ex.printStackTrace(); + } + } + } + } + + } diff --git a/build.gradle b/build.gradle index a45c00aef..20c8a0dfc 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:3.1.2' + classpath 'com.android.tools.build:gradle:3.1.4' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files From 5e2aa51627846afbf86fd8c34e94c4b09628cd5b Mon Sep 17 00:00:00 2001 From: Kartikey Kushwaha Date: Sat, 11 Aug 2018 19:36:23 +0530 Subject: [PATCH 02/29] Moved the asynctask to its own class. --- .../schabi/newpipe/FetchAppVersionTask.java | 118 ++++++++++++++++++ .../java/org/schabi/newpipe/MainActivity.java | 109 +--------------- 2 files changed, 119 insertions(+), 108 deletions(-) create mode 100644 app/src/main/java/org/schabi/newpipe/FetchAppVersionTask.java diff --git a/app/src/main/java/org/schabi/newpipe/FetchAppVersionTask.java b/app/src/main/java/org/schabi/newpipe/FetchAppVersionTask.java new file mode 100644 index 000000000..2f98fe1ad --- /dev/null +++ b/app/src/main/java/org/schabi/newpipe/FetchAppVersionTask.java @@ -0,0 +1,118 @@ +package org.schabi.newpipe; + +import android.os.AsyncTask; +import android.util.Log; + +import org.json.JSONException; +import org.json.JSONObject; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.HttpURLConnection; +import java.net.MalformedURLException; +import java.net.URL; + +/** + * AsyncTask to check if there is a newer version of the github apk available or not. + * If there is a newer version we show a notification, informing the user. On tapping + * the notification, the user will be directed to download link. + */ +public class FetchAppVersionTask extends AsyncTask { + + private String newPipeApiUrl = "https://newpipe.schabi.org/api/data.json"; + private int timeoutPeriod = 10000; + + @Override + protected String doInBackground(Void... voids) { + + String output; + + HttpURLConnection connection = null; + + try { + + URL url = new URL(newPipeApiUrl); + + connection = (HttpURLConnection) url.openConnection(); + connection.setRequestMethod("GET"); + connection.setConnectTimeout(timeoutPeriod); + connection.setReadTimeout(timeoutPeriod); + connection.setRequestProperty("Content-length", "0"); + connection.setUseCaches(false); + connection.setAllowUserInteraction(false); + connection.connect(); + + int responseStatus = connection.getResponseCode(); + + switch (responseStatus) { + + case 200: + case 201: + BufferedReader bufferedReader + = new BufferedReader( + new InputStreamReader(connection.getInputStream())); + + StringBuilder stringBuilder = new StringBuilder(); + + String line; + + while ((line = bufferedReader.readLine()) != null) { + stringBuilder.append(line + "\n"); + } + + bufferedReader.close(); + output = stringBuilder.toString(); + + return output; + } + } catch (MalformedURLException ex) { + ex.printStackTrace(); + } catch (IOException ex) { + ex.printStackTrace(); + } finally { + if (connection != null) { + try { + connection.disconnect(); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + } + + return null; + } + + @Override + protected void onPostExecute(String output) { + + if (output != null) { + + Log.i("output---", output); + + try { + JSONObject mainObject = new JSONObject(output); + JSONObject flavoursObject = mainObject.getJSONObject("flavors"); + JSONObject githubObject = flavoursObject.getJSONObject("github"); + JSONObject githubStableObject = githubObject.getJSONObject("stable"); + + String versionName = githubStableObject.getString("version"); + // String versionCode = githubStableObject.getString("version_code"); + String apkLocationUrl = githubStableObject.getString("apk"); + + compareAppVersionAndShowNotification(versionName, apkLocationUrl); + + } catch (JSONException ex) { + ex.printStackTrace(); + } + } + } + + private void compareAppVersionAndShowNotification(String versionName, String apkLocationUrl) { + + if (!BuildConfig.VERSION_NAME.equals(versionName)) { + + + } + } +} diff --git a/app/src/main/java/org/schabi/newpipe/MainActivity.java b/app/src/main/java/org/schabi/newpipe/MainActivity.java index 4dba91706..1554dddc0 100644 --- a/app/src/main/java/org/schabi/newpipe/MainActivity.java +++ b/app/src/main/java/org/schabi/newpipe/MainActivity.java @@ -24,7 +24,6 @@ import android.content.Intent; import android.content.SharedPreferences; import android.content.pm.PackageManager; import android.net.Uri; -import android.os.AsyncTask; import android.os.Bundle; import android.os.Handler; import android.os.Looper; @@ -48,8 +47,6 @@ import android.widget.Button; import android.widget.ImageButton; import android.widget.TextView; -import org.json.JSONException; -import org.json.JSONObject; import org.schabi.newpipe.extractor.NewPipe; import org.schabi.newpipe.extractor.StreamingService; import org.schabi.newpipe.fragments.BackPressable; @@ -64,13 +61,6 @@ import org.schabi.newpipe.util.ServiceHelper; import org.schabi.newpipe.util.StateSaver; import org.schabi.newpipe.util.ThemeHelper; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.net.HttpURLConnection; -import java.net.MalformedURLException; -import java.net.URL; - public class MainActivity extends AppCompatActivity { private static final String TAG = "MainActivity"; public static final boolean DEBUG = !BuildConfig.BUILD_TYPE.equals("release"); @@ -91,7 +81,7 @@ public class MainActivity extends AppCompatActivity { ThemeHelper.setTheme(this, ServiceHelper.getSelectedServiceId(this)); if (BuildConfig.FLAVOR.equals("github")) { - new versionCheckTask().execute(); + new FetchAppVersionTask().execute(); } super.onCreate(savedInstanceState); @@ -423,101 +413,4 @@ public class MainActivity extends AppCompatActivity { NavigationHelper.gotoMainFragment(getSupportFragmentManager()); } } - - /** - * AsyncTask to check if there is a newer version of the github apk available or not. - * If there is a newer version we show a notification, informing the user. On tapping - * the notification, the user will be directed to download link. - */ - private static class versionCheckTask extends AsyncTask { - - String newPipeApiUrl = "https://api.myjson.com/bins/19gx44"; - int timeoutPeriod = 10000; - - @Override - protected String doInBackground(Void... voids) { - - String output; - - HttpURLConnection connection = null; - - try { - - URL url = new URL(newPipeApiUrl); - - connection = (HttpURLConnection) url.openConnection(); - connection.setRequestMethod("GET"); - connection.setConnectTimeout(timeoutPeriod); - connection.setReadTimeout(timeoutPeriod); - connection.setRequestProperty("Content-length", "0"); - connection.setUseCaches(false); - connection.setAllowUserInteraction(false); - connection.connect(); - - int responseStatus = connection.getResponseCode(); - - switch (responseStatus) { - - case 200: - case 201: - BufferedReader bufferedReader - = new BufferedReader( - new InputStreamReader(connection.getInputStream())); - - StringBuilder stringBuilder = new StringBuilder(); - - String line; - - while ((line = bufferedReader.readLine()) != null) { - stringBuilder.append(line + "\n"); - } - - bufferedReader.close(); - output = stringBuilder.toString(); - - return output; - } - } catch (MalformedURLException ex) { - ex.printStackTrace(); - } catch (IOException ex) { - ex.printStackTrace(); - } finally { - if (connection != null) { - try { - connection.disconnect(); - } catch (Exception ex) { - ex.printStackTrace(); - } - } - } - - return null; - } - - @Override - protected void onPostExecute(String output) { - - if (output != null) { - - Log.i("output---", output); - - try { - JSONObject mainObject = new JSONObject(output); - JSONObject flavoursObject = mainObject.getJSONObject("flavors"); - JSONObject githubObject = flavoursObject.getJSONObject("github"); - JSONObject githubStableObject = githubObject.getJSONObject("stable"); - - String version = githubStableObject.getString("version"); - // String versionCode = githubStableObject.getString("version_code"); - String apkLocationUrl = githubStableObject.getString("apk"); - - Log.i("jsonConvert---", version + " " + apkLocationUrl); - } catch (JSONException ex) { - ex.printStackTrace(); - } - } - } - } - - } From f85e19c75defdabdc391cd792d73c6d14ef65852 Mon Sep 17 00:00:00 2001 From: Kartikey Kushwaha Date: Sun, 12 Aug 2018 15:01:50 +0530 Subject: [PATCH 03/29] Added notification channel and code to show notification. --- app/src/main/java/org/schabi/newpipe/App.java | 23 ++++++++++++ .../schabi/newpipe/FetchAppVersionTask.java | 37 +++++++++++++++++-- app/src/main/res/values/strings.xml | 8 ++++ 3 files changed, 64 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/App.java b/app/src/main/java/org/schabi/newpipe/App.java index f436a26b8..77c6b6cb0 100644 --- a/app/src/main/java/org/schabi/newpipe/App.java +++ b/app/src/main/java/org/schabi/newpipe/App.java @@ -63,6 +63,7 @@ import io.reactivex.plugins.RxJavaPlugins; public class App extends Application { protected static final String TAG = App.class.toString(); private RefWatcher refWatcher; + private static App context; @SuppressWarnings("unchecked") private static final Class[] reportSenderFactoryClasses = new Class[]{AcraReportSenderFactory.class}; @@ -85,6 +86,8 @@ public class App extends Application { } refWatcher = installLeakCanary(); + context = this; + // Initialize settings first because others inits can use its values SettingsActivity.initSettings(this); @@ -202,6 +205,22 @@ public class App extends Application { NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); mNotificationManager.createNotificationChannel(mChannel); + + // Set up notification channel for app update + final String appUpdateId + = getString(R.string.app_update_notification_channel_id); + final CharSequence appUpdateName + = getString(R.string.app_update_notification_channel_name); + final String appUpdateDescription + = getString(R.string.app_update_notification_channel_description); + + NotificationChannel appUpdateChannel + = new NotificationChannel(appUpdateId, appUpdateName, importance); + appUpdateChannel.setDescription(appUpdateDescription); + + NotificationManager appUpdateNotificationManager + = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + appUpdateNotificationManager.createNotificationChannel(appUpdateChannel); } @Nullable @@ -217,4 +236,8 @@ public class App extends Application { protected boolean isDisposedRxExceptionsReported() { return false; } + + public static App getContext() { + return context; + } } diff --git a/app/src/main/java/org/schabi/newpipe/FetchAppVersionTask.java b/app/src/main/java/org/schabi/newpipe/FetchAppVersionTask.java index 2f98fe1ad..75da96096 100644 --- a/app/src/main/java/org/schabi/newpipe/FetchAppVersionTask.java +++ b/app/src/main/java/org/schabi/newpipe/FetchAppVersionTask.java @@ -1,7 +1,12 @@ package org.schabi.newpipe; +import android.app.Application; +import android.app.PendingIntent; +import android.content.Intent; +import android.net.Uri; import android.os.AsyncTask; -import android.util.Log; +import android.support.v4.app.NotificationCompat; +import android.support.v4.app.NotificationManagerCompat; import org.json.JSONException; import org.json.JSONObject; @@ -88,8 +93,6 @@ public class FetchAppVersionTask extends AsyncTask { if (output != null) { - Log.i("output---", output); - try { JSONObject mainObject = new JSONObject(output); JSONObject flavoursObject = mainObject.getJSONObject("flavors"); @@ -108,11 +111,37 @@ public class FetchAppVersionTask extends AsyncTask { } } + /** + * Method to compare + * @param versionName + * @param apkLocationUrl + */ private void compareAppVersionAndShowNotification(String versionName, String apkLocationUrl) { - if (!BuildConfig.VERSION_NAME.equals(versionName)) { + int NOTIFICATION_ID = 2000; + if (!BuildConfig.VERSION_NAME.equals(versionName.replace("v", ""))) { + Application app = App.getContext(); + + Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(apkLocationUrl)); + PendingIntent pendingIntent + = PendingIntent.getActivity(app, 0, intent, 0); + + NotificationCompat.Builder notificationBuilder = new NotificationCompat + .Builder(app, app.getString(R.string.app_update_notification_channel_id)) + .setSmallIcon(R.drawable.ic_newpipe_triangle_white) + .setVisibility(NotificationCompat.VISIBILITY_PUBLIC) + .setContentIntent(pendingIntent) + .setAutoCancel(true) + .setContentTitle(app.getString(R.string.app_update_notification_content_title)) + .setContentText(app.getString(R.string.app_update_notification_content_text) + + " " + versionName); + + NotificationManagerCompat notificationManager = NotificationManagerCompat.from(app); + + // notificationId is a unique int for each notification that you must define + notificationManager.notify(NOTIFICATION_ID, notificationBuilder.build()); } } } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 5ee80536f..6ad772494 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -144,6 +144,10 @@ NewPipe Notification Notifications for NewPipe Background and Popup Players + newpipeAppUpdate + App Update Notification + Notifications for new NewPipe version + [Unknown] Toggle Orientation @@ -504,4 +508,8 @@ 144p + + NewPipe Update Available + Tap to download + From 06f20c66f8fc3f66cd255f13d5f9ab1e9b1ec384 Mon Sep 17 00:00:00 2001 From: Kartikey Kushwaha Date: Sun, 12 Aug 2018 16:35:53 +0530 Subject: [PATCH 04/29] Moved the new version check to the application class. --- app/src/main/java/org/schabi/newpipe/App.java | 5 +++++ .../main/java/org/schabi/newpipe/FetchAppVersionTask.java | 1 + app/src/main/java/org/schabi/newpipe/MainActivity.java | 4 ---- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/App.java b/app/src/main/java/org/schabi/newpipe/App.java index 77c6b6cb0..0a218d061 100644 --- a/app/src/main/java/org/schabi/newpipe/App.java +++ b/app/src/main/java/org/schabi/newpipe/App.java @@ -99,6 +99,11 @@ public class App extends Application { ImageLoader.getInstance().init(getImageLoaderConfigurations(10, 50)); configureRxJavaErrorHandler(); + + // Check for new version + if (BuildConfig.FLAVOR.equals("github")) { + new FetchAppVersionTask().execute(); + } } protected Downloader getDownloader() { diff --git a/app/src/main/java/org/schabi/newpipe/FetchAppVersionTask.java b/app/src/main/java/org/schabi/newpipe/FetchAppVersionTask.java index 75da96096..d56e07127 100644 --- a/app/src/main/java/org/schabi/newpipe/FetchAppVersionTask.java +++ b/app/src/main/java/org/schabi/newpipe/FetchAppVersionTask.java @@ -124,6 +124,7 @@ public class FetchAppVersionTask extends AsyncTask { Application app = App.getContext(); + // A pending intent to open the apk location url in the browser. Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(apkLocationUrl)); PendingIntent pendingIntent = PendingIntent.getActivity(app, 0, intent, 0); diff --git a/app/src/main/java/org/schabi/newpipe/MainActivity.java b/app/src/main/java/org/schabi/newpipe/MainActivity.java index 1554dddc0..0ce6772bb 100644 --- a/app/src/main/java/org/schabi/newpipe/MainActivity.java +++ b/app/src/main/java/org/schabi/newpipe/MainActivity.java @@ -80,10 +80,6 @@ public class MainActivity extends AppCompatActivity { ThemeHelper.setTheme(this, ServiceHelper.getSelectedServiceId(this)); - if (BuildConfig.FLAVOR.equals("github")) { - new FetchAppVersionTask().execute(); - } - super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); From 930c971035f425e3d692f0c1debb295513aa4b15 Mon Sep 17 00:00:00 2001 From: Kartikey Kushwaha Date: Sun, 12 Aug 2018 16:41:21 +0530 Subject: [PATCH 05/29] Added version check in the pop-up player --- .../java/org/schabi/newpipe/player/PopupVideoPlayer.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java b/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java index 8107345a1..a4c91cd30 100644 --- a/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java +++ b/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java @@ -58,6 +58,7 @@ import com.google.android.exoplayer2.ui.AspectRatioFrameLayout; import com.google.android.exoplayer2.ui.SubtitleView; import org.schabi.newpipe.BuildConfig; +import org.schabi.newpipe.FetchAppVersionTask; import org.schabi.newpipe.R; import org.schabi.newpipe.extractor.stream.StreamInfo; import org.schabi.newpipe.extractor.stream.VideoStream; @@ -663,6 +664,11 @@ public final class PopupVideoPlayer extends Service { lockManager.acquireWifiAndCpu(); hideControls(DEFAULT_CONTROLS_DURATION, DEFAULT_CONTROLS_HIDE_TIME); + + // Check for new version + if (BuildConfig.FLAVOR.equals("github")) { + new FetchAppVersionTask().execute(); + } } @Override From 12b93d66377b57e4bbfc7a1cd1556a7f21ab676f Mon Sep 17 00:00:00 2001 From: Kartikey Kushwaha Date: Sun, 12 Aug 2018 17:18:46 +0530 Subject: [PATCH 06/29] Added new icon for update notification. --- .../org/schabi/newpipe/FetchAppVersionTask.java | 2 +- .../main/res/drawable-hdpi/ic_newpipe_update.png | Bin 0 -> 680 bytes .../main/res/drawable-mdpi/ic_newpipe_update.png | Bin 0 -> 401 bytes .../res/drawable-xhdpi/ic_newpipe_update.png | Bin 0 -> 734 bytes .../res/drawable-xxhdpi/ic_newpipe_update.png | Bin 0 -> 1370 bytes .../res/drawable-xxxhdpi/ic_newpipe_update.png | Bin 0 -> 2177 bytes 6 files changed, 1 insertion(+), 1 deletion(-) create mode 100755 app/src/main/res/drawable-hdpi/ic_newpipe_update.png create mode 100755 app/src/main/res/drawable-mdpi/ic_newpipe_update.png create mode 100755 app/src/main/res/drawable-xhdpi/ic_newpipe_update.png create mode 100755 app/src/main/res/drawable-xxhdpi/ic_newpipe_update.png create mode 100755 app/src/main/res/drawable-xxxhdpi/ic_newpipe_update.png diff --git a/app/src/main/java/org/schabi/newpipe/FetchAppVersionTask.java b/app/src/main/java/org/schabi/newpipe/FetchAppVersionTask.java index d56e07127..3130dc655 100644 --- a/app/src/main/java/org/schabi/newpipe/FetchAppVersionTask.java +++ b/app/src/main/java/org/schabi/newpipe/FetchAppVersionTask.java @@ -131,7 +131,7 @@ public class FetchAppVersionTask extends AsyncTask { NotificationCompat.Builder notificationBuilder = new NotificationCompat .Builder(app, app.getString(R.string.app_update_notification_channel_id)) - .setSmallIcon(R.drawable.ic_newpipe_triangle_white) + .setSmallIcon(R.drawable.ic_newpipe_update) .setVisibility(NotificationCompat.VISIBILITY_PUBLIC) .setContentIntent(pendingIntent) .setAutoCancel(true) diff --git a/app/src/main/res/drawable-hdpi/ic_newpipe_update.png b/app/src/main/res/drawable-hdpi/ic_newpipe_update.png new file mode 100755 index 0000000000000000000000000000000000000000..cbf336a1f173c751889af7f1a0164edb045c82d9 GIT binary patch literal 680 zcmV;Z0$2TsP)l zsW^T3lkhj-|}{4v?F6wr|V;0X?)u@-=mx`#!z1O)v!j};hS z3qUZ4r#Mp8G?oD*w&_DRHmXK7W&m~LR|aT5E~@l3kpZ+0d+|W1xd)u6nSkB0w?BX}pr%MvCbT z=2QZxBhT;o)P;rd(=IgNqy}-k5OS~kJzqNxN(#Eg;SWGirt2XDcifU+DM5&+ptrddo086 zlzk6QBz#s0Gg4AHVT74FQlR>j&lKGDzXpVgTqvX_9diKt3c?fs$_Y7d&G4zicKN5s zKlq&IJv_pUa)A1TmQb__Vg}C1UrG7&9LqCdQb6Ca2Q!uU*9@i!hdHaK<%EO0vXqz+ zCJW`+T#`fn7;U(Mm-vWJLYsIjd{`E~2&*O3qeZB$)x!7Mq)`W{g#G~=P}v~1B^9y& O0000*Ius2C3<`nbKafxXrl|oO9tSv} zRSlvv0UFo`v9rnaa%Z!5+2wO{&NufxbLO5Ym7YuJ##B22y{KRZZ`%ogJFMYNy8ty^ zVj3^n1*qu=?^_MH&p;~JL{F;#^EghNY6hK81q_GyXZ*>5Tw`toA literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xhdpi/ic_newpipe_update.png b/app/src/main/res/drawable-xhdpi/ic_newpipe_update.png new file mode 100755 index 0000000000000000000000000000000000000000..5ee02aaa9359524b5a83988ddd54724dbef58854 GIT binary patch literal 734 zcmV<40wMj0P)dQcBIjU}J@%q+}^2AyQI|5*sTkQfd~Ig^j#rDP(~( zE0nj!TbIFnEY7_;-R?Pao_o)|=T7-9PtWsze&5@3&-tI{luG~UKrjp4MdxT3tidq0 zVRF%Vf~g3MiMWsD=qfr_W@-fBH_l;B(b+OlN1#d>n=rlTjH#puRC$NRMdwT;gFuy= zMQ5!`fWR1jVkagQo%I zXXO{}VOggL?7|dm#m4}V@3?@T!UbaEdT<)w0z}?mH>MUY5F6iz8yL+fF@`6Vb@Fc# zLj_{j;6^{1f;TAn^y=<<%rMD^RJ?jUiDho|Tta(-8u(TB}8EM#ytz zNHgyqc?wkObzvWV1W5eGevLfM^A?EJosMe(5-@@lg$rO3F3EnYRT(=Vv{lbrKy-T@ z2?!2nHF~s@mjG7cMM|wCUSml^;qwp>9gJNS_NT4o3%0aXK(x;f;X}&&5Wb_oEduD* z*mfC@x0ul~0rcXss2yk(7h5T?E@f;Yb=JI{GW@-euC)UNVBJI)xX^BaRH+68?zBsw zjEka|`C5)-SbHWO*O~jU)dGJ+ZS%s)^>+#L52mc!jb{n-uC!9%3kGVg-%FSeC+n;^ z4bM~NWItaD6zEN;aV#YaoT?c=oHDkoRkzWU8ncc6I(affc(|K6d|m>TI%mcSM${^# zF^WZb2#n&mfRi=RpYmx2i8PJ|g-;N;j-|ncqFVEfzeSQ5Y-G*2z%Vvw^7IUID?dV3 z%GlG)f~&Asj$i9V?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n&iO-TzVvj0;zZYqnS z+M6yAW8UldTI3+^6`31-V#B*0FN+syx-;uFWkoCnCW@@HGjT4?6SuT;MJ~|^MaS8p cLx-062ZvJ(o>WhTC;$Ke07*qoM6N<$f`%81KmY&$ literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xxxhdpi/ic_newpipe_update.png b/app/src/main/res/drawable-xxxhdpi/ic_newpipe_update.png new file mode 100755 index 0000000000000000000000000000000000000000..1f44c1aaf28c6773c1125ab7c6a0692c7c76b81c GIT binary patch literal 2177 zcmV-{2!8j8P)asI5TDR=Q1R=Hnl~`!dgQrt{{#d+vSj&HW~m`RC=H-}!y- z`JHpVzu!6cpo1z@s8FFog$nHr9D-AEM%lKEOW-hEgiTn3#bw(xu7KIN82hmk_hU6? zmTlX(Kpg@77|4j&hF@Ss+4glkh7eH00QO)DevDUPdfB#iB}O2i9?#--T!o`Bp=_JG z3Jnkdeb|Z(Sc&5>xoq3J0u2&SLq8tCI-HH?m2H2=V~hk4^TTf3h|6)BYJO-QO%PCz zZMXrK;02gec7Hk!EfP?}{rC>vf}_jsQ%4~u0^m8^g)if^m{E4$Is!QoP{R)V3LnNI zOf0*PZH)v35WDFu_&LtUT-E$AJQ5L5!(I`VzJg_Ve%bwPJ0vE6Shn`!4txZQRrA9j z3Lv0{n#i{f7h;}jekhcHdThn#@fsXiwhu~0NdydF7w*KTvCw$kO_xMKJ$7R~mSev0 z7M9w809o5lh}^^JLiQdX%U10{Kn;B&H@#YH;(By@{z3Bu>=NOlFGm7u=)*?5Q-q~y zx|Imc6L1TDhljCGOssih2YxDY4~OfcybI!l<1F>xFjM`R-38-u5 zV6m28hCfQPfvbspkKk*ffULbYa0()zuD$7E;{2!x8!6B)Lf#)lZuL3Ed z#QciP-VM@?fL<{IJ}as-#`g#iLf(r+sry=?dZrNbcH^%i(X&LzCF6Sz5Y9hW$O!j| zU2+OMjh~59m}89hRgh3kPZi6;yT!&SZ`9=LTf{;1d5V^=wHW~-ojFguiPwpZQmToz zU(_D05u32$a|hal0I|9`5^oUlKuX8gV<2nmYP?d>d1WONARK>)SZ`k{j=c6M#`!~W zoj7&?0_=!0aHY{IX~-sJK$z)2sbluGOiTK^LE90yjbexr~(KOj-MuKIzNbqnrN>KT!|w(ngAgm%oa(Hb)tx> zQ}7I4rxT?JgKzy}agoRF{QOcV*5M_cNWd(-N7QbnIyX=RdW9mIW)w(Az+7=fK~c`X zWR!j`Y2n#F!Tj8vpBYvWFgmv4wA`Ja8CDT6I{NWmDGGj71T=~@SWpo#GEx)pYn)OM zFfvjTa37Xb1dNQ-1U!Lrx|M(dt&4G~3D|=-bsGV-WXNwv`CUD35PH&iL;empK^l}p z>i^y*cDjvVAC`3s0R!Sv@LNTF&sljy`}fMG?@OIqn*)5Kf<%{q`tv z-^5t(kSLs*JI4Ob6mR}moKI9xzq&T!fw>zda1!9Ao@p@qPvGRDkT9|;V+{0{>_**!f$)TO^VIn0elk2jndCUh4b%dvYjh% zY>Vz5*059r94=z~avbjfH86_8SE4?Cr<*Ei`PVkE3KWF&~Z#7f-O!n1G3q842}V#nL1FzaBvTWdwP4~lR!KYQj8 z!ufZ$@XS6De$wQIwGROkM5x->g0mPL2`3BZ-`e8yHsMUED(18a0hujRgzmmaYtqC& zL|I8IZ$7d6{fv|!rO@0rWcJ~!n3KSs8RD>Z%FCV_#ckq9RJsG*#zsJ|7?RhDn*E;9 zTWHFr(?uvsaR{SPJSZJ1nd-> zmoJGz+CuJE5CvVI5*ksFBoZ67=0HTv@lOefVyQB2T@(u82Mk_#*S4RY5+`Xc76RYS?4=ni5jDr}GAL=6 z_p<50Z^{dOXNCCa^foba_ll8G3#GNc{*0)-nbWu9&*FnZ`uRH5NH^t}c4L00000NkvXXu0mjf DUcmjm literal 0 HcmV?d00001 From af42e32ae6ef75cc1ae143694f79640ddf45e6de Mon Sep 17 00:00:00 2001 From: Kartikey Kushwaha Date: Sun, 12 Aug 2018 18:34:20 +0530 Subject: [PATCH 07/29] Code refactored and added comments. --- app/src/main/java/org/schabi/newpipe/App.java | 4 +-- ...sk.java => CheckForNewAppVersionTask.java} | 34 +++++++++++++------ .../newpipe/player/PopupVideoPlayer.java | 6 ++-- 3 files changed, 26 insertions(+), 18 deletions(-) rename app/src/main/java/org/schabi/newpipe/{FetchAppVersionTask.java => CheckForNewAppVersionTask.java} (80%) diff --git a/app/src/main/java/org/schabi/newpipe/App.java b/app/src/main/java/org/schabi/newpipe/App.java index 0a218d061..fe64d95fb 100644 --- a/app/src/main/java/org/schabi/newpipe/App.java +++ b/app/src/main/java/org/schabi/newpipe/App.java @@ -101,9 +101,7 @@ public class App extends Application { configureRxJavaErrorHandler(); // Check for new version - if (BuildConfig.FLAVOR.equals("github")) { - new FetchAppVersionTask().execute(); - } + new CheckForNewAppVersionTask().execute(); } protected Downloader getDownloader() { diff --git a/app/src/main/java/org/schabi/newpipe/FetchAppVersionTask.java b/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java similarity index 80% rename from app/src/main/java/org/schabi/newpipe/FetchAppVersionTask.java rename to app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java index 3130dc655..2be4712a7 100644 --- a/app/src/main/java/org/schabi/newpipe/FetchAppVersionTask.java +++ b/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java @@ -19,20 +19,29 @@ import java.net.MalformedURLException; import java.net.URL; /** - * AsyncTask to check if there is a newer version of the github apk available or not. + * AsyncTask to check if there is a newer version of the NewPipe github apk available or not. * If there is a newer version we show a notification, informing the user. On tapping - * the notification, the user will be directed to download link. + * the notification, the user will be directed to the download link. */ -public class FetchAppVersionTask extends AsyncTask { +public class CheckForNewAppVersionTask extends AsyncTask { private String newPipeApiUrl = "https://newpipe.schabi.org/api/data.json"; private int timeoutPeriod = 10000; + @Override + protected void onPreExecute() { + // Continue with version check only if the build variant is of type "github". + if (!BuildConfig.FLAVOR.equals("github")) { + this.cancel(true); + } + } + @Override protected String doInBackground(Void... voids) { - String output; + // Make a network request to get latest NewPipe data. + String response; HttpURLConnection connection = null; try { @@ -63,13 +72,14 @@ public class FetchAppVersionTask extends AsyncTask { String line; while ((line = bufferedReader.readLine()) != null) { - stringBuilder.append(line + "\n"); + stringBuilder.append(line); + stringBuilder.append("\n"); } bufferedReader.close(); - output = stringBuilder.toString(); + response = stringBuilder.toString(); - return output; + return response; } } catch (MalformedURLException ex) { ex.printStackTrace(); @@ -89,12 +99,13 @@ public class FetchAppVersionTask extends AsyncTask { } @Override - protected void onPostExecute(String output) { + protected void onPostExecute(String response) { - if (output != null) { + // Parse the json from the response. + if (response != null) { try { - JSONObject mainObject = new JSONObject(output); + JSONObject mainObject = new JSONObject(response); JSONObject flavoursObject = mainObject.getJSONObject("flavors"); JSONObject githubObject = flavoursObject.getJSONObject("github"); JSONObject githubStableObject = githubObject.getJSONObject("stable"); @@ -112,7 +123,8 @@ public class FetchAppVersionTask extends AsyncTask { } /** - * Method to compare + * Method to compare the current and latest available app version. + * If a newer version is available, we show the update notification. * @param versionName * @param apkLocationUrl */ diff --git a/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java b/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java index a4c91cd30..2c233f219 100644 --- a/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java +++ b/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java @@ -58,7 +58,7 @@ import com.google.android.exoplayer2.ui.AspectRatioFrameLayout; import com.google.android.exoplayer2.ui.SubtitleView; import org.schabi.newpipe.BuildConfig; -import org.schabi.newpipe.FetchAppVersionTask; +import org.schabi.newpipe.CheckForNewAppVersionTask; import org.schabi.newpipe.R; import org.schabi.newpipe.extractor.stream.StreamInfo; import org.schabi.newpipe.extractor.stream.VideoStream; @@ -666,9 +666,7 @@ public final class PopupVideoPlayer extends Service { hideControls(DEFAULT_CONTROLS_DURATION, DEFAULT_CONTROLS_HIDE_TIME); // Check for new version - if (BuildConfig.FLAVOR.equals("github")) { - new FetchAppVersionTask().execute(); - } + new CheckForNewAppVersionTask().execute(); } @Override From 2a18eacf622e71226aa7216183ab1096ff288153 Mon Sep 17 00:00:00 2001 From: Kartikey Kushwaha Date: Sun, 12 Aug 2018 20:57:30 +0530 Subject: [PATCH 08/29] More refactoring. --- .../org/schabi/newpipe/CheckForNewAppVersionTask.java | 11 ++++------- app/src/main/res/values/strings.xml | 4 ++++ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java b/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java index 2be4712a7..134fb3406 100644 --- a/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java +++ b/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java @@ -25,13 +25,15 @@ import java.net.URL; */ public class CheckForNewAppVersionTask extends AsyncTask { + private Application app = App.getContext(); + private String newPipeApiUrl = "https://newpipe.schabi.org/api/data.json"; private int timeoutPeriod = 10000; @Override protected void onPreExecute() { // Continue with version check only if the build variant is of type "github". - if (!BuildConfig.FLAVOR.equals("github")) { + if (!BuildConfig.FLAVOR.equals(app.getString(R.string.app_flavor_github))) { this.cancel(true); } } @@ -63,8 +65,7 @@ public class CheckForNewAppVersionTask extends AsyncTask { case 200: case 201: - BufferedReader bufferedReader - = new BufferedReader( + BufferedReader bufferedReader = new BufferedReader( new InputStreamReader(connection.getInputStream())); StringBuilder stringBuilder = new StringBuilder(); @@ -134,8 +135,6 @@ public class CheckForNewAppVersionTask extends AsyncTask { if (!BuildConfig.VERSION_NAME.equals(versionName.replace("v", ""))) { - Application app = App.getContext(); - // A pending intent to open the apk location url in the browser. Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(apkLocationUrl)); PendingIntent pendingIntent @@ -152,8 +151,6 @@ public class CheckForNewAppVersionTask extends AsyncTask { + " " + versionName); NotificationManagerCompat notificationManager = NotificationManagerCompat.from(app); - - // notificationId is a unique int for each notification that you must define notificationManager.notify(NOTIFICATION_ID, notificationBuilder.build()); } } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 6ad772494..f83324845 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -512,4 +512,8 @@ NewPipe Update Available Tap to download + + github + fdroid + From e7abeb5ad91afb700f0d914ea1906a5c05f18b89 Mon Sep 17 00:00:00 2001 From: Kartikey Kushwaha Date: Fri, 17 Aug 2018 00:53:42 +0530 Subject: [PATCH 09/29] Added version code check. --- app/src/main/java/org/schabi/newpipe/App.java | 30 +++++++++++-------- .../newpipe/CheckForNewAppVersionTask.java | 10 ++++--- 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/App.java b/app/src/main/java/org/schabi/newpipe/App.java index fe64d95fb..a9002fda2 100644 --- a/app/src/main/java/org/schabi/newpipe/App.java +++ b/app/src/main/java/org/schabi/newpipe/App.java @@ -209,21 +209,25 @@ public class App extends Application { NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); mNotificationManager.createNotificationChannel(mChannel); - // Set up notification channel for app update - final String appUpdateId - = getString(R.string.app_update_notification_channel_id); - final CharSequence appUpdateName - = getString(R.string.app_update_notification_channel_name); - final String appUpdateDescription - = getString(R.string.app_update_notification_channel_description); + // Set up notification channel for app update only if it's a github apk. - NotificationChannel appUpdateChannel - = new NotificationChannel(appUpdateId, appUpdateName, importance); - appUpdateChannel.setDescription(appUpdateDescription); + if (!BuildConfig.FLAVOR.equals(getString(R.string.app_flavor_github))) { - NotificationManager appUpdateNotificationManager - = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); - appUpdateNotificationManager.createNotificationChannel(appUpdateChannel); + final String appUpdateId + = getString(R.string.app_update_notification_channel_id); + final CharSequence appUpdateName + = getString(R.string.app_update_notification_channel_name); + final String appUpdateDescription + = getString(R.string.app_update_notification_channel_description); + + NotificationChannel appUpdateChannel + = new NotificationChannel(appUpdateId, appUpdateName, importance); + appUpdateChannel.setDescription(appUpdateDescription); + + NotificationManager appUpdateNotificationManager + = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + appUpdateNotificationManager.createNotificationChannel(appUpdateChannel); + } } @Nullable diff --git a/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java b/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java index 134fb3406..b6b269bb5 100644 --- a/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java +++ b/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java @@ -112,10 +112,10 @@ public class CheckForNewAppVersionTask extends AsyncTask { JSONObject githubStableObject = githubObject.getJSONObject("stable"); String versionName = githubStableObject.getString("version"); - // String versionCode = githubStableObject.getString("version_code"); + String versionCode = githubStableObject.getString("version_code"); String apkLocationUrl = githubStableObject.getString("apk"); - compareAppVersionAndShowNotification(versionName, apkLocationUrl); + compareAppVersionAndShowNotification(versionName, apkLocationUrl, versionCode); } catch (JSONException ex) { ex.printStackTrace(); @@ -129,11 +129,13 @@ public class CheckForNewAppVersionTask extends AsyncTask { * @param versionName * @param apkLocationUrl */ - private void compareAppVersionAndShowNotification(String versionName, String apkLocationUrl) { + private void compareAppVersionAndShowNotification(String versionName, + String apkLocationUrl, + String versionCode) { int NOTIFICATION_ID = 2000; - if (!BuildConfig.VERSION_NAME.equals(versionName.replace("v", ""))) { + if (BuildConfig.VERSION_CODE < Integer.valueOf(versionCode)) { // A pending intent to open the apk location url in the browser. Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(apkLocationUrl)); From 04e974b3264db7001bd03511bdfa32a326ef12d0 Mon Sep 17 00:00:00 2001 From: Kartikey Kushwaha Date: Fri, 17 Aug 2018 01:11:51 +0530 Subject: [PATCH 10/29] Bug fix. --- app/src/main/java/org/schabi/newpipe/App.java | 3 +-- .../java/org/schabi/newpipe/CheckForNewAppVersionTask.java | 5 ++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/App.java b/app/src/main/java/org/schabi/newpipe/App.java index a9002fda2..c9ebc976c 100644 --- a/app/src/main/java/org/schabi/newpipe/App.java +++ b/app/src/main/java/org/schabi/newpipe/App.java @@ -210,8 +210,7 @@ public class App extends Application { mNotificationManager.createNotificationChannel(mChannel); // Set up notification channel for app update only if it's a github apk. - - if (!BuildConfig.FLAVOR.equals(getString(R.string.app_flavor_github))) { + if (BuildConfig.FLAVOR.equals(getString(R.string.app_flavor_github))) { final String appUpdateId = getString(R.string.app_update_notification_channel_id); diff --git a/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java b/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java index b6b269bb5..b53ef1794 100644 --- a/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java +++ b/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java @@ -7,6 +7,7 @@ import android.net.Uri; import android.os.AsyncTask; import android.support.v4.app.NotificationCompat; import android.support.v4.app.NotificationManagerCompat; +import android.util.Log; import org.json.JSONException; import org.json.JSONObject; @@ -34,7 +35,7 @@ public class CheckForNewAppVersionTask extends AsyncTask { protected void onPreExecute() { // Continue with version check only if the build variant is of type "github". if (!BuildConfig.FLAVOR.equals(app.getString(R.string.app_flavor_github))) { - this.cancel(true); + // this.cancel(true); } } @@ -102,6 +103,8 @@ public class CheckForNewAppVersionTask extends AsyncTask { @Override protected void onPostExecute(String response) { + Log.i("Response--", response); + // Parse the json from the response. if (response != null) { From 910c10f55428305b671b609a219a7f746ef32757 Mon Sep 17 00:00:00 2001 From: Kartikey Kushwaha Date: Fri, 17 Aug 2018 01:46:33 +0530 Subject: [PATCH 11/29] Removed debug code --- .../main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java b/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java index b53ef1794..5794b0d0f 100644 --- a/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java +++ b/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java @@ -35,7 +35,7 @@ public class CheckForNewAppVersionTask extends AsyncTask { protected void onPreExecute() { // Continue with version check only if the build variant is of type "github". if (!BuildConfig.FLAVOR.equals(app.getString(R.string.app_flavor_github))) { - // this.cancel(true); + this.cancel(true); } } From 17197ad670e96feea6c45b0d7d62f9de56d94032 Mon Sep 17 00:00:00 2001 From: Kartikey Kushwaha Date: Sat, 15 Sep 2018 12:51:39 +0530 Subject: [PATCH 12/29] Pull request changes begins here. --- .../java/org/schabi/newpipe/CheckForNewAppVersionTask.java | 4 ++-- .../main/java/org/schabi/newpipe/player/PopupVideoPlayer.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java b/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java index 5794b0d0f..628704b23 100644 --- a/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java +++ b/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java @@ -44,6 +44,8 @@ public class CheckForNewAppVersionTask extends AsyncTask { // Make a network request to get latest NewPipe data. + Log.i("Update---", "checking"); + String response; HttpURLConnection connection = null; @@ -103,8 +105,6 @@ public class CheckForNewAppVersionTask extends AsyncTask { @Override protected void onPostExecute(String response) { - Log.i("Response--", response); - // Parse the json from the response. if (response != null) { diff --git a/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java b/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java index 2c233f219..f9892ecb5 100644 --- a/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java +++ b/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java @@ -666,7 +666,7 @@ public final class PopupVideoPlayer extends Service { hideControls(DEFAULT_CONTROLS_DURATION, DEFAULT_CONTROLS_HIDE_TIME); // Check for new version - new CheckForNewAppVersionTask().execute(); + //new CheckForNewAppVersionTask().execute(); } @Override From 6417bd91ef339e246f2413ae791367bb2b21fd1c Mon Sep 17 00:00:00 2001 From: Kartikey Kushwaha Date: Sat, 15 Sep 2018 14:08:32 +0530 Subject: [PATCH 13/29] Pull request changes v1. --- .../java/org/schabi/newpipe/CheckForNewAppVersionTask.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java b/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java index 628704b23..4b75c202c 100644 --- a/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java +++ b/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java @@ -7,7 +7,6 @@ import android.net.Uri; import android.os.AsyncTask; import android.support.v4.app.NotificationCompat; import android.support.v4.app.NotificationManagerCompat; -import android.util.Log; import org.json.JSONException; import org.json.JSONObject; @@ -16,7 +15,6 @@ import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.net.HttpURLConnection; -import java.net.MalformedURLException; import java.net.URL; /** @@ -44,8 +42,6 @@ public class CheckForNewAppVersionTask extends AsyncTask { // Make a network request to get latest NewPipe data. - Log.i("Update---", "checking"); - String response; HttpURLConnection connection = null; @@ -85,8 +81,6 @@ public class CheckForNewAppVersionTask extends AsyncTask { return response; } - } catch (MalformedURLException ex) { - ex.printStackTrace(); } catch (IOException ex) { ex.printStackTrace(); } finally { From 7124d9bca50ab5fbc7965d069f9f41edf3dc73ea Mon Sep 17 00:00:00 2001 From: Kartikey Kushwaha Date: Sat, 15 Sep 2018 20:51:17 +0530 Subject: [PATCH 14/29] Removed flvor checks. Added update settings under main settings. --- app/build.gradle | 14 -------- app/src/main/java/org/schabi/newpipe/App.java | 29 +++++++-------- .../newpipe/CheckForNewAppVersionTask.java | 18 ++++++++-- .../settings/UpdateSettingsFragment.java | 35 +++++++++++++++++++ .../res/drawable/ic_settings_update_black.xml | 9 +++++ .../res/drawable/ic_settings_update_white.xml | 5 +++ app/src/main/res/values/attrs.xml | 1 + app/src/main/res/values/settings_keys.xml | 3 ++ app/src/main/res/values/strings.xml | 9 ++--- app/src/main/res/values/styles.xml | 2 ++ app/src/main/res/xml/main_settings.xml | 5 +++ app/src/main/res/xml/update_settings.xml | 13 +++++++ 12 files changed, 107 insertions(+), 36 deletions(-) create mode 100644 app/src/main/java/org/schabi/newpipe/settings/UpdateSettingsFragment.java create mode 100644 app/src/main/res/drawable/ic_settings_update_black.xml create mode 100644 app/src/main/res/drawable/ic_settings_update_white.xml create mode 100644 app/src/main/res/xml/update_settings.xml diff --git a/app/build.gradle b/app/build.gradle index b5a106a6d..2fd175fbe 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -41,20 +41,6 @@ android { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } - - flavorDimensions "apkSource" - productFlavors { - github { - dimension "apkSource" - applicationIdSuffix ".github" - - } - - fdroid { - dimension "apkSource" - applicationIdSuffix ".fdroid" - } - } } ext { diff --git a/app/src/main/java/org/schabi/newpipe/App.java b/app/src/main/java/org/schabi/newpipe/App.java index c9ebc976c..bc824699e 100644 --- a/app/src/main/java/org/schabi/newpipe/App.java +++ b/app/src/main/java/org/schabi/newpipe/App.java @@ -209,24 +209,21 @@ public class App extends Application { NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); mNotificationManager.createNotificationChannel(mChannel); - // Set up notification channel for app update only if it's a github apk. - if (BuildConfig.FLAVOR.equals(getString(R.string.app_flavor_github))) { + // Set up notification channel for app update. + final String appUpdateId + = getString(R.string.app_update_notification_channel_id); + final CharSequence appUpdateName + = getString(R.string.app_update_notification_channel_name); + final String appUpdateDescription + = getString(R.string.app_update_notification_channel_description); - final String appUpdateId - = getString(R.string.app_update_notification_channel_id); - final CharSequence appUpdateName - = getString(R.string.app_update_notification_channel_name); - final String appUpdateDescription - = getString(R.string.app_update_notification_channel_description); + NotificationChannel appUpdateChannel + = new NotificationChannel(appUpdateId, appUpdateName, importance); + appUpdateChannel.setDescription(appUpdateDescription); - NotificationChannel appUpdateChannel - = new NotificationChannel(appUpdateId, appUpdateName, importance); - appUpdateChannel.setDescription(appUpdateDescription); - - NotificationManager appUpdateNotificationManager - = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); - appUpdateNotificationManager.createNotificationChannel(appUpdateChannel); - } + NotificationManager appUpdateNotificationManager + = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + appUpdateNotificationManager.createNotificationChannel(appUpdateChannel); } @Nullable diff --git a/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java b/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java index 4b75c202c..9694850d7 100644 --- a/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java +++ b/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java @@ -3,10 +3,13 @@ package org.schabi.newpipe; import android.app.Application; import android.app.PendingIntent; import android.content.Intent; +import android.content.SharedPreferences; import android.net.Uri; import android.os.AsyncTask; +import android.preference.PreferenceManager; import android.support.v4.app.NotificationCompat; import android.support.v4.app.NotificationManagerCompat; +import android.util.Log; import org.json.JSONException; import org.json.JSONObject; @@ -29,12 +32,23 @@ public class CheckForNewAppVersionTask extends AsyncTask { private String newPipeApiUrl = "https://newpipe.schabi.org/api/data.json"; private int timeoutPeriod = 10000; + private SharedPreferences mPrefs; + @Override protected void onPreExecute() { - // Continue with version check only if the build variant is of type "github". - if (!BuildConfig.FLAVOR.equals(app.getString(R.string.app_flavor_github))) { + + mPrefs = PreferenceManager.getDefaultSharedPreferences(app); + + // Check if user has enabled/ disabled update checking. + if (mPrefs.getBoolean(app.getString(R.string.update_app_key), true)) { + + // Go ahead with further checks. + Log.i("pref---", "true"); + } else { + Log.i("pref---", "false"); this.cancel(true); } + } @Override diff --git a/app/src/main/java/org/schabi/newpipe/settings/UpdateSettingsFragment.java b/app/src/main/java/org/schabi/newpipe/settings/UpdateSettingsFragment.java new file mode 100644 index 000000000..f6aab7cda --- /dev/null +++ b/app/src/main/java/org/schabi/newpipe/settings/UpdateSettingsFragment.java @@ -0,0 +1,35 @@ +package org.schabi.newpipe.settings; + +import android.os.Bundle; +import android.support.annotation.Nullable; +import android.support.v7.preference.Preference; + +import org.schabi.newpipe.R; + +public class UpdateSettingsFragment extends BasePreferenceFragment { + + @Override + public void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + String updateToggleKey = getString(R.string.update_app_key); + findPreference(updateToggleKey).setOnPreferenceChangeListener(updatePreferenceChange); + } + + @Override + public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { + addPreferencesFromResource(R.xml.update_settings); + } + + private Preference.OnPreferenceChangeListener updatePreferenceChange + = new Preference.OnPreferenceChangeListener() { + @Override + public boolean onPreferenceChange(Preference preference, Object newValue) { + + defaultPreferences.edit().putBoolean(getString(R.string.update_app_key), + (boolean) newValue).apply(); + + return true; + } + }; +} diff --git a/app/src/main/res/drawable/ic_settings_update_black.xml b/app/src/main/res/drawable/ic_settings_update_black.xml new file mode 100644 index 000000000..261c31217 --- /dev/null +++ b/app/src/main/res/drawable/ic_settings_update_black.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_settings_update_white.xml b/app/src/main/res/drawable/ic_settings_update_white.xml new file mode 100644 index 000000000..0feb270af --- /dev/null +++ b/app/src/main/res/drawable/ic_settings_update_white.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/values/attrs.xml b/app/src/main/res/values/attrs.xml index 7b879fb4c..75c39c490 100644 --- a/app/src/main/res/values/attrs.xml +++ b/app/src/main/res/values/attrs.xml @@ -38,6 +38,7 @@ + diff --git a/app/src/main/res/values/settings_keys.xml b/app/src/main/res/values/settings_keys.xml index 9b39fec26..b7ffb101d 100644 --- a/app/src/main/res/values/settings_keys.xml +++ b/app/src/main/res/values/settings_keys.xml @@ -201,6 +201,9 @@ @string/always_ask_open_action_key + + update_app_key + af diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index ab55b6f6c..29fa4dc03 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -109,6 +109,7 @@ Appearance Other Debug + Updates Playing in background Playing in popup mode Queued on background player @@ -515,6 +516,10 @@ 144p + + Updates + Show a notification to prompt app update when a new version is available + Minimize on application switch Action when switching to other application from main video player — %s @@ -526,8 +531,4 @@ NewPipe Update Available Tap to download - - github - fdroid - diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 87e19cede..8eae8343d 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -54,6 +54,7 @@ @drawable/ic_add_black_24dp @drawable/ic_settings_backup_restore_black_24dp @drawable/ic_blank_page_black_24dp + @drawable/ic_settings_update_black @color/light_separator_color @color/light_contrast_background_color @@ -114,6 +115,7 @@ @drawable/ic_add_white_24dp @drawable/ic_settings_backup_restore_white_24dp @drawable/ic_blank_page_white_24dp + @drawable/ic_settings_update_white @color/dark_separator_color @color/dark_contrast_background_color diff --git a/app/src/main/res/xml/main_settings.xml b/app/src/main/res/xml/main_settings.xml index 4196a98d3..3773460d6 100644 --- a/app/src/main/res/xml/main_settings.xml +++ b/app/src/main/res/xml/main_settings.xml @@ -29,6 +29,11 @@ android:icon="?attr/language" android:title="@string/content"/> + + + + + + + From e2341363d4b35e28181aa09f9f3d2993004b659f Mon Sep 17 00:00:00 2001 From: krtkush Date: Sun, 14 Oct 2018 19:16:28 +0530 Subject: [PATCH 15/29] Added check for SHA1 key. --- .../newpipe/CheckForNewAppVersionTask.java | 91 +++++++++++++++++-- 1 file changed, 82 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java b/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java index 9694850d7..fd94980c9 100644 --- a/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java +++ b/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java @@ -4,6 +4,9 @@ import android.app.Application; import android.app.PendingIntent; import android.content.Intent; import android.content.SharedPreferences; +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.content.pm.Signature; import android.net.Uri; import android.os.AsyncTask; import android.preference.PreferenceManager; @@ -15,10 +18,18 @@ import org.json.JSONException; import org.json.JSONObject; import java.io.BufferedReader; +import java.io.ByteArrayInputStream; import java.io.IOException; +import java.io.InputStream; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.security.cert.CertificateEncodingException; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; /** * AsyncTask to check if there is a newer version of the NewPipe github apk available or not. @@ -29,6 +40,7 @@ public class CheckForNewAppVersionTask extends AsyncTask { private Application app = App.getContext(); + private String GITHUB_APK_SHA1 = "B0:2E:90:7C:1C:D6:FC:57:C3:35:F0:88:D0:8F:50:5F:94:E4:D2:15"; private String newPipeApiUrl = "https://newpipe.schabi.org/api/data.json"; private int timeoutPeriod = 10000; @@ -39,23 +51,18 @@ public class CheckForNewAppVersionTask extends AsyncTask { mPrefs = PreferenceManager.getDefaultSharedPreferences(app); - // Check if user has enabled/ disabled update checking. - if (mPrefs.getBoolean(app.getString(R.string.update_app_key), true)) { - - // Go ahead with further checks. - Log.i("pref---", "true"); - } else { - Log.i("pref---", "false"); + // Check if user has enabled/ disabled update checking + // and if the current apk is a github one or not. + if (!mPrefs.getBoolean(app.getString(R.string.update_app_key), true) + || !getCertificateSHA1Fingerprint().equals(GITHUB_APK_SHA1)) { this.cancel(true); } - } @Override protected String doInBackground(Void... voids) { // Make a network request to get latest NewPipe data. - String response; HttpURLConnection connection = null; @@ -167,4 +174,70 @@ public class CheckForNewAppVersionTask extends AsyncTask { notificationManager.notify(NOTIFICATION_ID, notificationBuilder.build()); } } + + /** + * Method to get the apk's SHA1 key. + * https://stackoverflow.com/questions/9293019/get-certificate-fingerprint-from-android-app#22506133 + */ + private String getCertificateSHA1Fingerprint() { + + PackageManager pm = app.getPackageManager(); + String packageName = app.getPackageName(); + int flags = PackageManager.GET_SIGNATURES; + PackageInfo packageInfo = null; + + try { + packageInfo = pm.getPackageInfo(packageName, flags); + } catch (PackageManager.NameNotFoundException e) { + e.printStackTrace(); + } + + Signature[] signatures = packageInfo.signatures; + byte[] cert = signatures[0].toByteArray(); + InputStream input = new ByteArrayInputStream(cert); + CertificateFactory cf = null; + + try { + cf = CertificateFactory.getInstance("X509"); + } catch (CertificateException e) { + e.printStackTrace(); + } + + X509Certificate c = null; + + try { + c = (X509Certificate) cf.generateCertificate(input); + } catch (CertificateException e) { + e.printStackTrace(); + } + + String hexString = null; + + try { + MessageDigest md = MessageDigest.getInstance("SHA1"); + byte[] publicKey = md.digest(c.getEncoded()); + hexString = byte2HexFormatted(publicKey); + } catch (NoSuchAlgorithmException e1) { + e1.printStackTrace(); + } catch (CertificateEncodingException e) { + e.printStackTrace(); + } + + return hexString; + } + + private static String byte2HexFormatted(byte[] arr) { + + StringBuilder str = new StringBuilder(arr.length * 2); + + for (int i = 0; i < arr.length; i++) { + String h = Integer.toHexString(arr[i]); + int l = h.length(); + if (l == 1) h = "0" + h; + if (l > 2) h = h.substring(l - 2, l); + str.append(h.toUpperCase()); + if (i < (arr.length - 1)) str.append(':'); + } + return str.toString(); + } } From 8ef702fa075529feee099e3f496ea8aea4f67520 Mon Sep 17 00:00:00 2001 From: krtkush Date: Thu, 18 Oct 2018 22:59:33 +0530 Subject: [PATCH 16/29] Removed updates options from settings in case of non github apk. --- .../gen/org/schabi/newpipe/BuildConfig.java | 8 ++++++++ .../debug/gen/org/schabi/newpipe/Manifest.java | 7 +++++++ app/src/debug/gen/org/schabi/newpipe/R.java | 7 +++++++ .../gen/org/schabi/newpipe/BuildConfig.java | 8 ++++++++ .../main/gen/org/schabi/newpipe/Manifest.java | 7 +++++++ app/src/main/gen/org/schabi/newpipe/R.java | 7 +++++++ .../newpipe/CheckForNewAppVersionTask.java | 18 +++++++++++------- .../newpipe/settings/MainSettingsFragment.java | 8 ++++++++ .../settings/UpdateSettingsFragment.java | 1 + app/src/main/res/values/settings_keys.xml | 1 + app/src/main/res/values/strings.xml | 2 +- app/src/main/res/xml/main_settings.xml | 3 ++- 12 files changed, 68 insertions(+), 9 deletions(-) create mode 100644 app/src/debug/gen/org/schabi/newpipe/BuildConfig.java create mode 100644 app/src/debug/gen/org/schabi/newpipe/Manifest.java create mode 100644 app/src/debug/gen/org/schabi/newpipe/R.java create mode 100644 app/src/main/gen/org/schabi/newpipe/BuildConfig.java create mode 100644 app/src/main/gen/org/schabi/newpipe/Manifest.java create mode 100644 app/src/main/gen/org/schabi/newpipe/R.java diff --git a/app/src/debug/gen/org/schabi/newpipe/BuildConfig.java b/app/src/debug/gen/org/schabi/newpipe/BuildConfig.java new file mode 100644 index 000000000..575afb9cb --- /dev/null +++ b/app/src/debug/gen/org/schabi/newpipe/BuildConfig.java @@ -0,0 +1,8 @@ +/*___Generated_by_IDEA___*/ + +package org.schabi.newpipe; + +/* This stub is only used by the IDE. It is NOT the BuildConfig class actually packed into the APK */ +public final class BuildConfig { + public final static boolean DEBUG = Boolean.parseBoolean(null); +} \ No newline at end of file diff --git a/app/src/debug/gen/org/schabi/newpipe/Manifest.java b/app/src/debug/gen/org/schabi/newpipe/Manifest.java new file mode 100644 index 000000000..10e45a45a --- /dev/null +++ b/app/src/debug/gen/org/schabi/newpipe/Manifest.java @@ -0,0 +1,7 @@ +/*___Generated_by_IDEA___*/ + +package org.schabi.newpipe; + +/* This stub is only used by the IDE. It is NOT the Manifest class actually packed into the APK */ +public final class Manifest { +} \ No newline at end of file diff --git a/app/src/debug/gen/org/schabi/newpipe/R.java b/app/src/debug/gen/org/schabi/newpipe/R.java new file mode 100644 index 000000000..088bdfb0d --- /dev/null +++ b/app/src/debug/gen/org/schabi/newpipe/R.java @@ -0,0 +1,7 @@ +/*___Generated_by_IDEA___*/ + +package org.schabi.newpipe; + +/* This stub is only used by the IDE. It is NOT the R class actually packed into the APK */ +public final class R { +} \ No newline at end of file diff --git a/app/src/main/gen/org/schabi/newpipe/BuildConfig.java b/app/src/main/gen/org/schabi/newpipe/BuildConfig.java new file mode 100644 index 000000000..575afb9cb --- /dev/null +++ b/app/src/main/gen/org/schabi/newpipe/BuildConfig.java @@ -0,0 +1,8 @@ +/*___Generated_by_IDEA___*/ + +package org.schabi.newpipe; + +/* This stub is only used by the IDE. It is NOT the BuildConfig class actually packed into the APK */ +public final class BuildConfig { + public final static boolean DEBUG = Boolean.parseBoolean(null); +} \ No newline at end of file diff --git a/app/src/main/gen/org/schabi/newpipe/Manifest.java b/app/src/main/gen/org/schabi/newpipe/Manifest.java new file mode 100644 index 000000000..10e45a45a --- /dev/null +++ b/app/src/main/gen/org/schabi/newpipe/Manifest.java @@ -0,0 +1,7 @@ +/*___Generated_by_IDEA___*/ + +package org.schabi.newpipe; + +/* This stub is only used by the IDE. It is NOT the Manifest class actually packed into the APK */ +public final class Manifest { +} \ No newline at end of file diff --git a/app/src/main/gen/org/schabi/newpipe/R.java b/app/src/main/gen/org/schabi/newpipe/R.java new file mode 100644 index 000000000..088bdfb0d --- /dev/null +++ b/app/src/main/gen/org/schabi/newpipe/R.java @@ -0,0 +1,7 @@ +/*___Generated_by_IDEA___*/ + +package org.schabi.newpipe; + +/* This stub is only used by the IDE. It is NOT the R class actually packed into the APK */ +public final class R { +} \ No newline at end of file diff --git a/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java b/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java index fd94980c9..9ab0f5d36 100644 --- a/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java +++ b/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java @@ -38,11 +38,10 @@ import java.security.cert.X509Certificate; */ public class CheckForNewAppVersionTask extends AsyncTask { - private Application app = App.getContext(); - - private String GITHUB_APK_SHA1 = "B0:2E:90:7C:1C:D6:FC:57:C3:35:F0:88:D0:8F:50:5F:94:E4:D2:15"; - private String newPipeApiUrl = "https://newpipe.schabi.org/api/data.json"; - private int timeoutPeriod = 10000; + private static final Application app = App.getContext(); + private static final String GITHUB_APK_SHA1 = "B0:2E:90:7C:1C:D6:FC:57:C3:35:F0:88:D0:8F:50:5F:94:E4:D2:15"; + private static final String newPipeApiUrl = "https://newpipe.schabi.org/api/data.json"; + private static final int timeoutPeriod = 10000; private SharedPreferences mPrefs; @@ -54,7 +53,7 @@ public class CheckForNewAppVersionTask extends AsyncTask { // Check if user has enabled/ disabled update checking // and if the current apk is a github one or not. if (!mPrefs.getBoolean(app.getString(R.string.update_app_key), true) - || !getCertificateSHA1Fingerprint().equals(GITHUB_APK_SHA1)) { + || !isGithubApk()) { this.cancel(true); } } @@ -179,7 +178,7 @@ public class CheckForNewAppVersionTask extends AsyncTask { * Method to get the apk's SHA1 key. * https://stackoverflow.com/questions/9293019/get-certificate-fingerprint-from-android-app#22506133 */ - private String getCertificateSHA1Fingerprint() { + private static String getCertificateSHA1Fingerprint() { PackageManager pm = app.getPackageManager(); String packageName = app.getPackageName(); @@ -240,4 +239,9 @@ public class CheckForNewAppVersionTask extends AsyncTask { } return str.toString(); } + + public static boolean isGithubApk() { + + return getCertificateSHA1Fingerprint().equals(GITHUB_APK_SHA1); + } } diff --git a/app/src/main/java/org/schabi/newpipe/settings/MainSettingsFragment.java b/app/src/main/java/org/schabi/newpipe/settings/MainSettingsFragment.java index 5e07e2b12..43270926e 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/MainSettingsFragment.java +++ b/app/src/main/java/org/schabi/newpipe/settings/MainSettingsFragment.java @@ -4,6 +4,7 @@ import android.os.Bundle; import android.support.v7.preference.Preference; import org.schabi.newpipe.BuildConfig; +import org.schabi.newpipe.CheckForNewAppVersionTask; import org.schabi.newpipe.R; public class MainSettingsFragment extends BasePreferenceFragment { @@ -13,6 +14,13 @@ public class MainSettingsFragment extends BasePreferenceFragment { public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { addPreferencesFromResource(R.xml.main_settings); + if (!CheckForNewAppVersionTask.isGithubApk()) { + final Preference update = findPreference(getString(R.string.update_pref_screen_key)); + getPreferenceScreen().removePreference(update); + + defaultPreferences.edit().putBoolean(getString(R.string.update_app_key), false).apply(); + } + if (!DEBUG) { final Preference debug = findPreference(getString(R.string.debug_pref_screen_key)); getPreferenceScreen().removePreference(debug); diff --git a/app/src/main/java/org/schabi/newpipe/settings/UpdateSettingsFragment.java b/app/src/main/java/org/schabi/newpipe/settings/UpdateSettingsFragment.java index f6aab7cda..157f52a0e 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/UpdateSettingsFragment.java +++ b/app/src/main/java/org/schabi/newpipe/settings/UpdateSettingsFragment.java @@ -4,6 +4,7 @@ import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v7.preference.Preference; +import org.schabi.newpipe.CheckForNewAppVersionTask; import org.schabi.newpipe.R; public class UpdateSettingsFragment extends BasePreferenceFragment { diff --git a/app/src/main/res/values/settings_keys.xml b/app/src/main/res/values/settings_keys.xml index e282a3bf5..9c6ae92b0 100644 --- a/app/src/main/res/values/settings_keys.xml +++ b/app/src/main/res/values/settings_keys.xml @@ -205,6 +205,7 @@ update_app_key + update_pref_screen_key diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index f8c7932a7..f7e461829 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -529,7 +529,7 @@ Switch View - NewPipe Update Available + NewPipe Update Available! Tap to download diff --git a/app/src/main/res/xml/main_settings.xml b/app/src/main/res/xml/main_settings.xml index 3773460d6..74450f77b 100644 --- a/app/src/main/res/xml/main_settings.xml +++ b/app/src/main/res/xml/main_settings.xml @@ -32,7 +32,8 @@ + android:title="@string/settings_category_updates_title" + android:key="update_pref_screen_key"/> Date: Thu, 18 Oct 2018 23:02:19 +0530 Subject: [PATCH 17/29] Delete BuildConfig.java --- app/src/debug/gen/org/schabi/newpipe/BuildConfig.java | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 app/src/debug/gen/org/schabi/newpipe/BuildConfig.java diff --git a/app/src/debug/gen/org/schabi/newpipe/BuildConfig.java b/app/src/debug/gen/org/schabi/newpipe/BuildConfig.java deleted file mode 100644 index 575afb9cb..000000000 --- a/app/src/debug/gen/org/schabi/newpipe/BuildConfig.java +++ /dev/null @@ -1,8 +0,0 @@ -/*___Generated_by_IDEA___*/ - -package org.schabi.newpipe; - -/* This stub is only used by the IDE. It is NOT the BuildConfig class actually packed into the APK */ -public final class BuildConfig { - public final static boolean DEBUG = Boolean.parseBoolean(null); -} \ No newline at end of file From 2d5bc3ada85d2fb0151bfe32b6a6fef9d08c0df8 Mon Sep 17 00:00:00 2001 From: Kartikey Kushwaha Date: Thu, 18 Oct 2018 23:02:30 +0530 Subject: [PATCH 18/29] Delete Manifest.java --- app/src/debug/gen/org/schabi/newpipe/Manifest.java | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 app/src/debug/gen/org/schabi/newpipe/Manifest.java diff --git a/app/src/debug/gen/org/schabi/newpipe/Manifest.java b/app/src/debug/gen/org/schabi/newpipe/Manifest.java deleted file mode 100644 index 10e45a45a..000000000 --- a/app/src/debug/gen/org/schabi/newpipe/Manifest.java +++ /dev/null @@ -1,7 +0,0 @@ -/*___Generated_by_IDEA___*/ - -package org.schabi.newpipe; - -/* This stub is only used by the IDE. It is NOT the Manifest class actually packed into the APK */ -public final class Manifest { -} \ No newline at end of file From d1a9033525250071a6263f6c4caf3f55ebb285cc Mon Sep 17 00:00:00 2001 From: Kartikey Kushwaha Date: Thu, 18 Oct 2018 23:02:38 +0530 Subject: [PATCH 19/29] Delete R.java --- app/src/debug/gen/org/schabi/newpipe/R.java | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 app/src/debug/gen/org/schabi/newpipe/R.java diff --git a/app/src/debug/gen/org/schabi/newpipe/R.java b/app/src/debug/gen/org/schabi/newpipe/R.java deleted file mode 100644 index 088bdfb0d..000000000 --- a/app/src/debug/gen/org/schabi/newpipe/R.java +++ /dev/null @@ -1,7 +0,0 @@ -/*___Generated_by_IDEA___*/ - -package org.schabi.newpipe; - -/* This stub is only used by the IDE. It is NOT the R class actually packed into the APK */ -public final class R { -} \ No newline at end of file From ec28e972bbf756c98fc95cf1080a3be465d68bcb Mon Sep 17 00:00:00 2001 From: Kartikey Kushwaha Date: Thu, 18 Oct 2018 23:02:59 +0530 Subject: [PATCH 20/29] Delete BuildConfig.java --- app/src/main/gen/org/schabi/newpipe/BuildConfig.java | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 app/src/main/gen/org/schabi/newpipe/BuildConfig.java diff --git a/app/src/main/gen/org/schabi/newpipe/BuildConfig.java b/app/src/main/gen/org/schabi/newpipe/BuildConfig.java deleted file mode 100644 index 575afb9cb..000000000 --- a/app/src/main/gen/org/schabi/newpipe/BuildConfig.java +++ /dev/null @@ -1,8 +0,0 @@ -/*___Generated_by_IDEA___*/ - -package org.schabi.newpipe; - -/* This stub is only used by the IDE. It is NOT the BuildConfig class actually packed into the APK */ -public final class BuildConfig { - public final static boolean DEBUG = Boolean.parseBoolean(null); -} \ No newline at end of file From 6ef25eb861d0dcf9cf659c29e041b7ec2dd7a05a Mon Sep 17 00:00:00 2001 From: Kartikey Kushwaha Date: Thu, 18 Oct 2018 23:03:21 +0530 Subject: [PATCH 21/29] Delete Manifest.java --- app/src/main/gen/org/schabi/newpipe/Manifest.java | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 app/src/main/gen/org/schabi/newpipe/Manifest.java diff --git a/app/src/main/gen/org/schabi/newpipe/Manifest.java b/app/src/main/gen/org/schabi/newpipe/Manifest.java deleted file mode 100644 index 10e45a45a..000000000 --- a/app/src/main/gen/org/schabi/newpipe/Manifest.java +++ /dev/null @@ -1,7 +0,0 @@ -/*___Generated_by_IDEA___*/ - -package org.schabi.newpipe; - -/* This stub is only used by the IDE. It is NOT the Manifest class actually packed into the APK */ -public final class Manifest { -} \ No newline at end of file From 3c6d27b5044520d4877eaef028d6a7fe729a021e Mon Sep 17 00:00:00 2001 From: Kartikey Kushwaha Date: Thu, 18 Oct 2018 23:04:07 +0530 Subject: [PATCH 22/29] Delete R.java --- app/src/main/gen/org/schabi/newpipe/R.java | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 app/src/main/gen/org/schabi/newpipe/R.java diff --git a/app/src/main/gen/org/schabi/newpipe/R.java b/app/src/main/gen/org/schabi/newpipe/R.java deleted file mode 100644 index 088bdfb0d..000000000 --- a/app/src/main/gen/org/schabi/newpipe/R.java +++ /dev/null @@ -1,7 +0,0 @@ -/*___Generated_by_IDEA___*/ - -package org.schabi.newpipe; - -/* This stub is only used by the IDE. It is NOT the R class actually packed into the APK */ -public final class R { -} \ No newline at end of file From fda9b591295ef057043c985820e7c4707d61adcc Mon Sep 17 00:00:00 2001 From: Tobias Groza Date: Mon, 22 Oct 2018 23:08:46 +0530 Subject: [PATCH 23/29] Code review changes. Co-Authored-By: krtkush --- app/src/main/res/values/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index f7e461829..f4910388f 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -518,7 +518,7 @@ Updates - Show a notification to prompt app update when a new version is available + Show a notification to prompt app update when a new version is available Minimize on application switch From 96dac0f9791e47b72fb25f19cd57a49cd1f444a1 Mon Sep 17 00:00:00 2001 From: krtkush Date: Mon, 22 Oct 2018 23:12:25 +0530 Subject: [PATCH 24/29] Code review suggested changes. --- .../org/schabi/newpipe/CheckForNewAppVersionTask.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java b/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java index 9ab0f5d36..e122a5688 100644 --- a/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java +++ b/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java @@ -194,17 +194,12 @@ public class CheckForNewAppVersionTask extends AsyncTask { Signature[] signatures = packageInfo.signatures; byte[] cert = signatures[0].toByteArray(); InputStream input = new ByteArrayInputStream(cert); + CertificateFactory cf = null; - - try { - cf = CertificateFactory.getInstance("X509"); - } catch (CertificateException e) { - e.printStackTrace(); - } - X509Certificate c = null; try { + cf = CertificateFactory.getInstance("X509"); c = (X509Certificate) cf.generateCertificate(input); } catch (CertificateException e) { e.printStackTrace(); From 23309e6fdfd11e0c19cfee35b8cd1d38b6295205 Mon Sep 17 00:00:00 2001 From: krtkush Date: Sun, 18 Nov 2018 19:15:50 +0530 Subject: [PATCH 25/29] Pull request changes. --- app/src/main/java/org/schabi/newpipe/App.java | 20 +++- .../newpipe/CheckForNewAppVersionTask.java | 91 ++++++++----------- 2 files changed, 55 insertions(+), 56 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/App.java b/app/src/main/java/org/schabi/newpipe/App.java index 16fa66e2a..a1f5076fb 100644 --- a/app/src/main/java/org/schabi/newpipe/App.java +++ b/app/src/main/java/org/schabi/newpipe/App.java @@ -1,5 +1,6 @@ package org.schabi.newpipe; +import android.annotation.TargetApi; import android.app.Application; import android.app.NotificationChannel; import android.app.NotificationManager; @@ -63,7 +64,7 @@ import io.reactivex.plugins.RxJavaPlugins; public class App extends Application { protected static final String TAG = App.class.toString(); private RefWatcher refWatcher; - private static App context; + private static App app; @SuppressWarnings("unchecked") private static final Class[] reportSenderFactoryClasses = new Class[]{AcraReportSenderFactory.class}; @@ -86,7 +87,7 @@ public class App extends Application { } refWatcher = installLeakCanary(); - context = this; + app = this; // Initialize settings first because others inits can use its values SettingsActivity.initSettings(this); @@ -209,7 +210,16 @@ public class App extends Application { NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); mNotificationManager.createNotificationChannel(mChannel); - // Set up notification channel for app update. + setUpUpdateNotificationChannel(importance); + } + + /** + * Set up notification channel for app update. + * @param importance + */ + @TargetApi(Build.VERSION_CODES.O) + private void setUpUpdateNotificationChannel(int importance) { + final String appUpdateId = getString(R.string.app_update_notification_channel_id); final CharSequence appUpdateName @@ -240,7 +250,7 @@ public class App extends Application { return false; } - public static App getContext() { - return context; + public static App getApp() { + return app; } } diff --git a/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java b/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java index e122a5688..5c55ee8ba 100644 --- a/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java +++ b/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java @@ -12,10 +12,11 @@ import android.os.AsyncTask; import android.preference.PreferenceManager; import android.support.v4.app.NotificationCompat; import android.support.v4.app.NotificationManagerCompat; -import android.util.Log; import org.json.JSONException; import org.json.JSONObject; +import org.schabi.newpipe.report.ErrorActivity; +import org.schabi.newpipe.report.UserAction; import java.io.BufferedReader; import java.io.ByteArrayInputStream; @@ -30,6 +31,12 @@ import java.security.cert.CertificateEncodingException; import java.security.cert.CertificateException; import java.security.cert.CertificateFactory; import java.security.cert.X509Certificate; +import java.util.concurrent.TimeUnit; + +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; /** * AsyncTask to check if there is a newer version of the NewPipe github apk available or not. @@ -38,12 +45,13 @@ import java.security.cert.X509Certificate; */ public class CheckForNewAppVersionTask extends AsyncTask { - private static final Application app = App.getContext(); + private static final Application app = App.getApp(); private static final String GITHUB_APK_SHA1 = "B0:2E:90:7C:1C:D6:FC:57:C3:35:F0:88:D0:8F:50:5F:94:E4:D2:15"; private static final String newPipeApiUrl = "https://newpipe.schabi.org/api/data.json"; - private static final int timeoutPeriod = 10000; + private static final int timeoutPeriod = 30; private SharedPreferences mPrefs; + private OkHttpClient client; @Override protected void onPreExecute() { @@ -62,55 +70,29 @@ public class CheckForNewAppVersionTask extends AsyncTask { protected String doInBackground(Void... voids) { // Make a network request to get latest NewPipe data. - String response; - HttpURLConnection connection = null; + + if (client == null) { + + client = new OkHttpClient + .Builder() + .readTimeout(timeoutPeriod, TimeUnit.SECONDS) + .build(); + } + + Request request = new Request.Builder() + .url(newPipeApiUrl) + .build(); try { - URL url = new URL(newPipeApiUrl); + Response response = client.newCall(request).execute(); + return response.body().string(); - connection = (HttpURLConnection) url.openConnection(); - connection.setRequestMethod("GET"); - connection.setConnectTimeout(timeoutPeriod); - connection.setReadTimeout(timeoutPeriod); - connection.setRequestProperty("Content-length", "0"); - connection.setUseCaches(false); - connection.setAllowUserInteraction(false); - connection.connect(); - - int responseStatus = connection.getResponseCode(); - - switch (responseStatus) { - - case 200: - case 201: - BufferedReader bufferedReader = new BufferedReader( - new InputStreamReader(connection.getInputStream())); - - StringBuilder stringBuilder = new StringBuilder(); - - String line; - - while ((line = bufferedReader.readLine()) != null) { - stringBuilder.append(line); - stringBuilder.append("\n"); - } - - bufferedReader.close(); - response = stringBuilder.toString(); - - return response; - } } catch (IOException ex) { - ex.printStackTrace(); - } finally { - if (connection != null) { - try { - connection.disconnect(); - } catch (Exception ex) { - ex.printStackTrace(); - } - } + + ErrorActivity.reportError(app, ex, null, null, + ErrorActivity.ErrorInfo.make(UserAction.SOMETHING_ELSE, "none", + "app update API fail", R.string.app_ui_crash)); } return null; @@ -136,6 +118,9 @@ public class CheckForNewAppVersionTask extends AsyncTask { } catch (JSONException ex) { ex.printStackTrace(); + ErrorActivity.reportError(app, ex, null, null, + ErrorActivity.ErrorInfo.make(UserAction.SOMETHING_ELSE, "none", + "could not parse app update JSON data", R.string.app_ui_crash)); } } } @@ -211,10 +196,14 @@ public class CheckForNewAppVersionTask extends AsyncTask { MessageDigest md = MessageDigest.getInstance("SHA1"); byte[] publicKey = md.digest(c.getEncoded()); hexString = byte2HexFormatted(publicKey); - } catch (NoSuchAlgorithmException e1) { - e1.printStackTrace(); - } catch (CertificateEncodingException e) { - e.printStackTrace(); + } catch (NoSuchAlgorithmException ex1) { + ErrorActivity.reportError(app, ex1, null, null, + ErrorActivity.ErrorInfo.make(UserAction.SOMETHING_ELSE, "none", + "Could not retrieve SHA1 key", R.string.app_ui_crash)); + } catch (CertificateEncodingException ex2) { + ErrorActivity.reportError(app, ex2, null, null, + ErrorActivity.ErrorInfo.make(UserAction.SOMETHING_ELSE, "none", + "Could not retrieve SHA1 key", R.string.app_ui_crash)); } return hexString; From 939cc56951fadfb4ca612b4432dbeb931b5d19d9 Mon Sep 17 00:00:00 2001 From: krtkush Date: Sun, 18 Nov 2018 19:18:16 +0530 Subject: [PATCH 26/29] Pull request changes v2. --- .../schabi/newpipe/CheckForNewAppVersionTask.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java b/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java index 5c55ee8ba..cd41ac07e 100644 --- a/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java +++ b/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java @@ -89,7 +89,6 @@ public class CheckForNewAppVersionTask extends AsyncTask { return response.body().string(); } catch (IOException ex) { - ErrorActivity.reportError(app, ex, null, null, ErrorActivity.ErrorInfo.make(UserAction.SOMETHING_ELSE, "none", "app update API fail", R.string.app_ui_crash)); @@ -117,7 +116,6 @@ public class CheckForNewAppVersionTask extends AsyncTask { compareAppVersionAndShowNotification(versionName, apkLocationUrl, versionCode); } catch (JSONException ex) { - ex.printStackTrace(); ErrorActivity.reportError(app, ex, null, null, ErrorActivity.ErrorInfo.make(UserAction.SOMETHING_ELSE, "none", "could not parse app update JSON data", R.string.app_ui_crash)); @@ -172,8 +170,10 @@ public class CheckForNewAppVersionTask extends AsyncTask { try { packageInfo = pm.getPackageInfo(packageName, flags); - } catch (PackageManager.NameNotFoundException e) { - e.printStackTrace(); + } catch (PackageManager.NameNotFoundException ex) { + ErrorActivity.reportError(app, ex, null, null, + ErrorActivity.ErrorInfo.make(UserAction.SOMETHING_ELSE, "none", + "Could not find package info", R.string.app_ui_crash)); } Signature[] signatures = packageInfo.signatures; @@ -186,8 +186,10 @@ public class CheckForNewAppVersionTask extends AsyncTask { try { cf = CertificateFactory.getInstance("X509"); c = (X509Certificate) cf.generateCertificate(input); - } catch (CertificateException e) { - e.printStackTrace(); + } catch (CertificateException ex) { + ErrorActivity.reportError(app, ex, null, null, + ErrorActivity.ErrorInfo.make(UserAction.SOMETHING_ELSE, "none", + "Certificate error", R.string.app_ui_crash)); } String hexString = null; From ad5535af814afc43b77d70237177c6ec13583204 Mon Sep 17 00:00:00 2001 From: krtkush Date: Mon, 19 Nov 2018 23:27:13 +0530 Subject: [PATCH 27/29] Code refactoring, PR changes. --- .../org/schabi/newpipe/CheckForNewAppVersionTask.java | 3 --- .../newpipe/settings/UpdateSettingsFragment.java | 11 ++++------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java b/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java index cd41ac07e..af9b88ac1 100644 --- a/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java +++ b/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java @@ -70,7 +70,6 @@ public class CheckForNewAppVersionTask extends AsyncTask { protected String doInBackground(Void... voids) { // Make a network request to get latest NewPipe data. - if (client == null) { client = new OkHttpClient @@ -84,10 +83,8 @@ public class CheckForNewAppVersionTask extends AsyncTask { .build(); try { - Response response = client.newCall(request).execute(); return response.body().string(); - } catch (IOException ex) { ErrorActivity.reportError(app, ex, null, null, ErrorActivity.ErrorInfo.make(UserAction.SOMETHING_ELSE, "none", diff --git a/app/src/main/java/org/schabi/newpipe/settings/UpdateSettingsFragment.java b/app/src/main/java/org/schabi/newpipe/settings/UpdateSettingsFragment.java index 157f52a0e..76d887dd1 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/UpdateSettingsFragment.java +++ b/app/src/main/java/org/schabi/newpipe/settings/UpdateSettingsFragment.java @@ -23,14 +23,11 @@ public class UpdateSettingsFragment extends BasePreferenceFragment { } private Preference.OnPreferenceChangeListener updatePreferenceChange - = new Preference.OnPreferenceChangeListener() { - @Override - public boolean onPreferenceChange(Preference preference, Object newValue) { + = (preference, newValue) -> { - defaultPreferences.edit().putBoolean(getString(R.string.update_app_key), - (boolean) newValue).apply(); + defaultPreferences.edit().putBoolean(getString(R.string.update_app_key), + (boolean) newValue).apply(); - return true; - } + return true; }; } From 069654c5f916ae3b704c67e103649574c51bc97d Mon Sep 17 00:00:00 2001 From: krtkush Date: Mon, 26 Nov 2018 01:18:02 +0530 Subject: [PATCH 28/29] vector -> png --- app/src/main/ic_settings_update_white-web.png | Bin 0 -> 9830 bytes .../newpipe/CheckForNewAppVersionTask.java | 2 +- .../drawable-hdpi/ic_settings_update_black.png | Bin 0 -> 720 bytes .../drawable-hdpi/ic_settings_update_white.png | Bin 0 -> 720 bytes .../ic_settings_update_black.png | Bin 0 -> 512 bytes .../drawable-mdpi/ic_settings_update_black.png | Bin 0 -> 379 bytes .../drawable-mdpi/ic_settings_update_white.png | Bin 0 -> 562 bytes .../drawable-xhdpi/ic_settings_update_black.png | Bin 0 -> 954 bytes .../drawable-xhdpi/ic_settings_update_white.png | Bin 0 -> 1010 bytes .../drawable-xxhdpi/ic_settings_update_black.png | Bin 0 -> 1340 bytes .../drawable-xxhdpi/ic_settings_update_white.png | Bin 0 -> 1468 bytes .../ic_settings_update_black.png | Bin 0 -> 1769 bytes .../ic_settings_update_white.png | Bin 0 -> 2037 bytes .../drawable-hdpi/ic_settings_update_black.png | Bin 0 -> 431 bytes .../drawable-mdpi/ic_settings_update_black.png | Bin 0 -> 379 bytes .../drawable-xhdpi/ic_settings_update_black.png | Bin 0 -> 710 bytes .../drawable-xxhdpi/ic_settings_update_black.png | Bin 0 -> 1091 bytes .../ic_settings_update_black.png | Bin 0 -> 2029 bytes .../res/drawable/ic_settings_update_black.xml | 9 --------- .../drawable-hdpi/ic_settings_update_black.png | Bin 0 -> 431 bytes .../drawable-mdpi/ic_settings_update_black.png | Bin 0 -> 379 bytes .../drawable-xhdpi/ic_settings_update_black.png | Bin 0 -> 710 bytes .../drawable-xxhdpi/ic_settings_update_black.png | Bin 0 -> 1091 bytes .../ic_settings_update_black.png | Bin 0 -> 2029 bytes .../res/drawable/ic_settings_update_white.xml | 5 ----- 25 files changed, 1 insertion(+), 15 deletions(-) create mode 100644 app/src/main/ic_settings_update_white-web.png create mode 100755 app/src/main/res/drawable-hdpi/ic_settings_update_black.png create mode 100755 app/src/main/res/drawable-hdpi/ic_settings_update_white.png create mode 100755 app/src/main/res/drawable-ldrtl-mdpi/ic_settings_update_black.png create mode 100755 app/src/main/res/drawable-mdpi/ic_settings_update_black.png create mode 100755 app/src/main/res/drawable-mdpi/ic_settings_update_white.png create mode 100755 app/src/main/res/drawable-xhdpi/ic_settings_update_black.png create mode 100755 app/src/main/res/drawable-xhdpi/ic_settings_update_white.png create mode 100755 app/src/main/res/drawable-xxhdpi/ic_settings_update_black.png create mode 100755 app/src/main/res/drawable-xxhdpi/ic_settings_update_white.png create mode 100755 app/src/main/res/drawable-xxxhdpi/ic_settings_update_black.png create mode 100755 app/src/main/res/drawable-xxxhdpi/ic_settings_update_white.png create mode 100755 app/src/main/res/drawable/drawable-hdpi/ic_settings_update_black.png create mode 100755 app/src/main/res/drawable/drawable-mdpi/ic_settings_update_black.png create mode 100755 app/src/main/res/drawable/drawable-xhdpi/ic_settings_update_black.png create mode 100755 app/src/main/res/drawable/drawable-xxhdpi/ic_settings_update_black.png create mode 100755 app/src/main/res/drawable/drawable-xxxhdpi/ic_settings_update_black.png delete mode 100644 app/src/main/res/drawable/ic_settings_update_black.xml create mode 100755 app/src/main/res/drawable/ic_settings_update_black/drawable-hdpi/ic_settings_update_black.png create mode 100755 app/src/main/res/drawable/ic_settings_update_black/drawable-mdpi/ic_settings_update_black.png create mode 100755 app/src/main/res/drawable/ic_settings_update_black/drawable-xhdpi/ic_settings_update_black.png create mode 100755 app/src/main/res/drawable/ic_settings_update_black/drawable-xxhdpi/ic_settings_update_black.png create mode 100755 app/src/main/res/drawable/ic_settings_update_black/drawable-xxxhdpi/ic_settings_update_black.png delete mode 100644 app/src/main/res/drawable/ic_settings_update_white.xml diff --git a/app/src/main/ic_settings_update_white-web.png b/app/src/main/ic_settings_update_white-web.png new file mode 100644 index 0000000000000000000000000000000000000000..60383b7901b4d341b2428782840b828ef3c65f9d GIT binary patch literal 9830 zcmdsd_g_<46ZZ{WP!J2fXySq{RS}RHR6?hy?%|I_IoU|9zKCpTKQRuD8H%Z}+D#W@!I5L3|0-gZv_;@ZZLmyLz>-3IO-!aOEGDa{EWFp*$lq%|Gz#jwzKSw(gF{RonnlV zYDt;UL6|Ete}G$aa7?@UmN!GV+QU20JB@f02uDKn4H;YY-&YjI%or^sE|>@tuj2(G z>Vxlh2;&p9)jnwffajL+@-FZkNQX8fJk(5}j1AInFw(~IK+Zv?HEj?KgUMUBsWBtG zgJ{WM7Zje#K6OGb^jcRh)UkoDtKxwhm20NO;E*Dr+16Yw29x9r%GC2zKihc7=E#o0 zs>5h0^mAvpJcUKn0YJXpFOU6Z0t|k^Vj7S!wJ(n~2$Ku#%YwM4@{&FJVMY2|6h|OML!UZU!NKehc*dJgk z0V|8EAsj<`_V4NeBE#_GdlG`)`MH}U<#JfRQ$py4ve9-3J$rF2B9;3MG_FN8V@|EG zNs*MoU%9Y`y05%8OI_e;J#>l{ap<^=9v8Wto2P*BqCFx(=qsk*1|fiHIp7p>1IOD4 z;62{3B~BVMJDQ5_9F3{4FdQS^IYXPgn;G5Cbn5JtY%EGpz^$;lZoRV zmPa?Ox#J$Pa|y``ob$X64b>H6PoU9VK;%kFCb>maaQkJ=6+6FA@fTML^AdAaXi z)>+P~iUbFgKknHL=+l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CJ$zpYmUS86qdOvQoah96zA zm}jQFSAAS3YiwK7?@SMntLWO{u7@9GE$)YYu5%QU!t3o3GVe>(+w?(Rqt0fFvo*-4 z=j+0RnBG%;q~oCNc?Wwp6e#(-1FtMJh)D+$B&hDoJfPng>S%*S`3LN_ zD&`LKBDXQaKj(_D1~Y8?6(q*7WaRCfQiE-YINPXJs{Ko^6is9d&Ui|4F2X+CvJuSF z9iGqjx?WlBTMeOi`nF9Lc>5$9MxS`3qtArADkldd_#vnVFn%;C(3WCWM|6sglYK%s zT2s!92Jz4p!FbH)X0uKH@NmV~^YkPoKcD0}J?V|K7X8rB5@Vl<%g^Njo8ea*Z+Tku zT{B$tbZ>F?bor2eD5Ap#yyzP8X#ekZkf+MLO|vc981Zmj_?!wjIFXH3Md_da9k=gQ zonaOl*jnJ%9&ViCRc=hf3T%R|&)n}h3K;PxVi8~-Oz-9jl>v^QD^h#UjL{McO~5r+ zGJGcq^0x|x2`6+!nCAB0C%+zKq&mJ0-h-v41R1kCqPUDbK2oGuO*=pab79*S1er z@(Vj=kUEX0M$dN%dAex{8ELQITc&MD9+tnaS(|W3K84L1mKHo6Rf7Ix=N}e5z47nu kgb$eizy8Mw0Q!Wv@Ug?C$yACMQn0pjh)dQLXFL=B4@?nqYybcN literal 0 HcmV?d00001 diff --git a/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java b/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java index af9b88ac1..706fec186 100644 --- a/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java +++ b/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java @@ -225,6 +225,6 @@ public class CheckForNewAppVersionTask extends AsyncTask { public static boolean isGithubApk() { - return getCertificateSHA1Fingerprint().equals(GITHUB_APK_SHA1); + return true; } } diff --git a/app/src/main/res/drawable-hdpi/ic_settings_update_black.png b/app/src/main/res/drawable-hdpi/ic_settings_update_black.png new file mode 100755 index 0000000000000000000000000000000000000000..cdd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!|50C|w|UK7*^D5JxLi zx);@ASWG#f+&Fq^V@M6^!PncqKCJU#nd+FjHjCwp3{8QJw0rl!`sEsMqnN3qx;84v zP@hePsr#GbUGSfik{y+qnCjRnFGE*g$u^Vvzu+O1rcdXlOfeU|lA--D;F3*__AgCe ztwHB5dm3rp^V#7IH5Zp*R;3Qo3c6#6yP7t3vr54mXz~qd-minJDZNaiUZ{j4^^s^B zlwY{Ifa5R(|5N%JJqn(gvLmxj2D~5kRQO9 z_L;-b0GpP#U(exKBu9TFKVjsnLw+@-Is#j31l9n>h3cDEjU>SU0000Px$x=BPqR7ef&l*=nbQ5?rFu`nLxQ6w9RvS1^5m58#pv9e%mqhx6z;=i!4wy?7y zW?`X_k`-H0UU|PCpYLtXbex$xXJ$XY`rLDV@0okg?*u_!Ja3@DD2cU;)y_Xe?+5*`6lue<3Q@1* z3*VrFZ1z9s@L?y@p7aavnJSH%!CfbOMS<%5J%ScfgR zHVxQ^qBE^KUmr1QHp0M&hXz*1{v6&TV)EwyZ{QF1J=`8(Lv9!V0000 CMBifo literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-mdpi/ic_settings_update_black.png b/app/src/main/res/drawable-mdpi/ic_settings_update_black.png new file mode 100755 index 0000000000000000000000000000000000000000..964553137f8d2d1138c49f86c6414fe6af9bbad9 GIT binary patch literal 379 zcmV->0fhdEP)Px$HAzH4R9Fe^l)Fj;Q4ogX-9ig1v9+?Ww6*ay6blPMQi<6348b~Gn&cTQ^8yxv zU~3^-i-9D@>-WPMGAxIH*-hmPe9XTyb7q#|?AB^wv4Pk?Y~a6dV4=hUHaNQrTQE%E zW^b#ExP%Y*NsRCpumUr+Wx99Z6KuG7y-*vLpmJNJ;|?^y27aO66VetxM^|cVbZbH% zY>50F93-SIcZ=SH%It(r-(UmGcijYOi<`eDrk5{m4|K4m-gjMRX`hqUJ-Kowr<~MnFE)QAcAStd=Jl-4 zvb5>P(}LUpef$202Cl literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-mdpi/ic_settings_update_white.png b/app/src/main/res/drawable-mdpi/ic_settings_update_white.png new file mode 100755 index 0000000000000000000000000000000000000000..cf4642f9720cf549caa4d3b429cff1e6fbf63549 GIT binary patch literal 562 zcmV-20?qx2P)Px$>`6pHR7ef&l(9=3K@^8~)kD0fkV_yEQV9_(v`~(y5fzN2w-6FY;T1M%gm9&W zApQ|4EUi-5S!j?HDH1d&hm{s-B7#vta~c)he80`iv3K0;-t|8C_Pu%U&3m&uv*UU9 zlJEumgt!+3fpRkN2wF`3CHlzs{Zlh`s@Mh;Z)0XJjKKhOfaCza!WSse=mK4zQ2a5x zhkbC#E`c08tgAW`9>5&@g(UeyLLSnIO-M>X7rcWa)GFsBPF8DB+5-}vlkf^&!XR{l zl>pNK|g0nKZNe&e(13C1iG^oeu=T(VB!H4NFAR?BB%%5llMR^VE_YW2Y|>}XIS@+qbq zmt^$@o38f8e~ey$(vKwD_!NtiGd1`SmtkTmveS z8hZwvF}6!x5qKL0X_AFiND{5OmX+(8(OuSR|77WI&{Z)G&maZ$$~6=AUR literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xhdpi/ic_settings_update_black.png b/app/src/main/res/drawable-xhdpi/ic_settings_update_black.png new file mode 100755 index 0000000000000000000000000000000000000000..0304e6fd140ffb51dd739b070f914e295fbc09eb GIT binary patch literal 954 zcmV;r14aCaP)Px&bV)=(RA>e5m^o+_Q4~PGYc%dL5!6&R3L+>33vFx^YefVbK@eM45Yq%~6txgc zVQFcjD1wa$HX&jmL_|>$_qeZdU(fku!espOXa3CpiNahsnKy6lz3;yJ-@LgmrBWe9 z28s+687MN4BLib{*v6SQ^I$Htz$9>tPw)z!z*nf7)N2A0h-fKvz+#vKGoc9_<1@U0 ze&~bCa1(w(F3CFq?G1bbEQdufAL7J-@56QIfs=3-Mnxtw>NdCl1Ms^>UZQ^%*1>of zQE_=3f_qSF;8Fc+_}B|3WJF{-qa25~5Dg~l{Zo7$goaOI9D|to50Ew3IJ?*Q?1Hh- zFxiA>2Z{?KZ~t?AZ)`;LzGUri8}bI3WPgh>S|PXiQ!a!~=!L7`HkcGZ-sg_d1*s(N zJK$b^7?y$Amu4K5i=fm*~eVM&64+h$XO zj)_uHSTZDuI%)j7Rr~H$N^-?9R?=&|lE!(QPCX}J0ci2}0Iad9 zt_FY7euxV!ZGSx{5FXQyrq%3fs3=G24I5-_H);YwJo-NZ!YT5vw=KxP}fp4uv+d-zz&!OX+>Ra@+8j~eGf~Qpq79u>ADOJXa*#S zI_hR!y5aH56WEWlaA(%G&XOh(1g~z^al&?%8Ra^|vNil5Yujzqb?u=)D)#wIovi+& zc4r*KgUh)(I{kvL=p=&ReHINO>%BYI7AVUK{yu`N&Z2gHk$1tYL2TO>)ys2#2Y*8! zO^c&FP|pLq%hEkw>a|3J3BSYVRv0GM+XukoT%efuI)E?9>nCh)GLAvT^MN0iPUwTM z(ZAC6o7D}iP!|7D6&AO*Uhr_^OJafLI`%~$O?l7YJ#Yd%54hCJGVEXwbPitUaa{!+ z&<-tN?J`o6F@Y{Wm-G#|2v@+;V@Rq^AW*XObpmbB3?n%KGw-=LIPTIcq{u*#fg%G% c2I`oBKfw!FKOJ^iGynhq07*qoM6N<$f)wPjaR2}S literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xhdpi/ic_settings_update_white.png b/app/src/main/res/drawable-xhdpi/ic_settings_update_white.png new file mode 100755 index 0000000000000000000000000000000000000000..9c71b13f7982ba89e77f96beeed0cbaf96a5b69e GIT binary patch literal 1010 zcmVPx&tVu*cRA>e5naOJuK@^8)CQ%dDXjEM0q=JG7DuV~TcoHvOj1mz<2#6OiZXo93 z(HOm%g9rZrFNzC#Py|H;5ibd%s7Tzhxs1_lGcg&zU+kVtW_o%$-8Ewl{ev&PRJ~X4 zRrOR=cOsEcVGo2o5cWXW0|9y<8o<`kG?U59rC=p2ff`U7L+~BCqS0uIqcIstfS_j) z(Pl`%MpzDYFbCAeFeITH+Tj_zCYf=LffOhK0++o4-w)eh1FVK(QotYJB|L>|B=MeO zA3o&Zj(Ar5b$+|zbL{#!U&9(Pm~+qZw7?O; z@1kZK#6equ=}6mzO(hIEDAx+@CUryu3EXh2R8U6nji4#bue4=w6^@5JI@eUK-(Eo{ zJ2pVY9gu_|GMT^-fpoz~NPy$hFp(XF8q!W!;h3HGntaM(O42bHmuC7Y8-oM* zzn@#ro`o)OGidO+eodb*!lAb3+B;o>$;XO|dKd!}GWiGVg6-MW~j($pW#vq|xcx~>_tr#G|wX;d#nv-5nFy6mMwJc7e7;74aM zng^QdvXp8yx2|}>$oK(Tg!)h`O$SH@W+p(WuqU|37GE| zs8gA2EZZOx$R{Px3qhm~I1US(0(H8lx|U6l&cj6}tppzFETHrlDhbWku2LPVuHQ!& z^Q_XEk{-LZ=&evM!L|mWldIH6EE^T8UgJy2El|p-z?24XBuq-3aTyA?7mdGwyKt2aW6}<$AOX98L{@RW6B3{oe7#U; z-xGsMNMEuCKwl_c!9#dX@Om@Ls%Qds4HD7TR|)8Ii2iv|$pqB%UC>S7`ce@p?18Wc g!X5~Fz-$lv1&a_iItI`d4gdfE07*qoM6N<$f*x(b4FCWD literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xxhdpi/ic_settings_update_black.png b/app/src/main/res/drawable-xxhdpi/ic_settings_update_black.png new file mode 100755 index 0000000000000000000000000000000000000000..7316dbc88983770f1f9f3e5c166336813c796787 GIT binary patch literal 1340 zcmV-C1;hG@P)Px(_DMuRRCodHo7;<3RUF4hQ!7out`^;c`kr+^Gebkkk^)JAq(D+2DUcLM3M2)R0!e|SKvE#K0@ETp)ZZnr0B(R~a4Xyh zzMBi$?{Ewb!{_iBjKX*DH%v*pj9RUQUGNp0hW|?P59z*yZE!za2vf#pQj-;M6s%}j zQM#o&L;e%67w&}EJph;WnZhguTg)lwR^dV3{YsfH!a_Ljgt~~JH^5OCM1(SV_u%6} zxB$)z^V{44c84+*tRu~Fd@YC8+toz49qOob)iNCPpN4tRN;9yxV9LaBHctF2O%G1)6e^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el3AkcSKd zVua(l;Le3jiM@Kd3FJLfi@A+Y4ku!07i)k7UxN|vYBHR&`QdA?DHkVuE@S%RUts6U zUlbzKy+@x7*=aW`1;>F>QSs`S0-#o*YZ*q?Ami_khSD!+Jppf(cF}Sq#-Q*$fIp8? zP7@SV9X=T|&q$MonM59*Ne&(*&PP-H@tW;VX^ci_GGH!nI*Mg|#l70`JpzRLmU zI@J&tB%Rah=L%)2^3$=gwKC1Myad_t2-eR9h|gZb+cLX}cAhqaF2z4gv&+aWH|H+N zW_`{=xVa_v3`+*JCCxs3DwbXwE>JyYt-kOnb)i}`Gz@UuXl?#nlL2$dJmoRt&U&_N z9QwHZkOl@$K=YdpcVX(_=4A6!US6r})25K>%8G{e*N4yq(5j95j}2VNdNJur^^u;k za@z32gu^S_jg>{~^FXS87iaWbt>*h5R_+gg5A;w}R9&8ryVhIn=54HqQJs9G5`Cp5 zA{BzE(lBA<$Km^8o3>5hQ;p*`Q{>+3QLC)>Sc3|T5YzEgsiz!$a;s! z{E@%6(SAF3bz4b$<*m2l68VoKS5xzG_>#$8IB^*5-o`~>-3}1VP zMGTP4UMWRd^wN-l>B8e2YB7`Eot=s0Lcb)0X~7-h-yO08Y}I%dhX`t5wi_akhg3XI zEV-vs=$%~^;WvUQU*dPFwO(t?Wth+=GuK}E0BuHpf{hj$=1zcXCMBpOXOFnVXyc~J zg|iX|5?qnsjYP{*$F=Z!Lpt5C6@yl&Uw|1s$nAww=LZAL8hVpx9KD=%O~10TFol*7 z>6Pmd2vd^cUDVBlB-J|H(E(j8M@$u3EnXFIPIOR+m-J&=TXIhQ@ACim7p{mMfTZQx| F`~%XSQ9l3x literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xxxhdpi/ic_settings_update_white.png b/app/src/main/res/drawable-xxxhdpi/ic_settings_update_white.png new file mode 100755 index 0000000000000000000000000000000000000000..8b5e6fa38c671e03b2a0b8eb31772031d01a6216 GIT binary patch literal 2037 zcmaLY`#;l-0tfK#Hny2%OLKY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?d7$zyGyHdbVN*jiQ?gJeQ@P?^$Hpw( z1vj(i6kc$lzZ@f#H8)8)NL(vv0|{NYde@T=@1l0>OBwRO zO$)Y;=;S`x#yE|$IbV$0-P;N`xaLQeR-ZE<*5>`kN)RnsT&mMAH>=HAjrx{tf|vDS z*W1&C-%GS5+NLNBQe)diO^uHItW|6LtT)a&O$o52q8~I_se(453XfyAzRgPwOKa3O z)#77L*(V7;+{uyCLr*n|jv!%8oMj0{_`yNEN$0=dsSU2(J>YhtblrCG`J_tqFHlTI zHbdjJYN5Oq>yv{R~~?`u5{7lF!FK6R;@LNh=CZ~hi|Hs=TMSQFcsRs_fW{BeNl;7X}J%i#VW D7xIJBsuwEZMZhtXJ?ObIx*K(VRbg-8F4%|1~c7*Kp%@WaM&h2M(2~V#_+`1@rJ6 zzBe;=)8@QFJ(*{P@8?#(yLp_4%}7&$bxDKB1g0PdE)PZ!$6+_uoQFHq6PVXDxF_&@ zxp(g12k9TCA6oz3Gb_rSurBKv*T%h@xHqg+%6j`&p#D}nU!TJxxd*EgCvN=~|9^L5 zJI~7*@uAAXrc4iiXZlG+Hi>ipxnA>*w@35>TkCse7OMT* z?l*(o^@qy6=&VP27TYhD+?W0!aMkUAp#jURTVkB^4=_ErJjoO6c|=HDn9Eepu;Oc! U)=K@?z!+fgboFyt=akR{04@o<&Hw-a literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable/drawable-mdpi/ic_settings_update_black.png b/app/src/main/res/drawable/drawable-mdpi/ic_settings_update_black.png new file mode 100755 index 0000000000000000000000000000000000000000..964553137f8d2d1138c49f86c6414fe6af9bbad9 GIT binary patch literal 379 zcmV->0fhdEP)Px$HAzH4R9Fe^l)Fj;Q4ogX-9ig1v9+?Ww6*ay6blPMQi<6348b~Gn&cTQ^8yxv zU~3^-i-9D@>-WPMGAxIH*-hmPe9XTyb7q#|?AB^wv4Pk?Y~a6dV4=hUHaNQrTQE%E zW^b#ExP%Y*NsRCpumUr+Wx99Z6KuG7y-*vLpmJNJ;|?^y27aO66VetxM^|cVbZbH% zY>50F93-SIcZ=SH%It(r-(UmGcijYOi<`eDrk5{m4|K4m-gjMRX`hqUJ-Kowr<~MnFE)QAcAStd=Jl-4 zvb5>P(}LUpef$202Cl literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable/drawable-xhdpi/ic_settings_update_black.png b/app/src/main/res/drawable/drawable-xhdpi/ic_settings_update_black.png new file mode 100755 index 0000000000000000000000000000000000000000..049edf0d876c5964133ec3e7ed787e284ddf1954 GIT binary patch literal 710 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=jKx9jP7LeL$-HD>U~2GmaSW+o zd^^oHThvjcP1u)(d$AyQAU7w+v@D&_Yi=$%e>DHGtQBbzV`I4(ub}D7WVTV{;F4~I z8xbp3ENIfun)SR@Hsamf!t}|r-`sm${UEjMe9hd?XO6$SG2<+Y&jFn1pEA>9-6vKj z=eS=`+_HVnf9t30U-A-UHr{$l=@)iu-dIb)r6U-Y)Ji1fCcop7``WO_yZU*lgg?#{XF9se|6`RaYIZQU1~q2c?yLhh;B?5y&B!;*TQ z)|YMe-Fb^mrxZU6?qvTjeay0P+fg+(i&rMeXBTFBod3V+bqH6$Rlko#+h1wS|9aA< zKhE`))#FQ%@eYYsU!77C+F7%*&VPmQg2O9%>&2J(-j-V>w=m>`VZETF-@b_GpZ^w| z&ycw_*a+5(kV_od_{gK=MU2ERK zvi=+Y?dKQm|DEm%zrFMNljxNe{-4$u&)?J?GRL`lC7bor>-M!dv%_lhGbb}^9jTeg z{&i)aV0E30)t1P*lN=!jwH4P!%@s8{;c3?sX?}0p_4P*1Ii*SazHhnuYMD;?)5ACJ z2Qj~0@?ULoYeSKjW5?STruuiM+AF_A=G;9eaL`?(>6GTwj8b)z*q;W+=U&^a&hYoY zy^G?CJ3#_nLB8Q}#V_tZHhI9}Iaf{Qp-??F8bk@_U ze=J_j$#gAIzvG}E@J@Y`-cR|SrQH7MakuvcYx~=n2^%otL=t>V((ikkB%aAm*bYpX N44$rjF6*2UngDR^J5c}t literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable/drawable-xxhdpi/ic_settings_update_black.png b/app/src/main/res/drawable/drawable-xxhdpi/ic_settings_update_black.png new file mode 100755 index 0000000000000000000000000000000000000000..10ae87baed7fa8ea0d0b78de6bb76f7a65ca5c83 GIT binary patch literal 1091 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD1|%QND7OGojKx9jP7LeL$-HD>VE*gr;uuoF z_;%Lm)xLo;$JduXs_L0?oaOp#BgYlH+3&fqxv;UF>Zxy-wBLcPt5aplB%=ckbF|Hu zXbX2Ws`T?1d^n-J{`~fLXWy2bi>rRW`Mq8G{ojADE`N73d+q&OuQz|YmA<|)+qtb-oso0l4VTvA6GF@Omi3=lIrTw@;f4uD zv1`Aom{tAJ+i9KjOa78;vc%uajF6(3-}X=JSr;E@Y%Gi5-RRxUzxDrU+LvP zf9D<9x&GpOVr*~d$jdVTOsC2G6Wv}sxk2~r-P71}E?3%kUac!-W zdgUUKonKs*>^)f$|Y|M-g?PbeHW6-*jseB zdodf&id@!LPx)o{Uv;>zd-;nmGn0x3)8;iTE4Jr)6vgcP#<{fL=HC0|v7Ca}ObQE& zCQo_!Hs|GI3uO8M&IeQNrWKcE2`mfls?F&pX{?y?Wi$K=qgF8=EJU z)|al%QlGS6jH^?y^~GJ+*WzN7-fx*+&&t;ucLK6UgrSE?L literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable/drawable-xxxhdpi/ic_settings_update_black.png b/app/src/main/res/drawable/drawable-xxxhdpi/ic_settings_update_black.png new file mode 100755 index 0000000000000000000000000000000000000000..49ac8ea654e4f48096c13cdb32633705825c5981 GIT binary patch literal 2029 zcmc(g{Xf$S8^^yJ+ZqRrh~?p+4doWcLt=7=bL9CXr1G@fg%+j<&tkJBloAJFiiMnt zo!irHlG!kh40jBXeaDG|X-i}>9Oth%ug~Xmy??oWxL(&UpX{H#U6mBj3IG5oxt(_L z-DAez*$3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ur5in*3CIL23Fi z&n!F6WFK|$1*3(hs8hG1s>({adGt@?_5Zy6uirUU=9pDKE@>J@Gnqh%`&z%ys7q}p zy;OR9WC@tp`%<3%W{iOpg3lROhDg8W-HBRy$Ozx&^ZXdvn!3HFas{mX(1e8>*_Bbd z*19xU(3X`(_2CSf_yQ~60w|)m{d_J^*^}G|x-%h5^_xMLB0bvjxW&R?;yl61-3`Dn zH5g`FlNp9_Xxj_R=zJPIFamfou2bQ9O>TK-nE^*Xc%=Got(bQLQ(=>jwcot0eolIoU?Sdr^W?r>SUlPkLg*BH@e85fz+nCz7f}rQ1!+g_uukr zK$s14)mjOc+s`JQwxd${0hIX zKd7%e8>k#Z;gJV#u@}P(m?@EVxU)q4b~!#L!hGLtkA8~zDOHR8a{rizdsvPucn{Go T%FJM|zX7)&y - - diff --git a/app/src/main/res/drawable/ic_settings_update_black/drawable-hdpi/ic_settings_update_black.png b/app/src/main/res/drawable/ic_settings_update_black/drawable-hdpi/ic_settings_update_black.png new file mode 100755 index 0000000000000000000000000000000000000000..1e318eecc2817d0da257bfbfd8b96aabca214f04 GIT binary patch literal 431 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA1|-9oezpTC#^NA%Cx&(BWL^TIJBsuwEZMZhtXJ?ObIx*K(VRbg-8F4%|1~c7*Kp%@WaM&h2M(2~V#_+`1@rJ6 zzBe;=)8@QFJ(*{P@8?#(yLp_4%}7&$bxDKB1g0PdE)PZ!$6+_uoQFHq6PVXDxF_&@ zxp(g12k9TCA6oz3Gb_rSurBKv*T%h@xHqg+%6j`&p#D}nU!TJxxd*EgCvN=~|9^L5 zJI~7*@uAAXrc4iiXZlG+Hi>ipxnA>*w@35>TkCse7OMT* z?l*(o^@qy6=&VP27TYhD+?W0!aMkUAp#jURTVkB^4=_ErJjoO6c|=HDn9Eepu;Oc! U)=K@?z!+fgboFyt=akR{04@o<&Hw-a literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable/ic_settings_update_black/drawable-mdpi/ic_settings_update_black.png b/app/src/main/res/drawable/ic_settings_update_black/drawable-mdpi/ic_settings_update_black.png new file mode 100755 index 0000000000000000000000000000000000000000..964553137f8d2d1138c49f86c6414fe6af9bbad9 GIT binary patch literal 379 zcmV->0fhdEP)Px$HAzH4R9Fe^l)Fj;Q4ogX-9ig1v9+?Ww6*ay6blPMQi<6348b~Gn&cTQ^8yxv zU~3^-i-9D@>-WPMGAxIH*-hmPe9XTyb7q#|?AB^wv4Pk?Y~a6dV4=hUHaNQrTQE%E zW^b#ExP%Y*NsRCpumUr+Wx99Z6KuG7y-*vLpmJNJ;|?^y27aO66VetxM^|cVbZbH% zY>50F93-SIcZ=SH%It(r-(UmGcijYOi<`eDrk5{m4|K4m-gjMRX`hqUJ-Kowr<~MnFE)QAcAStd=Jl-4 zvb5>P(}LUpef$202Cl literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable/ic_settings_update_black/drawable-xhdpi/ic_settings_update_black.png b/app/src/main/res/drawable/ic_settings_update_black/drawable-xhdpi/ic_settings_update_black.png new file mode 100755 index 0000000000000000000000000000000000000000..049edf0d876c5964133ec3e7ed787e284ddf1954 GIT binary patch literal 710 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=jKx9jP7LeL$-HD>U~2GmaSW+o zd^^oHThvjcP1u)(d$AyQAU7w+v@D&_Yi=$%e>DHGtQBbzV`I4(ub}D7WVTV{;F4~I z8xbp3ENIfun)SR@Hsamf!t}|r-`sm${UEjMe9hd?XO6$SG2<+Y&jFn1pEA>9-6vKj z=eS=`+_HVnf9t30U-A-UHr{$l=@)iu-dIb)r6U-Y)Ji1fCcop7``WO_yZU*lgg?#{XF9se|6`RaYIZQU1~q2c?yLhh;B?5y&B!;*TQ z)|YMe-Fb^mrxZU6?qvTjeay0P+fg+(i&rMeXBTFBod3V+bqH6$Rlko#+h1wS|9aA< zKhE`))#FQ%@eYYsU!77C+F7%*&VPmQg2O9%>&2J(-j-V>w=m>`VZETF-@b_GpZ^w| z&ycw_*a+5(kV_od_{gK=MU2ERK zvi=+Y?dKQm|DEm%zrFMNljxNe{-4$u&)?J?GRL`lC7bor>-M!dv%_lhGbb}^9jTeg z{&i)aV0E30)t1P*lN=!jwH4P!%@s8{;c3?sX?}0p_4P*1Ii*SazHhnuYMD;?)5ACJ z2Qj~0@?ULoYeSKjW5?STruuiM+AF_A=G;9eaL`?(>6GTwj8b)z*q;W+=U&^a&hYoY zy^G?CJ3#_nLB8Q}#V_tZHhI9}Iaf{Qp-??F8bk@_U ze=J_j$#gAIzvG}E@J@Y`-cR|SrQH7MakuvcYx~=n2^%otL=t>V((ikkB%aAm*bYpX N44$rjF6*2UngDR^J5c}t literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable/ic_settings_update_black/drawable-xxhdpi/ic_settings_update_black.png b/app/src/main/res/drawable/ic_settings_update_black/drawable-xxhdpi/ic_settings_update_black.png new file mode 100755 index 0000000000000000000000000000000000000000..10ae87baed7fa8ea0d0b78de6bb76f7a65ca5c83 GIT binary patch literal 1091 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD1|%QND7OGojKx9jP7LeL$-HD>VE*gr;uuoF z_;%Lm)xLo;$JduXs_L0?oaOp#BgYlH+3&fqxv;UF>Zxy-wBLcPt5aplB%=ckbF|Hu zXbX2Ws`T?1d^n-J{`~fLXWy2bi>rRW`Mq8G{ojADE`N73d+q&OuQz|YmA<|)+qtb-oso0l4VTvA6GF@Omi3=lIrTw@;f4uD zv1`Aom{tAJ+i9KjOa78;vc%uajF6(3-}X=JSr;E@Y%Gi5-RRxUzxDrU+LvP zf9D<9x&GpOVr*~d$jdVTOsC2G6Wv}sxk2~r-P71}E?3%kUac!-W zdgUUKonKs*>^)f$|Y|M-g?PbeHW6-*jseB zdodf&id@!LPx)o{Uv;>zd-;nmGn0x3)8;iTE4Jr)6vgcP#<{fL=HC0|v7Ca}ObQE& zCQo_!Hs|GI3uO8M&IeQNrWKcE2`mfls?F&pX{?y?Wi$K=qgF8=EJU z)|al%QlGS6jH^?y^~GJ+*WzN7-fx*+&&t;ucLK6UgrSE?L literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable/ic_settings_update_black/drawable-xxxhdpi/ic_settings_update_black.png b/app/src/main/res/drawable/ic_settings_update_black/drawable-xxxhdpi/ic_settings_update_black.png new file mode 100755 index 0000000000000000000000000000000000000000..49ac8ea654e4f48096c13cdb32633705825c5981 GIT binary patch literal 2029 zcmc(g{Xf$S8^^yJ+ZqRrh~?p+4doWcLt=7=bL9CXr1G@fg%+j<&tkJBloAJFiiMnt zo!irHlG!kh40jBXeaDG|X-i}>9Oth%ug~Xmy??oWxL(&UpX{H#U6mBj3IG5oxt(_L z-DAez*$3a7oRj#0JwR^wx;g>%JncmQK-9XqobpSAtduQ32tKQsbunS-|3wsJ8mDxegtUoa*Ima^3#>+cyAUe#-l9o=_vzPf1 zHBRW6>R_o&CwrZt6K4)~1v9iovUiogZ(O-pOCsEj3ezISZz3<~_`6?qqHH+Abjevl zv@LuoCp=1uD^V`WYRJ;N*p7`%f!ZF?qh2POj81M^rGHNZ45cJg|(tU-xGQ~iM^45a+( z2d@2+H_5VVyMr!JZ`+-5VPcuU8;UhJ%kZ}dux<=BiT{RUqRiy0haj$D1#Y5dT3UVP z7(?}fI>v|cew5m%o#~nzqjUGTYvxl z*fEbI5bw|YZ(JdocuPh-X5+k{ey)&bUKuubRPO$wh(|-a=89MlF_+ z&5-lVXaE(7WlU7g7Eo6xPYe~amrq6dD}B6eZ;@|=U1gaUWnviWA=KlbrBo|t(xlKg zRA*hW(#!hEl*1+FkGMmo1fQ<(;qE$2@ro|yEx_L)2o;Pm`t4Kb%~+cHO%ZAA7jUvS zR$_CF(o3hv6L&?6Gi$xkqbYKEsRdytL{N`Ya{?n{e0S2s9Qr9GMQC$X$z$3;LLBIh z#koKHv?kX5wyRo1odV+{Wyb9kRdYpD#m@SnvM5kaQ+`<_6rLeAd^SCn+Axso@ceq~ zY}MGxOeBXYtOk>~Tzd4goX(^Akn)}FYaKZfRu89mNXR{jw#xnklnm$k|r|%;)O^hPjoEh}I(Uoe`JX z`Kis8^B+;omszXhk%bR|DT}9(uCe|?=-@9cjVv)k;itBRPopyLg^k8P=T>(W#Dg0j z{@$yfaZp-&!T0Y4?tf59$vU)6;f6#&?R#MYI@lEYv9I=jl?>7OU(xqfRYAk=$`vgM z=J<{`Dme13--96?E;`n`lI6WeO6&0SGfvRdyCf=jml1PLs~)M{(IP&cs~wj)yi%SK zs^Zm8<2AI+PwjMlR&;#nC_U(fYgM+^@gDesxAALcpOiT~mOsmaRnd7XRfNn;PH88g z3$gE9D)lMI>c-wq)|)x;M{Bsu8Ho&Y^@N}6zJWIwMa8u95CdH{6Ur5in*3CIL23Fi z&n!F6WFK|$1*3(hs8hG1s>({adGt@?_5Zy6uirUU=9pDKE@>J@Gnqh%`&z%ys7q}p zy;OR9WC@tp`%<3%W{iOpg3lROhDg8W-HBRy$Ozx&^ZXdvn!3HFas{mX(1e8>*_Bbd z*19xU(3X`(_2CSf_yQ~60w|)m{d_J^*^}G|x-%h5^_xMLB0bvjxW&R?;yl61-3`Dn zH5g`FlNp9_Xxj_R=zJPIFamfou2bQ9O>TK-nE^*Xc%=Got(bQLQ(=>jwcot0eolIoU?Sdr^W?r>SUlPkLg*BH@e85fz+nCz7f}rQ1!+g_uukr zK$s14)mjOc+s`JQwxd${0hIX zKd7%e8>k#Z;gJV#u@}P(m?@EVxU)q4b~!#L!hGLtkA8~zDOHR8a{rizdsvPucn{Go T%FJM|zX7)&y - - From c864b15c34524bdfe83eb6faf3c6d438b3a453a6 Mon Sep 17 00:00:00 2001 From: krtkush Date: Mon, 26 Nov 2018 01:18:33 +0530 Subject: [PATCH 29/29] Test code revert. --- .../main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java b/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java index 706fec186..af9b88ac1 100644 --- a/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java +++ b/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java @@ -225,6 +225,6 @@ public class CheckForNewAppVersionTask extends AsyncTask { public static boolean isGithubApk() { - return true; + return getCertificateSHA1Fingerprint().equals(GITHUB_APK_SHA1); } }