Skip to content

Commit 6c47173

Browse files
committed
Fixes: nodejs#187 Ask for HTTP/HTTPS for non-prod builds
1 parent a421cf7 commit 6c47173

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

app/src/main/java/com/zulip/android/activities/LoginActivity.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,8 @@ private void checkForError() {
160160
// add http or https if scheme is not included
161161
if (!serverURL.contains("://")) {
162162
serverURL = httpScheme + "://" + serverURL;
163-
showBackends(httpScheme, serverURL);
163+
if (BuildConfig.DEBUG) showHTTPDialog(serverURL); //Ask for http or https if in non-prod builds otherwise if in prod then use https
164+
else showBackends(httpScheme, serverURL);
164165
} else {
165166
Uri serverUri = Uri.parse(serverURL);
166167

@@ -227,7 +228,7 @@ public void onFailure(Call<ZulipBackendResponse> call, Throwable t) {
227228
private void showHTTPDialog(final String serverURL) {
228229
new AlertDialog.Builder(this)
229230
.setTitle(R.string.http_or_https)
230-
.setMessage(R.string.http_message)
231+
.setMessage(((BuildConfig.DEBUG) ? R.string.http_message_debug : R.string.http_message))
231232
.setPositiveButton(R.string.use_https, new DialogInterface.OnClickListener() {
232233
public void onClick(DialogInterface dialog, int which) {
233234
dialog.dismiss();

app/src/main/res/values/strings.xml

+1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
<string name="menu_today">Today</string>
6666
<string name="http_or_https">HTTP/HTTPS</string>
6767
<string name="http_message">HTTP is insecure, and we recommend using it only for testing the Zulip Android app against a development environment. Are you sure you want to use HTTP?</string>
68+
<string name="http_message_debug">Which scheme you would like to use HTTP or HTTPS?</string>
6869
<string name="use_https">Use HTTPS</string>
6970
<string name="use_http">Use HTTP</string>
7071
<string name="empty_list">Sorry, no messages here.</string>

0 commit comments

Comments
 (0)