implementation 'androidx.webkit:webkit:1.4.0'
// Include the Kotlin standard libraries. This should be the same version number listed in project build.gradle.
- implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.30'
+ implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.31'
// Include the Google material library.
implementation 'com.google.android.material:material:1.4.0'
<!-- Required to read cell network information. -->
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
+ <!-- Required to display a realtime notification icon. -->
+ <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
+
+ <!-- Required to start the realtime notification icon at boot. -->
+ <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
+
<!-- Support Chromebooks that don't have a touch screen. -->
<uses-feature android:name="android.hardware.touchscreen" android:required="false" />
android:supportsRtl="true"
android:theme="@style/Theme.PrivacyCell" >
- <!-- PrivacyCellActivity. The label uses the short name so that it isn't truncated under the icon in the launcher on most phones.
+ <!-- Privacy Cell Activity. The label uses the short name so that it isn't truncated under the icon in the launcher on most phones.
`android:launchMode="singleTask"` makes the app launch in a new task instead of inside the task of the program that sends it an intent.
It also makes it reuse an existing Privacy Cell activity if available instead of launching a new one. -->
<activity
android:label="@string/settings"
android:screenOrientation="fullUser"
android:parentActivityName=".activities.PrivacyCellActivity" />
+
+ <!-- Realtime Monitoring Service. -->
+ <service android:name=".services.RealtimeMonitoringService" />
+
+ <!-- On Boot Completed Receiver. -->
+ <receiver
+ android:name=".receivers.OnBootCompletedReceiver"
+ android:exported="true" >
+
+ <intent-filter>
+ <action android:name="android.intent.action.BOOT_COMPLETED" />
+ </intent-filter>
+ </receiver>
</application>
</manifest>
\ No newline at end of file
</head>
<body>
- <h3>1.2 (version code 3)</h3>
- <p>15 September 2021 - minimum API 30, target API 30.</p>
+ <h3><a href="https://www.stoutner.com/privacy-cell-1-2/">1.2</a> (version code 3)</h3>
+ <p><a href="https://gitweb.stoutner.com/?p=PrivacyCell.git;a=commitdiff;h=70a8bdb781941d9f433b18a91befe03137d65a6f">15 September 2021</a> - minimum API 30, target API 30.</p>
<ul>
<li>Add the option to use a <a href="https://redmine.stoutner.com/issues/749">bottom app bar</a>.</li>
<li>First full Spanish translation contributed by Jose A. León.</li>
<h3>Translators</h3>
<a href="mailto:kevinliste@framalistes.org">Kévin L.</a>: French<br/>
+ Bernhard G. Keller: German<br/>
Francesco Buratti: Italian<br/>
Jose A. León: Spanish
which are released under the <a href="https://www.apache.org/licenses/LICENSE-2.0">Apache License 2.0</a>. The full text of the license is below.</p>
<h3>Icons</h3>
- <p><img class="left" src="../images/privacy_cell.svg"/> is derived from <code>security</code> and <code>5g</code>,
+ <p><img class="left" src="../images/privacy_cell.svg"/> <img class="left" src="../images/secure_notification.svg"/> are derived from <code>security</code> and <code>5g</code>,
which are part of the <a href="https://material.io/icons/">Android Material icon set</a> and are released under the <a href ="https://www.apache.org/licenses/LICENSE-2.0">Apache License 2.0</a>.
The full text of the license is below. Modifications copyright © 2016,2021 <a href="mailto:soren@stoutner.com">Soren Stoutner</a>.
- The resulting image is released under the <a href="https://www.gnu.org/licenses/gpl-3.0.html">GPLv3+ license</a>.</p>
- <p><img class="left" src="../images/not_secure.svg"/> is derived from <code>security</code> and <code>do_not_disturb</code>,
+ The resulting images are released under the <a href="https://www.gnu.org/licenses/gpl-3.0.html">GPLv3+ license</a>.</p>
+ <p><img class="left" src="../images/not_secure.svg"/> <img class="left" src="../images/insecure_notification.svg"/> are derived from <code>security</code> and <code>do_not_disturb</code>,
which are part of the <a href="https://material.io/icons/">Android Material icon set</a> and are released under the <a href ="https://www.apache.org/licenses/LICENSE-2.0">Apache License 2.0</a>.
Modifications copyright © 2016,2021 <a href="mailto:soren@stoutner.com">Soren Stoutner</a>.
- The resulting image is released under the <a href="https://www.gnu.org/licenses/gpl-3.0.html">GPLv3+ license</a>.</p>
+ The resulting images are released under the <a href="https://www.gnu.org/licenses/gpl-3.0.html">GPLv3+ license</a>.</p>
<p>The following icons come from the <a href="https://material.io/icons/">Android Material icon set</a>,
which is released under the <a href ="https://www.apache.org/licenses/LICENSE-2.0">Apache License 2.0</a>.
They are unchanged except for layout information like color and size. Some of them have been renamed to match their use in the code. The original icons and names are shown below.</p>
<h3>Read phone status and identity</h3>
<p><a href="https://developer.android.com/reference/android/Manifest.permission.html#READ_PHONE_STATE">android.permission. READ_PHONE_STATE</a></p>
<p>Required to determine which protocols are being used by the cell phone network.</p>
+
+ <h3>Run foreground service</h3>
+ <p><a href="https://developer.android.com/reference/android/Manifest.permission#FOREGROUND_SERVICE">android.permission. FOREGROUND_SERVICE</a></p>
+ <p>Allows Privacy Cell to display a realtime monitoring notification icon in the status bar.</p>
+
+ <h3>Run at startup</h3>
+ <p><a href="https://developer.android.com/reference/android/Manifest.permission#RECEIVE_BOOT_COMPLETED">android.permission. RECEIVE_BOOT_COMPLETED</a></p>
+ <p>Allows Privacy Cell to enable the realtime monitoring service when the phone boots.</p>
</body>
</html>
\ No newline at end of file
</head>
<body>
- <h3>1.2 (versión del código 3)</h3>
- <p>15 de septiembre de 2021 - API mínimo 30, API objetivo 30.</p>
+ <h3><a href="https://www.stoutner.com/privacy-cell-1-2/">1.2</a> (versión del código 3)</h3>
+ <p><a href="https://gitweb.stoutner.com/?p=PrivacyCell.git;a=commitdiff;h=70a8bdb781941d9f433b18a91befe03137d65a6f">15 de septiembre de 2021</a> - API mínimo 30, API objetivo 30.</p>
<ul>
<li>Añadir la opción de utilizar una <a href="https://redmine.stoutner.com/issues/749">barra de app inferior</a>.</li>
<li>Primera traducción completa al español aportada por José A. León.</li>
<h3>Traductores</h3>
Jose A. León: Español<br/>
<a href="mailto:kevinliste@framalistes.org">Kévin L.</a>: Francés<br/>
+ Bernhard G. Keller: Alemán<br/>
Francesco Buratti: Italiano
<br/>
que se liberan bajo la <a href="https://www.apache.org/licenses/LICENSE-2.0">Licencia Apache 2.0</a>. El texto completo de la licencia se muestra abajo.</p>
<h3>Iconos</h3>
- <p><img class="left" src="../images/privacy_cell.svg"/> deriva de <code>security</code> y <code>5g</code>,
+ <p><img class="left" src="../images/privacy_cell.svg"/> <img class="left" src="../images/secure_notification.svg"/> derivan de <code>security</code> y <code>5g</code>,
que son parte del <a href="https://material.io/icons/">set de iconos de Android Material</a> y se liberan bajo la <a href ="https://www.apache.org/licenses/LICENSE-2.0">Licencia Apache 2.0</a>.
El texto completo de la licencia se muestra abajo. Copyright de modificaciones © 2016,2021 <a href="mailto:soren@stoutner.com">Soren Stoutner</a>.
- La imagen resultante se libera bajo la <a href="https://www.gnu.org/licenses/gpl-3.0.html">licencia GPLv3+</a>.</p>
- <p><img class="left" src="../images/not_secure.svg"/> deriva de <code>security</code> y <code>do_not_disturb</code>,
+ Las imágenes resultante se liberan bajo la <a href="https://www.gnu.org/licenses/gpl-3.0.html">licencia GPLv3+</a>.</p>
+ <p><img class="left" src="../images/not_secure.svg"/> <img class="left" src="../images/insecure_notification.svg"/> derivan de <code>security</code> y <code>do_not_disturb</code>,
que son parte del <a href="https://material.io/icons/">set de iconos de Android Material</a> y se liberan bajo la <a href ="https://www.apache.org/licenses/LICENSE-2.0">Licencia Apache 2.0</a>.
Copyright de modificaciones © 2016,2021 <a href="mailto:soren@stoutner.com">Soren Stoutner</a>.
- La imagen resultante se libera bajo la <a href="https://www.gnu.org/licenses/gpl-3.0.html">licencia GPLv3+</a>.</p>
+ Las imágenes resultantes se liberan bajo la <a href="https://www.gnu.org/licenses/gpl-3.0.html">licencia GPLv3+</a>.</p>
<p>Los siguientes iconos vienen del <a href="https://material.io/icons/">set de iconos de Android Material</a>,
que se liberan bajo la <a href ="https://www.apache.org/licenses/LICENSE-2.0">licencia Apache 2.0</a>.
No se han modificado, salvo la información sobre el diseño, como el color y el tamaño. Algunos de ellos han sido renombrados para que coincidan con su uso en el código.
<h3>Leer el estado del teléfono e identidad</h3>
<p><a href="https://developer.android.com/reference/android/Manifest.permission.html#READ_PHONE_STATE">android.permission. READ_PHONE_STATE</a></p>
<p>Requerido para determinar qué protocolos se están usando por la red del teléfono celular.</p>
+
+ <h3>Run foreground service</h3>
+ <p><a href="https://developer.android.com/reference/android/Manifest.permission#FOREGROUND_SERVICE">android.permission. FOREGROUND_SERVICE</a></p>
+ <p>Allows Privacy Cell to display a realtime monitoring notification icon in the status bar.</p>
+
+ <h3>Run at startup</h3>
+ <p><a href="https://developer.android.com/reference/android/Manifest.permission#RECEIVE_BOOT_COMPLETED">android.permission. RECEIVE_BOOT_COMPLETED</a></p>
+ <p>Allows Privacy Cell to enable the realtime monitoring service when the phone boots.</p>
</body>
</html>
\ No newline at end of file
</head>
<body>
- <h3>1.2 (version de code 3)</h3>
- <p>15 Septembre 2021 - API minimum 30, API cible 30.</p>
+ <h3><a href="https://www.stoutner.com/privacy-cell-1-2/">1.2</a> (version de code 3)</h3>
+ <p><a href="https://gitweb.stoutner.com/?p=PrivacyCell.git;a=commitdiff;h=70a8bdb781941d9f433b18a91befe03137d65a6f">15 Septembre 2021</a> - API minimum 30, API cible 30.</p>
<ul>
<li>Ajout d'une option permettant d'utiliser un <a href="https://redmine.stoutner.com/issues/749">barre d'application inférieure</a>.</li>
<li>Traduction française partielle réalisée par <a href="mailto:kevinliste@framalistes.org">Kévin L</a>.</li>
<h3>Traducteurs</h3>
<a href="mailto:kevinliste@framalistes.org">Kévin L.</a> : Français<br/>
+ Bernhard G. Keller : Allemand<br/>
Francesco Buratti : Italien<br/>
Jose A. León : Espagnol
qui sont publiés sous la <a href="https://www.apache.org/licenses/LICENSE-2.0">Licence Apache 2.0</a>. Le texte intégral de la licence se trouve ci-dessous.</p>
<h3>Icônes</h3>
- <p><img class="left" src="../images/privacy_cell.svg"/> est dérivé de <code>security</code> et <code>5g</code>,
+ <p><img class="left" src="../images/privacy_cell.svg"/> <img class="left" src="../images/secure_notification.svg"/> sont dérivés de <code>security</code> et de <code>5g</code>,
qui font partie de l'ensemble d'icônes <a href="https://material.io/icons/">Android Material</a> et sont publiés sous la <a href ="https://www.apache.org/licenses/LICENSE-2.0">Licence Apache 2.0</a>.
Le texte intégral de la licence est ci-dessous. Modifications copyright © 2016,2021 <a href="mailto:soren@stoutner.com">Soren Stoutner</a>.
- L'image qui en résulte est publiée sous la <a href="https://www.gnu.org/licenses/gpl-3.0.html">licence GPLv3+</a>.</p>
- <p><img class="left" src="../images/not_secure.svg"/> est dérivé de <code>security</code> et <code>do_not_disturb</code>,
+ Les images résultantes sont publiées sous la <a href="https://www.gnu.org/licenses/gpl-3.0.html">licence GPLv3+</a>.</p>
+ <p><img class="left" src="../images/not_secure.svg"/> <img class="left" src="../images/insecure_notification.svg"/> sont dérivés de <code>security</code> et de <code>do_not_disturb</code>,
qui font partie de l'ensemble d'icônes <a href="https://material.io/icons/">Android Material icon set</a> et sont publiés sous la <a href ="https://www.apache.org/licenses/LICENSE-2.0">Licence Apache 2.0</a>.
Modifications copyright © 2016,2021 <a href="mailto:soren@stoutner.com">Soren Stoutner</a>.
- L'image qui en résulte est publiée sous le label <a href="https://www.gnu.org/licenses/gpl-3.0.html">licence GPLv3+</a>.</p>
+ Les images résultantes sont publiées sous la <a href="https://www.gnu.org/licenses/gpl-3.0.html">licence GPLv3+</a>.</p>
<p>Les icônes suivantes proviennent de l'ensemble d'icônes <a href="https://material.io/icons/">Android Material</a>,
qui sont publiées sous la <a href ="https://www.apache.org/licenses/LICENSE-2.0">Licence Apache 2.0</a>.
Elles sont inchangés, à l'exception des informations de mise en page comme la couleur et la taille. Certaines d'entre elles ont été renommées pour correspondre à leur utilisation dans le code. Les icônes et les noms originaux sont présentés ci-dessous.</p>
<h3>Lecture du statut et de l'identité du téléphone</h3>
<p><a href="https://developer.android.com/reference/android/Manifest.permission.html#READ_PHONE_STATE">android.permission. READ_PHONE_STATE</a></p>
<p>Nécessaire pour déterminer quels protocoles sont utilisés par le réseau de téléphonie mobile.</p>
+
+ <h3>Run foreground service</h3>
+ <p><a href="https://developer.android.com/reference/android/Manifest.permission#FOREGROUND_SERVICE">android.permission. FOREGROUND_SERVICE</a></p>
+ <p>Allows Privacy Cell to display a realtime monitoring notification icon in the status bar.</p>
+
+ <h3>Run at startup</h3>
+ <p><a href="https://developer.android.com/reference/android/Manifest.permission#RECEIVE_BOOT_COMPLETED">android.permission. RECEIVE_BOOT_COMPLETED</a></p>
+ <p>Allows Privacy Cell to enable the realtime monitoring service when the phone boots.</p>
</body>
</html>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+
+<!--
+ This file is derived from `security` and `do_not_disturb`, which are part of the Android Material icon set. They are released under the Apache License 2.0.
+
+ Changes copyright © 2021 Soren Stoutner <soren@stoutner.com>. The resulting file is released under the GPLv3+ license.
+
+ This file is part of Privacy Cell <https://www.stoutner.com/privacy-cell>.
+
+ Privacy Cell is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Privacy Cell is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Privacy Cell. If not, see <http://www.gnu.org/licenses/>. -->
+
+<svg
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 256 256" >
+
+ <path
+ style="fill:#d32f2f"
+ d="M 256,0 46.544922,93.091797 V 232.72656 C 46.544922,361.8902 135.91273,482.67638 256,512 376.08728,482.67638 465.45508,361.8902 465.45508,232.72656 V 93.091797 Z m 0,93.855469 c 89.50326,0 162.14453,72.641271 162.14453,162.144531 0,89.50326 -72.64127,162.14453 -162.14453,162.14453 C 166.49674,418.14453 93.855469,345.50326 93.855469,256 93.855469,166.49674 166.49674,93.855469 256,93.855469 Z m 0,32.429691 c -29.99656,0 -57.56179,10.21512 -79.45117,27.40234 L 358.3125,335.45117 C 375.49972,313.56179 385.71484,285.99656 385.71484,256 385.71484,184.33254 327.66746,126.28516 256,126.28516 Z M 153.6875,176.54883 C 136.50028,198.43821 126.28516,226.00344 126.28516,256 c 0,71.66746 58.04738,129.71484 129.71484,129.71484 29.99656,0 57.56179,-10.21512 79.45117,-27.40234 z"
+ transform="matrix(0.5,0,0,0.5,0,0)" />
+</svg>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+
+<!--
+ This file is derived from `security` and `5g`, which are part of the Android Material icon set. They are released under the Apache License 2.0.
+
+ Changes copyright © 2016,2021 Soren Stoutner <soren@stoutner.com>. The resulting file is released under the GPLv3+ license.
+
+ This file is part of Privacy Cell <https://www.stoutner.com/privacy-cell>.
+
+ Privacy Cell is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Privacy Cell is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Privacy Cell. If not, see <http://www.gnu.org/licenses/>. -->
+
+<svg
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 256 256" >
+
+ <path
+ style="fill:#1976d2"
+ d="M 273.06641,0 49.648438,99.296875 V 248.24219 c -2e-6,137.77455 95.324872,266.61209 223.417972,297.89062 128.0931,-31.27853 223.41797,-160.11607 223.41797,-297.89062 V 99.296875 Z M 117.01758,163.48438 h 103.79883 c 9.68784,0 17.29882,7.61293 17.29882,17.30078 0,9.68784 -7.61098,17.29882 -17.29882,17.29882 h -86.5 v 51.89844 h 69.19921 c 19.0297,0 34.59961,15.56992 34.59961,34.59961 v 51.90039 c 0,19.02969 -15.56991,34.59961 -34.59961,34.59961 h -86.49804 c -9.68784,0 -17.300783,-7.61294 -17.300783,-17.30078 0,-9.68784 7.612943,-17.29883 17.300783,-17.29883 h 86.49804 v -51.90039 h -86.49804 c -9.68784,0 -17.300783,-7.61098 -17.300783,-17.29883 v -86.49804 c 0,-9.68785 7.612943,-17.30078 17.300783,-17.30078 z m 190.29687,0 h 121.09766 c 9.68784,0 17.29883,7.61293 17.29883,17.30078 0,9.68784 -7.61099,17.29882 -17.29883,17.29882 H 307.31445 v 138.39844 h 103.79883 v -51.90039 h -51.90039 c -9.68784,0 -17.29883,-7.61098 -17.29883,-17.29883 0,-9.68784 7.61099,-17.30078 17.29883,-17.30078 h 69.19922 c 9.68784,0 17.29883,7.61294 17.29883,17.30078 v 69.19922 c 0,19.02969 -15.56797,34.59961 -34.59766,34.59961 H 307.31445 c -19.02969,0 -34.59961,-15.56992 -34.59961,-34.59961 V 198.08398 c 0,-19.02969 15.56992,-34.5996 34.59961,-34.5996 z"
+ transform="matrix(0.46874998,0,0,0.46874998,0,0)" />
+</svg>
</head>
<body>
- <h3>1.2 (versione codice 3)</h3>
- <p>15 Settembre 2021 - minima API 30, target API 30.</p>
+ <h3><a href="https://www.stoutner.com/privacy-cell-1-2/">1.2</a> (versione codice 3)</h3>
+ <p><a href="https://gitweb.stoutner.com/?p=PrivacyCell.git;a=commitdiff;h=70a8bdb781941d9f433b18a91befe03137d65a6f">15 Settembre 2021</a> - minima API 30, target API 30.</p>
<ul>
<li>Aggiunta l'opzione per avere <a href="https://redmine.stoutner.com/issues/749">la barra dell'app nella parte inferiore dello schermo</a>.</li>
<li>Traduzione parziale in Italiano da parte di Francesco Buratti.</li>
<h3>Traduttori</h3>
Francesco Buratti: Italiano<br/>
<a href="mailto:kevinliste@framalistes.org">Kévin L.</a>: Francese<br/>
+ Bernhard G. Keller: Tedesco<br/>
Jose A. León: Spagnolo
<br/>
<h3>Copyright</h3>
<p>Privacy Cell copyright © 2021 <a href="mailto:soren@stoutner.com">Soren Stoutner</a>.</p>
- <h3>License</h3>
- <p>Privacy Cell is released under the <a href="https://www.gnu.org/licenses/gpl-3.0.html">GPLv3+ license</a>. The full text of the license is below.
- The source code is available from <a href="https://gitweb.stoutner.com/?p=PrivacyCell.git;a=summary">gitweb.stoutner.com</a>.</p>
-
- <h3>Libraries</h3>
- <p>Privacy Cell is built with the <a href="https://developer.android.com/jetpack/androidx/">AndroidX Libraries</a>,
- the <a href="https://github.com/JetBrains/kotlin/tree/master/license">Kotlin libraries</a>,
- and code from the <a href="https://mvnrepository.com/artifact/com.google.android.material/material">Google Material Maven repository</a>,
- which are released under the <a href="https://www.apache.org/licenses/LICENSE-2.0">Apache License 2.0</a>. The full text of the license is below.</p>
-
- <h3>Icons</h3>
- <p><img class="left" src="../images/privacy_cell.svg"/> is derived from <code>security</code> and <code>5g</code>,
- which are part of the <a href="https://material.io/icons/">Android Material icon set</a> and are released under the <a href ="https://www.apache.org/licenses/LICENSE-2.0">Apache License 2.0</a>.
- The full text of the license is below. Modifications copyright © 2016,2021 <a href="mailto:soren@stoutner.com">Soren Stoutner</a>.
- The resulting image is released under the <a href="https://www.gnu.org/licenses/gpl-3.0.html">GPLv3+ license</a>.</p>
- <p><img class="left" src="../images/not_secure.svg"/> is derived from <code>security</code> and <code>do_not_disturb</code>,
- which are part of the <a href="https://material.io/icons/">Android Material icon set</a> and are released under the <a href ="https://www.apache.org/licenses/LICENSE-2.0">Apache License 2.0</a>.
- Modifications copyright © 2016,2021 <a href="mailto:soren@stoutner.com">Soren Stoutner</a>.
- The resulting image is released under the <a href="https://www.gnu.org/licenses/gpl-3.0.html">GPLv3+ license</a>.</p>
- <p>The following icons come from the <a href="https://material.io/icons/">Android Material icon set</a>,
- which is released under the <a href ="https://www.apache.org/licenses/LICENSE-2.0">Apache License 2.0</a>.
- They are unchanged except for layout information like color and size. Some of them have been renamed to match their use in the code. The original icons and names are shown below.</p>
+ <h3>Licenza</h3>
+ <p>Privacy Cell è rilasciato con <a href="https://www.gnu.org/licenses/gpl-3.0.html">Licenza GPLv3+</a>. Il testo completo è riportato di seguito.
+ Il codice sorgente è disponibile su <a href="https://gitweb.stoutner.com/?p=PrivacyCell.git;a=summary">gitweb.stoutner.com</a>.</p>
+
+ <h3>Librerie</h3>
+ <p>Privacy Cell è compilato con le <a href="https://developer.android.com/jetpack/androidx/">Librerie AndroidX</a>,
+ le <a href="https://github.com/JetBrains/kotlin/tree/master/license">Librerie Kotlin</a>,
+ e codice tratto da <a href="https://mvnrepository.com/artifact/com.google.android.material/material">Google Material Maven repository</a>,
+ che sono rilasciati sotto <a href="https://www.apache.org/licenses/LICENSE-2.0">Licenza Apache 2.0</a>. Il testo completo della licenza è riportato di seguito.</p>
+
+ <h3>Icone</h3>
+ <p><img class="left" src="../images/privacy_cell.svg"/> <img class="left" src="../images/secure_notification.svg"/> sono derivate da <code>security</code> e <code>5g</code>,
+ che sono parte del <a href="https://material.io/icons/">set di icone Android Material</a> e sono rilasciate sotto la <a href ="https://www.apache.org/licenses/LICENSE-2.0">Licenza Apache 2.0</a>.
+ Il testo completo della licenza è riportato qui sotto. Il copyright delle modifiche © 2016,2021 appartiene a <a href="mailto:soren@stoutner.com">Soren Stoutner</a>.
+ Le immagini risultanti sono rilasciate sotto la <a href="https://www.gnu.org/licenses/gpl-3.0.html">Licenza GPLv3+</a>.</p>
+ <p><img class="left" src="../images/not_secure.svg"/> <img class="left" src="../images/insecure_notification.svg"/> sono derivate da <code>security</code> e <code>do_not_disturb</code>,
+ che sono parte del <a href="https://material.io/icons/">set di icone Android Material</a> e sono rilasciate sotto la <a href ="https://www.apache.org/licenses/LICENSE-2.0">Licenza Apache 2.0</a>.
+ Il copyright delle modifiche © 2016,2021 appartiene a <a href="mailto:soren@stoutner.com">Soren Stoutner</a>.
+ Le immagini risultanti sono rilasciate sotto la <a href="https://www.gnu.org/licenses/gpl-3.0.html">Licenza GPLv3+</a>.</p>
+ <p>Le icone seguenti provengono dal <a href="https://material.io/icons/">set di icone Android Material</a>,
+ che è rilasciato sotto la <a href ="https://www.apache.org/licenses/LICENSE-2.0">Licenza Apache 2.0</a>.
+ Non sono state modificate ad eccezione delle informazioni del layout come il colore e le dimensioni. Alcune sono state rinominate per essere coerenti con il loro utilizzo nel codice.
+ Le icone originali e i loro nomi sono riportate di seguito.</p>
<p><svg class="icon"><use href="../images/bug_report_rounded.svg#icon"/></svg> bug_report_rounded.</p>
<p><svg class="icon"><use href="../images/call_to_action_rounded.svg#icon"/></svg> call_to_action_rounded.</p>
<p><svg class="icon"><use href="../images/chrome_reader_mode_rounded.svg#icon"/></svg> chrome_reader_mode_rounded.</p>
<h3>Lettura dello stato e dell'identità del telefono</h3>
<p><a href="https://developer.android.com/reference/android/Manifest.permission.html#READ_PHONE_STATE">android.permission. READ_PHONE_STATE</a></p>
<p>Richiesta per determinare i protocolli utilizzati dalla rete.</p>
+
+ <h3>Run foreground service</h3>
+ <p><a href="https://developer.android.com/reference/android/Manifest.permission#FOREGROUND_SERVICE">android.permission. FOREGROUND_SERVICE</a></p>
+ <p>Allows Privacy Cell to display a realtime monitoring notification icon in the status bar.</p>
+
+ <h3>Run at startup</h3>
+ <p><a href="https://developer.android.com/reference/android/Manifest.permission#RECEIVE_BOOT_COMPLETED">android.permission. RECEIVE_BOOT_COMPLETED</a></p>
+ <p>Allows Privacy Cell to enable the realtime monitoring service when the phone boots.</p>
</body>
</html>
\ No newline at end of file
<body>
<h3>Privacy Cell</h3>
- <p><strong class="red">Privacy Cell does not collect any user information.</strong></p>
+ <p><strong class="red">Privacy Cell non raccoglie alcuna informazione dagli utenti.</strong></p>
<h3>Google Play</h3>
- <p>Google Play has its <a href="https://policies.google.com/privacy">own privacy policy</a>.
- Google provides anonymized summary installation information to developers, including the number of installs organized by the following categories.</p>
+ <p>Google Play ha una <a href="https://policies.google.com/privacy">propria privacy policy</a>.
+ Google fornisce agli sviluppatori informazioni anonime sulle installazioni, incluso il numero di installazioni, secondo le seguenti categorie.</p>
<ul>
- <li><item>Android version</item> (eg. Android 7.1)</li>
- <li><item>Device</item> (eg. Samsung Galaxy S6 [zeroflte])</li>
- <li><item>Tablets</item> (eg. Tablets 10" and above)</li>
- <li><item>Country</item> (eg. United States)</li>
- <li><item>Language</item> (eg. English [United States])</li>
- <li><item>App version</item> (eg. 14)</li>
- <li><item>Carrier </item>(eg. T-Mobile – US)</li>
+ <li><item>Versione Android</item> (es. Android 7.1)</li>
+ <li><item>Dispositivo</item> (es. Samsung Galaxy S6 [zeroflte])</li>
+ <li><item>Tablet</item> (es. Tablet 10" o superiore)</li>
+ <li><item>Nazione</item> (es. United States)</li>
+ <li><item>Lingua</item> (es. English [United States])</li>
+ <li><item>Versione App</item> (es. 14)</li>
+ <li><item>Vettore</item> (es. T-Mobile - US)</li>
</ul>
- <h3>Google Play Ratings</h3>
- <p>Google Play has its <a href="https://policies.google.com/privacy">own privacy policy</a>.
- Google provides developers with anonymized summaries of the following information related to user ratings.</p>
+ <h3>Ratings di Google Play</h3>
+ <p>Google Play ha una <a href="https://policies.google.com/privacy">propria privacy policy</a>.
+ Google fornisce agli sviluppatori sintesi anonime delle seguenti informazioni collegate ai ratings degli utenti.</p>
<ul>
- <li><item>Country</item> (eg. United States)</li>
- <li><item>Language</item> (eg. English)</li>
- <li><item>App version</item> (eg. 14)</li>
- <li><item>Android version</item> (eg. 7.1)</li>
- <li><item>Device</item> (eg. Google Nexus 5X [bullhead])</li>
- <li><item>Tablets</item> (eg. Tablets 10" and above)</li>
+ <li><item>Nazione</item> (es. United States)</li>
+ <li><item>Lingua</item> (es. English)</li>
+ <li><item>Versione App</item> (es. 14)</li>
+ <li><item>Versione Android</item> (es. Android 7.1)</li>
+ <li><item>Dispositivo</item> (es. Google Nexus 5X [bullhead])</li>
+ <li><item>Tablet</item> (es. Tablets 10" o superiore)</li>
</ul>
- <h3>Google Play Reviews</h3>
- <p>Google Play has its <a href="https://policies.google.com/privacy">own privacy policy</a>.
- In addition to the name of the reviewer, the rating, and the text of the review (which are all available publicly), Google provides some or all of the following information to the developer.</p>
+ <h3>Recensioni di Google Play</h3>
+ <p>Google Play ha una <a href="https://policies.google.com/privacy">propria privacy policy</a>.
+ Oltre al nome del recensore, al rating, e al testo della recensione (i quali sono tutti pubblicamente disponibili), Google fornisce alcune o tutte le seguenti informazioni allo sviluppatore.</p>
<ul>
- <li><item>Version code</item> (eg. 7)</li>
- <li><item>Version name</item> (eg. 1.6)</li>
- <li><item>Android version</item> (eg. Android 5.1)</li>
- <li><item>Device </item>(eg. Galaxy S6 Edge+ [zenlte])</li>
- <li><item>Manufacturer</item> (eg. Samsung)</li>
- <li><item>Device type</item> (eg. Phone)</li>
- <li><item>CPU make</item> (eg. Samsung)</li>
- <li><item>CPU model</item> (eg. Exynos 7420)</li>
- <li><item>Screen density</item> (eg. 560 dpi)</li>
- <li><item>Screen size</item> (eg. 2560 x 1440)</li>
- <li><item>RAM</item> (eg. 4096 MB)</li>
- <li><item>Native platform</item> (eg. armeabi-v7a,armeabi,arm64v8a)</li>
- <li><item>OpenGL ES version</item> (eg. 3.1)</li>
- <li><item>Device language</item> (eg. English)</li>
+ <li><item>Codice Versione</item> (es. 7)</li>
+ <li><item>Nome Versione</item> (es. 1.6)</li>
+ <li><item>Versione Android</item> (es. Android 5.1)</li>
+ <li><item>Dispositivo</item> (es. Galaxy S6 Edge+ [zenlte])</li>
+ <li><item>Costruttore</item> (es. Samsung)</li>
+ <li><item>Tipo di dispositivo</item> (es. SmartPhone)</li>
+ <li><item>Produttore CPU</item> (es. Samsung)</li>
+ <li><item>Modello CPU</item> (es. Exynos 7420)</li>
+ <li><item>Risoluzione schermo</item> (es. 560 dpi)</li>
+ <li><item>Dimensione Schermo</item> (es. 2560 x 1440)</li>
+ <li><item>RAM</item> (es. 4096 MB)</li>
+ <li><item>Piattaforma nativa</item> (es. armeabi-v7a,armeabi,arm64v8a)</li>
+ <li><item>Versione OpenGL ES</item> (es. 3.1)</li>
+ <li><item>Lingua del dispositivo</item> (es. English)</li>
</ul>
- <h3>Direct Communications</h3>
- <p>Users may choose to send direct communications to Stoutner, like email messages and comments on <a href="https://www.stoutner.com/">stoutner.com</a>.</p>
+ <h3>Comunicazioni Dirette</h3>
+ <p>E' possibile inviare comunicazioni dirette a Stoutner, ad esempio email o commenti su <a href="https://www.stoutner.com/">stoutner.com</a>.</p>
- <h3>Use of Information</h3>
- <p><strong class="blue">Stoutner may use this information to assist in the development of Privacy Cell and communicate the status of the project to users.</strong>
- <strong class="red">Stoutner will never sell the information nor transfer it to any third party that would use it for advertising or marketing.</strong></p>
+ <h3>Uso delle informazioni</h3>
+ <p><strong class="blue">Stoutner si riserva di utilizzare queste informazioni per lo sviluppo di Privacy Cell e per comunicare lo stato del progetto agli utenti.</strong>
+ <strong class="red">Stoutner non vendera' mai ne trasferira' le informazioni ad alcuna terza parte che possa utilizzarle per scopi pubblicitari o di marketing.</strong></p>
<hr />
- <p style="text-align: center;"><em>Revision 1.0, 23 August 2021</em></p>
+ <p style="text-align: center;"><em>Revisione 1.0, 23 Agosto 2021</em></p>
</body>
</html>
\ No newline at end of file
package com.stoutner.privacycell.activities
import android.Manifest
+import android.app.ActivityManager
import android.content.Context
import android.content.Intent
import android.content.pm.PackageManager
import com.stoutner.privacycell.R
import com.stoutner.privacycell.dialogs.PhonePermissionDialog
import com.stoutner.privacycell.dialogs.WebViewDialog
+import com.stoutner.privacycell.services.RealtimeMonitoringService
class PrivacyCellActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelectedListener, PhonePermissionDialog.StoragePermissionDialogListener {
// Declare the class variables.
// Get a handle for the shared preferences.
val sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this)
- // Get the bottom app bar preference.
+ // Get the preferences.
+ val realtimeMonitoring = sharedPreferences.getBoolean(getString(R.string.realtime_monitoring_key), false)
val bottomAppBar = sharedPreferences.getBoolean(getString(R.string.bottom_app_bar_key), false)
// Set the content view.
// Do nothing.
}
})
+
+ // Start the realtime monitoring service if it is enabled.
+ if (realtimeMonitoring) {
+ // Get a handle for the activity manager.
+ val activityManager: ActivityManager = getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager
+
+ // Get a list of the running service info. The deprecated `getRunningServices()` now only returns services stared by Privacy Cell, but that is all we want to know anyway.
+ val runningServiceInfoList: List<ActivityManager.RunningServiceInfo> = activityManager.getRunningServices(1)
+
+ // Start the service if it is not already running.
+ if (runningServiceInfoList.isEmpty()) {
+ startService(Intent(this, RealtimeMonitoringService::class.java))
+ }
+ }
}
override fun onPostCreate(savedInstanceState: Bundle?) {
// Check to see if the read phone state permission has been granted. These commands need to be run on every resume so that the listener gets reassigned as it is automatically paused.
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.READ_PHONE_STATE) == PackageManager.PERMISSION_GRANTED) { // The storage permission has been granted.
// Populate Privacy Cell.
- populatePrivacyCell()
+ populatePrivacyCell(this)
} else { // The phone permission has not been granted.
// Check if the user has previously denied the storage permission.
if (ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.READ_PHONE_STATE)) { // Show a dialog explaining the request first.
// Check to see if the read phone state permission was granted. If the dialog was canceled the grant results will be empty.
if (grantResults[0] == PackageManager.PERMISSION_GRANTED) { // The read phone state permission was granted.
// Populate Privacy Cell.
- populatePrivacyCell()
+ populatePrivacyCell(this)
} else { // The read phone state permission was denied.
// Display the phone permission text on the main activity.
stingrayTextView.text = getString(R.string.phone_permission_text)
}
}
- private fun populatePrivacyCell() {
+ private fun populatePrivacyCell(context: Context) {
// Listen to changes in the cell network state.
telephonyManager.listen(object : PhoneStateListener() {
override fun onDisplayInfoChanged(telephonyDisplayInfo: TelephonyDisplayInfo) {
import android.os.Bundle
import android.os.Handler
import android.os.Looper
+import android.provider.Settings
import androidx.preference.Preference
import androidx.preference.PreferenceFragmentCompat
import com.stoutner.privacycell.R
+import com.stoutner.privacycell.services.RealtimeMonitoringService
class SettingsFragment : PreferenceFragmentCompat() {
// Declare the class variables.
private lateinit var sharedPreferenceChangeListener: SharedPreferences.OnSharedPreferenceChangeListener
// Declare the class views.
+ private lateinit var realtimeMonitoringPreference: Preference
private lateinit var bottomAppBarPreference: Preference
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
val sharedPreferences = preferenceScreen.sharedPreferences
// Get handles for the preferences.
+ realtimeMonitoringPreference = findPreference(getString(R.string.realtime_monitoring_key))!!
+ val secureNetworkNotificationPreference = findPreference<Preference>(getString(R.string.secure_network_notification_key))!!
+ val insecureNetworkNotificationPreference = findPreference<Preference>(getString(R.string.insecure_network_notification_key))!!
bottomAppBarPreference = findPreference(getString(R.string.bottom_app_bar_key))!!
+ // Set the realtime monitoring preference icon.
+ if (sharedPreferences.getBoolean(getString(R.string.realtime_monitoring_key), false)) {
+ // Set the enabled icon.
+ realtimeMonitoringPreference.setIcon(R.drawable.realtime_monitoring_enabled)
+ } else {
+ // Set the disabled icon.
+ realtimeMonitoringPreference.setIcon(R.drawable.realtime_monitoring_disabled)
+ }
+
+ // Set the notification preferences to depend on the realtime monitoring preference.
+ secureNetworkNotificationPreference.dependency = getString(R.string.realtime_monitoring_key)
+ insecureNetworkNotificationPreference.dependency = getString(R.string.realtime_monitoring_key)
+
+ // Create the notification intents.
+ val secureNetworkNotificationIntent = Intent(Settings.ACTION_CHANNEL_NOTIFICATION_SETTINGS)
+ .putExtra(Settings.EXTRA_APP_PACKAGE, requireContext().packageName)
+ .putExtra(Settings.EXTRA_CHANNEL_ID, RealtimeMonitoringService.SECURE_NETWORK)
+ val insecureNetworkNotificationIntent = Intent(Settings.ACTION_CHANNEL_NOTIFICATION_SETTINGS)
+ .putExtra(Settings.EXTRA_APP_PACKAGE, requireContext().packageName)
+ .putExtra(Settings.EXTRA_CHANNEL_ID, RealtimeMonitoringService.INSECURE_NETWORK)
+
+ // Set the notification preference intents.
+ secureNetworkNotificationPreference.intent = secureNetworkNotificationIntent
+ insecureNetworkNotificationPreference.intent = insecureNetworkNotificationIntent
+
// Set the bottom app bar preference icon.
if (sharedPreferences.getBoolean(getString(R.string.bottom_app_bar_key), false)) {
// Set the enabled icon.
// Return the shared preference change listener.
return SharedPreferences.OnSharedPreferenceChangeListener {sharedPreferences, key ->
when (key) {
- "bottom_app_bar" -> {
+ getString(R.string.realtime_monitoring_key) -> {
+ // Update the icon.
+ if (sharedPreferences.getBoolean(getString(R.string.realtime_monitoring_key), false)) {
+ // Set the enabled icon.
+ realtimeMonitoringPreference.setIcon(R.drawable.realtime_monitoring_enabled)
+ } else {
+ // Set the disabled icon.
+ realtimeMonitoringPreference.setIcon(R.drawable.realtime_monitoring_disabled)
+ }
+
+ // Start or stop the service.
+ if (sharedPreferences.getBoolean(getString(R.string.realtime_monitoring_key), false)) { // Realtime monitoring has been enabled.
+ // Start the realtime monitoring service.
+ requireActivity().startService(Intent(context, RealtimeMonitoringService::class.java))
+ } else { // Realtime monitoring has been disabled.
+ // Stop the realtime monitoring service.
+ requireActivity().stopService(Intent(context, RealtimeMonitoringService::class.java))
+ }
+ }
+
+ getString(R.string.bottom_app_bar_key) -> {
// Update the icon.
if (sharedPreferences.getBoolean(getString(R.string.bottom_app_bar_key), false)) {
// Set the enabled icon.
--- /dev/null
+/*
+ * Copyright © 2021 Soren Stoutner <soren@stoutner.com>.
+ *
+ * This file is part of Privacy Cell <https://www.stoutner.com/privacy-cell>.
+ *
+ * Privacy Cell is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Privacy Cell is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Privacy Cell. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.stoutner.privacycell.receivers
+
+import android.content.BroadcastReceiver
+import android.content.Context
+import android.content.Intent
+import androidx.preference.PreferenceManager
+import com.stoutner.privacycell.R
+import com.stoutner.privacycell.services.RealtimeMonitoringService
+
+class OnBootCompletedReceiver : BroadcastReceiver() {
+ override fun onReceive(context: Context, intent: Intent) {
+ // Check to make sure the system ACTION_BOOT_COMPLETED initiated the receiver.
+ if (intent.action == Intent.ACTION_BOOT_COMPLETED) {
+ // Get a handle for the shared preferences.
+ val sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context)
+
+ // Get the realtime monitoring preference.
+ val realtimeMonitoring = sharedPreferences.getBoolean(context.getString(R.string.realtime_monitoring_key), false)
+
+ // Start the realtime monitoring service if it is enabled.
+ if (realtimeMonitoring) {
+ context.startForegroundService(Intent(context, RealtimeMonitoringService::class.java))
+ }
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright © 2021 Soren Stoutner <soren@stoutner.com>.
+ *
+ * This file is part of Privacy Cell <https://www.stoutner.com/privacy-cell>.
+ *
+ * Privacy Cell is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Privacy Cell is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Privacy Cell. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.stoutner.privacycell.services
+
+import android.app.Notification
+import android.app.NotificationChannel
+import android.app.NotificationChannelGroup
+import android.app.NotificationManager
+import android.app.PendingIntent
+import android.app.Service
+import android.content.Context
+import android.content.Intent
+import android.os.IBinder
+import android.telephony.PhoneStateListener
+import android.telephony.TelephonyDisplayInfo
+import android.telephony.TelephonyManager
+
+import com.stoutner.privacycell.R
+import com.stoutner.privacycell.activities.PrivacyCellActivity
+
+// Define the class constants.
+const val REALTIME_MONITORING = "realtime_monitoring"
+const val NOTIFICATION_ID = 1
+
+class RealtimeMonitoringService : Service() {
+ companion object {
+ // Define the public constants.
+ const val SECURE_NETWORK = "secure_network"
+ const val INSECURE_NETWORK = "insecure_network"
+ }
+
+ override fun onBind(intent: Intent?): IBinder? {
+ // Do nothing.
+ return null
+ }
+
+ override fun onStartCommand(intent: Intent, flags: Int, startId: Int): Int {
+ // Get a handle for the notification manager.
+ val notificationManager = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
+
+ // Create a notification channel group.
+ notificationManager.createNotificationChannelGroup(NotificationChannelGroup(REALTIME_MONITORING, getString(R.string.realtime_monitoring)))
+
+ // Prepare the notification channels.
+ val secureNetworkChannel = NotificationChannel(SECURE_NETWORK, getString(R.string.secure_network_channel), NotificationManager.IMPORTANCE_DEFAULT)
+ val insecureNetworkChannel = NotificationChannel(INSECURE_NETWORK, getString(R.string.insecure_network_channel), NotificationManager.IMPORTANCE_DEFAULT)
+
+ // Set the notification channel group.
+ secureNetworkChannel.group = REALTIME_MONITORING
+ insecureNetworkChannel.group = REALTIME_MONITORING
+
+ // Disable the notification dots.
+ secureNetworkChannel.setShowBadge(false)
+ insecureNetworkChannel.setShowBadge(false)
+
+ // Set the notifications to be public.
+ secureNetworkChannel.lockscreenVisibility = Notification.VISIBILITY_PUBLIC
+ insecureNetworkChannel.lockscreenVisibility = Notification.VISIBILITY_PUBLIC
+
+ // Create the notification channels.
+ notificationManager.createNotificationChannel(secureNetworkChannel)
+ notificationManager.createNotificationChannel(insecureNetworkChannel)
+
+ // Create a notification builder.
+ val notificationBuilder = Notification.Builder(this, INSECURE_NETWORK)
+
+ // Create an intent to open Privacy Cell.
+ val privacyCellIntent = Intent(this, PrivacyCellActivity::class.java)
+
+ // Create a pending intent from the Privacy Cell intent.
+ val privacyCellPendingIntent = PendingIntent.getActivity(this, 0, privacyCellIntent, PendingIntent.FLAG_IMMUTABLE)
+
+ // Set the notification to open Privacy Cell.
+ notificationBuilder.setContentIntent(privacyCellPendingIntent)
+
+ // Set the notification text.
+ notificationBuilder.setContentText(getString(R.string.unknown_network))
+
+ // Set the notification icon.
+ notificationBuilder.setSmallIcon(R.drawable.insecure_notification)
+
+ // Set the color.
+ notificationBuilder.setColor(getColor(R.color.red_text))
+
+ // Start the foreground notification.
+ startForeground(NOTIFICATION_ID, notificationBuilder.build())
+
+ // Get a handle for the telephony manager and the context.
+ val telephonyManager = getSystemService(Context.TELEPHONY_SERVICE) as TelephonyManager
+
+ // Initialize the current status.
+ var currentStatus = ""
+
+ // Listen for changes to the phone state.
+ telephonyManager.listen(object : PhoneStateListener() {
+ override fun onDisplayInfoChanged(telephonyDisplayInfo: TelephonyDisplayInfo) {
+ // Populate the notification according to the network type.
+ if (telephonyDisplayInfo.networkType == TelephonyManager.NETWORK_TYPE_NR) { // This is a secure 5G NR SA network.
+ // Only update the notification if the network status has changed.
+ if (currentStatus != SECURE_NETWORK) {
+ // Create a secure network notification builder.
+ val secureNetworkNotificationBuilder = Notification.Builder(applicationContext, SECURE_NETWORK)
+
+ // Set the notification to open Privacy Cell.
+ secureNetworkNotificationBuilder.setContentIntent(privacyCellPendingIntent)
+
+ // Set the notification text.
+ secureNetworkNotificationBuilder.setContentText(getString(R.string.secure_network))
+
+ // Set the notification icon.
+ secureNetworkNotificationBuilder.setSmallIcon(R.drawable.secure_notification)
+
+ // Set the color.
+ secureNetworkNotificationBuilder.setColor(getColor(R.color.blue_text))
+
+ // Update the notification.
+ notificationManager.notify(NOTIFICATION_ID, secureNetworkNotificationBuilder.build())
+
+ // Store the new network status.
+ currentStatus = SECURE_NETWORK
+ }
+ } else { // This is not a secure 5G NR SA network.
+ // Only update the notification if the network status has changed.
+ if (currentStatus !=INSECURE_NETWORK) {
+ // Create an insecure network notification builder.
+ val insecureNetworkNotificationBuilder = Notification.Builder(applicationContext, INSECURE_NETWORK)
+
+ // Set the notification to open Privacy Cell.
+ insecureNetworkNotificationBuilder.setContentIntent(privacyCellPendingIntent)
+
+ // Set the notification text.
+ insecureNetworkNotificationBuilder.setContentText(getString(R.string.insecure_network))
+
+ // Set the notification icon.
+ insecureNetworkNotificationBuilder.setSmallIcon(R.drawable.insecure_notification)
+
+ // Set the color.
+ insecureNetworkNotificationBuilder.setColor(getColor(R.color.red_text))
+
+ // Update the notification.
+ notificationManager.notify(NOTIFICATION_ID, insecureNetworkNotificationBuilder.build())
+
+ // Store the new network status.
+ currentStatus = INSECURE_NETWORK
+ }
+ }
+ }
+ }, PhoneStateListener.LISTEN_DISPLAY_INFO_CHANGED)
+
+ // Return a sticky service.
+ return START_STICKY
+ }
+}
\ No newline at end of file
--- /dev/null
+<!--
+ This file is derived from `security` and `do_not_disturb`, which are part of the Android Material icon set. They are released under the Apache License 2.0.
+
+ Changes copyright © 2016,2021 Soren Stoutner <soren@stoutner.com>. The resulting image is released under the GPLv3+ license.
+
+ This file is part of Privacy Cell <https://www.stoutner.com/privacy-cell>.
+
+ Privacy Cell is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Privacy Cell is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Privacy Cell. If not, see <http://www.gnu.org/licenses/>. -->
+
+<vector
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:height="24dp"
+ android:width="24dp"
+ android:viewportHeight="256"
+ android:viewportWidth="256" >
+
+ <path
+ android:fillColor="@color/red_700"
+ android:pathData="M128,0 L23.272,46.546L23.272,116.363C23.272,180.945 67.956,241.338 128,256 188.044,241.338 232.728,180.945 232.728,116.363L232.728,46.546ZM128,46.928c44.752,0 81.072,36.321 81.072,81.072 0,44.752 -36.321,81.072 -81.072,81.072C83.248,209.072 46.928,172.752 46.928,128 46.928,83.248 83.248,46.928 128,46.928ZM128,63.143c-14.998,0 -28.781,5.108 -39.726,13.701L179.156,167.726C187.75,156.781 192.857,142.998 192.857,128 192.857,92.166 163.834,63.143 128,63.143ZM76.844,88.274C68.25,99.219 63.143,113.002 63.143,128c0,35.834 29.024,64.857 64.857,64.857 14.998,0 28.781,-5.108 39.726,-13.701z" />
+</vector>
\ No newline at end of file
--- /dev/null
+<!--
+ This file is derived from `security` and `5g`, which are part of the Android Material icon set. They are released under the Apache License 2.0.
+
+ Changes copyright © 2016,2021 Soren Stoutner <soren@stoutner.com>. The resulting image is released under the GPLv3+ license.
+
+ This file is part of Privacy Cell <https://www.stoutner.com/privacy-cell>.
+
+ Privacy Cell is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Privacy Cell is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Privacy Cell. If not, see <http://www.gnu.org/licenses/>. -->
+
+<vector
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:height="24dp"
+ android:width="24dp"
+ android:viewportHeight="256"
+ android:viewportWidth="256" >
+
+ <path
+ android:fillColor="@color/icon_disabled"
+ android:pathData="M128,0 L23.273,46.545L23.273,116.364c-0,64.582 44.684,124.974 104.727,139.636 60.044,-14.662 104.727,-75.054 104.727,-139.636L232.727,46.545ZM54.852,76.633l48.656,0c4.541,0 8.109,3.569 8.109,8.11 0,4.541 -3.568,8.109 -8.109,8.109l-40.547,0l0,24.327l32.437,0c8.92,0 16.219,7.298 16.219,16.219l0,24.328c0,8.92 -7.298,16.219 -16.219,16.219l-40.546,0c-4.541,0 -8.11,-3.569 -8.11,-8.11 0,-4.541 3.569,-8.109 8.11,-8.109l40.546,0l0,-24.328l-40.546,0c-4.541,0 -8.11,-3.568 -8.11,-8.109l0,-40.546c0,-4.541 3.569,-8.11 8.11,-8.11zM144.054,76.633l56.765,0c4.541,0 8.109,3.569 8.109,8.11 0,4.541 -3.568,8.109 -8.109,8.109L144.054,92.852l0,64.874l48.656,0l0,-24.328l-24.328,0c-4.541,0 -8.109,-3.568 -8.109,-8.109 0,-4.541 3.568,-8.11 8.109,-8.11l32.437,0c4.541,0 8.109,3.569 8.109,8.11l0,32.437c0,8.92 -7.297,16.219 -16.218,16.219L144.054,173.945c-8.92,0 -16.219,-7.298 -16.219,-16.219L127.835,92.852c0,-8.92 7.298,-16.219 16.219,-16.219z" />
+</vector>
\ No newline at end of file
--- /dev/null
+<!--
+ This file is derived from `security` and `5g`, which are part of the Android Material icon set. They are released under the Apache License 2.0.
+
+ Changes copyright © 2016,2021 Soren Stoutner <soren@stoutner.com>. The resulting image is released under the GPLv3+ license.
+
+ This file is part of Privacy Cell <https://www.stoutner.com/privacy-cell>.
+
+ Privacy Cell is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Privacy Cell is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Privacy Cell. If not, see <http://www.gnu.org/licenses/>. -->
+
+<vector
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:height="24dp"
+ android:width="24dp"
+ android:viewportHeight="256"
+ android:viewportWidth="256" >
+
+ <path
+ android:fillColor="@color/icon_enabled"
+ android:pathData="M128,0 L23.273,46.545L23.273,116.364c-0,64.582 44.684,124.974 104.727,139.636 60.044,-14.662 104.727,-75.054 104.727,-139.636L232.727,46.545ZM54.852,76.633l48.656,0c4.541,0 8.109,3.569 8.109,8.11 0,4.541 -3.568,8.109 -8.109,8.109l-40.547,0l0,24.327l32.437,0c8.92,0 16.219,7.298 16.219,16.219l0,24.328c0,8.92 -7.298,16.219 -16.219,16.219l-40.546,0c-4.541,0 -8.11,-3.569 -8.11,-8.11 0,-4.541 3.569,-8.109 8.11,-8.109l40.546,0l0,-24.328l-40.546,0c-4.541,0 -8.11,-3.568 -8.11,-8.109l0,-40.546c0,-4.541 3.569,-8.11 8.11,-8.11zM144.054,76.633l56.765,0c4.541,0 8.109,3.569 8.109,8.11 0,4.541 -3.568,8.109 -8.109,8.109L144.054,92.852l0,64.874l48.656,0l0,-24.328l-24.328,0c-4.541,0 -8.109,-3.568 -8.109,-8.109 0,-4.541 3.568,-8.11 8.109,-8.11l32.437,0c4.541,0 8.109,3.569 8.109,8.11l0,32.437c0,8.92 -7.297,16.219 -16.218,16.219L144.054,173.945c-8.92,0 -16.219,-7.298 -16.219,-16.219L127.835,92.852c0,-8.92 7.298,-16.219 16.219,-16.219z" />
+</vector>
\ No newline at end of file
--- /dev/null
+<!--
+ This file is derived from `security` and `5g`, which are part of the Android Material icon set. They are released under the Apache License 2.0.
+
+ Changes copyright © 2016,2021 Soren Stoutner <soren@stoutner.com>. The resulting image is released under the GPLv3+ license.
+
+ This file is part of Privacy Cell <https://www.stoutner.com/privacy-cell>.
+
+ Privacy Cell is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Privacy Cell is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Privacy Cell. If not, see <http://www.gnu.org/licenses/>. -->
+
+<vector
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:height="24dp"
+ android:width="24dp"
+ android:viewportHeight="256"
+ android:viewportWidth="256" >
+
+ <path
+ android:fillColor="@color/blue_700"
+ android:pathData="M128,0 L23.273,46.545L23.273,116.364c-0,64.582 44.684,124.974 104.727,139.636 60.044,-14.662 104.727,-75.054 104.727,-139.636L232.727,46.545ZM54.852,76.633l48.656,0c4.541,0 8.109,3.569 8.109,8.11 0,4.541 -3.568,8.109 -8.109,8.109l-40.547,0l0,24.327l32.437,0c8.92,0 16.219,7.298 16.219,16.219l0,24.328c0,8.92 -7.298,16.219 -16.219,16.219l-40.546,0c-4.541,0 -8.11,-3.569 -8.11,-8.11 0,-4.541 3.569,-8.109 8.11,-8.109l40.546,0l0,-24.328l-40.546,0c-4.541,0 -8.11,-3.568 -8.11,-8.109l0,-40.546c0,-4.541 3.569,-8.11 8.11,-8.11zM144.054,76.633l56.765,0c4.541,0 8.109,3.569 8.109,8.11 0,4.541 -3.568,8.109 -8.109,8.109L144.054,92.852l0,64.874l48.656,0l0,-24.328l-24.328,0c-4.541,0 -8.109,-3.568 -8.109,-8.109 0,-4.541 3.568,-8.11 8.109,-8.11l32.437,0c4.541,0 8.109,3.569 8.109,8.11l0,32.437c0,8.92 -7.297,16.219 -16.218,16.219L144.054,173.945c-8.92,0 -16.219,-7.298 -16.219,-16.219L127.835,92.852c0,-8.92 7.298,-16.219 16.219,-16.219z" />
+</vector>
\ No newline at end of file
<string name="donations">Donations</string>
<!-- Settings. -->
+ <string name="monitoring">Monitoring</string>
+ <string name="realtime_monitoring">Realtime monitoring</string>
+ <string name="realtime_monitoring_summary">Place an icon in the status bar that monitors the cell network.</string>
+ <string name="secure_network_notification">Secure network notification</string>
+ <string name="insecure_network_notification">Insecure network notification</string>
+ <string name="interface_title">Interface</string>
<string name="bottom_app_bar">Bottom app bar</string>
<string name="bottom_app_bar_summary">Move the app bar to the bottom of the screen. Changing this setting will restart Privacy Cell.</string>
<string name="stingrays">Stingrays</string>
<string name="close">Close</string>
+ <!-- Notifications. -->
+ <string name="secure">Secure</string>
+ <string name="insecure">Insecure</string>
+ <string name="secure_network">You are connected to a secure network.</string>
+ <string name="insecure_network">You are not connected to a secure network.</string>
+ <string name="unknown_network">The security of the network is unknown.</string>
+ <string name="secure_network_channel">Secure network</string>
+ <string name="insecure_network_channel">Insecure network</string>
+
<!-- Preference keys. -->
+ <string name="monitoring_key" translatable="false">monitoring</string>
+ <string name="realtime_monitoring_key" translatable="false">realtime_monitoring</string>
+ <string name="secure_network_notification_key" translatable="false">secure_network_notification</string>
+ <string name="insecure_network_notification_key" translatable="false">insecure_network_notification</string>
+ <string name="interface_key" translatable="false">interface</string>
<string name="bottom_app_bar_key" translatable="false">bottom_app_bar</string>
</resources>
\ No newline at end of file
You should have received a copy of the GNU General Public License
along with Privacy Cell. If not, see <http://www.gnu.org/licenses/>. -->
-<PreferenceScreen xmlns:app="http://schemas.android.com/apk/res-auto">
- <SwitchPreferenceCompat
- app:key="bottom_app_bar"
- app:title="@string/bottom_app_bar"
- app:summary="@string/bottom_app_bar_summary"
- app:defaultValue="false" />
+<PreferenceScreen
+ xmlns:app="http://schemas.android.com/apk/res-auto" >
+
+ <PreferenceCategory
+ app:key="@string/monitoring_key"
+ app:title="@string/monitoring" >
+
+ <SwitchPreferenceCompat
+ app:key="@string/realtime_monitoring_key"
+ app:title="@string/realtime_monitoring"
+ app:summary="@string/realtime_monitoring_summary"
+ app:defaultValue="false" />
+
+ <Preference
+ app:key="@string/secure_network_notification_key"
+ app:title="@string/secure_network_notification" />
+
+ <Preference
+ app:key="@string/insecure_network_notification_key"
+ app:title="@string/insecure_network_notification" />
+ </PreferenceCategory>
+
+ <PreferenceCategory
+ app:key="@string/interface_key"
+ app:title="@string/interface_title" >
+
+ <SwitchPreferenceCompat
+ app:key="@string/bottom_app_bar_key"
+ app:title="@string/bottom_app_bar"
+ app:summary="@string/bottom_app_bar_summary"
+ app:defaultValue="false" />
+ </PreferenceCategory>
</PreferenceScreen>
\ No newline at end of file
dependencies {
classpath 'com.android.tools.build:gradle:7.0.2'
- classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.30"
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files