From 7ffd149ce747377e6011123009ea4de1b24c86df Mon Sep 17 00:00:00 2001 From: Jesse de Wit Date: Mon, 2 Dec 2024 20:34:50 +0100 Subject: [PATCH] fix tor config receiver --- .../src/main/java/com/breez/client/plugins/breez/Tor.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/android/app/src/main/java/com/breez/client/plugins/breez/Tor.java b/android/app/src/main/java/com/breez/client/plugins/breez/Tor.java index 6c3026d63..c7836afc8 100644 --- a/android/app/src/main/java/com/breez/client/plugins/breez/Tor.java +++ b/android/app/src/main/java/com/breez/client/plugins/breez/Tor.java @@ -19,6 +19,7 @@ import android.content.Intent; import android.content.IntentFilter; import android.content.ServiceConnection; +import android.os.Build; import android.os.IBinder; import android.util.Log; import java.util.concurrent.Executor; @@ -151,7 +152,11 @@ public void onReceive(Context context, Intent intent) { Context context = binding.getApplicationContext(); - context.registerReceiver(receiver, new IntentFilter(TorService.ACTION_STATUS)); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { + context.registerReceiver(receiver, new IntentFilter(TorService.ACTION_STATUS), Context.RECEIVER_NOT_EXPORTED); + } else { + context.registerReceiver(receiver, new IntentFilter(TorService.ACTION_STATUS)); + } // Ref. https://developer.android.com/guide/components/services // Your service can work both ways—it can be started (to run indefinitely) and also allow binding.