| LEFT | RIGHT |
| 1 /* | 1 /* |
| 2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
| 3 * Copyright (C) 2006-2016 Eyeo GmbH | 3 * Copyright (C) 2006-2016 Eyeo GmbH |
| 4 * | 4 * |
| 5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
| 6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
| 7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
| 8 * | 8 * |
| 9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 public static final Pattern RE_FILTER_REGEXP = Pattern | 73 public static final Pattern RE_FILTER_REGEXP = Pattern |
| 74 .compile("^(@@)?\\/.*\\/(?:\\$~?[\\w\\-]+(?:=[^,\\s]+)?(?:,~?[\\w\\-]+(?:=
[^,\\s]+)?)*)?$"); | 74 .compile("^(@@)?\\/.*\\/(?:\\$~?[\\w\\-]+(?:=[^,\\s]+)?(?:,~?[\\w\\-]+(?:=
[^,\\s]+)?)*)?$"); |
| 75 public static final Pattern RE_FILTER_OPTIONS = Pattern | 75 public static final Pattern RE_FILTER_OPTIONS = Pattern |
| 76 .compile("\\$(~?[\\w\\-]+(?:=[^,\\s]+)?(?:,~?[\\w\\-]+(?:=[^,\\s]+)?)*)$")
; | 76 .compile("\\$(~?[\\w\\-]+(?:=[^,\\s]+)?(?:,~?[\\w\\-]+(?:=[^,\\s]+)?)*)$")
; |
| 77 public static final Pattern RE_FILTER_CSSPROPERTY = Pattern | 77 public static final Pattern RE_FILTER_CSSPROPERTY = Pattern |
| 78 .compile("\\[\\-abp\\-properties=([\"'])([^\"']+)\\1\\]"); | 78 .compile("\\[\\-abp\\-properties=([\"'])([^\"']+)\\1\\]"); |
| 79 | 79 |
| 80 public static final String USER_FILTERS_TITLE = "__filters"; | 80 public static final String USER_FILTERS_TITLE = "__filters"; |
| 81 public static final String USER_EXCEPTIONS_TITLE = "__exceptions"; | 81 public static final String USER_EXCEPTIONS_TITLE = "__exceptions"; |
| 82 | 82 |
| 83 public static final String SBROWSER_APP_ID = "com.sec.android.app.sbrowser"; |
| 83 public static final String ACTION_OPEN_SETTINGS = "com.samsung.android.sbrowse
r.contentBlocker.ACTION_SETTING"; | 84 public static final String ACTION_OPEN_SETTINGS = "com.samsung.android.sbrowse
r.contentBlocker.ACTION_SETTING"; |
| 84 public static final String ACTION_UPDATE = "com.samsung.android.sbrowser.conte
ntBlocker.ACTION_UPDATE"; | 85 public static final String ACTION_UPDATE = "com.samsung.android.sbrowser.conte
ntBlocker.ACTION_UPDATE"; |
| 85 public static final String EASYLIST_URL = "https://easylist-downloads.adblockp
lus.org/easylist.txt"; | 86 public static final String EASYLIST_URL = "https://easylist-downloads.adblockp
lus.org/easylist.txt"; |
| 86 | 87 |
| 87 public static final String SUBSCRIPTIONS_EXCEPTIONSURL = "subscriptions_except
ionsurl"; | 88 public static final String SUBSCRIPTIONS_EXCEPTIONSURL = "subscriptions_except
ionsurl"; |
| 88 | 89 |
| 89 public static final String CHARSET_UTF_8 = "UTF-8"; | 90 public static final String CHARSET_UTF_8 = "UTF-8"; |
| 90 private static final String PREFS_KEY_PREVIOUS_VERSION = "key_previous_version
"; | 91 private static final String PREFS_KEY_PREVIOUS_VERSION = "key_previous_version
"; |
| 91 | 92 |
| 92 // The value below specifies an interval of [x, 2*x[, where x = | 93 // The value below specifies an interval of [x, 2*x[, where x = |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 * Starting with Samsung Internet 5.0, the way to enable ad blocking has chang
ed. As a result, we | 170 * Starting with Samsung Internet 5.0, the way to enable ad blocking has chang
ed. As a result, we |
| 170 * need to check for the version of Samsung Internet and apply text changes to
the first run slide. | 171 * need to check for the version of Samsung Internet and apply text changes to
the first run slide. |
| 171 * | 172 * |
| 172 * @param activityContext | 173 * @param activityContext |
| 173 * @return a boolean that indicates, if the user has Samsung Internet version
5.x | 174 * @return a boolean that indicates, if the user has Samsung Internet version
5.x |
| 174 */ | 175 */ |
| 175 public static boolean hasSamsungInternetVersion5OrNewer(final Context activity
Context) | 176 public static boolean hasSamsungInternetVersion5OrNewer(final Context activity
Context) |
| 176 { | 177 { |
| 177 try | 178 try |
| 178 { | 179 { |
| 179 PackageInfo packageInfo = activityContext.getPackageManager().getPackageIn
fo(MainPreferences.SBROWSER_APP_ID, NO_FLAG); | 180 PackageInfo packageInfo = activityContext.getPackageManager().getPackageIn
fo(SBROWSER_APP_ID, NO_FLAG); |
| 180 return packageInfo.versionCode >= OLDEST_SAMSUNG_INTERNET_5_VERSIONCODE; | 181 return packageInfo.versionCode >= OLDEST_SAMSUNG_INTERNET_5_VERSIONCODE; |
| 181 } | 182 } |
| 182 catch (PackageManager.NameNotFoundException e) | 183 catch (PackageManager.NameNotFoundException e) |
| 183 { | 184 { |
| 184 // Should never happen, as checkAAStatusAndProceed() should not be called
if the user | 185 // Should never happen, as checkAAStatusAndProceed() should not be called
if the user |
| 185 // has no compatible SBrowser installed. Nevertheless we have to handle th
e Exception. | 186 // has no compatible SBrowser installed. Nevertheless we have to handle th
e Exception. |
| 186 Log.d(TAG, "No compatible Samsung Browser found.", e); | 187 Log.d(TAG, "No compatible Samsung Browser found.", e); |
| 187 return false; | 188 return false; |
| 188 } | 189 } |
| 189 } | 190 } |
| (...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 799 Log.d(TAG, headers.toString()); | 800 Log.d(TAG, headers.toString()); |
| 800 this.downloader.enqueueDownload(this.createDownloadURL(sub), sub.getId(),
headers); | 801 this.downloader.enqueueDownload(this.createDownloadURL(sub), sub.getId(),
headers); |
| 801 } | 802 } |
| 802 } | 803 } |
| 803 | 804 |
| 804 public void connectivityChanged() | 805 public void connectivityChanged() |
| 805 { | 806 { |
| 806 this.downloader.connectivityChanged(); | 807 this.downloader.connectivityChanged(); |
| 807 } | 808 } |
| 808 } | 809 } |
| LEFT | RIGHT |