Can android user become a super user in android? Is it possible to change the rights of normal user in android to super user? 

My requirement is to run the super user code(I want to read a file data from system directory) in a device that has rooted shell but we can not install any super user manager(SuperSu, Magisk etc.) on that device.

I thought of a solution like following:


Install an apk in your device that has UI to call the required function on JNI side to start reading data from the file.
Find the user id of the installed application. I found it in data/system/packages.list file.
Make file owner is this new user id with su shell.
Call the required function in the application that further try to open file. 


but this solution is not working. The file is not opened by code and return -8002. The errno is 13.

fd = open("/system/file.txt", O_RDWR | O_LARGEFILE | O_NONBLOCK);
    if (fd &lt; 0) {
        return -8002;
    }


This is very important for us. 
I shall be very thankful to all who will help me on this.
Depends what you want to do. With su (if it is installed) you became a superuser... But if you want to access some files you actually need to be the user system.  This looks like it is your case. The credentials of user system can be given to an app (apk) if you are the owner of the android os image or you have access to the private keys the os was built with... If you do then you need to sign your app with those keys and mark it in manifest as user system...