How to Update User Role Passwords Using API: Difference between revisions

From wizarPOS
No edit summary
Line 1: Line 1:
The system provides the AIDL interface to update the user role password. The package name is '''com.wizarpos.wizarviewagentassistant''', and the class name is '''com.wizarpos.wizarviewagentassistant.AdminPwdMainService'''. When the application uses the interface, it must import the package and add permissions to the Android manifest file.
== Interface Details ==
 
* Package Name: ''''com.wizarpos.wizarviewagentassistant''''
== Permission ==
* Class Name: ''''com.wizarpos.wizarviewagentassistant.AdminPwdMainService''''
The application declares the following permissions in the manifest:
* Before using the interface, ensure the package is imported and necessary permissions are added to the Android manifest file.
  * android.permission.USER_PWD
== Required Permissions ==
  * android.permission.USER_PWD_MODIFY
* Include the following permissions in your application's manifest:
 
** ''''android.permission.USER_PWD''''
== API Overview ==
** ''''android.permission.USER_PWD_MODIFY''''
=== <big>isUserPwd</big>===
== API Functions ==
  <syntaxhighlight lang="java">boolean isUserPwd(String pwd);</syntaxhighlight>
* '''isUserPwd'''
Check whether the pwd is the user password.
** ''''boolean isUserPwd(String pwd)'''';
 
*** Checks if the provided string (''''pwd'''') is the current user password.
{|class="wizarpostable"
{|class="wizarpostable"
|-
|-
Line 27: Line 27:
|  boolean || true of false.
|  boolean || true of false.
|}
|}
 
* '''forceModifyUserPwd'''
=== <big>forceModifyUserPwd</big>===
** ''''boolean forceModifyUserPwd(String newPwd)'''';
  <syntaxhighlight lang="java">boolean forceModifyUserPwd(String newPwd);</syntaxhighlight>
*** Modifies the user role password to the new password (''''newPwd'''').
Modify the user role password.
 
{|class="wizarpostable"
{|class="wizarpostable"
|-
|-
Line 48: Line 46:
|  boolean || true of false.
|  boolean || true of false.
|}
|}
 
* '''enableUserLogin'''
=== <big>enableUserLogin</big> ===
** ''''boolean enableUserLogin(boolean enable)'''';
  <syntaxhighlight lang="java">boolean enableUserLogin(boolean eneable);</syntaxhighlight>
*** Enables or disables user role login based on the boolean value (''''enable'''').
Enable user role.
 
{|class="wizarpostable"
{|class="wizarpostable"
|-
|-
Line 69: Line 65:
|  boolean || true of false.
|  boolean || true of false.
|}
|}
 
== Code Snippet and AIDL File ==
 
* Access the necessary code snippets and [http://ftp.wizarpos.com/advanceSDK/IModifyAdminPwdService.aidl download the AIDL file] for implementation.
<big>Snippet code:</big>
<syntaxhighlight lang="java">
<syntaxhighlight lang="java">
<!-- AdminPwdMainService -->
<!-- AdminPwdMainService -->
Line 85: Line 80:


</syntaxhighlight >
</syntaxhighlight >
== Download ==
=== AIDL file ===
Please download the [http://ftp.wizarpos.com/advanceSDK/IModifyAdminPwdService.aidl aidl file]

Revision as of 23:06, 29 December 2023

Interface Details

  • Package Name: 'com.wizarpos.wizarviewagentassistant'
  • Class Name: 'com.wizarpos.wizarviewagentassistant.AdminPwdMainService'
  • Before using the interface, ensure the package is imported and necessary permissions are added to the Android manifest file.

Required Permissions

  • Include the following permissions in your application's manifest:
    • 'android.permission.USER_PWD'
    • 'android.permission.USER_PWD_MODIFY'

API Functions

  • isUserPwd
    • 'boolean isUserPwd(String pwd)';
      • Checks if the provided string ('pwd') is the current user password.
Parameters
pwd String: Not null.
Returns
boolean true of false.
  • forceModifyUserPwd
    • 'boolean forceModifyUserPwd(String newPwd)';
      • Modifies the user role password to the new password ('newPwd').
Parameters
newPwd String: Not null.
Returns
boolean true of false.
  • enableUserLogin
    • 'boolean enableUserLogin(boolean enable)';
      • Enables or disables user role login based on the boolean value ('enable').
Parameters
name boolean: true to enable, false to disable.
Returns
boolean true of false.

Code Snippet and AIDL File

<!-- AdminPwdMainService -->
<uses-permission android:name="android.permission.USER_PWD"/>
<uses-permission android:name="android.permission.USER_PWD_MODIFY"/>

boolean result = adminPwdService.forceModifyUserPwd(newPwd);
boolean isUserPwd = adminPwdService.isUserPwd(newPwd);

ComponentName comp = new ComponentName (
        "com.wizarpos.wizarviewagentassistant",
        "com.wizarpos.wizarviewagentassistant.AdminPwdMainService");