Catch possible SecurityException starting the VPN

This commit is contained in:
emanuele-f 2024-09-07 10:29:40 +02:00
parent 95686b1def
commit 90c8ae537a

View File

@ -538,7 +538,8 @@ public class CaptureService extends VpnService implements Runnable {
try {
mParcelFileDescriptor = builder.setSession(CaptureService.VpnSessionName).establish();
} catch (IllegalArgumentException | IllegalStateException e) {
} catch (IllegalArgumentException | IllegalStateException | SecurityException e) {
e.printStackTrace();
Utils.showToast(this, R.string.vpn_setup_failed);
return abortStart();
}