diff --git a/app/build.gradle b/app/build.gradle index 0fae57c..c0f8cb1 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -40,7 +40,7 @@ android { } } lintOptions { - abortOnError false + abortOnError true } } diff --git a/app/src/main/java/acr/browser/lightning/download/WebAddress.java b/app/src/main/java/acr/browser/lightning/download/WebAddress.java index 96852a6..ed45299 100644 --- a/app/src/main/java/acr/browser/lightning/download/WebAddress.java +++ b/app/src/main/java/acr/browser/lightning/download/WebAddress.java @@ -35,11 +35,11 @@ class WebAddress { private static final int MATCH_GROUP_PORT = 4; private static final int MATCH_GROUP_PATH = 5; private static final Pattern sAddressPattern = Pattern.compile( - /* scheme */"(?:(http|https|file)\\:\\/\\/)?" + - /* authority */"(?:([-A-Za-z0-9$_.+!*'(),;?&=]+(?:\\:[-A-Za-z0-9$_.+!*'(),;?&=]+)?)@)?" + + /* scheme */"(?:(http|https|file)://)?" + + /* authority */"(?:([-A-Za-z0-9$_.+!*'(),;?&=]+(?::[-A-Za-z0-9$_.+!*'(),;?&=]+)?)@)?" + /* host */"([" + GOOD_IRI_CHAR + "%_-][" + GOOD_IRI_CHAR + "%_\\.-]*|\\[[0-9a-fA-F:\\.]+\\])?" + - /* port */"(?:\\:([0-9]*))?" + - /* path */"(\\/?[^#]*)?" + + /* port */"(?::([0-9]*))?" + + /* path */"(/?[^#]*)?" + /* anchor */".*", Pattern.CASE_INSENSITIVE); /** diff --git a/app/src/main/java/acr/browser/lightning/reading/OutputFormatter.java b/app/src/main/java/acr/browser/lightning/reading/OutputFormatter.java index f57a1da..fe63ca4 100644 --- a/app/src/main/java/acr/browser/lightning/reading/OutputFormatter.java +++ b/app/src/main/java/acr/browser/lightning/reading/OutputFormatter.java @@ -23,7 +23,7 @@ public class OutputFormatter { private static final int MIN_FIRST_PARAGRAPH_TEXT = 50; // Min size of first paragraph private static final int MIN_PARAGRAPH_TEXT = 30; // Min size of any other paragraphs private static final List NODES_TO_REPLACE = Arrays.asList("strong", "b", "i"); - private Pattern unlikelyPattern = Pattern.compile("display\\:none|visibility\\:hidden"); + private Pattern unlikelyPattern = Pattern.compile("display:none|visibility:hidden"); private final int minFirstParagraphText; private final int minParagraphText; private final List nodesToReplace; diff --git a/app/src/main/java/acr/browser/lightning/reading/SHelper.java b/app/src/main/java/acr/browser/lightning/reading/SHelper.java index 6e2ed97..7293f3a 100644 --- a/app/src/main/java/acr/browser/lightning/reading/SHelper.java +++ b/app/src/main/java/acr/browser/lightning/reading/SHelper.java @@ -253,7 +253,7 @@ class SHelper { public static String getUrlFromUglyGoogleRedirect(String url) { if (url.startsWith("http://www.google.com/url?")) { url = url.substring("http://www.google.com/url?".length()); - String arr[] = urlDecode(url).split("\\&"); + String arr[] = urlDecode(url).split("&"); for (String str : arr) { if (str.startsWith("q=")) return str.substring("q=".length()); diff --git a/app/src/main/java/acr/browser/lightning/utils/IntentUtils.java b/app/src/main/java/acr/browser/lightning/utils/IntentUtils.java index 91944c7..db29ee9 100644 --- a/app/src/main/java/acr/browser/lightning/utils/IntentUtils.java +++ b/app/src/main/java/acr/browser/lightning/utils/IntentUtils.java @@ -24,7 +24,7 @@ public class IntentUtils { + // switch on case insensitive matching '(' + // begin group for schema - "(?:http|https|file):\\/\\/" + "|(?:inline|data|about|javascript):" + "|(?:.*:.*@)" + "(?:http|https|file)://" + "|(?:inline|data|about|javascript):" + "|(?:.*:.*@)" + ')' + "(.*)"); public IntentUtils(Activity activity) { diff --git a/app/src/main/java/acr/browser/lightning/utils/UrlUtils.java b/app/src/main/java/acr/browser/lightning/utils/UrlUtils.java index 1cb5b9b..1e02907 100644 --- a/app/src/main/java/acr/browser/lightning/utils/UrlUtils.java +++ b/app/src/main/java/acr/browser/lightning/utils/UrlUtils.java @@ -28,7 +28,7 @@ public class UrlUtils { private static final Pattern ACCEPTED_URI_SCHEMA = Pattern.compile( "(?i)" + // switch on case insensitive matching '(' + // begin group for schema - "(?:http|https|file):\\/\\/" + + "(?:http|https|file)://" + "|(?:inline|data|about|javascript):" + "|(?:.*:.*@)" + ')' +