From 1b7c94ec9859adfd5c75001b9d423b53301289d6 Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 5 Jul 2014 11:04:12 +0200 Subject: [PATCH] Added option to blacklist applications, accounts and contacts Closes #1781 --- CHANGELOG.md | 1 + res/layout/settings.xml | 6 ++++++ res/values-ar/strings.xml | 1 + res/values-bg/strings.xml | 1 + res/values-ca/strings.xml | 1 + res/values-cs/strings.xml | 1 + res/values-da/strings.xml | 1 + res/values-de/strings.xml | 1 + res/values-ee/strings.xml | 1 + res/values-el/strings.xml | 1 + res/values-es/strings.xml | 1 + res/values-fa/strings.xml | 1 + res/values-fi/strings.xml | 1 + res/values-fr/strings.xml | 1 + res/values-ga/strings.xml | 1 + res/values-he/strings.xml | 1 + res/values-hi/strings.xml | 1 + res/values-hu/strings.xml | 1 + res/values-it/strings.xml | 1 + res/values-iw/strings.xml | 1 + res/values-ja/strings.xml | 1 + res/values-ku-rIQ/strings.xml | 1 + res/values-ku-rIR/strings.xml | 1 + res/values-lt/strings.xml | 1 + res/values-ms/strings.xml | 1 + res/values-nb-rNO/strings.xml | 1 + res/values-nl/strings.xml | 1 + res/values-nn-rNO/strings.xml | 1 + res/values-no-rNO/strings.xml | 1 + res/values-pl/strings.xml | 1 + res/values-pt/strings.xml | 1 + res/values-ro/strings.xml | 1 + res/values-ru/strings.xml | 1 + res/values-sk/strings.xml | 1 + res/values-sl/strings.xml | 1 + res/values-sr/strings.xml | 1 + res/values-sv/strings.xml | 1 + res/values-tl-rPH/strings.xml | 1 + res/values-tr/strings.xml | 1 + res/values-ua/strings.xml | 1 + res/values-vi/strings.xml | 1 + res/values-zh-rCN/strings.xml | 1 + res/values-zh-rTW/strings.xml | 1 + res/values/strings.xml | 1 + src/biz/bokhorst/xprivacy/PrivacyManager.java | 1 + src/biz/bokhorst/xprivacy/SettingsDialog.java | 11 +++++++++++ src/biz/bokhorst/xprivacy/XAccountManager.java | 10 +++++++--- src/biz/bokhorst/xprivacy/XContentResolver.java | 11 +++++++++-- src/biz/bokhorst/xprivacy/XPackageManager.java | 6 +++++- tools/addstring.sh | 6 +++--- 50 files changed, 85 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 299ee8ae8..4919241c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ Changelog **Next release** * Added option to specify file name to import/export intent ([issue](/../../issues/1784)) +* Added option to blacklist applications, accounts and contacts ([issue](/../../issues/1781)) * Updated Japanese translation * Updated Slovenian translation diff --git a/res/layout/settings.xml b/res/layout/settings.xml index 445130f4c..7c8f12c55 100644 --- a/res/layout/settings.xml +++ b/res/layout/settings.xml @@ -58,6 +58,12 @@ android:layout_height="wrap_content" android:text="@string/settings_ondemand" /> + + بيانات وهمية تحديث الإشعارات تقييد عند الطلب + Blacklist accounts, applications and contacts سِجِل تصحيح الأخطاء (يتطلب إعادة التشغيل) وضع الخبراء الحد الأقصى لجلب فترة الثقة diff --git a/res/values-bg/strings.xml b/res/values-bg/strings.xml index f1b0a3b84..3bde2ba9f 100644 --- a/res/values-bg/strings.xml +++ b/res/values-bg/strings.xml @@ -168,6 +168,7 @@ Fake data Update notifications Restrict on demand + Blacklist accounts, applications and contacts Debug log (requires restart) Expert mode Maximum fetch confidence interval diff --git a/res/values-ca/strings.xml b/res/values-ca/strings.xml index e089034f5..2656a0092 100644 --- a/res/values-ca/strings.xml +++ b/res/values-ca/strings.xml @@ -166,6 +166,7 @@ Fake data Update notifications Restrict on demand + Blacklist accounts, applications and contacts Registre de depuració (cal reiniciar) Expert mode Maximum fetch confidence interval diff --git a/res/values-cs/strings.xml b/res/values-cs/strings.xml index d61af1ea1..442fdecea 100644 --- a/res/values-cs/strings.xml +++ b/res/values-cs/strings.xml @@ -168,6 +168,7 @@ nicméně je nemožné zaručit bezchybnou funkčnost na všech zařízeních a Falešné údaje Upozorňovat při aktualizacích aplikací Restrict on demand + Blacklist accounts, applications and contacts Ukládat ladící záznam (vyžaduje restart) Režim experta Maximální rozsah spolehlivosti stahování diff --git a/res/values-da/strings.xml b/res/values-da/strings.xml index 229ab309f..1523237b8 100644 --- a/res/values-da/strings.xml +++ b/res/values-da/strings.xml @@ -166,6 +166,7 @@ Fake data Updaterings notifikationer Begræns on-demand + Blacklist accounts, applications and contacts Debug-log (kræver genstart) Ekspert tilstand Maximum fetch confidence interval diff --git a/res/values-de/strings.xml b/res/values-de/strings.xml index a8acad4dd..94cef2541 100644 --- a/res/values-de/strings.xml +++ b/res/values-de/strings.xml @@ -168,6 +168,7 @@ dass es einwandfrei auf wirklich JEDEM einzelnen Gerät und für JEDE einzelne A Daten manipulieren Update-Benachrichtigungen Beschränkungen nach Aufforderung festlegen + Blacklist accounts, applications and contacts Debug-Log (erfordert Geräteneustart) Experten-Modus Maximales Abruf-Konfidenzintervall diff --git a/res/values-ee/strings.xml b/res/values-ee/strings.xml index f581142bb..c371ac5d7 100644 --- a/res/values-ee/strings.xml +++ b/res/values-ee/strings.xml @@ -168,6 +168,7 @@ kuid on võimatu garanteerida, et see töötab igal seadmel ja iga rakendusega. Fake data Update notifications Restrict on demand + Blacklist accounts, applications and contacts Silumislogi (nõuab restarti) Expert mode Maximum fetch confidence interval diff --git a/res/values-el/strings.xml b/res/values-el/strings.xml index 9a24bd42b..1d3250c85 100644 --- a/res/values-el/strings.xml +++ b/res/values-el/strings.xml @@ -168,6 +168,7 @@ Fake data Update notifications Restrict on demand + Blacklist accounts, applications and contacts Debug log (requires restart) Expert mode Maximum fetch confidence interval diff --git a/res/values-es/strings.xml b/res/values-es/strings.xml index 101f95e09..1e4287efe 100644 --- a/res/values-es/strings.xml +++ b/res/values-es/strings.xml @@ -168,6 +168,7 @@ sin embargo no puedo garantizar que funcione sin ningún fallo para cada disposi Datos falsos Notificaciones de actualización Restringir en demanda + Blacklist accounts, applications and contacts Registro de depuración (requiere inicio) Modo experto Intervalo de confianza para bajar restricciones diff --git a/res/values-fa/strings.xml b/res/values-fa/strings.xml index e27025fa1..1ca8a15cb 100644 --- a/res/values-fa/strings.xml +++ b/res/values-fa/strings.xml @@ -170,6 +170,7 @@ Fake data Update notifications Restrict on demand + Blacklist accounts, applications and contacts لاگ ایرادیابی (نیازمند دوباره راه اندازی می باشد) Expert mode Maximum fetch confidence interval diff --git a/res/values-fi/strings.xml b/res/values-fi/strings.xml index 1b3d975c5..52a67d4ed 100644 --- a/res/values-fi/strings.xml +++ b/res/values-fi/strings.xml @@ -167,6 +167,7 @@ Fake data Päivitä ilmoitukset Restrict on demand + Blacklist accounts, applications and contacts Debuggaus logi (vaatii uudelleenkäynnistyksen) Expert tila Maximum fetch confidence interval diff --git a/res/values-fr/strings.xml b/res/values-fr/strings.xml index 5728366d3..651b44248 100644 --- a/res/values-fr/strings.xml +++ b/res/values-fr/strings.xml @@ -168,6 +168,7 @@ il est impossible de garantir un fonctionnement parfait sur chaque appareil et p Fausses données Notifications de MàJ Restrictions sur demande + Blacklist accounts, applications and contacts Debug log (redémarrage requis) Mode expert Intervalle de confiance maximum diff --git a/res/values-ga/strings.xml b/res/values-ga/strings.xml index 327bc9668..d3015014f 100644 --- a/res/values-ga/strings.xml +++ b/res/values-ga/strings.xml @@ -168,6 +168,7 @@ Fake data Update notifications Restrict on demand + Blacklist accounts, applications and contacts logáil Debug (Éilíonn atosú) Expert mode Maximum fetch confidence interval diff --git a/res/values-he/strings.xml b/res/values-he/strings.xml index 58a7364c1..d9b66a8f9 100644 --- a/res/values-he/strings.xml +++ b/res/values-he/strings.xml @@ -168,6 +168,7 @@ however it is impossible to guarantee it will work flawless on each and every de Fake data Update notifications Restrict on demand + Blacklist accounts, applications and contacts Debug log (requires restart) Expert mode Maximum fetch confidence interval diff --git a/res/values-hi/strings.xml b/res/values-hi/strings.xml index 914af5cea..89509f337 100644 --- a/res/values-hi/strings.xml +++ b/res/values-hi/strings.xml @@ -168,6 +168,7 @@ नकली डेटा अद्यतन सुचना Restrict on demand + Blacklist accounts, applications and contacts Debug log (पुनरारंभ जरूरी) विशेषज्ञ mode अधिकतम विश्वसनीय fetch अंतराल diff --git a/res/values-hu/strings.xml b/res/values-hu/strings.xml index 1885db47d..ec7196a1e 100644 --- a/res/values-hu/strings.xml +++ b/res/values-hu/strings.xml @@ -168,6 +168,7 @@ de lehetetlen garantálni hogy tökéletesen működjön az összes eszközön Kamu adat Értesítések frissítése Restrict on demand + Blacklist accounts, applications and contacts Debug log (újraindítás szükséges) Szakértői mód Maximum fetch confidence interval diff --git a/res/values-it/strings.xml b/res/values-it/strings.xml index ec9529dcd..4f8381608 100644 --- a/res/values-it/strings.xml +++ b/res/values-it/strings.xml @@ -168,6 +168,7 @@ tuttavia non è possibile garantire che funzioni perfettamente su qualunque disp Dati alterati Notifiche di aggiornamento Restringi su richiesta + Blacklist accounts, applications and contacts Registro errori (richiede riavvio) Modalità esperto Intervallo massimo di confidenza nella ricezione diff --git a/res/values-iw/strings.xml b/res/values-iw/strings.xml index 8edd0ff4f..88b56849f 100644 --- a/res/values-iw/strings.xml +++ b/res/values-iw/strings.xml @@ -168,6 +168,7 @@ however it is impossible to guarantee it will work flawless on each and every de Fake data Update notifications Restrict on demand + Blacklist accounts, applications and contacts Debug log (requires restart) Expert mode Maximum fetch confidence interval diff --git a/res/values-ja/strings.xml b/res/values-ja/strings.xml index 195ca6018..a15d1d87b 100644 --- a/res/values-ja/strings.xml +++ b/res/values-ja/strings.xml @@ -166,6 +166,7 @@ データ偽装 アプリ更新の際に通知する 制限をオンデマンドで設定する + Blacklist accounts, applications and contacts デバッグログを出力する (要再起動) 上級者モード 制限の設定を取得する際の信頼区間の最大値 diff --git a/res/values-ku-rIQ/strings.xml b/res/values-ku-rIQ/strings.xml index 6c8c52f5b..fe7441c1b 100644 --- a/res/values-ku-rIQ/strings.xml +++ b/res/values-ku-rIQ/strings.xml @@ -167,6 +167,7 @@ زانیاری هه له نوی کردنه وهی ئاگه داریه کان داوات لیبکریت بو سنوردار کردنیان + Blacklist accounts, applications and contacts Debug log (requires restart) چه ند هه لبژاردنیکی مه ترسیدار که تایبه ته به که سانی شاره زا زورترین راده ی دلنیابوون له زانیاریه دابه زینراوه کان diff --git a/res/values-ku-rIR/strings.xml b/res/values-ku-rIR/strings.xml index 6c8c52f5b..fe7441c1b 100644 --- a/res/values-ku-rIR/strings.xml +++ b/res/values-ku-rIR/strings.xml @@ -167,6 +167,7 @@ زانیاری هه له نوی کردنه وهی ئاگه داریه کان داوات لیبکریت بو سنوردار کردنیان + Blacklist accounts, applications and contacts Debug log (requires restart) چه ند هه لبژاردنیکی مه ترسیدار که تایبه ته به که سانی شاره زا زورترین راده ی دلنیابوون له زانیاریه دابه زینراوه کان diff --git a/res/values-lt/strings.xml b/res/values-lt/strings.xml index fceb4717e..9544351ef 100644 --- a/res/values-lt/strings.xml +++ b/res/values-lt/strings.xml @@ -168,6 +168,7 @@ Tačiau neįmanoma garantuoti, kad dirbs nepriekaištingai su kiekvienu prietais Netikri duomenys Atnaujinimų Pranešimas Riboti pagal reikalavimą + Blacklist accounts, applications and contacts DEBUG žurnalas (perkrauti prietaisą) Eksperto režimas Maks. pasitikėjimo gavimo intervalas diff --git a/res/values-ms/strings.xml b/res/values-ms/strings.xml index e50274a38..9673af7fa 100644 --- a/res/values-ms/strings.xml +++ b/res/values-ms/strings.xml @@ -168,6 +168,7 @@ namun ia adalah mustahil untuk menjaminkan penggunaan sempurna untuk setiap pera Data palsu Pemberitahuan pengemaskinian Sekatan di atas permintaan + Blacklist accounts, applications and contacts Log nyahsilap (perlu mula semula) Mod pakar Selang keyakinan pengambilan maxima diff --git a/res/values-nb-rNO/strings.xml b/res/values-nb-rNO/strings.xml index 561371378..86b8828b7 100644 --- a/res/values-nb-rNO/strings.xml +++ b/res/values-nb-rNO/strings.xml @@ -166,6 +166,7 @@ Forfalsket data Oppdater varslinger Blokkering på forespørsel + Blacklist accounts, applications and contacts Feilsøkingsloggfil (omstart nødvendig) Ekspert modus Maksimalt konfidensintervall for å hente restriksjoner diff --git a/res/values-nl/strings.xml b/res/values-nl/strings.xml index 474fbce3d..6fd992dcb 100644 --- a/res/values-nl/strings.xml +++ b/res/values-nl/strings.xml @@ -168,6 +168,7 @@ maar het is onmogelijk om te garanderen dat het op elk apparaat en voor elke app Nepgegevens Bijgewerkt notificaties Beperken op verzoek + Zwarte lijst voor accounts, applicaties en contacten Debug log (herstart vereist) Expertmodus Maximum betrouwbaarheidsinterval voor ophalen diff --git a/res/values-nn-rNO/strings.xml b/res/values-nn-rNO/strings.xml index 561371378..86b8828b7 100644 --- a/res/values-nn-rNO/strings.xml +++ b/res/values-nn-rNO/strings.xml @@ -166,6 +166,7 @@ Forfalsket data Oppdater varslinger Blokkering på forespørsel + Blacklist accounts, applications and contacts Feilsøkingsloggfil (omstart nødvendig) Ekspert modus Maksimalt konfidensintervall for å hente restriksjoner diff --git a/res/values-no-rNO/strings.xml b/res/values-no-rNO/strings.xml index 561371378..86b8828b7 100644 --- a/res/values-no-rNO/strings.xml +++ b/res/values-no-rNO/strings.xml @@ -166,6 +166,7 @@ Forfalsket data Oppdater varslinger Blokkering på forespørsel + Blacklist accounts, applications and contacts Feilsøkingsloggfil (omstart nødvendig) Ekspert modus Maksimalt konfidensintervall for å hente restriksjoner diff --git a/res/values-pl/strings.xml b/res/values-pl/strings.xml index 0de64e845..c9e2064d7 100644 --- a/res/values-pl/strings.xml +++ b/res/values-pl/strings.xml @@ -168,6 +168,7 @@ Fałszowanie danych Aktualizuj powiadomienia Ograniczanie na żądanie + Blacklist accounts, applications and contacts Log debugowania (wymaga restartu) Tryb eksperta Maksymalna wartość wspołczynnika zaufania diff --git a/res/values-pt/strings.xml b/res/values-pt/strings.xml index 94dcab55d..809fcd5ea 100644 --- a/res/values-pt/strings.xml +++ b/res/values-pt/strings.xml @@ -168,6 +168,7 @@ porém é impossível garantir que irá funcionar sem problemas em todos os disp Fake data Update notifications Restrict on demand + Blacklist accounts, applications and contacts Relatório de depuração (requer reinicialização) Expert mode Maximum fetch confidence interval diff --git a/res/values-ro/strings.xml b/res/values-ro/strings.xml index 515716da7..0749ba92f 100644 --- a/res/values-ro/strings.xml +++ b/res/values-ro/strings.xml @@ -168,6 +168,7 @@ however it is impossible to guarantee it will work flawless on each and every de Fake data Update notifications Restrict on demand + Blacklist accounts, applications and contacts Debug log (requires restart) Expert mode Maximum fetch confidence interval diff --git a/res/values-ru/strings.xml b/res/values-ru/strings.xml index 8e5753524..ae02e6607 100644 --- a/res/values-ru/strings.xml +++ b/res/values-ru/strings.xml @@ -168,6 +168,7 @@ Фальшивые данные Обновить уведомления Запрос разрешений + Blacklist accounts, applications and contacts Отладочный лог (требует перезапуска) Режим эксперта Макс. доверительный интервал выборки diff --git a/res/values-sk/strings.xml b/res/values-sk/strings.xml index 95afdf352..8640f818a 100644 --- a/res/values-sk/strings.xml +++ b/res/values-sk/strings.xml @@ -168,6 +168,7 @@ avšak nie je nemožné zaručiť, že bude fungovať bezchybne na každom zaria Falošné údaje Oznámenia o aktualizáciách Obmedziť na požiadanie + Blacklist accounts, applications and contacts Záznam na ladenie (vyžadovaný reštart) Režim experta Maximálny interval spoľahlivosti sťahovania diff --git a/res/values-sl/strings.xml b/res/values-sl/strings.xml index f762d58c9..dadc6cc33 100644 --- a/res/values-sl/strings.xml +++ b/res/values-sl/strings.xml @@ -168,6 +168,7 @@ Lažni podatki Obvestila ob posodobitvi Omeji na zahtevo + Blacklist accounts, applications and contacts Beleženje za razvijalce (zahtevan ponovni zagon) Način za strokovnjake Največji interval prenašanja omejitev diff --git a/res/values-sr/strings.xml b/res/values-sr/strings.xml index c7ba0ffe4..b882482c7 100644 --- a/res/values-sr/strings.xml +++ b/res/values-sr/strings.xml @@ -168,6 +168,7 @@ however it is impossible to guarantee it will work flawless on each and every de Fake data Update notifications Restrict on demand + Blacklist accounts, applications and contacts Debug log (requires restart) Expert mode Maximum fetch confidence interval diff --git a/res/values-sv/strings.xml b/res/values-sv/strings.xml index 3a4c66bc0..5af83e04e 100644 --- a/res/values-sv/strings.xml +++ b/res/values-sv/strings.xml @@ -168,6 +168,7 @@ Det är emellertid omöjligt att garantera att appen fungerar på alla enheter o Fake data Update notifications Restrict on demand + Blacklist accounts, applications and contacts Felsökningslogg (kräver omstart) Expert mode Maximum fetch confidence interval diff --git a/res/values-tl-rPH/strings.xml b/res/values-tl-rPH/strings.xml index d46fc8157..0d32cff48 100644 --- a/res/values-tl-rPH/strings.xml +++ b/res/values-tl-rPH/strings.xml @@ -168,6 +168,7 @@ Pekeng kaalaman Baguhin ang mga abiso Restrict on demand + Blacklist accounts, applications and contacts Ipakita kaalaman ukol sa Debug (kailangan muling paumpisahin ang iyong kagamitan) Gamitin XPrivacy sa sanay na paraan Pinakamataas na Confidence Interval na puwedeng kunin diff --git a/res/values-tr/strings.xml b/res/values-tr/strings.xml index 4a85ce2d3..233e29d92 100644 --- a/res/values-tr/strings.xml +++ b/res/values-tr/strings.xml @@ -167,6 +167,7 @@ Fake data Update notifications Restrict on demand + Blacklist accounts, applications and contacts Hata ayıklama modu (Yeniden başlatma gerekir) Expert mode Maximum fetch confidence interval diff --git a/res/values-ua/strings.xml b/res/values-ua/strings.xml index 378a3961c..170662bcb 100644 --- a/res/values-ua/strings.xml +++ b/res/values-ua/strings.xml @@ -168,6 +168,7 @@ Фальшиві дані Оновити сповіщення Restrict on demand + Blacklist accounts, applications and contacts Відлагоджувальний лог (потрібне перезавантаження) Експертний режим Максимальний інтервал отримання конфіденційних даних diff --git a/res/values-vi/strings.xml b/res/values-vi/strings.xml index 9e8b5dc5c..f2162bca1 100644 --- a/res/values-vi/strings.xml +++ b/res/values-vi/strings.xml @@ -167,6 +167,7 @@ Dữ liệu giả Cập nhật thông báo Hạn chế theo yêu cầu truy cập dữ liệu + Blacklist accounts, applications and contacts Nhật ký lỗi (cần khởi động lại ứng dụng) Chế độ nâng cao Tối đa khoảng thời gian lấy về các thiết lập diff --git a/res/values-zh-rCN/strings.xml b/res/values-zh-rCN/strings.xml index 2cb7f5059..8ec56f1bc 100644 --- a/res/values-zh-rCN/strings.xml +++ b/res/values-zh-rCN/strings.xml @@ -168,6 +168,7 @@ 模拟信息 通知栏提示 按需限制权限 + Blacklist accounts, applications and contacts 调试日志(需要重启) 专家模式 最大采样置信区间 diff --git a/res/values-zh-rTW/strings.xml b/res/values-zh-rTW/strings.xml index c6e28c69b..6d898adbc 100644 --- a/res/values-zh-rTW/strings.xml +++ b/res/values-zh-rTW/strings.xml @@ -168,6 +168,7 @@ 偽造資訊設定 APP更新時顯示通知 開啟互動式限制設定 + Blacklist accounts, applications and contacts 偵錯日誌 (需重新啟動) 進階模式 最大擷取信賴區間 diff --git a/res/values/strings.xml b/res/values/strings.xml index babadfd83..16327e9c9 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -183,6 +183,7 @@ however it is impossible to guarantee it will work flawlessly on each and every Fake data Update notifications Restrict on demand + Blacklist accounts, applications and contacts Debug log (requires restart) Expert mode Maximum fetch confidence interval diff --git a/src/biz/bokhorst/xprivacy/PrivacyManager.java b/src/biz/bokhorst/xprivacy/PrivacyManager.java index d6c12c3ce..46a521f2f 100644 --- a/src/biz/bokhorst/xprivacy/PrivacyManager.java +++ b/src/biz/bokhorst/xprivacy/PrivacyManager.java @@ -121,6 +121,7 @@ public class PrivacyManager { public final static String cSettingMigrated = "Migrated"; public final static String cSettingCid = "Cid"; public final static String cSettingLac = "Lac"; + public final static String cSettingBlacklist = "Blacklist"; // Special value names public final static String cValueRandom = "#Random#"; diff --git a/src/biz/bokhorst/xprivacy/SettingsDialog.java b/src/biz/bokhorst/xprivacy/SettingsDialog.java index 507688d5a..48cfe16c9 100644 --- a/src/biz/bokhorst/xprivacy/SettingsDialog.java +++ b/src/biz/bokhorst/xprivacy/SettingsDialog.java @@ -41,6 +41,7 @@ public static void edit(final ActivityBase context, ApplicationInfoEx appInfo) { final CheckBox cbNotify = (CheckBox) dlgSettings.findViewById(R.id.cbNotify); final CheckBox cbOnDemand = (CheckBox) dlgSettings.findViewById(R.id.cbOnDemand); + final CheckBox cbBlacklist = (CheckBox) dlgSettings.findViewById(R.id.cbBlacklist); final CheckBox cbUsage = (CheckBox) dlgSettings.findViewById(R.id.cbUsage); final CheckBox cbParameters = (CheckBox) dlgSettings.findViewById(R.id.cbParameters); final CheckBox cbLog = (CheckBox) dlgSettings.findViewById(R.id.cbLog); @@ -233,6 +234,7 @@ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { // Application specific boolean notify = PrivacyManager.getSettingBool(-uid, PrivacyManager.cSettingNotify, true); boolean ondemand = PrivacyManager.getSettingBool(-uid, PrivacyManager.cSettingOnDemand, uid == userId); + boolean blacklist = PrivacyManager.getSettingBool(-uid, PrivacyManager.cSettingBlacklist, false); boolean enabled = PrivacyManager.getSettingBool(-uid, PrivacyManager.cSettingRestricted, true); // Common @@ -300,6 +302,11 @@ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { } else cbOnDemand.setVisibility(View.GONE); + if (uid == userId) + cbBlacklist.setVisibility(View.GONE); + else + cbBlacklist.setChecked(blacklist); + // Common cbRandom.setChecked(random); @@ -470,6 +477,10 @@ public void onClick(View view) { PrivacyManager.setSetting(uid, PrivacyManager.cSettingOnDemand, Boolean.toString(cbOnDemand.isChecked())); + if (uid != userId) + PrivacyManager.setSetting(uid, PrivacyManager.cSettingBlacklist, + Boolean.toString(cbBlacklist.isChecked())); + // Random at boot PrivacyManager.setSetting(uid, PrivacyManager.cSettingRandom, cbRandom.isChecked() ? Boolean.toString(true) : null); diff --git a/src/biz/bokhorst/xprivacy/XAccountManager.java b/src/biz/bokhorst/xprivacy/XAccountManager.java index 9902acc4c..056519cd4 100644 --- a/src/biz/bokhorst/xprivacy/XAccountManager.java +++ b/src/biz/bokhorst/xprivacy/XAccountManager.java @@ -243,12 +243,16 @@ private boolean isAccountAllowed(Account account, int uid) { private boolean isAccountAllowed(String accountName, String accountType, int uid) { try { - if (PrivacyManager.getSettingBool(-uid, Meta.cTypeAccountHash, accountName + accountType, false)) - return true; + boolean allowed = PrivacyManager.getSettingBool(-uid, Meta.cTypeAccountHash, accountName + accountType, + false); + boolean blacklist = PrivacyManager.getSettingBool(-uid, PrivacyManager.cSettingBlacklist, false); + if (blacklist) + allowed = !allowed; + return allowed; } catch (Throwable ex) { Util.bug(this, ex); + return false; } - return false; } private class XFutureAccount implements AccountManagerFuture { diff --git a/src/biz/bokhorst/xprivacy/XContentResolver.java b/src/biz/bokhorst/xprivacy/XContentResolver.java index 5f25b1f1a..1f3f8a7f0 100644 --- a/src/biz/bokhorst/xprivacy/XContentResolver.java +++ b/src/biz/bokhorst/xprivacy/XContentResolver.java @@ -270,6 +270,11 @@ private void handleUriAfter(XParam param) throws Throwable { if (added) listColumn.remove(listColumn.size() - 1); + // Get blacklist setting + int uid = Binder.getCallingUid(); + boolean blacklist = PrivacyManager + .getSettingBool(-uid, PrivacyManager.cSettingBlacklist, false); + MatrixCursor result = new MatrixCursor(listColumn.toArray(new String[0])); // Filter rows @@ -279,8 +284,10 @@ private void handleUriAfter(XParam param) throws Throwable { while (cursor.moveToNext()) { // Check if allowed long id = (urlid >= 0 ? urlid : cursor.getLong(iid)); - boolean allowed = PrivacyManager.getSettingBool(-Binder.getCallingUid(), - Meta.cTypeContact, Long.toString(id), false); + boolean allowed = PrivacyManager.getSettingBool(-uid, Meta.cTypeContact, + Long.toString(id), false); + if (blacklist) + allowed = !allowed; if (allowed) copyColumns(cursor, result, listColumn.size()); } diff --git a/src/biz/bokhorst/xprivacy/XPackageManager.java b/src/biz/bokhorst/xprivacy/XPackageManager.java index a8ff97334..98492267b 100644 --- a/src/biz/bokhorst/xprivacy/XPackageManager.java +++ b/src/biz/bokhorst/xprivacy/XPackageManager.java @@ -155,6 +155,10 @@ public static boolean isPackageAllowed(String packageName) { return false; } - return PrivacyManager.getSettingBool(-uid, Meta.cTypeApplication, packageName, false); + boolean allowed = PrivacyManager.getSettingBool(-uid, Meta.cTypeApplication, packageName, false); + boolean blacklist = PrivacyManager.getSettingBool(-uid, PrivacyManager.cSettingBlacklist, false); + if (blacklist) + allowed = !allowed; + return allowed; } } diff --git a/tools/addstring.sh b/tools/addstring.sh index 094c62ee5..e8f9d49f8 100755 --- a/tools/addstring.sh +++ b/tools/addstring.sh @@ -1,7 +1,7 @@ #!/bin/bash -grep -RIl "\By last usage (XPrivacy)" +grep -RIl "\Blacklist accounts, applications and contacts" #grep -RIl "\