@@ -69,7 +69,6 @@ public class PortScanner extends Plugin {
6969 private static final String CUSTOM_PARAMETERS = "PortScanner.Prefs.CustomParameters" ;
7070 private static final String CUSTOM_PARAMETERS_TEXT = "PortScanner.Prefs.CustomParameters.Text" ;
7171 private SharedPreferences mPreferences = null ;
72- private boolean unresolvedPorts = false ;
7372
7473 public PortScanner () {
7574 super (R .string .port_scanner , R .string .port_scanner_desc ,
@@ -111,7 +110,7 @@ private void saveCustomParameters (boolean displayed){
111110 SharedPreferences .Editor edit = mPreferences .edit ();
112111 edit .putBoolean (CUSTOM_PARAMETERS , displayed );
113112 edit .putString (CUSTOM_PARAMETERS_TEXT , mTextParameters .getText ().toString ());
114- edit .commit ();
113+ edit .apply ();
115114 }
116115
117116 private void setStoppedState () {
@@ -390,29 +389,6 @@ public void run() {
390389 public void onEnd (int exitCode ) {
391390 super .onEnd (exitCode );
392391
393- // last chance to resolve ports protocols
394- if (unresolvedPorts ) {
395- String temp_port , port , protocol ;
396- for (int i = 0 ; i < mPortList .size (); i ++) {
397- if (mPortList .get (i ).startsWith ("tcp : " ) || mPortList .get (i ).startsWith ("udp : " )) {
398- temp_port = mPortList .get (i );
399- port = temp_port .split ("\\ s" )[2 ];
400- protocol = System .getProtocolByPort (port );
401-
402- if (protocol != null )
403- mPortList .set (i , port + " ( " + protocol + " )" );
404-
405- Logger .debug ("unresolved port: " + port + ":" + protocol );
406- }
407- }
408- PortScanner .this .runOnUiThread (new Runnable () {
409- @ Override
410- public void run () {
411- mListAdapter .notifyDataSetChanged ();
412- }
413- });
414- }
415-
416392 PortScanner .this .runOnUiThread (new Runnable () {
417393 @ Override
418394 public void run () {
@@ -433,11 +409,9 @@ public void onPortFound(final int port, String protocol) {
433409 public void run () {
434410 String entry ;
435411
436- if (resolvedProtocol != null )
412+ if (resolvedProtocol != null ) {
437413 entry = port + " ( " + resolvedProtocol + " )" ;
438-
439- else {
440- unresolvedPorts = true ;
414+ } else {
441415 entry = portProtocol + " : " + port ;
442416 }
443417
0 commit comments