Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix tor config receiver #1321

Merged
merged 1 commit into from
Dec 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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