diff --git a/app/src/main/java/org/schabi/newpipelegacy/about/License.java b/app/src/main/java/org/schabi/newpipelegacy/about/License.java deleted file mode 100644 index e69de29bb..000000000 diff --git a/app/src/main/java/org/schabi/newpipelegacy/about/LicenseFragmentHelper.java b/app/src/main/java/org/schabi/newpipelegacy/about/LicenseFragmentHelper.java index ec3db80d6..9beee1ea0 100644 --- a/app/src/main/java/org/schabi/newpipelegacy/about/LicenseFragmentHelper.java +++ b/app/src/main/java/org/schabi/newpipelegacy/about/LicenseFragmentHelper.java @@ -14,7 +14,6 @@ import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; -import java.nio.charset.StandardCharsets; import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers; import io.reactivex.rxjava3.core.Observable; @@ -38,7 +37,7 @@ private static String getFormattedLicense(@NonNull final Context context, final StringBuilder licenseContent = new StringBuilder(); final String webViewData; try (BufferedReader in = new BufferedReader(new InputStreamReader( - context.getAssets().open(license.getFilename()), StandardCharsets.UTF_8))) { + context.getAssets().open(license.getFilename()), "utf-8"))) { String str; while ((str = in.readLine()) != null) { licenseContent.append(str); @@ -84,6 +83,7 @@ private static String getHexRGBColor(@NonNull final Context context, final int c return context.getResources().getString(color).substring(3); } + @SuppressWarnings("CharsetObjectCanBeUsed") static Disposable showLicense(@Nullable final Context context, @NonNull final License license) { if (context == null) { return Disposable.empty(); @@ -94,7 +94,7 @@ static Disposable showLicense(@Nullable final Context context, @NonNull final Li .observeOn(AndroidSchedulers.mainThread()) .subscribe(formattedLicense -> { final String webViewData = Base64.encodeToString(formattedLicense - .getBytes(StandardCharsets.UTF_8), Base64.NO_PADDING); + .getBytes("utf-8"), Base64.NO_PADDING); final WebView webView = new WebView(context); webView.loadData(webViewData, "text/html; charset=UTF-8", "base64"); diff --git a/app/src/main/java/org/schabi/newpipelegacy/about/SoftwareComponent.java b/app/src/main/java/org/schabi/newpipelegacy/about/SoftwareComponent.java deleted file mode 100644 index e69de29bb..000000000 diff --git a/app/src/main/java/org/schabi/newpipelegacy/database/playlist/PlaylistStreamEntry.kt b/app/src/main/java/org/schabi/newpipelegacy/database/playlist/PlaylistStreamEntry.kt index d039fa227..f190a1e88 100644 --- a/app/src/main/java/org/schabi/newpipelegacy/database/playlist/PlaylistStreamEntry.kt +++ b/app/src/main/java/org/schabi/newpipelegacy/database/playlist/PlaylistStreamEntry.kt @@ -2,11 +2,11 @@ package org.schabi.newpipelegacy.database.playlist import androidx.room.ColumnInfo import androidx.room.Embedded +import org.schabi.newpipe.extractor.stream.StreamInfoItem import org.schabi.newpipelegacy.database.LocalItem import org.schabi.newpipelegacy.database.playlist.model.PlaylistStreamEntity import org.schabi.newpipelegacy.database.stream.model.StreamEntity import org.schabi.newpipelegacy.database.stream.model.StreamStateEntity -import org.schabi.newpipe.extractor.stream.StreamInfoItem import kotlin.jvm.Throws data class PlaylistStreamEntry( diff --git a/app/src/main/java/org/schabi/newpipelegacy/database/stream/StreamStatisticsEntry.kt b/app/src/main/java/org/schabi/newpipelegacy/database/stream/StreamStatisticsEntry.kt index 5d4a2d099..b58a2808d 100644 --- a/app/src/main/java/org/schabi/newpipelegacy/database/stream/StreamStatisticsEntry.kt +++ b/app/src/main/java/org/schabi/newpipelegacy/database/stream/StreamStatisticsEntry.kt @@ -2,11 +2,11 @@ package org.schabi.newpipelegacy.database.stream import androidx.room.ColumnInfo import androidx.room.Embedded +import org.schabi.newpipe.extractor.stream.StreamInfoItem import org.schabi.newpipelegacy.database.LocalItem import org.schabi.newpipelegacy.database.history.model.StreamHistoryEntity import org.schabi.newpipelegacy.database.stream.model.StreamEntity import org.schabi.newpipelegacy.database.stream.model.StreamStateEntity.STREAM_PROGRESS_TIME -import org.schabi.newpipe.extractor.stream.StreamInfoItem import java.time.OffsetDateTime class StreamStatisticsEntry( diff --git a/app/src/main/java/org/schabi/newpipelegacy/database/stream/dao/StreamDAO.kt b/app/src/main/java/org/schabi/newpipelegacy/database/stream/dao/StreamDAO.kt index 0379ec346..74d7a5133 100644 --- a/app/src/main/java/org/schabi/newpipelegacy/database/stream/dao/StreamDAO.kt +++ b/app/src/main/java/org/schabi/newpipelegacy/database/stream/dao/StreamDAO.kt @@ -7,12 +7,12 @@ import androidx.room.OnConflictStrategy import androidx.room.Query import androidx.room.Transaction import io.reactivex.rxjava3.core.Flowable -import org.schabi.newpipelegacy.database.BasicDAO -import org.schabi.newpipelegacy.database.stream.model.StreamEntity -import org.schabi.newpipelegacy.database.stream.model.StreamEntity.Companion.STREAM_ID import org.schabi.newpipe.extractor.stream.StreamType import org.schabi.newpipe.extractor.stream.StreamType.AUDIO_LIVE_STREAM import org.schabi.newpipe.extractor.stream.StreamType.LIVE_STREAM +import org.schabi.newpipelegacy.database.BasicDAO +import org.schabi.newpipelegacy.database.stream.model.StreamEntity +import org.schabi.newpipelegacy.database.stream.model.StreamEntity.Companion.STREAM_ID import java.time.OffsetDateTime @Dao diff --git a/app/src/main/java/org/schabi/newpipelegacy/database/stream/model/StreamEntity.kt b/app/src/main/java/org/schabi/newpipelegacy/database/stream/model/StreamEntity.kt index 5efd468b6..0a4816b6b 100644 --- a/app/src/main/java/org/schabi/newpipelegacy/database/stream/model/StreamEntity.kt +++ b/app/src/main/java/org/schabi/newpipelegacy/database/stream/model/StreamEntity.kt @@ -5,13 +5,13 @@ import androidx.room.Entity import androidx.room.Ignore import androidx.room.Index import androidx.room.PrimaryKey -import org.schabi.newpipelegacy.database.stream.model.StreamEntity.Companion.STREAM_SERVICE_ID -import org.schabi.newpipelegacy.database.stream.model.StreamEntity.Companion.STREAM_TABLE -import org.schabi.newpipelegacy.database.stream.model.StreamEntity.Companion.STREAM_URL import org.schabi.newpipe.extractor.localization.DateWrapper import org.schabi.newpipe.extractor.stream.StreamInfo import org.schabi.newpipe.extractor.stream.StreamInfoItem import org.schabi.newpipe.extractor.stream.StreamType +import org.schabi.newpipelegacy.database.stream.model.StreamEntity.Companion.STREAM_SERVICE_ID +import org.schabi.newpipelegacy.database.stream.model.StreamEntity.Companion.STREAM_TABLE +import org.schabi.newpipelegacy.database.stream.model.StreamEntity.Companion.STREAM_URL import org.schabi.newpipelegacy.player.playqueue.PlayQueueItem import java.io.Serializable import java.time.OffsetDateTime diff --git a/app/src/main/java/org/schabi/newpipelegacy/fragments/detail/VideoDetailFragment.java b/app/src/main/java/org/schabi/newpipelegacy/fragments/detail/VideoDetailFragment.java index 63ca0572d..deb49e9a1 100644 --- a/app/src/main/java/org/schabi/newpipelegacy/fragments/detail/VideoDetailFragment.java +++ b/app/src/main/java/org/schabi/newpipelegacy/fragments/detail/VideoDetailFragment.java @@ -1,6 +1,7 @@ package org.schabi.newpipelegacy.fragments.detail; import android.animation.ValueAnimator; +import android.annotation.SuppressLint; import android.app.Activity; import android.content.BroadcastReceiver; import android.content.Context; @@ -1593,6 +1594,7 @@ public void handleResult(@NonNull final StreamInfo info) { noVideoStreams ? R.drawable.ic_headset_shadow : R.drawable.ic_play_arrow_shadow); } + @SuppressLint("StringFormatInvalid") private void hideAgeRestrictedContent() { showError(getString(R.string.restricted_video, getString(R.string.show_age_restricted_content_title)), false); diff --git a/app/src/main/java/org/schabi/newpipelegacy/fragments/list/BaseListFragment.java b/app/src/main/java/org/schabi/newpipelegacy/fragments/list/BaseListFragment.java index 384a60832..c8a15f347 100644 --- a/app/src/main/java/org/schabi/newpipelegacy/fragments/list/BaseListFragment.java +++ b/app/src/main/java/org/schabi/newpipelegacy/fragments/list/BaseListFragment.java @@ -48,7 +48,7 @@ public abstract class BaseListFragment extends BaseStateFragment implements ListViewContract, StateSaver.WriteRead, SharedPreferences.OnSharedPreferenceChangeListener { private static final int LIST_MODE_UPDATE_FLAG = 0x32; - protected org.schabi.newpipe.util.SavedState savedState; + protected org.schabi.newpipelegacy.util.SavedState savedState; private boolean useDefaultStateSaving = true; private int updateFlags = 0; diff --git a/app/src/main/java/org/schabi/newpipelegacy/local/dialog/PlaylistDialog.java b/app/src/main/java/org/schabi/newpipelegacy/local/dialog/PlaylistDialog.java index 18bbebc60..616d43e36 100644 --- a/app/src/main/java/org/schabi/newpipelegacy/local/dialog/PlaylistDialog.java +++ b/app/src/main/java/org/schabi/newpipelegacy/local/dialog/PlaylistDialog.java @@ -17,7 +17,7 @@ public abstract class PlaylistDialog extends DialogFragment implements StateSaver.WriteRead { private List streamEntities; - private org.schabi.newpipe.util.SavedState savedState; + private org.schabi.newpipelegacy.util.SavedState savedState; protected void setInfo(final List entities) { this.streamEntities = entities; diff --git a/app/src/main/java/org/schabi/newpipelegacy/local/feed/FeedDatabaseManager.kt b/app/src/main/java/org/schabi/newpipelegacy/local/feed/FeedDatabaseManager.kt index e07ee8587..af3cbc0fb 100644 --- a/app/src/main/java/org/schabi/newpipelegacy/local/feed/FeedDatabaseManager.kt +++ b/app/src/main/java/org/schabi/newpipelegacy/local/feed/FeedDatabaseManager.kt @@ -7,14 +7,14 @@ import io.reactivex.rxjava3.core.Completable import io.reactivex.rxjava3.core.Flowable import io.reactivex.rxjava3.core.Maybe import io.reactivex.rxjava3.schedulers.Schedulers +import org.schabi.newpipe.extractor.stream.StreamInfoItem +import org.schabi.newpipe.extractor.stream.StreamType import org.schabi.newpipelegacy.MainActivity.DEBUG import org.schabi.newpipelegacy.NewPipeDatabase import org.schabi.newpipelegacy.database.feed.model.FeedEntity import org.schabi.newpipelegacy.database.feed.model.FeedGroupEntity import org.schabi.newpipelegacy.database.feed.model.FeedLastUpdatedEntity import org.schabi.newpipelegacy.database.stream.model.StreamEntity -import org.schabi.newpipe.extractor.stream.StreamInfoItem -import org.schabi.newpipe.extractor.stream.StreamType import org.schabi.newpipelegacy.local.subscription.FeedGroupIcon import java.time.LocalDate import java.time.OffsetDateTime diff --git a/app/src/main/java/org/schabi/newpipelegacy/local/feed/FeedViewModel.kt b/app/src/main/java/org/schabi/newpipelegacy/local/feed/FeedViewModel.kt index a7d5487ae..b14990058 100644 --- a/app/src/main/java/org/schabi/newpipelegacy/local/feed/FeedViewModel.kt +++ b/app/src/main/java/org/schabi/newpipelegacy/local/feed/FeedViewModel.kt @@ -9,8 +9,8 @@ import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers import io.reactivex.rxjava3.core.Flowable import io.reactivex.rxjava3.functions.Function4 import io.reactivex.rxjava3.schedulers.Schedulers -import org.schabi.newpipelegacy.database.feed.model.FeedGroupEntity import org.schabi.newpipe.extractor.stream.StreamInfoItem +import org.schabi.newpipelegacy.database.feed.model.FeedGroupEntity import org.schabi.newpipelegacy.ktx.toCalendar import org.schabi.newpipelegacy.local.feed.service.FeedEventManager import org.schabi.newpipelegacy.local.feed.service.FeedEventManager.Event.ErrorResultEvent diff --git a/app/src/main/java/org/schabi/newpipelegacy/local/feed/service/FeedLoadService.kt b/app/src/main/java/org/schabi/newpipelegacy/local/feed/service/FeedLoadService.kt index f865a284f..21b7796fe 100644 --- a/app/src/main/java/org/schabi/newpipelegacy/local/feed/service/FeedLoadService.kt +++ b/app/src/main/java/org/schabi/newpipelegacy/local/feed/service/FeedLoadService.kt @@ -43,13 +43,13 @@ import io.reactivex.rxjava3.processors.PublishProcessor import io.reactivex.rxjava3.schedulers.Schedulers import org.reactivestreams.Subscriber import org.reactivestreams.Subscription +import org.schabi.newpipe.extractor.ListInfo +import org.schabi.newpipe.extractor.exceptions.ReCaptchaException +import org.schabi.newpipe.extractor.stream.StreamInfoItem import org.schabi.newpipelegacy.App import org.schabi.newpipelegacy.MainActivity.DEBUG import org.schabi.newpipelegacy.R import org.schabi.newpipelegacy.database.feed.model.FeedGroupEntity -import org.schabi.newpipe.extractor.ListInfo -import org.schabi.newpipe.extractor.exceptions.ReCaptchaException -import org.schabi.newpipe.extractor.stream.StreamInfoItem import org.schabi.newpipelegacy.local.feed.FeedDatabaseManager import org.schabi.newpipelegacy.local.feed.service.FeedEventManager.Event.ErrorResultEvent import org.schabi.newpipelegacy.local.feed.service.FeedEventManager.Event.ProgressEvent diff --git a/app/src/main/java/org/schabi/newpipelegacy/local/subscription/SubscriptionFragment.kt b/app/src/main/java/org/schabi/newpipelegacy/local/subscription/SubscriptionFragment.kt index 48c278ea1..91bb9be16 100644 --- a/app/src/main/java/org/schabi/newpipelegacy/local/subscription/SubscriptionFragment.kt +++ b/app/src/main/java/org/schabi/newpipelegacy/local/subscription/SubscriptionFragment.kt @@ -33,6 +33,8 @@ import kotlinx.android.synthetic.main.dialog_title.view.itemAdditionalDetails import kotlinx.android.synthetic.main.dialog_title.view.itemTitleView import kotlinx.android.synthetic.main.fragment_subscription.items_list import org.schabi.newpipe.extractor.channel.ChannelInfoItem +import org.schabi.newpipelegacy.R +import org.schabi.newpipelegacy.database.feed.model.FeedGroupEntity import org.schabi.newpipelegacy.fragments.BaseStateFragment import org.schabi.newpipelegacy.local.subscription.SubscriptionViewModel.SubscriptionState import org.schabi.newpipelegacy.local.subscription.dialog.FeedGroupDialog diff --git a/app/src/main/java/org/schabi/newpipelegacy/local/subscription/SubscriptionManager.kt b/app/src/main/java/org/schabi/newpipelegacy/local/subscription/SubscriptionManager.kt index a99bc00e1..30fbd7c81 100644 --- a/app/src/main/java/org/schabi/newpipelegacy/local/subscription/SubscriptionManager.kt +++ b/app/src/main/java/org/schabi/newpipelegacy/local/subscription/SubscriptionManager.kt @@ -5,10 +5,6 @@ import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers import io.reactivex.rxjava3.core.Completable import io.reactivex.rxjava3.core.Flowable import io.reactivex.rxjava3.schedulers.Schedulers -import org.schabi.newpipelegacy.NewPipeDatabase -import org.schabi.newpipelegacy.database.feed.model.FeedGroupEntity -import org.schabi.newpipelegacy.database.subscription.SubscriptionDAO -import org.schabi.newpipelegacy.database.subscription.SubscriptionEntity import org.schabi.newpipe.extractor.ListInfo import org.schabi.newpipe.extractor.channel.ChannelInfo import org.schabi.newpipe.extractor.feed.FeedInfo diff --git a/app/src/main/java/org/schabi/newpipelegacy/local/subscription/services/BaseImportExportService.java b/app/src/main/java/org/schabi/newpipelegacy/local/subscription/services/BaseImportExportService.java index b6fd03cfe..d4b635f3e 100644 --- a/app/src/main/java/org/schabi/newpipelegacy/local/subscription/services/BaseImportExportService.java +++ b/app/src/main/java/org/schabi/newpipelegacy/local/subscription/services/BaseImportExportService.java @@ -19,6 +19,7 @@ package org.schabi.newpipelegacy.local.subscription.services; +import android.annotation.SuppressLint; import android.app.Service; import android.content.Intent; import android.os.Build; @@ -211,6 +212,7 @@ protected void showToast(final String message) { // Error handling //////////////////////////////////////////////////////////////////////////*/ + @SuppressLint("StringFormatInvalid") protected void handleError(@StringRes final int errorTitle, @NonNull final Throwable error) { String message = getErrorMessage(error); diff --git a/app/src/main/java/org/schabi/newpipelegacy/settings/NotificationSettingsFragment.java b/app/src/main/java/org/schabi/newpipelegacy/settings/NotificationSettingsFragment.java deleted file mode 100644 index e69de29bb..000000000 diff --git a/app/src/main/java/org/schabi/newpipelegacy/settings/custom/NotificationActionsPreference.java b/app/src/main/java/org/schabi/newpipelegacy/settings/custom/NotificationActionsPreference.java deleted file mode 100644 index e69de29bb..000000000 diff --git a/app/src/main/java/org/schabi/newpipelegacy/settings/tabs/Tab.java b/app/src/main/java/org/schabi/newpipelegacy/settings/tabs/Tab.java index af6a8c06d..33f8da2bf 100644 --- a/app/src/main/java/org/schabi/newpipelegacy/settings/tabs/Tab.java +++ b/app/src/main/java/org/schabi/newpipelegacy/settings/tabs/Tab.java @@ -33,8 +33,6 @@ import org.schabi.newpipelegacy.util.ServiceHelper; import org.schabi.newpipelegacy.util.ThemeHelper; -import java.util.Objects; - public abstract class Tab { private static final String JSON_TAB_ID_KEY = "tab_id"; diff --git a/app/src/main/java/org/schabi/newpipelegacy/streams/SrtFromTtmlWriter.java b/app/src/main/java/org/schabi/newpipelegacy/streams/SrtFromTtmlWriter.java index 2d6d615c2..552717ebd 100644 --- a/app/src/main/java/org/schabi/newpipelegacy/streams/SrtFromTtmlWriter.java +++ b/app/src/main/java/org/schabi/newpipelegacy/streams/SrtFromTtmlWriter.java @@ -20,7 +20,6 @@ public class SrtFromTtmlWriter { private final SharpStream out; private final boolean ignoreEmptyFrames; - private final Charset charset = StandardCharsets.UTF_8; private int frameIndex = 0; diff --git a/app/src/main/java/org/schabi/newpipelegacy/views/FocusOverlayView.java b/app/src/main/java/org/schabi/newpipelegacy/views/FocusOverlayView.java index d75afbc37..f0a38a215 100644 --- a/app/src/main/java/org/schabi/newpipelegacy/views/FocusOverlayView.java +++ b/app/src/main/java/org/schabi/newpipelegacy/views/FocusOverlayView.java @@ -18,6 +18,7 @@ */ package org.schabi.newpipelegacy.views; +import android.annotation.SuppressLint; import android.app.Activity; import android.app.Dialog; import android.content.Context; @@ -211,6 +212,7 @@ public static void setupFocusObserver(final Activity activity) { setupOverlay(window, overlay); } + @SuppressLint("RestrictedAPI") private static void setupOverlay(final Window window, final FocusOverlayView overlay) { final ViewGroup decor = (ViewGroup) window.getDecorView(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) { diff --git a/app/src/main/java/us/shandian/giga/get/DownloadRunnableFallback.java b/app/src/main/java/us/shandian/giga/get/DownloadRunnableFallback.java index eb276b1c7..1f00cb7ea 100644 --- a/app/src/main/java/us/shandian/giga/get/DownloadRunnableFallback.java +++ b/app/src/main/java/us/shandian/giga/get/DownloadRunnableFallback.java @@ -1,5 +1,6 @@ package us.shandian.giga.get; +import android.annotation.SuppressLint; import android.util.Log; import androidx.annotation.NonNull; @@ -48,6 +49,7 @@ private void dispose() { if (mF != null) mF.close(); } + @SuppressLint("LongLogTag") @Override public void run() { boolean done; diff --git a/checkstyle-suppressions.xml b/checkstyle-suppressions.xml index 15e722858..379d59404 100644 --- a/checkstyle-suppressions.xml +++ b/checkstyle-suppressions.xml @@ -62,15 +62,15 @@ + lines="113,359,433,578"/> + lines="72"/> + lines="504"/>