From 71ab73f0661d4bb43bb45bd9f0340e10aa59dea7 Mon Sep 17 00:00:00 2001 From: Poussinou Date: Fri, 5 Jan 2018 21:16:03 +0100 Subject: [PATCH 1/8] Create array.xml --- app/src/main/res/values-fr/array.xml | 61 ++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 app/src/main/res/values-fr/array.xml diff --git a/app/src/main/res/values-fr/array.xml b/app/src/main/res/values-fr/array.xml new file mode 100644 index 00000000..bf265ac5 --- /dev/null +++ b/app/src/main/res/values-fr/array.xml @@ -0,0 +1,61 @@ + + + + 500 + 450 + 400 + 350 + 300 + 250 + 200 + 150 + 100 + 50 + 25 + A + + + \\u2601 Scanner l\'hôte WAN + \\u2194 Recherche DNS + + + \\u2699 Paramètres + \\u2195 MAJ Liste Ports + \\u2699 Paramètres + + + Type d\'Enregistrement + A + A6 + AAAA + AFSDB + APL + CERT + CNAME + DHCID + DLV + DNAME + DNSKEY + DS + IPSECKEY + KEY + KX + LOC + MX + NAPTR + NS + NSEC + NSEC3 + NSEC3PARAM + PTR + RP + RRSIG + SIG + SOA + Q + SSHFP + TLSA + TXT + URI + + From 4bbf8bcfdee6acdb75a1d821665d723d2e86abee Mon Sep 17 00:00:00 2001 From: Poussinou Date: Fri, 5 Jan 2018 21:25:04 +0100 Subject: [PATCH 2/8] Create strings.xml --- app/src/main/res/values-fr/strings.xml | 53 ++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 app/src/main/res/values-fr/strings.xml diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml new file mode 100644 index 00000000..24379873 --- /dev/null +++ b/app/src/main/res/values-fr/strings.xml @@ -0,0 +1,53 @@ + + + Administration des Ports + Paramètres + MAC + Fournisseur + LAN IP + WAN IP + Récupération… + Signal/Vitesse + Trouver les Hôtes + SSID + BSSID + Scanner les Ports Connus + Scanner l\'intervalle de ports + Réinitialiser l\'intervalle de ports + Ports Ouverts + Port de Départ + Port de Fin + Wi-Fi désactivé + Pas de connexion Wi-Fi + URL/IP + ATTENTION + Nom Domaine + Recherche DNS + Wake Up + Réveil de %1$s… + Adresse IP + Récupération des enregistrements DNS... + Entrez un domaine et sélectionnez un type d\'enregistrement + Vous n\'êtes pas connecté au réseau local + Vous n\'êtes connecté à aucun réseau Wi-Fi! + %1$ddBm/%2$dMbps + Recherche d\'Hôtes + %1$d hôtes dans votre sous-réseau + Trier + Par nom d\'hôte + Par fournisseur + Copier le nom d\'hôte + Copier l\'IP + Copier le MAC + Fournisseur MAC indisponible + Échec de l\'ouverture de la base de données + Téléchargement des données + Échec de l\'obtention du nombre d\'hôtes dans le sous-réseau + Échec de l\'obtention de la force du signal + Impossible d\'obtenir la vitesse de liaison + Échec de l\'obtention du SSID + Échec de l\'obtention du BSSID + Échec de l\'obtention du WifiManager pour cet appareil + Sachez que scanner des ports sur des serveurs publics est généralement considéré comme malveillant. En outre, l\'exécution de ce type d\'analyse sur le réseau de votre opérateur plutôt que sur votre propre connexion Wi-Fi sera plus lent et produira parfois des résultats inexacts en raison de la mise en forme du trafic. Votre opérateur peut également considérer que le trafic généré par cette analyse est malveillant. + + From 2b1d4908b19a99d05bc0d21ac0a06ccfdf899e34 Mon Sep 17 00:00:00 2001 From: Poussinou Date: Thu, 11 Jan 2018 16:55:34 +0100 Subject: [PATCH 3/8] Update array.xml --- app/src/main/res/values-fr/array.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/res/values-fr/array.xml b/app/src/main/res/values-fr/array.xml index bf265ac5..412fcce0 100644 --- a/app/src/main/res/values-fr/array.xml +++ b/app/src/main/res/values-fr/array.xml @@ -15,13 +15,13 @@ A - \\u2601 Scanner l\'hôte WAN - \\u2194 Recherche DNS + \u2601 Scanner l\'hôte WAN + \u2194 Recherche DNS - \\u2699 Paramètres - \\u2195 MAJ Liste Ports - \\u2699 Paramètres + \u2699 Paramètres + \u2195 MAJ Liste Ports + \u2699 Paramètres Type d\'Enregistrement From 5846d0a9f439c89631ded2ec49f96e8c426d7586 Mon Sep 17 00:00:00 2001 From: Poussinou Date: Thu, 11 Jan 2018 16:58:21 +0100 Subject: [PATCH 4/8] Update strings.xml --- app/src/main/res/values-fr/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 24379873..e72de944 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -1,6 +1,6 @@ - Administration des Ports + Gestion des Ports Paramètres MAC Fournisseur From d292b44c3e3d43e87260f8bca76116bfc5974b0e Mon Sep 17 00:00:00 2001 From: Poussinou Date: Tue, 23 Jan 2018 21:21:46 +0100 Subject: [PATCH 5/8] Update array.xml --- app/src/main/res/values-fr/array.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/res/values-fr/array.xml b/app/src/main/res/values-fr/array.xml index 412fcce0..a800db77 100644 --- a/app/src/main/res/values-fr/array.xml +++ b/app/src/main/res/values-fr/array.xml @@ -12,14 +12,14 @@ 100 50 25 - A + 10 \u2601 Scanner l\'hôte WAN \u2194 Recherche DNS - \u2699 Paramètres + \u2195 MAJ Base de données OUI \u2195 MAJ Liste Ports \u2699 Paramètres @@ -52,7 +52,7 @@ RRSIG SIG SOA - Q + SRV SSHFP TLSA TXT From 05f3517a9947aff8c6992abddb3c8428443ca4f2 Mon Sep 17 00:00:00 2001 From: Aaron Wood Date: Sat, 24 Mar 2018 22:23:39 -0700 Subject: [PATCH 6/8] Watch out for devices that have no wifi interface --- .../aaronjwood/portauthority/activity/MainActivity.java | 2 ++ .../com/aaronjwood/portauthority/network/Wireless.java | 9 ++++++++- app/src/main/res/values/strings.xml | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/aaronjwood/portauthority/activity/MainActivity.java b/app/src/main/java/com/aaronjwood/portauthority/activity/MainActivity.java index 25969736..8c5dc66d 100644 --- a/app/src/main/java/com/aaronjwood/portauthority/activity/MainActivity.java +++ b/app/src/main/java/com/aaronjwood/portauthority/activity/MainActivity.java @@ -213,6 +213,8 @@ public void setupMac() { macVendor.setText(R.string.noWifiConnection); } catch (IOException | SQLiteException | UnsupportedOperationException e) { macVendor.setText(R.string.getMacVendorFailed); + } catch (Wireless.NoWifiInterface e) { + macAddress.setText(R.string.noWifiInterface); } } diff --git a/app/src/main/java/com/aaronjwood/portauthority/network/Wireless.java b/app/src/main/java/com/aaronjwood/portauthority/network/Wireless.java index 6b8b8053..ef4850df 100644 --- a/app/src/main/java/com/aaronjwood/portauthority/network/Wireless.java +++ b/app/src/main/java/com/aaronjwood/portauthority/network/Wireless.java @@ -30,6 +30,10 @@ public static class NoWifiManagerException extends Exception { public static class NoConnectivityManagerException extends Exception { } + public static class NoWifiInterface extends Exception { + + } + /** * Constructor to set the activity for context * @@ -44,7 +48,7 @@ public Wireless(Context context) { * * @return MAC address */ - public String getMacAddress() throws UnknownHostException, SocketException, NoWifiManagerException { + public String getMacAddress() throws UnknownHostException, SocketException, NoWifiManagerException, NoWifiInterface { String address = getWifiInfo().getMacAddress(); //Won't work on Android 6+ https://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-hardware-id if (!"02:00:00:00:00:00".equals(address)) { return address; @@ -52,6 +56,9 @@ public String getMacAddress() throws UnknownHostException, SocketException, NoWi //This should get us the device's MAC address on Android 6+ NetworkInterface iface = NetworkInterface.getByInetAddress(getWifiInetAddress()); + if (iface == null) { + throw new NoWifiInterface(); + } byte[] mac = iface.getHardwareAddress(); diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 1033082b..9eed9bdc 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -49,6 +49,7 @@ Failed to get SSID Failed to get BSSID Failed to get WifiManager for this device + No WiFi interface found Please be aware that running port scans against public servers is normally considered malicious. Additionally, running these kinds of scans over your carrier\'s network instead of your own WiFi connection will be slower and will sometimes produce inaccurate results due to traffic shaping. From 5261ee2df45e971830a488207411f197cc0dad44 Mon Sep 17 00:00:00 2001 From: Aaron Wood Date: Tue, 27 Mar 2018 21:52:06 -0700 Subject: [PATCH 7/8] Revert "Don't cache the WAN IP so that we can reflect the different IP when users switch between WiFi and 4G" This reverts commit 98048df4459314fcbd594e7b47af497e3dd81fa2. --- .../portauthority/activity/MainActivity.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/aaronjwood/portauthority/activity/MainActivity.java b/app/src/main/java/com/aaronjwood/portauthority/activity/MainActivity.java index 8c5dc66d..5283ebc1 100644 --- a/app/src/main/java/com/aaronjwood/portauthority/activity/MainActivity.java +++ b/app/src/main/java/com/aaronjwood/portauthority/activity/MainActivity.java @@ -67,6 +67,7 @@ public final class MainActivity extends AppCompatActivity implements MainAsyncRe private ListView hostList; private TextView internalIp; private TextView externalIp; + private String cachedWanIp; private TextView signalStrength; private TextView ssid; private TextView bssid; @@ -454,7 +455,7 @@ public void run() { Errors.showError(context, resources.getString(R.string.failedSignal)); return; } - + signalStrength.setText(String.format(resources.getString(R.string.signalLink), signal, speed)); signalHandler.postDelayed(this, TIMER_INTERVAL); } @@ -583,7 +584,10 @@ private void getExternalIp() { if (UserPreference.getFetchExternalIp(this)) { label.setVisibility(View.VISIBLE); ip.setVisibility(View.VISIBLE); - wifi.getExternalIpAddress(this); + + if (cachedWanIp == null) { + wifi.getExternalIpAddress(this); + } } else { label.setVisibility(View.GONE); ip.setVisibility(View.GONE); @@ -644,6 +648,7 @@ public void onSaveInstanceState(Bundle savedState) { adapterData.add(item); } savedState.putSerializable("hosts", adapterData); + savedState.putString("wanIp", cachedWanIp); } } @@ -657,6 +662,8 @@ public void onSaveInstanceState(Bundle savedState) { public void onRestoreInstanceState(Bundle savedState) { super.onRestoreInstanceState(savedState); + cachedWanIp = savedState.getString("wanIp"); + externalIp.setText(cachedWanIp); hosts = (ArrayList) savedState.getSerializable("hosts"); if (hosts != null) { setupHostsAdapter(); @@ -720,6 +727,7 @@ public void processFinish(int output) { */ @Override public void processFinish(String output) { + cachedWanIp = output; externalIp.setText(output); } From e4e28a855dd3d7c49c08f4d3c8fd6cf4f6d1ee1f Mon Sep 17 00:00:00 2001 From: Aaron Wood Date: Tue, 27 Mar 2018 21:58:08 -0700 Subject: [PATCH 8/8] Bump versions --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index e83fc8b0..240904ce 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -21,8 +21,8 @@ android { defaultConfig { minSdkVersion 14 targetSdkVersion 27 - versionCode 54 - versionName "2.2.6" + versionCode 55 + versionName "2.2.8" applicationId "com.aaronjwood.portauthority" setProperty("archivesBaseName", "PortAuthority-$versionName") }