End goal: my root app shouldn’t ever kernel panic (have init start a root daemon and disable SeLinux. Without disabling it, untrusted_app can’t connectto the daemon.
Or even easier: make a setuid (/system isn’t mounted blocking it) and have init turn off SeLinux so that untrusted_app can execute it.
I didn’t yet understand what this file is exactly but grim what you’re saying, this is exactly the type of thing I’m avoiding because of the variant differences. For this price I can patch SeLinux to add some rules.
If it would be the only way then maybe. But there’s the magisk firehose method + my app doesn’t cause that many kernel panics anyway. Only when you run root the first time after rebooting and your phone is anyway busy in the background
Update the app, the first time you use root after boot, don’t be running 17 apps in the background with battery bubbling.
Wait a minute after it turns on better you run it. (Just tips for better chances)
But there are other weirder differences between variants like the boot, and now an issue on my repo about install.sh failing on his att variant. Waiting on his logs
But if you have system r/w, and can find the correct file to edit in /system/etc/selinux/ (on any devices I’ve done it’s plat_seapp_contexts), couldn’t you make a script to
Detect newly installed package.
Get package name.
Add package-specific seapp_contexts rule.
Make sure target domain exists in compiled SELinux policy.
Make sure that domain can connect to the su daemon.
Reboot or restart enough Android services for the new mapping to apply.
For a newly installed /data/app package, a generated rule could look like: user=_app seinfo=default name=com.example.newapp domain=root_client_app type=app_data_file levelFrom=user
Or is this the type of thing you are trying to avoid??
I don’t have experience with patching SeLinux rules but if it can be device specific then I’m scared. The app will have to do all this programmatically and if the files look different on different devices then they’re probably different between the xp3 variants just because sonim loves making stuff the weird way all the time