diff --git a/app/src/main/java/com/emanuelef/remote_capture/activities/MainActivity.java b/app/src/main/java/com/emanuelef/remote_capture/activities/MainActivity.java
index 48309806..47982b14 100644
--- a/app/src/main/java/com/emanuelef/remote_capture/activities/MainActivity.java
+++ b/app/src/main/java/com/emanuelef/remote_capture/activities/MainActivity.java
@@ -62,6 +62,7 @@ import com.emanuelef.remote_capture.CaptureHelper;
import com.emanuelef.remote_capture.ConnectionsRegister;
import com.emanuelef.remote_capture.Log;
import com.emanuelef.remote_capture.MitmReceiver;
+import com.emanuelef.remote_capture.PCAPdroid;
import com.emanuelef.remote_capture.activities.prefs.SettingsActivity;
import com.emanuelef.remote_capture.fragments.ConnectionsFragment;
import com.emanuelef.remote_capture.fragments.StatusFragment;
@@ -102,6 +103,8 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
// helps detecting duplicate state reporting of STOPPED in MutableLiveData
private boolean mWasStarted = false;
+ private boolean mStartPressed = false;
+ private boolean mDecEmptyRulesNoticeShown = false;
private static final String TAG = "Main";
@@ -194,6 +197,7 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
appStateReady();
mWasStarted = false;
+ mStartPressed = false;
} else /* STOPPED -> STOPPED */
appStateReady();
});
@@ -554,6 +558,10 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q)
checkVpnLockdownNotice();
+ else if(mStartPressed) { // STOPPED -> STARTED
+ if(CaptureService.isDecryptingTLS() && !CaptureService.isCapturingAsRoot())
+ checkDecryptionRulesNotice();
+ }
}
public void appStateStopping() {
@@ -561,6 +569,22 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
notifyAppState();
}
+ private void checkDecryptionRulesNotice() {
+ if(!mDecEmptyRulesNoticeShown && PCAPdroid.getInstance().getDecryptionList().isEmpty()) {
+ new AlertDialog.Builder(this)
+ .setMessage(R.string.tls_decryption_no_rules_notice)
+ .setPositiveButton(R.string.yes, (d, whichButton) -> {
+ Intent intent = new Intent(MainActivity.this, EditListActivity.class);
+ intent.putExtra(EditListActivity.LIST_TYPE_EXTRA, ListInfo.Type.DECRYPTION_LIST);
+ startActivity(intent);
+ })
+ .setNegativeButton(R.string.no, (d, whichButton) -> {
+ })
+ .show();
+ mDecEmptyRulesNoticeShown = true;
+ }
+ }
+
private void checkLoadedPcap() {
if(mPcapLoadDialog != null) {
mPcapLoadDialog.dismiss();
@@ -632,6 +656,7 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
int id = item.getItemId();
if(id == R.id.start_live_capture) {
+ mStartPressed = true;
startCapture();
return true;
} else if(id == R.id.action_stop) {
diff --git a/app/src/main/java/com/emanuelef/remote_capture/fragments/ConnectionOverview.java b/app/src/main/java/com/emanuelef/remote_capture/fragments/ConnectionOverview.java
index 32703c0b..7b73a22b 100644
--- a/app/src/main/java/com/emanuelef/remote_capture/fragments/ConnectionOverview.java
+++ b/app/src/main/java/com/emanuelef/remote_capture/fragments/ConnectionOverview.java
@@ -300,6 +300,10 @@ public class ConnectionOverview extends Fragment implements ConnectionDetailsAct
mError.setTextColor(ContextCompat.getColor(context, R.color.warning));
mError.setText(context.getString(R.string.netd_block_missed));
mError.setVisibility(View.VISIBLE);
+ } else if(mConn.getDecryptionStatus() == ConnectionDescriptor.DecryptionStatus.ENCRYPTED) {
+ mError.setTextColor(ContextCompat.getColor(context, R.color.colorTabText));
+ mError.setText(R.string.decryption_info_no_rule);
+ mError.setVisibility(View.VISIBLE);
} else
mError.setVisibility(View.GONE);
}
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index ed0ffabb..fd8326be 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -490,4 +490,6 @@
"Could not resolve host %1$s
To show the actual apps instead of \"%1$s\", be sure to enable the \"%2$s\" option before exporting the PCAP file
Live capture
+ This connection will not be decrypted. Create a decryption rule to decrypt it
+ TLS decryption is only applied to connections that match the configured rules. Do you want to create decryption rules now?