BinderWrapperImpl

@Singleton
class BinderWrapperImpl @Inject constructor(val context: Context, broadcastReceiver: ScatterbrainBroadcastReceiver, binderProvider: BinderProvider, @Named(value = "defaultScope") defaultScope: CoroutineScope) : BinderWrapper

Constructors

Link copied to clipboard
@Inject
constructor(context: Context, broadcastReceiver: ScatterbrainBroadcastReceiver, binderProvider: BinderProvider, @Named(value = "defaultScope") defaultScope: CoroutineScope)

Properties

Link copied to clipboard
Link copied to clipboard
open override val coroutineScope: CoroutineScope

Functions

Link copied to clipboard
open suspend override fun approveDesktopIdentity(handle: UUID, identity: UUID)
Link copied to clipboard
open suspend override fun authorizeDesktop(fingerprint: ByteArray, authorize: Boolean)
Link copied to clipboard
open suspend override 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
open suspend override fun bindService(timeout: Long)

Attempts a connection to the scatterbrain service

Link copied to clipboard
open suspend override fun deauthorizeIdentity(identity: Identity, packageName: String): <Error class: unknown class>

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
open suspend override fun deleteAndroidApp(id: String)
Link copied to clipboard
open suspend override fun deleteDesktopApp(publicKey: ByteArray)
Link copied to clipboard
open suspend override fun dumpDatastore(uri: Uri?)
Link copied to clipboard
open suspend override 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
open suspend override fun getApps(): Apps
Link copied to clipboard
open suspend override fun getIdentities(): List<Identity>

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

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

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

Link copied to clipboard
open suspend override fun getMetrics(): HandshakeResult
Link copied to clipboard
open suspend override 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
open suspend override 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
open suspend override 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
open suspend override fun getScatterMessages(application: String, limit: Int): Flow<ScatterMessage>

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

open suspend override fun getScatterMessages(application: String, since: Date, limit: Int): Flow<ScatterMessage>

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

open suspend override fun getScatterMessages(application: String, start: Date, end: Date, limit: Int): 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
open suspend override fun isConnected(): Boolean

Checks if this SDK is connected to a running Scatterbrain router

Link copied to clipboard
open suspend override 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
open override 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
open override fun observeIdentitiesLiveData(): LiveData<ImmutableList<Identity>>
Link copied to clipboard
open override fun observeLuid(): LiveData<ParcelUuid>

Observes the current luid

Link copied to clipboard
@ExperimentalCoroutinesApi
open override fun observeMessages(application: String, limit: Int): 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
open suspend override fun randomizeLuid()
Link copied to clipboard
open override fun register()

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

Link copied to clipboard
open suspend override 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
open suspend override fun rescanPeers()

Attempts to reconnect to known local peers

Link copied to clipboard
open suspend override 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

open suspend override 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

open suspend override fun sendMessage(messages: List<ScatterMessage>, identity: UUID)
open suspend override 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

open suspend override fun sendMessage(message: ScatterMessage, identity: UUID)
open suspend override 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
open suspend override 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
open suspend override fun startDesktopApi(name: String)
Link copied to clipboard
open suspend override fun startDiscover(): <Error class: unknown class>

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

Link copied to clipboard
open suspend override fun startMeshtastic(): Boolean
Link copied to clipboard
open suspend override fun startPassive(): <Error class: unknown class>

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
open suspend override fun startService()

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

Link copied to clipboard
open suspend override fun stopDesktopApi()
Link copied to clipboard
open suspend override fun stopDiscover(): <Error class: unknown class>

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

Link copied to clipboard
open suspend override fun stopPassive(): <Error class: unknown class>

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

Link copied to clipboard
open suspend override fun stopService()

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

Link copied to clipboard
open suspend override fun syncMeshtastic()
Link copied to clipboard
open suspend override fun unbindService()

disconnects from the binder interface

Link copied to clipboard
open override fun unregister()

Unregisters Scatterbrain broadcast receivers

Link copied to clipboard
open suspend override 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