Running Android in lxc container?
Have Jolla engineers considered running Android in lxc container? It seems Cannonical is trying something like that for their "Ubuntu Touch" OS. Information on the Internet is sparse and seems to be limited to few smaller projects. Still interesting to take a look.
Benefits of this approach would obviously be:
better isolation of Sailfish and Android, as well as ability to fine tune and tweak "meeting points" where two OS's would be able to interact
Jolla would be able to apply AppArmour on the whole Android container;
Snapshoting Android rootfs via lxc/btrfs integration (to enable rolling back after some malicious program is installed or just something random went wrong)
Run multiple Android versions on Sailfish
Info links: https://wiki.ubuntu.com/Touch/ContainerArchitecture
https://lists.linuxcontainers.org/pipermail/lxc-devel/2013-December/006516.html
https://www.stgraber.org/2013/12/23/lxc-1-0-some-more-advanced-container-usage/
Does it mean the current way we run Android apps on SailfishOS is not isolated? For example, a proprietary Android app could inject a spyware in SailfishOS?
Update: any Android app can read and create files in SailfishOS folders (https://together.jolla.com/question/120006/malware-in-third-party-android-stores/?answer=121308#post-id-121308).
You can see that when using an Android app like Firefox and typing file:///home/nemo/ in the URL bar or by changing the download folder in about:config. To prevent this, I executed these commands:
chmod -R 700 /home/nemo/
andchmod -R 700 /media/sdcard/
(if you do it as root in order to protect files owned by root user, you will also have to dochmod 770 /home/nemo/.local/share/system/privileged/
to avoid having a black background after reboot and losing your calendar events after a firmware update, like it happened to me https://together.jolla.com/question/215126/calendar-events-missing-after-firmware-update/).Since Android data is saved in /home/nemo/android_storage/, you also need this command to access the parent folder and make the Firefox downloads work:
baptx ( 2019-04-11 14:51:04 +0200 )editchmod 710 /home/nemo/
. When you reboot, I noticed the /home/nemo/ permissions are reset and Android apps have access again to the SailfishOS data so unless there is a cleaner way to prevent permission changes, you will need tocd /home/nemo/
and use this command:chattr +i . Documents Downloads Pictures Videos Music Desktop .cache
.