JavaScript Bridge API Reference
The global dioxamine object provides asynchronous methods for interacting with connected devices, native dialogs, file systems, and the Android host.
Bridge Initialization
The native bridge is loaded automatically before any plugin scripts execute. To guarantee readiness across all initialization states, listen for the dioxamine-bridge-ready event:
function initPlugin() {
console.log("Dioxamine Bridge is ready:", window.dioxamine);
}
if (window.dioxamine && window.__dioxamine_bridge_ready) {
initPlugin();
} else {
window.addEventListener('dioxamine-bridge-ready', initPlugin, { once: true });
}
API Modules
The API is organized into the following specialized modules:
- Device Management: Query the active ADB connection and metadata.
- Single Command Execution (shellExec): Run non-interactive commands and receive exit code, stdout, and stderr.
- Interactive Shell Sessions (openInteractiveShell): Open persistent bi-directional PTY streams for terminals and live logcat.
- File Operations: Push and pull files, stream raw data, install APK packages, and launch Android SAF file pickers.
- Port Forwarding and Reverse: Manage TCP socket forwarding and reversing.
- UI Controls, Dialogs and Fullscreen: Show native Material toasts, blocking dialogs, and toggle edge-to-edge full-screen mode.
- Native Logging and Debugging: Forward logs and console output directly to Android Logcat.
- Dynamic Theming and Material 3: Integrate with Dioxamine’s dynamic color schemes and listen for theme changes.