{"id":19686089,"url":"https://github.com/nordicsemiconductor/android-dfu-library","last_synced_at":"2025-05-15T18:04:27.019Z","repository":{"id":27491332,"uuid":"30971472","full_name":"NordicSemiconductor/Android-DFU-Library","owner":"NordicSemiconductor","description":"Device Firmware Update library and Android app","archived":false,"fork":false,"pushed_at":"2024-02-16T23:01:33.000Z","size":5377,"stargazers_count":734,"open_issues_count":43,"forks_count":261,"subscribers_count":57,"default_branch":"main","last_synced_at":"2024-04-14T06:10:40.395Z","etag":null,"topics":["ble","bluetooth-le","bluetooth-low-energy","dfu","dfu-library","nrf51","nrf52","nrf5x"],"latest_commit_sha":null,"homepage":"http://www.nordicsemi.com/dfu","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"stdcoutzyx/DeepID_FaceClassify","license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NordicSemiconductor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-02-18T15:31:26.000Z","updated_at":"2024-05-27T12:48:09.031Z","dependencies_parsed_at":"2023-02-16T11:31:34.625Z","dependency_job_id":"4ea5e35d-ab90-4dd7-95e1-f631baed0b87","html_url":"https://github.com/NordicSemiconductor/Android-DFU-Library","commit_stats":null,"previous_names":[],"tags_count":50,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NordicSemiconductor%2FAndroid-DFU-Library","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NordicSemiconductor%2FAndroid-DFU-Library/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NordicSemiconductor%2FAndroid-DFU-Library/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NordicSemiconductor%2FAndroid-DFU-Library/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NordicSemiconductor","download_url":"https://codeload.github.com/NordicSemiconductor/Android-DFU-Library/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247737788,"owners_count":20987721,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ble","bluetooth-le","bluetooth-low-energy","dfu","dfu-library","nrf51","nrf52","nrf5x"],"created_at":"2024-11-11T18:26:00.875Z","updated_at":"2025-04-07T22:11:17.195Z","avatar_url":"https://github.com/NordicSemiconductor.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[ ![Download](https://maven-badges.herokuapp.com/maven-central/no.nordicsemi.android/dfu/badge.svg?style=plastic) ](https://search.maven.org/artifact/no.nordicsemi.android/dfu)\n\n# Device Firmware Update\n\nUpdate nRF5 SDK firmware using Bluetooth LE.\n\nThis repository contains the source code of the [DFU library](#library) (*lib/dfu* module) and nRF DFU app.\n\nThe DFU is design to update the firmware of nRF51 or nRF52 Series SoCs having an\n* **nRF5 SDK Secure Bootloader** (v12.0.0 or newer) or\n* **nRF5 SDK Legacy Bootloader** (v4.3.0-11.0.0).\n\n\u003e [!IMPORTANT]\n\u003e The DFU Library can't be used to update firmware developed with the nRF Connect SDK.\n\u003e\n\u003e Use [nRF Connect Device Manager](https://github.com/NordicSemiconductor/Android-nRF-Connect-Device-Manager) instead.\n\n## Application\n\n\u003ca href='https://play.google.com/store/apps/details?id=no.nordicsemi.android.dfu\u0026pcampaignid=pcampaignidMKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'\u003e\u003cimg alt='Get it on Google Play' src='https://play.google.com/intl/en_us/badges/static/images/badges/en_badge_web_generic.png' width='250'/\u003e\u003c/a\u003e\n\nnRF Device Firmware Update is a mobile app for updating nRF5 SDK firmware using Bluetooth Low Energy as a transport.\n\n![Welcome screen](resources/app_welcome.png) ![Main screen](resources/app_main.png) ![Settings](resources/app_settings.png)\n\n### Supported files\n\nThe firmware should be in *.zip* file format, prepared using [nRF Util](https://github.com/NordicSemiconductor/pc-nrfutil).\nThe firmware can be selected from the local storage on your Android or downloaded from the cloud using a deep-link.\n\n### Deep links\n\nApplication opens links with the provided format for both http and https.\nClicking a link automatically opens the app. The downloaded will be saved in the *Download* folder on the phone. Downloaded file is displayed in the app and ready to use.\n\nLink format: ```https://www.nordicsemi.com/dfu/?file=link_to_file```\n\n\u003e Note: Keep in mind to replace '\u0026' with '%26' in the `link_to_file`.\n\n# Library\n\nThe *lib_dfu* module contains the source code of the DFU library for Android.\n\nThe DFU library is available on Maven Central repository. Add it to your project by\nadding the following dependency:\n\n```Groovy\nimplementation 'no.nordicsemi.android:dfu:2.9.0'\n```\n\nLatest version targeting API lower than 31 is 1.11.1.\n\nFor projects not migrated to Android Jetpack, use version 1.8.1.\n\n\u003e Note: Those versions are not maintained anymore. All new features and bug fixes will be released on\nthe latest version only.\n\n#### Proguard / R8\n\nIf you use proguard/R8, add the following line to your proguard rules (although this should be added\nautomatically):\n```-keep class no.nordicsemi.android.dfu.** { *; }```\n\n### Required permissions\n\n#### Android 4.3 - 11\n\nTo communicate with Bluetooth LE devices on Android version 4.3 until 11 two permissions were\nrequired: **BLUETOOTH** and **BLUETOOTH_ADMIN**. It is enough to put them in the *AndroidManifest.xml*\nfile. If your app targets API 31 or newer set `android:maxSdkVersion=\"30\"` as on API 31 they were\nreplaced by **BLUETOOTH_CONNECT** and **BLUETOOTH_SCAN** runtime permissions (see below).\n\n#### Android 6 - 11\n\nIf your device is using the Nordic Buttonless Service for switching from app mode to\nDFU bootloader mode, this library will handle switching automatically. In case your bootloader is\nconfigured to advertise with incremented MAC address (that is you use Secure DFU and the device\nis not bonded) this library will need to scan for the new `BluetoothDevice`. In Android 6-11,\n**location permission** is required and has to be granted in runtime before DFU is started.\n\nStarting from Android 8.1.0, all scans done without a scan filter whilst the screen is turned off\nwill not return any scan results.\n\n\u003eNote: \"ACCESS_BACKGROUND_LOCATION\" permission would also be required to trigger a successful DFU\nwhilst the device screen is turned off, mainly to receive the scan results when scanning and\nconnecting to the peripheral in bootloader mode while the device screen is turned off.\n\n#### Android 12+\n\nStarting from Android 12 location permission is not needed, instead **BLUETOOTH_CONNECT** is required.\nWhen your device is using buttonless service and changes MAC address, it also requires\n**BLUETOOTH_SCAN** permission to be granted. This permission can be used with *neverForLocation* flag.\nRead more in [Bluetooth permissions](https://developer.android.com/guide/topics/connectivity/bluetooth/permissions).\n\n### Retrying\n\nStarting from version 1.9.0 the library is able to retry a DFU update in case of an unwanted\ndisconnection. However, to maintain backward compatibility, this feature is by default disabled.\nCall `initiator.setNumberOfRetries(int)` to set how many attempts the service should perform.\nSecure DFU will be resumed after it has been interrupted from the point it stopped, while the\nLegacy DFU will start again.\n\n# Device Firmware Update (DFU)\n\nThe nRF5x Series chips are flash-based SoCs, and as such they represent the most flexible solution available.\nA key feature of the nRF5x Series and their associated software architecture and S-Series SoftDevices\nis the possibility for Over-The-Air Device Firmware Upgrade (OTA-DFU). See Figure 1.\nOTA-DFU allows firmware upgrades to be issued and downloaded to products in the field via the cloud\nand so enables OEMs to fix bugs and introduce new features to products that are already out on the market.\nThis brings added security and flexibility to product development when using the nRF5x Series SoCs.\n\n![Device Firmware Update](resources/dfu.png)\n\nThis repository contains a tested library for Android 4.3+ platform which may be used to perform\nDevice Firmware Update on the nRF5x device using a phone or a tablet.\n\nDFU library has been designed to make it very easy to include these devices into your application.\nIt is compatible with all Bootloader/DFU versions.\n\n[![Alt text for your video](http://img.youtube.com/vi/LdY2m_bZTgE/0.jpg)](http://youtu.be/LdY2m_bZTgE)\n\n## Documentation\n\nSee the [documentation](documentation) for more information.\n\nAPI documentation is located [here](https://nordicsemiconductor.github.io/Android-DFU-Library/html/index.html).\n\n## Requirements\n\nThe library is compatible with nRF51 and nRF52 devices with S-Series Soft Device and the\nDFU Bootloader flashed on.\n\n## DFU History\n\n### Legacy DFU\n\n* **SDK 4.3.0** - First version of DFU over Bluetooth Smart. DFU supports Application update.\n* **SDK 6.1.0** - DFU Bootloader supports Soft Device and Bootloader update. As the updated\n                  Bootloader may be dependent on the new Soft Device, those two may be sent and\n                  installed together.\n    - Buttonless update support for non-bonded devices.\n* **SDK 7.0.0** - The extended init packet is required. The init packet contains additional\n                  validation information: device type and revision, application version, compatible\n                  Soft Devices and the firmware CRC.\n* **SDK 8.0.0** - The bond information may be preserved after an application update.\n                  The new application, when first started, will send the Service Change indication\n                  to the phone to refresh the services.\n    - Buttonless update support for bonded devices\n    - sharing the LTK between an app and the bootloader.\n\n### Secure DFU\n\n* **SDK 12.0.0** - New Secure DFU has been released. Buttonless service is experimental.\n* **SDK 13.0.0** - Buttonless DFU (still experimental) uses different UUIDs. No bond sharing\n                   supported. Bootloader will use address +1.\n* **SDK 14.0.0** - Buttonless DFU is no longer experimental. A new UUID (0004) added for bonded\n                   only devices (previous one (0003) is for non-bonded only).\n* **SDK 15.0.0** - Support for higher MTUs added.\n\nThis library is fully backwards compatible and supports both the new and legacy DFU.\nThe experimental buttonless DFU service from SDK 12 is supported since version 1.1.0.\nDue to the fact, that this experimental service from SDK 12 is not safe, you have to call\n[starter.setUnsafeExperimentalButtonlessServiceInSecureDfuEnabled(true)](https://github.com/NordicSemiconductor/Android-DFU-Library/blob/release/dfu/src/main/java/no/nordicsemi/android/dfu/DfuServiceInitiator.java#L376)\nto enable it. Read the method documentation for details. It is recommended to use the Buttonless\nservice from SDK 13 (for non-bonded devices, or 14 for bonded).\nBoth are supported since DFU Library 1.3.0.\n\nCheck platform folders for mode details about compatibility for each library.\n\n## Related libraries\n\n### iOS version\n\niOS version of the same library can be found at [IOS-DFU-Library](https://github.com/NordicSemiconductor/IOS-DFU-Library).\n\n### React Native\n\nA library for both iOS and Android that is based on this library is available for React Native: \n[react-native-nordic-dfu](https://github.com/Salt-PepperEngineering/react-native-nordic-dfu)\n\n### Capacitor\n\nA library for both iOS and Android that is based on this library is available for [Capacitor](https://capacitorjs.com):\n[nordic-dfu](https://github.com/robsonos/nordic-dfu)\n\n### Flutter\n\nA library for both iOS and Android that is based on this library is available for Flutter: \n[nordic-dfu](https://pub.dev/packages/nordic_dfu) \n\n### Xamarin\n\nSimple binding library for Android is available on nuget:\n[Laerdal.Dfu](https://www.nuget.org/packages/Laerdal.Dfu/)\n\n## Resources\n\n- [Legacy DFU Introduction](http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v11.0.0/examples_ble_dfu.html?cp=6_0_0_4_3_1 \"BLE Bootloader/DFU\")\n- [Secure DFU Introduction](https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/lib_bootloader_modules.html?cp=8_1_3_5 \"BLE Secure DFU Bootloader\")\n- [nRF51 Development Kit (DK)](https://www.nordicsemi.com/Software-and-tools/Development-Kits/nRF51-DK \"nRF51 DK\") (compatible with Arduino Uno Revision 3)\n- [nRF52 Development Kit (DK)](https://www.nordicsemi.com/Software-and-tools/Development-Kits/nRF52-DK \"nRF52 DK\") (compatible with Arduino Uno Revision 3)\n- [nRF52840 Development Kit (DK)](https://www.nordicsemi.com/Software-and-tools/Development-Kits/nRF52840-DK \"nRF52840 DK\") (compatible with Arduino Uno Revision 3)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnordicsemiconductor%2Fandroid-dfu-library","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnordicsemiconductor%2Fandroid-dfu-library","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnordicsemiconductor%2Fandroid-dfu-library/lists"}