PSA | Cursed wallpaper soft-bricks several Android phones: Details and possible workarounds
What can typically cause an Android smartphone to malfunction? Poorly coded apps? Malware? Low memory? A bad custom ROM? The causes can be many, but now we can also add a seemingly innocuous wallpaper to the list. Yes, a wallpaper and no, it is not a prank.
Known leaker Ice Universe has cautioned everyone not to set a particular image as the wallpaper as it can result in the phone crashing requiring nothing less than a factory reset to come back to normal.
Initially, it was thought that this bug affected only the latest Samsung devices. But users are also reporting that their Pixel, Nokia, Xiaomi phones, and even the Android emulator are effectively soft-bricked. Setting this image as a wallpaper can cause SystemUI to crash resulting in a boot loop. Devices such as the Huawei Mate 20 Pro and OnePlus phones are reportedly unaffected.
So, how can a seemingly harmless wallpaper bring down an entire device?
It's all in the color profile
The answer seems to lie in the color profile that the image uses. According to user /u/xanaxdroid on Reddit, the said image seems to have an incorrect Google Skia color profile.
The image has an embedded color profile, Google/Skia/E3CADAB7BD3DE5E3436874D2A9DEE126, which I'm assuming was encoded incorrectly to crash systemui somehow since Android uses Skia in their frameworks. It's com.android.systemui.glwallpaper.ImageProcessHelper that is crashing from an ArrayIndexOutOfBoudsException.
Edit: I removed the color profile and and now it doesn't crash."
Analyzing the SystemUI crash log indicates an OutofBoundsException error. The reason for this error can be traced to the ImageProcessHelper.java source code. In this code, "y" can take a maximum value of 255, which works fine for sRGB. Since the image supposedly has a larger color space, the value goes above 255 causing an OutofBoundsException error resulting in a System UI crash. Android tries to recover the System UI but since it cannot change the wallpaper, the crash happens each time SystemUI is re-initialized resulting in a boot loop.
This issue seems to affect mostly Samsung phones and those based on stock Android 10 or AOSP-based ROMs.
A few scenarios that may not result in a crash include:
- Using older Android versions prior to Android 10.
- Using a heavily modified custom or OEM ROM (YMMV).
- Using a screenshot of the said image as wallpaper.
- Converting the image into sRGB using Photoshop, GIMP, or similar software.
- Downloading the image from sites that compress the image, remove metadata, or change the color profile.
- Simply viewing the image in the phone's gallery without setting it as the wallpaper.
In fact, not all photo viewers are able to display the full dynamic range of the image either. For example, Windows Photo Viewer and Paint.NET show the image in toned-down colors while Photoshop and GIMP are able to show the full dynamic range (see image below).
So far, the only remedy being suggested is to reboot the phone in safe mode and change the wallpaper to something else. If that is not possible, a factory reset is the only option left. That being said, there are a few potential workarounds one can try.
- If you have a rooted phone with TWRP or a custom bootloader installed, it is possible to recover from the crash. Boot the phone in recovery, then navigate to TWRP -> Advanced -> File Manager -> Data -> System -> Users -> 0. Here, delete all files with the name "Wallpaper" (usually the last three ones) and reboot.
- For those with non-rooted phones, a possible workaround is to launch the camera app by quickly double pressing the power button (the camera shortcut in most phones), taking a photo, and setting it as the wallpaper from the gallery app.
- Another potential solution would be to have someone call when the phone is stuck in the lockscreen, unlock the phone, and try changing the wallpaper while on call.
Actually, this problem is not a new one and has been there since at least two years ago as evidenced by this Reddit post and this Google Issue Tracker thread wherein it was reported that certain images served via the Google Wallpapers app repeatedly crashed SystemUI. Back then, Google changed the status of the issue to "Won't Fix (Not Reproducible)" but has since updated the status on May 16 saying,
Hello Team Pixel,
Thank you for taking the time to report this issue. We have removed the wallpaper in question from the app and will roll out a preventative fix in a future Android release.
Pixel Community Team"
Hopefully, Google will incorporate native support for higher color gamut ranges in future AOSP code. Apparently, according to a report by 9to5Google, the issue does not affect Android 11 Developer Preview as it can convert the color space to one that the device natively supports. Till the issue is officially resolved, prevention is better than cure, and it is advised not to load the said wallpaper on daily-driver phones.
WARNING！！！— Ice universe (@UniverseIce) May 31, 2020
Never set this picture as wallpaper, especially for Samsung mobile phone users!
It will cause your phone to crash!
Don't try it!
If someone sends you this picture, please ignore it. pic.twitter.com/rVbozJdhkL