@henri2h You can't modify the file directly, it's Squashfs filesystem (see https://en.wikipedia.org/wiki/SquashFS). The best way to override it is via rootfs-overlay as I wrote.
To repack the image, you need some linux distro. Download the right android filesystem image from https://cdimage.ubports.com/anbox-images/. According to https://cdimage.ubports.com/anbox-images/devices.json it's android-armhf-64binder.img. You also need to have installed squashfs-tools package.
Uncompress the filesystem as root to keep uid and gid identities:
sudo unsquashfs android-armhf-64binder.img
you will see something like this:
Parallel unsquashfs: Using 4 processors
1429 inodes (5270 blocks) to write
[=================================-] 5270/5270 100%
created 1239 files
created 274 directories
created 190 symlinks
created 0 devices
created 0 fifos
it creates squashfs-root folder, locate squashfs-root/system/etc/media_codecs.xml file, rewrite it (as root) by the fixed one (http://dpaste.com/2H2CP58) and set the right owner:
sudo chown 100000:100000 media_codecs.xml
compress the filesystem into android.img:
sudo mksquashfs squashfs-root/ android.img -noappend -no-xattrs -comp xz
you will see something like this:
Parallel mksquashfs: Using 4 processors
Creating 4.0 filesystem on android.img, block size 131072.
[=================================] 5080/5080 100%
Exportable Squashfs 4.0 filesystem, xz compressed, data block size 131072
compressed data, compressed metadata, compressed fragments,
no xattrs, compressed ids
duplicates are removed
Filesystem size 212128.35 Kbytes (207.16 Mbytes)
39.95% of uncompressed filesystem size (531034.87 Kbytes)
Inode table size 23934 bytes (23.37 Kbytes)
33.61% of uncompressed inode table size (71204 bytes)
Directory table size 16322 bytes (15.94 Kbytes)
43.33% of uncompressed directory table size (37666 bytes)
Number of duplicate files found 38
Number of inodes 1703
Number of files 1239
Number of fragments 229
Number of symbolic links 190
Number of device nodes 0
Number of fifo nodes 0
Number of socket nodes 0
Number of directories 274
Number of ids (unique uids + gids) 4
Number of uids 2
unknown (100000)
unknown (101000)
Number of gids 4
unknown (100000)
unknown (102000)
unknown (101000)
unknown (101003)
Copy the new created android.img file into the phone's home folder into anbox-data and rewrite the original one.