mirror of
https://github.com/emanuele-f/PCAPdroid.git
synced 2026-07-03 21:21:12 +08:00
parent
e221fad374
commit
bd6034b8c6
@ -681,13 +681,22 @@ public class CaptureService extends VpnService implements Runnable {
|
||||
* when mCaptureThread terminates. */
|
||||
public static void stopService() {
|
||||
CaptureService captureService = INSTANCE;
|
||||
Log.d(TAG, "stopService called (instance? " + (captureService != null) + ")");
|
||||
|
||||
if(captureService == null)
|
||||
return;
|
||||
|
||||
stopPacketLoop();
|
||||
captureService.signalServicesTermination();
|
||||
|
||||
captureService.stopForeground(true /* remove notification */);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
||||
captureService.stopForeground(STOP_FOREGROUND_REMOVE);
|
||||
else
|
||||
captureService.stopForeground(true);
|
||||
|
||||
// this fixes notification not removed (reproduced on the Android 12 emulator)
|
||||
NotificationManagerCompat.from(captureService).deleteNotificationChannel(NOTIFY_CHAN_VPNSERVICE);
|
||||
|
||||
captureService.stopSelf();
|
||||
}
|
||||
|
||||
|
||||
@ -732,6 +732,7 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
|
||||
intent.setType("*/*");
|
||||
intent.putExtra(Intent.EXTRA_TITLE, "sslkeylogfile.txt");
|
||||
|
||||
Log.d(TAG, "startExportSslkeylogfile: launching dialog");
|
||||
Utils.launchFileDialog(this, intent, sslkeyfileExportLauncher);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user