Skip to content

Commit 87caa8c

Browse files
committed
Merge branch 'main' into gradle-versions-check
2 parents 3aed3d8 + b375836 commit 87caa8c

22 files changed

+134
-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

+56-13
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,64 @@
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](assets/Play_Store_badge.svg)](https://play.google.com/store/apps/details?id=au.id.colby.nfcquicksettings) 
19+
[![Get it](assets/F-Droid_badge.svg)](https://f-droid.org/packages/au.id.colby.nfcquicksettings)
1720

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

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.
23+
In the _basic_ mode, which requires no special permissions, tapping the tile will simply open the device's NFC Settings
24+
page (assuming the device has one). This is actually the best that can be done using official Android APIs.
2325

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

assets/F-Droid_badge.svg

+48
Loading

0 commit comments

Comments
 (0)