Skip to content

Commit

Permalink
Merge branch 'master' into prod
Browse files Browse the repository at this point in the history
  • Loading branch information
artemiv4nov committed Oct 23, 2019
2 parents 173f7c0 + b7d60d8 commit 32ce283
Show file tree
Hide file tree
Showing 37 changed files with 96 additions and 99 deletions.
4 changes: 2 additions & 2 deletions adguard_cb/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ android {
minSdkVersion 21
targetSdkVersion 28
applicationId 'com.adguard.android.contentblocker'
versionCode 22000004
versionName '2.5.3'
versionCode 22000006
versionName '2.5.5'
signingConfig signingConfigs.config
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,10 @@
*/
public class BrowserUtils {

public static final String YANDEX = "yandex";
public static final String SAMSUNG = "samsung";
private static boolean dialogAboutChromeShowed = false;

private static final String YANDEX = "yandex";
private static final String SAMSUNG = "samsung";

public static final String YANDEX_BROWSER_PACKAGE = "com.yandex.browser";
public static final String SAMSUNG_BROWSER_PACKAGE = "com.sec.android.app.sbrowser";
Expand All @@ -72,7 +74,6 @@ public class BrowserUtils {

private static final List<String> yandexBrowserPackageList = new ArrayList<>();
private static final List<String> samsungBrowserPackageList = new ArrayList<>();
public static final String TAG = "BrowserUtils";

static {
yandexBrowserPackageList.add("com.yandex.browser");
Expand Down Expand Up @@ -204,9 +205,15 @@ public static boolean isYandexBrowserAvailable(Context context) {
@SuppressLint("InflateParams")
public static void showBrowserInstallDialog(final Context context) {
View dialogLayout = LayoutInflater.from(context).inflate(R.layout.select_browser_dialog, null);
dialogAboutChromeShowed = false;

final AlertDialog dialog = new AlertDialog.Builder(context, R.style.AlertDialog)
.setNegativeButton(android.R.string.cancel, null)
.setNegativeButton(android.R.string.cancel, (dialog1, which) -> {
dialog1.dismiss();
if (!dialogAboutChromeShowed) {
showProductsDialog(context, true);
}
})
.setView(dialogLayout).create();

View browserItem = dialogLayout.findViewById(R.id.browser_yandex);
Expand All @@ -222,32 +229,35 @@ public static void showBrowserInstallDialog(final Context context) {
});

dialogLayout.findViewById(R.id.others_product_card).setOnClickListener(v -> {
showProductsDialog(context);
showProductsDialog(context, false);
});

dialog.show();
centerDialogButton(dialog);
}

@SuppressLint("InflateParams")
private static void showProductsDialog(final Context context) {
private static void showProductsDialog(final Context context, boolean hideProductsButton) {
View dialogLayout = LayoutInflater.from(context).inflate(R.layout.products_dialog, null);

final AlertDialog dialog = new AlertDialog.Builder(context, R.style.AlertDialog)
.setNegativeButton(R.string.back, null)
.setNegativeButton(hideProductsButton ? R.string.close : R.string.back, null)
.setView(dialogLayout).create();

TextView textView = dialogLayout.findViewById(R.id.dialog_text);
textView.setText(Html.fromHtml(context.getString(R.string.chrome_dialog_text)));
textView.setText(Html.fromHtml(context.getString(R.string.chrome_dialog_text) + "<br/><br/>" + context.getString(R.string.select_browser_dialog_adguard_products_message)));
textView.setMovementMethod(LinkMovementMethod.getInstance());

dialogLayout.findViewById(R.id.go_to_products).setOnClickListener(v -> {
View productsButton = dialogLayout.findViewById(R.id.go_to_products);
productsButton.setOnClickListener(v -> {
String url = AppLink.Website.getOtherProductUrl(context, "chrome_dialog");
NavigationHelper.openWebSite(context, url);
});
productsButton.setVisibility(hideProductsButton ? View.GONE : View.VISIBLE);

dialog.show();
centerDialogButton(dialog);
dialogAboutChromeShowed = true;
}

public static void startYandexBrowser(Context context) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.adguard.android.contentblocker.service.NotificationService;
import com.adguard.android.contentblocker.service.PreferencesService;

import java.util.Calendar;
import java.util.concurrent.TimeUnit;

/**
Expand Down Expand Up @@ -49,10 +50,17 @@ class ShowRateNotificationImpl extends AbstractJob {
Id.RATE_NOTIFICATION,
() -> {
int count = preferencesService.getRateAppDialogCount();
if (count >= MAX_RATE_DIALOG_COUNT) {
if (count >= MAX_RATE_DIALOG_COUNT || preferencesService.isAppRated()) {
jobService.cancelJobs(Id.RATE_NOTIFICATION);
return true;
}

// We check the current time and do not send the notification between 10pm and 7am
int currentHour = Calendar.getInstance().get(Calendar.HOUR_OF_DAY);
if (currentHour >= 22 || currentHour <= 7) {
return false;
}

// First show is scheduled 24 hours after installation
// Second show is scheduled 7 days after installation
long flexPeriod = count == 0 ? FIRST_FLEX_PERIOD : SECOND_FLEX_PERIOD;
Expand Down
3 changes: 1 addition & 2 deletions adguard_cb/src/main/res/values-ar/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
<string name="please_wait">الرجاء الانتظار...</string>
<string name="main_info">هذا التطبيق هو امتداد للمتصفحات التي تدعم حظر المحتوى.\n:يوجد حاليًا متصفحان من هذا القبيل\n\n1. متصفح الإنترنت سامسونج\n2. المتصفح ياندكس\n\nبمساعدة هذا التطبيق ، يمكنك حظر جميع الإعلانات في هذه المتصفحات\nكما يمكنك تحديد المرشحات لاستخدامها في الإعدادات.</string>
<string name="progressGenericErrorText">! حدث خطا ما</string>
<string name="importUserRulesSuccessResultMessage">{0}!تم استيراد الفلتر بنجاح</string>
<string name="importUserRulesErrorResultMessage">! خطا في استيراد الفلاتر</string>
<string name="importUserRulesProgressDialogTitle">الاستيراد قيد التقدم</string>
<string name="importUserRulesProgressDialogMessage">يتم الآن تحميل...</string>
<string name="checkUpdatesProgressDialogTitle">التحقق من التحديثات</string>
Expand Down Expand Up @@ -99,4 +97,5 @@
<string name="go_to_products">الذهاب إلى المنتجات</string>
<string name="select_browser_dialog_adguard_products_title">ليس تماما ما تحتاجه؟</string>
<string name="select_browser_dialog_adguard_products_message">الأخرى على موقعنا AdGuard تحقق من منتجات</string>
<string name="import_dialog_hint">أو مسارURLعنوان</string>
</resources>
2 changes: 0 additions & 2 deletions adguard_cb/src/main/res/values-be/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
<string name="please_wait">Калі ласка пачакайце...</string>
<string name="main_info">Гэты дадатак з\'яўляецца пашырэннем для браўзараў, што падтрымваюць блакаванне кантэнту.\n\nУ гэты час існуе два такія браўзары:\n\n1. Samsung Internet Browser\n2. Браўзар Яндэкса\n\nЗ дапамогай гэтага дадатку вы можаце заблакаваць усе рэкламныя аб\'явы ў гэтых браўзарах.\n\nАпроч таго, вы можаце выбраць, якія фільтры выкарыстоўваць у наладах.</string>
<string name="progressGenericErrorText">Адбылася нейкая памылка!</string>
<string name="importUserRulesSuccessResultMessage">{0} фільтр(-аў) паспяхова імпартаваны!</string>
<string name="importUserRulesErrorResultMessage">Памылка імпарту фільтраў!</string>
<string name="importUserRulesProgressDialogTitle">Імпартаванне ў працэсе</string>
<string name="importUserRulesProgressDialogMessage">Загрузка...</string>
<string name="checkUpdatesProgressDialogTitle">Праверка абнаўленняў</string>
Expand Down
2 changes: 0 additions & 2 deletions adguard_cb/src/main/res/values-bg/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
<string name="please_wait">Моля, изчакайте...</string>
<string name="main_info">Това приложение е разширение за браузъри, които поддържат блокиране на съдържание.\n\nВ момента има два такива браузъра:\n\n1. Интернет браузър на Samsung\n2. Yandex браузър\n\nС помощта на това приложение можете да блокирате всички реклами в тези браузъри.\n\nСъщо така, можете да изберете кои филтри да използвате в Настройки.</string>
<string name="progressGenericErrorText">Възьникна някаква грешка!</string>
<string name="importUserRulesSuccessResultMessage">{0} филтър(а) е(са) импортиран(и) успешно!</string>
<string name="importUserRulesErrorResultMessage">Грешка при импортиране на филтри!</string>
<string name="importUserRulesProgressDialogTitle">В ход е импортиране</string>
<string name="importUserRulesProgressDialogMessage">Зареждане…</string>
<string name="checkUpdatesProgressDialogTitle">Проверка за ъпдейти</string>
Expand Down
2 changes: 0 additions & 2 deletions adguard_cb/src/main/res/values-bn/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
<string name="please_wait">অনুগ্রহপূর্বক অপেক্ষা করুন...</string>
<string name="main_info">এই অ্যাপ্লিকেশন ব্রাউজারের জন্য একটি এক্সটেনশন যা কন্টেন্ট বা বিজ্ঞাপন ব্লক করতে সাহায্য করে।\n\nবর্তমানে দুটি ব্রাউজার আছে:\n\n১. স্যামসাং ইন্টারনেট ব্রাউজার\n২. ইয়ান্ডেক্স ব্রাউজার\n\nএই অ্যাপ্লিকেশনের সাহায্যে, আপনি এই ব্রাউজারগুলির সমস্ত বিজ্ঞাপনগুলিকে ব্লক করতে পারবেন।\n\nএছাড়াও, আপনি সেটিংস ব্যবহার করে যে কোন ফিল্টার নির্বাচন করতে পারবেন।</string>
<string name="progressGenericErrorText">কিছু ত্রুটি ঘটেছে!</string>
<string name="importUserRulesSuccessResultMessage">{0} টি ফিল্টার সফলভাবে ইমপোর্ট করা হয়েছে!</string>
<string name="importUserRulesErrorResultMessage">ফিল্টার ইমপোর্ট করার সময় ত্রুটি!</string>
<string name="importUserRulesProgressDialogTitle">ইমপোর্ট প্রক্রিয়া চলছে</string>
<string name="importUserRulesProgressDialogMessage">লোড হচ্ছে ...</string>
<string name="checkUpdatesProgressDialogTitle">আপডেটের জন্য চেক করা হচ্ছে</string>
Expand Down
8 changes: 5 additions & 3 deletions adguard_cb/src/main/res/values-cs/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<string name="please_wait">Prosím čekejte...</string>
<string name="main_info">Tato aplikace je rozšířením pro prohlížeče, které podporují blokování obsahu.\n\nMomentálně jsou zde 2 takové prohlížeče:\n\n1. Samsung Internet Browser\n2. Yandex Browser\n\nS pomocí této aplikace můžete blokovat všechny reklamy v těchto prohlížečích.\n\nZároveň si můžete v Nastavení zvolit, které filtry chcete používat.</string>
<string name="progressGenericErrorText">Vyskytla se nějaká chyba!</string>
<string name="importUserRulesSuccessResultMessage">{0} filtrů bylo úspěšně naimportováno!</string>
<string name="importUserRulesErrorResultMessage">Chyba při importu filtrů!</string>
<string name="importUserRulesSuccessResultMessage">Úspěšně naimportovaných pravidel filtrování: {0}</string>
<string name="importUserRulesErrorResultMessage">Chyba při exportu pravidel filtrování!</string>
<string name="importUserRulesProgressDialogTitle">Probíhá import</string>
<string name="importUserRulesProgressDialogMessage">Načítám...</string>
<string name="checkUpdatesProgressDialogTitle">Kontroluji aktualizace</string>
Expand Down Expand Up @@ -82,7 +82,7 @@
<string name="rate_app_notification_title">Ohodnoťte nás</string>
<string name="notification_channel_rate_name">Hodnocení</string>
<string name="notification_channel_rate_description">Oznámení o hodnocení aplikace</string>
<string name="rate_app_summary">Užíváte si Blokátor obsahu AdGuard? Dejte nám 5 hvězd v Obchodě Play</string>
<string name="rate_app_summary">Užíváte si Blokátor obsahu AdGuard? Ohodnoťte nás v Obchodě Play</string>
<string name="confirmClearUserFilterMessage">Opravdu chcete vyčistit uživatelský filtr? Tato operace nemůže být vrácena.</string>
<string name="confirmRemoveUserRuleMessage">Opravdu chcete smazat toto pravidlo? Tato operace nemůže být vrácena.</string>
<string name="clear_filters_cache_title">Vyčistit cache filtrů</string>
Expand Down Expand Up @@ -112,4 +112,6 @@
<string name="chrome_dialog_title">Chcete blokovat reklamy v Chrome?</string>
<string name="chrome_dialog_text"><![CDATA[Od roku 2019 Chrome pro Android nepodporuje žádná rozšíření nebo aplikace pro blokování reklam.\nMůžete požádat vývojáře prohlížeče Chrome, aby přidali podporu pro AdGuard a další blokátory obsahu. Chcete-li tak učinit, navštivte <a href="https://bugs.chromium.org/p/chromium/issues/detail?id=113111">Chrome bug tracker</a> a upozorněte na problém.]]></string>
<string name="back">Zpět</string>
<string name="close">Zavřít</string>
<string name="import_dialog_hint">URL nebo cesta</string>
</resources>
8 changes: 5 additions & 3 deletions adguard_cb/src/main/res/values-da/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<string name="please_wait">Vent venligst...</string>
<string name="main_info">Dette program er en udvidelse til browsere som understøtter indholdsblokering.\nDer er i øjeblikket således to browsere:\n1. Samsung Internet Browser\n2. Yandex Browser\nMed hjælp af dette program kan du blokere alle reklamer i disse browsere.\nDu kan også vælge i Indstillinger, hvilke filtre der skal bruges.</string>
<string name="progressGenericErrorText">Nogle fejl opstod!</string>
<string name="importUserRulesSuccessResultMessage">{0} filter(filtre) importeret succesfuldt!</string>
<string name="importUserRulesErrorResultMessage">Fejl ved importering af filtre!</string>
<string name="importUserRulesSuccessResultMessage">{0} filterregel(regler) importeret succesfuldt!</string>
<string name="importUserRulesErrorResultMessage">Fejl ved importering af filterregel!</string>
<string name="importUserRulesProgressDialogTitle">Fremskridt af importering</string>
<string name="importUserRulesProgressDialogMessage">Indlæser...</string>
<string name="checkUpdatesProgressDialogTitle">Søger efter opdateringer</string>
Expand Down Expand Up @@ -82,7 +82,7 @@
<string name="rate_app_notification_title">Bedøm os</string>
<string name="notification_channel_rate_name">Anmeldelser</string>
<string name="notification_channel_rate_description">Meddelelser om app-anmeldelser</string>
<string name="rate_app_summary">Nyder du AdGuard Indholdsblocker? Giv os 5 stjerner på Google Play</string>
<string name="rate_app_summary">Nyder du AdGuard Indholdsblocker? Bedøm os på Google Play</string>
<string name="confirmClearUserFilterMessage">Er du sikker på, at du vil rydde brugerfiltret? Denne handling kan ikke fortrydes.</string>
<string name="confirmRemoveUserRuleMessage">Er du sikker på, at du vil slette denne regel? Denne handling kan ikke fortrydes.</string>
<string name="clear_filters_cache_title">Ryd filtercache</string>
Expand Down Expand Up @@ -112,4 +112,6 @@
<string name="chrome_dialog_title">Vil du gerne blokere annoncer i Chrome?</string>
<string name="chrome_dialog_text"><![CDATA[Fra og med 2019 understøtter Chrome til Android ikke nogen adblocking udvidelser eller apps.\nDu kan opfordre Chrome-udviklerne til at tilføje support til AdGuard og andre indholdsblockere. For at gøre dette, skal du besøge <a href="https://bugs.chromium.org/p/chromium/issues/detail?id=113111">Chrome bug tracker</a> og upvote problemet.]]></string>
<string name="back">Tilbage</string>
<string name="close">Luk</string>
<string name="import_dialog_hint">URL eller sti</string>
</resources>
7 changes: 4 additions & 3 deletions adguard_cb/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
<string name="please_wait">Bitte warten...</string>
<string name="main_info">Diese Anwendung ist eine Erweiterung für Internet-Browser, die das Blockieren von Inhalten unterstützen.\n\nAktuell gibt es zwei Browser:\n\n1. Samsung Internet-Browser\n2. Yandex Browser\n\nMit Hilfe dieser Anwendung können Sie alle Werbungen in diesen Browsern blockieren.\n\nZusätzlich können Sie in den Einstellungen auswählen, welche Filter Sie nutzen wollen.</string>
<string name="progressGenericErrorText">Ein Fehler ist aufgetreten!</string>
<string name="importUserRulesSuccessResultMessage">{0} Filter erfolgreich importiert!</string>
<string name="importUserRulesErrorResultMessage">Fehler beim Importieren der Filter!</string>
<string name="importUserRulesSuccessResultMessage">{0} Filter-Regel(n) erfolgreich importiert!</string>
<string name="importUserRulesProgressDialogTitle">Importvorgang läuft</string>
<string name="importUserRulesProgressDialogMessage">Laden...</string>
<string name="checkUpdatesProgressDialogTitle">Auf Updates prüfen</string>
Expand Down Expand Up @@ -82,7 +81,7 @@
<string name="rate_app_notification_title">Bewerten Sie uns</string>
<string name="notification_channel_rate_name">Bewertungen</string>
<string name="notification_channel_rate_description">Benachrichtigungen über die App-Bewertungen</string>
<string name="rate_app_summary">Gefällt Ihnen AdGuard-Inhaltsblocker? Bewerten Sie uns mit 5 Sternen auf Google Play</string>
<string name="rate_app_summary">Gefällt Ihnen AdGuard-Inhaltsblocker? Bewerten Sie uns auf Google Play</string>
<string name="confirmClearUserFilterMessage">Möchten Sie den eigenen Filter wirklich entfernen? Dieser Vorgang kann nicht widerrufen werden.</string>
<string name="confirmRemoveUserRuleMessage">Möchten Sie diese Regel wirklich löschen? Dieser Vorgang kann nicht widerrufen werden.</string>
<string name="clear_filters_cache_title">Filtercache leeren</string>
Expand Down Expand Up @@ -113,4 +112,6 @@
<string name="chrome_dialog_title">Möchten Sie Werbung in Chrome blockieren?</string>
<string name="chrome_dialog_text"><![CDATA[Ab 2019 unterstützt Chrome für Android keine Erweiterungen oder Apps mehr zum Blockieren von Werbung.\nSie können Chrome-Entwickler auffordern, eine Unterstützung für AdGuard und andere Inhaltsblocker hinzuzufügen. Besuchen Sie dazu die Seite <a href="https://bugs.chromium.org/p/chromium/issues/detail?id=113111">Chrome Bug Tracker</a> und votieren Sie dafür.]]></string>
<string name="back">Zurück</string>
<string name="close">Schließen</string>
<string name="import_dialog_hint">URL oder Pfad</string>
</resources>
Loading

0 comments on commit 32ce283

Please sign in to comment.