RxLogger APIs

RxLogger 14.0

Overview

The functionality of RxLogger is managed through Android intents sent from third-party applications. The method required to interact with RxLogger depends on whether Secure Mode is on or off.


API Reference

Note: The Legacy category applies when Secure Mode is turned off.

Operation Category Intent Extra Value
BackupNow RxLogger (Legacy) com.symbol.rxlogger.intent.action.BACKUP_NOW None None
Secure RxLogger (Token Based) com.symbol.rxlogger.intent.action.BACKUP_NOW token <token>
password <password>
Secure RxLogger (Permission Based) com.zebra.rxlogger.intent.action.BACKUP_NOW_ZSX password <password>
Bug Report RxLogger (Legacy) com.symbol.rxlogger.intent.action.RX_BUGREPORT None None
Secure RxLogger (Token Based) com.symbol.rxlogger.intent.action.RX_BUGREPORT token <token>
Secure RxLogger (Permission Based) com.zebra.rxlogger.intent.action.RX_BUGREPORT_ZSX None None
Disable RxLogger (Legacy) com.symbol.rxlogger.intent.action.DISABLE None None
Secure RxLogger (Token Based) com.symbol.rxlogger.intent.action.DISABLE token <token>
Secure RxLogger (Permission Based) com.zebra.rxlogger.intent.action.DISABLE_ZSX None None
Delete Logs RxLogger (Legacy) com.symbol.rxlogger.intent.action.DELETE_LOGS logType 0, 1, or 2
Secure RxLogger (Token Based) com.symbol.rxlogger.intent.action.DELETE_LOGS token <token>
logType 0, 1, or 2
Secure RxLogger (Permission Based) com.zebra.rxlogger.intent.action.DELETE_LOGS_ZSX logType 0, 1, or 2
Enable RxLogger (Legacy) com.symbol.rxlogger.intent.action.ENABLE None None
Secure RxLogger (Token Based) com.symbol.rxlogger.intent.action.ENABLE token <token>
Secure RxLogger (Permission Based) com.zebra.rxlogger.intent.action.ENABLE_ZSX None None
Reset to Default RxLogger (Legacy) com.symbol.rxlogger.intent.action.RESET_TO_DEFAULT None None
Secure RxLogger (Token Based) com.symbol.rxlogger.intent.action.RESET_TO_DEFAULT token <token>
Secure RxLogger (Permission Based) com.zebra.rxlogger.intent.action.RESET_TO_DEFAULT_ZSX None None


Status Intents:

The following status intents are broadcast by the system as an acknowledgement to confirm the outcome of a command sent.

Operation Status Intent
Enable com.symbol.rxlogger.intent.action.ENABLE_STATUS
Disable com.symbol.rxlogger.intent.action.DISABLE_STATUS
BackupNow com.symbol.rxlogger.intent.action.BACKUP_NOW_STATUS
Delete Logs com.symbol.rxlogger.intent.action.DELETE_LOGS_STATUS
Bug Report com.symbol.rxlogger.intent.action.RX_BUGREPORT_STATUS
Reset to Default com.symbol.rxlogger.intent.action.RESET_TO_DEFAULT_STATUS

Secure Mode

Secure Mode is off by default. To turn it on, see instructions to Enable Secure Mode.

When Secure Mode is ON: Use one of the following secure methods to use Android intents:

  • AppOps (Recommended)- Use Android's AppOpsManager to control access to RxLogger, enhancing security by managing permissions for RxLogger operations.
  • App Token - Include a token as an extra within intents to access to the RxLogger APIs.

When Secure Mode is OFF: Standard Android intents are used without requiring an extra token or permission check. Refer to specific intent documentation for its required structure.

AppOps

To grant an app access to RxLogger APIs in Secure Mode using the AppOps method, execute the following shell command:

    appops set --user 0 com.symbol.your_app ACCESS_RXLOGGER allow

Replace com.symbol.your_app with your app's package name and adjust the permission mode as needed:

  • allow - grants access
  • ignore - denies access

App Token

To grant an app access to RxLogger APIs in Secure Mode using an app token, include the token as an extra in the intents. This token can be obtained through one of the following methods:

  • Zebra Device Manager with Delegation Scope
    • Use “token” and “password” as keys.
    • Delegation scope: delegation-zebra-com-symbol-secure-rxlogger
  • Access Manager in StageNow:
    • Grant access through Service Access Action using the package name, signature and service identifier (for Android 13 or higher: delegation-zebra-com-symbol-secure-rxlogger).

Procedure to request the token and send an intent:

  1. Download and import the library BroadcastProtectionLibrary.aar into your application project.

    import com.zebra.security.broadcastprotection.BroadCastAuthenticator;
    
  2. Instantiate BroadCastAuthenticator in your activity, fragment or service.

    BroadCastAuthenticator vIntentprotect = new BroadCastAuthenticator();
    
  3. In the onCreate() method, add the following:

    vIntentprotect.initialize(getApplicationContext());
    
  4. If needed, request a token using the getToken() API:

    String token=vIntentprotect.getToken("delegation-zebra-com-symbol-secure-rxlogger");
    
  5. Send the intent with the token as extras:

    Intent intent = new Intent();
    intent.setAction("<specify_intent>");
    intent.putExtra("token", token);
    sendBroadcast(intent);
    

    Replace <specify_intent> with the specific intent, e.g. com.symbol.rxlogger.intent.action.ENABLE.

  6. In the onDestroy() method, terminate with:

    vIntentprotect.terminate();
    

Enable RxLogger

This initiates data collection for all enabled modules, equivalent to tapping the Start button. Special instructions apply when RxLogger is operated in Secure Mode.

Standard method using an intent to start RxLogger (Secure Mode Off):

    intent.setAction("com.symbol.rxlogger.intent.action.ENABLE"); 
    intent.setPackage("com.symbol.dd"); 
    sendBroadcast(intent);

Secure Method (Secure Mode On)

To start RxLogger when in Secure Mode, use one of the following methods:

  • AppOps (Recommended) - Send an intent from a third-party app:

    intent.setAction("com.zebra.rxlogger.intent.action.ENABLE_ZSX"); 
    intent.setPackage("com.symbol.dd"); 
    sendBroadcast(intent);
    
  • App Token - Send an intent with a token from a third-party app. Include a token as an extra in the intent. Replace <your-app-token> with the obtained token, see App Token.

    intent.setAction("com.symbol.rxlogger.intent.action.ENABLE"); 
    intent.setPackage("com.symbol.dd"); 
    intent.putExtra("token", "<your-app-token>"); 
    sendBroadcast(intent);
    

Enable Status

This intent informs the third-party app that RxLogger has begun capturing logs. RxLogger sends this acknowledgment intent once it enters the running state.

Intent:

    com.symbol.rxlogger.intent.action.ENABLE_STATUS

Extras included in the intent:

Extra Values
result 0
-1
status success
failure
error_code 0
1
message Enable RxLogger Success
Intent failed, RxLogger already in running state

Disable RxLogger

This stops data collection for all modules; the equivalent of tapping the Stop button. Special instructions apply when RxLogger is operated in Secure Mode.

Standard method using an intent to stop RxLogger (Secure Mode off):

    intent.setAction("com.symbol.rxlogger.intent.action.DISABLE"); 
    intent.setPackage("com.symbol.dd"); 
    sendBroadcast(intent);

Secure Method (Secure Mode On)

To stop RxLogger when in Secure Mode, use one of the following methods:

  • AppOps (Recommended) - Send an intent from a third-party app:

    intent.setAction("com.zebra.rxlogger.intent.action.DISABLE_ZSX"); 
    intent.setPackage("com.symbol.dd"); 
    sendBroadcast(intent);
    
  • App Token - Send an intent with a token from a third-party app. Include a token as an extra in the intent. Replace <your-app-token> with the obtained token, see App Token.

    intent.setAction("com.symbol.rxlogger.intent.action.DISABLE"); 
    intent.setPackage("com.symbol.dd"); 
    intent.putExtra("token", "<your-app-token>"); 
    sendBroadcast(intent);
    

Disable Status

This informs the third-party app that RxLogger has stopped capturing logs. RxLogger sends this acknowledgment intent once it stops log capture.

Intent:

    com.symbol.rxlogger.intent.action.DISABLE_STATUS

Extras included in the intent:

Extra Values
result 0
-1
status success
failure
error_code 0
1
message Disable RxLogger Success
Intent failed, RxLogger already in running state

BackupNow

This initiates a backup of log files in the RxLogger folder, compressing them into a zip file named Backup-<date>-<HHMMSS>.zip, where <date>-<HHMMSS> is time stamp. Special instructions apply when operating RxLogger in Secure Mode.

Standard method (Secure Mode Off) using an intent to stop RxLogger:

    intent.setAction("com.symbol.rxlogger.intent.action.BACKUP_NOW"); 
    intent.setPackage("com.symbol.dd"); 
    sendBroadcast(intent);

Secure Method (Secure Mode On)

To trigger a backup in Secure Mode, use one of the following methods:

  • AppOps (Recommended) - Send an intent from a third-party app. Replace <password> with the password set for app access, see AppOps.

    intent.setAction("com.zebra.rxlogger.intent.action.BACKUP_NOW_ZSX"); 
    intent.setPackage("com.symbol.dd"); 
    intent.putExtra("password", "<password>"); 
    sendBroadcast(intent);
    
  • App Token - Send an intent with a token from a third-party app. Include a token as an extra in the intent. Replace <your-app-token> with the obtained token and <password> with the password set, see App Token.

    intent.setAction("com.symbol.rxlogger.intent.action.BACKUP_NOW"); 
    intent.setPackage("com.symbol.dd"); 
    intent.putExtra("token", "<your-app-token>"); 
    intent.putExtra("password", "<password>"); 
    sendBroadcast(intent);
    

BackupNow Status

This provides the status of the backup operation. RxLogger sends an acknowledgment intent to convey the backup status, including extras such as status, message and the absolute path of the backup zip file. These extras vary based on whether Secure Mode is enabled.

Intent:

    com.symbol.rxlogger.intent.action.BACKUP_NOW_STATUS

Secure Mode Off (Legacy):

Extra Success Message Failure Message
status success failed
message Backup Success Backup Failed
filepath /sdcard/rxlogger/Backup-<date>-<HHMMSS>.zip null


Secure Mode On:

Extra Success Message Failure Message
status success failed
message Backup Success Backup Failed
filepath /<Secure_RxLogger_Path>/SecureBackup-<date>-<HHMMSS>.zip

Where "<Secure_RxLogger_Path>" represents one of the following:
   • Internal storage path: /sdcard/Android/data/com.symbol.rxlogger/RxLogger/secure/log_data/
   • External storage path: /storage/<UUID>/Android/data/com.symbol.rxlogger/RxLogger/secure/log_data/
null

Remote Info Logging

When operating in Secure Mode, all events related to use of remote intents, including both success and failure information, are captured in the file RxInfo.txt. Error details may include instances where remote intents failed to start, stop, or back up RxLogger. This file is located in one of the following folders:

  • Internal storage path: /sdcard/RxLogger/
  • External storage path: /storage/<UUID>/RxLogger/ (where <UUID> is the device's unique identifier)

Reset to Default

This resets RxLogger settings to their default values across all modules. Special instructions apply when RxLogger is in Secure Mode.

Select the method to perform a reset to default based on whether secure mode is enabled:

  • Standard Method (Secure Mode Off) - Send an intent:

    intent.setAction("com.symbol.rxlogger.intent.action.RESET_TO_DEFAULT"); 
    intent.setPackage("com.symbol.dd"); 
    sendBroadcast(intent);
    
  • Secure Method (Secure Mode On) - Choose one of the following:

    • AppOps (Recommended) - Send an intent from a third-party app:

      intent.setAction("com.zebra.rxlogger.intent.action.RESET_TO_DEFAULT_ZSX"); 
      intent.setPackage("com.symbol.dd"); 
      sendBroadcast(intent);
      
    • App Token - Send an intent with a token from a third-party app, replacing <your-app-token> with the obtained token (see App Token):

      intent.setAction("com.symbol.rxlogger.intent.action.RESET_TO_DEFAULT"); 
      intent.setPackage("com.symbol.dd"); 
      intent.putExtra("token", "<your-app-token>"); 
      sendBroadcast(intent);
      

Status

This intent notifies the third-party app that RxLogger settings have been restored to their default state. RxLogger dispatches this acknowledgment intent upon completing the reset process.

Intent:

    com.symbol.rxlogger.intent.action.RESET_TO_DEFAULT_STATUS 

Extras returned from the result include the following:

error_code result status message
0 0 success N/A
1 -1 failure Intent failed, Reset to default currently running
2 -1 failure RxLogger running, cannot do reset to default

Delete Logs

This removes logs located in the RxLogger folder. Special instructions apply when RxLogger is in Secure Mode.

Select the method to delete logs based on whether secure mode is enabled:

  • Standard Method (Secure Mode Off) - Send an intent:

    intent.setAction("com.symbol.rxlogger.intent.action.DELETE_LOGS "); 
    intent.setPackage("com.symbol.dd"); 
    sendBroadcast(intent);
    
  • Secure Method (Secure Mode On) - To delete logs using a secure method, the intent must include a <logtype> parameter. This determines which files are deleted. If the parameter is omitted or an invalid value is used, the action defaults to deleting all files. The <logtype> parameter aaccepts one of the following values:

    • 0 - Deletes all files in the RxLogger folder (logs and backups), except for config.json and RxInfo.txt.
    • 1 - Deletes only the log files, retaining all backup files.
    • 2 - Deletes only the backup files, retaining all log files.

    Choose one of the following:

    • AppOps (Recommended) - Send an intent from a third-party app:

      intent.setAction("com.zebra.rxlogger.intent.action.DELETE_LOGS_ZSX"); 
      intent.setPackage("com.symbol.dd");
      intent.putExtra("logType", "<logType>"); 
      sendBroadcast(intent);
      
    • App Token - Send an intent with a token from a third-party app, replacing <your-app-token> with the obtained token (see App Token):

      intent.setAction("com.symbol.rxlogger.intent.action.DELETE_LOGS"); 
      intent.setPackage("com.symbol.dd"); 
      intent.putExtra("token", "<your-app-token>");
      intent.putExtra("logType", "<logType>"); 
      sendBroadcast(intent);
      

Status

This intent notifies the third-party app that the RxLogger logs have been deleted. RxLogger issues this acknowledgment after completing the deletion process.

Intent:

    com.symbol.rxlogger.intent.action.DELETE_LOGS_STATUS  

Extras returned from the result include the following:

error_code result status message
0 0 success N/A
1 -1 failure Intent failed, Delete Logs currently running
2 -1 failure RxLogger running, Cannot delete its log

Bug Report

This initiates the process of generating a bug report, providing comprehensive diagnostic information to aid in troubleshooting and performance analysis. Special instructions apply when RxLogger operates in Secure Mode.

Select the method to delete logs based on whether secure mode is enabled:

  • Standard Method (Secure Mode Off) - Send an intent:

    intent.setAction("com.symbol.rxlogger.intent.action.RX_BUGREPORT"); 
    intent.setPackage("com.symbol.dd"); 
    sendBroadcast(intent);
    
  • Secure Method (Secure Mode On) - Choose one of the following:

    • AppOps (Recommended) - Send an intent from a third-party app:

      intent.setAction("com.zebra.rxlogger.intent.action.RX_BUGREPORT_ZSX"); 
      intent.setPackage("com.symbol.dd"); 
      sendBroadcast(intent);
      
    • App Token - Send an intent with a token from a third-party app, replacing <your-app-token> with the obtained token (see App Token):

      intent.setAction("com.symbol.rxlogger.intent.action.RX_BUGREPORT"); 
      intent.setPackage("com.symbol.dd");
      intent.putExtra("token", "<your-app-token>"); 
      sendBroadcast(intent);
      

Status

This intent alerts the third-party app that RxLogger has successfully generated the bug report. RxLogger issues this acknowledgment once the bug report is generated.

Intent:

    com.symbol.rxlogger.intent.action.RX_BUGREPORT_STATUS  

Extras returned from the result include the following:

error_code result status message
0 0 success N/A
1 -1 failure Intent failed, Bugreport currently running
2 -1 failure Copy Bugreport file from source to RxLogger folder failed
3 -1 failure Bugreport file not generated at source

  • About RxLogger - Provides an overview of RxLogger and how to use
  • Settings - How to configure data collection module parameters
  • Modules - Explains data collection module parameters and settings
  • Log Viewer - View RxLogger logs in realtime