Patch Youtube Music to Remove Fullscreen Lockscreen Cover
This is a stupid feature -- so stupid that Google decided to remove it in Android 11 -- and Oneplus decided to "forward port" it to Android 11. I think it's finally gone in Android 12.
You can check the creepy screenshot in the Reddit post.
It's also a requested feature for Revanced but no update from developers yet.
Patch
A quick note for getting this along with Revanced(obviously I need other patches)
Patch YT Music in Revanced Manager as usual and install as mounted. It's an Oneplus(stock rom) issue so no need for MicroG.
Copy the patched apk
/data/adb/revanced/com.google.android.apps.youtube.music/base.apk
to PC.Use APKTOOL to unpack, modify the smali and repack.
To patch the smail, findanor.smali
insmali_classes2
folder.
Note, the exact file name may subject to change, in the future, search"android.media.metadata.ALBUM_ART"
, there should be a function for setting up various meta fields. Patch it to skip "ALBUM_ART", which making it NULL, and, disable lockscreen cover.1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27const-string v2, "android.media.metadata.ALBUM"
invoke-virtual {v1, v2, v0}, Lhe;->e(Ljava/lang/String;Ljava/lang/String;)V
:cond_0
iget-object v0, p0, Laonr;->h:Laomy;
iget-object v0, v0, Laomy;->r:Landroid/graphics/Bitmap;
#if-eqz v0, :cond_1
#>>>>>>change if-eqz v0 to goto<<<<<<<<
goto :cond_1
const-string v2, "android.media.metadata.ALBUM_ART"
invoke-virtual {v1, v2, v0}, Lhe;->b(Ljava/lang/String;Landroid/graphics/Bitmap;)V
:cond_1
iget-object v0, p0, Laonr;->k:Laons;
iget-object v2, p0, Laonr;->h:Laomy;
invoke-interface {v0, v1, v2}, Laons;->f(Lhe;Laomy;)V
return-object v1
.end methodSign the apk with apksigner. This must be signed, can use own key but can't unsigned or "reuse" original sign.
Name the new apk as "base.apk" and put it back, overwrite
/data/adb/revanced/com.google.android.apps.youtube.music/base.apk
Force stop Youtube Music and reopen. The change should take effect then.
This doesn't affect the small icon shown in pulldown or lockscreen, so everything is good now.
How it works
In Android source code
1 | Bitmap artworkBitmap = null; |
Bitmap is loaded from MediaMetadata.METADATA_KEY_ART
and MediaMetadata.METADATA_KEY_ALBUM_ART
, mProcessArtworkTasks.add
is called to update the lockscreen background.
In YT Music, android.media.metadata.ART
is unused only android.media.metadata.ALBUM_ART
, a NULL value will disable the lockscreen background. For other apps with similar issue might need to patch both fields. Another options is to patch SYSTEMUI.apk
, making a Magisk module for a system-wide fix.