Fix root permission request on read from pcap

INTERNET_ACROSS_USERS was requested when trying to read from a PCAP file,
which triggered a failure toast in most cases
This commit is contained in:
emanuele-f 2023-09-18 22:49:38 +02:00
parent 44f8dd8d29
commit bf6e834f17

View File

@ -1062,7 +1062,7 @@ public class CaptureService extends VpnService implements Runnable {
// Inside the mCaptureThread // Inside the mCaptureThread
@Override @Override
public void run() { public void run() {
if(mSettings.root_capture || mSettings.readFromPcap()) { if(mSettings.root_capture) {
// Check for INTERACT_ACROSS_USERS, required to query apps of other users/work profiles // Check for INTERACT_ACROSS_USERS, required to query apps of other users/work profiles
if(checkCallingOrSelfPermission(Utils.INTERACT_ACROSS_USERS) != PackageManager.PERMISSION_GRANTED) { if(checkCallingOrSelfPermission(Utils.INTERACT_ACROSS_USERS) != PackageManager.PERMISSION_GRANTED) {
boolean success = Utils.rootGrantPermission(this, Utils.INTERACT_ACROSS_USERS); boolean success = Utils.rootGrantPermission(this, Utils.INTERACT_ACROSS_USERS);