You could look into how opengapps script rebuilds the system.img of android, just skip downloading/extracting gapps and its apks, you just need the mounting/extracting insert your modified apn.xml here, then squash to get an .img in the end with your modifications
Edit: one example of the script Sony 10 III - Dual SIM (arm64) | Sailfish OS 4.6 | Android 11 | Open GApps pico installation script · GitHub
Just comment out the install_opengapps step, rest can be easily modified to inject your own versions of files into the extracted system.img before it gets squashed back
Edit2: what you see in /opt/appsupport/rootfs is that system.img mounted, if you kill appsupport files there disappear, so you need to make changes to the img before starting appsupport
1 Like