Your request seems to be focused on managing and restricting superuser (su) privileges for certain applications on a device. The goal is to provide a more secure environment by limiting which apps can gain root access. The proposed solution involves creating an 'app profile' for each app that needs to be managed. These profiles would specify which user the su command should switch to when executed by the app, such as 'adb' or another designated user. This approach would ensure that even if an app gains su access, it would only operate with limited permissions, enhancing overall system security.

You mentioned that you have considered using KernelSU as a solution, but it did not work due to compatibility issues with the GKI kernel on your device (Redmi Note 12T Pro). The kernel source for your device was also found to be difficult to work with, which further complicated the implementation of KernelSU.

As an alternative, you might consider exploring other root management applications that offer granular control over su permissions, or perhaps look into developing a custom solution that is compatible with your device's kernel. It may also be beneficial to seek support from the developer community or forums where you might find others who have faced similar challenges and have found effective solutions.