Skip to content

Commit eb72ee6

Browse files
Nuckyzanddea
authored andcommitted
feat(Spotify): Add Fix third party launchers widgets patch (#4893)
1 parent 966a84b commit eb72ee6

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

patches/api/patches.api

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -689,6 +689,10 @@ public final class app/revanced/patches/spotify/misc/privacy/SanitizeSharingLink
689689
public static final fun getSanitizeSharingLinksPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
690690
}
691691

692+
public final class app/revanced/patches/spotify/misc/widgets/FixThirdPartyLaunchersWidgetsKt {
693+
public static final fun getFixThirdPartyLaunchersWidgets ()Lapp/revanced/patcher/patch/BytecodePatch;
694+
}
695+
692696
public final class app/revanced/patches/spotify/navbar/PremiumNavbarTabPatchKt {
693697
public static final fun getPremiumNavbarTabPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
694698
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package app.revanced.patches.spotify.misc.widgets
2+
3+
import app.revanced.patcher.fingerprint
4+
import app.revanced.util.indexOfFirstInstruction
5+
import com.android.tools.smali.dexlib2.Opcode
6+
7+
internal val canBindAppWidgetPermissionFingerprint = fingerprint {
8+
strings("android.permission.BIND_APPWIDGET")
9+
opcodes(Opcode.AND_INT_LIT8)
10+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package app.revanced.patches.spotify.misc.widgets
2+
3+
import app.revanced.patcher.patch.bytecodePatch
4+
import app.revanced.util.returnEarly
5+
6+
@Suppress("unused")
7+
val fixThirdPartyLaunchersWidgets = bytecodePatch(
8+
name = "Fix third party launchers widgets",
9+
description = "Fixes Spotify widgets not working in third party launchers, like Nova Launcher.",
10+
) {
11+
compatibleWith("com.spotify.music")
12+
13+
execute {
14+
// Only system app launchers are granted the BIND_APPWIDGET permission.
15+
// Override the method that checks for it to always return true, as this permission is not actually required
16+
// for the widgets to work.
17+
canBindAppWidgetPermissionFingerprint.method.returnEarly(true)
18+
}
19+
}

0 commit comments

Comments
 (0)