Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
56a766d03c | ||
|
|
5b86d57857 | ||
|
|
4713e0d965 | ||
|
|
f6876b5b1d |
+2
-2
@@ -11,8 +11,8 @@ android {
|
||||
compileSdkVersion 36
|
||||
buildToolsVersion '36.0.0'
|
||||
useLibrary 'org.apache.http.legacy'
|
||||
versionCode 148
|
||||
versionName "1.8.7"
|
||||
versionCode 149
|
||||
versionName "1.8.8"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ public class ActivityManageActionSetSystemSetting extends Activity
|
||||
selectedDataType.equalsIgnoreCase("Long")
|
||||
)
|
||||
{
|
||||
if(Miscellaneous.isNumericDecimal(etSettingValue.getText().toString()) || !Miscellaneous.isNumeric(etSettingValue.getText().toString()))
|
||||
if(!Miscellaneous.isNumeric(etSettingValue.getText().toString()) || !Miscellaneous.isNumericNonDecimal(etSettingValue.getText().toString()))
|
||||
{
|
||||
Toast.makeText(ActivityManageActionSetSystemSetting.this, getResources().getString(R.string.enter_a_number), Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
|
||||
@@ -96,6 +96,7 @@ import java.security.SecureRandom;
|
||||
import java.security.cert.CertificateException;
|
||||
import java.security.cert.X509Certificate;
|
||||
import java.text.DateFormat;
|
||||
import java.text.DecimalFormatSymbols;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
@@ -1130,12 +1131,18 @@ public class Miscellaneous extends Service
|
||||
|
||||
return executedSuccesfully;
|
||||
}
|
||||
|
||||
public static char getDecimalSeparator()
|
||||
{
|
||||
DecimalFormatSymbols symbols = new DecimalFormatSymbols(Locale.getDefault());
|
||||
return symbols.getDecimalSeparator(); // ',' or '.'
|
||||
}
|
||||
|
||||
public static boolean isNumericDecimal(String strNum)
|
||||
{
|
||||
if (strNum == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
double d = Double.parseDouble(strNum);
|
||||
@@ -1147,6 +1154,26 @@ public class Miscellaneous extends Service
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean isNumericNonDecimal(String number)
|
||||
{
|
||||
if (number == null)
|
||||
return false;
|
||||
|
||||
try
|
||||
{
|
||||
int temp = Integer.parseInt(number);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if(number.contains(String.valueOf(getDecimalSeparator())))
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean isNumeric(String str)
|
||||
{
|
||||
return str.matches("-?\\d+(\\.\\d+)?"); //match a number with optional '-' and decimal.
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.jens.automation2.receivers;
|
||||
|
||||
import static android.content.Context.RECEIVER_NOT_EXPORTED;
|
||||
import static android.os.BatteryManager.*;
|
||||
|
||||
import android.os.BatteryManager;
|
||||
@@ -8,6 +9,7 @@ import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
|
||||
import com.jens.automation2.ActivityPermissions;
|
||||
@@ -30,7 +32,7 @@ public class BatteryReceiver extends BroadcastReceiver implements AutomationList
|
||||
static boolean usbHostConnected = false;
|
||||
static boolean batteryReceiverActive = false;
|
||||
static IntentFilter batteryIntentFilter = null;
|
||||
static Intent batteryStatus = null;
|
||||
static Intent batteryStatusReceiverIntent = null;
|
||||
|
||||
private static int currentChargingState = 0; //0=unknown, 1=no, 2=yes
|
||||
private static int currentChargingType = 0; //AC, wireless, USB
|
||||
@@ -52,7 +54,10 @@ public class BatteryReceiver extends BroadcastReceiver implements AutomationList
|
||||
batteryIntentFilter.addAction(Intent.ACTION_BATTERY_LOW);
|
||||
}
|
||||
|
||||
batteryStatus = automationServiceRef.registerReceiver(batteryInfoReceiverInstance, batteryIntentFilter);
|
||||
if(Build.VERSION.SDK_INT >= 26)
|
||||
batteryStatusReceiverIntent = automationServiceRef.registerReceiver(batteryInfoReceiverInstance, batteryIntentFilter, Context.RECEIVER_NOT_EXPORTED);
|
||||
else
|
||||
batteryStatusReceiverIntent = automationServiceRef.registerReceiver(batteryInfoReceiverInstance, batteryIntentFilter);
|
||||
|
||||
batteryReceiverActive = true;
|
||||
}
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
package com.jens.automation2.receivers;
|
||||
|
||||
import static android.content.Context.RECEIVER_EXPORTED;
|
||||
|
||||
import android.bluetooth.BluetoothAdapter;
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
|
||||
@@ -57,6 +60,10 @@ public class BluetoothReceiver extends BroadcastReceiver implements AutomationLi
|
||||
{
|
||||
Miscellaneous.logEvent("i", "BluetoothReceiver", "Starting BluetoothReceiver", 4);
|
||||
bluetoothReceiverActive = true;
|
||||
|
||||
if(Build.VERSION.SDK_INT >= 26)
|
||||
AutomationService.getInstance().registerReceiver(bluetoothReceiverInstance, bluetoothReceiverIntentFilter, Context.RECEIVER_EXPORTED);
|
||||
else
|
||||
AutomationService.getInstance().registerReceiver(bluetoothReceiverInstance, bluetoothReceiverIntentFilter);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,6 +57,10 @@ public class ConnectivityReceiver extends BroadcastReceiver implements Automatio
|
||||
{
|
||||
Miscellaneous.logEvent("i", "Wifi Listener", "Starting connectivityReceiver", 4);
|
||||
connectivityReceiverActive = true;
|
||||
|
||||
if(Build.VERSION.SDK_INT >= 26)
|
||||
automationServiceRef.registerReceiver(connectivityReceiverInstance, connectivityIntentFilter, Context.RECEIVER_EXPORTED);
|
||||
else
|
||||
automationServiceRef.registerReceiver(connectivityReceiverInstance, connectivityIntentFilter);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
|
||||
import com.jens.automation2.ActivityPermissions;
|
||||
@@ -105,6 +106,10 @@ public class HeadphoneJackListener extends BroadcastReceiver implements Automati
|
||||
{
|
||||
Miscellaneous.logEvent("i", "HeadsetJackListener", "Starting HeadsetJackListener", 4);
|
||||
headphoneJackListenerActive = true;
|
||||
|
||||
if(Build.VERSION.SDK_INT >= 26)
|
||||
automationService.registerReceiver(this, headphoneJackListenerIntentFilter, Context.RECEIVER_NOT_EXPORTED);
|
||||
else
|
||||
automationService.registerReceiver(this, headphoneJackListenerIntentFilter);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -285,7 +285,12 @@ public class PhoneStatusListener implements AutomationListenerInterface
|
||||
if(!outgoingCallsReceiverActive)
|
||||
{
|
||||
Miscellaneous.logEvent("i", "PhoneStatusListener", "Starting PhoneStatusListener->outgoingCallsReceiver", 4);
|
||||
|
||||
if(Build.VERSION.SDK_INT >= 26)
|
||||
automationService.registerReceiver(outgoingCallsReceiverInstance, outgoingCallsIntentFilter, Context.RECEIVER_NOT_EXPORTED);
|
||||
else
|
||||
automationService.registerReceiver(outgoingCallsReceiverInstance, outgoingCallsIntentFilter);
|
||||
|
||||
outgoingCallsReceiverActive = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.jens.automation2.receivers;
|
||||
|
||||
import static android.content.Context.RECEIVER_NOT_EXPORTED;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.KeyguardManager;
|
||||
import android.content.BroadcastReceiver;
|
||||
@@ -71,6 +73,9 @@ public class ScreenStateReceiver extends BroadcastReceiver implements Automation
|
||||
// Intent.ACTION_USER_UNLOCKED
|
||||
}
|
||||
|
||||
if(Build.VERSION.SDK_INT >= 26)
|
||||
screenStatusIntent = automationServiceRef.registerReceiver(screenStateReceiverInstance, screenStateIntentFilter, Context.RECEIVER_NOT_EXPORTED);
|
||||
else
|
||||
screenStatusIntent = automationServiceRef.registerReceiver(screenStateReceiverInstance, screenStateIntentFilter);
|
||||
|
||||
screenStateReceiverActive = true;
|
||||
|
||||
@@ -6,6 +6,7 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.net.wifi.WifiManager;
|
||||
import android.os.Build;
|
||||
|
||||
import com.jens.automation2.AutomationService;
|
||||
import com.jens.automation2.Miscellaneous;
|
||||
@@ -116,6 +117,9 @@ public class SubSystemStateReceiver extends BroadcastReceiver implements Automat
|
||||
subSystemStateIntentFilter.addAction(stateBluetooth);
|
||||
}
|
||||
|
||||
if(Build.VERSION.SDK_INT >= 26)
|
||||
subSystemStatusIntent = automationServiceRef.registerReceiver(subSystemStateReceiverInstance, subSystemStateIntentFilter, Context.RECEIVER_NOT_EXPORTED);
|
||||
else
|
||||
subSystemStatusIntent = automationServiceRef.registerReceiver(subSystemStateReceiverInstance, subSystemStateIntentFilter);
|
||||
|
||||
subSystemStateReceiverActive = true;
|
||||
|
||||
@@ -162,7 +162,11 @@ public class TetheringReceiver extends android.content.BroadcastReceiver impleme
|
||||
|
||||
try
|
||||
{
|
||||
if(Build.VERSION.SDK_INT >= 26)
|
||||
automationServiceRef.registerReceiver(receiverInstance, intentFilter, Context.RECEIVER_NOT_EXPORTED);
|
||||
else
|
||||
automationServiceRef.registerReceiver(receiverInstance, intentFilter);
|
||||
|
||||
receiverActive = true;
|
||||
}
|
||||
catch(Exception e)
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
|
||||
import com.jens.automation2.AutomationService;
|
||||
@@ -44,6 +45,9 @@ public class TimeZoneListener extends BroadcastReceiver implements AutomationLis
|
||||
timezoneListenerIntentFilter.addAction(Intent.ACTION_TIME_CHANGED);
|
||||
}
|
||||
|
||||
if(Build.VERSION.SDK_INT >= 26)
|
||||
automationService.registerReceiver(timeZoneListenerInstance, timezoneListenerIntentFilter, Context.RECEIVER_NOT_EXPORTED);
|
||||
else
|
||||
automationService.registerReceiver(timeZoneListenerInstance, timezoneListenerIntentFilter);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
* Hinzugefügt: Möglichkeit, zwischen Global, System und Secure für System-Einstellungen zu wählen
|
||||
* Behoben: Absturz beim Öffnen der Anwendung durch die Benachrichtigung des laufenden Dienstes
|
||||
* Behoben: Absturz beim Starten des Dienstes und das Servicesymbol anzeigen, wurde in den App-Einstellungen deaktiviert
|
||||
* Behoben: Die Berechtigung "Bluetooth-Verbindung" wurde nicht angefordert, um Bluetooth ein- oder auszuschalten.
|
||||
* Behoben: Eine weitere gestartete/beendete App konnte nicht hinzugefügt werden, als die UI-Sprache niederländisch war.
|
||||
* Behoben: Prüfe auf nicht-dezimale Zahlen in einigen Eingabefeldern
|
||||
@@ -3,3 +3,4 @@
|
||||
* Fixed: Crash when starting service and show service icon was deactivated in app settings
|
||||
* Fixed: "Bluetooth connect" permission was not requested for turning Bluetooth on or off.
|
||||
* Fixed: Another app started/stopped couldn't be added when UI language was Dutch.
|
||||
* Fixed: Check for non-decimal number in some input fields
|
||||
@@ -0,0 +1,6 @@
|
||||
* Se añadió la opción de elegir entre Global, Sistema y Seguro para establecer configuraciones
|
||||
* Solucionado: Bloqueo al abrir la aplicación mediante la notificación del servicio en ejecución
|
||||
* Solucionado: Fallo al iniciar el servicio y el icono de mostrar servicio se desactivó en la configuración de la app
|
||||
* Solucionado: no se solicitó permiso de "conexión Bluetooth" para activar o apagar el Bluetooth.
|
||||
* Solucionado: No se pudo añadir otra app que se inició o detuvo cuando el idioma de la interfaz era neerlandés.
|
||||
* Solucionado: Comprueba si hay un número no decimal en algunos campos de entrada
|
||||
@@ -0,0 +1,6 @@
|
||||
* Ajout d'une option pour choisir entre Global, Système et Sécurisé pour définir des paramètres
|
||||
* Corrigé : Plantage lors de l'ouverture de l'application via la notification du service en cours d'exécution
|
||||
* Corrigé : plantage au démarrage du service et l'icône d'affichage du service ont été désactivées dans les paramètres de l'application
|
||||
* Corrigé : l'autorisation « Bluetooth connect » n'a pas été demandée pour activer ou désactiver le Bluetooth.
|
||||
* Corrigé : Une autre application qui a démarré/arrêté n'a pas pu être ajoutée lorsque la langue de l'interface utilisateur était néerlandaise.
|
||||
* Corrigé : Vérifier la présence de nombre non décimal dans certains champs d'entrée
|
||||
@@ -0,0 +1,6 @@
|
||||
* Aggiunta l'opzione per scegliere tra Globale, Sistema e Sicuro per impostazioni prestabilite
|
||||
* Corretto: crash all'apertura dell'applicazione tramite la notifica del servizio in esecuzione
|
||||
* Corretto: crash all'avvio del servizio e l'icona di mostra il servizio sono state disattivate nelle impostazioni dell'app
|
||||
* Corretto: non è stato richiesto il permesso di "Bluetooth connect" per attivare o disattivare il Bluetooth.
|
||||
* Correto: Un'altra app avviata/fermata non poteva essere aggiunta quando la lingua dell'interfaccia era olandese.
|
||||
* Fisso: Verifica la presenza di numeri non decimali in alcuni campi di input
|
||||
@@ -0,0 +1,6 @@
|
||||
* Optie toegevoegd om te kiezen tussen Global, System en Secure voor ingestelde instellingen
|
||||
* Opgelost: Crash bij het openen van de applicatie via de melding van de lopende service
|
||||
* Opgelost: Crash bij het starten van de service en het service-icoon tonen was gedeactiveerd in de app-instellingen
|
||||
* Opgelost: "Bluetooth-verbinding" toestemming werd niet gevraagd om Bluetooth aan of uit te zetten.
|
||||
* Opgelost: Een andere app die was gestart/gestopt kon niet worden toegevoegd toen de UI-taal Nederlands was.
|
||||
* Vastgelegd: Controleer op niet-decimale getallen in sommige invoervelden
|
||||
@@ -0,0 +1,6 @@
|
||||
* Dodano opcję wyboru między Global, System i Secure dla ustawień określonych
|
||||
* Naprawione: Awaria przy otwieraniu aplikacji przez powiadomienie działającej usługi
|
||||
* Naprawione: Awaria przy uruchamianiu serwisu i wyświetlanie ikony serwisu została dezaktywowana w ustawieniach aplikacji
|
||||
* Naprawiono: Nie proszono o pozwolenie na "połączenie z Bluetooth" przy włączaniu lub wyłączaniu Bluetooth.
|
||||
* Naprawione: Inna aplikacja, która została uruchomiona/zatrzymana, nie mogła zostać dodana, gdy język użytkownika był niderlandzki.
|
||||
* Stałe: Sprawdź liczbę nieprzecinkową w niektórych polach wejściowych
|
||||
@@ -0,0 +1,6 @@
|
||||
* Добавлена опция выбора между Global, System и Secure для определённых настроек
|
||||
* Исправлено: сбой при открытии приложения через уведомление запускающегося сервиса
|
||||
* Исправлено: сбой при запуске сервиса, а иконка показа сервиса была деактивирована в настройках приложения
|
||||
* Исправлено: разрешение на включение или выключение Bluetooth не было запрошено.
|
||||
* Исправлено: другое приложение, запущенное/остановленное, нельзя было добавить, когда язык интерфейса был голландским.
|
||||
* Исправлено: проверка недесятичного числа в некоторых входных полях
|
||||
@@ -0,0 +1,6 @@
|
||||
* 新增了全局、系统和安全三种设置选项
|
||||
* 已修复:通过运行服务通知打开应用时崩溃
|
||||
* 已修复:启动服务时崩溃,应用设置中显示服务图标被停用
|
||||
* 已修复:未请求"蓝牙连接"权限来开关蓝牙。
|
||||
* 已修复:当用户界面语言为荷兰语时,无法添加另一个启动/停止的应用。
|
||||
* 固定:检查某些输入字段中的非十进制数字
|
||||
Reference in New Issue
Block a user