DSD Toolkit

Developed for white label custom unrooted firmware.

Please contact us for details.

ToolKit User Guide

DSDevices ToolKit is a utility designed to provide control and seamless integration between your application and DSDevices firmware. It allows execution of privileged functions such as retrieving MAC Address, sending CEC commands, installing APK and rebooting the device.  

The DSDevices ToolKit protects these critical functionality using an Android signature-level permission. This ensures that only applications developed and authorized by our team can utilize these services. 

Your client application must be signed with the exact same cryptographic key used to sign the DSDevicesToolKit APK. If the client application’s signature does not match the DSDevices ToolKit’s signature, the Android OS will automatically deny access, resulting in a SecurityException when attempting to launch a protected activity. No run-time user permission prompt will ever appear, as this check happens at the system level. 

Additionally, every client application must declare the following custom permission in its AndroidManifest.xml file. 

<uses-permission android:name=”com.dsdevices.dsdevicestoolkit.ACCESS_DSDEVICES_TOOLKIT” />  

DSDevices ToolKit functions and their intended operation are described below. 

1. GET MAC ADDRESS 
 
DSDevices Toolkit provides a way for applications to retrieve Ethernet MAC Address for the eth0 network interface.  

Technical Integration: Intent API 
To retrieve Ethernet MAC Address , the client application must initiate the request using startActivityForResult() and then handle the response in its onActivityResult() callback. 

Intent Request Details 

Parameter Value Description 
Action com.dsdevices.dsdevicestoolkit.ACTION_GET_MAC The unique action that triggers the MAC address retrieval logic. 
Request Type startActivityForResult() Required for receiving the data back. 
Target Package com.dsdevices.dsdevicestoolkit This directs the Intent explicitly to the DSDevicesToolkit application. 

Expected Result Details 

The result is returned within the onActivityResult() method of your calling Activity. 

Result Parameter Key (String) Value Type Description 
Result Code RESULT_OK (-1) Integer The MAC address was successfully retrieved. 
Result Code RESULT_CANCELED (0) Integer The MAC address could not be retrieved 
Data Extra returnedMacAddress String The MAC address is formatted as XX:XX:XX:XX:XX:XX (e.g. 00:11:22:33:44:55). Only present if RESULT_OK is returned. 

Example Java code: 

private static final String TOOLKIT_PACKAGE = “com.dsdevices.dsdevicestoolkit”; 
public static final String ACTION_GET_MAC =  

“com.dsdevices.dsdevicestoolkit.ACTION_GET_MAC”; 

public static final String EXTRA_RETURNED_MAC = “returnedMacAddress”; 

 
private androidx.activity.result.ActivityResultLauncher<Intent> macAddressLauncher; 

macAddressLauncher = registerForActivityResult( 

                new ActivityResultContracts.StartActivityForResult(), 

                this::handleMacAddressResult); 

 
private void requestMacAddress() { 

        Log.d(TAG, “Attempting to request MAC Address…”); 

        Intent intent = new Intent(ACTION_GET_MAC); 

        intent.setPackage(TOOLKIT_PACKAGE); 

        try { 

            macAddressLauncher.launch(intent); 

        } catch (Exception e) { 

            Log.e(TAG, “Failed to launch GetMacActivity: ” + e.getMessage()); 

            resultTextView.setText(“ERROR: Could not launch ToolKit Activity. Check permissions/installation.”); 

        } 

    } 

private void handleMacAddressResult(ActivityResult result) { 

        if (result.getResultCode() == RESULT_OK) { 

            Intent data = result.getData(); 

            if (data != null && data.hasExtra(EXTRA_RETURNED_MAC)) { 

                String mac = data.getStringExtra(EXTRA_RETURNED_MAC); 

                String displayResult = “MAC Address: ” + mac; 

                resultTextView.setText(displayResult); 

                Log.i(TAG, “Received MAC Address: ” + mac); 

            } else { 

                resultTextView.setText(“MAC Retrieval Failed: No data returned.”); 

                Log.w(TAG, “RESULT_OK, but returned Intent or EXTRA_RETURNED_MAC was missing.”); 

            } 

        } else if (result.getResultCode() == RESULT_CANCELED) { 

            resultTextView.setText(“MAC Retrieval Canceled or Failed (Code: ” + result.getResultCode() + “)”); 

            Log.e(TAG, “MAC Retrieval was canceled.”); 

        } else { 

            resultTextView.setText(“MAC Retrieval Unknown Result Code: ” + result.getResultCode()); 

            Log.e(TAG, “MAC Retrieval returned unknown result code: ” + result.getResultCode()); 

        } 

    } 

 

2. HDMI CEC  

DSDevices Toolkit allows the device to send Consumer Electronics Control (CEC) commands to the connected display over the HDMI cable for actions such as but not limited to power cycling and input switching. 

Technical Integration: Intent API 

Parameter Value Description 
Action com.dsdevices.dsdevicestoolkit.ACTION_SEND_CEC The mandatory action string to trigger the CEC handler. 
Target Package com.dsdevices.dsdevicestoolkit Required for security, directing the request to the Toolkit application. 
Request Method startActivity(Intent) Used to dispatch the command. 
Extra (Key) cecCommandToExecute Mandatory string key for the CEC command data. 
Extra (Value) String (e.g. “10 04”) The CEC command payload, consisting of space-separated hexadecimal bytes. 

Example Java code: 

private static final String TOOLKIT_PACKAGE = “com.dsdevices.dsdevicestoolkit”; 
public static final String ACTION_SEND_CEC = “com.dsdevices.dsdevicestoolkit.ACTION_SEND_CEC”; 

public static final String EXTRA_CEC_COMMAND = “cecCommandToExecute”; 

Intent intent = new Intent(ACTION_SEND_CEC); 

intent.setPackage(TOOLKIT_PACKAGE); 

intent.putExtra(EXTRA_CEC_COMMAND, command); 

 
private void sendCecCommand(String command) { 

        Log.d(TAG, “Attempting to send CEC Command: ” + command); 

        Intent intent = new Intent(ACTION_SEND_CEC); 

        intent.setPackage(TOOLKIT_PACKAGE); 

        intent.putExtra(EXTRA_CEC_COMMAND, command); 

        try { 

            startActivity(intent); 

            Toast.makeText(this, “Attempting to execute CEC command: ” + command, Toast.LENGTH_SHORT).show(); 

        } catch (Exception e) { 

            Log.e(TAG, “Failed to launch HdmiCecCommandActivity: ” + e.getMessage()); 

            Toast.makeText(this, “CEC Error: ToolKit Activity not found or permission issue.”, Toast.LENGTH_LONG).show(); 

        } 

    } 

3. REBOOT 

The DSDevices Toolkit provides essential device control functionality, most notably a clean system restart. 

Technical Integration: Intent API 

To programmatically execute a clean device reboot, the client application must send an Intent with the following parameters: 

Parameter Value Description 
Action com.dsdevices.dsdevicestoolkit.ACTION_REBOOT The mandatory action string to trigger the command. 
Target Package com.dsdevices.dsdevicestoolkit This directs the Intent explicitly to the DSDevicesToolkit application. 
Request Method startActivity(Intent) Used to dispatch the command. 
Extras None No additional data is required or accepted for this command. 

Example Java code: 

The client application sends an intent targeted at the Toolkit package: 

private static final String TOOLKIT_PACKAGE = “com.dsdevices.dsdevicestoolkit”; 
public static final String ACTION_REBOOT = “com.dsdevices.dsdevicestoolkit.ACTION_REBOOT”; 
 
 

// Client Implementation: 

// … 

Intent intent = new Intent(ACTION_REBOOT); 

intent.setPackage(TOOLKIT_PACKAGE); 

startActivity(intent); 

// Client Implementation: 

// … 

Upon receiving this intent, the device will display a brief message and initiate a full system restart. 

4. INSTALL APK 

DSDevices Toolkit provides client applications a way to trigger Android Package Kit (APK)  installation on the device. 

Step Action Notes 
1. Transfer the APK Transfer the .apk file you wish to install to the device. The file must be placed in a shared, public directory, such as /sdcard/Download. 
2. Initiate Installation Send an Intent to DSDevicesToolKit to initiate installation along with the path to the .apk location Ensure .apk exists on the path provided. 

Technical Integration: Intent API 

To initiate APK installation programmatically, the client application must send an Intent with the following parameters: 

Parameter Value Description 
Action com.dsdevices.dsdevicestoolkit.ACTION_INSTALL_APK The mandatory action string to trigger the installation activity. 
Target Package com.dsdevices.dsdevicestoolkit Required for security. This directs the Intent explicitly to the Toolkit application. 
Request Method startActivity(Intent) Used to dispatch the installation request. 
Extra Key apkPath Mandatory string key for the file path data. 
Extra Value String (e.g., file:///sdcard/Download/app_v2.apk) The URI string represents the absolute local file path to the APK file. 

Example Java Code: 

private static final String TOOLKIT_PACKAGE = “com.dsdevices.dsdevicestoolkit”; 
public static final String ACTION_INSTALL_APK = “com.dsdevices.dsdevicestoolkit.ACTION_INSTALL_APK”; 

public static final String EXTRA_APK_PATH = “apkPath”; 

// Client Implementation: 

// … 

String apkPath = apkPathEditText.getText().toString().trim(); 
 
Intent intent = new Intent(ACTION_INSTALL_APK); intent.setPackage(TOOLKIT_PACKAGE);  
intent.putExtra(EXTRA_APK_PATH, Uri.fromFile(new File(apkPath)).toString()); 
startActivity(intent); 

// Client Implementation: 

// … 

Leave a Reply