Skip to content

Commit

Permalink
Use integer to represent port number
Browse files Browse the repository at this point in the history
  • Loading branch information
GreaterFire committed Jan 19, 2019
1 parent 93b0983 commit 39519b6
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class MainActivity extends AppCompatActivity {
private ToggleButton verifyButton;
private Button startStopButton;

private String getConfig(String remoteAddr, short remotePort, String password, boolean verify) {
private String getConfig(String remoteAddr, int remotePort, String password, boolean verify) {
try {
return new JSONObject()
.put("local_addr", "127.0.0.1")
Expand Down Expand Up @@ -61,7 +61,7 @@ public void onClick(View v) {
TrojanService serviceInstance = TrojanService.getInstance();
if (serviceInstance == null) {
String config = getConfig(remoteAddrText.getText().toString(),
Short.parseShort(remotePortText.getText().toString()),
Integer.parseInt(remotePortText.getText().toString()),
passwordText.getText().toString(),
verifyButton.isChecked());
File file = new File(getFilesDir(), "config.json");
Expand Down

0 comments on commit 39519b6

Please sign in to comment.