Compare commits
6 Commits
5a7cbfcdc9
...
cb430b957f
Author | SHA1 | Date | |
---|---|---|---|
cb430b957f | |||
b6a0f6dd91 | |||
bc32cbc179 | |||
d9cc604bdd | |||
db21011b7f | |||
dc35c8b7fb |
@ -11,8 +11,8 @@ android {
|
|||||||
compileSdkVersion 29
|
compileSdkVersion 29
|
||||||
buildToolsVersion '29.0.2'
|
buildToolsVersion '29.0.2'
|
||||||
useLibrary 'org.apache.http.legacy'
|
useLibrary 'org.apache.http.legacy'
|
||||||
versionCode 111
|
versionCode 112
|
||||||
versionName "1.6.41"
|
versionName "1.6.42"
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
@ -11,8 +11,8 @@
|
|||||||
"type": "SINGLE",
|
"type": "SINGLE",
|
||||||
"filters": [],
|
"filters": [],
|
||||||
"attributes": [],
|
"attributes": [],
|
||||||
"versionCode": 111,
|
"versionCode": 112,
|
||||||
"versionName": "1.6.41-googlePlay",
|
"versionName": "1.6.42-googlePlay",
|
||||||
"outputFile": "app-googlePlayFlavor-release.apk"
|
"outputFile": "app-googlePlayFlavor-release.apk"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -1,11 +1,14 @@
|
|||||||
package com.jens.automation2;
|
package com.jens.automation2;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
|
import android.app.Notification;
|
||||||
import android.bluetooth.BluetoothDevice;
|
import android.bluetooth.BluetoothDevice;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
|
import android.os.Bundle;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
|
import android.os.Parcelable;
|
||||||
import android.service.notification.StatusBarNotification;
|
import android.service.notification.StatusBarNotification;
|
||||||
import android.telephony.TelephonyManager;
|
import android.telephony.TelephonyManager;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
@ -34,6 +37,8 @@ import static com.jens.automation2.Trigger.triggerParameter2Split;
|
|||||||
import static com.jens.automation2.receivers.NotificationListener.EXTRA_TEXT;
|
import static com.jens.automation2.receivers.NotificationListener.EXTRA_TEXT;
|
||||||
import static com.jens.automation2.receivers.NotificationListener.EXTRA_TITLE;
|
import static com.jens.automation2.receivers.NotificationListener.EXTRA_TITLE;
|
||||||
|
|
||||||
|
import androidx.core.app.NotificationCompat;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
|
|
||||||
@ -796,13 +801,13 @@ public class Rule implements Comparable<Rule>
|
|||||||
|
|
||||||
String myApp = params[0];
|
String myApp = params[0];
|
||||||
String myTitleDir = params[1];
|
String myTitleDir = params[1];
|
||||||
String myTitle = params[2];
|
String requiredTitle = params[2];
|
||||||
String myTextDir = params[3];
|
String myTextDir = params[3];
|
||||||
String myText;
|
String requiredText;
|
||||||
if (params.length >= 5)
|
if (params.length >= 5)
|
||||||
myText = params[4];
|
requiredText = params[4];
|
||||||
else
|
else
|
||||||
myText = "";
|
requiredText = "";
|
||||||
|
|
||||||
if(oneTrigger.getTriggerParameter())
|
if(oneTrigger.getTriggerParameter())
|
||||||
{
|
{
|
||||||
@ -815,8 +820,8 @@ public class Rule implements Comparable<Rule>
|
|||||||
if(getLastExecution() == null || sbn.getPostTime() > this.lastExecution.getTimeInMillis())
|
if(getLastExecution() == null || sbn.getPostTime() > this.lastExecution.getTimeInMillis())
|
||||||
{
|
{
|
||||||
String notificationApp = sbn.getPackageName();
|
String notificationApp = sbn.getPackageName();
|
||||||
String notificationTitle = sbn.getNotification().extras.getString(EXTRA_TITLE);
|
String notificationTitle = null;
|
||||||
String notificationText = sbn.getNotification().extras.getString(EXTRA_TEXT);
|
String notificationText = null;
|
||||||
|
|
||||||
Miscellaneous.logEvent("i", "NotificationCheck", "Checking if this notification matches our rule " + this.getName() + ". App: " + notificationApp + ", title: " + notificationTitle + ", text: " + notificationText, 5);
|
Miscellaneous.logEvent("i", "NotificationCheck", "Checking if this notification matches our rule " + this.getName() + ". App: " + notificationApp + ", title: " + notificationTitle + ", text: " + notificationText, 5);
|
||||||
|
|
||||||
@ -829,9 +834,20 @@ public class Rule implements Comparable<Rule>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!StringUtils.isEmpty(myTitle))
|
/*
|
||||||
|
If there are multiple notifications ("stacked") title or text might be null:
|
||||||
|
https://stackoverflow.com/questions/28047767/notificationlistenerservice-not-reading-text-of-stacked-notifications
|
||||||
|
*/
|
||||||
|
|
||||||
|
Bundle extras = sbn.getNotification().extras;
|
||||||
|
|
||||||
|
// T I T L E
|
||||||
|
if (extras.containsKey(EXTRA_TITLE))
|
||||||
|
notificationTitle = sbn.getNotification().extras.getString(EXTRA_TITLE);
|
||||||
|
|
||||||
|
if (!StringUtils.isEmpty(requiredTitle))
|
||||||
{
|
{
|
||||||
if (!Miscellaneous.compare(myTitleDir, myTitle, notificationTitle))
|
if (!Miscellaneous.compare(myTitleDir, requiredTitle, notificationTitle))
|
||||||
{
|
{
|
||||||
Miscellaneous.logEvent("i", "NotificationCheck", "Notification title does not match rule.", 5);
|
Miscellaneous.logEvent("i", "NotificationCheck", "Notification title does not match rule.", 5);
|
||||||
continue;
|
continue;
|
||||||
@ -840,9 +856,14 @@ public class Rule implements Comparable<Rule>
|
|||||||
else
|
else
|
||||||
Miscellaneous.logEvent("i", "NotificationCheck", "A required title for a notification trigger was not specified.", 5);
|
Miscellaneous.logEvent("i", "NotificationCheck", "A required title for a notification trigger was not specified.", 5);
|
||||||
|
|
||||||
if (!StringUtils.isEmpty(myText))
|
// T E X T
|
||||||
|
|
||||||
|
if (extras.containsKey(EXTRA_TEXT))
|
||||||
|
notificationText = sbn.getNotification().extras.getString(EXTRA_TEXT);
|
||||||
|
|
||||||
|
if (!StringUtils.isEmpty(requiredText))
|
||||||
{
|
{
|
||||||
if (!Miscellaneous.compare(myTextDir, myText, notificationText))
|
if (!Miscellaneous.compare(myTextDir, requiredText, notificationText))
|
||||||
{
|
{
|
||||||
Miscellaneous.logEvent("i", "NotificationCheck", "Notification text does not match rule.", 5);
|
Miscellaneous.logEvent("i", "NotificationCheck", "Notification text does not match rule.", 5);
|
||||||
continue;
|
continue;
|
||||||
@ -877,15 +898,15 @@ public class Rule implements Comparable<Rule>
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (myTitle.length() > 0)
|
if (requiredTitle.length() > 0)
|
||||||
{
|
{
|
||||||
if (!Miscellaneous.compare(myTitleDir, title, myTitle))
|
if (!Miscellaneous.compare(myTitleDir, title, requiredTitle))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (myText.length() > 0)
|
if (requiredText.length() > 0)
|
||||||
{
|
{
|
||||||
if (!Miscellaneous.compare(myTextDir, text, myText))
|
if (!Miscellaneous.compare(myTextDir, text, requiredText))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -88,13 +88,12 @@ public class ActivityManageRule extends Activity
|
|||||||
final static int requestCodeActionStartActivityEdit = 3001;
|
final static int requestCodeActionStartActivityEdit = 3001;
|
||||||
final static int requestCodeTriggerNfcTagAdd = 4000;
|
final static int requestCodeTriggerNfcTagAdd = 4000;
|
||||||
final static int requestCodeTriggerNfcTagEdit = 4001;
|
final static int requestCodeTriggerNfcTagEdit = 4001;
|
||||||
final static int requestCodeActionSpeakTextAdd = 5000;
|
final static int requestCodeActionSpeakTextAdd = 5101;
|
||||||
final static int requestCodeActionSpeakTextEdit = 1001;
|
final static int requestCodeActionSpeakTextEdit = 5102;
|
||||||
final static int requestCodeTriggerBluetoothAdd = 6000;
|
final static int requestCodeTriggerBluetoothAdd = 6000;
|
||||||
final static int requestCodeTriggerBluetoothEdit = 6001;
|
final static int requestCodeTriggerBluetoothEdit = 6001;
|
||||||
final static int requestCodeActionScreenBrightnessAdd = 401;
|
final static int requestCodeActionScreenBrightnessAdd = 401;
|
||||||
final static int requestCodeActionScreenBrightnessEdit = 402;
|
final static int requestCodeActionScreenBrightnessEdit = 402;
|
||||||
final static int requestCodeActionSendTextMessage = 7001;
|
|
||||||
final static int requestCodeTriggerNotificationAdd = 8000;
|
final static int requestCodeTriggerNotificationAdd = 8000;
|
||||||
final static int requestCodeTriggerNfcNotificationEdit = 8001;
|
final static int requestCodeTriggerNfcNotificationEdit = 8001;
|
||||||
final static int requestCodeActionPlaySoundAdd = 501;
|
final static int requestCodeActionPlaySoundAdd = 501;
|
||||||
@ -104,6 +103,7 @@ public class ActivityManageRule extends Activity
|
|||||||
final static int requestCodeTriggerWifiAdd = 723;
|
final static int requestCodeTriggerWifiAdd = 723;
|
||||||
final static int requestCodeTriggerWifiEdit = 724;
|
final static int requestCodeTriggerWifiEdit = 724;
|
||||||
final static int requestCodeActionSendTextMessageAdd = 5001;
|
final static int requestCodeActionSendTextMessageAdd = 5001;
|
||||||
|
final static int requestCodeActionSendTextMessageEdit = 5002;
|
||||||
final static int requestCodeActionVibrateAdd = 801;
|
final static int requestCodeActionVibrateAdd = 801;
|
||||||
final static int requestCodeActionVibrateEdit = 802;
|
final static int requestCodeActionVibrateEdit = 802;
|
||||||
|
|
||||||
@ -315,7 +315,7 @@ public class ActivityManageRule extends Activity
|
|||||||
Intent activitySendTextMessageIntent = new Intent(ActivityManageRule.this, ActivityManageActionSendTextMessage.class);
|
Intent activitySendTextMessageIntent = new Intent(ActivityManageRule.this, ActivityManageActionSendTextMessage.class);
|
||||||
ActivityManageActionSendTextMessage.resultingAction = a;
|
ActivityManageActionSendTextMessage.resultingAction = a;
|
||||||
activitySendTextMessageIntent.putExtra("edit", true);
|
activitySendTextMessageIntent.putExtra("edit", true);
|
||||||
startActivityForResult(activitySendTextMessageIntent, requestCodeActionSendTextMessage);
|
startActivityForResult(activitySendTextMessageIntent, requestCodeActionSendTextMessageEdit);
|
||||||
break;
|
break;
|
||||||
case setScreenBrightness:
|
case setScreenBrightness:
|
||||||
Intent activityEditScreenBrightnessIntent = new Intent(ActivityManageRule.this, ActivityManageActionBrightnessSetting.class);
|
Intent activityEditScreenBrightnessIntent = new Intent(ActivityManageRule.this, ActivityManageActionBrightnessSetting.class);
|
||||||
@ -1224,8 +1224,8 @@ public class ActivityManageRule extends Activity
|
|||||||
{
|
{
|
||||||
if(resultCode == RESULT_OK)
|
if(resultCode == RESULT_OK)
|
||||||
{
|
{
|
||||||
//add SpeakText
|
//edit SpeakText
|
||||||
ruleToEdit.getActionSet().add(ActivityManageActionSendTextMessage.resultingAction);
|
newAction = ActivityManageActionSpeakText.resultingAction;
|
||||||
this.refreshActionList();
|
this.refreshActionList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1315,17 +1315,25 @@ public class ActivityManageRule extends Activity
|
|||||||
this.refreshActionList();
|
this.refreshActionList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if(requestCode == requestCodeActionSendTextMessageAdd)
|
||||||
//TODO: Check with has data been changed or something like that.
|
|
||||||
/*try
|
|
||||||
{
|
{
|
||||||
Miscellaneous.logEvent("i", "ActivityManageSpecificRule", getResources().getString(R.string.noDataChangedReadingAnyway), 4);
|
if(resultCode == RESULT_OK)
|
||||||
XmlFileInterface.readFile();
|
{
|
||||||
|
//add SendTextMessage
|
||||||
|
ruleToEdit.getActionSet().add(ActivityManageActionSendTextMessage.resultingAction);
|
||||||
|
this.refreshActionList();
|
||||||
}
|
}
|
||||||
catch (FileNotFoundException e)
|
}
|
||||||
|
else if(requestCode == requestCodeActionSendTextMessageEdit)
|
||||||
{
|
{
|
||||||
Miscellaneous.logEvent("e", "ActivityManageSpecificRule", getResources().getString(R.string.errorReadingPoisAndRulesFromFile) + ": " + Log.getStackTraceString(e), 5);
|
if(resultCode == RESULT_OK)
|
||||||
}*/
|
{
|
||||||
|
//edit SendTextMessage
|
||||||
|
newAction = ActivityManageActionSendTextMessage.resultingAction;
|
||||||
|
//ruleToEdit.getActionSet().add(ActivityManageActionSendTextMessage.resultingAction);
|
||||||
|
this.refreshActionList();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Dialog getActionTypeDialog()
|
protected Dialog getActionTypeDialog()
|
||||||
|
@ -447,6 +447,14 @@ public class Miscellaneous extends Service
|
|||||||
|
|
||||||
public static boolean compare(String direction, String needle, String haystack)
|
public static boolean compare(String direction, String needle, String haystack)
|
||||||
{
|
{
|
||||||
|
// If only one of needle or haystack is null
|
||||||
|
if(
|
||||||
|
(needle == null && haystack != null)
|
||||||
|
||
|
||||||
|
(needle != null && haystack == null)
|
||||||
|
)
|
||||||
|
return false;
|
||||||
|
|
||||||
switch(direction)
|
switch(direction)
|
||||||
{
|
{
|
||||||
case Trigger.directionEquals:
|
case Trigger.directionEquals:
|
||||||
|
@ -5,7 +5,7 @@ buildscript {
|
|||||||
jcenter()
|
jcenter()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:7.0.1'
|
classpath 'com.android.tools.build:gradle:7.0.2'
|
||||||
|
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
// in the individual module build.gradle files
|
// in the individual module build.gradle files
|
||||||
|
4
fastlane/metadata/android/de-DE/changelogs/112.txt
Normal file
4
fastlane/metadata/android/de-DE/changelogs/112.txt
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
* Fehler im Benachrichtigungsauslöser behoben
|
||||||
|
* WLAN Liste laden für API > 30 (soweit möglich)
|
||||||
|
* Fehler behoben beim Hinzufügen/Ändern der SMS-senden Aktion
|
||||||
|
* Fehler behoben beim Ändern der Text-sprechen Aktion
|
@ -39,7 +39,7 @@ Mögliche Aktionen:
|
|||||||
* SMS verschicken
|
* SMS verschicken
|
||||||
* Sounddatei abspielen.
|
* Sounddatei abspielen.
|
||||||
|
|
||||||
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.
|
Es ist ziemlich schwierig diese Anwendung über die vielen verschiedenen Geräte und 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.
|
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.
|
||||||
|
|
||||||
Wenn Sie ein Problem mit der Anwendung haben und mich dazu kontaktieren möchten, updaten Sie bitte vorher auf die neueste Version und schauen Sie, ob Ihr Problem darin auch besteht.
|
Wenn Sie ein Problem mit der Anwendung haben und mich dazu kontaktieren möchten, updaten Sie bitte vorher auf die neueste Version und schauen Sie, ob Ihr Problem darin auch besteht.
|
||||||
|
@ -1 +1 @@
|
|||||||
Automatisieren Sie Dinge auf Ihrem Gerät, indem Sie Regeln anlegen.
|
Automatisieren Sie Dinge auf Ihrem Gerät, indem Sie Regeln anlegen.
|
4
fastlane/metadata/android/en-US/changelogs/112.txt
Normal file
4
fastlane/metadata/android/en-US/changelogs/112.txt
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
* Fixed bug in notification trigger.
|
||||||
|
* Load wifi list for API > 30 (as far as possible)
|
||||||
|
* Fixed a bug when adding/editing sendTextMessage action
|
||||||
|
* Fixed a bug when editing speakText action
|
4
fastlane/metadata/android/es-ES/112.txt
Normal file
4
fastlane/metadata/android/es-ES/112.txt
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
* Error fijo en el gatillo de notificación.
|
||||||
|
* Lista de wifi de carga para API > 30 (en la medida de lo posible)
|
||||||
|
* Arregló un error al añadir/editar sendTextMessage acción
|
||||||
|
* Arregló un error al editar la acción de TalkText
|
4
fastlane/metadata/android/it-IT/changelogs/112.txt
Normal file
4
fastlane/metadata/android/it-IT/changelogs/112.txt
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
* Corretto bug nel trigger di notifica.
|
||||||
|
* Carica elenco wifi per API > 30 (per quanto possibile)
|
||||||
|
* Corretto un bug quando si aggiunge / modifica l'azione di sendTextMessage
|
||||||
|
* Corretto un bug quando si modifica l'azione del testo
|
Loading…
Reference in New Issue
Block a user