mirror of
				https://github.com/TeamNewPipe/NewPipe
				synced 2025-10-31 07:13:00 +00:00 
			
		
		
		
	update project to the latest dev branch
This commit is contained in:
		| @@ -9,7 +9,7 @@ plugins { | ||||
|  | ||||
| android { | ||||
|     compileSdk 31 | ||||
|     buildToolsVersion '31.0.0' | ||||
|     namespace 'org.schabi.newpipe' | ||||
|  | ||||
|     defaultConfig { | ||||
|         applicationId "org.schabi.newpipe" | ||||
|   | ||||
| @@ -1,8 +1,6 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <manifest | ||||
|     xmlns:android="http://schemas.android.com/apk/res/android" | ||||
|     xmlns:tools="http://schemas.android.com/tools" | ||||
|     package="org.schabi.newpipe"> | ||||
| <manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||||
|     xmlns:tools="http://schemas.android.com/tools"> | ||||
|  | ||||
|     <application | ||||
|         android:name=".DebugApp" | ||||
|   | ||||
| @@ -1,7 +1,6 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||||
|     xmlns:tools="http://schemas.android.com/tools" | ||||
|     package="org.schabi.newpipe" | ||||
|     android:installLocation="auto"> | ||||
|  | ||||
|     <uses-permission android:name="android.permission.INTERNET" /> | ||||
| @@ -14,6 +13,9 @@ | ||||
|     <uses-feature | ||||
|         android:name="android.hardware.touchscreen" | ||||
|         android:required="false" /> | ||||
|     <uses-feature | ||||
|         android:name="android.software.leanback" | ||||
|         android:required="false" /> | ||||
|  | ||||
|     <application | ||||
|         android:name=".App" | ||||
|   | ||||
| @@ -35,7 +35,7 @@ import java.util.ArrayList; | ||||
| // TODO: Replace this deprecated class with its ViewPager2 counterpart | ||||
|  | ||||
| /** | ||||
|  * This is a copy from {@link androidx.fragment.app.FragmentStatePagerAdapter}. | ||||
|  * This is a copy from {@link FragmentStatePagerAdapter}. | ||||
|  * <p> | ||||
|  * It includes a workaround to fix the menu visibility when the adapter is restored. | ||||
|  * </p> | ||||
|   | ||||
| @@ -163,7 +163,7 @@ public class ReCaptchaActivity extends AppCompatActivity { | ||||
|         // Navigate to blank page (unloads youtube to prevent background playback) | ||||
|         recaptchaBinding.reCaptchaWebView.loadUrl("about:blank"); | ||||
|  | ||||
|         final Intent intent = new Intent(this, org.schabi.newpipe.MainActivity.class); | ||||
|         final Intent intent = new Intent(this, MainActivity.class); | ||||
|         intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); | ||||
|         NavUtils.navigateUpTo(this, intent); | ||||
|     } | ||||
|   | ||||
| @@ -1358,7 +1358,7 @@ public final class Player implements PlaybackListener, Listener { | ||||
|     //////////////////////////////////////////////////////////////////////////*/ | ||||
|     //region Errors | ||||
|     /** | ||||
|      * Process exceptions produced by {@link com.google.android.exoplayer2.ExoPlayer ExoPlayer}. | ||||
|      * Process exceptions produced by {@link ExoPlayer ExoPlayer}. | ||||
|      * <p>There are multiple types of errors:</p> | ||||
|      * <ul> | ||||
|      * <li>{@link PlaybackException#ERROR_CODE_BEHIND_LIVE_WINDOW BEHIND_LIVE_WINDOW}: | ||||
| @@ -1383,7 +1383,7 @@ public final class Player implements PlaybackListener, Listener { | ||||
|      * For any error above that is <b>not</b> explicitly <b>catchable</b>, the player will | ||||
|      * create a notification so users are aware. | ||||
|      * </ul> | ||||
|      * @see com.google.android.exoplayer2.Player.Listener#onPlayerError(PlaybackException) | ||||
|      * @see Listener#onPlayerError(PlaybackException) | ||||
|      * */ | ||||
|     // Any error code not explicitly covered here are either unrelated to NewPipe use case | ||||
|     // (e.g. DRM) or not recoverable (e.g. Decoder error). In both cases, the player should | ||||
|   | ||||
| @@ -41,7 +41,7 @@ public final class PlayerService extends Service { | ||||
|  | ||||
|     private Player player; | ||||
|  | ||||
|     private final IBinder mBinder = new PlayerService.LocalBinder(); | ||||
|     private final IBinder mBinder = new LocalBinder(); | ||||
|  | ||||
|  | ||||
|     /*////////////////////////////////////////////////////////////////////////// | ||||
|   | ||||
| @@ -64,7 +64,7 @@ import java.util.zip.GZIPInputStream; | ||||
|  | ||||
| /** | ||||
|  * An {@link HttpDataSource} that uses Android's {@link HttpURLConnection}, based on | ||||
|  * {@link com.google.android.exoplayer2.upstream.DefaultHttpDataSource}, for YouTube streams. | ||||
|  * {@link DefaultHttpDataSource}, for YouTube streams. | ||||
|  * | ||||
|  * <p> | ||||
|  * It adds more headers to {@code videoplayback} URLs, such as {@code Origin}, {@code Referer} | ||||
| @@ -73,7 +73,7 @@ import java.util.zip.GZIPInputStream; | ||||
|  * </p> | ||||
|  * | ||||
|  * There are many unused methods in this class because everything was copied from {@link | ||||
|  * com.google.android.exoplayer2.upstream.DefaultHttpDataSource} with as little changes as possible. | ||||
|  * DefaultHttpDataSource} with as little changes as possible. | ||||
|  * SonarQube warnings were also suppressed for the same reason. | ||||
|  */ | ||||
| @SuppressWarnings({"squid:S3011", "squid:S4738"}) | ||||
| @@ -197,7 +197,7 @@ public final class YoutubeHttpDataSource extends BaseDataSource implements HttpD | ||||
|  | ||||
|         /** | ||||
|          * Sets a content type {@link Predicate}. If a content type is rejected by the predicate | ||||
|          * then a {@link HttpDataSource.InvalidContentTypeException} is thrown from | ||||
|          * then a {@link InvalidContentTypeException} is thrown from | ||||
|          * {@link YoutubeHttpDataSource#open(DataSpec)}. | ||||
|          * | ||||
|          * <p> | ||||
|   | ||||
| @@ -280,11 +280,11 @@ public final class PlayerHelper { | ||||
|  | ||||
|     public static boolean isAutoplayAllowedByUser(@NonNull final Context context) { | ||||
|         switch (PlayerHelper.getAutoplayType(context)) { | ||||
|             case PlayerHelper.AutoplayType.AUTOPLAY_TYPE_NEVER: | ||||
|             case AutoplayType.AUTOPLAY_TYPE_NEVER: | ||||
|                 return false; | ||||
|             case PlayerHelper.AutoplayType.AUTOPLAY_TYPE_WIFI: | ||||
|             case AutoplayType.AUTOPLAY_TYPE_WIFI: | ||||
|                 return !ListHelper.isMeteredNetwork(context); | ||||
|             case PlayerHelper.AutoplayType.AUTOPLAY_TYPE_ALWAYS: | ||||
|             case AutoplayType.AUTOPLAY_TYPE_ALWAYS: | ||||
|             default: | ||||
|                 return true; | ||||
|         } | ||||
| @@ -382,7 +382,7 @@ public final class PlayerHelper { | ||||
|     public static boolean globalScreenOrientationLocked(final Context context) { | ||||
|         // 1: Screen orientation changes using accelerometer | ||||
|         // 0: Screen orientation is locked | ||||
|         return android.provider.Settings.System.getInt( | ||||
|         return Settings.System.getInt( | ||||
|                 context.getContentResolver(), Settings.System.ACCELEROMETER_ROTATION, 0) == 0; | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -23,12 +23,12 @@ public final class StreamInfoTag implements MediaItemTag { | ||||
|     @NonNull | ||||
|     private final StreamInfo streamInfo; | ||||
|     @Nullable | ||||
|     private final MediaItemTag.Quality quality; | ||||
|     private final Quality quality; | ||||
|     @Nullable | ||||
|     private final Object extras; | ||||
|  | ||||
|     private StreamInfoTag(@NonNull final StreamInfo streamInfo, | ||||
|                           @Nullable final MediaItemTag.Quality quality, | ||||
|                           @Nullable final Quality quality, | ||||
|                           @Nullable final Object extras) { | ||||
|         this.streamInfo = streamInfo; | ||||
|         this.quality = quality; | ||||
|   | ||||
| @@ -121,7 +121,7 @@ public class FailedMediaSource extends BaseMediaSource implements ManagedMediaSo | ||||
|      * {@link com.google.android.exoplayer2.Player.Listener#onPlayerError(PlaybackException)}. | ||||
|      * | ||||
|      * @throws IOException An error which will always result in | ||||
|      * {@link com.google.android.exoplayer2.PlaybackException#ERROR_CODE_IO_UNSPECIFIED}. | ||||
|      * {@link PlaybackException#ERROR_CODE_IO_UNSPECIFIED}. | ||||
|      */ | ||||
|     @Override | ||||
|     public void maybeThrowSourceInfoRefreshError() throws IOException { | ||||
|   | ||||
| @@ -1425,7 +1425,7 @@ public abstract class VideoPlayerUi extends PlayerUi | ||||
|                     break; | ||||
|                 } | ||||
|  | ||||
|                 if (player.getCurrentState() == org.schabi.newpipe.player.Player.STATE_BLOCKED) { | ||||
|                 if (player.getCurrentState() == Player.STATE_BLOCKED) { | ||||
|                     return true; | ||||
|                 } | ||||
|  | ||||
|   | ||||
| @@ -339,14 +339,14 @@ public class PeertubeInstanceListFragment extends Fragment { | ||||
|  | ||||
|         @NonNull | ||||
|         @Override | ||||
|         public InstanceListAdapter.TabViewHolder onCreateViewHolder(@NonNull final ViewGroup parent, | ||||
|         public TabViewHolder onCreateViewHolder(@NonNull final ViewGroup parent, | ||||
|                                                                     final int viewType) { | ||||
|             return new InstanceListAdapter.TabViewHolder(ItemInstanceBinding.inflate(inflater, | ||||
|             return new TabViewHolder(ItemInstanceBinding.inflate(inflater, | ||||
|                     parent, false)); | ||||
|         } | ||||
|  | ||||
|         @Override | ||||
|         public void onBindViewHolder(@NonNull final InstanceListAdapter.TabViewHolder holder, | ||||
|         public void onBindViewHolder(@NonNull final TabViewHolder holder, | ||||
|                                      final int position) { | ||||
|             holder.bind(position); | ||||
|         } | ||||
|   | ||||
| @@ -45,7 +45,7 @@ public class ChooseTabsFragment extends Fragment { | ||||
|     private TabsManager tabsManager; | ||||
|  | ||||
|     private final List<Tab> tabList = new ArrayList<>(); | ||||
|     private ChooseTabsFragment.SelectedTabsAdapter selectedTabsAdapter; | ||||
|     private SelectedTabsAdapter selectedTabsAdapter; | ||||
|  | ||||
|     /*////////////////////////////////////////////////////////////////////////// | ||||
|     // Lifecycle | ||||
| @@ -316,7 +316,7 @@ public class ChooseTabsFragment extends Fragment { | ||||
|     } | ||||
|  | ||||
|     private class SelectedTabsAdapter | ||||
|             extends RecyclerView.Adapter<ChooseTabsFragment.SelectedTabsAdapter.TabViewHolder> { | ||||
|             extends RecyclerView.Adapter<SelectedTabsAdapter.TabViewHolder> { | ||||
|         private final LayoutInflater inflater; | ||||
|         private final ItemTouchHelper itemTouchHelper; | ||||
|  | ||||
| @@ -332,15 +332,15 @@ public class ChooseTabsFragment extends Fragment { | ||||
|  | ||||
|         @NonNull | ||||
|         @Override | ||||
|         public ChooseTabsFragment.SelectedTabsAdapter.TabViewHolder onCreateViewHolder( | ||||
|         public TabViewHolder onCreateViewHolder( | ||||
|                 @NonNull final ViewGroup parent, final int viewType) { | ||||
|             final View view = inflater.inflate(R.layout.list_choose_tabs, parent, false); | ||||
|             return new ChooseTabsFragment.SelectedTabsAdapter.TabViewHolder(view); | ||||
|             return new TabViewHolder(view); | ||||
|         } | ||||
|  | ||||
|         @Override | ||||
|         public void onBindViewHolder( | ||||
|                 @NonNull final ChooseTabsFragment.SelectedTabsAdapter.TabViewHolder holder, | ||||
|                 @NonNull final TabViewHolder holder, | ||||
|                 final int position) { | ||||
|             holder.bind(position, holder); | ||||
|         } | ||||
|   | ||||
| @@ -27,7 +27,7 @@ public class WebMWriter implements Closeable { | ||||
|     private static final int CUE_RESERVE_SIZE = 65535; | ||||
|     private static final byte MINIMUM_EBML_VOID_SIZE = 4; | ||||
|  | ||||
|     private WebMReader.WebMTrack[] infoTracks; | ||||
|     private WebMTrack[] infoTracks; | ||||
|     private SharpStream[] sourceTracks; | ||||
|  | ||||
|     private WebMReader[] readers; | ||||
|   | ||||
| @@ -42,7 +42,7 @@ public final class SparseItemUtil { | ||||
|      * @param item     item which is checked and eventually loaded completely | ||||
|      * @param callback callback to call with the single play queue built from the original item if | ||||
|      *                 all info was available, otherwise from the fetched {@link | ||||
|      *                 org.schabi.newpipe.extractor.stream.StreamInfo} | ||||
|      *                 StreamInfo} | ||||
|      */ | ||||
|     public static void fetchItemInfoIfSparse(@NonNull final Context context, | ||||
|                                              @NonNull final StreamInfoItem item, | ||||
| @@ -72,7 +72,7 @@ public final class SparseItemUtil { | ||||
|      * @param uploaderUrl uploaderUrl of the item; if null or empty will be fetched | ||||
|      * @param callback    callback to be called with either the original uploaderUrl, if it was a | ||||
|      *                    valid url, otherwise with the uploader url obtained by fetching the {@link | ||||
|      *                    org.schabi.newpipe.extractor.stream.StreamInfo} corresponding to the item | ||||
|      *                    StreamInfo} corresponding to the item | ||||
|      */ | ||||
|     public static void fetchUploaderUrlIfSparse(@NonNull final Context context, | ||||
|                                                 final int serviceId, | ||||
|   | ||||
| @@ -92,7 +92,7 @@ public final class StateSaver { | ||||
|  | ||||
|     /** | ||||
|      * Try to restore the state from memory and disk, | ||||
|      * using the {@link StateSaver.WriteRead#readFrom(Queue)} from the writeRead. | ||||
|      * using the {@link WriteRead#readFrom(Queue)} from the writeRead. | ||||
|      * | ||||
|      * @param savedState | ||||
|      * @param writeRead | ||||
| @@ -176,7 +176,7 @@ public final class StateSaver { | ||||
|  | ||||
|     /** | ||||
|      * If it's not changing configuration (i.e. rotating screen), | ||||
|      * try to write the state from {@link StateSaver.WriteRead#writeTo(Queue)} | ||||
|      * try to write the state from {@link WriteRead#writeTo(Queue)} | ||||
|      * to the file with the name of prefixFileName + suffixFileName, | ||||
|      * in a cache folder got from the {@link #init(Context)}. | ||||
|      * <p> | ||||
|   | ||||
| @@ -163,12 +163,12 @@ public final class ShareUtils { | ||||
|     /** | ||||
|      * Open the system chooser to launch an intent. | ||||
|      * <p> | ||||
|      * This method opens an {@link android.content.Intent#ACTION_CHOOSER} of the intent putted | ||||
|      * This method opens an {@link Intent#ACTION_CHOOSER} of the intent putted | ||||
|      * as the intent param. If the setTitleChooser boolean is true, the string "Open with" will be | ||||
|      * set as the title of the system chooser. | ||||
|      * For Android P and higher, title for {@link android.content.Intent#ACTION_SEND} system | ||||
|      * For Android P and higher, title for {@link Intent#ACTION_SEND} system | ||||
|      * choosers must be set on this intent, not on the | ||||
|      * {@link android.content.Intent#ACTION_CHOOSER} intent. | ||||
|      * {@link Intent#ACTION_CHOOSER} intent. | ||||
|      * | ||||
|      * @param context         the context to use | ||||
|      * @param intent          the intent to open | ||||
|   | ||||
| @@ -57,8 +57,8 @@ public final class FocusAwareDrawerLayout extends DrawerLayout { | ||||
|         for (int i = 0; i < getChildCount(); ++i) { | ||||
|             final View child = getChildAt(i); | ||||
|  | ||||
|             final DrawerLayout.LayoutParams lp = | ||||
|                     (DrawerLayout.LayoutParams) child.getLayoutParams(); | ||||
|             final LayoutParams lp = | ||||
|                     (LayoutParams) child.getLayoutParams(); | ||||
|  | ||||
|             if (lp.gravity != 0 && isDrawerVisible(child)) { | ||||
|                 hasOpenPanels = true; | ||||
| @@ -85,8 +85,8 @@ public final class FocusAwareDrawerLayout extends DrawerLayout { | ||||
|         for (int i = 0; i < getChildCount(); ++i) { | ||||
|             final View child = getChildAt(i); | ||||
|  | ||||
|             final DrawerLayout.LayoutParams lp = | ||||
|                     (DrawerLayout.LayoutParams) child.getLayoutParams(); | ||||
|             final LayoutParams lp = | ||||
|                     (LayoutParams) child.getLayoutParams(); | ||||
|  | ||||
|             if (lp.gravity == 0) { | ||||
|                 content = child; | ||||
|   | ||||
| @@ -94,7 +94,7 @@ public class DownloadRunnable extends Thread { | ||||
|                         continue; | ||||
|                     } | ||||
|  | ||||
|                     throw new DownloadMission.HttpError(416); | ||||
|                     throw new HttpError(416); | ||||
|                 } | ||||
|  | ||||
|                 retry = false; | ||||
| @@ -104,7 +104,7 @@ public class DownloadRunnable extends Thread { | ||||
|                     if (DEBUG) { | ||||
|                         Log.e(TAG, mId + ":Unsupported " + mConn.getResponseCode()); | ||||
|                     } | ||||
|                     mMission.notifyError(new DownloadMission.HttpError(mConn.getResponseCode())); | ||||
|                     mMission.notifyError(new HttpError(mConn.getResponseCode())); | ||||
|                     break; | ||||
|                 } | ||||
|  | ||||
|   | ||||
| @@ -75,7 +75,7 @@ public class DownloadRunnableFallback extends Thread { | ||||
|                 mMission.notifyProgress(-start); | ||||
|                 start = 0; | ||||
|                 mRetryCount--; | ||||
|                 throw new DownloadMission.HttpError(416); | ||||
|                 throw new HttpError(416); | ||||
|             } | ||||
|  | ||||
|             // secondary check for the file length | ||||
|   | ||||
| @@ -20,7 +20,7 @@ import us.shandian.giga.get.Mission; | ||||
| import org.schabi.newpipe.streams.io.StoredFileHelper; | ||||
|  | ||||
| /** | ||||
|  * SQLite helper to store finished {@link us.shandian.giga.get.FinishedMission}'s | ||||
|  * SQLite helper to store finished {@link FinishedMission}'s | ||||
|  */ | ||||
| public class FinishedMissionStore extends SQLiteOpenHelper { | ||||
|  | ||||
|   | ||||
| @@ -837,7 +837,7 @@ public class MissionAdapter extends Adapter<ViewHolder> implements Handler.Callb | ||||
|     } | ||||
|  | ||||
|  | ||||
|     class ViewHolderItem extends RecyclerView.ViewHolder { | ||||
|     class ViewHolderItem extends ViewHolder { | ||||
|         DownloadManager.MissionItem item; | ||||
|  | ||||
|         TextView status; | ||||
| @@ -980,7 +980,7 @@ public class MissionAdapter extends Adapter<ViewHolder> implements Handler.Callb | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     static class ViewHolderHeader extends RecyclerView.ViewHolder { | ||||
|     static class ViewHolderHeader extends ViewHolder { | ||||
|         TextView header; | ||||
|  | ||||
|         ViewHolderHeader(View view) { | ||||
|   | ||||
| @@ -7,7 +7,7 @@ buildscript { | ||||
|         mavenCentral() | ||||
|     } | ||||
|     dependencies { | ||||
|         classpath 'com.android.tools.build:gradle:7.2.2' | ||||
|         classpath 'com.android.tools.build:gradle:7.3.0' | ||||
|         classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" | ||||
|  | ||||
|         // NOTE: Do not place your application dependencies here; they belong | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Zhidong Piao
					Zhidong Piao