How can I properly mount my SD card as "internal" (i.e. so that all apps are on it) using a custom filesystem (in my case Ext4, but I'd like to use full-disk encryption using a key that I can decrypt when putting the SD card in my laptop too, and eventually switch to a custom FUSE filesystem, so it's not an ext4-specific question)?
According to https://source.android.com/security/encryption/full-disk, I would need to run class_stop late_start; class_stop main to halt all applications, mount on top of /data (I guess, any other location that should be hidden?), and restart with class_start late_start; class_start main. However, these commands do not exist, and don't seem to be sub-commands of init.
How would I do this stop-all-apps, mount-on-/data/, start-all-apps dance from an adb shell?
I have root access via adb, but no root access for apps. The bootloader is locked (needs to be for my banking app it seems), so I can't edit /etc/vold.fstab or any other file in /system or /vendor. I'm using /e/ os Android 10 (a fork of LineageOS).
adb shell. Theinitcommands you mentioned aren't to be executed from commandline but need to be put in some.rcfile: https://android.googlesource.com/platform/system/core/+/master/init/README.md#commands. They are already defined in.rcfiles by ROM developers and are executed automatically in proper sequence when you format your SD card as Adoptable (internal) Storage. – Irfan Latif Mar 10 '21 at 05:50init.rc(dm-crypt+mountormount+fscryptor mount a FUSE filesystem). I can't edit this file: it's on boot.img, and something in the system refuses to lock the bootloader if it's modified (e.g. I flashing a magisk'ed boot.img and locking gives a "corrupted" message, and my bank's app won't run with unlocked boot) – Suzanne Soy Mar 10 '21 at 23:53