Because my work requires configuring the system’s wifi and Ethernet, I need to obtain system permissions before I can operate it. Therefore, I studied the system signature of the apk to obtain system permissions. In fact, I originally planned to do it if root could If you want to do it directly through root (the device is already rooted), I searched for a long time and found that there is no API to modify it, so I have no choice but to perform system signature. If anyone knows the root method to modify it, please let me know.
These files can be obtained from the system manufacturer. If it is a native system, they can be obtained from the system source code directory.
If the following error is reported, then use the prepared libconscrypt_openjdk_jni.so file
In order to detect whether our application has been successfully signed, we can obtain system permissions and see if we can obtain them. arrive.
Result:
In the previous method, we successfully signed our apk with the system and can use the system permissions, but we must package the apk and then sign it every time It is very inconvenient for debugging. Below we can generate a signature file with a system signature and use it in the project, so there is no need to sign manually every time.
Bubble can be replaced with the name you like. In this step, you need to enter the password. I tried entering other but it didn’t work. I can only enter android.
bubble can be replaced with your favorite password and alias
Here are two ways to system sign the app. If there are any deficiencies, please point them out.