From 2b8837609bed291969961f351e5d128fb90bb65f Mon Sep 17 00:00:00 2001 From: bopol Date: Sat, 19 Dec 2020 14:48:03 +0100 Subject: [PATCH 01/31] dynamically get package name it fixes issues with forks or debug builds, e.g. when you open two newpipe apps (with debug or fork apps), close one notification, it closes all newpipe notifications fixes https://github.com/TeamNewPipe/NewPipe/issues/4653 --- app/src/main/java/org/schabi/newpipe/App.java | 4 +++- .../fragments/detail/VideoDetailFragment.java | 18 ++++++++-------- .../local/feed/service/FeedLoadService.kt | 3 ++- .../services/SubscriptionsExportService.java | 3 ++- .../services/SubscriptionsImportService.java | 3 ++- .../org/schabi/newpipe/player/MainPlayer.java | 21 ++++++++++--------- 6 files changed, 29 insertions(+), 23 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/App.java b/app/src/main/java/org/schabi/newpipe/App.java index e6dce4d67..7e3466f67 100644 --- a/app/src/main/java/org/schabi/newpipe/App.java +++ b/app/src/main/java/org/schabi/newpipe/App.java @@ -67,8 +67,10 @@ import io.reactivex.rxjava3.plugins.RxJavaPlugins; public class App extends MultiDexApplication { protected static final String TAG = App.class.toString(); private static App app; + public static final String PACKAGE_NAME = BuildConfig.APPLICATION_ID; - @Nullable private Disposable disposable = null; + @Nullable + private Disposable disposable = null; @NonNull public static App getApp() { diff --git a/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java index 427cff06e..d0a1584a9 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java @@ -145,15 +145,15 @@ public final class VideoDetailFragment private static final float MAX_PLAYER_HEIGHT = 0.7f; public static final String ACTION_SHOW_MAIN_PLAYER = - "org.schabi.newpipe.VideoDetailFragment.ACTION_SHOW_MAIN_PLAYER"; + App.PACKAGE_NAME + ".VideoDetailFragment.ACTION_SHOW_MAIN_PLAYER"; public static final String ACTION_HIDE_MAIN_PLAYER = - "org.schabi.newpipe.VideoDetailFragment.ACTION_HIDE_MAIN_PLAYER"; + App.PACKAGE_NAME + ".VideoDetailFragment.ACTION_HIDE_MAIN_PLAYER"; public static final String ACTION_PLAYER_STARTED = - "org.schabi.newpipe.VideoDetailFragment.ACTION_PLAYER_STARTED"; + App.PACKAGE_NAME + ".VideoDetailFragment.ACTION_PLAYER_STARTED"; public static final String ACTION_VIDEO_FRAGMENT_RESUMED = - "org.schabi.newpipe.VideoDetailFragment.ACTION_VIDEO_FRAGMENT_RESUMED"; + App.PACKAGE_NAME + ".VideoDetailFragment.ACTION_VIDEO_FRAGMENT_RESUMED"; public static final String ACTION_VIDEO_FRAGMENT_STOPPED = - "org.schabi.newpipe.VideoDetailFragment.ACTION_VIDEO_FRAGMENT_STOPPED"; + App.PACKAGE_NAME + ".VideoDetailFragment.ACTION_VIDEO_FRAGMENT_STOPPED"; private static final String COMMENTS_TAB_TAG = "COMMENTS"; private static final String RELATED_TAB_TAG = "NEXT VIDEO"; @@ -494,10 +494,10 @@ public final class VideoDetailFragment final PlaylistAppendDialog d = PlaylistAppendDialog.fromStreamInfo(currentInfo); disposables.add( - PlaylistAppendDialog.onPlaylistFound(getContext(), - () -> d.show(getFM(), TAG), - () -> PlaylistCreationDialog.newInstance(d).show(getFM(), TAG) - ) + PlaylistAppendDialog.onPlaylistFound(getContext(), + () -> d.show(getFM(), TAG), + () -> PlaylistCreationDialog.newInstance(d).show(getFM(), TAG) + ) ); } break; diff --git a/app/src/main/java/org/schabi/newpipe/local/feed/service/FeedLoadService.kt b/app/src/main/java/org/schabi/newpipe/local/feed/service/FeedLoadService.kt index 2a0aa1c90..45e8855e7 100644 --- a/app/src/main/java/org/schabi/newpipe/local/feed/service/FeedLoadService.kt +++ b/app/src/main/java/org/schabi/newpipe/local/feed/service/FeedLoadService.kt @@ -43,6 +43,7 @@ import io.reactivex.rxjava3.processors.PublishProcessor import io.reactivex.rxjava3.schedulers.Schedulers import org.reactivestreams.Subscriber import org.reactivestreams.Subscription +import org.schabi.newpipe.App import org.schabi.newpipe.MainActivity.DEBUG import org.schabi.newpipe.R import org.schabi.newpipe.database.feed.model.FeedGroupEntity @@ -68,7 +69,7 @@ class FeedLoadService : Service() { companion object { private val TAG = FeedLoadService::class.java.simpleName private const val NOTIFICATION_ID = 7293450 - private const val ACTION_CANCEL = "org.schabi.newpipe.local.feed.service.FeedLoadService.CANCEL" + private const val ACTION_CANCEL = App.PACKAGE_NAME + ".local.feed.service.FeedLoadService.CANCEL" /** * How often the notification will be updated. diff --git a/app/src/main/java/org/schabi/newpipe/local/subscription/services/SubscriptionsExportService.java b/app/src/main/java/org/schabi/newpipe/local/subscription/services/SubscriptionsExportService.java index 982701d1f..5dfb1bfe5 100644 --- a/app/src/main/java/org/schabi/newpipe/local/subscription/services/SubscriptionsExportService.java +++ b/app/src/main/java/org/schabi/newpipe/local/subscription/services/SubscriptionsExportService.java @@ -27,6 +27,7 @@ import androidx.localbroadcastmanager.content.LocalBroadcastManager; import org.reactivestreams.Subscriber; import org.reactivestreams.Subscription; +import org.schabi.newpipe.App; import org.schabi.newpipe.R; import org.schabi.newpipe.database.subscription.SubscriptionEntity; import org.schabi.newpipe.extractor.subscription.SubscriptionItem; @@ -50,7 +51,7 @@ public class SubscriptionsExportService extends BaseImportExportService { * A {@link LocalBroadcastManager local broadcast} will be made with this action * when the export is successfully completed. */ - public static final String EXPORT_COMPLETE_ACTION = "org.schabi.newpipe.local.subscription" + public static final String EXPORT_COMPLETE_ACTION = App.PACKAGE_NAME + ".local.subscription" + ".services.SubscriptionsExportService.EXPORT_COMPLETE"; private Subscription subscription; diff --git a/app/src/main/java/org/schabi/newpipe/local/subscription/services/SubscriptionsImportService.java b/app/src/main/java/org/schabi/newpipe/local/subscription/services/SubscriptionsImportService.java index b1c67719c..90d0afe37 100644 --- a/app/src/main/java/org/schabi/newpipe/local/subscription/services/SubscriptionsImportService.java +++ b/app/src/main/java/org/schabi/newpipe/local/subscription/services/SubscriptionsImportService.java @@ -29,6 +29,7 @@ import androidx.localbroadcastmanager.content.LocalBroadcastManager; import org.reactivestreams.Subscriber; import org.reactivestreams.Subscription; +import org.schabi.newpipe.App; import org.schabi.newpipe.R; import org.schabi.newpipe.database.subscription.SubscriptionEntity; import org.schabi.newpipe.extractor.NewPipe; @@ -66,7 +67,7 @@ public class SubscriptionsImportService extends BaseImportExportService { * A {@link LocalBroadcastManager local broadcast} will be made with this action * when the import is successfully completed. */ - public static final String IMPORT_COMPLETE_ACTION = "org.schabi.newpipe.local.subscription" + public static final String IMPORT_COMPLETE_ACTION = App.PACKAGE_NAME + ".local.subscription" + ".services.SubscriptionsImportService.IMPORT_COMPLETE"; /** diff --git a/app/src/main/java/org/schabi/newpipe/player/MainPlayer.java b/app/src/main/java/org/schabi/newpipe/player/MainPlayer.java index 63f6a400e..49c836346 100644 --- a/app/src/main/java/org/schabi/newpipe/player/MainPlayer.java +++ b/app/src/main/java/org/schabi/newpipe/player/MainPlayer.java @@ -33,6 +33,7 @@ import android.view.WindowManager; import androidx.annotation.Nullable; import androidx.core.content.ContextCompat; +import org.schabi.newpipe.App; import org.schabi.newpipe.R; import org.schabi.newpipe.util.ThemeHelper; @@ -64,25 +65,25 @@ public final class MainPlayer extends Service { //////////////////////////////////////////////////////////////////////////*/ static final String ACTION_CLOSE - = "org.schabi.newpipe.player.MainPlayer.CLOSE"; + = App.PACKAGE_NAME + ".player.MainPlayer.CLOSE"; static final String ACTION_PLAY_PAUSE - = "org.schabi.newpipe.player.MainPlayer.PLAY_PAUSE"; + = App.PACKAGE_NAME + ".player.MainPlayer.PLAY_PAUSE"; static final String ACTION_OPEN_CONTROLS - = "org.schabi.newpipe.player.MainPlayer.OPEN_CONTROLS"; + = App.PACKAGE_NAME + ".player.MainPlayer.OPEN_CONTROLS"; static final String ACTION_REPEAT - = "org.schabi.newpipe.player.MainPlayer.REPEAT"; + = App.PACKAGE_NAME + ".player.MainPlayer.REPEAT"; static final String ACTION_PLAY_NEXT - = "org.schabi.newpipe.player.MainPlayer.ACTION_PLAY_NEXT"; + = App.PACKAGE_NAME + ".player.MainPlayer.ACTION_PLAY_NEXT"; static final String ACTION_PLAY_PREVIOUS - = "org.schabi.newpipe.player.MainPlayer.ACTION_PLAY_PREVIOUS"; + = App.PACKAGE_NAME + ".player.MainPlayer.ACTION_PLAY_PREVIOUS"; static final String ACTION_FAST_REWIND - = "org.schabi.newpipe.player.MainPlayer.ACTION_FAST_REWIND"; + = App.PACKAGE_NAME + ".player.MainPlayer.ACTION_FAST_REWIND"; static final String ACTION_FAST_FORWARD - = "org.schabi.newpipe.player.MainPlayer.ACTION_FAST_FORWARD"; + = App.PACKAGE_NAME + ".player.MainPlayer.ACTION_FAST_FORWARD"; static final String ACTION_SHUFFLE - = "org.schabi.newpipe.player.MainPlayer.ACTION_SHUFFLE"; + = App.PACKAGE_NAME + ".player.MainPlayer.ACTION_SHUFFLE"; public static final String ACTION_RECREATE_NOTIFICATION - = "org.schabi.newpipe.player.MainPlayer.ACTION_RECREATE_NOTIFICATION"; + = App.PACKAGE_NAME + ".player.MainPlayer.ACTION_RECREATE_NOTIFICATION"; /*////////////////////////////////////////////////////////////////////////// // Service's LifeCycle From b5bf0d7e1d2e47fbac39333e194671eafb3997f3 Mon Sep 17 00:00:00 2001 From: opusforlife2 <53176348+opusforlife2@users.noreply.github.com> Date: Tue, 22 Dec 2020 16:58:29 +0000 Subject: [PATCH 02/31] Export -> Import --- README.ko.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.ko.md b/README.ko.md index a86eae8d9..460a90dc1 100644 --- a/README.ko.md +++ b/README.ko.md @@ -98,7 +98,7 @@ NewPipe 코드의 변경이 있을 때(기능 추가 또는 버그 수정으로 1. 당신의 기록, 구독, 그리고 재생목록을 유지할 수 있도록 Settings > Content > Export Database 를 통해 데이터를 백업하십시오. 2. NewPipe를 삭제하십시오. 3. 새로운 소스에서 APK를 다운로드하고 이것을 설치하십시오. -4. Step 1의 Settings > Content > Export Database 을 통해 데이터를 불러오십시오. +4. Step 1의 Settings > Content > Import Database 을 통해 데이터를 불러오십시오. ## Contribution 당신이 아이디어, 번역, 디자인 변경, 코드 정리, 또는 정말 큰 코드 수정에 대한 의견이 있다면, 도움은 항상 환영합니다. From b2e9981313ad338b173de7123dfa5f65493a0914 Mon Sep 17 00:00:00 2001 From: Isira Seneviratne Date: Wed, 23 Dec 2020 20:06:02 +0530 Subject: [PATCH 03/31] Fix queue display in ServicePlayerActivity. --- .../java/org/schabi/newpipe/player/ServicePlayerActivity.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/player/ServicePlayerActivity.java b/app/src/main/java/org/schabi/newpipe/player/ServicePlayerActivity.java index 41d66dc90..fd20fd175 100644 --- a/app/src/main/java/org/schabi/newpipe/player/ServicePlayerActivity.java +++ b/app/src/main/java/org/schabi/newpipe/player/ServicePlayerActivity.java @@ -638,12 +638,12 @@ public abstract class ServicePlayerActivity extends AppCompatActivity case BasePlayer.STATE_COMPLETED: queueControlBinding.controlPlayPause.setClickable(true); queueControlBinding.controlPlayPause.setVisibility(View.VISIBLE); - queueControlBinding.progressBar.setVisibility(View.GONE); + queueControlBinding.controlProgressBar.setVisibility(View.GONE); break; default: queueControlBinding.controlPlayPause.setClickable(false); queueControlBinding.controlPlayPause.setVisibility(View.INVISIBLE); - queueControlBinding.progressBar.setVisibility(View.VISIBLE); + queueControlBinding.controlProgressBar.setVisibility(View.VISIBLE); break; } } From ced3898499c1157e67cb82f176fcd128c0263506 Mon Sep 17 00:00:00 2001 From: TobiGr Date: Wed, 23 Dec 2020 16:45:56 +0100 Subject: [PATCH 04/31] Add Somali (Af Soomaali)[so] to app language chooser --- app/src/main/res/values/settings_keys.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/res/values/settings_keys.xml b/app/src/main/res/values/settings_keys.xml index a861b9607..44e75c10c 100644 --- a/app/src/main/res/values/settings_keys.xml +++ b/app/src/main/res/values/settings_keys.xml @@ -1067,6 +1067,7 @@ sc sk sl + so sq sr sv @@ -1144,6 +1145,7 @@ sardu Slovenčina Slovenščina + Af Soomaali Shqip Српски Svenska From eddc12693ab42114132116cf79589685750a7af2 Mon Sep 17 00:00:00 2001 From: TobiGr Date: Wed, 23 Dec 2020 19:58:02 +0100 Subject: [PATCH 05/31] [media.ccc.de] Fix service color Caused by changing service name in TeamNewPipe/NewPipeExtractor#472 --- app/src/main/AndroidManifest.xml | 2 +- app/src/main/java/org/schabi/newpipe/MainActivity.java | 2 +- app/src/main/res/values-v21/styles_services.xml | 9 +++++---- app/src/main/res/values/colors_services.xml | 2 +- app/src/main/res/values/styles_services.xml | 8 ++++---- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index f0a38b54f..d240d123f 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -266,7 +266,7 @@ - + diff --git a/app/src/main/java/org/schabi/newpipe/MainActivity.java b/app/src/main/java/org/schabi/newpipe/MainActivity.java index ff078fa2c..0c784e9d5 100644 --- a/app/src/main/java/org/schabi/newpipe/MainActivity.java +++ b/app/src/main/java/org/schabi/newpipe/MainActivity.java @@ -129,7 +129,7 @@ public class MainActivity extends AppCompatActivity { + "savedInstanceState = [" + savedInstanceState + "]"); } - // enable TLS1.1/1.2 for kitkat devices, to fix download and play for mediaCCC sources + // enable TLS1.1/1.2 for kitkat devices, to fix download and play for media.ccc.de sources if (Build.VERSION.SDK_INT == Build.VERSION_CODES.KITKAT) { TLSSocketFactoryCompat.setAsDefault(); } diff --git a/app/src/main/res/values-v21/styles_services.xml b/app/src/main/res/values-v21/styles_services.xml index e5b675ef8..c495a9a31 100644 --- a/app/src/main/res/values-v21/styles_services.xml +++ b/app/src/main/res/values-v21/styles_services.xml @@ -12,6 +12,7 @@ + - - - - - - - -