Compare commits

...

5 Commits

Author SHA1 Message Date
Jens
6f80caa1c6 Bugfix release 2023-01-17 22:38:49 +01:00
Jens
a9646cbf28 Autostart error fixed 2023-01-16 23:44:28 +01:00
52edfa32df Fixed bug with multiple time frames with reoccurrence configured 2023-01-16 16:54:54 +01:00
Jens
ca81e6a7bd Log improvements 2023-01-15 23:18:42 +01:00
Jens
49e4c20ab6 Allow negative integers as intents 2023-01-14 22:50:43 +01:00
20 changed files with 96 additions and 10 deletions

View File

@ -11,8 +11,8 @@ android {
compileSdkVersion 31
buildToolsVersion '29.0.2'
useLibrary 'org.apache.http.legacy'
versionCode 124
versionName "1.7.9"
versionCode 125
versionName "1.7.10"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

View File

@ -347,7 +347,16 @@ public class Rule implements Comparable<Rule>
if(oneTrigger.getTriggerType().equals(Trigger.Trigger_Enum.timeFrame))
{
if(oneTrigger.getTimeFrame().repetition > 0)
return true;
{
if(this.getLastExecution() != null)
{
Calendar now = Calendar.getInstance();
if (this.getLastExecution().getTimeInMillis() + oneTrigger.getTimeFrame().getRepetition() * 1000 <= now.getTimeInMillis())
return true;
}
else
return true;
}
}
else if(oneTrigger.getTriggerType().equals(Trigger.Trigger_Enum.broadcastReceived))
{

View File

@ -225,7 +225,7 @@ public class ActivityManageActionSendBroadcast extends Activity
public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2, long arg3)
{
if(supportedIntentTypes[arg2].equals("int") || supportedIntentTypes[arg2].equals("long") || supportedIntentTypes[arg2].equals("short"))
ActivityManageActionSendBroadcast.this.etParameterValue.setInputType(InputType.TYPE_CLASS_NUMBER);
ActivityManageActionSendBroadcast.this.etParameterValue.setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_SIGNED);
else if(supportedIntentTypes[arg2].equals("double") || supportedIntentTypes[arg2].equals("float"))
ActivityManageActionSendBroadcast.this.etParameterValue.setInputType(InputType.TYPE_NUMBER_FLAG_DECIMAL);
else

View File

@ -268,7 +268,7 @@ public class ActivityManageActionStartActivity extends Activity
public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2, long arg3)
{
if(supportedIntentTypes[arg2].equals("int") || supportedIntentTypes[arg2].equals("long") || supportedIntentTypes[arg2].equals("short"))
ActivityManageActionStartActivity.this.etParameterValue.setInputType(InputType.TYPE_CLASS_NUMBER);
ActivityManageActionStartActivity.this.etParameterValue.setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_SIGNED);
else if(supportedIntentTypes[arg2].equals("double") || supportedIntentTypes[arg2].equals("float"))
ActivityManageActionStartActivity.this.etParameterValue.setInputType(InputType.TYPE_NUMBER_FLAG_DECIMAL);
else

View File

@ -111,6 +111,8 @@ import androidx.documentfile.provider.DocumentFile;
public class Miscellaneous extends Service
{
protected static String writeableFolderStringCache = null;
public static Context startupContext;
public static final String lineSeparator = System.getProperty("line.separator");
public static String downloadURL(String url, String username, String password)
@ -273,7 +275,7 @@ public class Miscellaneous extends Service
{
writeToLogFile(type, header, description);
if(!logCleanerRunning && Math.random() < 0.1) // tidy up with 10% probability
if (!logCleanerRunning && Math.random() < 0.1) // tidy up with 10% probability
{
rotateLogFile(getLogFile());
}
@ -558,6 +560,9 @@ public class Miscellaneous extends Service
if(returnContext != null)
return returnContext;
if(startupContext != null)
return startupContext;
return null;
}

View File

@ -421,14 +421,18 @@ public class PointOfInterest implements Comparable<PointOfInterest>
public boolean create(Context context)
{
for(PointOfInterest poi : PointOfInterest.pointOfInterestCollection)
if(poi.getName().equals(this.getName()))
{
if (poi.getName().equals(this.getName()))
{
Toast.makeText(context, context.getResources().getString(R.string.anotherPoiByThatName), Toast.LENGTH_LONG).show();
return false;
}
}
if(plausibilityCheck())
{
Miscellaneous.logEvent("i", "Creating POI", this.toStringLong(), 3);
PointOfInterest.pointOfInterestCollection.add(this);
PointOfInterest.writePoisToFile();
@ -490,8 +494,10 @@ public class PointOfInterest implements Comparable<PointOfInterest>
Check for change of rule name END
*/
if (plausibilityCheck())
if(plausibilityCheck())
{
Miscellaneous.logEvent("i", "Changing POI", "Old name: " + this.oldName + ", new data: " + this.toStringLong(), 3);
if(PointOfInterest.writePoisToFile())
{
AutomationService service = AutomationService.getInstance();

View File

@ -11,12 +11,13 @@ import com.jens.automation2.Settings;
public class StartupIntentReceiver extends BroadcastReceiver
{
@Override
public void onReceive(Context context, Intent intent)
{
Settings.readFromPersistentStorage(context);
Miscellaneous.startupContext = context;
// Miscellaneous.logEvent("i", "Boot event", "Received event: " + intent.getAction(), 5);
if(Settings.startServiceAtSystemBoot)

View File

@ -771,4 +771,10 @@
<string name="checkVariableExplanation">Wenn Sie den Wert der Variablen leer lassen, darf sie nicht gesetzt sein, damit die Bedingung als erfüllt gilt.</string>
<string name="variableCheckString">wenn Variable %1$s den Wert %2$s hat</string>
<string name="variableCheckStringDeleted">wenn Variable %1$s nicht gesetzt ist</string>
<string name="messageType">Nachrichtentyp</string>
<string name="sms">SMS</string>
<string name="mms">MMS</string>
<string name="attachment">Dateianhang</string>
<string name="chooseFile">Datei wählen</string>
<string name="startAppByStartService">via startService()</string>
</resources>

View File

@ -770,4 +770,10 @@
<string name="VariableKey">Clave variable</string>
<string name="deleteVariable">Eliminar variable</string>
<string name="setVariable">Establecer una variable</string>
<string name="messageType">Tipo de mensaje</string>
<string name="sms">SMS</string>
<string name="mms">MMS</string>
<string name="attachment">Archivo adjunto</string>
<string name="chooseFile">elegir archivo</string>
<string name="startAppByStartService">via startService()</string>
</resources>

View File

@ -274,6 +274,7 @@
<string name="with">avec</string>
<string name="phoneNumber">Numéro de téléphone</string>
<string name="enterPhoneNumberBlankForAny">Saisissez un numéro de téléphone. Laissez vide pour nimporte quel numéro.</string>
<string name="enterPhoneNumber">Entrez le numéro de téléphone.</string>
<string name="phoneDirection">Sélectionnez le type \ndappel</string>
<string name="any">tout</string>
<string name="incoming">entrant</string>
@ -769,4 +770,10 @@
<string name="VariableKey">Clé variable</string>
<string name="deleteVariable">Supprimer la variable</string>
<string name="setVariable">Définir une variable</string>
<string name="messageType">Type de message</string>
<string name="sms">SMS</string>
<string name="mms">MMS</string>
<string name="attachment">Attachement</string>
<string name="chooseFile">Choisissez un fichier</string>
<string name="startAppByStartService">via startService()</string>
</resources>

View File

@ -771,4 +771,10 @@
<string name="checkVariableExplanation">Se si lascia vuoto il valore, la variabile non deve essere impostata affinché la condizione restituisca true.</string>
<string name="variableCheckString">Se la variabile %1$s è %2$s</string>
<string name="variableCheckStringDeleted">Se la variabile %1$s non è impostata</string>
<string name="messageType">Tipo di messaggio</string>
<string name="sms">SMS</string>
<string name="mms">MMS</string>
<string name="attachment">Allegato</string>
<string name="chooseFile">Scegli file</string>
<string name="startAppByStartService">tramite startService()</string>
</resources>

View File

@ -769,5 +769,11 @@
<string name="checkVariableExplanation">Als u de waarde leeg laat, mag de variabele niet worden ingesteld om de voorwaarde true te laten retourneren.</string>
<string name="variableCheckString">als variabele %1$s %2$s is</string>
<string name="variableCheckStringDeleted">als variabele %1$s niet is ingesteld</string>
<string name="messageType">Type bericht</string>
<string name="sms">SMS</string>
<string name="mms">MMS</string>
<string name="attachment">Bijlage</string>
<string name="chooseFile">kies bestand</string>
<string name="startAppByStartService">via startService()</string>
</resources>

View File

@ -828,4 +828,10 @@
<string name="checkVariableExplanation">Если оставить значение пустым, переменная не должна быть задана для того, чтобы условие возвращало значение true.</string>
<string name="variableCheckString">если переменная %1$s равно %2$s</string>
<string name="variableCheckStringDeleted">Если переменная %1$s не задана</string>
<string name="messageType">Тип сообщения</string>
<string name="sms">SMS</string>
<string name="mms">MMS</string>
<string name="attachment">Прикрепление</string>
<string name="chooseFile">выберите файл</string>
<string name="startAppByStartService">дорога startService()</string>
</resources>

View File

@ -0,0 +1,4 @@
* Behoben: Negative Ganzzahlen werden als Intent-Parameter akzeptiert
* Behoben: Mehrere parallele Zeiträume mit Wiederholung konnten dazu führen, daß alle zu häufig ausgeführt wurden
* Behoben: Automatischer Start der Anwendung beim Gerätestart konnte in manchen Fällen scheitern
* Übersetzungen aktualisiert

View File

@ -0,0 +1,4 @@
* Fixed: Now allowing negative integers as intent data
* Fixed: Multiple time frames with reoccurence configured would trigger to early executions
* Fixed: Automatic app start at boot might fail in some cases
* Translations updated

View File

@ -0,0 +1,4 @@
* Corregido: Ahora permite enteros negativos como datos de intención
* Corregido: Múltiples marcos de tiempo con la repetición configurada se desencadenarían en ejecuciones tempranas
* Corregido: el inicio automático de la aplicación en el arranque puede fallar en algunos casos
* Traducciones actualizadas

View File

@ -0,0 +1,4 @@
* Correction : Autorise désormais les entiers négatifs comme données d'intention
* Correction : Plusieurs délais avec récurrence configurée déclenchaient des exécutions anticipées
* Correction : le démarrage automatique de l'application au démarrage peut échouer dans certains cas
* Traductions mises à jour

View File

@ -0,0 +1,4 @@
* Risolto: ora consente numeri interi negativi come dati di intento
* Risolto: più intervalli di tempo con ripetizione configurata si attiverebbero per le esecuzioni anticipate
* Risolto: l'avvio automatico dell'app all'avvio potrebbe non riuscire in alcuni casi
* Traduzioni aggiornate

View File

@ -0,0 +1,4 @@
* Opgelost: nu negatieve gehele getallen toestaan als intentiegegevens
* Opgelost: Meerdere tijdframes met reoccurence geconfigureerd zouden leiden tot vroege uitvoeringen
* Opgelost: Automatische app-start bij het opstarten kan in sommige gevallen mislukken
* Vertalingen bijgewerkt

View File

@ -0,0 +1,4 @@
* Исправлено: Добавлено разрешение отрицательных целых чисел в качестве данных о намерениях
* Исправлено: Несколько таймфреймов с настроенным повторением запускали бы ранние выполнения
* Исправлено: Автоматический запуск приложения при загрузке может завершиться сбоем в некоторых случаях
* Переводы обновлены