17
17
import org .eclipse .core .runtime .Status ;
18
18
import org .eclipse .ui .console .MessageConsole ;
19
19
20
- import io .sloeber .core .api .PasswordManager ;
21
20
import io .sloeber .core .common .Common ;
22
21
import io .sloeber .core .common .Const ;
23
22
import io .sloeber .core .common .IndexHelper ;
24
23
import io .sloeber .core .communication .ArduinoSerial ;
25
- import io .sloeber .core .tools .Helpers ;
26
24
27
25
public class arduinoUploader implements IRealUpload {
28
26
@@ -93,11 +91,6 @@ public boolean uploadUsingPreferences(IFile hexFile, boolean usingProgrammer, IP
93
91
if (boardName .startsWith ("Arduino Due " )) { //$NON-NLS-1$
94
92
ArduinoSerial .reset_Arduino_by_baud_rate (MComPort , 115200 , 100 );
95
93
}
96
- // for web authorized upload
97
- if (needsPassword ) {
98
- String passWord = getPasswordFromCode ();
99
- PasswordManager .setPwd (MComPort , myLogin , passWord );
100
- }
101
94
102
95
return true ;
103
96
}
@@ -111,20 +104,16 @@ public boolean uploadUsingPreferences(IFile hexFile, boolean usingProgrammer, IP
111
104
*/
112
105
@ SuppressWarnings ("nls" )
113
106
private String getPasswordFromCode () {
114
- return IndexHelper .findParameterInFunction (this .myProject , "setup" , "ArduinoOTA.setPassword" ,
107
+ String parameter = IndexHelper .findParameterInFunction (this .myProject , "setup" , "ArduinoOTA.setPassword" ,
115
108
"no_pwd_found_in_code" );
109
+ return parameter .replaceAll ("\\ (.*\\ )" , "" ).trim ();
116
110
117
111
}
118
112
119
113
private void setEnvironmentvarsForAutorizedUpload (IContributedEnvironment contribEnv ,
120
114
ICConfigurationDescription configurationDescription , String host ) {
121
- String passWord ;
122
- PasswordManager pwdManager = new PasswordManager ();
123
- if (!pwdManager .setHost (Helpers .getHostFromComPort (host ))) {
124
- passWord = getPasswordFromCode ();
125
- } else {
126
- passWord = pwdManager .getPassword ();
127
- }
115
+ String passWord = null ;
116
+ passWord = getPasswordFromCode ();
128
117
IEnvironmentVariable var = new EnvironmentVariable (Const .ENV_KEY_NETWORK_AUTH , passWord );
129
118
contribEnv .addVariable (var , configurationDescription );
130
119
0 commit comments