Trigger URL fixes
This commit is contained in:
@@ -115,8 +115,7 @@ public class Actions
|
||||
public static void closeNotification(Action action)
|
||||
{
|
||||
NotificationManager nm = (NotificationManager) Miscellaneous.getAnyContext().getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
// for(StatusBarNotification n : nm.getActiveNotifications())
|
||||
// {
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT)
|
||||
{
|
||||
String[] params = action.getParameter2().split(Action.actionParameter2Split, -1);
|
||||
@@ -193,7 +192,6 @@ public class Actions
|
||||
Miscellaneous.logEvent("i", "NotificationCloseCheck", "NotificationListener instance is null. Can\'t close notification.", 3);
|
||||
}
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
public static void sendBroadcast(Context context, String action)
|
||||
|
||||
@@ -96,7 +96,6 @@ import java.security.cert.CertificateException;
|
||||
import java.security.cert.X509Certificate;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
@@ -127,6 +126,8 @@ import eu.chainfire.libsuperuser.Shell;
|
||||
public class Miscellaneous extends Service
|
||||
{
|
||||
protected static String writeableFolderStringCache = null;
|
||||
protected final static String http_error_string = "HTTP_ERROR";
|
||||
protected final static String last_trigger_url_result_string = "last_trigger_url_result";
|
||||
public static Context startupContext;
|
||||
|
||||
public static final String lineSeparator = System.getProperty("line.separator");
|
||||
@@ -199,7 +200,7 @@ public class Miscellaneous extends Service
|
||||
// immediate deallocation of all system resources
|
||||
httpclient.getConnectionManager().shutdown();
|
||||
if(errorFound)
|
||||
return "httpError";
|
||||
return http_error_string;
|
||||
else
|
||||
return responseBody.toString();
|
||||
}
|
||||
@@ -275,7 +276,7 @@ public class Miscellaneous extends Service
|
||||
catch(Exception e)
|
||||
{
|
||||
Miscellaneous.logEvent("e", "HTTP error", Log.getStackTraceString(e), 3);
|
||||
return "httpError";
|
||||
return http_error_string;
|
||||
}
|
||||
// finally
|
||||
// {
|
||||
@@ -853,15 +854,15 @@ public class Miscellaneous extends Service
|
||||
}
|
||||
}
|
||||
|
||||
if(source.contains("[last_trigger_url_result]"))
|
||||
if(source.contains("[" + last_trigger_url_result_string + "]"))
|
||||
{
|
||||
try
|
||||
{
|
||||
source = source.replace("[last_trigger_url_result]", AutomationService.getInstance().getVariableMap().get("last_trigger_url_result"));
|
||||
source = source.replace("[" + last_trigger_url_result_string + "]", AutomationService.getInstance().getVariableMap().get(last_trigger_url_result_string));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Miscellaneous.logEvent("w", "Variable replacement", "Error replacing variable last_trigger_url_result.", 3);
|
||||
Miscellaneous.logEvent("w", "Variable replacement", "Error replacing variable " + last_trigger_url_result_string + ".", 3);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -36,18 +36,8 @@ public class NfcReceiver
|
||||
public static NfcAdapter getNfcAdapter(Context context)
|
||||
{
|
||||
if(nfcAdapter == null)
|
||||
{
|
||||
if(Build.VERSION.SDK_INT <= 10)
|
||||
{
|
||||
// NFC not supported until after Gingerbread.
|
||||
Miscellaneous.logEvent("w", "NFC", context.getResources().getString(R.string.nfcNotSupportedInThisAndroidVersionYet), 3);
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
nfcAdapter = NfcAdapter.getDefaultAdapter(context);
|
||||
}
|
||||
}
|
||||
nfcAdapter = NfcAdapter.getDefaultAdapter(context);
|
||||
|
||||
return nfcAdapter;
|
||||
}
|
||||
|
||||
@@ -91,28 +81,6 @@ public class NfcReceiver
|
||||
new NdefReaderTask().execute(tag);
|
||||
}
|
||||
}
|
||||
// else if (NfcAdapter.ACTION_TECH_DISCOVERED.equals(action))
|
||||
// {
|
||||
//
|
||||
// // In case we would still use the Tech Discovered Intent
|
||||
// Tag tag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);
|
||||
// String[] techList = tag.getTechList();
|
||||
// String searchedTech = Ndef.class.getName();
|
||||
//
|
||||
// for (String tech : techList)
|
||||
// {
|
||||
// if (searchedTech.equals(tech))
|
||||
// {
|
||||
// new NdefReaderTask().execute(tag);
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// // No NFC NDEF intent
|
||||
// Miscellaneous.logEvent("w", "NFC", context.getResources().getString(R.string.nfcNoNdefIntentBut) + " " + action + ".", 5);
|
||||
// }
|
||||
}
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
@@ -334,15 +302,7 @@ public class NfcReceiver
|
||||
|
||||
return false;
|
||||
}
|
||||
else if(Build.VERSION.SDK_INT <= 10)
|
||||
{
|
||||
// NFC not supported until after Gingerbread.
|
||||
if(showErrorMessage)
|
||||
Toast.makeText(context, context.getResources().getString(R.string.nfcNotSupportedInThisAndroidVersionYet), Toast.LENGTH_LONG).show();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -302,7 +302,6 @@
|
||||
<string name="nfcTagFoundWithText">Tag gefunden mit Bezeichner:</string>
|
||||
<string name="nfcUnsupportedEncoding">Nicht unterstützte Kodierung:</string>
|
||||
<string name="nfcNoNdefIntentBut">Kein NFC NDEF intent, sondern</string>
|
||||
<string name="nfcNotSupportedInThisAndroidVersionYet">NFC wird in dieser Android Version noch nicht unterstützt.</string>
|
||||
<string name="cantRunRule">Regeln können nicht ausgeführt werden.</string>
|
||||
<string name="nfcApplyTagToRule">Aktuellen Tag in Regel übernehmen</string>
|
||||
<string name="nfcTagReadSuccessfully">Tag erfolgreich gelesen.</string>
|
||||
|
||||
@@ -443,7 +443,6 @@
|
||||
<string name="nfcTagFoundWithText">Tag encontrado con etiqueta:</string>
|
||||
<string name="nfcUnsupportedEncoding">No hay soporte para este codigo:</string>
|
||||
<string name="nfcNoNdefIntentBut">No NFC NDEF intent, pero</string>
|
||||
<string name="nfcNotSupportedInThisAndroidVersionYet">NFC sin soporto en esta version Android, todavia no.</string>
|
||||
<string name="cantRunRule">No puedo ejecutar reglas.</string>
|
||||
<string name="nfcApplyTagToRule">Aplicar este tag a regla</string>
|
||||
<string name="nfcTagReadSuccessfully">Tag escritoso con éxito.</string>
|
||||
|
||||
@@ -305,7 +305,6 @@
|
||||
<string name="nfcTagFoundWithText">Étiquette trouvée :</string>
|
||||
<string name="nfcUnsupportedEncoding">Codage non pris en charge :</string>
|
||||
<string name="nfcNoNdefIntentBut">Aucun NFC NDEF atteint, mais</string>
|
||||
<string name="nfcNotSupportedInThisAndroidVersionYet">NFC non pris en charge dans cette version Android.</string>
|
||||
<string name="cantRunRule">Impossible d’éxécuter les règles.</string>
|
||||
<string name="nfcApplyTagToRule">Affecter l’étiquette à la règle</string>
|
||||
<string name="nfcTagReadSuccessfully">Succès de lecture de l’étiquette.</string>
|
||||
|
||||
@@ -300,7 +300,6 @@
|
||||
<string name="nfcEnterValidIdentifier">Inserire un nome valido per l\'etichetta (come "Porta d\'ingresso di casa").</string>
|
||||
<string name="nfcNoNdefIntentBut">Nessun Intent NFC NDEF, ma</string>
|
||||
<string name="nfcNoTag">Nessuna etichetta rilevata.</string>
|
||||
<string name="nfcNotSupportedInThisAndroidVersionYet">NFC non ancora supportato in questa versione di Android.</string>
|
||||
<string name="nfcReadTag">Leggi ID dall\'etichetta</string>
|
||||
<string name="nfcTag">Etichetta NFC</string>
|
||||
<string name="nfcTagDataNotUsable">Dati dell\'etichetta non leggibili, si prega di riscriverli.</string>
|
||||
|
||||
@@ -300,7 +300,6 @@
|
||||
<string name="nfcTagFoundWithText">Tag gevonden met tekst:</string>
|
||||
<string name="nfcUnsupportedEncoding">Niet ondersteunde codering:</string>
|
||||
<string name="nfcNoNdefIntentBut">Geen NFC NDEF bedoeling, maar</string>
|
||||
<string name="nfcNotSupportedInThisAndroidVersionYet">NFC nog niet ondersteund in deze Android versie.</string>
|
||||
<string name="cantRunRule">Kan regels niet uitvoeren.</string>
|
||||
<string name="nfcApplyTagToRule">Pas Tag toe op regel</string>
|
||||
<string name="nfcTagReadSuccessfully">Tag succesvol gelezen.</string>
|
||||
|
||||
@@ -365,7 +365,6 @@
|
||||
<string name="nfcTagFoundWithText">Znaleziono tag z tekstem:</string>
|
||||
<string name="nfcUnsupportedEncoding">Nieobsługiwane kodowanie:</string>
|
||||
<string name="nfcNoNdefIntentBut"> Brak intencji NFC NDEF, ale</string>
|
||||
<string name="nfcNotSupportedInThisAndroidVersionYet">NFC nie jest jeszcze obsługiwane w tej wersji Androida.</string>
|
||||
<string name="cantRunRule">Nie można uruchomić reguł.</string>
|
||||
<string name="cantDownloadTooFewRequestsInSettings" translatable="false">Can\'t download anything. Amount of http requests in settings is lower than 1.</string>
|
||||
<string name="nfcApplyTagToRule">Zastosuj tag do reguły</string>
|
||||
|
||||
@@ -334,8 +334,7 @@
|
||||
<string name="nfcTagFoundWithText">Найдена метка с текстом:</string>
|
||||
<string name="nfcUnsupportedEncoding">Неподдерживаемая кодировка:</string>
|
||||
<string name="nfcNoNdefIntentBut">Нет NFC NDEF Intent, но</string>
|
||||
<string name="nfcNotSupportedInThisAndroidVersionYet">NFC пока не поддерживается в этой версии Android.</string>
|
||||
<string name="cantRunRule">Не удается запустить правила.</string>
|
||||
<string name="cantRunRule">Не удается запустить правила.</string>
|
||||
<string name="cantDownloadTooFewRequestsInSettings" translatable="false">Не получается загрузить. Количество http запросов в настройках меньше 1.</string>
|
||||
<string name="nfcApplyTagToRule">Применить метку к правилу</string>
|
||||
<string name="nfcTagReadSuccessfully">Метка прочитана успешно.</string>
|
||||
|
||||
@@ -296,7 +296,6 @@
|
||||
<string name="nfcTagFoundWithText">找到标签,文本为:</string>
|
||||
<string name="nfcUnsupportedEncoding">不支持的编码:</string>
|
||||
<string name="nfcNoNdefIntentBut">没有 NFC NDEF Intent,但是</string>
|
||||
<string name="nfcNotSupportedInThisAndroidVersionYet">此 Android 版本尚不支持 NFC。</string>
|
||||
<string name="cantRunRule">无法运行规则。</string>
|
||||
<string name="nfcApplyTagToRule">将标签应用到规则</string>
|
||||
<string name="nfcTagReadSuccessfully">标签读取成功。</string>
|
||||
|
||||
@@ -366,7 +366,6 @@
|
||||
<string name="nfcTagFoundWithText">Tag found with text:</string>
|
||||
<string name="nfcUnsupportedEncoding">Unsupported encoding:</string>
|
||||
<string name="nfcNoNdefIntentBut">No NFC NDEF intent, but</string>
|
||||
<string name="nfcNotSupportedInThisAndroidVersionYet">NFC not supported in this Android version, yet.</string>
|
||||
<string name="cantRunRule">Cannot run rules.</string>
|
||||
<string name="cantDownloadTooFewRequestsInSettings" translatable="false">Can\'t download anything. Amount of http requests in settings is lower than 1.</string>
|
||||
<string name="nfcApplyTagToRule">Apply tag to rule</string>
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
* Fixed: Crash in Play Store version when starting the service
|
||||
* Fixed: trigger url result was not stored correctly in a variable
|
||||
* Fixed: In case of HTTP errors during trigger url actions, the return value in the variable was not set according to documentation.
|
||||
* Fixed: Crash when clicking +/- when creating/editing TimeFrame trigger
|
||||
* Fixed: Permission BLUETOOTH_CONNECT requested for Bluetooth trigger editor in Google Play version
|
||||
* Fixed: Airplane mode trigger didn't work if no locations where defined.
|
||||
* Fixed: Vibrate action didn't work on some devices
|
||||
* Added Possibility to select UI theme, hence enabling modern UI designs
|
||||
Reference in New Issue
Block a user