Enable the TLS decryption switch on setup done

This commit is contained in:
emanuele-f 2022-05-30 23:20:32 +02:00
parent 12f29a920e
commit e221fad374
3 changed files with 14 additions and 2 deletions

View File

@ -132,6 +132,7 @@ public class SettingsActivity extends BaseActivity implements PreferenceFragment
private DropDownPreference mCapInterface;
private SwitchPreference mMalwareDetectionEnabled;
private Billing mIab;
private boolean mHasStartedMitmWizard;
private final ActivityResultLauncher<String> requestPermissionLauncher =
registerForActivityResult(new ActivityResultContracts.RequestPermission(), isGranted ->
@ -162,6 +163,17 @@ public class SettingsActivity extends BaseActivity implements PreferenceFragment
}
}
@Override
public void onResume() {
super.onResume();
if(mHasStartedMitmWizard && !MitmAddon.needsSetup(requireContext())) {
Log.d(TAG, "mitm setup complete, enabling");
mTlsDecryption.setChecked(true);
}
mHasStartedMitmWizard = false;
}
private @NonNull <T extends Preference> T requirePreference(String key) {
T pref = findPreference(key);
if(pref == null)
@ -258,6 +270,7 @@ public class SettingsActivity extends BaseActivity implements PreferenceFragment
Context ctx = requireContext();
if(enabled && MitmAddon.needsSetup(ctx)) {
mHasStartedMitmWizard = true;
Intent intent = new Intent(ctx, MitmSetupWizard.class);
startActivity(intent);
return false;

View File

@ -32,7 +32,6 @@ public class Done extends StepFragment {
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
mStepIcon.setVisibility(View.GONE);
mStepLabel.setText(R.string.mitm_setup_wizard_done);
MitmAddon.setDecryptionSetupDone(requireContext(), true);

View File

@ -346,7 +346,7 @@
<string name="block_private_dns">Block private DNS</string>
<string name="block_private_dns_summary">Detect and possibly block private DNS to inspect DNS traffic. Disabling this can hinder detection</string>
<string name="mitm_setup_wizard_intro">This wizard will guide you through the installation of the PCAPdroid mitm addon and certification authority, which are needed to perform the <a href='%1$s'>TLS decryption</a></string>
<string name="mitm_setup_wizard_done">PCAPdroid is now ready to decrypt TLS traffic\n\nCheck out the <a href='%1$s'>user guide</a> to know more about the security measures which may prevent decryption and how to bypass them</string>
<string name="mitm_setup_wizard_done">PCAPdroid is now ready to decrypt the TLS traffic\n\nCheck out the <a href='%1$s'>user guide</a> to know more about the security measures which may prevent decryption and how to bypass them</string>
<string name="app_intro_skip_button">Skip</string>
<string name="app_intro_next_button">Next</string>
<string name="app_intro_back_button">Back</string>