-
Notifications
You must be signed in to change notification settings - Fork 130
Modifying the standby screen image
Note: you cannot reuse old modified framework-res.apk to replace the one in the new firmware, as it has been changed. After upgrading, all changes to the system partition are wiped. Therefore, you need to redo it.
The screen is rendered at boot by com.android.server.power.PowerManagerService . PowerManagerService calls configChanged in com.sony.infras.standbyscreenmanager.StandbyScreenManager . StandbyScreenManager renders a layout to a bitmap and sets the standby screen by calling setStandbyScreenBitmap in com.sony.infras.dp_libraries.systemutil.SystemUtil$EpdUtil. These classes can be found in /system/framework/arm/services.odex .
The layout is defined in /system/framework/framework-res.apk at /res/layout/screen_standby.xml . This layout refers to @drawable/img_digitalpaper_stamp which can be found at /res/drawable-mdpi-v4/img_digitalpaper_stamp.png. It also refers to @string/STR_SCRLINE_1001 which is the "Pressing the power button" line at the top. This can be found in /res/values/strings.xml.
Easy mode is to just replace /res/drawable-mdpi-v4/img_digitalpaper_stamp.png in framework-res.apk with your own image and then reboot the device. But since this is rendered from a layout you can get fancy with it if you like.
Step by step:
-
Pull the apk from the device through adb.
adb pull /system/framework/framework-res.apk
-
Decode the apk with apktool.
apktool decode framework-res.apk
-
Make whatever modification you intend to the resources mentioned above.
cp ~/new-image.png framework-res/res/drawable-mdpi-v4/img_digitalpaper_stamp.png
-
Rebuild the apk with apktool keeping the original signature and manifest.
apktool build --copy-original framework-res
-
Push the rebuilt apk to a location on the device that happy's adbd has write permission to.
adb push framework-res/dist/framework-res.apk /storage/sdcard0
-
Remount the system partition read-write.
adb shell su -c "mount -o rw,remount /system"
-
Backup the original for easy fix if things go wrong.
adb shell su -c "cp -p /system/framework/framework-res.apk /system/framework/framework-res.apk.bak"
-
Move the new apk into place.
adb shell su -c "mv /storage/sdcard0/framework-res.apk /system/framework/framework-res.apk"
-
Fixup the ownership and permissions
adb shell su -c "chown root:root /system/framework/framework-res.apk"
adb shell su -c "chmod 0644 /system/framework/framework-res.apk"
-
Finally reboot the device
If all went well your modifications should be visible after the device reboots.
If all did not go well you will be stuck at the spinning arrows. You should still be able to adb shell in and put the original back in place and ensure the ownership and permissions are as above. As soon as this is done the boot will complete.