mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2026-01-19 17:13:59 +00:00
Compare commits
8 Commits
v5.2.1-dev
...
v5.2.1-dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a7aa8de6a8 | ||
|
|
4ee70e3869 | ||
|
|
c912a662ab | ||
|
|
d3b3262a31 | ||
|
|
78390a8bca | ||
|
|
85bfa4ca91 | ||
|
|
9bcde94724 | ||
|
|
0cfd8e6760 |
21
CHANGELOG.md
21
CHANGELOG.md
@@ -1,3 +1,24 @@
|
|||||||
|
## [5.2.1-dev.5](https://github.com/ReVanced/revanced-patches/compare/v5.2.1-dev.4...v5.2.1-dev.5) (2024-12-01)
|
||||||
|
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* Move variables to local scope ([43c0421](https://github.com/ReVanced/revanced-patches/commit/43c04216c6e647eaf6ad7e813eb5f0df0c108b77))
|
||||||
|
|
||||||
|
## [5.2.1-dev.4](https://github.com/ReVanced/revanced-patches/compare/v5.2.1-dev.3...v5.2.1-dev.4) (2024-11-30)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **Twitch:** Resolve setting menu crashes ([#4025](https://github.com/ReVanced/revanced-patches/issues/4025)) ([62df596](https://github.com/ReVanced/revanced-patches/commit/62df5965d7331e47b3143425d169a79a19eac447))
|
||||||
|
|
||||||
|
## [5.2.1-dev.3](https://github.com/ReVanced/revanced-patches/compare/v5.2.1-dev.2...v5.2.1-dev.3) (2024-11-29)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **YouTube Music - Hide category bar:** Add support for latest release ([#3968](https://github.com/ReVanced/revanced-patches/issues/3968)) ([b63fdeb](https://github.com/ReVanced/revanced-patches/commit/b63fdeb10b504468307a77bd5de69407906848bf))
|
||||||
|
|
||||||
## [5.2.1-dev.2](https://github.com/ReVanced/revanced-patches/compare/v5.2.1-dev.1...v5.2.1-dev.2) (2024-11-28)
|
## [5.2.1-dev.2](https://github.com/ReVanced/revanced-patches/compare/v5.2.1-dev.1...v5.2.1-dev.2) (2024-11-28)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,23 +1,13 @@
|
|||||||
package app.revanced.extension.shared.settings.preference;
|
package app.revanced.extension.shared.settings.preference;
|
||||||
|
|
||||||
import static app.revanced.extension.shared.StringRef.str;
|
import static app.revanced.extension.shared.StringRef.str;
|
||||||
import static app.revanced.extension.shared.Utils.getResourceIdentifier;
|
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.app.Dialog;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.graphics.Insets;
|
|
||||||
import android.graphics.drawable.Drawable;
|
|
||||||
import android.os.Build;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.preference.*;
|
import android.preference.*;
|
||||||
import android.util.TypedValue;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.view.WindowInsets;
|
|
||||||
import android.widget.TextView;
|
|
||||||
import android.widget.Toolbar;
|
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
@@ -29,7 +19,6 @@ import app.revanced.extension.shared.Utils;
|
|||||||
import app.revanced.extension.shared.settings.BaseSettings;
|
import app.revanced.extension.shared.settings.BaseSettings;
|
||||||
import app.revanced.extension.shared.settings.BooleanSetting;
|
import app.revanced.extension.shared.settings.BooleanSetting;
|
||||||
import app.revanced.extension.shared.settings.Setting;
|
import app.revanced.extension.shared.settings.Setting;
|
||||||
import app.revanced.extension.youtube.ThemeHelper;
|
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
public abstract class AbstractPreferenceFragment extends PreferenceFragment {
|
public abstract class AbstractPreferenceFragment extends PreferenceFragment {
|
||||||
@@ -85,14 +74,6 @@ public abstract class AbstractPreferenceFragment extends PreferenceFragment {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@SuppressLint("UseCompatLoadingForDrawables")
|
|
||||||
public static Drawable getBackButtonDrawable() {
|
|
||||||
final int backButtonResource = getResourceIdentifier(ThemeHelper.isDarkTheme()
|
|
||||||
? "yt_outline_arrow_left_white_24"
|
|
||||||
: "yt_outline_arrow_left_black_24",
|
|
||||||
"drawable");
|
|
||||||
return Utils.getContext().getResources().getDrawable(backButtonResource);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize this instance, and do any custom behavior.
|
* Initialize this instance, and do any custom behavior.
|
||||||
@@ -284,7 +265,6 @@ public abstract class AbstractPreferenceFragment extends PreferenceFragment {
|
|||||||
// causes a callback to the listener even though nothing changed.
|
// causes a callback to the listener even though nothing changed.
|
||||||
initialize();
|
initialize();
|
||||||
updateUIToSettingValues();
|
updateUIToSettingValues();
|
||||||
setPreferenceScreenToolbar(getPreferenceScreen());
|
|
||||||
|
|
||||||
preferenceManager.getSharedPreferences().registerOnSharedPreferenceChangeListener(listener);
|
preferenceManager.getSharedPreferences().registerOnSharedPreferenceChangeListener(listener);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
@@ -297,56 +277,4 @@ public abstract class AbstractPreferenceFragment extends PreferenceFragment {
|
|||||||
getPreferenceManager().getSharedPreferences().unregisterOnSharedPreferenceChangeListener(listener);
|
getPreferenceManager().getSharedPreferences().unregisterOnSharedPreferenceChangeListener(listener);
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setPreferenceScreenToolbar(PreferenceScreen parentScreen) {
|
|
||||||
for (int i = 0, preferenceCount = parentScreen.getPreferenceCount(); i < preferenceCount; i++) {
|
|
||||||
Preference childPreference = parentScreen.getPreference(i);
|
|
||||||
if (childPreference instanceof PreferenceScreen) {
|
|
||||||
// Recursively set sub preferences.
|
|
||||||
setPreferenceScreenToolbar((PreferenceScreen) childPreference);
|
|
||||||
|
|
||||||
childPreference.setOnPreferenceClickListener(
|
|
||||||
childScreen -> {
|
|
||||||
Dialog preferenceScreenDialog = ((PreferenceScreen) childScreen).getDialog();
|
|
||||||
ViewGroup rootView = (ViewGroup) preferenceScreenDialog
|
|
||||||
.findViewById(android.R.id.content)
|
|
||||||
.getParent();
|
|
||||||
|
|
||||||
// Fix required for Android 15 and YT 19.45+
|
|
||||||
// FIXME:
|
|
||||||
// On Android 15 the text layout is not aligned the same as the parent
|
|
||||||
// screen and it looks a little off. Otherwise this works.
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
|
||||||
rootView.setOnApplyWindowInsetsListener((v, insets) -> {
|
|
||||||
Insets statusInsets = insets.getInsets(WindowInsets.Type.statusBars());
|
|
||||||
v.setPadding(0, statusInsets.top, 0, 0);
|
|
||||||
return insets;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
Toolbar toolbar = new Toolbar(childScreen.getContext());
|
|
||||||
toolbar.setTitle(childScreen.getTitle());
|
|
||||||
toolbar.setNavigationIcon(getBackButtonDrawable());
|
|
||||||
toolbar.setNavigationOnClickListener(view -> preferenceScreenDialog.dismiss());
|
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
|
||||||
final int margin = (int) TypedValue.applyDimension(
|
|
||||||
TypedValue.COMPLEX_UNIT_DIP, 16, getResources().getDisplayMetrics()
|
|
||||||
);
|
|
||||||
toolbar.setTitleMargin(margin, 0, margin, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
TextView toolbarTextView = Utils.getChildView(toolbar,
|
|
||||||
true, TextView.class::isInstance);
|
|
||||||
if (toolbarTextView != null) {
|
|
||||||
toolbarTextView.setTextColor(ThemeHelper.getForegroundColor());
|
|
||||||
}
|
|
||||||
|
|
||||||
rootView.addView(toolbar, 0);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import android.view.ViewGroup;
|
|||||||
import android.widget.ImageButton;
|
import android.widget.ImageButton;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import app.revanced.extension.shared.Logger;
|
import app.revanced.extension.shared.Logger;
|
||||||
import app.revanced.extension.shared.settings.preference.AbstractPreferenceFragment;
|
|
||||||
import app.revanced.extension.youtube.ThemeHelper;
|
import app.revanced.extension.youtube.ThemeHelper;
|
||||||
import app.revanced.extension.youtube.settings.preference.ReVancedPreferenceFragment;
|
import app.revanced.extension.youtube.settings.preference.ReVancedPreferenceFragment;
|
||||||
import app.revanced.extension.youtube.settings.preference.ReturnYouTubeDislikePreferenceFragment;
|
import app.revanced.extension.youtube.settings.preference.ReturnYouTubeDislikePreferenceFragment;
|
||||||
@@ -83,7 +82,7 @@ public class LicenseActivityHook {
|
|||||||
ViewGroup toolbar = activity.findViewById(getToolbarResourceId());
|
ViewGroup toolbar = activity.findViewById(getToolbarResourceId());
|
||||||
ImageButton imageButton = Objects.requireNonNull(getChildView(toolbar, false,
|
ImageButton imageButton = Objects.requireNonNull(getChildView(toolbar, false,
|
||||||
view -> view instanceof ImageButton));
|
view -> view instanceof ImageButton));
|
||||||
imageButton.setImageDrawable(AbstractPreferenceFragment.getBackButtonDrawable());
|
imageButton.setImageDrawable(ReVancedPreferenceFragment.getBackButtonDrawable());
|
||||||
imageButton.setOnClickListener(view -> activity.onBackPressed());
|
imageButton.setOnClickListener(view -> activity.onBackPressed());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,27 @@
|
|||||||
package app.revanced.extension.youtube.settings.preference;
|
package app.revanced.extension.youtube.settings.preference;
|
||||||
|
|
||||||
|
import static app.revanced.extension.shared.Utils.getResourceIdentifier;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.app.Dialog;
|
||||||
|
import android.graphics.Insets;
|
||||||
|
import android.graphics.drawable.Drawable;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.preference.ListPreference;
|
import android.preference.ListPreference;
|
||||||
import android.preference.Preference;
|
import android.preference.Preference;
|
||||||
|
import android.preference.PreferenceScreen;
|
||||||
|
import android.util.TypedValue;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.view.WindowInsets;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toolbar;
|
||||||
|
|
||||||
import androidx.annotation.RequiresApi;
|
import androidx.annotation.RequiresApi;
|
||||||
|
|
||||||
import app.revanced.extension.shared.Logger;
|
import app.revanced.extension.shared.Logger;
|
||||||
|
import app.revanced.extension.shared.Utils;
|
||||||
import app.revanced.extension.shared.settings.preference.AbstractPreferenceFragment;
|
import app.revanced.extension.shared.settings.preference.AbstractPreferenceFragment;
|
||||||
|
import app.revanced.extension.youtube.ThemeHelper;
|
||||||
import app.revanced.extension.youtube.patches.playback.speed.CustomPlaybackSpeedPatch;
|
import app.revanced.extension.youtube.patches.playback.speed.CustomPlaybackSpeedPatch;
|
||||||
import app.revanced.extension.youtube.settings.Settings;
|
import app.revanced.extension.youtube.settings.Settings;
|
||||||
|
|
||||||
@@ -18,12 +32,23 @@ import app.revanced.extension.youtube.settings.Settings;
|
|||||||
*/
|
*/
|
||||||
public class ReVancedPreferenceFragment extends AbstractPreferenceFragment {
|
public class ReVancedPreferenceFragment extends AbstractPreferenceFragment {
|
||||||
|
|
||||||
|
@SuppressLint("UseCompatLoadingForDrawables")
|
||||||
|
public static Drawable getBackButtonDrawable() {
|
||||||
|
final int backButtonResource = getResourceIdentifier(ThemeHelper.isDarkTheme()
|
||||||
|
? "yt_outline_arrow_left_white_24"
|
||||||
|
: "yt_outline_arrow_left_black_24",
|
||||||
|
"drawable");
|
||||||
|
return Utils.getContext().getResources().getDrawable(backButtonResource);
|
||||||
|
}
|
||||||
|
|
||||||
@RequiresApi(api = Build.VERSION_CODES.O)
|
@RequiresApi(api = Build.VERSION_CODES.O)
|
||||||
@Override
|
@Override
|
||||||
protected void initialize() {
|
protected void initialize() {
|
||||||
super.initialize();
|
super.initialize();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
setPreferenceScreenToolbar(getPreferenceScreen());
|
||||||
|
|
||||||
// If the preference was included, then initialize it based on the available playback speed.
|
// If the preference was included, then initialize it based on the available playback speed.
|
||||||
Preference defaultSpeedPreference = findPreference(Settings.PLAYBACK_SPEED_DEFAULT.key);
|
Preference defaultSpeedPreference = findPreference(Settings.PLAYBACK_SPEED_DEFAULT.key);
|
||||||
if (defaultSpeedPreference instanceof ListPreference) {
|
if (defaultSpeedPreference instanceof ListPreference) {
|
||||||
@@ -33,4 +58,56 @@ public class ReVancedPreferenceFragment extends AbstractPreferenceFragment {
|
|||||||
Logger.printException(() -> "initialize failure", ex);
|
Logger.printException(() -> "initialize failure", ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setPreferenceScreenToolbar(PreferenceScreen parentScreen) {
|
||||||
|
for (int i = 0, preferenceCount = parentScreen.getPreferenceCount(); i < preferenceCount; i++) {
|
||||||
|
Preference childPreference = parentScreen.getPreference(i);
|
||||||
|
if (childPreference instanceof PreferenceScreen) {
|
||||||
|
// Recursively set sub preferences.
|
||||||
|
setPreferenceScreenToolbar((PreferenceScreen) childPreference);
|
||||||
|
|
||||||
|
childPreference.setOnPreferenceClickListener(
|
||||||
|
childScreen -> {
|
||||||
|
Dialog preferenceScreenDialog = ((PreferenceScreen) childScreen).getDialog();
|
||||||
|
ViewGroup rootView = (ViewGroup) preferenceScreenDialog
|
||||||
|
.findViewById(android.R.id.content)
|
||||||
|
.getParent();
|
||||||
|
|
||||||
|
// Fix required for Android 15 and YT 19.45+
|
||||||
|
// FIXME:
|
||||||
|
// On Android 15 the text layout is not aligned the same as the parent
|
||||||
|
// screen and it looks a little off. Otherwise this works.
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||||
|
rootView.setOnApplyWindowInsetsListener((v, insets) -> {
|
||||||
|
Insets statusInsets = insets.getInsets(WindowInsets.Type.statusBars());
|
||||||
|
v.setPadding(0, statusInsets.top, 0, 0);
|
||||||
|
return insets;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Toolbar toolbar = new Toolbar(childScreen.getContext());
|
||||||
|
toolbar.setTitle(childScreen.getTitle());
|
||||||
|
toolbar.setNavigationIcon(getBackButtonDrawable());
|
||||||
|
toolbar.setNavigationOnClickListener(view -> preferenceScreenDialog.dismiss());
|
||||||
|
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||||
|
final int margin = (int) TypedValue.applyDimension(
|
||||||
|
TypedValue.COMPLEX_UNIT_DIP, 16, getResources().getDisplayMetrics()
|
||||||
|
);
|
||||||
|
toolbar.setTitleMargin(margin, 0, margin, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
TextView toolbarTextView = Utils.getChildView(toolbar,
|
||||||
|
true, TextView.class::isInstance);
|
||||||
|
if (toolbarTextView != null) {
|
||||||
|
toolbarTextView.setTextColor(ThemeHelper.getForegroundColor());
|
||||||
|
}
|
||||||
|
|
||||||
|
rootView.addView(toolbar, 0);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.2.1-dev.2
|
version = 5.2.1-dev.5
|
||||||
|
|||||||
@@ -1200,10 +1200,6 @@ public final class app/revanced/patches/youtube/layout/startupshortsreset/Disabl
|
|||||||
public static final fun getDisableResumingShortsOnStartupPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
public static final fun getDisableResumingShortsOnStartupPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final class app/revanced/patches/youtube/layout/startupshortsreset/FingerprintsKt {
|
|
||||||
public static final fun indexOfOptionalInstruction (Lcom/android/tools/smali/dexlib2/iface/Method;)I
|
|
||||||
}
|
|
||||||
|
|
||||||
public final class app/revanced/patches/youtube/layout/tablet/EnableTabletLayoutPatchKt {
|
public final class app/revanced/patches/youtube/layout/tablet/EnableTabletLayoutPatchKt {
|
||||||
public static final field EXTENSION_CLASS_DESCRIPTOR Ljava/lang/String;
|
public static final field EXTENSION_CLASS_DESCRIPTOR Ljava/lang/String;
|
||||||
public static final fun getEnableTabletLayoutPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
public static final fun getEnableTabletLayoutPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||||
@@ -1329,6 +1325,7 @@ public final class app/revanced/patches/youtube/misc/playservice/VersionCheckPat
|
|||||||
public static final fun is_19_41_or_greater ()Z
|
public static final fun is_19_41_or_greater ()Z
|
||||||
public static final fun is_19_43_or_greater ()Z
|
public static final fun is_19_43_or_greater ()Z
|
||||||
public static final fun is_19_46_or_greater ()Z
|
public static final fun is_19_46_or_greater ()Z
|
||||||
|
public static final fun is_19_47_or_greater ()Z
|
||||||
}
|
}
|
||||||
|
|
||||||
public final class app/revanced/patches/youtube/misc/privacy/RemoveTrackingQueryParameterPatchKt {
|
public final class app/revanced/patches/youtube/misc/privacy/RemoveTrackingQueryParameterPatchKt {
|
||||||
|
|||||||
@@ -15,8 +15,6 @@ internal val constructCategoryBarFingerprint = fingerprint {
|
|||||||
Opcode.MOVE_RESULT_OBJECT,
|
Opcode.MOVE_RESULT_OBJECT,
|
||||||
Opcode.IPUT_OBJECT,
|
Opcode.IPUT_OBJECT,
|
||||||
Opcode.CONST,
|
Opcode.CONST,
|
||||||
Opcode.INVOKE_VIRTUAL,
|
Opcode.INVOKE_VIRTUAL
|
||||||
Opcode.NEW_INSTANCE,
|
|
||||||
Opcode.INVOKE_DIRECT,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,12 +12,12 @@ lateinit var resourceMappings: List<ResourceElement>
|
|||||||
private set
|
private set
|
||||||
|
|
||||||
val resourceMappingPatch = resourcePatch {
|
val resourceMappingPatch = resourcePatch {
|
||||||
val threadCount = Runtime.getRuntime().availableProcessors()
|
|
||||||
val threadPoolExecutor = Executors.newFixedThreadPool(threadCount)
|
|
||||||
|
|
||||||
val resourceMappings = Collections.synchronizedList(mutableListOf<ResourceElement>())
|
val resourceMappings = Collections.synchronizedList(mutableListOf<ResourceElement>())
|
||||||
|
|
||||||
execute {
|
execute {
|
||||||
|
val threadCount = Runtime.getRuntime().availableProcessors()
|
||||||
|
val threadPoolExecutor = Executors.newFixedThreadPool(threadCount)
|
||||||
|
|
||||||
// Save the file in memory to concurrently read from it.
|
// Save the file in memory to concurrently read from it.
|
||||||
val resourceXmlFile = get("res/values/public.xml").readBytes()
|
val resourceXmlFile = get("res/values/public.xml").readBytes()
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import app.revanced.patches.all.misc.resources.addResources
|
|||||||
import app.revanced.patches.all.misc.resources.addResourcesPatch
|
import app.revanced.patches.all.misc.resources.addResourcesPatch
|
||||||
import app.revanced.patches.shared.misc.settings.preference.BasePreference
|
import app.revanced.patches.shared.misc.settings.preference.BasePreference
|
||||||
import app.revanced.patches.shared.misc.settings.preference.BasePreferenceScreen
|
import app.revanced.patches.shared.misc.settings.preference.BasePreferenceScreen
|
||||||
|
import app.revanced.patches.shared.misc.settings.preference.NonInteractivePreference
|
||||||
import app.revanced.patches.shared.misc.settings.preference.PreferenceCategory
|
import app.revanced.patches.shared.misc.settings.preference.PreferenceCategory
|
||||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||||
import app.revanced.patches.shared.misc.settings.settingsPatch
|
import app.revanced.patches.shared.misc.settings.settingsPatch
|
||||||
@@ -58,6 +59,12 @@ val settingsPatch = bytecodePatch(
|
|||||||
execute {
|
execute {
|
||||||
addResources("twitch", "misc.settings.settingsPatch")
|
addResources("twitch", "misc.settings.settingsPatch")
|
||||||
|
|
||||||
|
preferences += NonInteractivePreference(
|
||||||
|
key = "revanced_about",
|
||||||
|
tag = "app.revanced.extension.shared.settings.preference.ReVancedAboutPreference",
|
||||||
|
selectable = true,
|
||||||
|
)
|
||||||
|
|
||||||
PreferenceScreen.MISC.OTHER.addPreferences(
|
PreferenceScreen.MISC.OTHER.addPreferences(
|
||||||
// The debug setting is shared across multiple apps and the key must be the same.
|
// The debug setting is shared across multiple apps and the key must be the same.
|
||||||
// But the title and summary must be different, otherwise when the strings file is flattened
|
// But the title and summary must be different, otherwise when the strings file is flattened
|
||||||
|
|||||||
@@ -20,6 +20,8 @@ import app.revanced.patches.shared.misc.settings.preference.*
|
|||||||
import app.revanced.patches.youtube.misc.litho.filter.addLithoFilter
|
import app.revanced.patches.youtube.misc.litho.filter.addLithoFilter
|
||||||
import app.revanced.patches.youtube.misc.litho.filter.lithoFilterPatch
|
import app.revanced.patches.youtube.misc.litho.filter.lithoFilterPatch
|
||||||
import app.revanced.patches.youtube.misc.navigation.navigationBarHookPatch
|
import app.revanced.patches.youtube.misc.navigation.navigationBarHookPatch
|
||||||
|
import app.revanced.patches.youtube.misc.playservice.is_19_47_or_greater
|
||||||
|
import app.revanced.patches.youtube.misc.playservice.versionCheckPatch
|
||||||
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.util.findInstructionIndicesReversedOrThrow
|
import app.revanced.util.findInstructionIndicesReversedOrThrow
|
||||||
@@ -118,6 +120,7 @@ val hideLayoutComponentsPatch = bytecodePatch(
|
|||||||
addResourcesPatch,
|
addResourcesPatch,
|
||||||
hideLayoutComponentsResourcePatch,
|
hideLayoutComponentsResourcePatch,
|
||||||
navigationBarHookPatch,
|
navigationBarHookPatch,
|
||||||
|
versionCheckPatch
|
||||||
)
|
)
|
||||||
|
|
||||||
compatibleWith(
|
compatibleWith(
|
||||||
@@ -243,22 +246,27 @@ val hideLayoutComponentsPatch = bytecodePatch(
|
|||||||
|
|
||||||
// region Mix playlists
|
// region Mix playlists
|
||||||
|
|
||||||
val startIndex = parseElementFromBufferFingerprint.patternMatch!!.startIndex
|
|
||||||
|
|
||||||
parseElementFromBufferFingerprint.method.apply {
|
parseElementFromBufferFingerprint.method.apply {
|
||||||
val freeRegister = "v0"
|
val startIndex = parseElementFromBufferFingerprint.patternMatch!!.startIndex
|
||||||
|
// Target code is a mess with a lot of register moves.
|
||||||
|
// There is no simple way to find a free register for all versions so this is hard coded.
|
||||||
|
val freeRegister = if (is_19_47_or_greater) 6 else 0
|
||||||
val byteArrayParameter = "p3"
|
val byteArrayParameter = "p3"
|
||||||
val conversionContextRegister = getInstruction<TwoRegisterInstruction>(startIndex).registerA
|
val conversionContextRegister = getInstruction<TwoRegisterInstruction>(startIndex).registerA
|
||||||
val returnEmptyComponentInstruction = instructions.last { it.opcode == Opcode.INVOKE_STATIC }
|
val returnEmptyComponentInstruction = instructions.last { it.opcode == Opcode.INVOKE_STATIC }
|
||||||
|
val returnEmptyComponentRegister = (returnEmptyComponentInstruction as FiveRegisterInstruction).registerC
|
||||||
|
|
||||||
addInstructionsWithLabels(
|
addInstructionsWithLabels(
|
||||||
startIndex + 1,
|
startIndex + 1,
|
||||||
"""
|
"""
|
||||||
invoke-static { v$conversionContextRegister, $byteArrayParameter }, $LAYOUT_COMPONENTS_FILTER_CLASS_DESCRIPTOR->filterMixPlaylists(Ljava/lang/Object;[B)Z
|
invoke-static { v$conversionContextRegister, $byteArrayParameter }, $LAYOUT_COMPONENTS_FILTER_CLASS_DESCRIPTOR->filterMixPlaylists(Ljava/lang/Object;[B)Z
|
||||||
move-result $freeRegister
|
move-result v$freeRegister
|
||||||
if-nez $freeRegister, :return_empty_component
|
if-eqz v$freeRegister, :show
|
||||||
const/4 $freeRegister, 0x0 # Restore register, required for 19.16
|
move-object v$returnEmptyComponentRegister, p1 # Required for 19.47
|
||||||
""",
|
goto :return_empty_component
|
||||||
|
:show
|
||||||
|
const/4 v$freeRegister, 0x0 # Restore register, required for 19.16
|
||||||
|
""",
|
||||||
ExternalLabel("return_empty_component", returnEmptyComponentInstruction),
|
ExternalLabel("return_empty_component", returnEmptyComponentInstruction),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -125,8 +125,8 @@ val returnYouTubeDislikePatch = bytecodePatch(
|
|||||||
|
|
||||||
if (is_19_33_or_greater) {
|
if (is_19_33_or_greater) {
|
||||||
insertIndex = indexOfFirstInstructionOrThrow {
|
insertIndex = indexOfFirstInstructionOrThrow {
|
||||||
opcode == Opcode.INVOKE_STATIC_RANGE &&
|
(opcode == Opcode.INVOKE_STATIC || opcode == Opcode.INVOKE_STATIC_RANGE)
|
||||||
getReference<MethodReference>()?.returnType == textDataClassType
|
&& getReference<MethodReference>()?.returnType == textDataClassType
|
||||||
}
|
}
|
||||||
|
|
||||||
tempRegister = getInstruction<OneRegisterInstruction>(insertIndex + 1).registerA
|
tempRegister = getInstruction<OneRegisterInstruction>(insertIndex + 1).registerA
|
||||||
|
|||||||
@@ -35,8 +35,8 @@ val spoofAppVersionPatch = bytecodePatch(
|
|||||||
"18.38.44",
|
"18.38.44",
|
||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.16.39",
|
"19.16.39",
|
||||||
"19.25.37",
|
// "19.25.37", // Cannot be supported because the lowest spoof target is higher.
|
||||||
"19.34.42",
|
// "19.34.42", // Cannot be supported because the lowest spoof target is higher.
|
||||||
"19.43.41",
|
"19.43.41",
|
||||||
"19.45.38",
|
"19.45.38",
|
||||||
"19.46.42",
|
"19.46.42",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package app.revanced.patches.youtube.layout.startupshortsreset
|
package app.revanced.patches.youtube.layout.startupshortsreset
|
||||||
|
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
import app.revanced.patcher.patch.bytecodePatch
|
import app.revanced.patcher.patch.bytecodePatch
|
||||||
import app.revanced.patches.all.misc.resources.addResources
|
import app.revanced.patches.all.misc.resources.addResources
|
||||||
@@ -49,31 +49,6 @@ val disableResumingShortsOnStartupPatch = bytecodePatch(
|
|||||||
SwitchPreference("revanced_disable_resuming_shorts_player"),
|
SwitchPreference("revanced_disable_resuming_shorts_player"),
|
||||||
)
|
)
|
||||||
|
|
||||||
userWasInShortsConfigFingerprint.originalMethod.apply {
|
|
||||||
val startIndex = indexOfOptionalInstruction(this)
|
|
||||||
val walkerIndex = indexOfFirstInstructionOrThrow(startIndex) {
|
|
||||||
val reference = getReference<MethodReference>()
|
|
||||||
opcode == Opcode.INVOKE_VIRTUAL &&
|
|
||||||
reference?.returnType == "Z" &&
|
|
||||||
reference.definingClass != "Lj${'$'}/util/Optional;" &&
|
|
||||||
reference.parameterTypes.isEmpty()
|
|
||||||
}
|
|
||||||
|
|
||||||
// Presumably a method that processes the ProtoDataStore value (boolean) for the 'user_was_in_shorts' key.
|
|
||||||
navigate(this).to(walkerIndex).stop().addInstructionsWithLabels(
|
|
||||||
0,
|
|
||||||
"""
|
|
||||||
invoke-static {}, $EXTENSION_CLASS_DESCRIPTOR->disableResumingStartupShortsPlayer()Z
|
|
||||||
move-result v0
|
|
||||||
if-eqz v0, :show
|
|
||||||
const/4 v0, 0x0
|
|
||||||
return v0
|
|
||||||
:show
|
|
||||||
nop
|
|
||||||
""",
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
userWasInShortsFingerprint.method.apply {
|
userWasInShortsFingerprint.method.apply {
|
||||||
val listenableInstructionIndex = indexOfFirstInstructionOrThrow {
|
val listenableInstructionIndex = indexOfFirstInstructionOrThrow {
|
||||||
opcode == Opcode.INVOKE_INTERFACE &&
|
opcode == Opcode.INVOKE_INTERFACE &&
|
||||||
@@ -94,5 +69,18 @@ val disableResumingShortsOnStartupPatch = bytecodePatch(
|
|||||||
""",
|
""",
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
userWasInShortsConfigFingerprint.method.addInstructions(
|
||||||
|
0,
|
||||||
|
"""
|
||||||
|
invoke-static {}, $EXTENSION_CLASS_DESCRIPTOR->disableResumingStartupShortsPlayer()Z
|
||||||
|
move-result v0
|
||||||
|
if-eqz v0, :show
|
||||||
|
const/4 v0, 0x0
|
||||||
|
return v0
|
||||||
|
:show
|
||||||
|
nop
|
||||||
|
"""
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
package app.revanced.patches.youtube.layout.startupshortsreset
|
package app.revanced.patches.youtube.layout.startupshortsreset
|
||||||
|
|
||||||
import app.revanced.patcher.fingerprint
|
import app.revanced.patcher.fingerprint
|
||||||
import app.revanced.util.getReference
|
import app.revanced.util.literal
|
||||||
import app.revanced.util.indexOfFirstInstruction
|
|
||||||
import com.android.tools.smali.dexlib2.AccessFlags
|
import com.android.tools.smali.dexlib2.AccessFlags
|
||||||
import com.android.tools.smali.dexlib2.iface.Method
|
|
||||||
import com.android.tools.smali.dexlib2.iface.reference.MethodReference
|
|
||||||
import com.android.tools.smali.dexlib2.immutable.reference.ImmutableMethodReference
|
|
||||||
import com.android.tools.smali.dexlib2.util.MethodUtil
|
|
||||||
|
|
||||||
internal val userWasInShortsFingerprint = fingerprint {
|
internal val userWasInShortsFingerprint = fingerprint {
|
||||||
returns("V")
|
returns("V")
|
||||||
@@ -20,22 +15,9 @@ internal val userWasInShortsFingerprint = fingerprint {
|
|||||||
* 18.15.40+
|
* 18.15.40+
|
||||||
*/
|
*/
|
||||||
internal val userWasInShortsConfigFingerprint = fingerprint {
|
internal val userWasInShortsConfigFingerprint = fingerprint {
|
||||||
returns("V")
|
accessFlags(AccessFlags.PUBLIC, AccessFlags.FINAL)
|
||||||
strings("Failed to get offline response: ")
|
returns("Z")
|
||||||
custom { method, _ ->
|
literal {
|
||||||
indexOfOptionalInstruction(method) >= 0
|
45358360L
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private val optionalOfMethodReference = ImmutableMethodReference(
|
|
||||||
"Lj${'$'}/util/Optional;",
|
|
||||||
"of",
|
|
||||||
listOf("Ljava/lang/Object;"),
|
|
||||||
"Lj${'$'}/util/Optional;",
|
|
||||||
)
|
|
||||||
|
|
||||||
fun indexOfOptionalInstruction(method: Method) = method.indexOfFirstInstruction {
|
|
||||||
val reference = getReference<MethodReference>() ?: return@indexOfFirstInstruction false
|
|
||||||
|
|
||||||
MethodUtil.methodSignaturesMatch(reference, optionalOfMethodReference)
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ import app.revanced.patches.shared.misc.settings.preference.PreferenceScreenPref
|
|||||||
import app.revanced.patches.shared.misc.settings.preference.PreferenceScreenPreference.Sorting
|
import app.revanced.patches.shared.misc.settings.preference.PreferenceScreenPreference.Sorting
|
||||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||||
import app.revanced.patches.youtube.misc.extension.sharedExtensionPatch
|
import app.revanced.patches.youtube.misc.extension.sharedExtensionPatch
|
||||||
|
import app.revanced.patches.youtube.misc.playservice.is_19_16_or_greater
|
||||||
|
import app.revanced.patches.youtube.misc.playservice.versionCheckPatch
|
||||||
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.util.indexOfFirstInstructionOrThrow
|
import app.revanced.util.indexOfFirstInstructionOrThrow
|
||||||
@@ -25,6 +27,7 @@ val enableDebuggingPatch = bytecodePatch(
|
|||||||
sharedExtensionPatch,
|
sharedExtensionPatch,
|
||||||
settingsPatch,
|
settingsPatch,
|
||||||
addResourcesPatch,
|
addResourcesPatch,
|
||||||
|
versionCheckPatch
|
||||||
)
|
)
|
||||||
|
|
||||||
compatibleWith(
|
compatibleWith(
|
||||||
@@ -91,20 +94,22 @@ val enableDebuggingPatch = bytecodePatch(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
experimentalLongFeatureFlagFingerprint.match(
|
if (is_19_16_or_greater) {
|
||||||
experimentalFeatureFlagParentFingerprint.originalClassDef
|
experimentalLongFeatureFlagFingerprint.match(
|
||||||
).method.apply {
|
experimentalFeatureFlagParentFingerprint.originalClassDef
|
||||||
val insertIndex = indexOfFirstInstructionOrThrow(Opcode.MOVE_RESULT_WIDE)
|
).method.apply {
|
||||||
|
val insertIndex = indexOfFirstInstructionOrThrow(Opcode.MOVE_RESULT_WIDE)
|
||||||
|
|
||||||
addInstructions(
|
addInstructions(
|
||||||
insertIndex,
|
insertIndex,
|
||||||
"""
|
"""
|
||||||
move-result-wide v0
|
move-result-wide v0
|
||||||
invoke-static/range { v0 .. v5 }, $EXTENSION_CLASS_DESCRIPTOR->isLongFeatureFlagEnabled(JJJ)J
|
invoke-static/range { v0 .. v5 }, $EXTENSION_CLASS_DESCRIPTOR->isLongFeatureFlagEnabled(JJJ)J
|
||||||
move-result-wide v0
|
move-result-wide v0
|
||||||
return-wide v0
|
return-wide v0
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
experimentalStringFeatureFlagFingerprint.match(
|
experimentalStringFeatureFlagFingerprint.match(
|
||||||
|
|||||||
@@ -39,6 +39,8 @@ var is_19_43_or_greater = false
|
|||||||
private set
|
private set
|
||||||
var is_19_46_or_greater = false
|
var is_19_46_or_greater = false
|
||||||
private set
|
private set
|
||||||
|
var is_19_47_or_greater = false
|
||||||
|
private set
|
||||||
|
|
||||||
val versionCheckPatch = resourcePatch(
|
val versionCheckPatch = resourcePatch(
|
||||||
description = "Uses the Play Store service version to find the major/minor version of the YouTube target app.",
|
description = "Uses the Play Store service version to find the major/minor version of the YouTube target app.",
|
||||||
@@ -71,5 +73,6 @@ val versionCheckPatch = resourcePatch(
|
|||||||
is_19_41_or_greater = 244305000 <= playStoreServicesVersion
|
is_19_41_or_greater = 244305000 <= playStoreServicesVersion
|
||||||
is_19_43_or_greater = 244405000 <= playStoreServicesVersion
|
is_19_43_or_greater = 244405000 <= playStoreServicesVersion
|
||||||
is_19_46_or_greater = 244705000 <= playStoreServicesVersion
|
is_19_46_or_greater = 244705000 <= playStoreServicesVersion
|
||||||
|
is_19_47_or_greater = 244799000 <= playStoreServicesVersion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1269,6 +1269,8 @@ This is because Crowdin requires temporarily flattening this file and removing t
|
|||||||
</patch>
|
</patch>
|
||||||
<patch id="misc.settings.settingsPatch">
|
<patch id="misc.settings.settingsPatch">
|
||||||
<string name="revanced_settings">ReVanced Settings</string>
|
<string name="revanced_settings">ReVanced Settings</string>
|
||||||
|
<string name="revanced_about_title">About</string>
|
||||||
|
<string name="revanced_about_summary">About ReVanced</string>
|
||||||
<string name="revanced_ads_screen_title">Ads</string>
|
<string name="revanced_ads_screen_title">Ads</string>
|
||||||
<string name="revanced_ads_screen_summary">Ad blocking settings</string>
|
<string name="revanced_ads_screen_summary">Ad blocking settings</string>
|
||||||
<string name="revanced_chat_screen_title">Chat</string>
|
<string name="revanced_chat_screen_title">Chat</string>
|
||||||
|
|||||||
Reference in New Issue
Block a user