RxLogger APIs

RxLogger 14.0

Overview

RxLogger's functionality can be controlled through Android intents within third-party applications.


Secure Mode

In Secure Mode, third-party apps must gain access to RxLogger APIs through one of two methods:

  • 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.

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:

    com.symbol.rxlogger.intent.action.ENABLE

Secure Method

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

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

    com.symbol.rxlogger.intent.action.ENABLE
    
  • App Token - Send an intent with a token from a third-party app:

    com.symbol.rxlogger.intent.action.ENABLE -e "token" "<token-id>"
    

    Include a token as an extra in the intent. Replace <token-id> with the obtained token, see App Token.

  • Shell Command - Execute the following command:

    com.symbol.rxlogger.intent.action.ENABLE_SHELL
    

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

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:

    com.symbol.rxlogger.intent.action.DISABLE

Secure Method

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

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

    com.symbol.rxlogger.intent.action.DISABLE
    
  • App Token - Send an intent with a token from a third-party app:

    com.symbol.rxlogger.intent.action.DISABLE -e "token" "<token-id>"
    

    Include a token as an extra in the intent. Replace <token-id> with the obtained token, see App Token.

  • Shell Command - Execute the following command:

    com.symbol.rxlogger.intent.action.DISABLE_SHELL
    

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

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 using an intent to stop RxLogger:

    com.symbol.rxlogger.intent.action.BACKUP_NOW

Secure Method

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

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

    com.symbol.rxlogger.intent.action.BACKUP_NOW  -e "password" "<password>"
    

    Replace <password> with the password set for app access, see AppOps.

  • App Token - Send an intent with a token from a third-party app:

    com.symbol.rxlogger.intent.action.BACKUP_NOW -e "token" "<token-id>" -e "password" "<password>"
    

    Includ a token as an extra in the intent. Replace <token-id> with the obtained token and <password> with the password set, see App Token.

  • Shell Command - Execute the command:

    com.symbol.rxlogger.intent.action.BACKUP_NOW_SHELL  -e "password" "<password>"
    

    Replace <password> with the password set for app access, see AppOps.


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

Non-secure (Legacy) RxLogger:

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


Secure RxLogger:

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 (Non-secure) - Send an intent:

    com.symbol.rxlogger.intent.action.RESET_TO_DEFAULT
    
  • Secure Method - Choose one of the following:

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

      com.symbol.rxlogger.intent.action.RESET_TO_DEFAULT 
      
    • App Token - Send an intent with a token from a third-party app, replacing <token-id> with the obtained token (see App Token):

      com.symbol.rxlogger.intent.action.RESET_TO_DEFAULT  -e "token" "<token-id>"
      
    • Shell Command - Execute the following command:

      com.symbol.rxlogger.intent.action.RESET_TO_DEFAULT_SHELL
      

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 

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 (Non-secure) - Send an intent:

    com.symbol.rxlogger.intent.action.DELETE_LOGS -e logType <logType>
    

    Replace <logType> with one of the following values:

    • 0 - (default) Delete all logs and backup files
    • 1 - Delete only log files
    • 2 - Delete only backup files Any other value or absence of this value defaults to deleting all files.
  • Secure Method - Choose one of the following:

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

      com.symbol.rxlogger.intent.action.DELETE_LOGS  -e logType <logType>
      
    • App Token - Send an intent with a token from a third-party app, replacing <token-id> with the obtained token (see App Token):

      com.symbol.rxlogger.intent.action.DELETE_LOGS   -e "token" "<token-id>" -e logType <logType>
      
    • Shell Command - Execute the following command:

      com.symbol.rxlogger.intent.action.DELETE_LOGS _SHELL -e logType <logType>
      

    Replace <logType> with one of the following values:

    • 0 - (default) Delete all logs and backup files
    • 1 - Delete only log files
    • 2 - Delete only backup files Any other value or absence of this value defaults to deleting all files.

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  

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 (Non-secure) - Send an intent:

    com.symbol.rxlogger.intent.action.RX_BUGREPORT
    
  • Secure Method - Choose one of the following:

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

      com.symbol.rxlogger.intent.action.RX_BUGREPORT 
      
    • App Token - Send an intent with a token from a third-party app, replacing <token-id> with the obtained token (see App Token):

      com.symbol.rxlogger.intent.action.RX_BUGREPORT -e "token" "<token-id>"
      
    • Shell Command - Execute the following command:

      com.symbol.rxlogger.intent.action.RX_BUGREPORT_SHELL
      

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  

  • 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