| Index: adblockplussbrowser/src/org/adblockplus/sbrowser/contentblocker/engine/Engine.java |
| =================================================================== |
| --- a/adblockplussbrowser/src/org/adblockplus/sbrowser/contentblocker/engine/Engine.java |
| +++ b/adblockplussbrowser/src/org/adblockplus/sbrowser/contentblocker/engine/Engine.java |
| @@ -36,20 +36,18 @@ import java.util.Collections; |
| import java.util.HashMap; |
| import java.util.List; |
| import java.util.Map; |
| import java.util.Set; |
| import java.util.TreeSet; |
| import java.util.concurrent.LinkedBlockingQueue; |
| import java.util.concurrent.TimeUnit; |
| import java.util.concurrent.locks.ReentrantLock; |
| -import java.util.regex.Pattern; |
| import org.adblockplus.adblockplussbrowser.R; |
| -import org.adblockplus.sbrowser.contentblocker.MainPreferences; |
| import android.content.Context; |
| import android.content.Intent; |
| import android.content.SharedPreferences; |
| import android.content.pm.PackageInfo; |
| import android.content.pm.PackageManager; |
| import android.content.pm.ResolveInfo; |
| import android.net.ConnectivityManager; |
| @@ -60,29 +58,16 @@ import android.os.Looper; |
| import android.preference.PreferenceManager; |
| import android.text.TextUtils; |
| import android.util.Log; |
| public final class Engine |
| { |
| private static final String TAG = Engine.class.getSimpleName(); |
| - // TODO make use of this regex's |
| - public static final Pattern RE_SUBSCRIPTION_HEADER = Pattern.compile( |
| - "\\[Adblock(?:\\s*Plus\\s*([\\d\\.]+)?)?\\]", Pattern.CASE_INSENSITIVE); |
| - public static final Pattern RE_FILTER_META = Pattern.compile("^\\s*!\\s*(\\w+)\\s*:\\s*(.*)"); |
| - public static final Pattern RE_FILTER_ELEMHIDE = Pattern |
| - .compile("^([^\\/\\*\\|\\@\"!]*?)#(\\@)?(?:([\\w\\-]+|\\*)((?:\\([\\w\\-]+(?:[$^*]?=[^\\(\\)\"]*)?\\))*)|#([^{}]+))$"); |
| - public static final Pattern RE_FILTER_REGEXP = Pattern |
| - .compile("^(@@)?\\/.*\\/(?:\\$~?[\\w\\-]+(?:=[^,\\s]+)?(?:,~?[\\w\\-]+(?:=[^,\\s]+)?)*)?$"); |
| - public static final Pattern RE_FILTER_OPTIONS = Pattern |
| - .compile("\\$(~?[\\w\\-]+(?:=[^,\\s]+)?(?:,~?[\\w\\-]+(?:=[^,\\s]+)?)*)$"); |
| - public static final Pattern RE_FILTER_CSSPROPERTY = Pattern |
| - .compile("\\[\\-abp\\-properties=([\"'])([^\"']+)\\1\\]"); |
| - |
| public static final String USER_FILTERS_TITLE = "__filters"; |
| public static final String USER_EXCEPTIONS_TITLE = "__exceptions"; |
| public static final String SBROWSER_APP_ID = "com.sec.android.app.sbrowser"; |
| public static final String ACTION_OPEN_SETTINGS = "com.samsung.android.sbrowser.contentBlocker.ACTION_SETTING"; |
| public static final String ACTION_UPDATE = "com.samsung.android.sbrowser.contentBlocker.ACTION_UPDATE"; |
| public static final String EASYLIST_URL = "https://easylist-downloads.adblockplus.org/easylist.txt"; |
| @@ -532,17 +517,16 @@ public final class Engine |
| final URI uri = new URI(url); |
| final String host = uri.getHost() != null ? uri.getHost() : uri.getPath(); |
| w.write("@@||" + host + "^$document"); |
| w.write('\n'); |
| } |
| catch (URISyntaxException e) |
| { |
| Log.w(TAG, "Failed to parse whitelisted website: " + url); |
| - continue; |
| } |
| } |
| } |
| } |
| private static File getCachedFilterFile(Context context) |
| { |
| final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); |