Crash in Google Play version fixed

This commit is contained in:
2025-12-07 12:53:48 +01:00
parent bbb477fc77
commit e52ce4cd30
7 changed files with 27 additions and 17 deletions

View File

@@ -74,9 +74,7 @@
<uses-permission android:name="android.permission.READ_CALL_LOG" /> <uses-permission android:name="android.permission.READ_CALL_LOG" />
<uses-permission android:name="android.permission.READ_CALENDAR" /> <uses-permission android:name="android.permission.READ_CALENDAR" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" /> <uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<uses-permission <uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" tools:ignore="ProtectedPermissions" />
android:name="android.permission.WRITE_SECURE_SETTINGS"
tools:ignore="ProtectedPermissions" />
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM"/> <uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM"/>
<!--android:maxSdkVersion="32" /> <!--android:maxSdkVersion="32" />
<uses-permission android:name="android.permission.USE_EXACT_ALARM" />--> <uses-permission android:name="android.permission.USE_EXACT_ALARM" />-->

View File

@@ -72,9 +72,7 @@
<uses-permission android:name="android.permission.READ_CALL_LOG" /> <uses-permission android:name="android.permission.READ_CALL_LOG" />
<uses-permission android:name="android.permission.READ_CALENDAR" /> <uses-permission android:name="android.permission.READ_CALENDAR" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" /> <uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<uses-permission <uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" tools:ignore="ProtectedPermissions" />
android:name="android.permission.WRITE_SECURE_SETTINGS"
tools:ignore="ProtectedPermissions" />
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM"/> <uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM"/>
<!--android:maxSdkVersion="32" /> <!--android:maxSdkVersion="32" />
<uses-permission android:name="android.permission.USE_EXACT_ALARM" />--> <uses-permission android:name="android.permission.USE_EXACT_ALARM" />-->

View File

@@ -68,13 +68,11 @@
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" /> <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.hardware.sensor.proximity"/> <uses-permission android:name="android.hardware.sensor.proximity"/>
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" /> <uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<uses-permission <uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" tools:ignore="ProtectedPermissions" />
android:name="android.permission.WRITE_SECURE_SETTINGS"
tools:ignore="ProtectedPermissions" />
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM"/> <uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM"/>
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<!--android:maxSdkVersion="32" /> <!--android:maxSdkVersion="32" />
<uses-permission android:name="android.permission.USE_EXACT_ALARM" />--> <uses-permission android:name="android.permission.USE_EXACT_ALARM" />-->
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="com.termux.permission.RUN_COMMAND" /> <uses-permission android:name="com.termux.permission.RUN_COMMAND" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE" /> <uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE" />

View File

@@ -191,7 +191,7 @@ public class ActivityManageTriggerNfc extends Activity
@Override @Override
protected void onPause() protected void onPause()
{ {
/** /*
* Call this before onPause, otherwise an IllegalArgumentException is thrown as well. * Call this before onPause, otherwise an IllegalArgumentException is thrown as well.
*/ */
disableForegroundDispatch(this); disableForegroundDispatch(this);
@@ -203,7 +203,7 @@ public class ActivityManageTriggerNfc extends Activity
protected void onResume() protected void onResume()
{ {
super.onResume(); super.onResume();
/** /*
* It's important, that the activity is in the foreground (resumed). Otherwise * It's important, that the activity is in the foreground (resumed). Otherwise
* an IllegalStateException is thrown. * an IllegalStateException is thrown.
*/ */
@@ -238,9 +238,17 @@ public class ActivityManageTriggerNfc extends Activity
{ {
generatedId = NfcReceiver.readTag(discoveredTag); generatedId = NfcReceiver.readTag(discoveredTag);
if(generatedId != null && generatedId.length() > 0) if(generatedId != null && generatedId.length() > 0)
tvCurrentNfcId.setText(generatedId); {
tvCurrentNfcId.setText(generatedId);
bReadNfcTag.setEnabled(true);
bUseValueCurrentlyStored.setEnabled(true);
}
else else
tvCurrentNfcId.setText(getResources().getString(R.string.nfcTagDataNotUsable)); {
tvCurrentNfcId.setText(getResources().getString(R.string.nfcTagDataNotUsable));
bReadNfcTag.setEnabled(false);
bUseValueCurrentlyStored.setEnabled(false);
}
} }
else if(currentStatus == 1) else if(currentStatus == 1)
{ {

View File

@@ -1,5 +1,7 @@
package com.jens.automation2; package com.jens.automation2;
import static android.app.PendingIntent.FLAG_IMMUTABLE;
import android.Manifest; import android.Manifest;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.app.ActivityManager; import android.app.ActivityManager;
@@ -502,7 +504,12 @@ public class AutomationService extends Service implements OnInitListener
if(Miscellaneous.googleToBlameForLocation(true)) if(Miscellaneous.googleToBlameForLocation(true))
{ {
Intent intent = new Intent(AutomationService.this, ActivityMainTabLayout.class); Intent intent = new Intent(AutomationService.this, ActivityMainTabLayout.class);
PendingIntent pi = PendingIntent.getActivity(AutomationService.this, 0, intent, 0); PendingIntent pi;
// if(Miscellaneous.getTargetSDK(AutomationService.this) >= Build.VERSION_CODES.S)
pi = PendingIntent.getActivity(AutomationService.this, 0, intent, FLAG_IMMUTABLE);
// else
// pi = PendingIntent.getActivity(AutomationService.this, 0, intent, 0);
Miscellaneous.logEvent("w", "Features disabled", "Background location disabled because Google to blame.", 5); Miscellaneous.logEvent("w", "Features disabled", "Background location disabled because Google to blame.", 5);

View File

@@ -290,7 +290,7 @@ public class NfcReceiver
Miscellaneous.logEvent("e", "NFC", "Error writing tag: " + Log.getStackTraceString(e), 2); Miscellaneous.logEvent("e", "NFC", "Error writing tag: " + Log.getStackTraceString(e), 2);
} }
return false; return false;
} }
public static boolean checkNfcRequirements(Context context, boolean showErrorMessage) public static boolean checkNfcRequirements(Context context, boolean showErrorMessage)

View File

@@ -7,4 +7,5 @@
* Fixed: Vibrate action didn't work on some devices * Fixed: Vibrate action didn't work on some devices
* Fixed: Variable trigger didn't always compare correctly. * Fixed: Variable trigger didn't always compare correctly.
* Fixed: Permission check for ability to schedule exact timers * Fixed: Permission check for ability to schedule exact timers
* Fixed: Crash in Google Play version
* Added Possibility to select UI theme, hence enabling modern UI designs * Added Possibility to select UI theme, hence enabling modern UI designs