PLUGIN DOCUMENTATION

Build tools for the hardware you have.

Uma referência prática para plugins Python, integração Android e capacidades de hardware do ErikrafT Multi-tool. Compatibilidade de formato não significa que cada recurso esteja disponível em todos os dispositivos.

A readable file, a native app

Plugins use Python 3.11 through Chaquopy and render native Jetpack Compose UI inside ErikrafT Multi-tool.

.dolphypluginapplication/x-dolphy-pluginPython 3.11 (Chaquopy)UTF-8SDK 36 / API 26+
Create screens

Build tools from Compose components, callbacks and plugin state.

Integrate with the app

Register modules and use the explicit hooks and extension points exposed by the app.

Respect device capabilities

Check the device, permission and accessory requirements before offering a hardware feature.

Inspect the source

Plugin files are executable code; review what they do before installing them.

Upstream-compatible plugin format

ErikrafT Multi-tool supports .dolphyplugin packages from its upstream Dolphy-App lineage. The .erikraftplugin extension is also supported. Both are readable UTF-8 Python files; compatibility does not guarantee identical device APIs across app versions.

Three honest capability classes

The same feature can need different hardware or privileges on different Android devices. The app distinguishes what is built in, what needs an accessory and what needs elevated support.

CapabilityWhat it meansExamples & requirements
Mobile NativeUsa APIs e componentes integrados ao telefone, quando presentes.BLE, NFC HCE, IR embutido, LAN. Bluetooth 12+: runtime permissions; HCE: aparelho compatível.
External HardwareDepende de um acessório externo conectado e compatível.Adaptadores IR e periféricos USB/Bluetooth; USB Host e permissões/conexão dependem do aparelho e adaptador.
PrivilegedExige privilégios de sistema que não estão disponíveis em todo dispositivo.USB Gadget HID e suporte específico de kernel; Root, Shizuku ou firmware compatível podem ser necessários.
Bluetooth / BLE

Android 12+ exige permissões de Bluetooth em runtime. Recursos dependem do rádio e da versão do sistema.

NFC HCE

Precisa de NFC e suporte a Host Card Emulation no dispositivo.

IR / USB Host

IR requer emissor integrado ou adaptador compatível; USB requer Host e hardware suportado.

LAN / Multicast

Descoberta local precisa de acesso à rede; multicast depende da rede e do sistema.

Root / Shizuku

Só para operações específicas que não são expostas pelas APIs Android comuns.

A disponibilidade não é universal

Um recurso listado não significa que o telefone tenha o componente, que o Android permita a operação ou que o acessório esteja conectado. Verifique as condições locais antes de iniciar uma ação.

Quick start: um módulo simples

Salve um arquivo de texto UTF-8 com a extensão .dolphyplugin. Esse exemplo registra um cartão e devolve uma tela nativa.

hardware_lab.dolphyplugin
__id__ = "hardware_lab"
__name__ = "Hardware Lab"
__version__ = "1.0.0"
__author__ = "Your Name"
__description__ = "A local hardware learning workspace"
__icon__ = "rounded:developer_board"

class HardwareLab(BasePlugin):
    def on_plugin_load(self):
        self.add_module(
            title="Hardware Lab",
            description="A local hardware learning workspace",
            icon="developer_board",
            screen="main",
            section="PLUGINS",
        )

    def screen_main(self, ui, api, state):
        return ui.scaffold(
            title="Hardware Lab",
            content=ui.column(
                [
                    ui.card([
                        ui.text("Ready to explore", "headlineSmall"),
                        ui.text("Check your device capabilities before use.", "bodyMedium"),
                    ]),
                ],
                padding=16,
                spacing=12,
            ),
        )
Where to start

Compare the runnable starter in plugin-examples/hello_erikraft.erikraftplugin with the current app runtime before relying on an API.

Expressive UI, rendered natively

Plugins describe a UI tree in Python; the app renders native Jetpack Compose components using its current theme.

Python 3.11
Plugin UI tree
Jetpack Compose
ui.scaffoldui.columnui.lazy_columnui.cardui.textui.buttonui.icon_buttonui.text_fieldui.switchui.sliderui.tabs
Material 3Components follow the active app theme; plugin UI is not a browser page.
callbacksCallbacks connect UI events to plugin functions and state.
api / uiThe runtime exposes the bridge to plugin code; use documented APIs and check their return values.

Plugin settings & lifecycle

Keep plugin setup and teardown explicit. State and settings should be resilient to a screen being opened more than once.

Plugin loaded

Register modules and initialize lightweight state.

Screen created

Render the screen and connect user actions.

Settings updated

Persist only values the plugin needs.

Plugin unloaded

Stop work and release owned resources.

Failure handling matters

Do not assume plugin code is sandboxed. Keep hardware access scoped, handle unavailable permissions and make recovery behavior clear.

Integrate at documented extension points

Plugin hooks are intentional integration points in the app, not unrestricted interception of arbitrary Kotlin code.

Module registration

Add a plugin entry point in a supported section and render its screen through the UI bridge.

Screen and action hooks

Hooks run only where the app dispatches an exposed hook or named action.

Hardware APIs

Access depends on the platform API, permission state, device feature and optional accessory.

No implicit global hooks

A plugin cannot assume it can patch every screen, action, system service or app function. A new named hook requires a corresponding integration point in the app code.

Screen hooks

Where supported, screen hooks can contribute plugin UI to an app route. Their effect and priority depend on the hook mode.

overlayAdds a plugin layer over a supported route.
top / bottomPlaces plugin UI at a supported edge of the screen.
fabAdds a compact floating action UI where the route supports it.
replaceProvides replacement UI at the hook point; this does not patch bytecode or guarantee that the underlying screen stops running.
Route matching

Use only route names and patterns supported by the current app build. Route names and available hooks may change; inspect the matching source and examples when targeting a specific screen.

Actions & services

Named action hooks and service providers run only through explicit dispatch points that the app currently exposes.

hook_actionParticipates in a named action pipeline where the app calls that action hook.
provide_serviceOffers an implementation for a service explicitly requested by the app.
priorityOrdering is meaningful only within the hook or provider dispatch supported by the runtime.
Check the runtime contract

The public integration surface is tied to the version of ErikrafT Multi-tool installed. Review the current repository examples and plugin bridge before relying on a particular hook name or hardware service.

Build & SDK

The project uses Kotlin, Jetpack Compose, Chaquopy, Android SDK 36 and a minimum Android API level of 26.

Primary languageKotlin (98.9%)
UI toolkitJetpack Compose
Python runtimePython 3.11 / Chaquopy
Android SDKCompile / Target 36
Minimum OSAndroid 8.0 / API 26
Build systemGradle 8.11.1
App iconsAdaptive Icon / Themed Icons (Android 13+)
Build and test commands
./gradlew testDebugUnitTest lintDebug assembleDebug bundleDebug
Build locally

Install a compatible JDK and Android SDK, then run the command from the repository root. CI workflow artifacts are debug builds; releases are published separately.

DEX & libraries

Advanced plugins may package compatible DEX code or share library plugins. These capabilities are version- and runtime-dependent.

DEX loading

Use only trusted, reviewed code that matches the app's Android runtime and supported plugin APIs.

Library dependencies

Declare dependencies explicitly and make startup order and failure behavior clear.

Integrity checks

Where a bridge accepts a checksum, verify the expected artifact before loading it.

Version compatibility

An API present in one build may not exist in another; validate against the current source.

Authorized research, safety & GPL

Use the app and plugins only for learning, testing and diagnostics on devices and networks you own or are explicitly authorized to assess.

Clear boundaries

Do not use the project to clone payment or transit cards, steal credentials, jam radio communications, conduct denial-of-service, or send spam. Respect consent, applicable law and platform rules.

Plugins are executable code

Review a plugin's source before installing it. A plugin may have access to app capabilities granted at runtime; do not install code from a source you do not trust.

GNU General Public License v3.0

ErikrafT Multi-tool is a fork evolved from unvoiddd/Dolphy-App. The project is distributed under GNU GPL v3.0 and retains clear upstream attribution.

Read license