Compare commits

..

25 Commits

Author SHA1 Message Date
semantic-release-bot
39a0b9bda6 chore: Release v5.12.0-dev.5 [skip ci]
# [5.12.0-dev.5](https://github.com/ReVanced/revanced-patches/compare/v5.12.0-dev.4...v5.12.0-dev.5) (2025-02-13)

### Bug Fixes

* **YouTube:** Remove obsolete 18.x targets ([#4454](https://github.com/ReVanced/revanced-patches/issues/4454)) ([92c38b2](92c38b2cb4))
2025-02-13 12:41:16 +00:00
LisoUseInAIKyrios
92c38b2cb4 fix(YouTube): Remove obsolete 18.x targets (#4454) 2025-02-13 14:38:23 +02:00
github-actions[bot]
4732210d4b chore: Sync translations (#4455) 2025-02-13 14:35:32 +02:00
semantic-release-bot
f30a49f1cb chore: Release v5.12.0-dev.4 [skip ci]
# [5.12.0-dev.4](https://github.com/ReVanced/revanced-patches/compare/v5.12.0-dev.3...v5.12.0-dev.4) (2025-02-11)

### Features

* **YouTube Music:** Support version `8.05.50` ([#4439](https://github.com/ReVanced/revanced-patches/issues/4439)) ([bcd157d](bcd157dd2b))
2025-02-11 18:40:51 +00:00
Alberto Ponces
bcd157dd2b feat(YouTube Music): Support version 8.05.50 (#4439) 2025-02-11 20:37:58 +02:00
LisoUseInAIKyrios
d299ea5973 chore(deps): Remove unused dependency 2025-02-11 17:41:40 +02:00
dependabot[bot]
a20021e290 chore(deps): bump com.google.code.gson:gson from 2.11.0 to 2.12.1 (#4398)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-11 17:19:52 +02:00
dependabot[bot]
373ca966f3 chore(deps): Bump com.google.guava:guava from 33.2.1-jre to 33.4.0-jre (#4252) 2025-02-11 17:17:35 +02:00
semantic-release-bot
12de922afa chore: Release v5.12.0-dev.3 [skip ci]
# [5.12.0-dev.3](https://github.com/ReVanced/revanced-patches/compare/v5.12.0-dev.2...v5.12.0-dev.3) (2025-02-11)

### Bug Fixes

* **Windy.app:** Remove obsolete `Unlock pro` patch ([#4428](https://github.com/ReVanced/revanced-patches/issues/4428)) ([421af92](421af92f4c))
2025-02-11 15:11:34 +00:00
dependabot[bot]
580bb3cf6c chore(deps-dev): bump semantic-release from 24.1.2 to 24.2.1 (#4397) 2025-02-11 17:07:28 +02:00
LisoUseInAIKyrios
421af92f4c fix(Windy.app): Remove obsolete Unlock pro patch (#4428) 2025-02-11 17:05:46 +02:00
github-actions[bot]
4d03e1b5a1 chore: Sync translations (#4446) 2025-02-11 17:05:17 +02:00
LisoUseInAIKyrios
24d68df6cd refactor: Improve XML performance 2025-02-11 15:24:29 +02:00
semantic-release-bot
e9aee17746 chore: Release v5.12.0-dev.2 [skip ci]
# [5.12.0-dev.2](https://github.com/ReVanced/revanced-patches/compare/v5.12.0-dev.1...v5.12.0-dev.2) (2025-02-11)

### Features

* **Return YouTube Dislike:** add `Show estimated likes` setting ([#4443](https://github.com/ReVanced/revanced-patches/issues/4443)) ([7c4285e](7c4285e3e6))
2025-02-11 10:15:24 +00:00
LisoUseInAIKyrios
7c4285e3e6 feat(Return YouTube Dislike): add Show estimated likes setting (#4443) 2025-02-11 12:12:24 +02:00
semantic-release-bot
e3110271a7 chore: Release v5.12.0-dev.1 [skip ci]
# [5.12.0-dev.1](https://github.com/ReVanced/revanced-patches/compare/v5.11.0...v5.12.0-dev.1) (2025-02-10)

### Features

* **YouTube - SponsorBlock:** Redesign skip buttons ([#4427](https://github.com/ReVanced/revanced-patches/issues/4427)) ([0079ece](0079eceb87))
2025-02-10 18:33:12 +00:00
MarcaD
0079eceb87 feat(YouTube - SponsorBlock): Redesign skip buttons (#4427)
Co-authored-by: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
2025-02-10 20:30:06 +02:00
github-actions[bot]
af2a97cb16 chore: Sync translations (#4436) 2025-02-10 20:29:28 +02:00
semantic-release-bot
aeb552e8f2 chore: Release v5.11.0 [skip ci]
# [5.11.0](https://github.com/ReVanced/revanced-patches/compare/v5.10.0...v5.11.0) (2025-02-07)

### Bug Fixes

* Fix broken `Remove screen capture restriction`,  `Remove screenshot restriction`, `Spoof Wi-Fi connection`, and `Export internal data documents provider` patch ([#4405](https://github.com/ReVanced/revanced-patches/issues/4405)) ([399889c](399889c6fa))
* **YouTube - Enable slide to seek:** Change patch to default include ([76fd33c](76fd33ca54))
* **YouTube - Hide layout components:** Hide new type of community post ([#4404](https://github.com/ReVanced/revanced-patches/issues/4404)) ([a06c031](a06c0318bf))
* **YouTube - Theme:** Use custom seekbar color for cairo startup animation ([#4399](https://github.com/ReVanced/revanced-patches/issues/4399)) ([f81b658](f81b658fb7))

### Features

* **YouTube - Change start page:** Add additional start pages ([#4413](https://github.com/ReVanced/revanced-patches/issues/4413)) ([b7ebfdd](b7ebfddf65))
2025-02-07 07:05:36 +00:00
LisoUseInAIKyrios
6e936fea42 chore: Merge branch dev to main (#4388) 2025-02-07 09:02:22 +02:00
github-actions[bot]
f63769f39f chore: Sync translations (#4421) 2025-02-07 08:58:04 +02:00
semantic-release-bot
1c9ab20a63 chore: Release v5.11.0-dev.2 [skip ci]
# [5.11.0-dev.2](https://github.com/ReVanced/revanced-patches/compare/v5.11.0-dev.1...v5.11.0-dev.2) (2025-02-06)

### Bug Fixes

* Fix broken `Remove screen capture restriction`,  `Remove screenshot restriction`, `Spoof Wi-Fi connection`, and `Export internal data documents provider` patch ([#4405](https://github.com/ReVanced/revanced-patches/issues/4405)) ([399889c](399889c6fa))
2025-02-06 12:29:29 +00:00
github-actions[bot]
cdeccad908 chore: Sync translations (#4417) 2025-02-06 14:25:50 +02:00
LisoUseInAIKyrios
399889c6fa fix: Fix broken Remove screen capture restriction, Remove screenshot restriction, Spoof Wi-Fi connection, and Export internal data documents provider patch (#4405) 2025-02-06 14:24:40 +02:00
github-actions[bot]
ec77861410 chore: Sync translations (#4415) 2025-02-05 20:42:07 +02:00
200 changed files with 1434 additions and 561 deletions

View File

@@ -1,3 +1,60 @@
# [5.12.0-dev.5](https://github.com/ReVanced/revanced-patches/compare/v5.12.0-dev.4...v5.12.0-dev.5) (2025-02-13)
### Bug Fixes
* **YouTube:** Remove obsolete 18.x targets ([#4454](https://github.com/ReVanced/revanced-patches/issues/4454)) ([a006758](https://github.com/ReVanced/revanced-patches/commit/a0067581d0f877e1b4eb1f888a25786f09676b2e))
# [5.12.0-dev.4](https://github.com/ReVanced/revanced-patches/compare/v5.12.0-dev.3...v5.12.0-dev.4) (2025-02-11)
### Features
* **YouTube Music:** Support version `8.05.50` ([#4439](https://github.com/ReVanced/revanced-patches/issues/4439)) ([b31fed9](https://github.com/ReVanced/revanced-patches/commit/b31fed98901fcda1bce6f05eb0de63280c689fa0))
# [5.12.0-dev.3](https://github.com/ReVanced/revanced-patches/compare/v5.12.0-dev.2...v5.12.0-dev.3) (2025-02-11)
### Bug Fixes
* **Windy.app:** Remove obsolete `Unlock pro` patch ([#4428](https://github.com/ReVanced/revanced-patches/issues/4428)) ([83d116e](https://github.com/ReVanced/revanced-patches/commit/83d116e8fd3935ee431cfdf0b8e095d04ee77259))
# [5.12.0-dev.2](https://github.com/ReVanced/revanced-patches/compare/v5.12.0-dev.1...v5.12.0-dev.2) (2025-02-11)
### Features
* **Return YouTube Dislike:** add `Show estimated likes` setting ([#4443](https://github.com/ReVanced/revanced-patches/issues/4443)) ([9a88b42](https://github.com/ReVanced/revanced-patches/commit/9a88b4239fd63d5f91105fec8e7d59d318a5d09a))
# [5.12.0-dev.1](https://github.com/ReVanced/revanced-patches/compare/v5.11.0...v5.12.0-dev.1) (2025-02-10)
### Features
* **YouTube - SponsorBlock:** Redesign skip buttons ([#4427](https://github.com/ReVanced/revanced-patches/issues/4427)) ([8f4883f](https://github.com/ReVanced/revanced-patches/commit/8f4883fc002420bfb4056401e23445c99e1d3fce))
# [5.11.0](https://github.com/ReVanced/revanced-patches/compare/v5.10.0...v5.11.0) (2025-02-07)
### Bug Fixes
* Fix broken `Remove screen capture restriction`, `Remove screenshot restriction`, `Spoof Wi-Fi connection`, and `Export internal data documents provider` patch ([#4405](https://github.com/ReVanced/revanced-patches/issues/4405)) ([1d52b74](https://github.com/ReVanced/revanced-patches/commit/1d52b7478d34e699d8c629eeaa9fdbb470b7d5c8))
* **YouTube - Enable slide to seek:** Change patch to default include ([50358cd](https://github.com/ReVanced/revanced-patches/commit/50358cddea3eef4051d248040d23f774521dce00))
* **YouTube - Hide layout components:** Hide new type of community post ([#4404](https://github.com/ReVanced/revanced-patches/issues/4404)) ([f67ab2b](https://github.com/ReVanced/revanced-patches/commit/f67ab2baf25d543ceb55fcec48bda441ebf2b998))
* **YouTube - Theme:** Use custom seekbar color for cairo startup animation ([#4399](https://github.com/ReVanced/revanced-patches/issues/4399)) ([1cba294](https://github.com/ReVanced/revanced-patches/commit/1cba2948a6787118eb380ffcec35ee4fb99447ea))
### Features
* **YouTube - Change start page:** Add additional start pages ([#4413](https://github.com/ReVanced/revanced-patches/issues/4413)) ([b434182](https://github.com/ReVanced/revanced-patches/commit/b434182df69313c4eb5f0dfd98101cb80e46ead2))
# [5.11.0-dev.2](https://github.com/ReVanced/revanced-patches/compare/v5.11.0-dev.1...v5.11.0-dev.2) (2025-02-06)
### Bug Fixes
* Fix broken `Remove screen capture restriction`, `Remove screenshot restriction`, `Spoof Wi-Fi connection`, and `Export internal data documents provider` patch ([#4405](https://github.com/ReVanced/revanced-patches/issues/4405)) ([1d52b74](https://github.com/ReVanced/revanced-patches/commit/1d52b7478d34e699d8c629eeaa9fdbb470b7d5c8))
# [5.11.0-dev.1](https://github.com/ReVanced/revanced-patches/compare/v5.10.1-dev.3...v5.11.0-dev.1) (2025-02-05) # [5.11.0-dev.1](https://github.com/ReVanced/revanced-patches/compare/v5.10.1-dev.3...v5.11.0-dev.1) (2025-02-05)

View File

@@ -1,4 +1,11 @@
android.namespace = "app.revanced.extension" android {
namespace = "app.revanced.extension"
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
}
dependencies { dependencies {
compileOnly(libs.annotation) compileOnly(libs.annotation)

View File

@@ -12,7 +12,7 @@ import android.os.Handler;
import androidx.annotation.RequiresApi; import androidx.annotation.RequiresApi;
/** @noinspection deprecation, unused */ @SuppressWarnings({"deprecation", "unused"})
public class SpoofWifiPatch { public class SpoofWifiPatch {
// Used to check what the (real or fake) active network is (take a look at `hasTransport`). // Used to check what the (real or fake) active network is (take a look at `hasTransport`).

View File

@@ -1,3 +1,16 @@
android {
namespace = "app.revanced.extension"
defaultConfig {
minSdk = 21
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
}
dependencies { dependencies {
compileOnly(libs.annotation) compileOnly(libs.annotation)
} }

View File

@@ -1,5 +1,6 @@
package app.revanced.extension.all.misc.directory.documentsprovider; package app.revanced.extension.all.misc.directory.documentsprovider;
import android.annotation.SuppressLint;
import android.content.Context; import android.content.Context;
import android.content.pm.ApplicationInfo; import android.content.pm.ApplicationInfo;
import android.content.pm.ProviderInfo; import android.content.pm.ProviderInfo;
@@ -23,6 +24,7 @@ import java.util.Objects;
/** /**
* A DocumentsProvider that allows access to the app's internal data directory. * A DocumentsProvider that allows access to the app's internal data directory.
*/ */
@SuppressLint("LongLogTag")
public class InternalDataDocumentsProvider extends DocumentsProvider { public class InternalDataDocumentsProvider extends DocumentsProvider {
private static final String[] rootColumns = private static final String[] rootColumns =
{"root_id", "mime_types", "flags", "icon", "title", "summary", "document_id"}; {"root_id", "mime_types", "flags", "icon", "title", "summary", "document_id"};

View File

@@ -1,4 +1,15 @@
android.namespace = "app.revanced.extension" android {
namespace = "app.revanced.extension"
defaultConfig {
minSdk = 21
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
}
dependencies { dependencies {
compileOnly(libs.annotation) compileOnly(libs.annotation)

View File

@@ -5,7 +5,8 @@ import android.os.Build;
import androidx.annotation.RequiresApi; import androidx.annotation.RequiresApi;
public final class RemoveScreencaptureRestrictionPatch { @SuppressWarnings("unused")
public final class RemoveScreenCaptureRestrictionPatch {
// Member of AudioAttributes.Builder // Member of AudioAttributes.Builder
@RequiresApi(api = Build.VERSION_CODES.Q) @RequiresApi(api = Build.VERSION_CODES.Q)
public static AudioAttributes.Builder setAllowedCapturePolicy(final AudioAttributes.Builder builder, final int capturePolicy) { public static AudioAttributes.Builder setAllowedCapturePolicy(final AudioAttributes.Builder builder, final int capturePolicy) {

View File

@@ -1 +1,16 @@
android.namespace = "app.revanced.extension" android {
namespace = "app.revanced.extension"
defaultConfig {
minSdk = 21
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
}
dependencies {
compileOnly(libs.annotation)
}

View File

@@ -3,6 +3,7 @@ package app.revanced.extension.all.screenshot.removerestriction;
import android.view.Window; import android.view.Window;
import android.view.WindowManager; import android.view.WindowManager;
@SuppressWarnings("unused")
public class RemoveScreenshotRestrictionPatch { public class RemoveScreenshotRestrictionPatch {
public static void addFlags(Window window, int flags) { public static void addFlags(Window window, int flags) {

View File

@@ -4,7 +4,7 @@ plugins {
android { android {
namespace = "app.revanced.extension" namespace = "app.revanced.extension"
compileSdk = 33 compileSdk = 34
defaultConfig { defaultConfig {
minSdk = 24 minSdk = 24

View File

@@ -1 +1,5 @@
// Do not remove. Necessary for the extension plugin to be applied to the project. android {
defaultConfig {
minSdk = 26
}
}

View File

@@ -4,7 +4,7 @@ plugins {
android { android {
namespace = "app.revanced.extension" namespace = "app.revanced.extension"
compileSdk = 33 compileSdk = 34
defaultConfig { defaultConfig {
minSdk = 24 minSdk = 24

View File

@@ -4,7 +4,7 @@ plugins {
android { android {
namespace = "app.revanced.extension" namespace = "app.revanced.extension"
compileSdk = 33 compileSdk = 34
defaultConfig { defaultConfig {
minSdk = 24 minSdk = 24

View File

@@ -3,3 +3,14 @@ dependencies {
compileOnly(project(":extensions:tiktok:stub")) compileOnly(project(":extensions:tiktok:stub"))
compileOnly(libs.annotation) compileOnly(libs.annotation)
} }
android {
defaultConfig {
minSdk = 22
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
}

View File

@@ -21,9 +21,11 @@ public class ReVancedPreferenceFragment extends AbstractPreferenceFragment {
protected void syncSettingWithPreference(@NonNull Preference pref, protected void syncSettingWithPreference(@NonNull Preference pref,
@NonNull Setting<?> setting, @NonNull Setting<?> setting,
boolean applySettingToPreference) { boolean applySettingToPreference) {
if (pref instanceof RangeValuePreference rangeValuePref) { if (pref instanceof RangeValuePreference) {
RangeValuePreference rangeValuePref = (RangeValuePreference) pref;
Setting.privateSetValueFromString(setting, rangeValuePref.getValue()); Setting.privateSetValueFromString(setting, rangeValuePref.getValue());
} else if (pref instanceof DownloadPathPreference downloadPathPref) { } else if (pref instanceof DownloadPathPreference) {
DownloadPathPreference downloadPathPref = (DownloadPathPreference) pref;
Setting.privateSetValueFromString(setting, downloadPathPref.getValue()); Setting.privateSetValueFromString(setting, downloadPathPref.getValue());
} else { } else {
super.syncSettingWithPreference(pref, setting, applySettingToPreference); super.syncSettingWithPreference(pref, setting, applySettingToPreference);
@@ -32,7 +34,7 @@ public class ReVancedPreferenceFragment extends AbstractPreferenceFragment {
@Override @Override
protected void initialize() { protected void initialize() {
final var context = getContext(); final var context = getActivity();
// 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.

View File

@@ -4,14 +4,9 @@ plugins {
android { android {
namespace = "app.revanced.extension" namespace = "app.revanced.extension"
compileSdk = 33 compileSdk = 34
defaultConfig { defaultConfig {
minSdk = 24 minSdk = 22
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
} }
} }

View File

@@ -1,3 +1,9 @@
dependencies { dependencies {
compileOnly(project(":extensions:tumblr:stub")) compileOnly(project(":extensions:tumblr:stub"))
} }
android {
defaultConfig {
minSdk = 26
}
}

View File

@@ -1,17 +1,14 @@
android.namespace = "app.revanced.extension"
plugins { plugins {
id(libs.plugins.android.library.get().pluginId) id(libs.plugins.android.library.get().pluginId)
} }
android { android {
namespace = "app.revanced.extension" namespace = "app.revanced.extension"
compileSdk = 33 compileSdk = 34
defaultConfig { defaultConfig {
minSdk = 24 minSdk = 26
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
} }
} }

View File

@@ -6,3 +6,14 @@ dependencies {
compileOnly(libs.annotation) compileOnly(libs.annotation)
compileOnly(libs.appcompat) compileOnly(libs.appcompat)
} }
android {
defaultConfig {
minSdk = 21
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
}

View File

@@ -4,14 +4,9 @@ plugins {
android { android {
namespace = "app.revanced.extension" namespace = "app.revanced.extension"
compileSdk = 33 compileSdk = 34
defaultConfig { defaultConfig {
minSdk = 24 minSdk = 21
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
} }
} }

View File

@@ -1,8 +1,13 @@
//noinspection GradleDependency
android.compileSdk = 33
dependencies { dependencies {
compileOnly(project(":extensions:shared:library")) compileOnly(project(":extensions:shared:library"))
compileOnly(project(":extensions:youtube:stub")) compileOnly(project(":extensions:youtube:stub"))
compileOnly(libs.annotation) compileOnly(libs.annotation)
} }
android {
compileSdk = 33 // TODO: Update Swipe controls code to allow updating this to the latest sdk.
defaultConfig {
minSdk = 26
}
}

View File

@@ -4,7 +4,6 @@ import static app.revanced.extension.youtube.returnyoutubedislike.ReturnYouTubeD
import android.graphics.Rect; import android.graphics.Rect;
import android.graphics.drawable.ShapeDrawable; import android.graphics.drawable.ShapeDrawable;
import android.os.Build;
import android.text.Spannable; import android.text.Spannable;
import android.text.SpannableString; import android.text.SpannableString;
import android.text.Spanned; import android.text.Spanned;
@@ -366,9 +365,7 @@ public class ReturnYouTubeDislikePatch {
private static final List<WeakReference<TextView>> shortsTextViewRefs = new ArrayList<>(); private static final List<WeakReference<TextView>> shortsTextViewRefs = new ArrayList<>();
private static void clearRemovedShortsTextViews() { private static void clearRemovedShortsTextViews() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { // YouTube requires Android N or greater shortsTextViewRefs.removeIf(ref -> ref.get() == null);
shortsTextViewRefs.removeIf(ref -> ref.get() == null);
}
} }
/** /**

View File

@@ -234,6 +234,12 @@ public class ReturnYouTubeDislike {
// example video: https://www.youtube.com/watch?v=UnrU5vxCHxw // example video: https://www.youtube.com/watch?v=UnrU5vxCHxw
// RYD data: https://returnyoutubedislikeapi.com/votes?videoId=UnrU5vxCHxw // RYD data: https://returnyoutubedislikeapi.com/votes?videoId=UnrU5vxCHxw
// //
if (!Settings.RYD_ESTIMATED_LIKE.get()) {
// Change the "Likes" string to show that likes and dislikes are hidden.
String hiddenMessageString = str("revanced_ryd_video_likes_hidden_by_video_owner");
return newSpanUsingStylingOfAnotherSpan(oldSpannable, hiddenMessageString);
}
Logger.printDebug(() -> "Using estimated likes"); Logger.printDebug(() -> "Using estimated likes");
oldLikes = formatDislikeCount(voteData.getLikeCount()); oldLikes = formatDislikeCount(voteData.getLikeCount());
} }
@@ -346,56 +352,49 @@ public class ReturnYouTubeDislike {
} }
private static String formatDislikeCount(long dislikeCount) { private static String formatDislikeCount(long dislikeCount) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { synchronized (ReturnYouTubeDislike.class) { // number formatter is not thread safe, must synchronize
synchronized (ReturnYouTubeDislike.class) { // number formatter is not thread safe, must synchronize if (dislikeCountFormatter == null) {
if (dislikeCountFormatter == null) { Locale locale = Objects.requireNonNull(Utils.getContext()).getResources().getConfiguration().locale;
Locale locale = Objects.requireNonNull(Utils.getContext()).getResources().getConfiguration().locale; dislikeCountFormatter = CompactDecimalFormat.getInstance(locale, CompactDecimalFormat.CompactStyle.SHORT);
dislikeCountFormatter = CompactDecimalFormat.getInstance(locale, CompactDecimalFormat.CompactStyle.SHORT);
// YouTube disregards locale specific number characters // YouTube disregards locale specific number characters
// and instead shows english number characters everywhere. // and instead shows english number characters everywhere.
// To use the same behavior, override the digit characters to use English // To use the same behavior, override the digit characters to use English
// so languages such as Arabic will show "1.234" instead of the native "۱,۲۳٤" // so languages such as Arabic will show "1.234" instead of the native "۱,۲۳٤"
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
DecimalFormatSymbols symbols = DecimalFormatSymbols.getInstance(locale); DecimalFormatSymbols symbols = DecimalFormatSymbols.getInstance(locale);
symbols.setDigitStrings(DecimalFormatSymbols.getInstance(Locale.ENGLISH).getDigitStrings()); symbols.setDigitStrings(DecimalFormatSymbols.getInstance(Locale.ENGLISH).getDigitStrings());
dislikeCountFormatter.setDecimalFormatSymbols(symbols); dislikeCountFormatter.setDecimalFormatSymbols(symbols);
}
} }
return dislikeCountFormatter.format(dislikeCount);
} }
}
// Will never be reached, as the oldest supported YouTube app requires Android N or greater. return dislikeCountFormatter.format(dislikeCount);
return String.valueOf(dislikeCount); }
} }
private static String formatDislikePercentage(float dislikePercentage) { private static String formatDislikePercentage(float dislikePercentage) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { synchronized (ReturnYouTubeDislike.class) { // Number formatter is not thread safe, must synchronize.
synchronized (ReturnYouTubeDislike.class) { // number formatter is not thread safe, must synchronize if (dislikePercentageFormatter == null) {
if (dislikePercentageFormatter == null) { Locale locale = Objects.requireNonNull(Utils.getContext()).getResources().getConfiguration().locale;
Locale locale = Objects.requireNonNull(Utils.getContext()).getResources().getConfiguration().locale; dislikePercentageFormatter = NumberFormat.getPercentInstance(locale);
dislikePercentageFormatter = NumberFormat.getPercentInstance(locale);
// Want to set the digit strings, and the simplest way is to cast to the implementation NumberFormat returns. // Want to set the digit strings, and the simplest way is to cast to the implementation NumberFormat returns.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P
&& dislikePercentageFormatter instanceof DecimalFormat) { && dislikePercentageFormatter instanceof DecimalFormat) {
DecimalFormatSymbols symbols = DecimalFormatSymbols.getInstance(locale); DecimalFormatSymbols symbols = DecimalFormatSymbols.getInstance(locale);
symbols.setDigitStrings(DecimalFormatSymbols.getInstance(Locale.ENGLISH).getDigitStrings()); symbols.setDigitStrings(DecimalFormatSymbols.getInstance(Locale.ENGLISH).getDigitStrings());
((DecimalFormat) dislikePercentageFormatter).setDecimalFormatSymbols(symbols); ((DecimalFormat) dislikePercentageFormatter).setDecimalFormatSymbols(symbols);
}
} }
if (dislikePercentage >= 0.01) { // at least 1%
dislikePercentageFormatter.setMaximumFractionDigits(0); // show only whole percentage points
} else {
dislikePercentageFormatter.setMaximumFractionDigits(1); // show up to 1 digit precision
}
return dislikePercentageFormatter.format(dislikePercentage);
} }
}
// Will never be reached, as the oldest supported YouTube app requires Android N or greater. if (dislikePercentage >= 0.01) { // at least 1%
return String.valueOf((int) (dislikePercentage * 100)); dislikePercentageFormatter.setMaximumFractionDigits(0); // show only whole percentage points
} else {
dislikePercentageFormatter.setMaximumFractionDigits(1); // show up to 1 digit precision
}
return dislikePercentageFormatter.format(dislikePercentage);
}
} }
@NonNull @NonNull
@@ -403,15 +402,13 @@ public class ReturnYouTubeDislike {
Objects.requireNonNull(videoId); Objects.requireNonNull(videoId);
synchronized (fetchCache) { synchronized (fetchCache) {
// Remove any expired entries. // Remove any expired entries.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { final long now = System.currentTimeMillis();
final long now = System.currentTimeMillis(); fetchCache.values().removeIf(value -> {
fetchCache.values().removeIf(value -> { final boolean expired = value.isExpired(now);
final boolean expired = value.isExpired(now); if (expired)
if (expired) Logger.printDebug(() -> "Removing expired fetch: " + value.videoId);
Logger.printDebug(() -> "Removing expired fetch: " + value.videoId); return expired;
return expired; });
});
}
ReturnYouTubeDislike fetch = fetchCache.get(videoId); ReturnYouTubeDislike fetch = fetchCache.get(videoId);
if (fetch == null) { if (fetch == null) {
@@ -551,6 +548,15 @@ public class ReturnYouTubeDislike {
} }
if (spanIsForLikes) { if (spanIsForLikes) {
if (!Utils.containsNumber(original)) {
if (!Settings.RYD_ESTIMATED_LIKE.get()) {
Logger.printDebug(() -> "Likes are hidden");
return original;
} else {
Logger.printDebug(() -> "Using estimated likes");
}
}
// Scrolling Shorts does not cause the Spans to be reloaded, // Scrolling Shorts does not cause the Spans to be reloaded,
// so there is no need to cache the likes for this situations. // so there is no need to cache the likes for this situations.
Logger.printDebug(() -> "Creating likes span for: " + votingData.videoId); Logger.printDebug(() -> "Creating likes span for: " + votingData.videoId);

View File

@@ -333,6 +333,7 @@ public class Settings extends BaseSettings {
public static final BooleanSetting RYD_SHORTS = new BooleanSetting("ryd_shorts", TRUE, parent(RYD_ENABLED)); public static final BooleanSetting RYD_SHORTS = new BooleanSetting("ryd_shorts", TRUE, parent(RYD_ENABLED));
public static final BooleanSetting RYD_DISLIKE_PERCENTAGE = new BooleanSetting("ryd_dislike_percentage", FALSE, parent(RYD_ENABLED)); public static final BooleanSetting RYD_DISLIKE_PERCENTAGE = new BooleanSetting("ryd_dislike_percentage", FALSE, parent(RYD_ENABLED));
public static final BooleanSetting RYD_COMPACT_LAYOUT = new BooleanSetting("ryd_compact_layout", FALSE, parent(RYD_ENABLED)); public static final BooleanSetting RYD_COMPACT_LAYOUT = new BooleanSetting("ryd_compact_layout", FALSE, parent(RYD_ENABLED));
public static final BooleanSetting RYD_ESTIMATED_LIKE = new BooleanSetting("ryd_estimated_like", TRUE, parent(RYD_ENABLED));
public static final BooleanSetting RYD_TOAST_ON_CONNECTION_ERROR = new BooleanSetting("ryd_toast_on_connection_error", TRUE, parent(RYD_ENABLED)); public static final BooleanSetting RYD_TOAST_ON_CONNECTION_ERROR = new BooleanSetting("ryd_toast_on_connection_error", TRUE, parent(RYD_ENABLED));
// SponsorBlock // SponsorBlock
@@ -344,13 +345,14 @@ public class Settings extends BaseSettings {
public static final IntegerSetting SB_CREATE_NEW_SEGMENT_STEP = new IntegerSetting("sb_create_new_segment_step", 150, parent(SB_ENABLED)); public static final IntegerSetting SB_CREATE_NEW_SEGMENT_STEP = new IntegerSetting("sb_create_new_segment_step", 150, parent(SB_ENABLED));
public static final BooleanSetting SB_VOTING_BUTTON = new BooleanSetting("sb_voting_button", FALSE, parent(SB_ENABLED)); public static final BooleanSetting SB_VOTING_BUTTON = new BooleanSetting("sb_voting_button", FALSE, parent(SB_ENABLED));
public static final BooleanSetting SB_CREATE_NEW_SEGMENT = new BooleanSetting("sb_create_new_segment", FALSE, parent(SB_ENABLED)); public static final BooleanSetting SB_CREATE_NEW_SEGMENT = new BooleanSetting("sb_create_new_segment", FALSE, parent(SB_ENABLED));
public static final BooleanSetting SB_SQUARE_LAYOUT = new BooleanSetting("sb_square_layout", FALSE, parent(SB_ENABLED));
public static final BooleanSetting SB_COMPACT_SKIP_BUTTON = new BooleanSetting("sb_compact_skip_button", FALSE, parent(SB_ENABLED)); public static final BooleanSetting SB_COMPACT_SKIP_BUTTON = new BooleanSetting("sb_compact_skip_button", FALSE, parent(SB_ENABLED));
public static final BooleanSetting SB_AUTO_HIDE_SKIP_BUTTON = new BooleanSetting("sb_auto_hide_skip_button", TRUE, parent(SB_ENABLED)); public static final BooleanSetting SB_AUTO_HIDE_SKIP_BUTTON = new BooleanSetting("sb_auto_hide_skip_button", TRUE, parent(SB_ENABLED));
public static final BooleanSetting SB_TOAST_ON_SKIP = new BooleanSetting("sb_toast_on_skip", TRUE, parent(SB_ENABLED)); public static final BooleanSetting SB_TOAST_ON_SKIP = new BooleanSetting("sb_toast_on_skip", TRUE, parent(SB_ENABLED));
public static final BooleanSetting SB_TOAST_ON_CONNECTION_ERROR = new BooleanSetting("sb_toast_on_connection_error", TRUE, parent(SB_ENABLED)); public static final BooleanSetting SB_TOAST_ON_CONNECTION_ERROR = new BooleanSetting("sb_toast_on_connection_error", TRUE, parent(SB_ENABLED));
public static final BooleanSetting SB_TRACK_SKIP_COUNT = new BooleanSetting("sb_track_skip_count", TRUE, parent(SB_ENABLED)); public static final BooleanSetting SB_TRACK_SKIP_COUNT = new BooleanSetting("sb_track_skip_count", TRUE, parent(SB_ENABLED));
public static final FloatSetting SB_SEGMENT_MIN_DURATION = new FloatSetting("sb_min_segment_duration", 0F, parent(SB_ENABLED)); public static final FloatSetting SB_SEGMENT_MIN_DURATION = new FloatSetting("sb_min_segment_duration", 0F, parent(SB_ENABLED));
public static final BooleanSetting SB_VIDEO_LENGTH_WITHOUT_SEGMENTS = new BooleanSetting("sb_video_length_without_segments", TRUE, parent(SB_ENABLED)); public static final BooleanSetting SB_VIDEO_LENGTH_WITHOUT_SEGMENTS = new BooleanSetting("sb_video_length_without_segments", FALSE, parent(SB_ENABLED));
public static final StringSetting SB_API_URL = new StringSetting("sb_api_url", "https://sponsor.ajay.app"); public static final StringSetting SB_API_URL = new StringSetting("sb_api_url", "https://sponsor.ajay.app");
public static final BooleanSetting SB_USER_IS_VIP = new BooleanSetting("sb_user_is_vip", FALSE); public static final BooleanSetting SB_USER_IS_VIP = new BooleanSetting("sb_user_is_vip", FALSE);
public static final IntegerSetting SB_LOCAL_TIME_SAVED_NUMBER_SEGMENTS = new IntegerSetting("sb_local_time_saved_number_segments", 0); public static final IntegerSetting SB_LOCAL_TIME_SAVED_NUMBER_SEGMENTS = new IntegerSetting("sb_local_time_saved_number_segments", 0);

View File

@@ -153,13 +153,10 @@ public class ReVancedPreferenceFragment extends AbstractPreferenceFragment {
toolbar.setTitle(childScreen.getTitle()); toolbar.setTitle(childScreen.getTitle());
toolbar.setNavigationIcon(getBackButtonDrawable()); toolbar.setNavigationIcon(getBackButtonDrawable());
toolbar.setNavigationOnClickListener(view -> preferenceScreenDialog.dismiss()); toolbar.setNavigationOnClickListener(view -> preferenceScreenDialog.dismiss());
final int margin = (int) TypedValue.applyDimension(
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { TypedValue.COMPLEX_UNIT_DIP, 16, getResources().getDisplayMetrics()
final int margin = (int) TypedValue.applyDimension( );
TypedValue.COMPLEX_UNIT_DIP, 16, getResources().getDisplayMetrics() toolbar.setTitleMargin(margin, 0, margin, 0);
);
toolbar.setTitleMargin(margin, 0, margin, 0);
}
TextView toolbarTextView = Utils.getChildView(toolbar, TextView toolbarTextView = Utils.getChildView(toolbar,
true, TextView.class::isInstance); true, TextView.class::isInstance);

View File

@@ -39,6 +39,11 @@ public class ReturnYouTubeDislikePreferenceFragment extends PreferenceFragment {
*/ */
private SwitchPreference compactLayoutPreference; private SwitchPreference compactLayoutPreference;
/**
* If hidden likes are replaced with an estimated value.
*/
private SwitchPreference estimatedLikesPreference;
/** /**
* If segmented like/dislike button uses smaller compact layout. * If segmented like/dislike button uses smaller compact layout.
*/ */
@@ -48,6 +53,7 @@ public class ReturnYouTubeDislikePreferenceFragment extends PreferenceFragment {
shortsPreference.setEnabled(Settings.RYD_SHORTS.isAvailable()); shortsPreference.setEnabled(Settings.RYD_SHORTS.isAvailable());
percentagePreference.setEnabled(Settings.RYD_DISLIKE_PERCENTAGE.isAvailable()); percentagePreference.setEnabled(Settings.RYD_DISLIKE_PERCENTAGE.isAvailable());
compactLayoutPreference.setEnabled(Settings.RYD_COMPACT_LAYOUT.isAvailable()); compactLayoutPreference.setEnabled(Settings.RYD_COMPACT_LAYOUT.isAvailable());
estimatedLikesPreference.setEnabled(Settings.RYD_ESTIMATED_LIKE.isAvailable());
toastOnRYDNotAvailable.setEnabled(Settings.RYD_TOAST_ON_CONNECTION_ERROR.isAvailable()); toastOnRYDNotAvailable.setEnabled(Settings.RYD_TOAST_ON_CONNECTION_ERROR.isAvailable());
} }
@@ -117,6 +123,19 @@ public class ReturnYouTubeDislikePreferenceFragment extends PreferenceFragment {
}); });
preferenceScreen.addPreference(compactLayoutPreference); preferenceScreen.addPreference(compactLayoutPreference);
estimatedLikesPreference = new SwitchPreference(context);
estimatedLikesPreference.setChecked(Settings.RYD_ESTIMATED_LIKE.get());
estimatedLikesPreference.setTitle(str("revanced_ryd_estimated_like_title"));
estimatedLikesPreference.setSummaryOn(str("revanced_ryd_estimated_like_summary_on"));
estimatedLikesPreference.setSummaryOff(str("revanced_ryd_estimated_like_summary_off"));
estimatedLikesPreference.setOnPreferenceChangeListener((pref, newValue) -> {
Settings.RYD_ESTIMATED_LIKE.save((Boolean) newValue);
ReturnYouTubeDislike.clearAllUICaches();
updateUIState();
return true;
});
preferenceScreen.addPreference(estimatedLikesPreference);
toastOnRYDNotAvailable = new SwitchPreference(context); toastOnRYDNotAvailable = new SwitchPreference(context);
toastOnRYDNotAvailable.setChecked(Settings.RYD_TOAST_ON_CONNECTION_ERROR.get()); toastOnRYDNotAvailable.setChecked(Settings.RYD_TOAST_ON_CONNECTION_ERROR.get());
toastOnRYDNotAvailable.setTitle(str("revanced_ryd_toast_on_connection_error_title")); toastOnRYDNotAvailable.setTitle(str("revanced_ryd_toast_on_connection_error_title"));

View File

@@ -6,7 +6,6 @@ import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.net.Uri; import android.net.Uri;
import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.preference.*; import android.preference.*;
import android.text.Html; import android.text.Html;
@@ -37,8 +36,9 @@ public class SponsorBlockPreferenceFragment extends PreferenceFragment {
private SwitchPreference sbEnabled; private SwitchPreference sbEnabled;
private SwitchPreference addNewSegment; private SwitchPreference addNewSegment;
private SwitchPreference votingEnabled; private SwitchPreference votingEnabled;
private SwitchPreference compactSkipButton;
private SwitchPreference autoHideSkipSegmentButton; private SwitchPreference autoHideSkipSegmentButton;
private SwitchPreference compactSkipButton;
private SwitchPreference squareLayout;
private SwitchPreference showSkipToast; private SwitchPreference showSkipToast;
private SwitchPreference trackSkips; private SwitchPreference trackSkips;
private SwitchPreference showTimeWithoutSegments; private SwitchPreference showTimeWithoutSegments;
@@ -62,7 +62,9 @@ public class SponsorBlockPreferenceFragment extends PreferenceFragment {
} else if (!Settings.SB_CREATE_NEW_SEGMENT.get()) { } else if (!Settings.SB_CREATE_NEW_SEGMENT.get()) {
SponsorBlockViewController.hideNewSegmentLayout(); SponsorBlockViewController.hideNewSegmentLayout();
} }
// Voting and add new segment buttons automatically shows/hide themselves. // Voting and add new segment buttons automatically show/hide themselves.
SponsorBlockViewController.updateLayout();
sbEnabled.setChecked(enabled); sbEnabled.setChecked(enabled);
@@ -72,11 +74,14 @@ public class SponsorBlockPreferenceFragment extends PreferenceFragment {
votingEnabled.setChecked(Settings.SB_VOTING_BUTTON.get()); votingEnabled.setChecked(Settings.SB_VOTING_BUTTON.get());
votingEnabled.setEnabled(enabled); votingEnabled.setEnabled(enabled);
autoHideSkipSegmentButton.setEnabled(enabled);
autoHideSkipSegmentButton.setChecked(Settings.SB_AUTO_HIDE_SKIP_BUTTON.get());
compactSkipButton.setChecked(Settings.SB_COMPACT_SKIP_BUTTON.get()); compactSkipButton.setChecked(Settings.SB_COMPACT_SKIP_BUTTON.get());
compactSkipButton.setEnabled(enabled); compactSkipButton.setEnabled(enabled);
autoHideSkipSegmentButton.setChecked(Settings.SB_AUTO_HIDE_SKIP_BUTTON.get()); squareLayout.setChecked(Settings.SB_SQUARE_LAYOUT.get());
autoHideSkipSegmentButton.setEnabled(enabled); squareLayout.setEnabled(enabled);
showSkipToast.setChecked(Settings.SB_TOAST_ON_SKIP.get()); showSkipToast.setChecked(Settings.SB_TOAST_ON_SKIP.get());
showSkipToast.setEnabled(enabled); showSkipToast.setEnabled(enabled);
@@ -176,6 +181,17 @@ public class SponsorBlockPreferenceFragment extends PreferenceFragment {
return true; return true;
}); });
autoHideSkipSegmentButton = new SwitchPreference(context);
autoHideSkipSegmentButton.setTitle(str("revanced_sb_enable_auto_hide_skip_segment_button"));
autoHideSkipSegmentButton.setSummaryOn(str("revanced_sb_enable_auto_hide_skip_segment_button_sum_on"));
autoHideSkipSegmentButton.setSummaryOff(str("revanced_sb_enable_auto_hide_skip_segment_button_sum_off"));
category.addPreference(autoHideSkipSegmentButton);
autoHideSkipSegmentButton.setOnPreferenceChangeListener((preference1, newValue) -> {
Settings.SB_AUTO_HIDE_SKIP_BUTTON.save((Boolean) newValue);
updateUI();
return true;
});
compactSkipButton = new SwitchPreference(context); compactSkipButton = new SwitchPreference(context);
compactSkipButton.setTitle(str("revanced_sb_enable_compact_skip_button")); compactSkipButton.setTitle(str("revanced_sb_enable_compact_skip_button"));
compactSkipButton.setSummaryOn(str("revanced_sb_enable_compact_skip_button_sum_on")); compactSkipButton.setSummaryOn(str("revanced_sb_enable_compact_skip_button_sum_on"));
@@ -187,13 +203,13 @@ public class SponsorBlockPreferenceFragment extends PreferenceFragment {
return true; return true;
}); });
autoHideSkipSegmentButton = new SwitchPreference(context); squareLayout = new SwitchPreference(context);
autoHideSkipSegmentButton.setTitle(str("revanced_sb_enable_auto_hide_skip_segment_button")); squareLayout.setTitle(str("revanced_sb_square_layout"));
autoHideSkipSegmentButton.setSummaryOn(str("revanced_sb_enable_auto_hide_skip_segment_button_sum_on")); squareLayout.setSummaryOn(str("revanced_sb_square_layout_sum_on"));
autoHideSkipSegmentButton.setSummaryOff(str("revanced_sb_enable_auto_hide_skip_segment_button_sum_off")); squareLayout.setSummaryOff(str("revanced_sb_square_layout_sum_off"));
category.addPreference(autoHideSkipSegmentButton); category.addPreference(squareLayout);
autoHideSkipSegmentButton.setOnPreferenceChangeListener((preference1, newValue) -> { squareLayout.setOnPreferenceChangeListener((preference1, newValue) -> {
Settings.SB_AUTO_HIDE_SKIP_BUTTON.save((Boolean) newValue); Settings.SB_SQUARE_LAYOUT.save((Boolean) newValue);
updateUI(); updateUI();
return true; return true;
}); });
@@ -393,9 +409,7 @@ public class SponsorBlockPreferenceFragment extends PreferenceFragment {
importExport.getEditText().setInputType(InputType.TYPE_CLASS_TEXT importExport.getEditText().setInputType(InputType.TYPE_CLASS_TEXT
| InputType.TYPE_TEXT_FLAG_MULTI_LINE | InputType.TYPE_TEXT_FLAG_MULTI_LINE
| InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS); | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { importExport.getEditText().setAutofillHints((String) null);
importExport.getEditText().setAutofillHints((String) null);
}
importExport.getEditText().setTextSize(TypedValue.COMPLEX_UNIT_PT, 8); importExport.getEditText().setTextSize(TypedValue.COMPLEX_UNIT_PT, 8);
importExport.setOnPreferenceClickListener(preference1 -> { importExport.setOnPreferenceClickListener(preference1 -> {
importExport.getEditText().setText(SponsorBlockSettings.exportDesktopSettings()); importExport.getEditText().setText(SponsorBlockSettings.exportDesktopSettings());

View File

@@ -2,10 +2,11 @@ package app.revanced.extension.youtube.sponsorblock.ui;
import android.content.Context; import android.content.Context;
import android.content.res.ColorStateList; import android.content.res.ColorStateList;
import android.graphics.drawable.GradientDrawable;
import android.graphics.drawable.RippleDrawable; import android.graphics.drawable.RippleDrawable;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.util.TypedValue;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.ViewGroup;
import android.widget.FrameLayout; import android.widget.FrameLayout;
import android.widget.ImageButton; import android.widget.ImageButton;
@@ -14,15 +15,15 @@ import app.revanced.extension.youtube.settings.Settings;
import app.revanced.extension.youtube.sponsorblock.SponsorBlockUtils; import app.revanced.extension.youtube.sponsorblock.SponsorBlockUtils;
import app.revanced.extension.shared.Logger; import app.revanced.extension.shared.Logger;
import static app.revanced.extension.shared.Utils.getResourceColor;
import static app.revanced.extension.shared.Utils.getResourceDimensionPixelSize; import static app.revanced.extension.shared.Utils.getResourceDimensionPixelSize;
import static app.revanced.extension.shared.Utils.getResourceIdentifier; import static app.revanced.extension.shared.Utils.getResourceIdentifier;
public final class NewSegmentLayout extends FrameLayout { public final class NewSegmentLayout extends FrameLayout {
private static final ColorStateList rippleColorStateList = new ColorStateList( private static final ColorStateList rippleColorStateList = new ColorStateList(
new int[][]{new int[]{android.R.attr.state_enabled}}, new int[][]{new int[]{android.R.attr.state_enabled}},
new int[]{0x33ffffff} // sets the ripple color to white new int[]{0x33ffffff} // Ripple effect color (semi-transparent white)
); );
private final int rippleEffectId;
final int defaultBottomMargin; final int defaultBottomMargin;
final int ctaBottomMargin; final int ctaBottomMargin;
@@ -47,10 +48,6 @@ public final class NewSegmentLayout extends FrameLayout {
getResourceIdentifier(context, "revanced_sb_new_segment", "layout"), this, true getResourceIdentifier(context, "revanced_sb_new_segment", "layout"), this, true
); );
TypedValue rippleEffect = new TypedValue();
context.getTheme().resolveAttribute(android.R.attr.selectableItemBackground, rippleEffect, true);
rippleEffectId = rippleEffect.resourceId;
initializeButton( initializeButton(
context, context,
"revanced_sb_new_segment_rewind", "revanced_sb_new_segment_rewind",
@@ -120,6 +117,28 @@ public final class NewSegmentLayout extends FrameLayout {
}); });
} }
/**
* Update the layout of this UI control.
*/
public void updateLayout() {
final boolean squareLayout = Settings.SB_SQUARE_LAYOUT.get();
ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) getLayoutParams();
final int margin = squareLayout
? 0
: SponsorBlockViewController.ROUNDED_LAYOUT_MARGIN;
params.setMarginStart(margin);
setLayoutParams(params);
GradientDrawable backgroundDrawable = new GradientDrawable();
backgroundDrawable.setColor(getResourceColor("skip_ad_button_background_color"));
final float cornerRadius = squareLayout
? 0
: 16 * getResources().getDisplayMetrics().density;
backgroundDrawable.setCornerRadius(cornerRadius);
setBackground(backgroundDrawable);
}
@FunctionalInterface @FunctionalInterface
private interface ButtonOnClickHandlerFunction { private interface ButtonOnClickHandlerFunction {
void apply(); void apply();

View File

@@ -8,6 +8,7 @@ import static app.revanced.extension.shared.Utils.getResourceIdentifier;
import android.content.Context; import android.content.Context;
import android.graphics.Canvas; import android.graphics.Canvas;
import android.graphics.Paint; import android.graphics.Paint;
import android.graphics.RectF;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
@@ -19,11 +20,19 @@ import androidx.annotation.NonNull;
import java.util.Objects; import java.util.Objects;
import app.revanced.extension.youtube.settings.Settings;
import app.revanced.extension.youtube.sponsorblock.SegmentPlaybackController; import app.revanced.extension.youtube.sponsorblock.SegmentPlaybackController;
import app.revanced.extension.youtube.sponsorblock.objects.SponsorSegment; import app.revanced.extension.youtube.sponsorblock.objects.SponsorSegment;
public class SkipSponsorButton extends FrameLayout { public class SkipSponsorButton extends FrameLayout {
private static final boolean highContrast = true; /**
* Adds a high contrast border around the skip button.
*
* This feature is not currently used.
* If this is added, it needs an additional button width change because
* as-is the skip button text is clipped when this is on.
*/
private static final boolean highContrast = false;
private final LinearLayout skipSponsorBtnContainer; private final LinearLayout skipSponsorBtnContainer;
private final TextView skipSponsorTextView; private final TextView skipSponsorTextView;
private final Paint background; private final Paint background;
@@ -49,18 +58,23 @@ public class SkipSponsorButton extends FrameLayout {
LayoutInflater.from(context).inflate(getResourceIdentifier(context, "revanced_sb_skip_sponsor_button", "layout"), this, true); // layout:skip_ad_button LayoutInflater.from(context).inflate(getResourceIdentifier(context, "revanced_sb_skip_sponsor_button", "layout"), this, true); // layout:skip_ad_button
setMinimumHeight(getResourceDimensionPixelSize("ad_skip_ad_button_min_height")); // dimen:ad_skip_ad_button_min_height setMinimumHeight(getResourceDimensionPixelSize("ad_skip_ad_button_min_height")); // dimen:ad_skip_ad_button_min_height
skipSponsorBtnContainer = Objects.requireNonNull((LinearLayout) findViewById(getResourceIdentifier(context, "revanced_sb_skip_sponsor_button_container", "id"))); // id:skip_ad_button_container skipSponsorBtnContainer = Objects.requireNonNull(findViewById(getResourceIdentifier(context, "revanced_sb_skip_sponsor_button_container", "id"))); // id:skip_ad_button_container
background = new Paint(); background = new Paint();
background.setColor(getResourceColor("skip_ad_button_background_color")); // color:skip_ad_button_background_color); background.setColor(getResourceColor("skip_ad_button_background_color")); // color:skip_ad_button_background_color);
background.setStyle(Paint.Style.FILL); background.setStyle(Paint.Style.FILL);
border = new Paint(); border = new Paint();
border.setColor(getResourceColor("skip_ad_button_border_color")); // color:skip_ad_button_border_color); border.setColor(getResourceColor("skip_ad_button_border_color")); // color:skip_ad_button_border_color);
border.setStrokeWidth(getResourceDimension("ad_skip_ad_button_border_width")); // dimen:ad_skip_ad_button_border_width); border.setStrokeWidth(getResourceDimension("ad_skip_ad_button_border_width")); // dimen:ad_skip_ad_button_border_width);
border.setStyle(Paint.Style.STROKE); border.setStyle(Paint.Style.STROKE);
skipSponsorTextView = Objects.requireNonNull((TextView) findViewById(getResourceIdentifier(context, "revanced_sb_skip_sponsor_button_text", "id"))); // id:skip_ad_button_text;
skipSponsorTextView = Objects.requireNonNull(findViewById(getResourceIdentifier(context, "revanced_sb_skip_sponsor_button_text", "id"))); // id:skip_ad_button_text;
defaultBottomMargin = getResourceDimensionPixelSize("skip_button_default_bottom_margin"); // dimen:skip_button_default_bottom_margin defaultBottomMargin = getResourceDimensionPixelSize("skip_button_default_bottom_margin"); // dimen:skip_button_default_bottom_margin
ctaBottomMargin = getResourceDimensionPixelSize("skip_button_cta_bottom_margin"); // dimen:skip_button_cta_bottom_margin ctaBottomMargin = getResourceDimensionPixelSize("skip_button_cta_bottom_margin"); // dimen:skip_button_cta_bottom_margin
updateLayout();
skipSponsorBtnContainer.setOnClickListener(v -> { skipSponsorBtnContainer.setOnClickListener(v -> {
// The view controller handles hiding this button, but hide it here as well just in case something goofs. // The view controller handles hiding this button, but hide it here as well just in case something goofs.
setVisibility(View.GONE); setVisibility(View.GONE);
@@ -72,30 +86,56 @@ public class SkipSponsorButton extends FrameLayout {
protected final void dispatchDraw(Canvas canvas) { protected final void dispatchDraw(Canvas canvas) {
final int left = skipSponsorBtnContainer.getLeft(); final int left = skipSponsorBtnContainer.getLeft();
final int top = skipSponsorBtnContainer.getTop(); final int top = skipSponsorBtnContainer.getTop();
final int leftPlusWidth = (left + skipSponsorBtnContainer.getWidth()); final int right = left + skipSponsorBtnContainer.getWidth();
final int topPlusHeight = (top + skipSponsorBtnContainer.getHeight()); final int bottom = top + skipSponsorBtnContainer.getHeight();
canvas.drawRect(left, top, leftPlusWidth, topPlusHeight, background);
if (!highContrast) { // Determine corner radius for rounded button
canvas.drawLines(new float[]{ float cornerRadius = skipSponsorBtnContainer.getHeight() / 2f;
leftPlusWidth, top, left, top,
left, top, left, topPlusHeight, if (Settings.SB_SQUARE_LAYOUT.get()) {
left, topPlusHeight, leftPlusWidth, topPlusHeight}, // Square button.
border); canvas.drawRect(left, top, right, bottom, background);
if (highContrast) {
canvas.drawLines(new float[]{
right, top, left, top,
left, top, left, bottom,
left, bottom, right, bottom},
border); // Draw square border.
}
} else {
// Rounded button.
RectF rect = new RectF(left, top, right, bottom);
canvas.drawRoundRect(rect, cornerRadius, cornerRadius, background); // Draw rounded background.
if (highContrast) {
canvas.drawRoundRect(rect, cornerRadius, cornerRadius, border); // Draw rounded border.
}
} }
super.dispatchDraw(canvas); super.dispatchDraw(canvas);
} }
/** /**
* @return true, if this button state was changed * Update the layout of this button.
*/ */
public boolean updateSkipButtonText(@NonNull SponsorSegment segment) { public void updateLayout() {
if (Settings.SB_SQUARE_LAYOUT.get()) {
// No padding for square corners.
setPadding(0, 0, 0, 0);
} else {
// Apply padding for rounded corners.
final int padding = SponsorBlockViewController.ROUNDED_LAYOUT_MARGIN;
setPadding(padding, 0, padding, 0);
}
}
public void updateSkipButtonText(@NonNull SponsorSegment segment) {
this.segment = segment; this.segment = segment;
CharSequence newText = segment.getSkipButtonText(); CharSequence newText = segment.getSkipButtonText();
//noinspection StringEqualsCharSequence
if (newText.equals(skipSponsorTextView.getText())) { if (newText.equals(skipSponsorTextView.getText())) {
return false; return;
} }
skipSponsorTextView.setText(newText); skipSponsorTextView.setText(newText);
return true;
} }
} }

View File

@@ -19,8 +19,11 @@ import app.revanced.extension.shared.Utils;
import app.revanced.extension.youtube.settings.Settings; import app.revanced.extension.youtube.settings.Settings;
import app.revanced.extension.youtube.shared.PlayerType; import app.revanced.extension.youtube.shared.PlayerType;
import app.revanced.extension.youtube.sponsorblock.objects.SponsorSegment; import app.revanced.extension.youtube.sponsorblock.objects.SponsorSegment;
import kotlin.Unit;
public class SponsorBlockViewController { public class SponsorBlockViewController {
public static final int ROUNDED_LAYOUT_MARGIN = 12;
private static WeakReference<RelativeLayout> inlineSponsorOverlayRef = new WeakReference<>(null); private static WeakReference<RelativeLayout> inlineSponsorOverlayRef = new WeakReference<>(null);
private static WeakReference<ViewGroup> youtubeOverlaysLayoutRef = new WeakReference<>(null); private static WeakReference<ViewGroup> youtubeOverlaysLayoutRef = new WeakReference<>(null);
private static WeakReference<SkipSponsorButton> skipHighlightButtonRef = new WeakReference<>(null); private static WeakReference<SkipSponsorButton> skipHighlightButtonRef = new WeakReference<>(null);
@@ -36,7 +39,7 @@ public class SponsorBlockViewController {
static { static {
PlayerType.getOnChange().addObserver((PlayerType type) -> { PlayerType.getOnChange().addObserver((PlayerType type) -> {
playerTypeChanged(type); playerTypeChanged(type);
return null; return Unit.INSTANCE;
}); });
} }
@@ -80,12 +83,16 @@ public class SponsorBlockViewController {
}); });
youtubeOverlaysLayoutRef = new WeakReference<>(viewGroup); youtubeOverlaysLayoutRef = new WeakReference<>(viewGroup);
skipHighlightButtonRef = new WeakReference<>( skipHighlightButtonRef = new WeakReference<>(Objects.requireNonNull(
Objects.requireNonNull(layout.findViewById(getResourceIdentifier("revanced_sb_skip_highlight_button", "id")))); layout.findViewById(getResourceIdentifier("revanced_sb_skip_highlight_button", "id"))));
skipSponsorButtonRef = new WeakReference<>(
Objects.requireNonNull(layout.findViewById(getResourceIdentifier("revanced_sb_skip_sponsor_button", "id")))); skipSponsorButtonRef = new WeakReference<>(Objects.requireNonNull(
newSegmentLayoutRef = new WeakReference<>( layout.findViewById(getResourceIdentifier("revanced_sb_skip_sponsor_button", "id"))));
Objects.requireNonNull(layout.findViewById(getResourceIdentifier("revanced_sb_new_segment_view", "id"))));
NewSegmentLayout newSegmentLayout = Objects.requireNonNull(
layout.findViewById(getResourceIdentifier("revanced_sb_new_segment_view", "id")));
newSegmentLayoutRef = new WeakReference<>(newSegmentLayout);
newSegmentLayout.updateLayout();
newSegmentLayoutVisible = false; newSegmentLayoutVisible = false;
skipHighlight = null; skipHighlight = null;
@@ -101,6 +108,23 @@ public class SponsorBlockViewController {
hideNewSegmentLayout(); hideNewSegmentLayout();
} }
public static void updateLayout() {
SkipSponsorButton button = skipSponsorButtonRef.get();
if (button != null) {
button.updateLayout();
}
button = skipHighlightButtonRef.get();
if (button != null) {
button.updateLayout();
}
NewSegmentLayout newSegmentLayout = newSegmentLayoutRef.get();
if (newSegmentLayout != null) {
newSegmentLayout.updateLayout();
}
}
public static void showSkipHighlightButton(@NonNull SponsorSegment segment) { public static void showSkipHighlightButton(@NonNull SponsorSegment segment) {
skipHighlight = Objects.requireNonNull(segment); skipHighlight = Objects.requireNonNull(segment);
NewSegmentLayout newSegmentLayout = newSegmentLayoutRef.get(); NewSegmentLayout newSegmentLayout = newSegmentLayoutRef.get();

View File

@@ -4,14 +4,9 @@ plugins {
android { android {
namespace = "app.revanced.extension" namespace = "app.revanced.extension"
compileSdk = 33 compileSdk = 34
defaultConfig { defaultConfig {
minSdk = 24 minSdk = 24
} }
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
} }

View File

@@ -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.11.0-dev.1 version = 5.12.0-dev.5

View File

@@ -3,7 +3,6 @@ revanced-patcher = "21.0.0"
# Tracking https://github.com/google/smali/issues/64. # Tracking https://github.com/google/smali/issues/64.
#noinspection GradleDependency #noinspection GradleDependency
smali = "3.0.5" smali = "3.0.5"
gson = "2.11.0"
# 8.3.0 causes java verifier error: https://github.com/ReVanced/revanced-patches/issues/2818. # 8.3.0 causes java verifier error: https://github.com/ReVanced/revanced-patches/issues/2818.
#noinspection GradleDependency #noinspection GradleDependency
agp = "8.2.2" agp = "8.2.2"
@@ -11,10 +10,9 @@ annotation = "1.9.1"
appcompat = "1.7.0" appcompat = "1.7.0"
okhttp = "5.0.0-alpha.14" okhttp = "5.0.0-alpha.14"
retrofit = "2.11.0" retrofit = "2.11.0"
guava = "33.2.1-jre" guava = "33.4.0-jre"
[libraries] [libraries]
gson = { module = "com.google.code.gson:gson", version.ref = "gson" }
annotation = { module = "androidx.annotation:annotation", version.ref = "annotation" } annotation = { module = "androidx.annotation:annotation", version.ref = "annotation" }
appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" } appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" }
okhttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" } okhttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" }

24
package-lock.json generated
View File

@@ -9,7 +9,7 @@
"@semantic-release/changelog": "^6.0.3", "@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1", "@semantic-release/git": "^10.0.1",
"gradle-semantic-release-plugin": "^1.10.1", "gradle-semantic-release-plugin": "^1.10.1",
"semantic-release": "^24.1.2" "semantic-release": "^24.2.1"
} }
}, },
"node_modules/@babel/code-frame": { "node_modules/@babel/code-frame": {
@@ -6760,9 +6760,9 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/semantic-release": { "node_modules/semantic-release": {
"version": "24.1.2", "version": "24.2.1",
"resolved": "https://registry.npmjs.org/semantic-release/-/semantic-release-24.1.2.tgz", "resolved": "https://registry.npmjs.org/semantic-release/-/semantic-release-24.2.1.tgz",
"integrity": "sha512-hvEJ7yI97pzJuLsDZCYzJgmRxF8kiEJvNZhf0oiZQcexw+Ycjy4wbdsn/sVMURgNCu8rwbAXJdBRyIxM4pe32g==", "integrity": "sha512-z0/3cutKNkLQ4Oy0HTi3lubnjTsdjjgOqmxdPjeYWe6lhFqUPfwslZxRHv3HDZlN4MhnZitb9SLihDkZNxOXfQ==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
@@ -6782,7 +6782,7 @@
"git-log-parser": "^1.2.0", "git-log-parser": "^1.2.0",
"hook-std": "^3.0.0", "hook-std": "^3.0.0",
"hosted-git-info": "^8.0.0", "hosted-git-info": "^8.0.0",
"import-from-esm": "^1.3.1", "import-from-esm": "^2.0.0",
"lodash-es": "^4.17.21", "lodash-es": "^4.17.21",
"marked": "^12.0.0", "marked": "^12.0.0",
"marked-terminal": "^7.0.0", "marked-terminal": "^7.0.0",
@@ -6926,6 +6926,20 @@
"node": ">=18.18.0" "node": ">=18.18.0"
} }
}, },
"node_modules/semantic-release/node_modules/import-from-esm": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/import-from-esm/-/import-from-esm-2.0.0.tgz",
"integrity": "sha512-YVt14UZCgsX1vZQ3gKjkWVdBdHQ6eu3MPU1TBgL1H5orXe2+jWD006WCPPtOuwlQm10NuzOW5WawiF1Q9veW8g==",
"dev": true,
"license": "MIT",
"dependencies": {
"debug": "^4.3.4",
"import-meta-resolve": "^4.0.0"
},
"engines": {
"node": ">=18.20"
}
},
"node_modules/semantic-release/node_modules/indent-string": { "node_modules/semantic-release/node_modules/indent-string": {
"version": "5.0.0", "version": "5.0.0",
"resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz",

View File

@@ -4,6 +4,6 @@
"@semantic-release/changelog": "^6.0.3", "@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1", "@semantic-release/git": "^10.0.1",
"gradle-semantic-release-plugin": "^1.10.1", "gradle-semantic-release-plugin": "^1.10.1",
"semantic-release": "^24.1.2" "semantic-release": "^24.2.1"
} }
} }

View File

@@ -13,8 +13,6 @@ patches {
} }
dependencies { dependencies {
// Used by JsonGenerator.
implementation(libs.gson)
// Required due to smali, or build fails. Can be removed once smali is bumped. // Required due to smali, or build fails. Can be removed once smali is bumped.
implementation(libs.guava) implementation(libs.guava)
// Android API stubs defined here. // Android API stubs defined here.

View File

@@ -14,7 +14,7 @@ val exportInternalDataDocumentsProviderPatch = resourcePatch(
) { ) {
dependsOn( dependsOn(
bytecodePatch { bytecodePatch {
extendWith("extensions/all/misc/directory/export-internal-data-documents-provider.rve") extendWith("extensions/all/misc/directory/documentsprovider/export-internal-data-documents-provider.rve")
}, },
) )

View File

@@ -25,7 +25,7 @@ private val removeCaptureRestrictionResourcePatch = resourcePatch(
} }
private const val EXTENSION_CLASS_DESCRIPTOR_PREFIX = private const val EXTENSION_CLASS_DESCRIPTOR_PREFIX =
"Lapp/revanced/extension/all/screencapture/removerestriction/RemoveScreencaptureRestrictionPatch" "Lapp/revanced/extension/all/screencapture/removerestriction/RemoveScreenCaptureRestrictionPatch"
private const val EXTENSION_CLASS_DESCRIPTOR = "$EXTENSION_CLASS_DESCRIPTOR_PREFIX;" private const val EXTENSION_CLASS_DESCRIPTOR = "$EXTENSION_CLASS_DESCRIPTOR_PREFIX;"
@Suppress("unused") @Suppress("unused")

View File

@@ -8,7 +8,12 @@ val hideVideoAdsPatch = bytecodePatch(
name = "Hide music video ads", name = "Hide music video ads",
description = "Hides ads that appear while listening to or streaming music videos, podcasts, or songs.", description = "Hides ads that appear while listening to or streaming music videos, podcasts, or songs.",
) { ) {
compatibleWith("com.google.android.apps.youtube.music") compatibleWith(
"com.google.android.apps.youtube.music"(
"7.16.53",
"8.05.50"
)
)
execute { execute {
navigate(showVideoAdsParentFingerprint.originalMethod) navigate(showVideoAdsParentFingerprint.originalMethod)

View File

@@ -1,24 +1,21 @@
package app.revanced.patches.music.audio.exclusiveaudio package app.revanced.patches.music.audio.exclusiveaudio
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.patch.bytecodePatch import app.revanced.patcher.patch.bytecodePatch
import app.revanced.util.returnEarly
@Suppress("unused") @Suppress("unused")
val enableExclusiveAudioPlaybackPatch = bytecodePatch( val enableExclusiveAudioPlaybackPatch = bytecodePatch(
name = "Enable exclusive audio playback", name = "Enable exclusive audio playback",
description = "Enables the option to play audio without video.", description = "Enables the option to play audio without video.",
) { ) {
compatibleWith("com.google.android.apps.youtube.music") compatibleWith(
"com.google.android.apps.youtube.music"(
"7.16.53",
"8.05.50"
)
)
execute { execute {
allowExclusiveAudioPlaybackFingerprint.method.apply { allowExclusiveAudioPlaybackFingerprint.method.returnEarly(true)
addInstructions(
0,
"""
const/4 v0, 0x1
return v0
""",
)
}
} }
} }

View File

@@ -9,16 +9,15 @@ internal val allowExclusiveAudioPlaybackFingerprint = fingerprint {
returns("Z") returns("Z")
parameters() parameters()
opcodes( opcodes(
Opcode.INVOKE_INTERFACE,
Opcode.MOVE_RESULT_OBJECT,
Opcode.IGET_OBJECT,
Opcode.INVOKE_VIRTUAL, Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT_OBJECT, Opcode.MOVE_RESULT_OBJECT,
Opcode.CHECK_CAST, Opcode.CHECK_CAST,
Opcode.IF_NEZ, Opcode.IF_NEZ,
Opcode.IGET_OBJECT, Opcode.IGET_OBJECT,
Opcode.INVOKE_VIRTUAL, Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT, Opcode.MOVE_RESULT
Opcode.GOTO,
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT,
Opcode.RETURN
) )
} }

View File

@@ -11,10 +11,14 @@ val permanentRepeatPatch = bytecodePatch(
description = "Permanently remember your repeating preference even if the playlist ends or another track is played.", description = "Permanently remember your repeating preference even if the playlist ends or another track is played.",
use = false, use = false,
) { ) {
compatibleWith("com.google.android.apps.youtube.music") compatibleWith(
"com.google.android.apps.youtube.music"(
"7.16.53",
"8.05.50"
)
)
execute { execute {
val startIndex = repeatTrackFingerprint.patternMatch!!.endIndex val startIndex = repeatTrackFingerprint.patternMatch!!.endIndex
val repeatIndex = startIndex + 1 val repeatIndex = startIndex + 1

View File

@@ -11,7 +11,12 @@ val hideCategoryBar = bytecodePatch(
description = "Hides the category bar at the top of the homepage.", description = "Hides the category bar at the top of the homepage.",
use = false, use = false,
) { ) {
compatibleWith("com.google.android.apps.youtube.music") compatibleWith(
"com.google.android.apps.youtube.music"(
"7.16.53",
"8.05.50"
)
)
execute { execute {
constructCategoryBarFingerprint.method.apply { constructCategoryBarFingerprint.method.apply {

View File

@@ -11,7 +11,12 @@ val hideGetPremiumPatch = bytecodePatch(
name = "Hide 'Get Music Premium' label", name = "Hide 'Get Music Premium' label",
description = "Hides the \"Get Music Premium\" label from the account menu and settings.", description = "Hides the \"Get Music Premium\" label from the account menu and settings.",
) { ) {
compatibleWith("com.google.android.apps.youtube.music") compatibleWith(
"com.google.android.apps.youtube.music"(
"7.16.53",
"8.05.50"
)
)
execute { execute {
hideGetPremiumFingerprint.method.apply { hideGetPremiumFingerprint.method.apply {

View File

@@ -18,7 +18,12 @@ val removeUpgradeButtonPatch = bytecodePatch(
name = "Remove upgrade button", name = "Remove upgrade button",
description = "Removes the upgrade tab from the pivot bar.", description = "Removes the upgrade tab from the pivot bar.",
) { ) {
compatibleWith("com.google.android.apps.youtube.music") compatibleWith(
"com.google.android.apps.youtube.music"(
"7.16.53",
"8.05.50"
)
)
execute { execute {
pivotBarConstructorFingerprint.method.apply { pivotBarConstructorFingerprint.method.apply {

View File

@@ -8,7 +8,12 @@ val bypassCertificateChecksPatch = bytecodePatch(
name = "Bypass certificate checks", name = "Bypass certificate checks",
description = "Bypasses certificate checks which prevent YouTube Music from working on Android Auto.", description = "Bypasses certificate checks which prevent YouTube Music from working on Android Auto.",
) { ) {
compatibleWith("com.google.android.apps.youtube.music"("7.29.52")) compatibleWith(
"com.google.android.apps.youtube.music"(
"7.16.53",
"8.05.50"
)
)
execute { execute {
checkCertificateFingerprint.method.returnEarly(true) checkCertificateFingerprint.method.returnEarly(true)

View File

@@ -4,8 +4,10 @@ import com.android.tools.smali.dexlib2.AccessFlags
import app.revanced.patcher.fingerprint import app.revanced.patcher.fingerprint
internal val checkCertificateFingerprint = fingerprint { internal val checkCertificateFingerprint = fingerprint {
accessFlags(AccessFlags.PUBLIC, AccessFlags.FINAL)
returns("Z") returns("Z")
parameters("Ljava/lang/String;") parameters("Ljava/lang/String;")
strings("X509", "Failed to get certificate.") strings(
"X509",
"Failed to get certificate" // Partial String match.
)
} }

View File

@@ -8,7 +8,12 @@ val backgroundPlaybackPatch = bytecodePatch(
name = "Remove background playback restrictions", name = "Remove background playback restrictions",
description = "Removes restrictions on background playback, including playing kids videos in the background.", description = "Removes restrictions on background playback, including playing kids videos in the background.",
) { ) {
compatibleWith("com.google.android.apps.youtube.music") compatibleWith(
"com.google.android.apps.youtube.music"(
"7.16.53",
"8.05.50"
)
)
execute { execute {
kidsBackgroundPlaybackPolicyControllerFingerprint.method.addInstruction( kidsBackgroundPlaybackPolicyControllerFingerprint.method.addInstruction(

View File

@@ -25,7 +25,12 @@ val spoofClientPatch = bytecodePatch(
name = "Spoof client", name = "Spoof client",
description = "Spoofs the client to fix playback.", description = "Spoofs the client to fix playback.",
) { ) {
compatibleWith("com.google.android.apps.youtube.music") compatibleWith(
"com.google.android.apps.youtube.music"(
"7.16.53",
"8.05.50"
)
)
dependsOn( dependsOn(
sharedExtensionPatch, sharedExtensionPatch,

View File

@@ -56,8 +56,9 @@ val customThemePatch = resourcePatch(
document("res/values/colors.xml").use { document -> document("res/values/colors.xml").use { document ->
val resourcesNode = document.getElementsByTagName("resources").item(0) as Element val resourcesNode = document.getElementsByTagName("resources").item(0) as Element
for (i in 0 until resourcesNode.childNodes.length) { val childNodes = resourcesNode.childNodes
val node = resourcesNode.childNodes.item(i) as? Element ?: continue for (i in 0 until childNodes.length) {
val node = childNodes.item(i) as? Element ?: continue
node.textContent = node.textContent =
when (node.getAttribute("name")) { when (node.getAttribute("name")) {

View File

@@ -3,9 +3,9 @@ package app.revanced.patches.windyapp.misc.unlockpro
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.patch.bytecodePatch import app.revanced.patcher.patch.bytecodePatch
@Deprecated("This patch no longer works and will be removed in the future.")
@Suppress("unused") @Suppress("unused")
val unlockProPatch = bytecodePatch( val unlockProPatch = bytecodePatch(
name = "Unlock pro",
description = "Unlocks all pro features.", description = "Unlocks all pro features.",
) { ) {
compatibleWith("co.windyapp.android") compatibleWith("co.windyapp.android")

View File

@@ -78,8 +78,6 @@ val hideAdsPatch = bytecodePatch(
compatibleWith( compatibleWith(
"com.google.android.youtube"( "com.google.android.youtube"(
"18.38.44",
"18.49.37",
"19.16.39", "19.16.39",
"19.25.37", "19.25.37",
"19.34.42", "19.34.42",

View File

@@ -25,8 +25,6 @@ val hideGetPremiumPatch = bytecodePatch(
compatibleWith( compatibleWith(
"com.google.android.youtube"( "com.google.android.youtube"(
"18.38.44",
"18.49.37",
"19.16.39", "19.16.39",
"19.25.37", "19.25.37",
"19.34.42", "19.34.42",

View File

@@ -23,8 +23,6 @@ val videoAdsPatch = bytecodePatch(
compatibleWith( compatibleWith(
"com.google.android.youtube"( "com.google.android.youtube"(
"18.38.44",
"18.49.37",
"19.16.39", "19.16.39",
"19.25.37", "19.25.37",
"19.34.42", "19.34.42",

View File

@@ -53,8 +53,6 @@ val copyVideoUrlPatch = bytecodePatch(
compatibleWith( compatibleWith(
"com.google.android.youtube"( "com.google.android.youtube"(
"18.38.44",
"18.49.37",
"19.16.39", "19.16.39",
"19.25.37", "19.25.37",
"19.34.42", "19.34.42",

View File

@@ -24,8 +24,6 @@ val removeViewerDiscretionDialogPatch = bytecodePatch(
compatibleWith( compatibleWith(
"com.google.android.youtube"( "com.google.android.youtube"(
"18.38.44",
"18.49.37",
"19.16.39", "19.16.39",
"19.25.37", "19.25.37",
"19.34.42", "19.34.42",

View File

@@ -68,8 +68,6 @@ val downloadsPatch = bytecodePatch(
compatibleWith( compatibleWith(
"com.google.android.youtube"( "com.google.android.youtube"(
"18.38.44",
"18.49.37",
"19.16.39", "19.16.39",
"19.25.37", "19.25.37",
"19.34.42", "19.34.42",

View File

@@ -23,8 +23,6 @@ val disablePreciseSeekingGesturePatch = bytecodePatch(
compatibleWith( compatibleWith(
"com.google.android.youtube"( "com.google.android.youtube"(
"18.38.44",
"18.49.37",
"19.16.39", "19.16.39",
"19.25.37", "19.25.37",
"19.34.42", "19.34.42",

View File

@@ -26,8 +26,6 @@ val enableSeekbarTappingPatch = bytecodePatch(
compatibleWith( compatibleWith(
"com.google.android.youtube"( "com.google.android.youtube"(
// 18.38.44 patches but crashes on startup.
"18.49.37",
"19.16.39", "19.16.39",
"19.25.37", "19.25.37",
"19.34.42", "19.34.42",

View File

@@ -35,7 +35,6 @@ val enableSlideToSeekPatch = bytecodePatch(
compatibleWith( compatibleWith(
"com.google.android.youtube"( "com.google.android.youtube"(
"18.49.37",
"19.16.39", "19.16.39",
"19.25.37", "19.25.37",
"19.34.42", "19.34.42",

View File

@@ -19,7 +19,7 @@ private const val EXTENSION_CLASS_DESCRIPTOR =
val seekbarThumbnailsPatch = bytecodePatch( val seekbarThumbnailsPatch = bytecodePatch(
name = "Seekbar thumbnails", name = "Seekbar thumbnails",
description = "Adds an option to use high quality fullscreen seekbar thumbnails. " + description = "Adds an option to use high quality fullscreen seekbar thumbnails. " +
"Patching 19.16.39 or lower adds an option to restore old seekbar thumbnails.", "Patching 19.16.39 adds an option to restore old seekbar thumbnails.",
) { ) {
dependsOn( dependsOn(
sharedExtensionPatch, sharedExtensionPatch,
@@ -29,8 +29,6 @@ val seekbarThumbnailsPatch = bytecodePatch(
compatibleWith( compatibleWith(
"com.google.android.youtube"( "com.google.android.youtube"(
"18.38.44",
"18.49.37",
"19.16.39", "19.16.39",
"19.25.37", "19.25.37",
"19.34.42", "19.34.42",

View File

@@ -74,8 +74,6 @@ val swipeControlsPatch = bytecodePatch(
compatibleWith( compatibleWith(
"com.google.android.youtube"( "com.google.android.youtube"(
"18.38.44",
"18.49.37",
"19.16.39", "19.16.39",
"19.25.37", "19.25.37",
"19.34.42", "19.34.42",

View File

@@ -22,8 +22,6 @@ val autoCaptionsPatch = bytecodePatch(
compatibleWith( compatibleWith(
"com.google.android.youtube"( "com.google.android.youtube"(
"18.38.44",
"18.49.37",
"19.16.39", "19.16.39",
"19.25.37", "19.25.37",
"19.34.42", "19.34.42",

View File

@@ -43,8 +43,6 @@ val customBrandingPatch = resourcePatch(
compatibleWith( compatibleWith(
"com.google.android.youtube"( "com.google.android.youtube"(
"18.38.44",
"18.49.37",
"19.16.39", "19.16.39",
"19.25.37", "19.25.37",
"19.34.42", "19.34.42",

View File

@@ -41,8 +41,6 @@ val changeHeaderPatch = resourcePatch(
compatibleWith( compatibleWith(
"com.google.android.youtube"( "com.google.android.youtube"(
"18.38.44",
"18.49.37",
"19.16.39", "19.16.39",
"19.25.37", "19.25.37",
"19.34.42", "19.34.42",
@@ -172,14 +170,16 @@ val changeHeaderPatch = resourcePatch(
// Instead change styles.xml to use the old drawable resources. // Instead change styles.xml to use the old drawable resources.
if (is_19_25_or_greater) { if (is_19_25_or_greater) {
document("res/values/styles.xml").use { document -> document("res/values/styles.xml").use { document ->
val documentChildNodes = document.childNodes
arrayOf( arrayOf(
"CairoLightThemeRingo2Updates" to variants[0], "CairoLightThemeRingo2Updates" to variants[0],
"CairoDarkThemeRingo2Updates" to variants[1] "CairoDarkThemeRingo2Updates" to variants[1]
).forEach { (styleName, theme) -> ).forEach { (styleName, theme) ->
val style = document.childNodes.findElementByAttributeValueOrThrow( val styleNodes = documentChildNodes.findElementByAttributeValueOrThrow(
"name", "name",
styleName, styleName,
) ).childNodes
val drawable = "@drawable/${HEADER_FILE_NAME}_${theme}" val drawable = "@drawable/${HEADER_FILE_NAME}_${theme}"
@@ -187,7 +187,7 @@ val changeHeaderPatch = resourcePatch(
"ytWordmarkHeader", "ytWordmarkHeader",
"ytPremiumWordmarkHeader" "ytPremiumWordmarkHeader"
).forEach { itemName -> ).forEach { itemName ->
style.childNodes.findElementByAttributeValueOrThrow( styleNodes.findElementByAttributeValueOrThrow(
"name", "name",
itemName, itemName,
).textContent = drawable ).textContent = drawable

View File

@@ -22,8 +22,6 @@ val hideButtonsPatch = resourcePatch(
compatibleWith( compatibleWith(
"com.google.android.youtube"( "com.google.android.youtube"(
"18.38.44",
"18.49.37",
"19.16.39", "19.16.39",
"19.25.37", "19.25.37",
"19.34.42", "19.34.42",

View File

@@ -40,8 +40,6 @@ val navigationButtonsPatch = bytecodePatch(
compatibleWith( compatibleWith(
"com.google.android.youtube"( "com.google.android.youtube"(
"18.38.44",
"18.49.37",
"19.16.39", "19.16.39",
"19.25.37", "19.25.37",
"19.34.42", "19.34.42",

View File

@@ -54,8 +54,6 @@ val hidePlayerOverlayButtonsPatch = bytecodePatch(
compatibleWith( compatibleWith(
"com.google.android.youtube"( "com.google.android.youtube"(
"18.38.44",
"18.49.37",
"19.16.39", "19.16.39",
"19.25.37", "19.25.37",
"19.34.42", "19.34.42",

View File

@@ -30,8 +30,6 @@ val changeFormFactorPatch = bytecodePatch(
compatibleWith( compatibleWith(
"com.google.android.youtube"( "com.google.android.youtube"(
"18.38.44",
"18.49.37",
"19.16.39", "19.16.39",
"19.25.37", "19.25.37",
"19.34.42", "19.34.42",

View File

@@ -56,8 +56,6 @@ val hideEndscreenCardsPatch = bytecodePatch(
compatibleWith( compatibleWith(
"com.google.android.youtube"( "com.google.android.youtube"(
"18.38.44",
"18.49.37",
"19.16.39", "19.16.39",
"19.25.37", "19.25.37",
"19.34.42", "19.34.42",

View File

@@ -29,8 +29,6 @@ val disableFullscreenAmbientModePatch = bytecodePatch(
compatibleWith( compatibleWith(
"com.google.android.youtube"( "com.google.android.youtube"(
"18.38.44",
"18.49.37",
"19.16.39", "19.16.39",
"19.25.37", "19.25.37",
"19.34.42", "19.34.42",

View File

@@ -125,8 +125,6 @@ val hideLayoutComponentsPatch = bytecodePatch(
compatibleWith( compatibleWith(
"com.google.android.youtube"( "com.google.android.youtube"(
"18.38.44",
"18.49.37",
"19.16.39", "19.16.39",
"19.25.37", "19.25.37",
"19.34.42", "19.34.42",

View File

@@ -57,8 +57,6 @@ val hideInfoCardsPatch = bytecodePatch(
compatibleWith( compatibleWith(
"com.google.android.youtube"( "com.google.android.youtube"(
"18.38.44",
"18.49.37",
"19.16.39", "19.16.39",
"19.25.37", "19.25.37",
"19.34.42", "19.34.42",

View File

@@ -24,8 +24,6 @@ val hidePlayerFlyoutMenuPatch = bytecodePatch(
compatibleWith( compatibleWith(
"com.google.android.youtube"( "com.google.android.youtube"(
"18.38.44",
"18.49.37",
"19.16.39", "19.16.39",
"19.25.37", "19.25.37",
"19.34.42", "19.34.42",

View File

@@ -29,8 +29,6 @@ val disableRollingNumberAnimationPatch = bytecodePatch(
compatibleWith( compatibleWith(
"com.google.android.youtube"( "com.google.android.youtube"(
// 18.43 is the earliest target this patch works.
"18.49.37",
"19.16.39", "19.16.39",
"19.25.37", "19.25.37",
"19.34.42", "19.34.42",

View File

@@ -25,8 +25,6 @@ val hideSeekbarPatch = bytecodePatch(
compatibleWith( compatibleWith(
"com.google.android.youtube"( "com.google.android.youtube"(
"18.38.44",
"18.49.37",
"19.16.39", "19.16.39",
"19.25.37", "19.25.37",
"19.34.42", "19.34.42",

View File

@@ -30,12 +30,6 @@ internal val createShortsButtonsFingerprint = fingerprint {
literal { reelPlayerRightCellButtonHeight } literal { reelPlayerRightCellButtonHeight }
} }
internal val reelConstructorFingerprint = fingerprint {
accessFlags(AccessFlags.PUBLIC, AccessFlags.CONSTRUCTOR)
opcodes(Opcode.INVOKE_VIRTUAL)
literal { reelMultipleItemShelfId }
}
internal val renderBottomNavigationBarFingerprint = fingerprint { internal val renderBottomNavigationBarFingerprint = fingerprint {
returns("V") returns("V")
parameters("Ljava/lang/String;") parameters("Ljava/lang/String;")

View File

@@ -18,7 +18,6 @@ import app.revanced.patches.youtube.misc.extension.sharedExtensionPatch
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_03_or_greater
import app.revanced.patches.youtube.misc.playservice.is_19_41_or_greater import app.revanced.patches.youtube.misc.playservice.is_19_41_or_greater
import app.revanced.patches.youtube.misc.playservice.versionCheckPatch import app.revanced.patches.youtube.misc.playservice.versionCheckPatch
import app.revanced.patches.youtube.misc.settings.PreferenceScreen import app.revanced.patches.youtube.misc.settings.PreferenceScreen
@@ -27,11 +26,8 @@ import app.revanced.util.*
import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.Opcode
import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction 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.reference.MethodReference import com.android.tools.smali.dexlib2.iface.reference.MethodReference
internal var reelMultipleItemShelfId = -1L
private set
internal var reelPlayerRightCellButtonHeight = -1L internal var reelPlayerRightCellButtonHeight = -1L
private set private set
internal var bottomBarContainer = -1L internal var bottomBarContainer = -1L
@@ -155,13 +151,6 @@ private val hideShortsComponentsResourcePatch = resourcePatch {
"dimen", "dimen",
"reel_player_right_pivot_v2_size", "reel_player_right_pivot_v2_size",
] ]
if (!is_19_03_or_greater) {
reelMultipleItemShelfId = resourceMappings[
"dimen",
"reel_player_right_cell_button_height",
]
}
} }
} }
@@ -183,8 +172,6 @@ val hideShortsComponentsPatch = bytecodePatch(
compatibleWith( compatibleWith(
"com.google.android.youtube"( "com.google.android.youtube"(
"18.38.44",
"18.49.37",
"19.16.39", "19.16.39",
"19.25.37", "19.25.37",
"19.34.42", "19.34.42",
@@ -199,25 +186,6 @@ val hideShortsComponentsPatch = bytecodePatch(
hideShortsWidgetOption() hideShortsWidgetOption()
execute { execute {
// region Hide the Shorts shelf.
// This patch point is not present in 19.03.x and greater.
if (!is_19_03_or_greater && reelConstructorFingerprint.methodOrNull != null) {
reelConstructorFingerprint.method.apply {
val insertIndex = reelConstructorFingerprint.patternMatch!!.startIndex + 2
val viewRegister = getInstruction<TwoRegisterInstruction>(insertIndex).registerA
injectHideViewCall(
insertIndex,
viewRegister,
FILTER_CLASS_DESCRIPTOR,
"hideShortsShelf",
)
}
}
// endregion
// region Hide the Shorts buttons in older versions of YouTube. // region Hide the Shorts buttons in older versions of YouTube.
// Some Shorts buttons are views, hide them by setting their visibility to GONE. // Some Shorts buttons are views, hide them by setting their visibility to GONE.

View File

@@ -54,8 +54,6 @@ val disableSuggestedVideoEndScreenPatch = bytecodePatch(
compatibleWith( compatibleWith(
"com.google.android.youtube"( "com.google.android.youtube"(
"18.38.44",
"18.49.37",
"19.16.39", "19.16.39",
"19.25.37", "19.25.37",
"19.34.42", "19.34.42",

View File

@@ -21,8 +21,6 @@ val hideTimestampPatch = bytecodePatch(
compatibleWith( compatibleWith(
"com.google.android.youtube"( "com.google.android.youtube"(
"18.38.44",
"18.49.37",
"19.16.39", "19.16.39",
"19.25.37", "19.25.37",
"19.34.42", "19.34.42",

View File

@@ -79,53 +79,52 @@ private val miniplayerResourcePatch = resourcePatch {
"player_overlays", "player_overlays",
] ]
if (is_19_16_or_greater) {
modernMiniplayerClose = resourceMappings[ modernMiniplayerClose = resourceMappings[
"id", "id",
"modern_miniplayer_close", "modern_miniplayer_close",
]
modernMiniplayerExpand = resourceMappings[
"id",
"modern_miniplayer_expand",
]
modernMiniplayerRewindButton = resourceMappings[
"id",
"modern_miniplayer_rewind_button",
]
modernMiniplayerForwardButton = resourceMappings[
"id",
"modern_miniplayer_forward_button",
]
// Resource id is not used during patching, but is used by extension.
// Verify the resource is present while patching.
resourceMappings[
"id",
"modern_miniplayer_subtitle_text",
]
// Only required for exactly 19.16
if (!is_19_17_or_greater) {
ytOutlinePictureInPictureWhite24 = resourceMappings[
"drawable",
"yt_outline_picture_in_picture_white_24",
] ]
modernMiniplayerExpand = resourceMappings[ ytOutlineXWhite24 = resourceMappings[
"id", "drawable",
"modern_miniplayer_expand", "yt_outline_x_white_24",
] ]
}
modernMiniplayerRewindButton = resourceMappings[ if (is_19_26_or_greater) {
"id", miniplayerMaxSize = resourceMappings[
"modern_miniplayer_rewind_button", "dimen",
"miniplayer_max_size",
] ]
modernMiniplayerForwardButton = resourceMappings[
"id",
"modern_miniplayer_forward_button",
]
// Resource id is not used during patching, but is used by extension.
// Verify the resource is present while patching.
resourceMappings[
"id",
"modern_miniplayer_subtitle_text",
]
// Only required for exactly 19.16
if (!is_19_17_or_greater) {
ytOutlinePictureInPictureWhite24 = resourceMappings[
"drawable",
"yt_outline_picture_in_picture_white_24",
]
ytOutlineXWhite24 = resourceMappings[
"drawable",
"yt_outline_x_white_24",
]
}
if (is_19_26_or_greater) {
miniplayerMaxSize = resourceMappings[
"dimen",
"miniplayer_max_size",
]
}
} }
} }
} }
@@ -146,9 +145,6 @@ val miniplayerPatch = bytecodePatch(
compatibleWith( compatibleWith(
"com.google.android.youtube"( "com.google.android.youtube"(
// 18.49.37 // Could be supported, but no reason when 19.16 exists and has modern types.
// 19.14.43 // Incomplete code for modern miniplayers.
// 19.15.36 // Different code for handling subtitle texts and not worth supporting.
"19.16.39", // First with modern miniplayers. "19.16.39", // First with modern miniplayers.
// 19.17.41 // Works without issues, but no reason to recommend over 19.16. // 19.17.41 // Works without issues, but no reason to recommend over 19.16.
// 19.18.41 // Works without issues, but no reason to recommend over 19.16. // 19.18.41 // Works without issues, but no reason to recommend over 19.16.

View File

@@ -21,8 +21,6 @@ val playerPopupPanelsPatch = bytecodePatch(
compatibleWith( compatibleWith(
"com.google.android.youtube"( "com.google.android.youtube"(
"18.38.44",
"18.49.37",
"19.16.39", "19.16.39",
"19.25.37", "19.25.37",
"19.34.42", "19.34.42",

View File

@@ -12,8 +12,6 @@ val playerControlsBackgroundPatch = resourcePatch(
) { ) {
compatibleWith( compatibleWith(
"com.google.android.youtube"( "com.google.android.youtube"(
"18.38.44",
"18.49.37",
"19.16.39", "19.16.39",
"19.25.37", "19.25.37",
"19.34.42", "19.34.42",

View File

@@ -21,8 +21,6 @@ internal val exitFullscreenPatch = bytecodePatch(
compatibleWith( compatibleWith(
"com.google.android.youtube"( "com.google.android.youtube"(
"18.38.44",
"18.49.37",
"19.16.39", "19.16.39",
"19.25.37", "19.25.37",
"19.34.42", "19.34.42",

View File

@@ -52,8 +52,6 @@ val customPlayerOverlayOpacityPatch = bytecodePatch(
compatibleWith( compatibleWith(
"com.google.android.youtube"( "com.google.android.youtube"(
"18.38.44",
"18.49.37",
"19.16.39", "19.16.39",
"19.25.37", "19.25.37",
"19.34.42", "19.34.42",

View File

@@ -54,7 +54,6 @@ val returnYouTubeDislikePatch = bytecodePatch(
compatibleWith( compatibleWith(
"com.google.android.youtube"( "com.google.android.youtube"(
"18.49.37",
"19.16.39", "19.16.39",
"19.25.37", "19.25.37",
"19.34.42", "19.34.42",

View File

@@ -29,8 +29,6 @@ val wideSearchbarPatch = bytecodePatch(
compatibleWith( compatibleWith(
"com.google.android.youtube"( "com.google.android.youtube"(
"18.38.44",
"18.49.37",
"19.16.39", "19.16.39",
"19.25.37", "19.25.37",
"19.34.42", "19.34.42",

View File

@@ -125,8 +125,10 @@ private val seekbarColorResourcePatch = resourcePatch {
fun setSplashDrawablePathFillColor(xmlFileNames: Iterable<String>, vararg resourceNames: String) { fun setSplashDrawablePathFillColor(xmlFileNames: Iterable<String>, vararg resourceNames: String) {
xmlFileNames.forEach { xmlFileName -> xmlFileNames.forEach { xmlFileName ->
document(xmlFileName).use { document -> document(xmlFileName).use { document ->
val childNodes = document.childNodes
resourceNames.forEach { elementId -> resourceNames.forEach { elementId ->
val element = document.childNodes.findElementByAttributeValueOrThrow( val element = childNodes.findElementByAttributeValueOrThrow(
"android:name", "android:name",
elementId elementId
) )

View File

@@ -33,7 +33,6 @@ val shortsAutoplayPatch = bytecodePatch(
compatibleWith( compatibleWith(
"com.google.android.youtube"( "com.google.android.youtube"(
"18.49.37",
"19.16.39", "19.16.39",
"19.25.37", "19.25.37",
"19.34.42", "19.34.42",

View File

@@ -41,8 +41,6 @@ val openShortsInRegularPlayerPatch = bytecodePatch(
compatibleWith( compatibleWith(
"com.google.android.youtube"( "com.google.android.youtube"(
"18.38.44",
"18.49.37",
"19.16.39", "19.16.39",
"19.25.37", "19.25.37",
"19.34.42", "19.34.42",

View File

@@ -70,12 +70,7 @@ private val sponsorBlockResourcePatch = resourcePatch {
"revanced_sb_logo.xml", "revanced_sb_logo.xml",
"revanced_sb_publish.xml", "revanced_sb_publish.xml",
"revanced_sb_voting.xml", "revanced_sb_voting.xml",
), )
ResourceGroup(
// required resource for back button, because when the base APK is used, this resource will not exist
"drawable-xxxhdpi",
"quantum_ic_skip_next_white_24.png",
),
).forEach { resourceGroup -> ).forEach { resourceGroup ->
copyResources("sponsorblock", resourceGroup) copyResources("sponsorblock", resourceGroup)
} }
@@ -111,8 +106,6 @@ val sponsorBlockPatch = bytecodePatch(
compatibleWith( compatibleWith(
"com.google.android.youtube"( "com.google.android.youtube"(
"18.38.44",
"18.49.37",
"19.16.39", "19.16.39",
"19.25.37", "19.25.37",
"19.34.42", "19.34.42",

View File

@@ -21,7 +21,7 @@ val spoofAppVersionPatch = bytecodePatch(
name = "Spoof app version", name = "Spoof app version",
description = "Adds an option to trick YouTube into thinking you are running an older version of the app. " + description = "Adds an option to trick YouTube into thinking you are running an older version of the app. " +
"This can be used to restore old UI elements and features. " + "This can be used to restore old UI elements and features. " +
"Patching 19.16.39 or lower includes additional older spoofing targets.", "Patching 19.16.39 includes additional older spoofing targets.",
) { ) {
dependsOn( dependsOn(
sharedExtensionPatch, sharedExtensionPatch,
@@ -32,8 +32,6 @@ val spoofAppVersionPatch = bytecodePatch(
compatibleWith( compatibleWith(
"com.google.android.youtube"( "com.google.android.youtube"(
"18.38.44",
"18.49.37",
"19.16.39", "19.16.39",
// "19.25.37", // Cannot be supported because the lowest spoof target is higher. // "19.25.37", // Cannot be supported because the lowest spoof target is higher.
// "19.34.42", // Cannot be supported because the lowest spoof target is higher. // "19.34.42", // Cannot be supported because the lowest spoof target is higher.

View File

@@ -29,8 +29,6 @@ val changeStartPagePatch = bytecodePatch(
compatibleWith( compatibleWith(
"com.google.android.youtube"( "com.google.android.youtube"(
"18.38.44",
"18.49.37",
"19.16.39", "19.16.39",
"19.25.37", "19.25.37",
"19.34.42", "19.34.42",

View File

@@ -31,8 +31,6 @@ val disableResumingShortsOnStartupPatch = bytecodePatch(
compatibleWith( compatibleWith(
"com.google.android.youtube"( "com.google.android.youtube"(
"18.38.44",
"18.49.37",
"19.16.39", "19.16.39",
"19.25.37", "19.25.37",
"19.34.42", "19.34.42",

View File

@@ -208,8 +208,6 @@ val themePatch = bytecodePatch(
compatibleWith( compatibleWith(
"com.google.android.youtube"( "com.google.android.youtube"(
"18.38.44",
"18.49.37",
"19.16.39", "19.16.39",
"19.25.37", "19.25.37",
"19.34.42", "19.34.42",

View File

@@ -33,8 +33,6 @@ val alternativeThumbnailsPatch = bytecodePatch(
compatibleWith( compatibleWith(
"com.google.android.youtube"( "com.google.android.youtube"(
"18.38.44",
"18.49.37",
"19.16.39", "19.16.39",
"19.25.37", "19.25.37",
"19.34.42", "19.34.42",

View File

@@ -27,8 +27,6 @@ val bypassImageRegionRestrictionsPatch = bytecodePatch(
compatibleWith( compatibleWith(
"com.google.android.youtube"( "com.google.android.youtube"(
"18.38.44",
"18.49.37",
"19.16.39", "19.16.39",
"19.25.37", "19.25.37",
"19.34.42", "19.34.42",

View File

@@ -23,8 +23,6 @@ val announcementsPatch = bytecodePatch(
compatibleWith( compatibleWith(
"com.google.android.youtube"( "com.google.android.youtube"(
"18.38.44",
"18.49.37",
"19.16.39", "19.16.39",
"19.25.37", "19.25.37",
"19.34.42", "19.34.42",

View File

@@ -24,8 +24,6 @@ val autoRepeatPatch = bytecodePatch(
compatibleWith( compatibleWith(
"com.google.android.youtube"( "com.google.android.youtube"(
"18.38.44",
"18.49.37",
"19.16.39", "19.16.39",
"19.25.37", "19.25.37",
"19.34.42", "19.34.42",

View File

@@ -48,8 +48,6 @@ val backgroundPlaybackPatch = bytecodePatch(
compatibleWith( compatibleWith(
"com.google.android.youtube"( "com.google.android.youtube"(
"18.38.44",
"18.49.37",
"19.16.39", "19.16.39",
"19.25.37", "19.25.37",
"19.34.42", "19.34.42",

Some files were not shown because too many files have changed in this diff Show More