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. */
|
* when mCaptureThread terminates. */
|
||||||
public static void stopService() {
|
public static void stopService() {
|
||||||
CaptureService captureService = INSTANCE;
|
CaptureService captureService = INSTANCE;
|
||||||
|
Log.d(TAG, "stopService called (instance? " + (captureService != null) + ")");
|
||||||
|
|
||||||
if(captureService == null)
|
if(captureService == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
stopPacketLoop();
|
stopPacketLoop();
|
||||||
captureService.signalServicesTermination();
|
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();
|
captureService.stopSelf();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -732,6 +732,7 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
|
|||||||
intent.setType("*/*");
|
intent.setType("*/*");
|
||||||
intent.putExtra(Intent.EXTRA_TITLE, "sslkeylogfile.txt");
|
intent.putExtra(Intent.EXTRA_TITLE, "sslkeylogfile.txt");
|
||||||
|
|
||||||
|
Log.d(TAG, "startExportSslkeylogfile: launching dialog");
|
||||||
Utils.launchFileDialog(this, intent, sslkeyfileExportLauncher);
|
Utils.launchFileDialog(this, intent, sslkeyfileExportLauncher);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user