Notes on understanding Android.
1. Storage
Android storage is really mind-boggling.
Background reading: https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt
2. Security
https://android.stackexchange.com/questions/210139/what-is-the-u-everybody-uid/210159#210159
Selinux?
https://android.stackexchange.com/questions/210139/what-is-the-u-everybody-uid/
Runtime permissions
https://source.android.com/devices/storage#runtime_permissions
Namespaces
https://developer.android.com/training/data-storage#scoped-storage
3. getprop
This is a kind of “Registry” for system properties. “getprop” -T -Z
They have something like selinux attributes attached to them (crazy!), so you need to understand SELinux first, before doing anything useful with them.
I have not found a corresponding setprop, however, there exists settings
4. init.rc
This is something like what Android has instead of init.d (why would you reinvent the wheel again?). Magisk can plug into this file without making the system go insane, but I guess it is better to use Magisk’s services anyway.
5. List of Java apps:
/data/system/packages.list
6. am
Some command for activities/services management.
For example, you can restart “Airplane Mode” by typing:
#!/system/bin/sh settings put global airplane_mode_on 1 sleep 1 am broadcast -a android.intent.action.AIRPLANE_MODE sleep 1 settings put global airplane_mode_on 0 sleep 1 am broadcast -a android.intent.action.AIRPLANE_MODE