Skip to content

Commit ad14b21

Browse files
author
Joice M. Joseph
committed
feat: enforces https for article viewers, removes outdated article readers such as
1. google gwt 2. view text
1 parent 122016a commit ad14b21

File tree

3 files changed

+2
-14
lines changed

3 files changed

+2
-14
lines changed

app/src/main/java/com/manuelmaly/hn/ArticleReaderActivity.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ public class ArticleReaderActivity extends AppCompatActivity {
4242
public static final String EXTRA_HNPOST = "HNPOST";
4343
public static final String EXTRA_HTMLPROVIDER_OVERRIDE = "HTMLPROVIDER_OVERRIDE";
4444

45-
private static final String HTMLPROVIDER_PREFIX_VIEWTEXT = "http://viewtext.org/article?url=";
46-
private static final String HTMLPROVIDER_PREFIX_GOOGLE = "http://www.google.com/gwt/x?u=";
47-
private static final String HTMLPROVIDER_PREFIX_INSTAPAPER = "http://www.instapaper.com/text?u=";
45+
private static final String HTMLPROVIDER_PREFIX_INSTAPAPER = "https://www.instapaper.com/text?u=";
4846

4947
@ViewById(R.id.article_webview)
5048
WebView mWebView;
@@ -187,11 +185,7 @@ private void toggleSwipeRefreshLayout() {
187185
@SuppressWarnings("deprecation")
188186
public static String getArticleViewURL( HNPost post, String htmlProvider, Context c ) {
189187
String encodedURL = URLEncoder.encode( post.getURL() );
190-
if (htmlProvider.equals( c.getString( R.string.pref_htmlprovider_viewtext ) )) {
191-
return HTMLPROVIDER_PREFIX_VIEWTEXT + encodedURL;
192-
} else if (htmlProvider.equals( c.getString( R.string.pref_htmlprovider_google ) )) {
193-
return HTMLPROVIDER_PREFIX_GOOGLE + encodedURL;
194-
} else if (htmlProvider.equals( c.getString( R.string.pref_htmlprovider_instapaper ) )) {
188+
if (htmlProvider.equals( c.getString( R.string.pref_htmlprovider_instapaper ) )) {
195189
return HTMLPROVIDER_PREFIX_INSTAPAPER + encodedURL;
196190
} else {
197191
return post.getURL();

app/src/main/java/com/manuelmaly/hn/MainActivity.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -603,8 +603,6 @@ public LongPressMenuListAdapter(HNPost post) {
603603
}
604604
mItems.addAll(Arrays.asList(
605605
getString(R.string.pref_htmlprovider_original_url),
606-
getString(R.string.pref_htmlprovider_viewtext),
607-
getString(R.string.pref_htmlprovider_google),
608606
getString(R.string.pref_htmlprovider_instapaper),
609607
getString(R.string.external_browser),
610608
getString(R.string.share_article_url)));

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,10 @@
1616
<string name="pref_title_htmlprovider">View Articles via &#8230;</string>
1717
<string name="pref_default_htmlprovider">Original Article URL</string>
1818
<string name="pref_htmlprovider_original_url">Original Article URL</string>
19-
<string name="pref_htmlprovider_viewtext">ViewText.org</string>
20-
<string name="pref_htmlprovider_google">Google for Mobile Devices</string>
2119
<string name="pref_htmlprovider_instapaper">Instapaper Text</string>
2220

2321
<string-array name="pref_array_htmlprovider">
2422
<item>@string/pref_htmlprovider_original_url</item>
25-
<item>@string/pref_htmlprovider_viewtext</item>
26-
<item>@string/pref_htmlprovider_google</item>
2723
<item>@string/pref_htmlprovider_instapaper</item>
2824
</string-array>
2925

0 commit comments

Comments
 (0)