Skip to content

Commit 6f7bb6c

Browse files
committed
Merge branch 'main' into android-15
2 parents d49635c + c86b5ef commit 6f7bb6c

21 files changed

+83
-19
lines changed

CHANGELOG.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Changelog[^1]
22

3-
## [Unreleased][]
3+
## [1.4.1][] (2024-06-29)
4+
5+
Added metadata for F-Droid.
6+
7+
## [1.4.0][] (2024-06-22)
48

59
Replaced timer with broadcast listener for more responsive tile updates.
610

@@ -34,7 +38,9 @@ Added translations for 86 languages.
3438

3539
Initial release.
3640

37-
[Unreleased]: https://github.com/pcolby/nfc-quick-settings/compare/v1.3.1...HEAD
41+
[Unreleased]: https://github.com/pcolby/nfc-quick-settings/compare/v1.4.1...HEAD
42+
[1.4.1]: https://github.com/pcolby/nfc-quick-settings/releases/tag/v1.4.1
43+
[1.4.0]: https://github.com/pcolby/nfc-quick-settings/releases/tag/v1.4.0
3844
[1.3.1]: https://github.com/pcolby/nfc-quick-settings/releases/tag/v1.3.1
3945
[1.3.0]: https://github.com/pcolby/nfc-quick-settings/releases/tag/v1.3.0
4046
[1.2.2]: https://github.com/pcolby/nfc-quick-settings/releases/tag/v1.2.2

README.md

+55-13
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,63 @@
88
[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=pcolby_nfc-quick-settings&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=pcolby_nfc-quick-settings)
99
[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=pcolby_nfc-quick-settings&metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=pcolby_nfc-quick-settings)
1010

11-
NFC Quick Settings is a really basic Android app with no GUI of it's own, that simply adds an NFC
12-
tile to the tiles available to the [Quick Settings panel][].
11+
NFC Quick Settings is a really basic Android app with no GUI of it's own, that simply adds an NFC tile to the tiles
12+
available to the [Quick Settings panel][].
1313

14-
*Screenshots go here...*
14+
The Quick Settings tile indicates the current NFC status (enabled, or disabled), but the action it takes when tapped
15+
varies a little depending on the permissions available. See [Basic](#basic-mode) and [Advanced](#advanced-mode) modes
16+
below.
1517

16-
## Internal Details
18+
[![Get it on Google Play](assets/GetItOnGooglePlay_Badge_Web_color_English.png)](https://play.google.com/store/apps/details?id=au.id.colby.nfcquicksettings)
1719

18-
Just for the curious, the application implements a basic [TileService][], that overrides:
20+
## Basic Mode
1921

20-
* [onStartListening()][] to check the default NFC adapter's current status, and update the tile state
21-
accordingly; and
22-
* [onClick()][] to show the device's NFC Settings by starting the [NFC Settings][] activity.
22+
In the _basic_ mode, which requires no special permissions, tapping the tile will simply open the device's NFC Settings
23+
page (assuming the device has one). This is actually the best that can be done using official Android APIs.
2324

24-
[NFC Settings]: https://developer.android.com/reference/android/provider/Settings#ACTION_NFC_SETTINGS
25-
[onClick()]: https://developer.android.com/reference/android/service/quicksettings/TileService#onClick()
26-
[onStartListening()]: https://developer.android.com/reference/android/service/quicksettings/TileService#onStartListening()
27-
[Quick Settings panel]: https://support.google.com/android/answer/9083864
28-
[TileService]: https://developer.android.com/reference/android/service/quicksettings/TileService
25+
## Advanced Mode
26+
27+
The advanced mode requires special permissions (see below), but once enabled, tapping the NFC Quick Settings tile will
28+
turn the NFC service on or off directly, without having to open the NFC settings page at all. Unfortunately, to acheive
29+
this _advanced_ mode, NFC Quick Settings needs to use APIs not intended for third-party applications (specifically
30+
[`NfcAdapter::enable()`][] and [`NfcAdapter::disable()`][]), and to use those methods the tile needs the special
31+
[`WRITE_SECURE_SETTINGS`][] permission.
32+
33+
### Granting `WRITE_SECURE_SETTINGS` Permission
34+
35+
As the [`WRITE_SECURE_SETTINGS`][] permission is not intended to be used by third-party applications, it needs to be
36+
granted via the [Android Debug Bridge (adb)][] tool.
37+
38+
1. Install [Android Debug Bridge (adb)][]:
39+
40+
> `adb` is included in the Android SDK Platform Tools package. Download this package with the [SDK Manager][], which
41+
> installs it at `android_sdk/platform-tools/`. If you want the standalone Android SDK Platform Tools package,
42+
> [download it here](https://developer.android.com/tools/releases/platform-tools).
43+
44+
2. Install NFC Quick Settings, via [Google Play] or [GitHub Releases].
45+
46+
3. [Enable adb debugging on your device](https://developer.android.com/tools/adb#Enabling).
47+
48+
4. [Connect your device via Wi-Fi](https://developer.android.com/tools/adb#connect-to-a-device-over-wi-fi).
49+
50+
5. Grant the permission to NFC Quick Settings via `adb`:
51+
52+
```sh
53+
adb shell pm grant au.id.colby.nfcquicksettings android.permission.WRITE_SECURE_SETTINGS
54+
```
55+
56+
If for some reason you want to revoke the [`WRITE_SECURE_SETTINGS`][] permission, and restore the _basic_ mode, then
57+
simply follow the same steps as above, but replace `grant` with `revoke`. That is, run:
58+
59+
```sh
60+
adb shell pm revoke au.id.colby.nfcquicksettings android.permission.WRITE_SECURE_SETTINGS
61+
```
62+
63+
[`NfcAdapter::disable()`]: https://cs.android.com/android/platform/superproject/+/main:frameworks/base/core/java/android/nfc/NfcAdapter.java;l=986?q=NfcAdapter "android.nfc.NfcAdapter::disable()"
64+
[`NfcAdapter::enable()`]: https://cs.android.com/android/platform/superproject/+/main:frameworks/base/core/java/android/nfc/NfcAdapter.java;l=947?q=NfcAdapter "android.nfc.NfcAdapter::enable()"
65+
[`WRITE_SECURE_SETTINGS`]: https://developer.android.com/reference/android/Manifest.permission#WRITE_SECURE_SETTINGS "android.permission.WRITE_SECURE_SETTINGS"
66+
[Android Debug Bridge (adb)]: https://developer.android.com/tools/adb "Android Debug Bridge (adb)"
67+
[GitHub Releases]: https://github.com/pcolby/nfc-quick-settings/releases "NFC Quick Settings releases"
68+
[Google Play]: https://play.google.com/store/apps/details?id=au.id.colby.nfcquicksettings "NFC Quick Settings on Google Play"
69+
[SDK Manager]: https://developer.android.com/studio/intro/update#sdk-manager "Update your tools with the SDK Manager"
70+
[Quick Settings panel]: https://support.google.com/android/answer/9083864 "Change settings quickly on your Android phone"

app/build.gradle

+4-4
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ android {
3030
applicationId "au.id.colby.nfcquicksettings"
3131
minSdk 24
3232
targetSdkPreview "VanillaIceCream"
33-
versionCode 9
34-
versionName "1.3.2-pre"
33+
versionCode 11
34+
versionName "1.4.2-pre"
3535
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
3636
}
3737

@@ -64,6 +64,6 @@ dependencies {
6464
implementation 'androidx.appcompat:appcompat:1.7.0'
6565
implementation 'com.google.android.material:material:1.12.0'
6666
testImplementation 'junit:junit:4.13.2'
67-
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
68-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
67+
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
68+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
6969
}

app/src/main/play/contact-email.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

app/src/main/play/contact-website.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
https://colby.id.au/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
NFC Quick Settings is a simple, open source, utility for quickly checking the device's current NFC status, and enabling or disabling NFC with as few taps as possible.
2+
3+
NFC Quick Settings has no user interface of it's own. Instead, once installed, you will see a new "NFC" tile available when customising your Quick Settings menu. See "Add, remove, or move a setting" in Android Help for more information on customising the Quick Settings menu: https://support.google.com/android/answer/9083864?hl=en#customize_settings
4+
5+
Once the NFC Quick Settings tile has been added to your Quick Settings menu, the tile will show the current NFC status.
6+
7+
Android security limitations do not allow any third-party apps, such as this, to turn NFC on or off directly, so when tapped, the NFC Quick Settings tile will simply open the device's NFC Settings page (if the device has one), where you can enable or disable NFC as desired.
8+
9+
NFC Quick Settings also has an advanced mode that allows NFC to be toggled directly from the tile, without having to going the NFC Settings page. But this advanced mode requires special permissions, which can only be granted via the Android Debug Bridge on a desktop computer. You can read more about this mode at https://github.com/pcolby/nfc-quick-settings?tab=readme-ov-file#advanced-mode
10+
11+
NFC Quick Settings is freely available under the GPLv3 open source license. The source code is available at https://github.com/pcolby/nfc-quick-settings
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
View NFC status, and quickly access NFC settings, from the Quick Settings menu
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
NFC Quick Settings
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Added metadata for F-Droid
Loading

0 commit comments

Comments
 (0)