Browse Source

Merge pull request #327 from kuc/migrate-to-https

Migrate to HTTPS
master
Anthony Restaino 9 years ago
parent
commit
aa9a7123b2
  1. 2
      app/src/main/java/acr/browser/lightning/constant/BookmarkPage.java
  2. 2
      app/src/main/java/acr/browser/lightning/fragment/GeneralSettingsFragment.java
  3. 2
      app/src/main/java/acr/browser/lightning/object/SearchAdapter.java
  4. 4
      app/src/main/java/acr/browser/lightning/reading/HtmlFetcher.java
  5. 8
      app/src/main/java/acr/browser/lightning/reading/SHelper.java

2
app/src/main/java/acr/browser/lightning/constant/BookmarkPage.java

@ -46,7 +46,7 @@ public final class BookmarkPage {
"<p class=ellipses>\n" + "<p class=ellipses>\n" +
"<img src='"; "<img src='";
private static final String PART3 = "http://www.google.com/s2/favicons?domain="; private static final String PART3 = "https://www.google.com/s2/favicons?domain=";
private static final String PART4 = "' />"; private static final String PART4 = "' />";

2
app/src/main/java/acr/browser/lightning/fragment/GeneralSettingsFragment.java

@ -344,7 +344,7 @@ public class GeneralSettingsFragment extends LightningPreferenceFragment impleme
if (!mHomepage.startsWith("about:")) { if (!mHomepage.startsWith("about:")) {
getHome.setText(mHomepage); getHome.setText(mHomepage);
} else { } else {
String defaultUrl = "http://www.google.com"; String defaultUrl = "https://www.google.com";
getHome.setText(defaultUrl); getHome.setText(defaultUrl);
} }
homePicker.setView(getHome); homePicker.setView(getHome);

2
app/src/main/java/acr/browser/lightning/object/SearchAdapter.java

@ -380,7 +380,7 @@ public class SearchAdapter extends BaseAdapter implements Filterable {
language = DEFAULT_LANGUAGE; language = DEFAULT_LANGUAGE;
} }
try { try {
URL url = new URL("http://google.com/complete/search?q=" + query URL url = new URL("https://google.com/complete/search?q=" + query
+ "&output=toolbar&hl=" + language); + "&output=toolbar&hl=" + language);
HttpURLConnection connection = (HttpURLConnection) url.openConnection(); HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setDoInput(true); connection.setDoInput(true);

4
app/src/main/java/acr/browser/lightning/reading/HtmlFetcher.java

@ -394,8 +394,8 @@ public class HtmlFetcher {
if (responseCode / 100 == 3 && newUrl != null && num_redirects < 5) { if (responseCode / 100 == 3 && newUrl != null && num_redirects < 5) {
newUrl = SPACE.matcher(newUrl).replaceAll("+"); newUrl = SPACE.matcher(newUrl).replaceAll("+");
// some services use (none-standard) utf8 in their location header // some services use (none-standard) utf8 in their location header
if (urlAsString.startsWith("http://bit.ly") if (urlAsString.contains("://bit.ly")
|| urlAsString.startsWith("http://is.gd")) || urlAsString.contains("://is.gd"))
newUrl = encodeUriFromHeader(newUrl); newUrl = encodeUriFromHeader(newUrl);
// AP: This code is not longer need, instead we always follow // AP: This code is not longer need, instead we always follow

8
app/src/main/java/acr/browser/lightning/reading/SHelper.java

@ -251,8 +251,8 @@ class SHelper {
} }
public static String getUrlFromUglyGoogleRedirect(String url) { public static String getUrlFromUglyGoogleRedirect(String url) {
if (url.startsWith("http://www.google.com/url?")) { if (url.startsWith("https://www.google.com/url?")) {
url = url.substring("http://www.google.com/url?".length()); url = url.substring("https://www.google.com/url?".length());
String arr[] = urlDecode(url).split("&"); String arr[] = urlDecode(url).split("&");
for (String str : arr) { for (String str : arr) {
if (str.startsWith("q=")) if (str.startsWith("q="))
@ -264,8 +264,8 @@ class SHelper {
} }
public static String getUrlFromUglyFacebookRedirect(String url) { public static String getUrlFromUglyFacebookRedirect(String url) {
if (url.startsWith("http://www.facebook.com/l.php?u=")) { if (url.startsWith("https://www.facebook.com/l.php?u=")) {
url = url.substring("http://www.facebook.com/l.php?u=".length()); url = url.substring("https://www.facebook.com/l.php?u=".length());
return urlDecode(url); return urlDecode(url);
} }

Loading…
Cancel
Save