feat(Spotify): Add Fix third party launchers widgets
patch (#4893)
Co-authored-by: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
This commit is contained in:
@ -0,0 +1,10 @@
|
||||
package app.revanced.patches.spotify.misc.widgets
|
||||
|
||||
import app.revanced.patcher.fingerprint
|
||||
import app.revanced.util.indexOfFirstInstruction
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
|
||||
internal val canBindAppWidgetPermissionFingerprint = fingerprint {
|
||||
strings("android.permission.BIND_APPWIDGET")
|
||||
opcodes(Opcode.AND_INT_LIT8)
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package app.revanced.patches.spotify.misc.widgets
|
||||
|
||||
import app.revanced.patcher.patch.bytecodePatch
|
||||
import app.revanced.util.returnEarly
|
||||
|
||||
@Suppress("unused")
|
||||
val fixThirdPartyLaunchersWidgets = bytecodePatch(
|
||||
name = "Fix third party launchers widgets",
|
||||
description = "Fixes Spotify widgets not working in third party launchers, like Nova Launcher.",
|
||||
) {
|
||||
execute {
|
||||
// Only system app launchers are granted the BIND_APPWIDGET permission.
|
||||
// Override the method that checks for it to always return true, as this permission is not actually required
|
||||
// for the widgets to work.
|
||||
canBindAppWidgetPermissionFingerprint.method.returnEarly(true)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user