How to Change the Terminal Administrator's Login Password: Difference between revisions
No edit summary |
No edit summary |
||
Line 14: | Line 14: | ||
== API Overview == | == API Overview == | ||
=== <big>Modify Admin Password</big> === | === <big>Modify Admin Password</big> === | ||
<syntaxhighlight lang="java">boolean modifyAdminPwd(String oldPwd, String newPwd);</syntaxhighlight > | |||
* This function allows the modification of the admin password. Provide the current password (''''oldPwd'''') and the new password (''''newPwd'''') as arguments. | * This function allows the modification of the admin password. Provide the current password (''''oldPwd'''') and the new password (''''newPwd'''') as arguments. | ||
{|class="wizarpostable" | {|class="wizarpostable" | ||
Line 35: | Line 35: | ||
|} | |} | ||
=== <big>Check Admin Password</big> === | === <big>Check Admin Password</big> === | ||
<syntaxhighlight lang="java">boolean isAdminPwd(String pwd);</syntaxhighlight > | |||
* Returns ''''true'''' if the provided password (''''pwd'''') matches the current admin password. | * Returns ''''true'''' if the provided password (''''pwd'''') matches the current admin password. | ||
{|class="wizarpostable" | {|class="wizarpostable" | ||
Line 54: | Line 54: | ||
|} | |} | ||
=== <big>Reset Password (System APK Only)</big> === | === <big>Reset Password (System APK Only)</big> === | ||
<syntaxhighlight lang="java">boolean reset(String pwd);</syntaxhighlight > | |||
* Resets the admin password. Due to security reasons, this method is exclusive to system APKs and cannot be called by third-party apps. | * Resets the admin password. Due to security reasons, this method is exclusive to system APKs and cannot be called by third-party apps. | ||
{|class="wizarpostable" | {|class="wizarpostable" |
Revision as of 15:34, 4 January 2024
AIDL Interface for Managing Terminal Administrator Passwords
Required Permissions
- Applications must declare the specified permissions in their manifest to use this AIDL interface.
Permission | Function |
---|---|
android.permission.ADMIN_PWD_MODIFY | modify admin password |
android.permission.ADMIN_PWD | get admin password |
android.permission.ADMIN_PWD_RESET | reset admin password |
API Overview
Modify Admin Password
boolean modifyAdminPwd(String oldPwd, String newPwd);
- This function allows the modification of the admin password. Provide the current password ('oldPwd') and the new password ('newPwd') as arguments.
Parameters | |
---|---|
oldPwd | String: old admin password. |
newPwd | String: new admin password. |
Returns | |
---|---|
boolean | true is success, false is failure. |
Check Admin Password
boolean isAdminPwd(String pwd);
- Returns 'true' if the provided password ('pwd') matches the current admin password.
Parameters | |
---|---|
pwd | String: admin password. |
Returns | |
---|---|
boolean | true is success, false is failure. |
Reset Password (System APK Only)
boolean reset(String pwd);
- Resets the admin password. Due to security reasons, this method is exclusive to system APKs and cannot be called by third-party apps.
Parameters | |
---|---|
pwd | String: the real admin password. |
Returns | |
---|---|
boolean | true is success, false is failure. |
Project Demo Download
- To implement these features, please download the complete project demo.