BinderWrapper

interface BinderWrapper

Represents a connection to the Scatterbrain API. This class should only be injected by dagger only. By default this class is created as a singleton, as there is little value of concurrent connections to Scatterbrain

Inheritors

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
abstract val coroutineScope: CoroutineScope

Functions

Link copied to clipboard
abstract suspend fun approveDesktopIdentity(handle: UUID, identity: UUID)
Link copied to clipboard
abstract suspend fun authorizeDesktop(fingerprint: ByteArray, authorize: Boolean)
Link copied to clipboard
abstract suspend fun authorizeIdentity(identity: Identity, packageName: String)

Adds an ACL to an identity authorizing an app to use it. This function requires net.ballmerlabs.scatterroutingservice.permission.SUPERUSER and is currently not available to 3rd party applications

Link copied to clipboard
abstract suspend fun bindService(timeout: Long = 5000)

Attempts a connection to the scatterbrain service

Link copied to clipboard
abstract suspend fun deauthorizeIdentity(identity: Identity, packageName: String)

Removes an ACL authorizing an app to use an identity. This function requires net.ballmerlabs.scatterroutingservice.permission.SUPERUSER and is currently not available to 3rd party applications

Link copied to clipboard
abstract suspend fun deleteAndroidApp(id: String)
Link copied to clipboard
abstract suspend fun deleteDesktopApp(publicKey: ByteArray)
Link copied to clipboard
abstract suspend fun dumpDatastore(uri: Uri?)
Link copied to clipboard
abstract suspend fun generateIdentity(name: String): Identity

generates and returns a scatterbrain identity with ACLs matching the calling application only If additional applications need access to this identity they can be assigned via the Scatterbrain app. This requires net.ballmerlabs.scatterroutingservice.permission.ACCESS permission

Link copied to clipboard
abstract suspend fun getApps(): Apps
Link copied to clipboard
abstract suspend fun getIdentities(): List<Identity>

Gets a list of all known identities. requires net.ballmerlabs.scatterroutingservice.permission.ACCESS permission

Link copied to clipboard
abstract suspend fun getIdentity(fingerprint: UUID): Identity?

Gets a single identity by fingerprint. requires net.ballmerlabs.scatterroutingservice.permission.ACCESS permission

Link copied to clipboard
abstract suspend fun getMetrics(): HandshakeResult
Link copied to clipboard
abstract suspend fun getPackages(): List<NamePackage>

Gets a list of packages declaring a Scatterbrain compatible BroadcastReceiver. This function requires net.ballmerlabs.scatterroutingservice.permission.SUPERUSER permission and is currently not available to 3rd party applications

Link copied to clipboard
abstract suspend fun getPermissions(identity: Identity): List<NamePackage>

Gets a list of ACLs associated with a given identity object. This function requires net.ballmerlabs.scatterroutingservice.permission.SUPERUSER permission and is currently not available to 3rd party applications

Link copied to clipboard
abstract suspend fun getPermissionStatus(): PermissionStatus

Gets the current critical permissions granted to the router. This should be used to prompt the user to open Scatterbrain and grant permissions

Link copied to clipboard
abstract suspend fun getScatterMessages(application: String, limit: Int = -1): Flow<ScatterMessage>

returns a list of all stored message objects for a given application requires net.ballmerlabs.scatterroutingservice.permission.ACCESS permission

abstract suspend fun getScatterMessages(application: String, since: Date, limit: Int = -1): Flow<ScatterMessage>

returns a list of all stored messages for a given application after a given date. requires net.ballmerlabs.scatterroutingservice.permission.ACCESS permission

abstract suspend fun getScatterMessages(application: String, start: Date, end: Date, limit: Int = -1): Flow<ScatterMessage>

returns a list of all stored messages for a given application between two dates. requires net.ballmerlabs.scatterroutingservice.permission.ACCESS permission

Link copied to clipboard
abstract suspend fun isConnected(): Boolean

Checks if this SDK is connected to a running Scatterbrain router

Link copied to clipboard
abstract suspend fun isDiscovering(): Boolean

Returns true if the RoutingService is currently discovering

Link copied to clipboard

Returns a LiveData providing the current connection state

Link copied to clipboard
@ExperimentalCoroutinesApi
abstract fun observeIdentities(): Flow<List<Identity>>

returns an asynchronous flow of identities received after this function is called in real time. requires net.ballmerlabs.scatterroutingservice.permission.ACCESS permission

Link copied to clipboard
abstract fun observeIdentitiesLiveData(): LiveData<ImmutableList<Identity>>
Link copied to clipboard

Observes the current luid

Link copied to clipboard
@ExperimentalCoroutinesApi
abstract fun observeMessages(application: String, limit: Int = -1): LiveData<List<ScatterMessage>>

returns an asynchronous flow of all messages received after this functions is called filtered by a given application identifier. requires net.ballmerlabs.scatterroutingservice.permission.ACCESS permission

Link copied to clipboard

Returns a LiveData that emits periodic aggregate statistics

Link copied to clipboard

observes desktop pairing attempts This should only be used by clients with PERMISSION_SUPERUSER

Link copied to clipboard

Observe router state

Link copied to clipboard
abstract suspend fun randomizeLuid()
Link copied to clipboard
abstract fun register()

Unregisters the internal BroadcastReceiver for Scatterbrain events. This must be called to use the Scatterbrain SDK

Link copied to clipboard
abstract suspend fun removeIdentity(identity: Identity): Boolean

Deletes an identity. This function requires net.ballmerlabs.scatterroutingservice.permission.SUPERUSER and is currently not available to 3rd party applications

Link copied to clipboard
abstract suspend fun rescanPeers()

Attempts to reconnect to known local peers

Link copied to clipboard
abstract suspend fun sendMessage(messages: List<ScatterMessage>)

Enqueues multiple Scatterbrain messages to the datastore. The messages will be sent as soon as a peer is available This function requires net.ballmerlabs.scatterroutingservice.permission.ACCESS permission

abstract suspend fun sendMessage(message: ScatterMessage)

Enqueues a Scatterbrain message to the datastore. The messages will be sent as soon as a peer is available This function requires net.ballmerlabs.scatterroutingservice.permission.ACCESS permission

abstract suspend fun sendMessage(messages: List<ScatterMessage>, identity: UUID)
abstract suspend fun sendMessage(messages: List<ScatterMessage>, identity: Identity)

Enqueues a list of messages to the datastore and signs it with a given identity. This function requires net.ballmerlabs.scatterroutingservice.permission.ACCESS permission but the calling package must have accesss to the identity

abstract suspend fun sendMessage(message: ScatterMessage, identity: UUID)
abstract suspend fun sendMessage(message: ScatterMessage, identity: Identity)

Enqueues a message to the datastore and signs it with a given identity. This function requires net.ballmerlabs.scatterroutingservice.permission.ACCESS permission but the calling package must have accesss to the identity

Link copied to clipboard
abstract suspend fun sign(identity: Identity, data: ByteArray): ByteArray

Cryptographically signs data using a stored identity. This function requires net.ballmerlabs.scatterroutingservice.permission.ACCESS permission

Link copied to clipboard
abstract suspend fun startDesktopApi(name: String)
Link copied to clipboard
abstract suspend fun startDiscover()

Starts active discovery using default transport modules This function requires net.ballmerlabs.scatterroutingservice.permission.ADMIN permission

Link copied to clipboard
abstract suspend fun startMeshtastic(): Boolean
Link copied to clipboard
abstract suspend fun startPassive()

Starts passive discovery using the default radio module. This usually uses less power than active discovery for most transport modules but may skip peers that are also in passive mode This function requires net.ballmerlabs.scatterroutingservice.permission.ADMIN permission

Link copied to clipboard
abstract suspend fun startService()

Starts the scatterbrain router if stopped. Requires net.ballmerlabs.scatterroutingservice.permission.ADMIN permission

Link copied to clipboard
abstract suspend fun stopDesktopApi()
Link copied to clipboard
abstract suspend fun stopDiscover()

Stops active discovery This function requires net.ballmerlabs.scatterroutingservice.permission.ADMIN permission

Link copied to clipboard
abstract suspend fun stopPassive()

Stops passive discovery This function requires net.ballmerlabs.scatterroutingservice.permission.ADMIN permission

Link copied to clipboard
abstract suspend fun stopService()

Stops the scatterbrain router if started. Requires net.ballmerlabs.scatterroutingservice.permission.ADMIN permission

Link copied to clipboard
abstract suspend fun syncMeshtastic()
Link copied to clipboard
abstract suspend fun unbindService()

disconnects from the binder interface

Link copied to clipboard
abstract fun unregister()

Unregisters Scatterbrain broadcast receivers

Link copied to clipboard
abstract suspend fun verify(identity: Identity, data: ByteArray, sig: ByteArray): Boolean

Cryptographically verifies a detached signature using a stored identity This function requires net.ballmerlabs.scatterroutingservice.permission.ACCESS permission