Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firmware: Android #7

Open
Kolsha opened this issue Sep 17, 2024 · 0 comments
Open

Firmware: Android #7

Kolsha opened this issue Sep 17, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@Kolsha
Copy link

Kolsha commented Sep 17, 2024

Hey
I wonder, is it possible to create firmsoftware on android, to make it behave like AirTag.

At the moment I'm trying to experiment with android.bluetooth.le.BluetoothLeAdvertiser, but not sure that if it's right direction and it's capable of doing so.

Here is my snippet, any comments, guidances, ideas would be helpful.
Thanks!

// manufacturerData is similar to 
// https://github.com/positive-security/find-you/blob/ab7a3a9eaa4559d34fcdf37142729bef3ae38a36/Firmware/Microbit_v1/offline-finding/main.c#L32

        val settings = AdvertiseSettings.Builder()
            .setAdvertiseMode(AdvertiseSettings.ADVERTISE_MODE_LOW_LATENCY)
            .setConnectable(false)
            .setTxPowerLevel(AdvertiseSettings.ADVERTISE_TX_POWER_HIGH)
            .build()

        val manufacturerData = createManufacturerData()
        val data: AdvertiseData = AdvertiseData.Builder()
            .setIncludeDeviceName(false)
            .addManufacturerData(0x004C, manufacturerData)
            .build()

        try {
            bluetoothLeAdvertiser?.startAdvertising(settings, data, advertiseCallback)
        } catch (e: Throwable) {
            Log.e(TAG, "SecurityException: ${e.message}")
        }
@Kolsha Kolsha added the enhancement New feature or request label Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant