Skip to content

Commit

Permalink
fix tor config receiver
Browse files Browse the repository at this point in the history
  • Loading branch information
JssDWt committed Dec 2, 2024
1 parent 254d7e5 commit 7ffd149
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 7ffd149

Please sign in to comment.