From d257c4ccb08154b66f7da97a42cabef2918f3f62 Mon Sep 17 00:00:00 2001 From: Jens Date: Tue, 11 May 2021 22:49:41 +0200 Subject: [PATCH] Miscellaneous changes. --- .../jens/automation2/ActivityMaintenance.java | 1 + .../com/jens/automation2/Miscellaneous.java | 21 +++++++++++++++++++ app/src/main/res/values-de/strings.xml | 2 +- app/src/main/res/values/strings.xml | 2 +- .../android/de-DE/full_description.txt | 8 +++++-- .../android/en-US/full_description.txt | 6 +++++- 6 files changed, 35 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/jens/automation2/ActivityMaintenance.java b/app/src/main/java/com/jens/automation2/ActivityMaintenance.java index 8b5a217..029bb30 100644 --- a/app/src/main/java/com/jens/automation2/ActivityMaintenance.java +++ b/app/src/main/java/com/jens/automation2/ActivityMaintenance.java @@ -274,6 +274,7 @@ public class ActivityMaintenance extends Activity ArrayList srcFilesList = new ArrayList<>(); srcFilesList.add(Miscellaneous.getWriteableFolder() + "/" + XmlFileInterface.settingsFileName); + srcFilesList.add(Miscellaneous.getWriteableFolder() + "/../shared_prefs/" + prefsFileName); String logFilePath = Miscellaneous.getWriteableFolder() + "/" + Miscellaneous.logFileName; if((new File(logFilePath)).exists()) diff --git a/app/src/main/java/com/jens/automation2/Miscellaneous.java b/app/src/main/java/com/jens/automation2/Miscellaneous.java index b0d22ea..664d3e1 100644 --- a/app/src/main/java/com/jens/automation2/Miscellaneous.java +++ b/app/src/main/java/com/jens/automation2/Miscellaneous.java @@ -26,6 +26,7 @@ import android.util.Log; import android.widget.Toast; import com.jens.automation2.location.LocationProvider; +import com.jens.automation2.receivers.NotificationListener; import com.jens.automation2.receivers.PhoneStatusListener; import org.apache.http.HttpEntity; @@ -596,6 +597,26 @@ public class Miscellaneous extends Service source = source.replace("[s]", String.valueOf(cal.get(Calendar.SECOND))); source = source.replace("[ms]", String.valueOf(cal.get(Calendar.MILLISECOND))); } + + if(source.contains("[notificationTitle]")) + { + String notificationTitle = NotificationListener.getLastNotification().getTitle(); + + if(notificationTitle != null && notificationTitle.length() > 0) + source = source.replace("[notificationTitle]", notificationTitle); + else + Miscellaneous.logEvent("w", "Variable replacement", "notificationTitle was empty.", 3); + } + + if(source.contains("[notificationText]")) + { + String notificationText = NotificationListener.getLastNotification().getText(); + + if(notificationText != null && notificationText.length() > 0) + source = source.replace("[notificationText]", notificationText); + else + Miscellaneous.logEvent("w", "Variable replacement", "notificationText was empty.", 3); + } // Miscellaneous.logEvent("i", "URL after replace", source); diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 6ce650c..5db291c 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -73,7 +73,7 @@ Ende Speichern URL, die ausgelöst werden soll: - Variablen:\nSie können die folgenden Variablen verwenden. Vor dem Auslösen werden sie mit dem entsprechenden Wert Ihres Geräts ersetzt. Die Klammern müssen in den Text mit aufgenommen werden.\n\n[uniqueid] - Die Unique ID Ihres Geräts\n[serialnr] - Die Seriennummer Ihres Geräts\n[latitude] - Ihr gegenwärtiger Breitengrad\n[longitude] - Ihr gegenwärtiger Längengrad\n[phonenr] - Nummer des letzten ein- oder ausgehenden Anrufs\n[d] - Tag des Monats, 2-stellig mit führender Null\n[m] - Monat als Zahl, mit führenden Nullen\n[Y] - Vierstellige Jahreszahl\n[h] - Stunde im 12-Stunden-Format, mit führenden Nullen\n[H] - Stunde im 24-Stunden-Format, mit führenden Nullen\n[i] - Minuten, mit führenden Nullen\n[s] - Sekunden, mit führenden Nullen\n[ms] - milliseconds + Variablen:\nSie können die folgenden Variablen verwenden. Vor dem Auslösen werden sie mit dem entsprechenden Wert Ihres Geräts ersetzt. Die Klammern müssen in den Text mit aufgenommen werden.\n\n[uniqueid] - Die Unique ID Ihres Geräts\n[serialnr] - Die Seriennummer Ihres Geräts\n[latitude] - Ihr gegenwärtiger Breitengrad\n[longitude] - Ihr gegenwärtiger Längengrad\n[phonenr] - Nummer des letzten ein- oder ausgehenden Anrufs\n[d] - Tag des Monats, 2-stellig mit führender Null\n[m] - Monat als Zahl, mit führenden Nullen\n[Y] - Vierstellige Jahreszahl\n[h] - Stunde im 12-Stunden-Format, mit führenden Nullen\n[H] - Stunde im 24-Stunden-Format, mit führenden Nullen\n[i] - Minuten, mit führenden Nullen\n[s] - Sekunden, mit führenden Nullen\n[ms] - milliseconds\n[notificationTitle] - Titel der letzten Benachrichtigung\n[notificationText] - Text der letzten Benachrichtigung WLAN Aktiviere Deaktiviere diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index bf5fac7..8a53103 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -73,7 +73,7 @@ End Save URL to trigger: - Variables:\nYou can use the following variables. Upon triggering they will be replaced with the corresponding value on your device. Include the brackets in your text.\n\n[uniqueid] - Your device\'s unique id\n[serialnr] - Your device\'s serial number\n[latitude] - Your device\'s latitude\n[longitude] - Your device\'s longitude\n[phonenr] - Number of last incoming or outgoing call\n[d] - Day of the month, 2 digits with leading zeros\n[m] - Numeric representation of a month, with leading zeros\n[Y] - A full numeric representation of a year, 4 digits\n[h] - 12-hour format of an hour with leading zeros\n[H] - 24-hour format of an hour with leading zeros\n[i] - Minutes with leading zeros\n[s] - Seconds, with leading zeros\n[ms] - milliseconds + Variables:\nYou can use the following variables. Upon triggering they will be replaced with the corresponding value on your device. Include the brackets in your text.\n\n[uniqueid] - Your device\'s unique id\n[serialnr] - Your device\'s serial number\n[latitude] - Your device\'s latitude\n[longitude] - Your device\'s longitude\n[phonenr] - Number of last incoming or outgoing call\n[d] - Day of the month, 2 digits with leading zeros\n[m] - Numeric representation of a month, with leading zeros\n[Y] - A full numeric representation of a year, 4 digits\n[h] - 12-hour format of an hour with leading zeros\n[H] - 24-hour format of an hour with leading zeros\n[i] - Minutes with leading zeros\n[s] - Seconds, with leading zeros\n[ms] - milliseconds\n[notificationTitle] - title of last notification\n[notificationText] - text of last notification wifi Activating Deactivating diff --git a/fastlane/metadata/android/de-DE/full_description.txt b/fastlane/metadata/android/de-DE/full_description.txt index e2854f6..d34a1c7 100644 --- a/fastlane/metadata/android/de-DE/full_description.txt +++ b/fastlane/metadata/android/de-DE/full_description.txt @@ -39,8 +39,12 @@ Mögliche Aktionen: * SMS verschicken * Sounddatei abspielen. -Es ist ziemlich schwierig diese Anwendung über die vielen verschiedenen Geräte sowie die vielen Änderungen an Android Versionen am Funktionen zu halten. Ich kann vieles im Emulator testen, aber eben nicht alles. -Wenn also eine bestimmte Funktion nicht so tut wie sie sollte - lassen Sie es mich wissen. Über die Jahre habe ich noch alle Fehler behoben, die mir gemeldet wurden. Aber dafür bin ich auf Ihre Mithilfe angewiesen. +Es ist ziemlich schwierig diese Anwendung über die vielen verschiedenen Geräte sowie die vielen Änderungen an Android Versionen am Laufen zu halten. Ich kann vieles im Emulator testen, aber eben nicht alles. +Wenn also eine bestimmte Funktion nicht so tut wie sie sollte - lassen Sie es mich wissen. Über die Jahre habe ich noch alle Fehler behoben, die mir vernünftig gemeldet wurden. Aber dafür bin ich auf Ihre Mithilfe angewiesen. + +Spenden sind nicht die einzige Möglichkeit mich zu motivieren :-) +* Wer mir etwas Gutes tun will, kann die Anwendung auch im Play Store bewerten. +* Außerdem ist Hilfe bei der Übersetzung willkommen. Englisch, Spanisch und Deutsch kann ich selbst. Aber sonst ist alles gern gesehen. Ein Wort zu den vielen Berechtigungen.... diff --git a/fastlane/metadata/android/en-US/full_description.txt b/fastlane/metadata/android/en-US/full_description.txt index 95e5301..668937d 100644 --- a/fastlane/metadata/android/en-US/full_description.txt +++ b/fastlane/metadata/android/en-US/full_description.txt @@ -40,7 +40,11 @@ Supported actions: * Play sound file It's quite hard to keep this app working across the many different hardwares as well as the many changes Android undergoes over the versions. I can test it in the emulator, but that cannot show all bugs. -So if a certain feature is not working on your device - let me know. Over the years I have fixed almost all bugs that have been reported to me. But for that I'm dependend on your input. +So if a certain feature is not working on your device - let me know. Over the years I have fixed almost all bugs that have been reasonably reported to me. But for that I'm dependend on your input. + +Donations are not the only way to motivate me :-) +* If you want to suport me, can also review the app on Google Play. +* Furthermore I can always use help in translating the app. English, German and some Spanish are among my own skills. But everything else is more than welcome. A word about the many permissions....