mirror of
https://github.com/revanced/revanced-patches.git
synced 2025-12-22 17:04:07 +01:00
Compare commits
32 Commits
v5.41.0-de
...
v5.41.0-de
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a89556a017 | ||
|
|
2b555f67f0 | ||
|
|
fb87199514 | ||
|
|
dd4e2cd085 | ||
|
|
fadc66816d | ||
|
|
ffd933c673 | ||
|
|
69883530b7 | ||
|
|
39971291f3 | ||
|
|
51facf9321 | ||
|
|
b83d41ca88 | ||
|
|
bfbffbd1f5 | ||
|
|
ee4755646b | ||
|
|
d1a12930c3 | ||
|
|
dfac836a8c | ||
|
|
6fa404331b | ||
|
|
8bcb95adcd | ||
|
|
8af70fe2d1 | ||
|
|
191b9169ff | ||
|
|
212418b8db | ||
|
|
7dbc744be0 | ||
|
|
150a3e7c60 | ||
|
|
5027943470 | ||
|
|
fa9e590b3a | ||
|
|
5823f0e982 | ||
|
|
f506a67e4a | ||
|
|
ed6e1155f2 | ||
|
|
8c229954d7 | ||
|
|
c5eb88bbf6 | ||
|
|
ef514017f4 | ||
|
|
c72d99518c | ||
|
|
772df6eb73 | ||
|
|
dfb5407e67 |
84
CHANGELOG.md
84
CHANGELOG.md
@@ -1,3 +1,87 @@
|
|||||||
|
# [5.41.0-dev.14](https://github.com/ReVanced/revanced-patches/compare/v5.41.0-dev.13...v5.41.0-dev.14) (2025-09-24)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **YouTube - Hide layout components:** Add "Hide Emoji and Timestamp buttons" setting ([#5992](https://github.com/ReVanced/revanced-patches/issues/5992)) ([2b555f6](https://github.com/ReVanced/revanced-patches/commit/2b555f67f07e0de5703c630888ce2fbba3145192))
|
||||||
|
|
||||||
|
# [5.41.0-dev.13](https://github.com/ReVanced/revanced-patches/compare/v5.41.0-dev.12...v5.41.0-dev.13) (2025-09-24)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **YouTube - Hide Shorts components:** Fix "Hide preview comment" ([#5990](https://github.com/ReVanced/revanced-patches/issues/5990)) ([dd4e2cd](https://github.com/ReVanced/revanced-patches/commit/dd4e2cd0855ccc51b94593004fdd8150ac3b41cc))
|
||||||
|
|
||||||
|
# [5.41.0-dev.12](https://github.com/ReVanced/revanced-patches/compare/v5.41.0-dev.11...v5.41.0-dev.12) (2025-09-24)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **YouTube - SponsorBlock:** Show category color in create new segment menu ([#5987](https://github.com/ReVanced/revanced-patches/issues/5987)) ([ffd933c](https://github.com/ReVanced/revanced-patches/commit/ffd933c6734274cdde5aaec0159b67f173f9228c))
|
||||||
|
|
||||||
|
# [5.41.0-dev.11](https://github.com/ReVanced/revanced-patches/compare/v5.41.0-dev.10...v5.41.0-dev.11) (2025-09-23)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **YouTube:** Add `Disable video codecs` patch ([#5981](https://github.com/ReVanced/revanced-patches/issues/5981)) ([bfbffbd](https://github.com/ReVanced/revanced-patches/commit/bfbffbd1f5aa867027053e25b343a51a606216a3))
|
||||||
|
|
||||||
|
# [5.41.0-dev.10](https://github.com/ReVanced/revanced-patches/compare/v5.41.0-dev.9...v5.41.0-dev.10) (2025-09-23)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **TikTok:** Show correct dialog restart text, use correct font color for non-dark mode ([d1a1293](https://github.com/ReVanced/revanced-patches/commit/d1a12930c35f630793a0f240d4203c2ff9060158))
|
||||||
|
|
||||||
|
# [5.41.0-dev.9](https://github.com/ReVanced/revanced-patches/compare/v5.41.0-dev.8...v5.41.0-dev.9) (2025-09-23)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **Instagram - Hide navigation buttons:** Remove button based on name ([#5971](https://github.com/ReVanced/revanced-patches/issues/5971)) ([6fa4043](https://github.com/ReVanced/revanced-patches/commit/6fa404331b5162682d83fba5f38ed570c31495fc))
|
||||||
|
|
||||||
|
# [5.41.0-dev.8](https://github.com/ReVanced/revanced-patches/compare/v5.41.0-dev.7...v5.41.0-dev.8) (2025-09-23)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **YouTube Music:** Add `Check watch history domain name resolution` ([#5979](https://github.com/ReVanced/revanced-patches/issues/5979)) ([8af70fe](https://github.com/ReVanced/revanced-patches/commit/8af70fe2d10c0f4da2d7e53bd00f5b3979775d5d))
|
||||||
|
|
||||||
|
# [5.41.0-dev.7](https://github.com/ReVanced/revanced-patches/compare/v5.41.0-dev.6...v5.41.0-dev.7) (2025-09-23)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **Tumblr:** Add `Disable Tumblr TV` patch ([#5959](https://github.com/ReVanced/revanced-patches/issues/5959)) ([212418b](https://github.com/ReVanced/revanced-patches/commit/212418b8db9a730ae9efa89ad2bef24952afbadd))
|
||||||
|
|
||||||
|
# [5.41.0-dev.6](https://github.com/ReVanced/revanced-patches/compare/v5.41.0-dev.5...v5.41.0-dev.6) (2025-09-22)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **YouTube - Spoof app version:** Add spoof target `20.05.46` that fixes transcript functionality ([5823f0e](https://github.com/ReVanced/revanced-patches/commit/5823f0e982e87b4a35d30feeca8a7e16edfebc5f))
|
||||||
|
|
||||||
|
# [5.41.0-dev.5](https://github.com/ReVanced/revanced-patches/compare/v5.41.0-dev.4...v5.41.0-dev.5) (2025-09-22)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **Twitch - Settings:** Fix missing style resources ([#5970](https://github.com/ReVanced/revanced-patches/issues/5970)) ([8c22995](https://github.com/ReVanced/revanced-patches/commit/8c229954d7f232a7a472ca49f1b5e7cdc475bbcc))
|
||||||
|
|
||||||
|
# [5.41.0-dev.4](https://github.com/ReVanced/revanced-patches/compare/v5.41.0-dev.3...v5.41.0-dev.4) (2025-09-22)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **Instagram - Limit feed to followed profiles:** Preserve favorites feed ([#5963](https://github.com/ReVanced/revanced-patches/issues/5963)) ([ef51401](https://github.com/ReVanced/revanced-patches/commit/ef514017f46025d9aef6884424caeb0670514e7a))
|
||||||
|
|
||||||
|
# [5.41.0-dev.3](https://github.com/ReVanced/revanced-patches/compare/v5.41.0-dev.2...v5.41.0-dev.3) (2025-09-22)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **YouTube - Loop video:** Add player button to change loop video state ([#5961](https://github.com/ReVanced/revanced-patches/issues/5961)) ([dfb5407](https://github.com/ReVanced/revanced-patches/commit/dfb5407e67222e80e23c8935e04b6dbf1a43d757))
|
||||||
|
|
||||||
# [5.41.0-dev.2](https://github.com/ReVanced/revanced-patches/compare/v5.41.0-dev.1...v5.41.0-dev.2) (2025-09-21)
|
# [5.41.0-dev.2](https://github.com/ReVanced/revanced-patches/compare/v5.41.0-dev.1...v5.41.0-dev.2) (2025-09-21)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -10,9 +10,17 @@ public class LimitFeedToFollowedProfiles {
|
|||||||
* Injection point.
|
* Injection point.
|
||||||
*/
|
*/
|
||||||
public static Map<String, String> setFollowingHeader(Map<String, String> requestHeaderMap) {
|
public static Map<String, String> setFollowingHeader(Map<String, String> requestHeaderMap) {
|
||||||
|
String paginationHeaderName = "pagination_source";
|
||||||
|
|
||||||
|
// Patch the header only if it's trying to fetch the default feed
|
||||||
|
String currentHeader = requestHeaderMap.get(paginationHeaderName);
|
||||||
|
if (currentHeader != null && !currentHeader.equals("feed_recs")) {
|
||||||
|
return requestHeaderMap;
|
||||||
|
}
|
||||||
|
|
||||||
// Create new map as original is unmodifiable.
|
// Create new map as original is unmodifiable.
|
||||||
Map<String, String> patchedRequestHeaderMap = new HashMap<>(requestHeaderMap);
|
Map<String, String> patchedRequestHeaderMap = new HashMap<>(requestHeaderMap);
|
||||||
patchedRequestHeaderMap.put("pagination_source", "following");
|
patchedRequestHeaderMap.put(paginationHeaderName, "following");
|
||||||
return patchedRequestHeaderMap;
|
return patchedRequestHeaderMap;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package app.revanced.extension.instagram.hide.navigation;
|
||||||
|
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
|
public class HideNavigationButtonsPatch {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Injection point.
|
||||||
|
* @param navigationButtonsList the list of navigation buttons, as an (obfuscated) Enum type
|
||||||
|
* @param buttonNameToRemove the name of the button we want to remove
|
||||||
|
* @param enumNameField the field in the nav button enum class which contains the name of the button
|
||||||
|
* @return the patched list of navigation buttons
|
||||||
|
*/
|
||||||
|
public static List<Object> removeNavigationButtonByName(
|
||||||
|
List<Object> navigationButtonsList,
|
||||||
|
String buttonNameToRemove,
|
||||||
|
String enumNameField
|
||||||
|
)
|
||||||
|
throws IllegalAccessException, NoSuchFieldException {
|
||||||
|
for (Object button : navigationButtonsList) {
|
||||||
|
Field f = button.getClass().getDeclaredField(enumNameField);
|
||||||
|
String currentButtonEnumName = (String) f.get(button);
|
||||||
|
|
||||||
|
if (buttonNameToRemove.equals(currentButtonEnumName)) {
|
||||||
|
navigationButtonsList.remove(button);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return navigationButtonsList;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package app.revanced.extension.youtube.patches;
|
package app.revanced.extension.shared.patches;
|
||||||
|
|
||||||
import static app.revanced.extension.shared.StringRef.str;
|
import static app.revanced.extension.shared.StringRef.str;
|
||||||
|
|
||||||
@@ -13,8 +13,8 @@ import java.net.UnknownHostException;
|
|||||||
|
|
||||||
import app.revanced.extension.shared.Logger;
|
import app.revanced.extension.shared.Logger;
|
||||||
import app.revanced.extension.shared.Utils;
|
import app.revanced.extension.shared.Utils;
|
||||||
|
import app.revanced.extension.shared.settings.BaseSettings;
|
||||||
import app.revanced.extension.shared.ui.CustomDialog;
|
import app.revanced.extension.shared.ui.CustomDialog;
|
||||||
import app.revanced.extension.youtube.settings.Settings;
|
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
public class CheckWatchHistoryDomainNameResolutionPatch {
|
public class CheckWatchHistoryDomainNameResolutionPatch {
|
||||||
@@ -49,7 +49,7 @@ public class CheckWatchHistoryDomainNameResolutionPatch {
|
|||||||
* Checks if s.youtube.com is blacklisted and playback history will fail to work.
|
* Checks if s.youtube.com is blacklisted and playback history will fail to work.
|
||||||
*/
|
*/
|
||||||
public static void checkDnsResolver(Activity context) {
|
public static void checkDnsResolver(Activity context) {
|
||||||
if (!Utils.isNetworkConnected() || !Settings.CHECK_WATCH_HISTORY_DOMAIN_NAME.get()) return;
|
if (!Utils.isNetworkConnected() || !BaseSettings.CHECK_WATCH_HISTORY_DOMAIN_NAME.get()) return;
|
||||||
|
|
||||||
Utils.runOnBackgroundThread(() -> {
|
Utils.runOnBackgroundThread(() -> {
|
||||||
try {
|
try {
|
||||||
@@ -61,8 +61,8 @@ public class CheckWatchHistoryDomainNameResolutionPatch {
|
|||||||
// Prevent this false positive by verify youtube.com resolves.
|
// Prevent this false positive by verify youtube.com resolves.
|
||||||
// If youtube.com does not resolve, then it's not a watch history domain resolving error
|
// If youtube.com does not resolve, then it's not a watch history domain resolving error
|
||||||
// because the entire app will not work since no domains are resolving.
|
// because the entire app will not work since no domains are resolving.
|
||||||
if (domainResolvesToValidIP(HISTORY_TRACKING_ENDPOINT)
|
if (!domainResolvesToValidIP("youtube.com")
|
||||||
|| !domainResolvesToValidIP("youtube.com")) {
|
|| domainResolvesToValidIP(HISTORY_TRACKING_ENDPOINT)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -78,7 +78,7 @@ public class CheckWatchHistoryDomainNameResolutionPatch {
|
|||||||
() -> {}, // OK button action (just dismiss).
|
() -> {}, // OK button action (just dismiss).
|
||||||
() -> {}, // Cancel button action (just dismiss).
|
() -> {}, // Cancel button action (just dismiss).
|
||||||
str("revanced_check_watch_history_domain_name_dialog_ignore"), // Neutral button text.
|
str("revanced_check_watch_history_domain_name_dialog_ignore"), // Neutral button text.
|
||||||
() -> Settings.CHECK_WATCH_HISTORY_DOMAIN_NAME.save(false), // Neutral button action (Ignore).
|
() -> BaseSettings.CHECK_WATCH_HISTORY_DOMAIN_NAME.save(false), // Neutral button action (Ignore).
|
||||||
true // Dismiss dialog on Neutral button click.
|
true // Dismiss dialog on Neutral button click.
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -28,10 +28,16 @@ public class BaseSettings {
|
|||||||
public static final BooleanSetting SETTINGS_SEARCH_HISTORY = new BooleanSetting("revanced_settings_search_history", TRUE, true);
|
public static final BooleanSetting SETTINGS_SEARCH_HISTORY = new BooleanSetting("revanced_settings_search_history", TRUE, true);
|
||||||
public static final StringSetting SETTINGS_SEARCH_ENTRIES = new StringSetting("revanced_settings_search_entries", "");
|
public static final StringSetting SETTINGS_SEARCH_ENTRIES = new StringSetting("revanced_settings_search_entries", "");
|
||||||
|
|
||||||
|
//
|
||||||
|
// Settings shared by YouTube and YouTube Music.
|
||||||
|
//
|
||||||
|
|
||||||
public static final BooleanSetting SPOOF_VIDEO_STREAMS = new BooleanSetting("revanced_spoof_video_streams", TRUE, true, "revanced_spoof_video_streams_user_dialog_message");
|
public static final BooleanSetting SPOOF_VIDEO_STREAMS = new BooleanSetting("revanced_spoof_video_streams", TRUE, true, "revanced_spoof_video_streams_user_dialog_message");
|
||||||
public static final EnumSetting<AppLanguage> SPOOF_VIDEO_STREAMS_LANGUAGE = new EnumSetting<>("revanced_spoof_video_streams_language", AppLanguage.DEFAULT, new AudioStreamLanguageOverrideAvailability());
|
public static final EnumSetting<AppLanguage> SPOOF_VIDEO_STREAMS_LANGUAGE = new EnumSetting<>("revanced_spoof_video_streams_language", AppLanguage.DEFAULT, new AudioStreamLanguageOverrideAvailability());
|
||||||
public static final BooleanSetting SPOOF_STREAMING_DATA_STATS_FOR_NERDS = new BooleanSetting("revanced_spoof_streaming_data_stats_for_nerds", TRUE, parent(SPOOF_VIDEO_STREAMS));
|
public static final BooleanSetting SPOOF_STREAMING_DATA_STATS_FOR_NERDS = new BooleanSetting("revanced_spoof_streaming_data_stats_for_nerds", TRUE, parent(SPOOF_VIDEO_STREAMS));
|
||||||
|
|
||||||
public static final BooleanSetting SANITIZE_SHARED_LINKS = new BooleanSetting("revanced_sanitize_sharing_links", TRUE);
|
public static final BooleanSetting SANITIZE_SHARED_LINKS = new BooleanSetting("revanced_sanitize_sharing_links", TRUE);
|
||||||
public static final BooleanSetting REPLACE_MUSIC_LINKS_WITH_YOUTUBE = new BooleanSetting("revanced_replace_music_with_youtube", FALSE);
|
public static final BooleanSetting REPLACE_MUSIC_LINKS_WITH_YOUTUBE = new BooleanSetting("revanced_replace_music_with_youtube", FALSE);
|
||||||
|
|
||||||
|
public static final BooleanSetting CHECK_WATCH_HISTORY_DOMAIN_NAME = new BooleanSetting("revanced_check_watch_history_domain_name", TRUE, false, false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ public abstract class AbstractPreferenceFragment extends PreferenceFragment {
|
|||||||
* Set by subclasses if Strings cannot be added as a resource.
|
* Set by subclasses if Strings cannot be added as a resource.
|
||||||
*/
|
*/
|
||||||
@Nullable
|
@Nullable
|
||||||
protected static String restartDialogButtonText, restartDialogTitle, confirmDialogTitle, restartDialogMessage;
|
protected static CharSequence restartDialogTitle, restartDialogMessage, restartDialogButtonText, confirmDialogTitle;
|
||||||
|
|
||||||
private final SharedPreferences.OnSharedPreferenceChangeListener listener = (sharedPreferences, str) -> {
|
private final SharedPreferences.OnSharedPreferenceChangeListener listener = (sharedPreferences, str) -> {
|
||||||
try {
|
try {
|
||||||
@@ -125,10 +125,13 @@ public abstract class AbstractPreferenceFragment extends PreferenceFragment {
|
|||||||
|
|
||||||
showingUserDialogMessage = true;
|
showingUserDialogMessage = true;
|
||||||
|
|
||||||
|
CharSequence message = BulletPointPreference.formatIntoBulletPoints(
|
||||||
|
Objects.requireNonNull(setting.userDialogMessage).toString());
|
||||||
|
|
||||||
Pair<Dialog, LinearLayout> dialogPair = CustomDialog.create(
|
Pair<Dialog, LinearLayout> dialogPair = CustomDialog.create(
|
||||||
context,
|
context,
|
||||||
confirmDialogTitle, // Title.
|
confirmDialogTitle, // Title.
|
||||||
Objects.requireNonNull(setting.userDialogMessage).toString(), // No message.
|
message,
|
||||||
null, // No EditText.
|
null, // No EditText.
|
||||||
null, // OK button text.
|
null, // OK button text.
|
||||||
() -> {
|
() -> {
|
||||||
@@ -152,6 +155,7 @@ public abstract class AbstractPreferenceFragment extends PreferenceFragment {
|
|||||||
);
|
);
|
||||||
|
|
||||||
dialogPair.first.setOnDismissListener(d -> showingUserDialogMessage = false);
|
dialogPair.first.setOnDismissListener(d -> showingUserDialogMessage = false);
|
||||||
|
dialogPair.first.setCancelable(false);
|
||||||
|
|
||||||
// Show the dialog.
|
// Show the dialog.
|
||||||
dialogPair.first.show();
|
dialogPair.first.show();
|
||||||
|
|||||||
@@ -15,7 +15,15 @@ import android.util.AttributeSet;
|
|||||||
@SuppressWarnings({"unused", "deprecation"})
|
@SuppressWarnings({"unused", "deprecation"})
|
||||||
public class BulletPointPreference extends Preference {
|
public class BulletPointPreference extends Preference {
|
||||||
|
|
||||||
public static SpannedString formatIntoBulletPoints(CharSequence source) {
|
/**
|
||||||
|
* Replaces bullet points with styled spans.
|
||||||
|
*/
|
||||||
|
public static CharSequence formatIntoBulletPoints(CharSequence source) {
|
||||||
|
final char bulletPoint = '•';
|
||||||
|
if (TextUtils.indexOf(source, bulletPoint) < 0) {
|
||||||
|
return source; // Nothing to do.
|
||||||
|
}
|
||||||
|
|
||||||
SpannableStringBuilder builder = new SpannableStringBuilder(source);
|
SpannableStringBuilder builder = new SpannableStringBuilder(source);
|
||||||
|
|
||||||
int lineStart = 0;
|
int lineStart = 0;
|
||||||
@@ -26,7 +34,7 @@ public class BulletPointPreference extends Preference {
|
|||||||
if (lineEnd < 0) lineEnd = length;
|
if (lineEnd < 0) lineEnd = length;
|
||||||
|
|
||||||
// Apply BulletSpan only if the line starts with the '•' character.
|
// Apply BulletSpan only if the line starts with the '•' character.
|
||||||
if (lineEnd > lineStart && builder.charAt(lineStart) == '•') {
|
if (lineEnd > lineStart && builder.charAt(lineStart) == bulletPoint) {
|
||||||
int deleteEnd = lineStart + 1; // remove the bullet itself
|
int deleteEnd = lineStart + 1; // remove the bullet itself
|
||||||
|
|
||||||
// If there's a single space right after the bullet, remove that too.
|
// If there's a single space right after the bullet, remove that too.
|
||||||
|
|||||||
@@ -5,12 +5,15 @@ import static app.revanced.extension.shared.Utils.getResourceIdentifierOrThrow;
|
|||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.graphics.Color;
|
||||||
import android.graphics.drawable.GradientDrawable;
|
import android.graphics.drawable.GradientDrawable;
|
||||||
|
import android.os.Build;
|
||||||
import android.preference.Preference;
|
import android.preference.Preference;
|
||||||
import android.preference.PreferenceCategory;
|
import android.preference.PreferenceCategory;
|
||||||
import android.preference.PreferenceGroup;
|
import android.preference.PreferenceGroup;
|
||||||
import android.preference.PreferenceScreen;
|
import android.preference.PreferenceScreen;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
import android.util.TypedValue;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
@@ -23,6 +26,7 @@ import android.widget.SearchView;
|
|||||||
import android.widget.Toolbar;
|
import android.widget.Toolbar;
|
||||||
|
|
||||||
import androidx.annotation.ColorInt;
|
import androidx.annotation.ColorInt;
|
||||||
|
import androidx.annotation.RequiresApi;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
@@ -118,6 +122,14 @@ public abstract class BaseSearchViewController {
|
|||||||
searchView.setBackground(createBackgroundDrawable());
|
searchView.setBackground(createBackgroundDrawable());
|
||||||
searchView.setQueryHint(str("revanced_settings_search_hint"));
|
searchView.setQueryHint(str("revanced_settings_search_hint"));
|
||||||
|
|
||||||
|
// Set text size.
|
||||||
|
searchEditText.setTextSize(TypedValue.COMPLEX_UNIT_SP, 16);
|
||||||
|
|
||||||
|
// Set cursor color.
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||||
|
setCursorColor(searchEditText);
|
||||||
|
}
|
||||||
|
|
||||||
// Configure RTL support based on app language.
|
// Configure RTL support based on app language.
|
||||||
AppLanguage appLanguage = BaseSettings.REVANCED_LANGUAGE.get();
|
AppLanguage appLanguage = BaseSettings.REVANCED_LANGUAGE.get();
|
||||||
if (Utils.isRightToLeftLocale(appLanguage.getLocale())) {
|
if (Utils.isRightToLeftLocale(appLanguage.getLocale())) {
|
||||||
@@ -126,6 +138,24 @@ public abstract class BaseSearchViewController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the cursor color (for Android 10+ devices).
|
||||||
|
*/
|
||||||
|
@RequiresApi(api = Build.VERSION_CODES.Q)
|
||||||
|
private void setCursorColor(EditText editText) {
|
||||||
|
// Get the cursor color based on the current theme.
|
||||||
|
final int cursorColor = Utils.isDarkModeEnabled() ? Color.WHITE : Color.BLACK;
|
||||||
|
|
||||||
|
// Create cursor drawable.
|
||||||
|
GradientDrawable cursorDrawable = new GradientDrawable();
|
||||||
|
cursorDrawable.setShape(GradientDrawable.RECTANGLE);
|
||||||
|
cursorDrawable.setSize(Utils.dipToPixels(2), -1); // Width: 2dp, Height: match text height.
|
||||||
|
cursorDrawable.setColor(cursorColor);
|
||||||
|
|
||||||
|
// Set cursor drawable.
|
||||||
|
editText.setTextCursorDrawable(cursorDrawable);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes the overlay container for displaying search results and history.
|
* Initializes the overlay container for displaying search results and history.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -42,11 +42,8 @@ final class PlayerRoutes {
|
|||||||
JSONObject context = new JSONObject();
|
JSONObject context = new JSONObject();
|
||||||
|
|
||||||
AppLanguage language = SpoofVideoStreamsPatch.getLanguageOverride();
|
AppLanguage language = SpoofVideoStreamsPatch.getLanguageOverride();
|
||||||
if (language == null || clientType == ANDROID_VR_1_43_32) {
|
if (language == null) {
|
||||||
// Force original audio has not overrode the language.
|
// Force original audio has not overrode the language.
|
||||||
// Or if YT has fallen over to the last unauthenticated client (VR 1.43), then
|
|
||||||
// always use the app language because forcing an audio stream of specific languages
|
|
||||||
// can sometimes fail so it's better to try and load something rather than nothing.
|
|
||||||
language = BaseSettings.SPOOF_VIDEO_STREAMS_LANGUAGE.get();
|
language = BaseSettings.SPOOF_VIDEO_STREAMS_LANGUAGE.get();
|
||||||
}
|
}
|
||||||
//noinspection ExtractMethodRecommender
|
//noinspection ExtractMethodRecommender
|
||||||
|
|||||||
@@ -58,10 +58,10 @@ public class CustomDialog {
|
|||||||
* @param dismissDialogOnNeutralClick If the dialog should be dismissed when the Neutral button is clicked.
|
* @param dismissDialogOnNeutralClick If the dialog should be dismissed when the Neutral button is clicked.
|
||||||
* @return The Dialog and its main LinearLayout container.
|
* @return The Dialog and its main LinearLayout container.
|
||||||
*/
|
*/
|
||||||
public static Pair<Dialog, LinearLayout> create(Context context, String title, CharSequence message,
|
public static Pair<Dialog, LinearLayout> create(Context context, CharSequence title, CharSequence message,
|
||||||
@Nullable EditText editText, String okButtonText,
|
@Nullable EditText editText, CharSequence okButtonText,
|
||||||
Runnable onOkClick, Runnable onCancelClick,
|
Runnable onOkClick, Runnable onCancelClick,
|
||||||
@Nullable String neutralButtonText,
|
@Nullable CharSequence neutralButtonText,
|
||||||
@Nullable Runnable onNeutralClick,
|
@Nullable Runnable onNeutralClick,
|
||||||
boolean dismissDialogOnNeutralClick) {
|
boolean dismissDialogOnNeutralClick) {
|
||||||
Logger.printDebug(() -> "Creating custom dialog with title: " + title);
|
Logger.printDebug(() -> "Creating custom dialog with title: " + title);
|
||||||
@@ -85,9 +85,9 @@ public class CustomDialog {
|
|||||||
* @param onNeutralClick Action to perform when the Neutral button is clicked, or null if no Neutral button is needed.
|
* @param onNeutralClick Action to perform when the Neutral button is clicked, or null if no Neutral button is needed.
|
||||||
* @param dismissDialogOnNeutralClick If the dialog should be dismissed when the Neutral button is clicked.
|
* @param dismissDialogOnNeutralClick If the dialog should be dismissed when the Neutral button is clicked.
|
||||||
*/
|
*/
|
||||||
private CustomDialog(Context context, String title, CharSequence message, @Nullable EditText editText,
|
private CustomDialog(Context context, CharSequence title, CharSequence message, @Nullable EditText editText,
|
||||||
String okButtonText, Runnable onOkClick, Runnable onCancelClick,
|
CharSequence okButtonText, Runnable onOkClick, Runnable onCancelClick,
|
||||||
@Nullable String neutralButtonText, @Nullable Runnable onNeutralClick,
|
@Nullable CharSequence neutralButtonText, @Nullable Runnable onNeutralClick,
|
||||||
boolean dismissDialogOnNeutralClick) {
|
boolean dismissDialogOnNeutralClick) {
|
||||||
this.context = context;
|
this.context = context;
|
||||||
this.dialog = new Dialog(context);
|
this.dialog = new Dialog(context);
|
||||||
@@ -139,7 +139,7 @@ public class CustomDialog {
|
|||||||
*
|
*
|
||||||
* @param title The title text to display.
|
* @param title The title text to display.
|
||||||
*/
|
*/
|
||||||
private void addTitle(String title) {
|
private void addTitle(CharSequence title) {
|
||||||
if (TextUtils.isEmpty(title)) return;
|
if (TextUtils.isEmpty(title)) return;
|
||||||
|
|
||||||
TextView titleView = new TextView(context);
|
TextView titleView = new TextView(context);
|
||||||
@@ -232,8 +232,8 @@ public class CustomDialog {
|
|||||||
* @param onNeutralClick Action for the Neutral button click, or null if no Neutral button.
|
* @param onNeutralClick Action for the Neutral button click, or null if no Neutral button.
|
||||||
* @param dismissDialogOnNeutralClick If the dialog should dismiss on Neutral button click.
|
* @param dismissDialogOnNeutralClick If the dialog should dismiss on Neutral button click.
|
||||||
*/
|
*/
|
||||||
private void addButtons(String okButtonText, Runnable onOkClick, Runnable onCancelClick,
|
private void addButtons(CharSequence okButtonText, Runnable onOkClick, Runnable onCancelClick,
|
||||||
@Nullable String neutralButtonText, @Nullable Runnable onNeutralClick,
|
@Nullable CharSequence neutralButtonText, @Nullable Runnable onNeutralClick,
|
||||||
boolean dismissDialogOnNeutralClick) {
|
boolean dismissDialogOnNeutralClick) {
|
||||||
// Button container.
|
// Button container.
|
||||||
LinearLayout buttonContainer = new LinearLayout(context);
|
LinearLayout buttonContainer = new LinearLayout(context);
|
||||||
@@ -280,7 +280,7 @@ public class CustomDialog {
|
|||||||
* @param dismissDialog If the dialog should dismiss when the button is clicked.
|
* @param dismissDialog If the dialog should dismiss when the button is clicked.
|
||||||
* @return The created Button.
|
* @return The created Button.
|
||||||
*/
|
*/
|
||||||
private Button createButton(String text, Runnable onClick, boolean isOkButton, boolean dismissDialog) {
|
private Button createButton(CharSequence text, Runnable onClick, boolean isOkButton, boolean dismissDialog) {
|
||||||
Button button = new Button(context, null, 0);
|
Button button = new Button(context, null, 0);
|
||||||
button.setText(text);
|
button.setText(text);
|
||||||
button.setTextSize(14);
|
button.setTextSize(14);
|
||||||
|
|||||||
@@ -2,12 +2,15 @@ package app.revanced.extension.tiktok.settings.preference;
|
|||||||
|
|
||||||
import android.preference.Preference;
|
import android.preference.Preference;
|
||||||
import android.preference.PreferenceScreen;
|
import android.preference.PreferenceScreen;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
|
import app.revanced.extension.shared.Utils;
|
||||||
import app.revanced.extension.shared.settings.Setting;
|
import app.revanced.extension.shared.settings.Setting;
|
||||||
import app.revanced.extension.shared.settings.preference.AbstractPreferenceFragment;
|
import app.revanced.extension.shared.settings.preference.AbstractPreferenceFragment;
|
||||||
import app.revanced.extension.tiktok.settings.preference.categories.DownloadsPreferenceCategory;
|
import app.revanced.extension.tiktok.settings.preference.categories.DownloadsPreferenceCategory;
|
||||||
import app.revanced.extension.tiktok.settings.preference.categories.FeedFilterPreferenceCategory;
|
|
||||||
import app.revanced.extension.tiktok.settings.preference.categories.ExtensionPreferenceCategory;
|
import app.revanced.extension.tiktok.settings.preference.categories.ExtensionPreferenceCategory;
|
||||||
|
import app.revanced.extension.tiktok.settings.preference.categories.FeedFilterPreferenceCategory;
|
||||||
import app.revanced.extension.tiktok.settings.preference.categories.SimSpoofPreferenceCategory;
|
import app.revanced.extension.tiktok.settings.preference.categories.SimSpoofPreferenceCategory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -37,10 +40,14 @@ public class TikTokPreferenceFragment extends AbstractPreferenceFragment {
|
|||||||
|
|
||||||
// Currently no resources can be compiled for TikTok (fails with aapt error).
|
// Currently no resources can be compiled for TikTok (fails with aapt error).
|
||||||
// So all TikTok Strings are hard coded in the extension.
|
// So all TikTok Strings are hard coded in the extension.
|
||||||
restartDialogTitle = "Refresh and restart";
|
restartDialogTitle = "Restart required";
|
||||||
|
restartDialogMessage = "Restart the app for this change to take effect.";
|
||||||
restartDialogButtonText = "Restart";
|
restartDialogButtonText = "Restart";
|
||||||
confirmDialogTitle = "Do you wish to proceed?";
|
confirmDialogTitle = "Do you wish to proceed?";
|
||||||
|
|
||||||
|
// App does not use dark mode.
|
||||||
|
Utils.setIsDarkModeEnabled(false);
|
||||||
|
|
||||||
PreferenceScreen preferenceScreen = getPreferenceManager().createPreferenceScreen(context);
|
PreferenceScreen preferenceScreen = getPreferenceManager().createPreferenceScreen(context);
|
||||||
setPreferenceScreen(preferenceScreen);
|
setPreferenceScreen(preferenceScreen);
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
package app.revanced.extension.youtube.patches;
|
|
||||||
|
|
||||||
import app.revanced.extension.youtube.settings.Settings;
|
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
public class AutoRepeatPatch {
|
|
||||||
//Used by app.revanced.patches.youtube.layout.autorepeat.patch.AutoRepeatPatch
|
|
||||||
public static boolean shouldAutoRepeat() {
|
|
||||||
return Settings.AUTO_REPEAT.get();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -5,7 +5,7 @@ import android.view.Display;
|
|||||||
import app.revanced.extension.youtube.settings.Settings;
|
import app.revanced.extension.youtube.settings.Settings;
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
public class DisableHdrPatch {
|
public class DisableVideoCodecsPatch {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Injection point.
|
* Injection point.
|
||||||
@@ -15,5 +15,12 @@ public class DisableHdrPatch {
|
|||||||
? new int[0]
|
? new int[0]
|
||||||
: capabilities.getSupportedHdrTypes();
|
: capabilities.getSupportedHdrTypes();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Injection point.
|
||||||
|
*/
|
||||||
|
public static boolean allowVP9() {
|
||||||
|
return !Settings.FORCE_AVC_CODEC.get();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -15,7 +15,8 @@ public class ForceOriginalAudioPatch {
|
|||||||
*/
|
*/
|
||||||
public static void setPreferredLanguage() {
|
public static void setPreferredLanguage() {
|
||||||
if (Settings.FORCE_ORIGINAL_AUDIO.get()
|
if (Settings.FORCE_ORIGINAL_AUDIO.get()
|
||||||
&& SpoofVideoStreamsPatch.spoofingToClientWithNoMultiAudioStreams()) {
|
&& SpoofVideoStreamsPatch.spoofingToClientWithNoMultiAudioStreams()
|
||||||
|
&& !Settings.SPOOF_VIDEO_STREAMS_CLIENT_TYPE.get().useAuth) {
|
||||||
// If client spoofing does not use authentication and lacks multi-audio streams,
|
// If client spoofing does not use authentication and lacks multi-audio streams,
|
||||||
// then can use any language code for the request and if that requested language is
|
// then can use any language code for the request and if that requested language is
|
||||||
// not available YT uses the original audio language. Authenticated requests ignore
|
// not available YT uses the original audio language. Authenticated requests ignore
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package app.revanced.extension.youtube.patches;
|
||||||
|
|
||||||
|
import app.revanced.extension.youtube.settings.Settings;
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
|
public class LoopVideoPatch {
|
||||||
|
/**
|
||||||
|
* Injection point
|
||||||
|
*/
|
||||||
|
public static boolean shouldLoopVideo() {
|
||||||
|
return Settings.LOOP_VIDEO.get();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6,8 +6,11 @@ import app.revanced.extension.youtube.shared.PlayerType;
|
|||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
final class CommentsFilter extends Filter {
|
final class CommentsFilter extends Filter {
|
||||||
|
|
||||||
|
private static final String COMMENT_COMPOSER_PATH = "comment_composer.eml";
|
||||||
|
|
||||||
private final StringFilterGroup chipBar;
|
private final StringFilterGroup chipBar;
|
||||||
private final ByteArrayFilterGroup aiCommentsSummary;
|
private final ByteArrayFilterGroup aiCommentsSummary;
|
||||||
|
private final StringFilterGroup emojiAndTimestampButtons;
|
||||||
|
|
||||||
public CommentsFilter() {
|
public CommentsFilter() {
|
||||||
var chatSummary = new StringFilterGroup(
|
var chatSummary = new StringFilterGroup(
|
||||||
@@ -52,6 +55,11 @@ final class CommentsFilter extends Filter {
|
|||||||
"composer_short_creation_button.eml"
|
"composer_short_creation_button.eml"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
emojiAndTimestampButtons = new StringFilterGroup(
|
||||||
|
Settings.HIDE_COMMENTS_EMOJI_AND_TIMESTAMP_BUTTONS,
|
||||||
|
"|CellType|ContainerType|ContainerType|ContainerType|ContainerType|ContainerType|"
|
||||||
|
);
|
||||||
|
|
||||||
var previewComment = new StringFilterGroup(
|
var previewComment = new StringFilterGroup(
|
||||||
Settings.HIDE_COMMENTS_PREVIEW_COMMENT,
|
Settings.HIDE_COMMENTS_PREVIEW_COMMENT,
|
||||||
"|carousel_item",
|
"|carousel_item",
|
||||||
@@ -64,11 +72,6 @@ final class CommentsFilter extends Filter {
|
|||||||
"super_thanks_button.eml"
|
"super_thanks_button.eml"
|
||||||
);
|
);
|
||||||
|
|
||||||
StringFilterGroup timestampButton = new StringFilterGroup(
|
|
||||||
Settings.HIDE_COMMENTS_TIMESTAMP_BUTTON,
|
|
||||||
"composer_timestamp_button.eml"
|
|
||||||
);
|
|
||||||
|
|
||||||
addPathCallbacks(
|
addPathCallbacks(
|
||||||
channelGuidelines,
|
channelGuidelines,
|
||||||
chatSummary,
|
chatSummary,
|
||||||
@@ -77,9 +80,9 @@ final class CommentsFilter extends Filter {
|
|||||||
comments,
|
comments,
|
||||||
communityGuidelines,
|
communityGuidelines,
|
||||||
createAShort,
|
createAShort,
|
||||||
|
emojiAndTimestampButtons,
|
||||||
previewComment,
|
previewComment,
|
||||||
thanksButton,
|
thanksButton
|
||||||
timestampButton
|
|
||||||
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -93,6 +96,10 @@ final class CommentsFilter extends Filter {
|
|||||||
&& aiCommentsSummary.check(buffer).isFiltered();
|
&& aiCommentsSummary.check(buffer).isFiltered();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (matchedGroup == emojiAndTimestampButtons) {
|
||||||
|
return path.startsWith(COMMENT_COMPOSER_PATH);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -154,6 +154,13 @@ public final class ShortsFilter extends Filter {
|
|||||||
"reel_dislike_button.eml"
|
"reel_dislike_button.eml"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
StringFilterGroup previewComment = new StringFilterGroup(
|
||||||
|
Settings.HIDE_SHORTS_PREVIEW_COMMENT,
|
||||||
|
// Preview comment that can popup while a Short is playing.
|
||||||
|
// Uses no bundled icons, and instead the users profile photo is shown.
|
||||||
|
"participation_bar.eml"
|
||||||
|
);
|
||||||
|
|
||||||
joinButton = new StringFilterGroup(
|
joinButton = new StringFilterGroup(
|
||||||
Settings.HIDE_SHORTS_JOIN_BUTTON,
|
Settings.HIDE_SHORTS_JOIN_BUTTON,
|
||||||
"sponsor_button"
|
"sponsor_button"
|
||||||
@@ -213,7 +220,7 @@ public final class ShortsFilter extends Filter {
|
|||||||
|
|
||||||
addPathCallbacks(
|
addPathCallbacks(
|
||||||
shortsCompactFeedVideo, joinButton, subscribeButton, paidPromotionButton,
|
shortsCompactFeedVideo, joinButton, subscribeButton, paidPromotionButton,
|
||||||
shortsActionBar, suggestedAction, pausedOverlayButtons, channelBar,
|
shortsActionBar, suggestedAction, pausedOverlayButtons, channelBar, previewComment,
|
||||||
fullVideoLinkLabel, videoTitle, useSoundButton, reelSoundMetadata, soundButton, infoPanel,
|
fullVideoLinkLabel, videoTitle, useSoundButton, reelSoundMetadata, soundButton, infoPanel,
|
||||||
stickers, likeFountain, likeButton, dislikeButton
|
stickers, likeFountain, likeButton, dislikeButton
|
||||||
);
|
);
|
||||||
@@ -243,12 +250,6 @@ public final class ShortsFilter extends Filter {
|
|||||||
// Suggested actions.
|
// Suggested actions.
|
||||||
//
|
//
|
||||||
suggestedActionsBuffer.addAll(
|
suggestedActionsBuffer.addAll(
|
||||||
new ByteArrayFilterGroup(
|
|
||||||
Settings.HIDE_SHORTS_PREVIEW_COMMENT,
|
|
||||||
// Preview comment that can popup while a Short is playing.
|
|
||||||
// Uses no bundled icons, and instead the users profile photo is shown.
|
|
||||||
"shorts-comments-panel"
|
|
||||||
),
|
|
||||||
new ByteArrayFilterGroup(
|
new ByteArrayFilterGroup(
|
||||||
Settings.HIDE_SHORTS_SHOP_BUTTON,
|
Settings.HIDE_SHORTS_SHOP_BUTTON,
|
||||||
"yt_outline_bag_"
|
"yt_outline_bag_"
|
||||||
|
|||||||
@@ -18,7 +18,22 @@ public class SpoofVideoStreamsPatch {
|
|||||||
* Injection point.
|
* Injection point.
|
||||||
*/
|
*/
|
||||||
public static void setClientOrderToUse() {
|
public static void setClientOrderToUse() {
|
||||||
List<ClientType> availableClients = List.of(
|
final boolean forceAVC = Settings.FORCE_AVC_CODEC.get();
|
||||||
|
|
||||||
|
// VR 1.61 uses VP9/AV1, and cannot force AVC.
|
||||||
|
ClientType client = Settings.SPOOF_VIDEO_STREAMS_CLIENT_TYPE.get();
|
||||||
|
if (forceAVC && client == ANDROID_VR_1_61_48) {
|
||||||
|
client = ANDROID_VR_1_43_32; // Use VR 1.43 instead.
|
||||||
|
}
|
||||||
|
|
||||||
|
List<ClientType> availableClients = forceAVC
|
||||||
|
? List.of(
|
||||||
|
ANDROID_VR_1_43_32,
|
||||||
|
VISIONOS,
|
||||||
|
ANDROID_CREATOR,
|
||||||
|
ANDROID_VR_1_61_48,
|
||||||
|
IPADOS)
|
||||||
|
: List.of(
|
||||||
ANDROID_VR_1_61_48,
|
ANDROID_VR_1_61_48,
|
||||||
VISIONOS,
|
VISIONOS,
|
||||||
ANDROID_CREATOR,
|
ANDROID_CREATOR,
|
||||||
@@ -27,6 +42,6 @@ public class SpoofVideoStreamsPatch {
|
|||||||
);
|
);
|
||||||
|
|
||||||
app.revanced.extension.shared.spoof.SpoofVideoStreamsPatch.setClientsToUse(
|
app.revanced.extension.shared.spoof.SpoofVideoStreamsPatch.setClientsToUse(
|
||||||
availableClients, Settings.SPOOF_VIDEO_STREAMS_CLIENT_TYPE.get());
|
availableClients, client);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -48,6 +48,9 @@ import app.revanced.extension.youtube.swipecontrols.SwipeControlsConfigurationPr
|
|||||||
|
|
||||||
public class Settings extends BaseSettings {
|
public class Settings extends BaseSettings {
|
||||||
// Video
|
// Video
|
||||||
|
public static final BooleanSetting ADVANCED_VIDEO_QUALITY_MENU = new BooleanSetting("revanced_advanced_video_quality_menu", TRUE);
|
||||||
|
public static final BooleanSetting DISABLE_HDR_VIDEO = new BooleanSetting("revanced_disable_hdr_video", FALSE);
|
||||||
|
public static final BooleanSetting FORCE_AVC_CODEC = new BooleanSetting("revanced_force_avc_codec", FALSE, true, "revanced_force_avc_codec_user_dialog_message");
|
||||||
public static final IntegerSetting VIDEO_QUALITY_DEFAULT_WIFI = new IntegerSetting("revanced_video_quality_default_wifi", -2);
|
public static final IntegerSetting VIDEO_QUALITY_DEFAULT_WIFI = new IntegerSetting("revanced_video_quality_default_wifi", -2);
|
||||||
public static final IntegerSetting VIDEO_QUALITY_DEFAULT_MOBILE = new IntegerSetting("revanced_video_quality_default_mobile", -2);
|
public static final IntegerSetting VIDEO_QUALITY_DEFAULT_MOBILE = new IntegerSetting("revanced_video_quality_default_mobile", -2);
|
||||||
public static final BooleanSetting REMEMBER_VIDEO_QUALITY_LAST_SELECTED = new BooleanSetting("revanced_remember_video_quality_last_selected", FALSE);
|
public static final BooleanSetting REMEMBER_VIDEO_QUALITY_LAST_SELECTED = new BooleanSetting("revanced_remember_video_quality_last_selected", FALSE);
|
||||||
@@ -56,8 +59,6 @@ public class Settings extends BaseSettings {
|
|||||||
public static final BooleanSetting REMEMBER_SHORTS_QUALITY_LAST_SELECTED = new BooleanSetting("revanced_remember_shorts_quality_last_selected", FALSE);
|
public static final BooleanSetting REMEMBER_SHORTS_QUALITY_LAST_SELECTED = new BooleanSetting("revanced_remember_shorts_quality_last_selected", FALSE);
|
||||||
public static final BooleanSetting REMEMBER_VIDEO_QUALITY_LAST_SELECTED_TOAST = new BooleanSetting("revanced_remember_video_quality_last_selected_toast", TRUE, false,
|
public static final BooleanSetting REMEMBER_VIDEO_QUALITY_LAST_SELECTED_TOAST = new BooleanSetting("revanced_remember_video_quality_last_selected_toast", TRUE, false,
|
||||||
parentsAny(REMEMBER_VIDEO_QUALITY_LAST_SELECTED, REMEMBER_SHORTS_QUALITY_LAST_SELECTED));
|
parentsAny(REMEMBER_VIDEO_QUALITY_LAST_SELECTED, REMEMBER_SHORTS_QUALITY_LAST_SELECTED));
|
||||||
public static final BooleanSetting ADVANCED_VIDEO_QUALITY_MENU = new BooleanSetting("revanced_advanced_video_quality_menu", TRUE);
|
|
||||||
public static final BooleanSetting DISABLE_HDR_VIDEO = new BooleanSetting("revanced_disable_hdr_video", FALSE);
|
|
||||||
|
|
||||||
// Speed
|
// Speed
|
||||||
public static final FloatSetting SPEED_TAP_AND_HOLD = new FloatSetting("revanced_speed_tap_and_hold", 2.0f, true);
|
public static final FloatSetting SPEED_TAP_AND_HOLD = new FloatSetting("revanced_speed_tap_and_hold", 2.0f, true);
|
||||||
@@ -198,9 +199,9 @@ public class Settings extends BaseSettings {
|
|||||||
public static final BooleanSetting HIDE_COMMENTS_COMMUNITY_GUIDELINES = new BooleanSetting("revanced_hide_comments_community_guidelines", TRUE);
|
public static final BooleanSetting HIDE_COMMENTS_COMMUNITY_GUIDELINES = new BooleanSetting("revanced_hide_comments_community_guidelines", TRUE);
|
||||||
public static final BooleanSetting HIDE_COMMENTS_CREATE_A_SHORT_BUTTON = new BooleanSetting("revanced_hide_comments_create_a_short_button", TRUE);
|
public static final BooleanSetting HIDE_COMMENTS_CREATE_A_SHORT_BUTTON = new BooleanSetting("revanced_hide_comments_create_a_short_button", TRUE);
|
||||||
public static final BooleanSetting HIDE_COMMENTS_PREVIEW_COMMENT = new BooleanSetting("revanced_hide_comments_preview_comment", FALSE);
|
public static final BooleanSetting HIDE_COMMENTS_PREVIEW_COMMENT = new BooleanSetting("revanced_hide_comments_preview_comment", FALSE);
|
||||||
|
public static final BooleanSetting HIDE_COMMENTS_EMOJI_AND_TIMESTAMP_BUTTONS = new BooleanSetting("revanced_hide_comments_emoji_and_timestamp_buttons", FALSE);
|
||||||
public static final BooleanSetting HIDE_COMMENTS_SECTION = new BooleanSetting("revanced_hide_comments_section", FALSE);
|
public static final BooleanSetting HIDE_COMMENTS_SECTION = new BooleanSetting("revanced_hide_comments_section", FALSE);
|
||||||
public static final BooleanSetting HIDE_COMMENTS_THANKS_BUTTON = new BooleanSetting("revanced_hide_comments_thanks_button", TRUE);
|
public static final BooleanSetting HIDE_COMMENTS_THANKS_BUTTON = new BooleanSetting("revanced_hide_comments_thanks_button", TRUE);
|
||||||
public static final BooleanSetting HIDE_COMMENTS_TIMESTAMP_BUTTON = new BooleanSetting("revanced_hide_comments_timestamp_button", FALSE);
|
|
||||||
|
|
||||||
// Description
|
// Description
|
||||||
public static final BooleanSetting HIDE_AI_GENERATED_VIDEO_SUMMARY_SECTION = new BooleanSetting("revanced_hide_ai_generated_video_summary_section", FALSE);
|
public static final BooleanSetting HIDE_AI_GENERATED_VIDEO_SUMMARY_SECTION = new BooleanSetting("revanced_hide_ai_generated_video_summary_section", FALSE);
|
||||||
@@ -341,9 +342,9 @@ public class Settings extends BaseSettings {
|
|||||||
// Miscellaneous
|
// Miscellaneous
|
||||||
public static final BooleanSetting ANNOUNCEMENTS = new BooleanSetting("revanced_announcements", TRUE);
|
public static final BooleanSetting ANNOUNCEMENTS = new BooleanSetting("revanced_announcements", TRUE);
|
||||||
public static final IntegerSetting ANNOUNCEMENT_LAST_ID = new IntegerSetting("revanced_announcement_last_id", -1, false, false);
|
public static final IntegerSetting ANNOUNCEMENT_LAST_ID = new IntegerSetting("revanced_announcement_last_id", -1, false, false);
|
||||||
public static final BooleanSetting AUTO_REPEAT = new BooleanSetting("revanced_auto_repeat", FALSE);
|
public static final BooleanSetting LOOP_VIDEO = new BooleanSetting("revanced_loop_video", FALSE);
|
||||||
|
public static final BooleanSetting LOOP_VIDEO_BUTTON = new BooleanSetting("revanced_loop_video_button", FALSE);
|
||||||
public static final BooleanSetting BYPASS_URL_REDIRECTS = new BooleanSetting("revanced_bypass_url_redirects", TRUE);
|
public static final BooleanSetting BYPASS_URL_REDIRECTS = new BooleanSetting("revanced_bypass_url_redirects", TRUE);
|
||||||
public static final BooleanSetting CHECK_WATCH_HISTORY_DOMAIN_NAME = new BooleanSetting("revanced_check_watch_history_domain_name", TRUE, false, false);
|
|
||||||
public static final BooleanSetting DISABLE_HAPTIC_FEEDBACK_CHAPTERS = new BooleanSetting("revanced_disable_haptic_feedback_chapters", FALSE);
|
public static final BooleanSetting DISABLE_HAPTIC_FEEDBACK_CHAPTERS = new BooleanSetting("revanced_disable_haptic_feedback_chapters", FALSE);
|
||||||
public static final BooleanSetting DISABLE_HAPTIC_FEEDBACK_PRECISE_SEEKING = new BooleanSetting("revanced_disable_haptic_feedback_precise_seeking", FALSE);
|
public static final BooleanSetting DISABLE_HAPTIC_FEEDBACK_PRECISE_SEEKING = new BooleanSetting("revanced_disable_haptic_feedback_precise_seeking", FALSE);
|
||||||
public static final BooleanSetting DISABLE_HAPTIC_FEEDBACK_SEEK_UNDO = new BooleanSetting("revanced_disable_haptic_feedback_seek_undo", FALSE);
|
public static final BooleanSetting DISABLE_HAPTIC_FEEDBACK_SEEK_UNDO = new BooleanSetting("revanced_disable_haptic_feedback_seek_undo", FALSE);
|
||||||
@@ -444,6 +445,7 @@ public class Settings extends BaseSettings {
|
|||||||
public static final StringSetting SB_CATEGORY_UNSUBMITTED_COLOR = new StringSetting("sb_unsubmitted_color", "#FFFFFFFF", false, false);
|
public static final StringSetting SB_CATEGORY_UNSUBMITTED_COLOR = new StringSetting("sb_unsubmitted_color", "#FFFFFFFF", false, false);
|
||||||
|
|
||||||
// Deprecated migrations
|
// Deprecated migrations
|
||||||
|
private static final BooleanSetting DEPRECATED_AUTO_REPEAT = new BooleanSetting("revanced_auto_repeat", FALSE);
|
||||||
private static final BooleanSetting DEPRECATED_HIDE_PLAYER_BUTTONS = new BooleanSetting("revanced_hide_player_buttons", FALSE, true);
|
private static final BooleanSetting DEPRECATED_HIDE_PLAYER_BUTTONS = new BooleanSetting("revanced_hide_player_buttons", FALSE, true);
|
||||||
private static final BooleanSetting DEPRECATED_HIDE_PLAYER_FLYOUT_VIDEO_QUALITY_FOOTER = new BooleanSetting("revanced_hide_video_quality_menu_footer", FALSE);
|
private static final BooleanSetting DEPRECATED_HIDE_PLAYER_FLYOUT_VIDEO_QUALITY_FOOTER = new BooleanSetting("revanced_hide_video_quality_menu_footer", FALSE);
|
||||||
private static final IntegerSetting DEPRECATED_SWIPE_OVERLAY_BACKGROUND_ALPHA = new IntegerSetting("revanced_swipe_overlay_background_alpha", 127);
|
private static final IntegerSetting DEPRECATED_SWIPE_OVERLAY_BACKGROUND_ALPHA = new IntegerSetting("revanced_swipe_overlay_background_alpha", 127);
|
||||||
@@ -452,20 +454,21 @@ public class Settings extends BaseSettings {
|
|||||||
private static final BooleanSetting DEPRECATED_RESTORE_OLD_VIDEO_QUALITY_MENU = new BooleanSetting("revanced_restore_old_video_quality_menu", TRUE);
|
private static final BooleanSetting DEPRECATED_RESTORE_OLD_VIDEO_QUALITY_MENU = new BooleanSetting("revanced_restore_old_video_quality_menu", TRUE);
|
||||||
private static final BooleanSetting DEPRECATED_AUTO_CAPTIONS = new BooleanSetting("revanced_auto_captions", FALSE);
|
private static final BooleanSetting DEPRECATED_AUTO_CAPTIONS = new BooleanSetting("revanced_auto_captions", FALSE);
|
||||||
|
|
||||||
public static final FloatSetting DEPRECATED_SB_CATEGORY_SPONSOR_OPACITY = new FloatSetting("sb_sponsor_opacity", 0.8f, false, false);
|
private static final FloatSetting DEPRECATED_SB_CATEGORY_SPONSOR_OPACITY = new FloatSetting("sb_sponsor_opacity", 0.8f, false, false);
|
||||||
public static final FloatSetting DEPRECATED_SB_CATEGORY_SELF_PROMO_OPACITY = new FloatSetting("sb_selfpromo_opacity", 0.8f, false, false);
|
private static final FloatSetting DEPRECATED_SB_CATEGORY_SELF_PROMO_OPACITY = new FloatSetting("sb_selfpromo_opacity", 0.8f, false, false);
|
||||||
public static final FloatSetting DEPRECATED_SB_CATEGORY_INTERACTION_OPACITY = new FloatSetting("sb_interaction_opacity", 0.8f, false, false);
|
private static final FloatSetting DEPRECATED_SB_CATEGORY_INTERACTION_OPACITY = new FloatSetting("sb_interaction_opacity", 0.8f, false, false);
|
||||||
public static final FloatSetting DEPRECATED_SB_CATEGORY_HIGHLIGHT_OPACITY = new FloatSetting("sb_highlight_opacity", 0.8f, false, false);
|
private static final FloatSetting DEPRECATED_SB_CATEGORY_HIGHLIGHT_OPACITY = new FloatSetting("sb_highlight_opacity", 0.8f, false, false);
|
||||||
public static final FloatSetting DEPRECATED_SB_CATEGORY_HOOK_OPACITY = new FloatSetting("sb_hook_opacity", 0.8f, false, false);
|
private static final FloatSetting DEPRECATED_SB_CATEGORY_HOOK_OPACITY = new FloatSetting("sb_hook_opacity", 0.8f, false, false);
|
||||||
public static final FloatSetting DEPRECATED_SB_CATEGORY_INTRO_OPACITY = new FloatSetting("sb_intro_opacity", 0.8f, false, false);
|
private static final FloatSetting DEPRECATED_SB_CATEGORY_INTRO_OPACITY = new FloatSetting("sb_intro_opacity", 0.8f, false, false);
|
||||||
public static final FloatSetting DEPRECATED_SB_CATEGORY_OUTRO_OPACITY = new FloatSetting("sb_outro_opacity", 0.8f, false, false);
|
private static final FloatSetting DEPRECATED_SB_CATEGORY_OUTRO_OPACITY = new FloatSetting("sb_outro_opacity", 0.8f, false, false);
|
||||||
public static final FloatSetting DEPRECATED_SB_CATEGORY_PREVIEW_OPACITY = new FloatSetting("sb_preview_opacity", 0.8f, false, false);
|
private static final FloatSetting DEPRECATED_SB_CATEGORY_PREVIEW_OPACITY = new FloatSetting("sb_preview_opacity", 0.8f, false, false);
|
||||||
public static final FloatSetting DEPRECATED_SB_CATEGORY_FILLER_OPACITY = new FloatSetting("sb_filler_opacity", 0.8f, false, false);
|
private static final FloatSetting DEPRECATED_SB_CATEGORY_FILLER_OPACITY = new FloatSetting("sb_filler_opacity", 0.8f, false, false);
|
||||||
public static final FloatSetting DEPRECATED_SB_CATEGORY_MUSIC_OFFTOPIC_OPACITY = new FloatSetting("sb_music_offtopic_opacity", 0.8f, false, false);
|
private static final FloatSetting DEPRECATED_SB_CATEGORY_MUSIC_OFFTOPIC_OPACITY = new FloatSetting("sb_music_offtopic_opacity", 0.8f, false, false);
|
||||||
|
|
||||||
static {
|
static {
|
||||||
// region Migration
|
// region Migration
|
||||||
|
|
||||||
|
migrateOldSettingToNew(DEPRECATED_AUTO_REPEAT, LOOP_VIDEO);
|
||||||
migrateOldSettingToNew(DEPRECATED_HIDE_PLAYER_BUTTONS, HIDE_PLAYER_PREVIOUS_NEXT_BUTTONS);
|
migrateOldSettingToNew(DEPRECATED_HIDE_PLAYER_BUTTONS, HIDE_PLAYER_PREVIOUS_NEXT_BUTTONS);
|
||||||
migrateOldSettingToNew(DEPRECATED_HIDE_PLAYER_FLYOUT_VIDEO_QUALITY_FOOTER, HIDE_PLAYER_FLYOUT_VIDEO_QUALITY_FOOTER);
|
migrateOldSettingToNew(DEPRECATED_HIDE_PLAYER_FLYOUT_VIDEO_QUALITY_FOOTER, HIDE_PLAYER_FLYOUT_VIDEO_QUALITY_FOOTER);
|
||||||
migrateOldSettingToNew(DEPRECATED_DISABLE_SUGGESTED_VIDEO_END_SCREEN, HIDE_END_SCREEN_SUGGESTED_VIDEO);
|
migrateOldSettingToNew(DEPRECATED_DISABLE_SUGGESTED_VIDEO_END_SCREEN, HIDE_END_SCREEN_SUGGESTED_VIDEO);
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ public class SponsorBlockUtils {
|
|||||||
SegmentCategory[] categories = SegmentCategory.categoriesWithoutHighlights();
|
SegmentCategory[] categories = SegmentCategory.categoriesWithoutHighlights();
|
||||||
CharSequence[] titles = new CharSequence[categories.length];
|
CharSequence[] titles = new CharSequence[categories.length];
|
||||||
for (int i = 0, length = categories.length; i < length; i++) {
|
for (int i = 0, length = categories.length; i < length; i++) {
|
||||||
titles[i] = categories[i].getTitle().toString();
|
titles[i] = categories[i].getTitleWithColorDot();
|
||||||
}
|
}
|
||||||
|
|
||||||
newUserCreatedSegmentCategory = null;
|
newUserCreatedSegmentCategory = null;
|
||||||
@@ -336,8 +336,8 @@ public class SponsorBlockUtils {
|
|||||||
Utils.verifyOnMainThread();
|
Utils.verifyOnMainThread();
|
||||||
final SegmentCategory[] values = SegmentCategory.categoriesWithoutHighlights();
|
final SegmentCategory[] values = SegmentCategory.categoriesWithoutHighlights();
|
||||||
CharSequence[] titles = new CharSequence[values.length];
|
CharSequence[] titles = new CharSequence[values.length];
|
||||||
for (int i = 0, length = values.length; i < length; i++) {
|
for (int i = 0; i < values.length; i++) {
|
||||||
titles[i] = values[i].getTitle().toString();
|
titles[i] = values[i].getTitleWithColorDot();
|
||||||
}
|
}
|
||||||
|
|
||||||
new AlertDialog.Builder(context)
|
new AlertDialog.Builder(context)
|
||||||
|
|||||||
@@ -5,8 +5,12 @@ import static app.revanced.extension.youtube.settings.Settings.*;
|
|||||||
|
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.graphics.Paint;
|
import android.graphics.Paint;
|
||||||
|
import android.text.Spannable;
|
||||||
|
import android.text.SpannableString;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
|
||||||
|
import android.text.style.ForegroundColorSpan;
|
||||||
|
import android.text.style.RelativeSizeSpan;
|
||||||
import androidx.annotation.ColorInt;
|
import androidx.annotation.ColorInt;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
@@ -83,6 +87,8 @@ public enum SegmentCategory {
|
|||||||
MUSIC_OFFTOPIC,
|
MUSIC_OFFTOPIC,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
public static final String COLOR_DOT_STRING = "⬤";
|
||||||
|
|
||||||
public static final float CATEGORY_DEFAULT_OPACITY = 0.7f;
|
public static final float CATEGORY_DEFAULT_OPACITY = 0.7f;
|
||||||
|
|
||||||
private static final Map<String, SegmentCategory> mValuesMap = new HashMap<>(2 * categoriesWithoutUnsubmitted.length);
|
private static final Map<String, SegmentCategory> mValuesMap = new HashMap<>(2 * categoriesWithoutUnsubmitted.length);
|
||||||
@@ -324,6 +330,32 @@ public enum SegmentCategory {
|
|||||||
return title;
|
return title;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a {@link SpannableString} that starts with a colored dot followed by the provided text.
|
||||||
|
*/
|
||||||
|
private static SpannableString getCategoryColorDotSpan(String text, @ColorInt int color) {
|
||||||
|
SpannableString dotSpan = new SpannableString(COLOR_DOT_STRING + text);
|
||||||
|
dotSpan.setSpan(new ForegroundColorSpan(color), 0, 1,
|
||||||
|
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||||
|
dotSpan.setSpan(new RelativeSizeSpan(1.5f), 0, 1,
|
||||||
|
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||||
|
return dotSpan;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the category title with a colored dot.
|
||||||
|
*/
|
||||||
|
public SpannableString getTitleWithColorDot(@ColorInt int categoryColor) {
|
||||||
|
return getCategoryColorDotSpan(" " + title, categoryColor);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the category title with a colored dot.
|
||||||
|
*/
|
||||||
|
public SpannableString getTitleWithColorDot() {
|
||||||
|
return getTitleWithColorDot(color);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the skip button text based on segment position.
|
* Gets the skip button text based on segment position.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -0,0 +1,83 @@
|
|||||||
|
package app.revanced.extension.youtube.videoplayer;
|
||||||
|
|
||||||
|
import static app.revanced.extension.shared.StringRef.str;
|
||||||
|
|
||||||
|
import android.view.View;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import app.revanced.extension.shared.Logger;
|
||||||
|
import app.revanced.extension.shared.Utils;
|
||||||
|
import app.revanced.extension.youtube.settings.Settings;
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
|
public class LoopVideoButton {
|
||||||
|
@Nullable
|
||||||
|
private static PlayerControlButton instance;
|
||||||
|
|
||||||
|
private static final int LOOP_VIDEO_ON = Utils.getResourceIdentifierOrThrow(
|
||||||
|
"revanced_loop_video_button_on", "drawable");
|
||||||
|
private static final int LOOP_VIDEO_OFF = Utils.getResourceIdentifierOrThrow(
|
||||||
|
"revanced_loop_video_button_off", "drawable");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Injection point.
|
||||||
|
*/
|
||||||
|
public static void initializeButton(View controlsView) {
|
||||||
|
try {
|
||||||
|
instance = new PlayerControlButton(
|
||||||
|
controlsView,
|
||||||
|
"revanced_loop_video_button",
|
||||||
|
null,
|
||||||
|
Settings.LOOP_VIDEO_BUTTON::get,
|
||||||
|
v -> updateButtonAppearance(),
|
||||||
|
null
|
||||||
|
);
|
||||||
|
} catch (Exception ex) {
|
||||||
|
Logger.printException(() -> "initializeButton failure", ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* injection point.
|
||||||
|
*/
|
||||||
|
public static void setVisibilityNegatedImmediate() {
|
||||||
|
if (instance != null) instance.setVisibilityNegatedImmediate();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* injection point.
|
||||||
|
*/
|
||||||
|
public static void setVisibilityImmediate(boolean visible) {
|
||||||
|
if (instance != null) instance.setVisibilityImmediate(visible);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* injection point.
|
||||||
|
*/
|
||||||
|
public static void setVisibility(boolean visible, boolean animated) {
|
||||||
|
if (instance != null) instance.setVisibility(visible, animated);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Updates the button's appearance.
|
||||||
|
*/
|
||||||
|
private static void updateButtonAppearance() {
|
||||||
|
if (instance == null) return;
|
||||||
|
|
||||||
|
try {
|
||||||
|
Utils.verifyOnMainThread();
|
||||||
|
|
||||||
|
final boolean currentState = Settings.LOOP_VIDEO.get();
|
||||||
|
final boolean newState = !currentState;
|
||||||
|
Settings.LOOP_VIDEO.save(newState);
|
||||||
|
|
||||||
|
instance.setIcon(newState
|
||||||
|
? LOOP_VIDEO_ON
|
||||||
|
: LOOP_VIDEO_OFF);
|
||||||
|
Utils.showToastShort(str(newState
|
||||||
|
? "revanced_loop_video_button_toast_on"
|
||||||
|
: "revanced_loop_video_button_toast_off"));
|
||||||
|
} catch (Exception ex) {
|
||||||
|
Logger.printException(() -> "updateButtonAppearance failure", ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,4 +3,4 @@ org.gradle.jvmargs = -Xms512M -Xmx2048M
|
|||||||
org.gradle.parallel = true
|
org.gradle.parallel = true
|
||||||
android.useAndroidX = true
|
android.useAndroidX = true
|
||||||
kotlin.code.style = official
|
kotlin.code.style = official
|
||||||
version = 5.41.0-dev.2
|
version = 5.41.0-dev.14
|
||||||
|
|||||||
@@ -405,6 +405,10 @@ public final class app/revanced/patches/music/misc/debugging/EnableDebuggingPatc
|
|||||||
public static final fun getEnableDebuggingPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
public static final fun getEnableDebuggingPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public final class app/revanced/patches/music/misc/dns/CheckWatchHistoryDomainNameResolutionPatchKt {
|
||||||
|
public static final fun getCheckWatchHistoryDomainNameResolutionPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||||
|
}
|
||||||
|
|
||||||
public final class app/revanced/patches/music/misc/extension/SharedExtensionPatchKt {
|
public final class app/revanced/patches/music/misc/extension/SharedExtensionPatchKt {
|
||||||
public static final fun getSharedExtensionPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
public static final fun getSharedExtensionPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||||
}
|
}
|
||||||
@@ -1169,6 +1173,10 @@ public final class app/revanced/patches/tumblr/annoyances/popups/DisableGiftMess
|
|||||||
public static final fun getDisableGiftMessagePopupPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
public static final fun getDisableGiftMessagePopupPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public final class app/revanced/patches/tumblr/annoyances/tv/DisableTumblrTvPatchKt {
|
||||||
|
public static final fun getDisableTumblrTvPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||||
|
}
|
||||||
|
|
||||||
public final class app/revanced/patches/tumblr/featureflags/OverrideFeatureFlagsPatchKt {
|
public final class app/revanced/patches/tumblr/featureflags/OverrideFeatureFlagsPatchKt {
|
||||||
public static final fun getOverrideFeatureFlagsPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
public static final fun getOverrideFeatureFlagsPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||||
}
|
}
|
||||||
@@ -1610,6 +1618,10 @@ public final class app/revanced/patches/youtube/misc/litho/filter/LithoFilterPat
|
|||||||
public static final fun getLithoFilterPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
public static final fun getLithoFilterPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public final class app/revanced/patches/youtube/misc/loopvideo/LoopVideoPatchKt {
|
||||||
|
public static final fun getLoopVideoPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||||
|
}
|
||||||
|
|
||||||
public final class app/revanced/patches/youtube/misc/navigation/NavigationBarHookPatchKt {
|
public final class app/revanced/patches/youtube/misc/navigation/NavigationBarHookPatchKt {
|
||||||
public static field hookNavigationButtonCreated Lkotlin/jvm/functions/Function1;
|
public static field hookNavigationButtonCreated Lkotlin/jvm/functions/Function1;
|
||||||
public static final fun getHookNavigationButtonCreated ()Lkotlin/jvm/functions/Function1;
|
public static final fun getHookNavigationButtonCreated ()Lkotlin/jvm/functions/Function1;
|
||||||
@@ -1715,6 +1727,10 @@ public final class app/revanced/patches/youtube/video/audio/ForceOriginalAudioPa
|
|||||||
public static final fun getForceOriginalAudioPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
public static final fun getForceOriginalAudioPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public final class app/revanced/patches/youtube/video/codecs/DisableVideoCodecsPatchKt {
|
||||||
|
public static final fun getDisableVideoCodecsPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||||
|
}
|
||||||
|
|
||||||
public final class app/revanced/patches/youtube/video/hdr/DisableHdrPatchKt {
|
public final class app/revanced/patches/youtube/video/hdr/DisableHdrPatchKt {
|
||||||
public static final fun getDisableHdrPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
public static final fun getDisableHdrPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,28 +2,22 @@
|
|||||||
package app.revanced.patches.instagram.hide.navigation
|
package app.revanced.patches.instagram.hide.navigation
|
||||||
|
|
||||||
import app.revanced.patcher.fingerprint
|
import app.revanced.patcher.fingerprint
|
||||||
import com.android.tools.smali.dexlib2.Opcode
|
import app.revanced.patcher.patch.BytecodePatchContext
|
||||||
|
|
||||||
internal val tabCreateButtonsLoopStartFingerprint = fingerprint {
|
internal val initializeNavigationButtonsListFingerprint = fingerprint {
|
||||||
returns("V")
|
strings("Nav3")
|
||||||
strings("InstagramMainActivity.createTabButtons")
|
parameters("Lcom/instagram/common/session/UserSession;", "Z")
|
||||||
opcodes(
|
returns("Ljava/util/List;")
|
||||||
//Loop Start
|
|
||||||
Opcode.IF_GE, // Check if index is finished (index, size)
|
|
||||||
//Injection
|
|
||||||
Opcode.INVOKE_INTERFACE,
|
|
||||||
Opcode.MOVE_RESULT_OBJECT
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
internal val tabCreateButtonsLoopEndFingerprint = fingerprint {
|
private val navigationButtonsEnumClassDef = fingerprint {
|
||||||
returns("V")
|
strings("FEED", "fragment_feed", "SEARCH", "fragment_search")
|
||||||
strings("InstagramMainActivity.createTabButtons")
|
}
|
||||||
opcodes(
|
|
||||||
Opcode.IPUT_OBJECT,
|
context(BytecodePatchContext)
|
||||||
// Injection Jump
|
internal val navigationButtonsEnumInitFingerprint get() = fingerprint {
|
||||||
Opcode.ADD_INT_LIT8, //Increase Index
|
custom { method, classDef ->
|
||||||
Opcode.GOTO // Jump to loopStart
|
method.name == "<init>"
|
||||||
// LoopEnd
|
&& classDef == navigationButtonsEnumClassDef.classDef
|
||||||
)
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,21 +1,28 @@
|
|||||||
package app.revanced.patches.instagram.hide.navigation
|
package app.revanced.patches.instagram.hide.navigation
|
||||||
|
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
import app.revanced.patcher.patch.booleanOption
|
import app.revanced.patcher.patch.booleanOption
|
||||||
import app.revanced.patcher.patch.bytecodePatch
|
import app.revanced.patcher.patch.bytecodePatch
|
||||||
import app.revanced.patcher.util.smali.ExternalLabel
|
import app.revanced.util.addInstructionsAtControlFlowLabel
|
||||||
import app.revanced.util.findFreeRegister
|
import app.revanced.util.findFreeRegister
|
||||||
|
import app.revanced.util.getReference
|
||||||
|
import app.revanced.util.indexOfFirstInstructionOrThrow
|
||||||
|
import com.android.tools.smali.dexlib2.Opcode
|
||||||
|
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||||
import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
|
import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
|
||||||
|
import com.android.tools.smali.dexlib2.iface.reference.FieldReference
|
||||||
import java.util.logging.Logger
|
import java.util.logging.Logger
|
||||||
|
|
||||||
|
private const val EXTENSION_CLASS_DESCRIPTOR =
|
||||||
|
"Lapp/revanced/extension/instagram/hide/navigation/HideNavigationButtonsPatch;"
|
||||||
|
|
||||||
@Suppress("unused")
|
@Suppress("unused")
|
||||||
val hideNavigationButtonsPatch = bytecodePatch(
|
val hideNavigationButtonsPatch = bytecodePatch(
|
||||||
name = "Hide navigation buttons",
|
name = "Hide navigation buttons",
|
||||||
description = "Hides navigation bar buttons, such as the Reels and Create button.",
|
description = "Hides navigation bar buttons, such as the Reels and Create button.",
|
||||||
use = false
|
use = false
|
||||||
) {
|
) {
|
||||||
compatibleWith("com.instagram.android"("397.1.0.52.81"))
|
compatibleWith("com.instagram.android")
|
||||||
|
|
||||||
val hideReels by booleanOption(
|
val hideReels by booleanOption(
|
||||||
key = "hideReels",
|
key = "hideReels",
|
||||||
@@ -38,43 +45,44 @@ val hideNavigationButtonsPatch = bytecodePatch(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
tabCreateButtonsLoopStartFingerprint.method.apply {
|
val enumNameField: String
|
||||||
// Check the current loop index, and skip over adding the
|
|
||||||
// navigation button view if the index matches a given button.
|
|
||||||
|
|
||||||
val startIndex = tabCreateButtonsLoopStartFingerprint.patternMatch!!.startIndex
|
// Get the field name which contains the name of the enum for the navigation button ("fragment_clips", "fragment_share", ...)
|
||||||
val endIndex = tabCreateButtonsLoopEndFingerprint.patternMatch!!.endIndex
|
with(navigationButtonsEnumInitFingerprint.method) {
|
||||||
val insertIndex = startIndex + 1
|
enumNameField = indexOfFirstInstructionOrThrow {
|
||||||
val loopIndexRegister = getInstruction<TwoRegisterInstruction>(startIndex).registerA
|
opcode == Opcode.IPUT_OBJECT &&
|
||||||
val freeRegister = findFreeRegister(insertIndex, loopIndexRegister)
|
(this as TwoRegisterInstruction).registerA == 2 // The p2 register
|
||||||
val instruction = getInstruction(endIndex - 1)
|
}.let {
|
||||||
|
getInstruction(it).getReference<FieldReference>()!!.name
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
val instructions = buildString {
|
initializeNavigationButtonsListFingerprint.method.apply {
|
||||||
if (hideCreate!!) {
|
val returnIndex = indexOfFirstInstructionOrThrow(Opcode.RETURN_OBJECT)
|
||||||
appendLine(
|
val buttonsListRegister = getInstruction<OneRegisterInstruction>(returnIndex).registerA
|
||||||
"""
|
val freeRegister = findFreeRegister(returnIndex)
|
||||||
const v$freeRegister, 0x2
|
val freeRegister2 = findFreeRegister(returnIndex, freeRegister)
|
||||||
if-eq v$freeRegister, v$loopIndexRegister, :skipAddView
|
|
||||||
|
fun instructionsRemoveButtonByName(buttonEnumName: String): String {
|
||||||
|
return """
|
||||||
|
const-string v$freeRegister, "$buttonEnumName"
|
||||||
|
const-string v$freeRegister2, "$enumNameField"
|
||||||
|
invoke-static { v$buttonsListRegister, v$freeRegister, v$freeRegister2 }, $EXTENSION_CLASS_DESCRIPTOR->removeNavigationButtonByName(Ljava/util/List;Ljava/lang/String;Ljava/lang/String;)Ljava/util/List;
|
||||||
|
move-result-object v$buttonsListRegister
|
||||||
"""
|
"""
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hideReels!!)
|
||||||
|
addInstructionsAtControlFlowLabel(
|
||||||
|
returnIndex,
|
||||||
|
instructionsRemoveButtonByName("fragment_clips")
|
||||||
)
|
)
|
||||||
}
|
|
||||||
|
|
||||||
if (hideReels!!) {
|
if (hideCreate!!)
|
||||||
appendLine(
|
addInstructionsAtControlFlowLabel(
|
||||||
"""
|
returnIndex,
|
||||||
const v$freeRegister, 0x3
|
instructionsRemoveButtonByName("fragment_share")
|
||||||
if-eq v$freeRegister, v$loopIndexRegister, :skipAddView
|
|
||||||
"""
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
addInstructionsWithLabels(
|
|
||||||
insertIndex,
|
|
||||||
instructions,
|
|
||||||
ExternalLabel("skipAddView", instruction)
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package app.revanced.patches.music.misc.dns
|
||||||
|
|
||||||
|
import app.revanced.patches.music.misc.extension.sharedExtensionPatch
|
||||||
|
import app.revanced.patches.music.shared.mainActivityOnCreateFingerprint
|
||||||
|
import app.revanced.patches.shared.misc.dns.checkWatchHistoryDomainNameResolutionPatch
|
||||||
|
|
||||||
|
val checkWatchHistoryDomainNameResolutionPatch = checkWatchHistoryDomainNameResolutionPatch(
|
||||||
|
block = {
|
||||||
|
dependsOn(
|
||||||
|
sharedExtensionPatch
|
||||||
|
)
|
||||||
|
|
||||||
|
compatibleWith(
|
||||||
|
"com.google.android.apps.youtube.music"(
|
||||||
|
"7.29.52",
|
||||||
|
"8.10.52"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
},
|
||||||
|
|
||||||
|
mainActivityFingerprint = mainActivityOnCreateFingerprint
|
||||||
|
)
|
||||||
@@ -1,9 +1,10 @@
|
|||||||
package app.revanced.patches.music.misc.extension
|
package app.revanced.patches.music.misc.extension
|
||||||
|
|
||||||
import app.revanced.patches.music.misc.extension.hooks.applicationInitHook
|
import app.revanced.patches.music.misc.extension.hooks.applicationInitHook
|
||||||
|
import app.revanced.patches.music.misc.extension.hooks.applicationInitOnCreateHook
|
||||||
import app.revanced.patches.shared.misc.extension.sharedExtensionPatch
|
import app.revanced.patches.shared.misc.extension.sharedExtensionPatch
|
||||||
|
|
||||||
val sharedExtensionPatch = sharedExtensionPatch(
|
val sharedExtensionPatch = sharedExtensionPatch(
|
||||||
"music",
|
"music",
|
||||||
applicationInitHook,
|
applicationInitHook, applicationInitOnCreateHook
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package app.revanced.patches.music.misc.extension.hooks
|
package app.revanced.patches.music.misc.extension.hooks
|
||||||
|
|
||||||
|
import app.revanced.patches.music.shared.YOUTUBE_MUSIC_MAIN_ACTIVITY_CLASS_TYPE
|
||||||
import app.revanced.patches.shared.misc.extension.extensionHook
|
import app.revanced.patches.shared.misc.extension.extensionHook
|
||||||
|
|
||||||
internal val applicationInitHook = extensionHook {
|
internal val applicationInitHook = extensionHook {
|
||||||
@@ -8,3 +9,11 @@ internal val applicationInitHook = extensionHook {
|
|||||||
strings("activity")
|
strings("activity")
|
||||||
custom { method, _ -> method.name == "onCreate" }
|
custom { method, _ -> method.name == "onCreate" }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal val applicationInitOnCreateHook = extensionHook {
|
||||||
|
returns("V")
|
||||||
|
parameters("Landroid/os/Bundle;")
|
||||||
|
custom { method, classDef ->
|
||||||
|
method.name == "onCreate" && classDef.type == YOUTUBE_MUSIC_MAIN_ACTIVITY_CLASS_TYPE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -28,7 +28,12 @@ val gmsCoreSupportPatch = gmsCoreSupportPatch(
|
|||||||
) {
|
) {
|
||||||
dependsOn(spoofVideoStreamsPatch)
|
dependsOn(spoofVideoStreamsPatch)
|
||||||
|
|
||||||
compatibleWith(MUSIC_PACKAGE_NAME)
|
compatibleWith(
|
||||||
|
MUSIC_PACKAGE_NAME(
|
||||||
|
"7.29.52",
|
||||||
|
"8.10.52"
|
||||||
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun gmsCoreSupportResourcePatch(
|
private fun gmsCoreSupportResourcePatch(
|
||||||
|
|||||||
@@ -42,6 +42,8 @@ private val settingsResourcePatch = resourcePatch {
|
|||||||
|
|
||||||
execute {
|
execute {
|
||||||
|
|
||||||
|
// Set the style for the ReVanced settings to follow the style of the music settings,
|
||||||
|
// namely: action bar height, menu item padding and remove horizontal dividers.
|
||||||
val targetResource = "values/styles.xml"
|
val targetResource = "values/styles.xml"
|
||||||
inputStreamFromBundledResource(
|
inputStreamFromBundledResource(
|
||||||
"settings/music",
|
"settings/music",
|
||||||
@@ -53,7 +55,7 @@ private val settingsResourcePatch = resourcePatch {
|
|||||||
).close()
|
).close()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove horizontal divider from the settings Preferences.
|
// Remove horizontal dividers from the music settings.
|
||||||
val styleFile = get("res/values/styles.xml")
|
val styleFile = get("res/values/styles.xml")
|
||||||
styleFile.writeText(
|
styleFile.writeText(
|
||||||
styleFile.readText()
|
styleFile.readText()
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package app.revanced.patches.music.shared
|
||||||
|
|
||||||
|
import app.revanced.patcher.fingerprint
|
||||||
|
|
||||||
|
internal const val YOUTUBE_MUSIC_MAIN_ACTIVITY_CLASS_TYPE = "Lcom/google/android/apps/youtube/music/activities/MusicActivity;"
|
||||||
|
|
||||||
|
internal val mainActivityOnCreateFingerprint = fingerprint {
|
||||||
|
returns("V")
|
||||||
|
parameters("Landroid/os/Bundle;")
|
||||||
|
custom { method, classDef ->
|
||||||
|
method.name == "onCreate" && classDef.type == YOUTUBE_MUSIC_MAIN_ACTIVITY_CLASS_TYPE
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package app.revanced.patches.shared.misc.dns
|
||||||
|
|
||||||
|
import app.revanced.patcher.Fingerprint
|
||||||
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
|
import app.revanced.patcher.patch.BytecodePatchBuilder
|
||||||
|
import app.revanced.patcher.patch.BytecodePatchContext
|
||||||
|
import app.revanced.patcher.patch.bytecodePatch
|
||||||
|
import app.revanced.patches.all.misc.resources.addResources
|
||||||
|
|
||||||
|
private const val EXTENSION_CLASS_DESCRIPTOR =
|
||||||
|
"Lapp/revanced/extension/shared/patches/CheckWatchHistoryDomainNameResolutionPatch;"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Patch shared with YouTube and YT Music.
|
||||||
|
*/
|
||||||
|
internal fun checkWatchHistoryDomainNameResolutionPatch(
|
||||||
|
block: BytecodePatchBuilder.() -> Unit = {},
|
||||||
|
executeBlock: BytecodePatchContext.() -> Unit = {},
|
||||||
|
mainActivityFingerprint: Fingerprint
|
||||||
|
) = bytecodePatch(
|
||||||
|
name = "Check watch history domain name resolution",
|
||||||
|
description = "Checks if the device DNS server is preventing user watch history from being saved.",
|
||||||
|
) {
|
||||||
|
block()
|
||||||
|
|
||||||
|
execute {
|
||||||
|
executeBlock()
|
||||||
|
|
||||||
|
addResources("shared", "misc.dns.checkWatchHistoryDomainNameResolutionPatch")
|
||||||
|
|
||||||
|
mainActivityFingerprint.method.addInstruction(
|
||||||
|
0,
|
||||||
|
"invoke-static/range { p0 .. p0 }, $EXTENSION_CLASS_DESCRIPTOR->checkDnsResolver(Landroid/app/Activity;)V",
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -18,7 +18,9 @@ import app.revanced.util.returnEarly
|
|||||||
import org.w3c.dom.Node
|
import org.w3c.dom.Node
|
||||||
|
|
||||||
// TODO: Delete this on next major version bump.
|
// TODO: Delete this on next major version bump.
|
||||||
@Deprecated("Use non deprecated settings patch function")
|
@Deprecated("Use non deprecated settings patch function",
|
||||||
|
ReplaceWith("settingsPatch(listOf(rootPreference), preferences)")
|
||||||
|
)
|
||||||
fun settingsPatch (
|
fun settingsPatch (
|
||||||
rootPreference: Pair<IntentPreference, String>,
|
rootPreference: Pair<IntentPreference, String>,
|
||||||
preferences: Set<BasePreference>,
|
preferences: Set<BasePreference>,
|
||||||
@@ -69,8 +71,8 @@ fun settingsPatch (
|
|||||||
ResourceGroup("drawable",
|
ResourceGroup("drawable",
|
||||||
// CustomListPreference resources.
|
// CustomListPreference resources.
|
||||||
"revanced_ic_dialog_alert.xml",
|
"revanced_ic_dialog_alert.xml",
|
||||||
|
// Search resources.
|
||||||
"revanced_settings_arrow_time.xml",
|
"revanced_settings_arrow_time.xml",
|
||||||
"revanced_settings_cursor.xml",
|
|
||||||
"revanced_settings_custom_checkmark.xml",
|
"revanced_settings_custom_checkmark.xml",
|
||||||
"revanced_settings_search_icon.xml",
|
"revanced_settings_search_icon.xml",
|
||||||
"revanced_settings_search_remove.xml",
|
"revanced_settings_search_remove.xml",
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package app.revanced.patches.tumblr.annoyances.tv
|
||||||
|
|
||||||
|
import app.revanced.patcher.patch.bytecodePatch
|
||||||
|
import app.revanced.patches.tumblr.featureflags.addFeatureFlagOverride
|
||||||
|
import app.revanced.patches.tumblr.featureflags.overrideFeatureFlagsPatch
|
||||||
|
|
||||||
|
@Suppress("unused")
|
||||||
|
val disableTumblrTvPatch = bytecodePatch(
|
||||||
|
name = "Disable Tumblr TV",
|
||||||
|
description = "Removes the Tumblr TV navigation button from the bottom navigation bar.",
|
||||||
|
) {
|
||||||
|
dependsOn(overrideFeatureFlagsPatch)
|
||||||
|
|
||||||
|
compatibleWith("com.tumblr")
|
||||||
|
|
||||||
|
execute {
|
||||||
|
addFeatureFlagOverride("tumblrTvMobileNav", "false")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -77,7 +77,6 @@ val hideAdsPatch = bytecodePatch(
|
|||||||
compatibleWith(
|
compatibleWith(
|
||||||
"com.google.android.youtube"(
|
"com.google.android.youtube"(
|
||||||
"19.34.42",
|
"19.34.42",
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
"20.07.39",
|
||||||
"20.13.41",
|
"20.13.41",
|
||||||
"20.14.43",
|
"20.14.43",
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ val hideGetPremiumPatch = bytecodePatch(
|
|||||||
compatibleWith(
|
compatibleWith(
|
||||||
"com.google.android.youtube"(
|
"com.google.android.youtube"(
|
||||||
"19.34.42",
|
"19.34.42",
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
"20.07.39",
|
||||||
"20.13.41",
|
"20.13.41",
|
||||||
"20.14.43",
|
"20.14.43",
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ val videoAdsPatch = bytecodePatch(
|
|||||||
compatibleWith(
|
compatibleWith(
|
||||||
"com.google.android.youtube"(
|
"com.google.android.youtube"(
|
||||||
"19.34.42",
|
"19.34.42",
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
"20.07.39",
|
||||||
"20.13.41",
|
"20.13.41",
|
||||||
"20.14.43",
|
"20.14.43",
|
||||||
|
|||||||
@@ -54,7 +54,6 @@ val copyVideoUrlPatch = bytecodePatch(
|
|||||||
compatibleWith(
|
compatibleWith(
|
||||||
"com.google.android.youtube"(
|
"com.google.android.youtube"(
|
||||||
"19.34.42",
|
"19.34.42",
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
"20.07.39",
|
||||||
"20.13.41",
|
"20.13.41",
|
||||||
"20.14.43",
|
"20.14.43",
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ val removeViewerDiscretionDialogPatch = bytecodePatch(
|
|||||||
compatibleWith(
|
compatibleWith(
|
||||||
"com.google.android.youtube"(
|
"com.google.android.youtube"(
|
||||||
"19.34.42",
|
"19.34.42",
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
"20.07.39",
|
||||||
"20.13.41",
|
"20.13.41",
|
||||||
"20.14.43",
|
"20.14.43",
|
||||||
|
|||||||
@@ -75,7 +75,6 @@ val downloadsPatch = bytecodePatch(
|
|||||||
compatibleWith(
|
compatibleWith(
|
||||||
"com.google.android.youtube"(
|
"com.google.android.youtube"(
|
||||||
"19.34.42",
|
"19.34.42",
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
"20.07.39",
|
||||||
"20.13.41",
|
"20.13.41",
|
||||||
"20.14.43",
|
"20.14.43",
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ val seekbarPatch = bytecodePatch(
|
|||||||
compatibleWith(
|
compatibleWith(
|
||||||
"com.google.android.youtube"(
|
"com.google.android.youtube"(
|
||||||
"19.34.42",
|
"19.34.42",
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
"20.07.39",
|
||||||
"20.13.41",
|
"20.13.41",
|
||||||
"20.14.43",
|
"20.14.43",
|
||||||
|
|||||||
@@ -89,7 +89,6 @@ val swipeControlsPatch = bytecodePatch(
|
|||||||
compatibleWith(
|
compatibleWith(
|
||||||
"com.google.android.youtube"(
|
"com.google.android.youtube"(
|
||||||
"19.34.42",
|
"19.34.42",
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
"20.07.39",
|
||||||
"20.13.41",
|
"20.13.41",
|
||||||
"20.14.43",
|
"20.14.43",
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ val autoCaptionsPatch = bytecodePatch(
|
|||||||
compatibleWith(
|
compatibleWith(
|
||||||
"com.google.android.youtube"(
|
"com.google.android.youtube"(
|
||||||
"19.34.42",
|
"19.34.42",
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
"20.07.39",
|
||||||
"20.13.41",
|
"20.13.41",
|
||||||
"20.14.43",
|
"20.14.43",
|
||||||
|
|||||||
@@ -44,7 +44,6 @@ val customBrandingPatch = resourcePatch(
|
|||||||
compatibleWith(
|
compatibleWith(
|
||||||
"com.google.android.youtube"(
|
"com.google.android.youtube"(
|
||||||
"19.34.42",
|
"19.34.42",
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
"20.07.39",
|
||||||
"20.13.41",
|
"20.13.41",
|
||||||
"20.14.43",
|
"20.14.43",
|
||||||
|
|||||||
@@ -94,7 +94,6 @@ val changeHeaderPatch = resourcePatch(
|
|||||||
compatibleWith(
|
compatibleWith(
|
||||||
"com.google.android.youtube"(
|
"com.google.android.youtube"(
|
||||||
"19.34.42",
|
"19.34.42",
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
"20.07.39",
|
||||||
"20.13.41",
|
"20.13.41",
|
||||||
"20.14.43",
|
"20.14.43",
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ val hideButtonsPatch = resourcePatch(
|
|||||||
compatibleWith(
|
compatibleWith(
|
||||||
"com.google.android.youtube"(
|
"com.google.android.youtube"(
|
||||||
"19.34.42",
|
"19.34.42",
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
"20.07.39",
|
||||||
"20.13.41",
|
"20.13.41",
|
||||||
"20.14.43",
|
"20.14.43",
|
||||||
|
|||||||
@@ -41,7 +41,6 @@ val navigationButtonsPatch = bytecodePatch(
|
|||||||
compatibleWith(
|
compatibleWith(
|
||||||
"com.google.android.youtube"(
|
"com.google.android.youtube"(
|
||||||
"19.34.42",
|
"19.34.42",
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
"20.07.39",
|
||||||
"20.13.41",
|
"20.13.41",
|
||||||
"20.14.43",
|
"20.14.43",
|
||||||
|
|||||||
@@ -59,7 +59,6 @@ val hidePlayerOverlayButtonsPatch = bytecodePatch(
|
|||||||
compatibleWith(
|
compatibleWith(
|
||||||
"com.google.android.youtube"(
|
"com.google.android.youtube"(
|
||||||
"19.34.42",
|
"19.34.42",
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
"20.07.39",
|
||||||
"20.13.41",
|
"20.13.41",
|
||||||
"20.14.43",
|
"20.14.43",
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ val changeFormFactorPatch = bytecodePatch(
|
|||||||
compatibleWith(
|
compatibleWith(
|
||||||
"com.google.android.youtube"(
|
"com.google.android.youtube"(
|
||||||
"19.34.42",
|
"19.34.42",
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
"20.07.39",
|
||||||
"20.13.41",
|
"20.13.41",
|
||||||
"20.14.43",
|
"20.14.43",
|
||||||
|
|||||||
@@ -60,7 +60,6 @@ val hideEndscreenCardsPatch = bytecodePatch(
|
|||||||
compatibleWith(
|
compatibleWith(
|
||||||
"com.google.android.youtube"(
|
"com.google.android.youtube"(
|
||||||
"19.34.42",
|
"19.34.42",
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
"20.07.39",
|
||||||
"20.13.41",
|
"20.13.41",
|
||||||
"20.14.43",
|
"20.14.43",
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ val hideEndScreenSuggestedVideoPatch = bytecodePatch(
|
|||||||
compatibleWith(
|
compatibleWith(
|
||||||
"com.google.android.youtube"(
|
"com.google.android.youtube"(
|
||||||
"19.34.42",
|
"19.34.42",
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
"20.07.39",
|
||||||
"20.13.41",
|
"20.13.41",
|
||||||
"20.14.43",
|
"20.14.43",
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ val disableFullscreenAmbientModePatch = bytecodePatch(
|
|||||||
compatibleWith(
|
compatibleWith(
|
||||||
"com.google.android.youtube"(
|
"com.google.android.youtube"(
|
||||||
"19.34.42",
|
"19.34.42",
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
"20.07.39",
|
||||||
"20.13.41",
|
"20.13.41",
|
||||||
"20.14.43",
|
"20.14.43",
|
||||||
|
|||||||
@@ -127,7 +127,6 @@ val hideLayoutComponentsPatch = bytecodePatch(
|
|||||||
compatibleWith(
|
compatibleWith(
|
||||||
"com.google.android.youtube"(
|
"com.google.android.youtube"(
|
||||||
"19.34.42",
|
"19.34.42",
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
"20.07.39",
|
||||||
"20.13.41",
|
"20.13.41",
|
||||||
"20.14.43",
|
"20.14.43",
|
||||||
@@ -162,9 +161,9 @@ val hideLayoutComponentsPatch = bytecodePatch(
|
|||||||
SwitchPreference("revanced_hide_comments_section"),
|
SwitchPreference("revanced_hide_comments_section"),
|
||||||
SwitchPreference("revanced_hide_comments_community_guidelines"),
|
SwitchPreference("revanced_hide_comments_community_guidelines"),
|
||||||
SwitchPreference("revanced_hide_comments_create_a_short_button"),
|
SwitchPreference("revanced_hide_comments_create_a_short_button"),
|
||||||
|
SwitchPreference("revanced_hide_comments_emoji_and_timestamp_buttons"),
|
||||||
SwitchPreference("revanced_hide_comments_preview_comment"),
|
SwitchPreference("revanced_hide_comments_preview_comment"),
|
||||||
SwitchPreference("revanced_hide_comments_thanks_button"),
|
SwitchPreference("revanced_hide_comments_thanks_button"),
|
||||||
SwitchPreference("revanced_hide_comments_timestamp_button"),
|
|
||||||
),
|
),
|
||||||
sorting = PreferenceScreenPreference.Sorting.UNSORTED,
|
sorting = PreferenceScreenPreference.Sorting.UNSORTED,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -58,7 +58,6 @@ val hideInfoCardsPatch = bytecodePatch(
|
|||||||
compatibleWith(
|
compatibleWith(
|
||||||
"com.google.android.youtube"(
|
"com.google.android.youtube"(
|
||||||
"19.34.42",
|
"19.34.42",
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
"20.07.39",
|
||||||
"20.13.41",
|
"20.13.41",
|
||||||
"20.14.43",
|
"20.14.43",
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ val hidePlayerFlyoutMenuPatch = bytecodePatch(
|
|||||||
compatibleWith(
|
compatibleWith(
|
||||||
"com.google.android.youtube"(
|
"com.google.android.youtube"(
|
||||||
"19.34.42",
|
"19.34.42",
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
"20.07.39",
|
||||||
"20.13.41",
|
"20.13.41",
|
||||||
"20.14.43",
|
"20.14.43",
|
||||||
|
|||||||
@@ -49,7 +49,6 @@ val hideRelatedVideoOverlayPatch = bytecodePatch(
|
|||||||
compatibleWith(
|
compatibleWith(
|
||||||
"com.google.android.youtube"(
|
"com.google.android.youtube"(
|
||||||
"19.34.42",
|
"19.34.42",
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
"20.07.39",
|
||||||
"20.13.41",
|
"20.13.41",
|
||||||
"20.14.43",
|
"20.14.43",
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ val disableRollingNumberAnimationPatch = bytecodePatch(
|
|||||||
compatibleWith(
|
compatibleWith(
|
||||||
"com.google.android.youtube"(
|
"com.google.android.youtube"(
|
||||||
"19.34.42",
|
"19.34.42",
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
"20.07.39",
|
||||||
"20.13.41",
|
"20.13.41",
|
||||||
"20.14.43",
|
"20.14.43",
|
||||||
|
|||||||
@@ -173,7 +173,6 @@ val hideShortsComponentsPatch = bytecodePatch(
|
|||||||
compatibleWith(
|
compatibleWith(
|
||||||
"com.google.android.youtube"(
|
"com.google.android.youtube"(
|
||||||
"19.34.42",
|
"19.34.42",
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
"20.07.39",
|
||||||
"20.13.41",
|
"20.13.41",
|
||||||
"20.14.43",
|
"20.14.43",
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ val disableSignInToTvPopupPatch = bytecodePatch(
|
|||||||
compatibleWith(
|
compatibleWith(
|
||||||
"com.google.android.youtube"(
|
"com.google.android.youtube"(
|
||||||
"19.34.42",
|
"19.34.42",
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
"20.07.39",
|
||||||
"20.13.41",
|
"20.13.41",
|
||||||
"20.14.43",
|
"20.14.43",
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ val hideTimestampPatch = bytecodePatch(
|
|||||||
compatibleWith(
|
compatibleWith(
|
||||||
"com.google.android.youtube"(
|
"com.google.android.youtube"(
|
||||||
"19.34.42",
|
"19.34.42",
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
"20.07.39",
|
||||||
"20.13.41",
|
"20.13.41",
|
||||||
"20.14.43",
|
"20.14.43",
|
||||||
|
|||||||
@@ -154,7 +154,6 @@ val miniplayerPatch = bytecodePatch(
|
|||||||
compatibleWith(
|
compatibleWith(
|
||||||
"com.google.android.youtube"(
|
"com.google.android.youtube"(
|
||||||
"19.34.42",
|
"19.34.42",
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
"20.07.39",
|
||||||
"20.13.41",
|
"20.13.41",
|
||||||
"20.14.43",
|
"20.14.43",
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ val playerPopupPanelsPatch = bytecodePatch(
|
|||||||
compatibleWith(
|
compatibleWith(
|
||||||
"com.google.android.youtube"(
|
"com.google.android.youtube"(
|
||||||
"19.34.42",
|
"19.34.42",
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
"20.07.39",
|
||||||
"20.13.41",
|
"20.13.41",
|
||||||
"20.14.43",
|
"20.14.43",
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ import app.revanced.patches.youtube.misc.playercontrols.playerControlsPatch
|
|||||||
import app.revanced.patches.youtube.misc.playertype.playerTypeHookPatch
|
import app.revanced.patches.youtube.misc.playertype.playerTypeHookPatch
|
||||||
import app.revanced.patches.youtube.misc.settings.PreferenceScreen
|
import app.revanced.patches.youtube.misc.settings.PreferenceScreen
|
||||||
import app.revanced.patches.youtube.misc.settings.settingsPatch
|
import app.revanced.patches.youtube.misc.settings.settingsPatch
|
||||||
import app.revanced.patches.youtube.shared.autoRepeatFingerprint
|
import app.revanced.patches.youtube.shared.loopVideoFingerprint
|
||||||
import app.revanced.patches.youtube.shared.autoRepeatParentFingerprint
|
import app.revanced.patches.youtube.shared.loopVideoParentFingerprint
|
||||||
import app.revanced.util.addInstructionsAtControlFlowLabel
|
import app.revanced.util.addInstructionsAtControlFlowLabel
|
||||||
|
|
||||||
@Suppress("unused")
|
@Suppress("unused")
|
||||||
@@ -22,7 +22,6 @@ internal val exitFullscreenPatch = bytecodePatch(
|
|||||||
compatibleWith(
|
compatibleWith(
|
||||||
"com.google.android.youtube"(
|
"com.google.android.youtube"(
|
||||||
"19.34.42",
|
"19.34.42",
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
"20.07.39",
|
||||||
"20.13.41",
|
"20.13.41",
|
||||||
"20.14.43",
|
"20.14.43",
|
||||||
@@ -50,7 +49,7 @@ internal val exitFullscreenPatch = bytecodePatch(
|
|||||||
ListPreference("revanced_exit_fullscreen")
|
ListPreference("revanced_exit_fullscreen")
|
||||||
)
|
)
|
||||||
|
|
||||||
autoRepeatFingerprint.match(autoRepeatParentFingerprint.originalClassDef).method.apply {
|
loopVideoFingerprint.match(loopVideoParentFingerprint.originalClassDef).method.apply {
|
||||||
addInstructionsAtControlFlowLabel(
|
addInstructionsAtControlFlowLabel(
|
||||||
implementation!!.instructions.lastIndex,
|
implementation!!.instructions.lastIndex,
|
||||||
"invoke-static {}, $EXTENSION_CLASS_DESCRIPTOR->endOfVideoReached()V",
|
"invoke-static {}, $EXTENSION_CLASS_DESCRIPTOR->endOfVideoReached()V",
|
||||||
|
|||||||
@@ -53,7 +53,6 @@ val customPlayerOverlayOpacityPatch = bytecodePatch(
|
|||||||
compatibleWith(
|
compatibleWith(
|
||||||
"com.google.android.youtube"(
|
"com.google.android.youtube"(
|
||||||
"19.34.42",
|
"19.34.42",
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
"20.07.39",
|
||||||
"20.13.41",
|
"20.13.41",
|
||||||
"20.14.43",
|
"20.14.43",
|
||||||
|
|||||||
@@ -62,7 +62,6 @@ val returnYouTubeDislikePatch = bytecodePatch(
|
|||||||
compatibleWith(
|
compatibleWith(
|
||||||
"com.google.android.youtube"(
|
"com.google.android.youtube"(
|
||||||
"19.34.42",
|
"19.34.42",
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
"20.07.39",
|
||||||
"20.13.41",
|
"20.13.41",
|
||||||
"20.14.43",
|
"20.14.43",
|
||||||
|
|||||||
@@ -67,7 +67,6 @@ val wideSearchbarPatch = bytecodePatch(
|
|||||||
compatibleWith(
|
compatibleWith(
|
||||||
"com.google.android.youtube"(
|
"com.google.android.youtube"(
|
||||||
"19.34.42",
|
"19.34.42",
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
"20.07.39",
|
||||||
"20.13.41",
|
"20.13.41",
|
||||||
"20.14.43",
|
"20.14.43",
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ val shortsAutoplayPatch = bytecodePatch(
|
|||||||
compatibleWith(
|
compatibleWith(
|
||||||
"com.google.android.youtube"(
|
"com.google.android.youtube"(
|
||||||
"19.34.42",
|
"19.34.42",
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
"20.07.39",
|
||||||
"20.13.41",
|
"20.13.41",
|
||||||
"20.14.43",
|
"20.14.43",
|
||||||
|
|||||||
@@ -65,7 +65,6 @@ val openShortsInRegularPlayerPatch = bytecodePatch(
|
|||||||
compatibleWith(
|
compatibleWith(
|
||||||
"com.google.android.youtube"(
|
"com.google.android.youtube"(
|
||||||
"19.34.42",
|
"19.34.42",
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
"20.07.39",
|
||||||
"20.13.41",
|
"20.13.41",
|
||||||
"20.14.43",
|
"20.14.43",
|
||||||
|
|||||||
@@ -127,7 +127,6 @@ val sponsorBlockPatch = bytecodePatch(
|
|||||||
compatibleWith(
|
compatibleWith(
|
||||||
"com.google.android.youtube"(
|
"com.google.android.youtube"(
|
||||||
"19.34.42",
|
"19.34.42",
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
"20.07.39",
|
||||||
"20.13.41",
|
"20.13.41",
|
||||||
"20.14.43",
|
"20.14.43",
|
||||||
|
|||||||
@@ -60,7 +60,6 @@ val spoofAppVersionPatch = bytecodePatch(
|
|||||||
compatibleWith(
|
compatibleWith(
|
||||||
"com.google.android.youtube"(
|
"com.google.android.youtube"(
|
||||||
"19.34.42",
|
"19.34.42",
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
"20.07.39",
|
||||||
"20.13.41",
|
"20.13.41",
|
||||||
"20.14.43",
|
"20.14.43",
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ val changeStartPagePatch = bytecodePatch(
|
|||||||
compatibleWith(
|
compatibleWith(
|
||||||
"com.google.android.youtube"(
|
"com.google.android.youtube"(
|
||||||
"19.34.42",
|
"19.34.42",
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
"20.07.39",
|
||||||
"20.13.41",
|
"20.13.41",
|
||||||
"20.14.43",
|
"20.14.43",
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ val disableResumingShortsOnStartupPatch = bytecodePatch(
|
|||||||
compatibleWith(
|
compatibleWith(
|
||||||
"com.google.android.youtube"(
|
"com.google.android.youtube"(
|
||||||
"19.34.42",
|
"19.34.42",
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
"20.07.39",
|
||||||
"20.13.41",
|
"20.13.41",
|
||||||
"20.14.43",
|
"20.14.43",
|
||||||
|
|||||||
@@ -205,7 +205,6 @@ val themePatch = bytecodePatch(
|
|||||||
compatibleWith(
|
compatibleWith(
|
||||||
"com.google.android.youtube"(
|
"com.google.android.youtube"(
|
||||||
"19.34.42",
|
"19.34.42",
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
"20.07.39",
|
||||||
"20.13.41",
|
"20.13.41",
|
||||||
"20.14.43",
|
"20.14.43",
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ val alternativeThumbnailsPatch = bytecodePatch(
|
|||||||
compatibleWith(
|
compatibleWith(
|
||||||
"com.google.android.youtube"(
|
"com.google.android.youtube"(
|
||||||
"19.34.42",
|
"19.34.42",
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
"20.07.39",
|
||||||
"20.13.41",
|
"20.13.41",
|
||||||
"20.14.43",
|
"20.14.43",
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ val bypassImageRegionRestrictionsPatch = bytecodePatch(
|
|||||||
compatibleWith(
|
compatibleWith(
|
||||||
"com.google.android.youtube"(
|
"com.google.android.youtube"(
|
||||||
"19.34.42",
|
"19.34.42",
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
"20.07.39",
|
||||||
"20.13.41",
|
"20.13.41",
|
||||||
"20.14.43",
|
"20.14.43",
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ val announcementsPatch = bytecodePatch(
|
|||||||
compatibleWith(
|
compatibleWith(
|
||||||
"com.google.android.youtube"(
|
"com.google.android.youtube"(
|
||||||
"19.34.42",
|
"19.34.42",
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
"20.07.39",
|
||||||
"20.13.41",
|
"20.13.41",
|
||||||
"20.14.43",
|
"20.14.43",
|
||||||
|
|||||||
@@ -1,62 +1,9 @@
|
|||||||
package app.revanced.patches.youtube.misc.autorepeat
|
package app.revanced.patches.youtube.misc.autorepeat
|
||||||
|
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.instructions
|
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.removeInstruction
|
|
||||||
import app.revanced.patcher.patch.bytecodePatch
|
import app.revanced.patcher.patch.bytecodePatch
|
||||||
import app.revanced.patches.all.misc.resources.addResources
|
import app.revanced.patches.youtube.misc.loopvideo.loopVideoPatch
|
||||||
import app.revanced.patches.all.misc.resources.addResourcesPatch
|
|
||||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
|
||||||
import app.revanced.patches.youtube.misc.extension.sharedExtensionPatch
|
|
||||||
import app.revanced.patches.youtube.misc.settings.PreferenceScreen
|
|
||||||
import app.revanced.patches.youtube.shared.autoRepeatFingerprint
|
|
||||||
import app.revanced.patches.youtube.shared.autoRepeatParentFingerprint
|
|
||||||
|
|
||||||
// TODO: Rename this patch to AlwaysRepeatPatch (as well as strings and references in the extension).
|
@Deprecated("Patch was renamed", ReplaceWith("looVideoPatch"))
|
||||||
val autoRepeatPatch = bytecodePatch(
|
val autoRepeatPatch = bytecodePatch {
|
||||||
name = "Always repeat",
|
dependsOn(loopVideoPatch)
|
||||||
description = "Adds an option to always repeat videos when they end.",
|
|
||||||
) {
|
|
||||||
dependsOn(
|
|
||||||
sharedExtensionPatch,
|
|
||||||
addResourcesPatch,
|
|
||||||
)
|
|
||||||
|
|
||||||
compatibleWith(
|
|
||||||
"com.google.android.youtube"(
|
|
||||||
"19.34.42",
|
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
|
||||||
"20.13.41",
|
|
||||||
"20.14.43",
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
execute {
|
|
||||||
addResources("youtube", "misc.autorepeat.autoRepeatPatch")
|
|
||||||
|
|
||||||
PreferenceScreen.MISC.addPreferences(
|
|
||||||
SwitchPreference("revanced_auto_repeat"),
|
|
||||||
)
|
|
||||||
|
|
||||||
autoRepeatFingerprint.match(autoRepeatParentFingerprint.originalClassDef).method.apply {
|
|
||||||
val playMethod = autoRepeatParentFingerprint.method
|
|
||||||
val index = instructions.lastIndex
|
|
||||||
|
|
||||||
// Remove return-void.
|
|
||||||
removeInstruction(index)
|
|
||||||
// Add own instructions there.
|
|
||||||
addInstructionsWithLabels(
|
|
||||||
index,
|
|
||||||
"""
|
|
||||||
invoke-static {}, Lapp/revanced/extension/youtube/patches/AutoRepeatPatch;->shouldAutoRepeat()Z
|
|
||||||
move-result v0
|
|
||||||
if-eqz v0, :noautorepeat
|
|
||||||
invoke-virtual { p0 }, $playMethod
|
|
||||||
:noautorepeat
|
|
||||||
return-void
|
|
||||||
""",
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,7 +52,6 @@ val backgroundPlaybackPatch = bytecodePatch(
|
|||||||
compatibleWith(
|
compatibleWith(
|
||||||
"com.google.android.youtube"(
|
"com.google.android.youtube"(
|
||||||
"19.34.42",
|
"19.34.42",
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
"20.07.39",
|
||||||
"20.13.41",
|
"20.13.41",
|
||||||
"20.14.43",
|
"20.14.43",
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ val enableDebuggingPatch = enableDebuggingPatch(
|
|||||||
compatibleWith(
|
compatibleWith(
|
||||||
"com.google.android.youtube"(
|
"com.google.android.youtube"(
|
||||||
"19.34.42",
|
"19.34.42",
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
"20.07.39",
|
||||||
"20.13.41",
|
"20.13.41",
|
||||||
"20.14.43",
|
"20.14.43",
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ val spoofDeviceDimensionsPatch = bytecodePatch(
|
|||||||
compatibleWith(
|
compatibleWith(
|
||||||
"com.google.android.youtube"(
|
"com.google.android.youtube"(
|
||||||
"19.34.42",
|
"19.34.42",
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
"20.07.39",
|
||||||
"20.13.41",
|
"20.13.41",
|
||||||
"20.14.43",
|
"20.14.43",
|
||||||
|
|||||||
@@ -1,40 +1,23 @@
|
|||||||
package app.revanced.patches.youtube.misc.dns
|
package app.revanced.patches.youtube.misc.dns
|
||||||
|
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
import app.revanced.patches.shared.misc.dns.checkWatchHistoryDomainNameResolutionPatch
|
||||||
import app.revanced.patcher.patch.bytecodePatch
|
|
||||||
import app.revanced.patches.all.misc.resources.addResources
|
|
||||||
import app.revanced.patches.all.misc.resources.addResourcesPatch
|
|
||||||
import app.revanced.patches.youtube.misc.extension.sharedExtensionPatch
|
import app.revanced.patches.youtube.misc.extension.sharedExtensionPatch
|
||||||
import app.revanced.patches.youtube.shared.mainActivityOnCreateFingerprint
|
import app.revanced.patches.youtube.shared.mainActivityOnCreateFingerprint
|
||||||
|
|
||||||
private const val EXTENSION_CLASS_DESCRIPTOR =
|
val checkWatchHistoryDomainNameResolutionPatch = checkWatchHistoryDomainNameResolutionPatch(
|
||||||
"Lapp/revanced/extension/youtube/patches/CheckWatchHistoryDomainNameResolutionPatch;"
|
block = {
|
||||||
|
|
||||||
val checkWatchHistoryDomainNameResolutionPatch = bytecodePatch(
|
|
||||||
name = "Check watch history domain name resolution",
|
|
||||||
description = "Checks if the device DNS server is preventing user watch history from being saved.",
|
|
||||||
) {
|
|
||||||
dependsOn(
|
dependsOn(
|
||||||
sharedExtensionPatch,
|
sharedExtensionPatch
|
||||||
addResourcesPatch
|
|
||||||
)
|
)
|
||||||
|
|
||||||
compatibleWith(
|
compatibleWith(
|
||||||
"com.google.android.youtube"(
|
"com.google.android.youtube"(
|
||||||
"19.34.42",
|
"19.34.42",
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
"20.07.39",
|
||||||
"20.13.41",
|
"20.13.41",
|
||||||
"20.14.43",
|
"20.14.43",
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
},
|
||||||
execute {
|
mainActivityFingerprint = mainActivityOnCreateFingerprint
|
||||||
addResources("youtube", "misc.dns.checkWatchHistoryDomainNameResolutionPatch")
|
|
||||||
|
|
||||||
mainActivityOnCreateFingerprint.method.addInstruction(
|
|
||||||
0,
|
|
||||||
"invoke-static/range { p0 .. p0 }, $EXTENSION_CLASS_DESCRIPTOR->checkDnsResolver(Landroid/app/Activity;)V",
|
|
||||||
)
|
)
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ val gmsCoreSupportPatch = gmsCoreSupportPatch(
|
|||||||
compatibleWith(
|
compatibleWith(
|
||||||
YOUTUBE_PACKAGE_NAME(
|
YOUTUBE_PACKAGE_NAME(
|
||||||
"19.34.42",
|
"19.34.42",
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
"20.07.39",
|
||||||
"20.13.41",
|
"20.13.41",
|
||||||
"20.14.43",
|
"20.14.43",
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ val disableHapticFeedbackPatch = bytecodePatch(
|
|||||||
compatibleWith(
|
compatibleWith(
|
||||||
"com.google.android.youtube"(
|
"com.google.android.youtube"(
|
||||||
"19.34.42",
|
"19.34.42",
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
"20.07.39",
|
||||||
"20.13.41",
|
"20.13.41",
|
||||||
"20.14.43",
|
"20.14.43",
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ val bypassURLRedirectsPatch = bytecodePatch(
|
|||||||
compatibleWith(
|
compatibleWith(
|
||||||
"com.google.android.youtube"(
|
"com.google.android.youtube"(
|
||||||
"19.34.42",
|
"19.34.42",
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
"20.07.39",
|
||||||
"20.13.41",
|
"20.13.41",
|
||||||
"20.14.43",
|
"20.14.43",
|
||||||
|
|||||||
@@ -42,7 +42,6 @@ val openLinksExternallyPatch = bytecodePatch(
|
|||||||
compatibleWith(
|
compatibleWith(
|
||||||
"com.google.android.youtube"(
|
"com.google.android.youtube"(
|
||||||
"19.34.42",
|
"19.34.42",
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
"20.07.39",
|
||||||
"20.13.41",
|
"20.13.41",
|
||||||
"20.14.43",
|
"20.14.43",
|
||||||
|
|||||||
@@ -0,0 +1,61 @@
|
|||||||
|
package app.revanced.patches.youtube.misc.loopvideo
|
||||||
|
|
||||||
|
import app.revanced.patcher.patch.bytecodePatch
|
||||||
|
import app.revanced.patches.all.misc.resources.addResources
|
||||||
|
import app.revanced.patches.all.misc.resources.addResourcesPatch
|
||||||
|
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||||
|
import app.revanced.patches.youtube.misc.extension.sharedExtensionPatch
|
||||||
|
import app.revanced.patches.youtube.misc.loopvideo.button.loopVideoButtonPatch
|
||||||
|
import app.revanced.patches.youtube.misc.settings.PreferenceScreen
|
||||||
|
import app.revanced.patches.youtube.shared.loopVideoFingerprint
|
||||||
|
import app.revanced.patches.youtube.shared.loopVideoParentFingerprint
|
||||||
|
import app.revanced.util.addInstructionsAtControlFlowLabel
|
||||||
|
import app.revanced.util.indexOfFirstInstructionReversedOrThrow
|
||||||
|
import com.android.tools.smali.dexlib2.Opcode
|
||||||
|
|
||||||
|
private const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/youtube/patches/LoopVideoPatch;"
|
||||||
|
|
||||||
|
val loopVideoPatch = bytecodePatch(
|
||||||
|
name = "Loop video",
|
||||||
|
description = "Adds an option to loop videos and display loop video button in the video player.",
|
||||||
|
) {
|
||||||
|
dependsOn(
|
||||||
|
sharedExtensionPatch,
|
||||||
|
addResourcesPatch,
|
||||||
|
loopVideoButtonPatch
|
||||||
|
)
|
||||||
|
|
||||||
|
compatibleWith(
|
||||||
|
"com.google.android.youtube"(
|
||||||
|
"19.34.42",
|
||||||
|
"20.07.39",
|
||||||
|
"20.13.41",
|
||||||
|
"20.14.43",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
execute {
|
||||||
|
addResources("youtube", "misc.loopvideo.loopVideoPatch")
|
||||||
|
|
||||||
|
PreferenceScreen.MISC.addPreferences(
|
||||||
|
SwitchPreference("revanced_loop_video"),
|
||||||
|
)
|
||||||
|
|
||||||
|
loopVideoFingerprint.match(loopVideoParentFingerprint.originalClassDef).method.apply {
|
||||||
|
val playMethod = loopVideoParentFingerprint.method
|
||||||
|
val insertIndex = indexOfFirstInstructionReversedOrThrow(Opcode.RETURN_VOID)
|
||||||
|
|
||||||
|
addInstructionsAtControlFlowLabel(
|
||||||
|
insertIndex,
|
||||||
|
"""
|
||||||
|
invoke-static {}, $EXTENSION_CLASS_DESCRIPTOR->shouldLoopVideo()Z
|
||||||
|
move-result v0
|
||||||
|
if-eqz v0, :do_not_loop
|
||||||
|
invoke-virtual { p0 }, $playMethod
|
||||||
|
:do_not_loop
|
||||||
|
nop
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
package app.revanced.patches.youtube.misc.loopvideo.button
|
||||||
|
|
||||||
|
import app.revanced.patcher.patch.bytecodePatch
|
||||||
|
import app.revanced.patcher.patch.resourcePatch
|
||||||
|
import app.revanced.patches.all.misc.resources.addResources
|
||||||
|
import app.revanced.patches.all.misc.resources.addResourcesPatch
|
||||||
|
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||||
|
import app.revanced.patches.youtube.misc.extension.sharedExtensionPatch
|
||||||
|
import app.revanced.patches.youtube.misc.playercontrols.*
|
||||||
|
import app.revanced.patches.youtube.misc.settings.PreferenceScreen
|
||||||
|
import app.revanced.patches.youtube.misc.settings.settingsPatch
|
||||||
|
import app.revanced.util.ResourceGroup
|
||||||
|
import app.revanced.util.copyResources
|
||||||
|
|
||||||
|
private val loopVideoButtonResourcePatch = resourcePatch {
|
||||||
|
dependsOn(playerControlsResourcePatch)
|
||||||
|
|
||||||
|
execute {
|
||||||
|
copyResources(
|
||||||
|
"loopvideobutton",
|
||||||
|
ResourceGroup(
|
||||||
|
"drawable",
|
||||||
|
"revanced_loop_video_button_on.xml",
|
||||||
|
"revanced_loop_video_button_off.xml"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
addBottomControl("loopvideobutton")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private const val LOOP_VIDEO_BUTTON_CLASS_DESCRIPTOR =
|
||||||
|
"Lapp/revanced/extension/youtube/videoplayer/LoopVideoButton;"
|
||||||
|
|
||||||
|
internal val loopVideoButtonPatch = bytecodePatch(
|
||||||
|
description = "Adds the option to display loop video button in the video player.",
|
||||||
|
) {
|
||||||
|
dependsOn(
|
||||||
|
sharedExtensionPatch,
|
||||||
|
settingsPatch,
|
||||||
|
addResourcesPatch,
|
||||||
|
loopVideoButtonResourcePatch,
|
||||||
|
playerControlsPatch,
|
||||||
|
)
|
||||||
|
|
||||||
|
execute {
|
||||||
|
addResources("youtube", "misc.loopvideo.button.loopVideoButtonPatch")
|
||||||
|
|
||||||
|
PreferenceScreen.PLAYER.addPreferences(
|
||||||
|
SwitchPreference("revanced_loop_video_button"),
|
||||||
|
)
|
||||||
|
|
||||||
|
// Initialize the button using standard approach.
|
||||||
|
initializeBottomControl(LOOP_VIDEO_BUTTON_CLASS_DESCRIPTOR)
|
||||||
|
injectVisibilityCheckCall(LOOP_VIDEO_BUTTON_CLASS_DESCRIPTOR)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -15,7 +15,6 @@ val sanitizeSharingLinksPatch = sanitizeSharingLinksPatch(
|
|||||||
compatibleWith(
|
compatibleWith(
|
||||||
"com.google.android.youtube"(
|
"com.google.android.youtube"(
|
||||||
"19.34.42",
|
"19.34.42",
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
"20.07.39",
|
||||||
"20.13.41",
|
"20.13.41",
|
||||||
"20.14.43",
|
"20.14.43",
|
||||||
|
|||||||
@@ -95,20 +95,6 @@ private val settingsResourcePatch = resourcePatch {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
// Copy style properties used to fix over-sized copy menu that appear in EditTextPreference.
|
|
||||||
// For a full explanation of how this fixes the issue, see the comments in this style file
|
|
||||||
// and the comments in the extension code.
|
|
||||||
val targetResource = "values/styles.xml"
|
|
||||||
inputStreamFromBundledResource(
|
|
||||||
"settings/youtube",
|
|
||||||
targetResource,
|
|
||||||
)!!.let { inputStream ->
|
|
||||||
"resources".copyXmlNode(
|
|
||||||
document(inputStream),
|
|
||||||
document("res/$targetResource"),
|
|
||||||
).close()
|
|
||||||
}
|
|
||||||
|
|
||||||
// Remove horizontal divider from the settings Preferences
|
// Remove horizontal divider from the settings Preferences
|
||||||
// To better match the appearance of the stock YouTube settings.
|
// To better match the appearance of the stock YouTube settings.
|
||||||
document("res/values/styles.xml").use { document ->
|
document("res/values/styles.xml").use { document ->
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ val spoofVideoStreamsPatch = spoofVideoStreamsPatch(
|
|||||||
compatibleWith(
|
compatibleWith(
|
||||||
"com.google.android.youtube"(
|
"com.google.android.youtube"(
|
||||||
"19.34.42",
|
"19.34.42",
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
"20.07.39",
|
||||||
"20.13.41",
|
"20.13.41",
|
||||||
"20.14.43",
|
"20.14.43",
|
||||||
|
|||||||
@@ -21,7 +21,10 @@ internal val conversionContextFingerprintToString = fingerprint {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal val autoRepeatFingerprint = fingerprint {
|
/**
|
||||||
|
* Resolves to class found in [loopVideoParentFingerprint].
|
||||||
|
*/
|
||||||
|
internal val loopVideoFingerprint = fingerprint {
|
||||||
accessFlags(AccessFlags.PUBLIC, AccessFlags.FINAL)
|
accessFlags(AccessFlags.PUBLIC, AccessFlags.FINAL)
|
||||||
returns("V")
|
returns("V")
|
||||||
parameters()
|
parameters()
|
||||||
@@ -30,7 +33,7 @@ internal val autoRepeatFingerprint = fingerprint {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal val autoRepeatParentFingerprint = fingerprint {
|
internal val loopVideoParentFingerprint = fingerprint {
|
||||||
accessFlags(AccessFlags.PUBLIC, AccessFlags.FINAL)
|
accessFlags(AccessFlags.PUBLIC, AccessFlags.FINAL)
|
||||||
returns("V")
|
returns("V")
|
||||||
strings(
|
strings(
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ val forceOriginalAudioPatch = bytecodePatch(
|
|||||||
compatibleWith(
|
compatibleWith(
|
||||||
"com.google.android.youtube"(
|
"com.google.android.youtube"(
|
||||||
"19.34.42",
|
"19.34.42",
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
"20.07.39",
|
||||||
"20.13.41",
|
"20.13.41",
|
||||||
"20.14.43",
|
"20.14.43",
|
||||||
|
|||||||
@@ -0,0 +1,87 @@
|
|||||||
|
package app.revanced.patches.youtube.video.codecs
|
||||||
|
|
||||||
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
||||||
|
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
||||||
|
import app.revanced.patcher.patch.bytecodePatch
|
||||||
|
import app.revanced.patches.all.misc.resources.addResources
|
||||||
|
import app.revanced.patches.all.misc.resources.addResourcesPatch
|
||||||
|
import app.revanced.patches.all.misc.transformation.transformInstructionsPatch
|
||||||
|
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||||
|
import app.revanced.patches.youtube.misc.extension.sharedExtensionPatch
|
||||||
|
import app.revanced.patches.youtube.misc.settings.PreferenceScreen
|
||||||
|
import app.revanced.patches.youtube.misc.settings.settingsPatch
|
||||||
|
import app.revanced.util.getReference
|
||||||
|
import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
|
||||||
|
import com.android.tools.smali.dexlib2.iface.reference.MethodReference
|
||||||
|
|
||||||
|
private const val EXTENSION_CLASS_DESCRIPTOR =
|
||||||
|
"Lapp/revanced/extension/youtube/patches/DisableVideoCodecsPatch;"
|
||||||
|
|
||||||
|
@Suppress("unused")
|
||||||
|
val disableVideoCodecsPatch = bytecodePatch(
|
||||||
|
name = "Disable video codecs",
|
||||||
|
description = "Adds options to disable HDR and VP9 codecs.",
|
||||||
|
) {
|
||||||
|
dependsOn(
|
||||||
|
sharedExtensionPatch,
|
||||||
|
settingsPatch,
|
||||||
|
addResourcesPatch,
|
||||||
|
/**
|
||||||
|
* Override all calls of `getSupportedHdrTypes`.
|
||||||
|
*/
|
||||||
|
transformInstructionsPatch(
|
||||||
|
filterMap = filterMap@{ classDef, _, instruction, instructionIndex ->
|
||||||
|
if (classDef.type.startsWith("Lapp/revanced/")) {
|
||||||
|
return@filterMap null
|
||||||
|
}
|
||||||
|
|
||||||
|
val reference = instruction.getReference<MethodReference>()
|
||||||
|
if (reference?.definingClass =="Landroid/view/Display\$HdrCapabilities;"
|
||||||
|
&& reference.name == "getSupportedHdrTypes") {
|
||||||
|
return@filterMap instruction to instructionIndex
|
||||||
|
}
|
||||||
|
return@filterMap null
|
||||||
|
},
|
||||||
|
transform = { method, entry ->
|
||||||
|
val (instruction, index) = entry
|
||||||
|
val register = (instruction as FiveRegisterInstruction).registerC
|
||||||
|
|
||||||
|
method.replaceInstruction(
|
||||||
|
index,
|
||||||
|
"invoke-static/range { v$register .. v$register }, $EXTENSION_CLASS_DESCRIPTOR->" +
|
||||||
|
"disableHdrVideo(Landroid/view/Display\$HdrCapabilities;)[I",
|
||||||
|
)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
compatibleWith(
|
||||||
|
"com.google.android.youtube"(
|
||||||
|
"19.34.42",
|
||||||
|
"20.07.39",
|
||||||
|
"20.13.41",
|
||||||
|
"20.14.43",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
execute {
|
||||||
|
addResources("youtube", "video.codecs.disableVideoCodecsPatch")
|
||||||
|
|
||||||
|
PreferenceScreen.VIDEO.addPreferences(
|
||||||
|
SwitchPreference("revanced_disable_hdr_video"),
|
||||||
|
SwitchPreference("revanced_force_avc_codec")
|
||||||
|
)
|
||||||
|
|
||||||
|
vp9CapabilityFingerprint.method.addInstructionsWithLabels(
|
||||||
|
0,
|
||||||
|
"""
|
||||||
|
invoke-static {}, $EXTENSION_CLASS_DESCRIPTOR->allowVP9()Z
|
||||||
|
move-result v0
|
||||||
|
if-nez v0, :default
|
||||||
|
return v0
|
||||||
|
:default
|
||||||
|
nop
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package app.revanced.patches.youtube.video.codecs
|
||||||
|
|
||||||
|
import app.revanced.patcher.fingerprint
|
||||||
|
import com.android.tools.smali.dexlib2.AccessFlags
|
||||||
|
|
||||||
|
internal val vp9CapabilityFingerprint = fingerprint {
|
||||||
|
accessFlags(AccessFlags.PUBLIC, AccessFlags.FINAL)
|
||||||
|
returns("Z")
|
||||||
|
strings(
|
||||||
|
"vp9_supported",
|
||||||
|
"video/x-vnd.on2.vp9"
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -1,72 +1,10 @@
|
|||||||
package app.revanced.patches.youtube.video.hdr
|
package app.revanced.patches.youtube.video.hdr
|
||||||
|
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
|
||||||
import app.revanced.patcher.patch.bytecodePatch
|
import app.revanced.patcher.patch.bytecodePatch
|
||||||
import app.revanced.patches.all.misc.resources.addResources
|
import app.revanced.patches.youtube.video.codecs.disableVideoCodecsPatch
|
||||||
import app.revanced.patches.all.misc.resources.addResourcesPatch
|
|
||||||
import app.revanced.patches.all.misc.transformation.transformInstructionsPatch
|
|
||||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
|
||||||
import app.revanced.patches.youtube.misc.extension.sharedExtensionPatch
|
|
||||||
import app.revanced.patches.youtube.misc.settings.PreferenceScreen
|
|
||||||
import app.revanced.patches.youtube.misc.settings.settingsPatch
|
|
||||||
import app.revanced.util.getReference
|
|
||||||
import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
|
|
||||||
import com.android.tools.smali.dexlib2.iface.reference.MethodReference
|
|
||||||
|
|
||||||
private const val EXTENSION_CLASS_DESCRIPTOR =
|
|
||||||
"Lapp/revanced/extension/youtube/patches/DisableHdrPatch;"
|
|
||||||
|
|
||||||
|
@Deprecated("Patch was renamed", ReplaceWith("disableVideoCodecsPatch"))
|
||||||
@Suppress("unused")
|
@Suppress("unused")
|
||||||
val disableHdrPatch = bytecodePatch(
|
val disableHdrPatch = bytecodePatch{
|
||||||
name = "Disable HDR video",
|
dependsOn(disableVideoCodecsPatch)
|
||||||
description = "Adds an option to disable video HDR.",
|
|
||||||
) {
|
|
||||||
dependsOn(
|
|
||||||
sharedExtensionPatch,
|
|
||||||
settingsPatch,
|
|
||||||
addResourcesPatch,
|
|
||||||
// Override all calls of `getSupportedHdrTypes`.
|
|
||||||
transformInstructionsPatch(
|
|
||||||
filterMap = filterMap@{ classDef, _, instruction, instructionIndex ->
|
|
||||||
if (classDef.type.startsWith("Lapp/revanced/")) {
|
|
||||||
return@filterMap null
|
|
||||||
}
|
|
||||||
|
|
||||||
val reference = instruction.getReference<MethodReference>()
|
|
||||||
if (reference?.definingClass =="Landroid/view/Display\$HdrCapabilities;"
|
|
||||||
&& reference.name == "getSupportedHdrTypes") {
|
|
||||||
return@filterMap instruction to instructionIndex
|
|
||||||
}
|
|
||||||
return@filterMap null
|
|
||||||
},
|
|
||||||
transform = { method, entry ->
|
|
||||||
val (instruction, index) = entry
|
|
||||||
val register = (instruction as FiveRegisterInstruction).registerC
|
|
||||||
|
|
||||||
method.replaceInstruction(
|
|
||||||
index,
|
|
||||||
"invoke-static/range { v$register .. v$register }, $EXTENSION_CLASS_DESCRIPTOR->" +
|
|
||||||
"disableHdrVideo(Landroid/view/Display\$HdrCapabilities;)[I",
|
|
||||||
)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
compatibleWith(
|
|
||||||
"com.google.android.youtube"(
|
|
||||||
"19.34.42",
|
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
|
||||||
"20.13.41",
|
|
||||||
"20.14.43",
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
execute {
|
|
||||||
addResources("youtube", "video.hdr.disableHdrPatch")
|
|
||||||
|
|
||||||
PreferenceScreen.VIDEO.addPreferences(
|
|
||||||
SwitchPreference("revanced_disable_hdr_video")
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -26,7 +26,6 @@ internal val videoQualityItemOnClickFingerprint = fingerprint {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
internal val videoQualityMenuOptionsFingerprint = fingerprint {
|
internal val videoQualityMenuOptionsFingerprint = fingerprint {
|
||||||
accessFlags(AccessFlags.STATIC)
|
accessFlags(AccessFlags.STATIC)
|
||||||
returns("[L")
|
returns("[L")
|
||||||
|
|||||||
@@ -14,18 +14,18 @@ internal val settingsMenuVideoQualityGroup = mutableSetOf<BasePreference>()
|
|||||||
@Suppress("unused")
|
@Suppress("unused")
|
||||||
val videoQualityPatch = bytecodePatch(
|
val videoQualityPatch = bytecodePatch(
|
||||||
name = "Video quality",
|
name = "Video quality",
|
||||||
description = "Adds options to use the advanced video quality menu and set default video qualities."
|
description = "Adds options to use the advanced video quality menu, set default video qualities, " +
|
||||||
|
"and disable video codecs such as VP9/HDR."
|
||||||
) {
|
) {
|
||||||
dependsOn(
|
dependsOn(
|
||||||
rememberVideoQualityPatch,
|
rememberVideoQualityPatch,
|
||||||
advancedVideoQualityMenuPatch,
|
advancedVideoQualityMenuPatch,
|
||||||
videoQualityDialogButtonPatch,
|
videoQualityDialogButtonPatch
|
||||||
)
|
)
|
||||||
|
|
||||||
compatibleWith(
|
compatibleWith(
|
||||||
"com.google.android.youtube"(
|
"com.google.android.youtube"(
|
||||||
"19.34.42",
|
"19.34.42",
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
"20.07.39",
|
||||||
"20.13.41",
|
"20.13.41",
|
||||||
"20.14.43",
|
"20.14.43",
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ val playbackSpeedPatch = bytecodePatch(
|
|||||||
compatibleWith(
|
compatibleWith(
|
||||||
"com.google.android.youtube"(
|
"com.google.android.youtube"(
|
||||||
"19.34.42",
|
"19.34.42",
|
||||||
"19.43.41",
|
|
||||||
"20.07.39",
|
"20.07.39",
|
||||||
"20.13.41",
|
"20.13.41",
|
||||||
"20.14.43",
|
"20.14.43",
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ Second \"item\" text"</string>
|
|||||||
<app id="shared">
|
<app id="shared">
|
||||||
<patch id="misc.checks.checkEnvironmentPatch">
|
<patch id="misc.checks.checkEnvironmentPatch">
|
||||||
</patch>
|
</patch>
|
||||||
|
<patch id="misc.dns.checkWatchHistoryDomainNameResolutionPatch">
|
||||||
|
</patch>
|
||||||
<patch id="misc.settings.settingsResourcePatch">
|
<patch id="misc.settings.settingsResourcePatch">
|
||||||
<!-- Settings about dialog. -->
|
<!-- Settings about dialog. -->
|
||||||
<!-- NOTE: the about strings above are duplicated in the TikTok about screen code,
|
<!-- NOTE: the about strings above are duplicated in the TikTok about screen code,
|
||||||
@@ -209,9 +211,9 @@ Second \"item\" text"</string>
|
|||||||
</patch>
|
</patch>
|
||||||
<patch id="misc.announcements.announcementsPatch">
|
<patch id="misc.announcements.announcementsPatch">
|
||||||
</patch>
|
</patch>
|
||||||
<patch id="misc.dns.checkWatchHistoryDomainNameResolutionPatch">
|
<patch id="misc.loopvideo.loopVideoPatch">
|
||||||
</patch>
|
</patch>
|
||||||
<patch id="misc.autorepeat.autoRepeatPatch">
|
<patch id="misc.loopvideo.button.loopVideoButtonPatch">
|
||||||
</patch>
|
</patch>
|
||||||
<patch id="misc.dimensions.spoof.spoofDeviceDimensionsPatch">
|
<patch id="misc.dimensions.spoof.spoofDeviceDimensionsPatch">
|
||||||
</patch>
|
</patch>
|
||||||
@@ -237,7 +239,7 @@ Second \"item\" text"</string>
|
|||||||
</patch>
|
</patch>
|
||||||
<patch id="video.speed.remember.rememberPlaybackSpeedPatch">
|
<patch id="video.speed.remember.rememberPlaybackSpeedPatch">
|
||||||
</patch>
|
</patch>
|
||||||
<patch id="video.hdr.disableHdrPatch">
|
<patch id="video.codecs.disableVideoCodecsPatch">
|
||||||
</patch>
|
</patch>
|
||||||
<patch id="video.quality.advancedVideoQualityMenuPatch">
|
<patch id="video.quality.advancedVideoQualityMenuPatch">
|
||||||
</patch>
|
</patch>
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user