mirror of
https://github.com/revanced/revanced-patches.git
synced 2025-06-12 21:27:38 +02:00
feat(Spotify): Add Unlock premium
patch (#4644)
Co-authored-by: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Co-authored-by: Brosssh <tiabroch@gmail.com>
This commit is contained in:
1
extensions/spotify/src/main/AndroidManifest.xml
Normal file
1
extensions/spotify/src/main/AndroidManifest.xml
Normal file
@ -0,0 +1 @@
|
||||
<manifest/>
|
@ -0,0 +1,37 @@
|
||||
package app.revanced.extension.spotify.misc;
|
||||
|
||||
import com.spotify.remoteconfig.internal.AccountAttribute;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @noinspection unused
|
||||
*/
|
||||
public final class UnlockPremiumPatch {
|
||||
private static final Map<String, Object> OVERRIDES = Map.of(
|
||||
// Disables player and app ads.
|
||||
"ads", false,
|
||||
// Works along on-demand, allows playing any song without restriction.
|
||||
"player-license", "premium",
|
||||
// Disables shuffle being initially enabled when first playing a playlist.
|
||||
"shuffle", false,
|
||||
// Allows playing any song on-demand, without a shuffled order.
|
||||
"on-demand", true,
|
||||
// Allows adding songs to queue and removes the smart shuffle mode restriction,
|
||||
// allowing to pick any of the other modes.
|
||||
"pick-and-shuffle", false,
|
||||
// Disables shuffle-mode streaming-rule, which forces songs to be played shuffled
|
||||
// and breaks the player when other patches are applied.
|
||||
"streaming-rules", "",
|
||||
// Enables premium UI in settings and removes the premium button in the nav-bar.
|
||||
"nft-disabled", "1"
|
||||
);
|
||||
|
||||
public static void overrideAttribute(Map<String, AccountAttribute> attributes) {
|
||||
for (var entry : OVERRIDES.entrySet()) {
|
||||
var attribute = Objects.requireNonNull(attributes.get(entry.getKey()));
|
||||
attribute.value_ = entry.getValue();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user