As I’m currently migrating my FP2 to the LineageOS fork including microG (also see this thread) I was wondering how to get some FP OS specifics (like the background images or the Fairphone ringtone) to LineageOS.
I found this how to article giving some valuable hints where to find e.g. the wallpaper files, but of course you’ll need a rooted device (still) containing the respective files, which means that you would have known you’ll miss them before having flashed the new OS.
If you didn’t, you can use the full binary images Fairphone provides on the support page and extract them from there.
Some remarks regarding prerequisites I found during my experiments and web searches:
- The files I wanted to extract are located in the system partition.
- The
/system/framework/framework-res.apk
file mentioned in the blog post above only contains Android (i.e. AOSP) stock wallpapers. The FP2 wallpapers are contained in the Fairphone launcher app. - The partition image files contained in the zip’s provided by Fairphone “are dumped partitions in “Android sparse image” format… you will need to convert them with simg2img before mounting them to extract any content.” (citing @Roboe).
- On my machine running Ubuntu 16.04 LTS I needed to install android-tools-fsutils (
apt install android-tools-fsutils
) first to be able to usesimg2img
.
Now here’s the step-by-step procedure:
- Download the image of choice, e.g. FP OS 17.11.02 image, to your machine.
- Open the zip file using the archive manager and unzip the system partition image file
system.img
to some folder, e.g. to/home/bemigro/FP2/system.img
. - Now use a terminal window to convert the file from Android sparse image format to raw ext4 image format by typing
simg2img system.img sys-raw.img
. - Mount the image
sys-raw.img
using the file manager and navigate to the desired apk file; the Fairphone wallpapers are packaged in the Fairphone launcher/system/priv-app/FairphoneLauncher3/FairphoneLauncher3.apk
. - Open the apk file with the archive manager; extracting the apk’s contents (e.g. subfolder
FP2/FairphoneLauncher3/
) makes searching easier. As an example, the wallpapers are (depending on the resolution) .jpg (or .png) files in one of theres/drawable*
folders (e.g.res/drawable_nodpi_v4/wallpaper_press.jpg
). - Copy the desired files to an appropriate folder on your FP2, e.g. wallpaper files to the
Pictures
folder.
Two more side remarks:
- Since I mentioned it above: the Fairphone ringtone is not packaged in an apk, but can be found as a separate file in the system image as
/system/media/audio/ringtones/Fairphone.mp3
. - Of course you could also go ahead and integrate those files into your own (flashable) system image, but that’s just a bit too far beyond my horizon.