diff --git a/F-Droid/AndroidManifest.xml b/F-Droid/AndroidManifest.xml index a3d73f060..86a6d8f46 100644 --- a/F-Droid/AndroidManifest.xml +++ b/F-Droid/AndroidManifest.xml @@ -386,10 +386,10 @@ + android:name=".privileged.install.InstallExtensionBootReceiver" > diff --git a/F-Droid/res/values-ast/strings.xml b/F-Droid/res/values-ast/strings.xml index cbd9f115a..3d0eb5af6 100644 --- a/F-Droid/res/values-ast/strings.xml +++ b/F-Droid/res/values-ast/strings.xml @@ -178,8 +178,8 @@ Deberíes tener procuru con aplicaciones baxaes dende índices ensin roblar.Refugóse l\'accesu root O\'l to preséu Android nun ta rootexáu o refuguesti l\'accesu root pa F-Droid. Anovar too - Nun ta disponible F-Droid privilexáu - Esta opción ta namái disponible cuando s\'instale F-Droid como una aplicación del sistema. + Nun ta disponible F-Droid privilexáu + Esta opción ta namái disponible cuando s\'instale F-Droid como una aplicación del sistema. F-Droid ye un catálogu de software FOSS (software llibre y de baldre) instalable pa la plataforma Android. El veceru fai cenciello restolar, instalar y caltener el rastrexu d\'anovamientos nel to preséu. Si\'l to collaciu tien F-Droid y NFC activáu, axuntái los vuesos teléfonos pela parte d\'atras. Xúnite a la mesma Wi-Fi que\'l to collaciu diff --git a/F-Droid/res/values-bg/strings.xml b/F-Droid/res/values-bg/strings.xml index 7b673118d..940072a48 100644 --- a/F-Droid/res/values-bg/strings.xml +++ b/F-Droid/res/values-bg/strings.xml @@ -154,7 +154,7 @@ Изисква Root достъп… Root достъпът е отказан Актуализирай всички - Опцията е налична само когато сте инсталирали F-Droid като системно приложение. + Опцията е налична само когато сте инсталирали F-Droid като системно приложение. Ако приятелят ви има F-Droid и е активирал NFC можете да докоснете телефоните си. Свържете се към една и съща Wi-Fi мрежа с приятеля си Размяна на приложения diff --git a/F-Droid/res/values-cs/strings.xml b/F-Droid/res/values-cs/strings.xml index e0fbafc4d..6dcb9333b 100644 --- a/F-Droid/res/values-cs/strings.xml +++ b/F-Droid/res/values-cs/strings.xml @@ -146,8 +146,8 @@ Uvolněno pod GPLv3 licencí. Root přístup odepřen Buď toto Android zařízení není rootnuté, nebo jsi odepřel F-Droidu opránění roota. Aktualizovat vše - Systémová oprávnění odepřena - Tato volba je dostupná pouze, pokud je F-Droid nainstalován jako systémová aplikace. + Systémová oprávnění odepřena + Tato volba je dostupná pouze, pokud je F-Droid nainstalován jako systémová aplikace. Připoj se na stejnou WiFi jako tvůj přítel Přepnout aplikace Zatím žádná síť diff --git a/F-Droid/res/values-de/strings.xml b/F-Droid/res/values-de/strings.xml index 2856e4125..8b5ea8478 100644 --- a/F-Droid/res/values-de/strings.xml +++ b/F-Droid/res/values-de/strings.xml @@ -183,8 +183,8 @@ wird verbunden Root-Zugriff verweigert Entweder ist Ihr Android-Gerät nicht gerootet oder Sie haben den Root-Zugriff für F-Droid verweigert. Alle aktualisieren - Systemberechtigungen verweigert - Diese Option ist nur verfügbar, wenn F-Droid als System-App installiert wurde. + Systemberechtigungen verweigert + Diese Option ist nur verfügbar, wenn F-Droid als System-App installiert wurde. F-Droid ist ein installierbarer App-Store für FOSS (Freie und Quelloffene Software) Anwendungen für die Android-Plattform. Der Client macht es auf deinem Gerät einfach zu durchsuchen, zu installieren und Aktualisierungen zu verfolgen. Wenn Sie die Telefone mit Ihrem Freund aneinander halten. Treten Sie dem gleichen WLAN-Netzwerk bei wie Ihr Freund diff --git a/F-Droid/res/values-es/strings.xml b/F-Droid/res/values-es/strings.xml index 452613c1e..cb24ba303 100644 --- a/F-Droid/res/values-es/strings.xml +++ b/F-Droid/res/values-es/strings.xml @@ -183,8 +183,8 @@ Deberías tener cuidado con aplicaciones descargadas desde índices no firmados. Acceso «root» denegado El dispositivo Android no está «rooteado» o se ha denegado el acceso «root» para F-Droid. Actualizar todo - F-Droid con permisos de sistema no está disponible - Esta opción sólo está disponible cuando F-Droid está instalado con permisos de sistema. + F-Droid con permisos de sistema no está disponible + Esta opción sólo está disponible cuando F-Droid está instalado con permisos de sistema. F-Droid es un catálogo instalable de aplicaciones FOSS (Software libre y de Código Abierto) para la plataforma Android. El cliente hace que sea fácil navegar, instalar y mantener un registro de cambios en el dispositivo. Si tu amigo tiene F-Droid y NFC encendido, colocad los un teléfonos una contra el otro. Unirse a la misma Red Wi-Fi que tu amigo diff --git a/F-Droid/res/values-fi/strings.xml b/F-Droid/res/values-fi/strings.xml index 5a0cfa6e6..92e4118bb 100644 --- a/F-Droid/res/values-fi/strings.xml +++ b/F-Droid/res/values-fi/strings.xml @@ -151,8 +151,8 @@ Sinun pitää Root-oikeudet kielletty Joko Android-laitettasi ei ole rootattu tai olet kieltänyt F-Droidin root-oikeuksiin pääsyn. Päivitä kaikki - Järjestelmäasetukset kielletty - Tämä asetus on käytössä vain silloin, kun F-Droid on asennettu järjestelmäsovellukseksi. + Järjestelmäasetukset kielletty + Tämä asetus on käytössä vain silloin, kun F-Droid on asennettu järjestelmäsovellukseksi. F-Droid on asennettava FOSS-sovellusten hakemisto (Free and Open Source Software) Androidille. Asiakasohjelma helpottaa selailemista, asentamista ja laitteesi pitämistä päivitettynä. Jos ystävälläsi on koskekaa puhelimianne yhtäaikaa. Liity ystäväsi kanssa samaan WiFi-verkkoon diff --git a/F-Droid/res/values-fr/strings.xml b/F-Droid/res/values-fr/strings.xml index a6e78ced2..cf49a2499 100644 --- a/F-Droid/res/values-fr/strings.xml +++ b/F-Droid/res/values-fr/strings.xml @@ -182,8 +182,8 @@ Publiée sous licence GNU GPLv3. Droits root refusés Soit votre système Android n\'a pas les droits root/SuperUser, soit vous les avez refusés à F-Droid. Tout mettre à jour - Permissions systèmes refusées - Cette option est seulement disponible quand F-Droid est installé comme application-système. + Permissions systèmes refusées + Cette option est seulement disponible quand F-Droid est installé comme application-système. F-Droid est un catalogue installable de logiciels libres et open source pour le système Android. Le client permet une navigation facile, l\'installation, et garder une trace des mises à jour sur votre appareil. Se connecter au même Wi-Fi que votre ami Échanger des apps diff --git a/F-Droid/res/values-it/strings.xml b/F-Droid/res/values-it/strings.xml index 53c989079..d30ae3ba1 100644 --- a/F-Droid/res/values-it/strings.xml +++ b/F-Droid/res/values-it/strings.xml @@ -179,8 +179,8 @@ Prova a collegarti a questa rete: %s Accesso Root negato Il tuo telefono non ha i permessi di root oppure li hai negati ad F-Droid. Aggiorna tutto - Permessi di sistema negati - Questa opzione è disponibile solo quando F-Droid è installato come app di sistema. + Permessi di sistema negati + Questa opzione è disponibile solo quando F-Droid è installato come app di sistema. F-Droid è un catalogo installabile di applicazioni FOSS (Free and Open Source Software) per Android. Il client rende semplice cercare, installare e tenere traccia deglii aggiornamenti sul tuo dispositivo. Collegati alla stessa WiFi del tuo amico Invia apps diff --git a/F-Droid/res/values-ja/strings.xml b/F-Droid/res/values-ja/strings.xml index 9d6568a55..775211a2c 100644 --- a/F-Droid/res/values-ja/strings.xml +++ b/F-Droid/res/values-ja/strings.xml @@ -179,8 +179,8 @@ 管理者権限での接続が拒絶されました この端末はroot化されていないか、F-Droidの管理者権限要求が拒絶されされました。 全て更新 - システムアクセス許可が拒絶されました - この設定は、F-Droidがシステムアプリとしてインストールされているときのみ有効です。 + システムアクセス許可が拒絶されました + この設定は、F-Droidがシステムアプリとしてインストールされているときのみ有効です。 F-DroidはAndroidプラットフォーム向けFOSS(フリーのオープンソースソフトウェア) アプリケーションのインストール可能なカタログです。このクライアントで、お使いの端末で簡単に参照、インストール、および更新履歴を記録することができます。 友達がF-DroidとNFCを持っていれば、一緒に電話をタッチしてください。 友達として同じWi-Fiに参加 diff --git a/F-Droid/res/values-ko/strings.xml b/F-Droid/res/values-ko/strings.xml index 74211f59e..1205a7592 100644 --- a/F-Droid/res/values-ko/strings.xml +++ b/F-Droid/res/values-ko/strings.xml @@ -178,8 +178,8 @@ GNU GPLv3 라이센스 하에 배포됩니다. 루트 권한 거부됨 기기가 루팅되지 않았거나 F-Droid의 루트 권한 요청을 거부한 경우입니다. 모두 업데이트 - 시스템 권한 거부됨 - 이 옵션은 F-Droid가 시스템 앱으로 설치된 경우에만 사용 가능합니다. + 시스템 권한 거부됨 + 이 옵션은 F-Droid가 시스템 앱으로 설치된 경우에만 사용 가능합니다. F-Droid는 안드로이드 플랫폼을 위한 \'오픈 소스 및 자유 소프트웨어(FOSS)\' 앱들의 설치 목록입니다. F-Droid는 기기에서 앱들을 쉽게 검색, 설치, 업데이트를 할 수 있게 해줍니다. 기기를 서로 맞대어 놓으세요. 같은 WiFi 네트워크에 접속하세요 diff --git a/F-Droid/res/values-nb/strings.xml b/F-Droid/res/values-nb/strings.xml index 2d093b8b4..de3ec14b7 100644 --- a/F-Droid/res/values-nb/strings.xml +++ b/F-Droid/res/values-nb/strings.xml @@ -188,8 +188,8 @@ Du må Root tilgang nektet Enten mangler din Android-enhet superbrukertilgang, eller så har du nektet F-droid root-tilgang. Oppdater alle - System-rettigheter avslått - Dette valget er bare tilgjengelig når F-Droid er installert som system-program. + System-rettigheter avslått + Dette valget er bare tilgjengelig når F-Droid er installert som system-program. F-droid er en ansamling fri programvare som kan installeres på Android-plattformen. Klienten gjør det enkelt å sjekke ut, installere og holde øye med oppdateringer på din enhet. Hvis du og din venn holder telefonene deres sammen. Koble til samme Wi-Fi-nett som din venn diff --git a/F-Droid/res/values-nl/strings.xml b/F-Droid/res/values-nl/strings.xml index 5432a4526..6af4f7071 100644 --- a/F-Droid/res/values-nl/strings.xml +++ b/F-Droid/res/values-nl/strings.xml @@ -176,8 +176,8 @@ Root toegang geweigerd Uw Android apparaat is niet geroot, of u heeft F-Droid geen root toegang gegeven. Update alles - Systeemrechten geweigerd - Deze optie is alleen beschikbaar als F-Droid als systeemapp geïnstalleerd is. + Systeemrechten geweigerd + Deze optie is alleen beschikbaar als F-Droid als systeemapp geïnstalleerd is. F-Droid is een installeerbare cataloges van FOSS (Vrije en Open Source Software) apps voor Android. Het programma maakt het gemakkelijk om door apps te bladeren, te installeren en up-to-date te houden. Verbind met hetzelfde Wi-Fi netwerk als jouw vriend Deel apps diff --git a/F-Droid/res/values-pl/strings.xml b/F-Droid/res/values-pl/strings.xml index aa3c48959..789508b0d 100644 --- a/F-Droid/res/values-pl/strings.xml +++ b/F-Droid/res/values-pl/strings.xml @@ -137,8 +137,8 @@ Uwaga: Wszystkie poprzednio zainstalowane aplikacje zostaną na urządzeniu.Odmówiono uprawnień roota Urządzenie nie zostało zrootowane lub odmówiono uprawnień roota F-Droidowi. Uaktualnij wszystko - Odmówiono uprawnień systemowych - Opcja dostępna tylko wtedy, gdy F-Droid został zainstalowany jako aplikacja systemowa. + Odmówiono uprawnień systemowych + Opcja dostępna tylko wtedy, gdy F-Droid został zainstalowany jako aplikacja systemowa. F-Droid jest katalogiem aplikacji FOSS (Wolne i Otwarte Oprogramowanie) dla platformy Android. Klient umożliwia łatwe przeglądanie, instalowanie i zarządzanie aktualizacjami na Twoim urządzeniu. Jeśli oba urządzenie mają F-Droida i NFC, możecie je zbliżyć do siebie. Połącz się z tą samą siecią Wi-Fi diff --git a/F-Droid/res/values-pt-rBR/strings.xml b/F-Droid/res/values-pt-rBR/strings.xml index 35b7fe540..0015cff90 100644 --- a/F-Droid/res/values-pt-rBR/strings.xml +++ b/F-Droid/res/values-pt-rBR/strings.xml @@ -181,8 +181,8 @@ com aplicativos baixados a partir de índices não assinados. Acesso root negado Ou o seu dispositivo Android não está \"rooteado\" ou você recusou o acesso root para o F-Droid. Atualizar tudo - Permissões do sistema negadas - Esta opção só está disponível quando o F-Droid está instalado como um aplicativo de sistema. + Permissões do sistema negadas + Esta opção só está disponível quando o F-Droid está instalado como um aplicativo de sistema. F-Droid é um catálogo instalável de aplicativos FOSS (Software Livre e de Código Aberto) para a plataforma Android. O cliente faz com que seja fácil navegar, instalar e manter o controle das atualizações no seu dispositivo. Caso seu(sua) amigo(a) encoste o telefone dele(a) junto ao seu. Juntar-se a mesma rede Wi-Fi do(a) seu(sua) amigo(a) diff --git a/F-Droid/res/values-ru/strings.xml b/F-Droid/res/values-ru/strings.xml index c05622521..1375a84f7 100644 --- a/F-Droid/res/values-ru/strings.xml +++ b/F-Droid/res/values-ru/strings.xml @@ -177,8 +177,8 @@ Отказано в root доступе Либо у вашего устройства нет root доступа, либо вы отклонили запрос от F-Droid. Обновить всё - Запрос на системные привилегии отклонён - Данная опция доступна только если F-Droid установлен как системное приложение. + Запрос на системные привилегии отклонён + Данная опция доступна только если F-Droid установлен как системное приложение. F-Droid — каталог FOSS (свободного и открытого программного обеспечения) для платформы Android. Клиент позволяет с лёгкостью просматривать, устанавливать и обновлять приложение на вашем устройстве. Подключиться к той же Wi-Fi сети, что и ваш друг Обмен приложениями diff --git a/F-Droid/res/values-sc/strings.xml b/F-Droid/res/values-sc/strings.xml index 514d47eb4..051da0fe3 100644 --- a/F-Droid/res/values-sc/strings.xml +++ b/F-Droid/res/values-sc/strings.xml @@ -179,8 +179,8 @@ Intregadu cun sa litzèntzia Atzessu root dennegadu Su dispositivu tuo non tenet sos permissos de root o non los as datu a F-droid. Agiorna totu - Permissos de sistema dennegados - Custa optzione est disponìbile petzi cando F-Droid est installadu comente aplicatzione de sistema. + Permissos de sistema dennegados + Custa optzione est disponìbile petzi cando F-Droid est installadu comente aplicatzione de sistema. F-Droid est unu catàlogu installàbile de FOSS (Free and Open Source Software - Aplicatziones lìberas e a mitza aberta) pro Android. S\'aplicatzione-client permitit de chircare, installare, e compidare sos agiornamentos in su dispositivu tuo. Si s\'amigu tuo tenet pone a cuntatu sos duos dispositivos. Intra in sa matessi retza Wi-Fi de s\'amigu tuo diff --git a/F-Droid/res/values-sk/strings.xml b/F-Droid/res/values-sk/strings.xml index 6fd4fd9c5..635436479 100644 --- a/F-Droid/res/values-sk/strings.xml +++ b/F-Droid/res/values-sk/strings.xml @@ -175,8 +175,8 @@ Vydaný pod licenciou Root prístup zamietnutý Buď vaše zariadenie s Androidom nemá urobený root alebo ste odmietli root prístup pre F-Droid. Aktualizovať všetko - Systémové povolenia zamietnuté - Táto možnosť je dostupná iba ak je F-Droid inštalovaný ako systémová aplikácia. + Systémové povolenia zamietnuté + Táto možnosť je dostupná iba ak je F-Droid inštalovaný ako systémová aplikácia. F-Droid je inštalovateľný katalóg FOSS (Free a Open Source Software) aplikácií pre platformu Android. Klient umožňuje ľahko prechádzať, inštalovať, a sledovať aktualizácie na vašom zariadení. Ak má váš kamarát F-Droid a zapnuté NFC, spojte prosím telefóny dohromady. Pripojte sa na rovnaké Wi-fi ako kamarát diff --git a/F-Droid/res/values-sr/strings.xml b/F-Droid/res/values-sr/strings.xml index 12c413236..7b06c3fa7 100644 --- a/F-Droid/res/values-sr/strings.xml +++ b/F-Droid/res/values-sr/strings.xml @@ -175,8 +175,8 @@ Корени приступ одбијен Или ваш Андроид уређај није рутован или сте Ф-дроиду одбили корени приступ. Надогради све - Системске дозволе одбијене - Ова опција доступна само када је Ф-дроид инсталиран као системска апликација. + Системске дозволе одбијене + Ова опција доступна само када је Ф-дроид инсталиран као системска апликација. Ф-дроид је каталог ФОСС (слободан и софтвер отвореног кôда) апликација за Андроид платформу. Клијент олакшава претрагу, инсталацију и праћење надоградњи на вашем уређају. Ако ваш пријатељ има НФЦ, спојите телефоне. Повежите се на исту бежичну мрежу на којој је ваш пријатељ diff --git a/F-Droid/res/values-sv/strings.xml b/F-Droid/res/values-sv/strings.xml index a874fe5f8..526af5290 100644 --- a/F-Droid/res/values-sv/strings.xml +++ b/F-Droid/res/values-sv/strings.xml @@ -177,8 +177,8 @@ Släppt under licensen GNU GPLv3. Root-åtkomst nekad Antingen är din Android-enhet inte rootad eller så har du nekat root-åtkomst för F-Droid. Uppdatera alla - Systembehörigheter nekade - Detta val är endast tillgängligt när F-Droid installerats som en system-app. + Systembehörigheter nekade + Detta val är endast tillgängligt när F-Droid installerats som en system-app. F-Droid är en installerbar katalog av fri och öppen källkodsprogramvara (FOSS) för Android-plattformen. Klienten gör det enkelt att bläddra bland, installera och hålla koll på uppdateringar på din enhet. Använd samma wifi som din vän Byt appar diff --git a/F-Droid/res/values-tr/strings.xml b/F-Droid/res/values-tr/strings.xml index bcc548b7b..34b7a8539 100644 --- a/F-Droid/res/values-tr/strings.xml +++ b/F-Droid/res/values-tr/strings.xml @@ -190,8 +190,8 @@ Ondan uygulama indirmek için bu depoyu tekrar etkinleştirmeniz gerekecektir.Root erişimi engellendi Ya Android cihazınız rootlu değil ya da F-Droid için root erişimini engellediniz. Tümünü güncelle - Sistem izinleri reddedildi - Bu seçenek sadece F-Droid bir sistem uygulaması olarak kurulduğunda mevcuttur. + Sistem izinleri reddedildi + Bu seçenek sadece F-Droid bir sistem uygulaması olarak kurulduğunda mevcuttur. F-Droid, Android platformu için kurulabilir Özgür ve Açık Kaynaklı Yazılım kataloğudur. İstemci cihazınızda uygulama taramayı, kurmayı ve güncellemeyi kolaylaştırır. Arkadaşınızda NFC varsa telefonlarınızı birbirine dokundurun. Arkadaşınızla aynı kablosuz ağda bulunun diff --git a/F-Droid/res/values-vi/strings.xml b/F-Droid/res/values-vi/strings.xml index eca7f02fb..47a99fe00 100644 --- a/F-Droid/res/values-vi/strings.xml +++ b/F-Droid/res/values-vi/strings.xml @@ -161,8 +161,8 @@ Bị từ chối quyền root Thiết bị của bạn chưa được root hoặc bạn đã từ chối quyền root của F-Droid. Cập nhật tất cả - Bị từ chối quyền hệ thống - Chỉ có tuỳ chọn này khi F-Droid được cài làm ứng dụng hệ thống. + Bị từ chối quyền hệ thống + Chỉ có tuỳ chọn này khi F-Droid được cài làm ứng dụng hệ thống. F-Droid là một kho ứng dụng FOSS (tự do và mã nguồn mở) cài đặt được trên nền tảng Android. Ứng dụng F-Droid giúp bạn tìm kiếm, cài đặt và theo dõi cập nhật dễ dàng hơn. Nếu bạn của bạn có NFC, hãy chạm hai điện thoại vào nhau. Vào cùng một mạng Wi-Fi với bạn của bạn diff --git a/F-Droid/res/values-zh-rHK/strings.xml b/F-Droid/res/values-zh-rHK/strings.xml index 1da68ffd7..23a6a8a5a 100644 --- a/F-Droid/res/values-zh-rHK/strings.xml +++ b/F-Droid/res/values-zh-rHK/strings.xml @@ -145,7 +145,7 @@ 要求 root 權限中… Root 權限被拒絕 更新所有應用程式 - 系統權限被拒絕 + 系統權限被拒絕 F-Droid 是一個為 Android 而設,可供安裝的自由開源應用程式目錄。F-Droid 讓您更容易瀏覽、安裝和管理在您裝置上的應用程式更新。 交換應用程式 交換應用程式 diff --git a/F-Droid/res/values/strings.xml b/F-Droid/res/values/strings.xml index 602f7fc41..be82aaecb 100644 --- a/F-Droid/res/values/strings.xml +++ b/F-Droid/res/values/strings.xml @@ -27,10 +27,10 @@ Show a notification when updates are available Update history Days to consider apps new or recent: %s - Enable privileged F-Droid - Use privileged permissions to install, update, and remove packages - Uninstall privileged F-Droid - Uninstalls the additional privileged F-Droid app + Privileged Extension + Use F-Droid Privileged Extension to install, update, and remove packages + Update/Uninstall Privileged Extension + Open details screen of Privileged Extension to update/uninstall it. Name of your Local Repo The advertised title of your local repo: %s Use Private Connection @@ -257,23 +257,26 @@ An error occurred while parsing the package Uninstall error Failed to uninstall due to an unknown error - Privileged F-Droid is not available - This option is only available when privileged F-Droid is installed. - Install privileged F-Droid - Install privileged F-Droid? + F-Droid Privileged Extension is not available + This option is only available when F-Droid Privileged Extension is installed. + Install + Open Extension + Install F-Droid Privileged Extension? Touch for more information. - Touch to install privileged F-Droid, tightly coupled with the Android operating system. This allows F-Droid to install, upgrade and uninstall apps on its own.\nYou can also do this later from F-Droid\'s preferences. - Successfully installed privileged F-Droid - Installation of privileged F-Droid failed - Privileged F-Droid has been successfully installed. This allows F-Droid to install, upgrade and uninstall apps on its own. - The installation of privileged F-Droid has failed. The installation method is not supported by all Android distributions, please consult the F-Droid bug tracker for more information. - Installing… - Uninstalling… - Do you want to install privileged F-Droid?\nThis takes up to 10 seconds. - Do you want to install privileged F-Droid?\nThis takes up to 10 seconds and the device will be rebooted afterwards. - Looks like you have root access on your device. You can now install privileged F-Droid, tightly coupled with the Android operating system. This allows F-Droid to install, upgrade and uninstall apps on its own. - Do you want to uninstall privileged F-Droid? - This will uninstall privileged F-Droid. + Touch to install F-Droid Privileged Extension, tightly coupled with the Android operating system. This allows F-Droid to install, upgrade and uninstall apps on its own.\nYou can also do this later from F-Droid\'s preferences. + Successfully installed F-Droid Privileged Extension + Installation of F-Droid Privileged Extension failed + F-Droid Privileged Extension has been successfully installed. This allows F-Droid to install, upgrade and uninstall apps on its own. + The installation of F-Droid Privileged Extension has failed. The installation method is not supported by all Android distributions, please consult the F-Droid bug tracker for more information. + installing… + installing and rebooting… + uninstalling… + Do you want to install F-Droid Privileged Extension? + This takes up to 10 seconds. + This takes up to 10 seconds and the device will be <b>rebooted</b> afterwards. + Looks like you have root access on your device. You can now install F-Droid Privileged Extension, tightly coupled with the Android operating system. This allows F-Droid to install, upgrade and uninstall apps on its own. + Do you want to uninstall F-Droid Privileged Extension? + This will uninstall F-Droid Privileged Extension. Uninstall F-Droid is an installable catalogue of FOSS (Free and Open Source Software) applications for the Android platform. The client makes it easy to browse, install, and keep track of updates on your device. diff --git a/F-Droid/src/org/fdroid/fdroid/FDroid.java b/F-Droid/src/org/fdroid/fdroid/FDroid.java index d8638de06..b6dc34601 100644 --- a/F-Droid/src/org/fdroid/fdroid/FDroid.java +++ b/F-Droid/src/org/fdroid/fdroid/FDroid.java @@ -43,7 +43,7 @@ import android.widget.Toast; import org.fdroid.fdroid.compat.TabManager; import org.fdroid.fdroid.data.AppProvider; import org.fdroid.fdroid.data.NewRepoConfig; -import org.fdroid.fdroid.privileged.install.InstallPrivilegedDialogActivity; +import org.fdroid.fdroid.privileged.install.InstallExtensionDialogActivity; import org.fdroid.fdroid.views.AppListFragmentPagerAdapter; import org.fdroid.fdroid.views.ManageReposActivity; import org.fdroid.fdroid.views.swap.SwapWorkflowActivity; @@ -97,7 +97,7 @@ public class FDroid extends ActionBarActivity { Uri uri = AppProvider.getContentUri(); getContentResolver().registerContentObserver(uri, true, new AppObserver()); - InstallPrivilegedDialogActivity.firstTime(this); + InstallExtensionDialogActivity.firstTime(this); if (UpdateService.isNetworkAvailableForUpdate(this)) { UpdateService.updateNow(this); diff --git a/F-Droid/src/org/fdroid/fdroid/installer/Installer.java b/F-Droid/src/org/fdroid/fdroid/installer/Installer.java index 97517e9f9..e6a6e3f46 100644 --- a/F-Droid/src/org/fdroid/fdroid/installer/Installer.java +++ b/F-Droid/src/org/fdroid/fdroid/installer/Installer.java @@ -27,7 +27,7 @@ import android.util.Log; import org.fdroid.fdroid.Preferences; import org.fdroid.fdroid.Utils; -import org.fdroid.fdroid.privileged.install.InstallPrivilegedDialogActivity; +import org.fdroid.fdroid.privileged.install.InstallExtensionDialogActivity; import java.io.File; import java.util.List; @@ -109,7 +109,7 @@ abstract public class Installer { // system permissions and pref enabled -> SystemInstaller boolean isSystemInstallerEnabled = Preferences.get().isPrivilegedInstallerEnabled(); if (isSystemInstallerEnabled) { - if (PrivilegedInstaller.isAvailable(activity)) { + if (PrivilegedInstaller.isExtensionInstalledCorrectly(activity)) { Utils.debugLog(TAG, "system permissions -> SystemInstaller"); try { @@ -164,9 +164,9 @@ abstract public class Installer { return; } - Intent installIntent = new Intent(activity, InstallPrivilegedDialogActivity.class); - installIntent.setAction(InstallPrivilegedDialogActivity.ACTION_INSTALL); - installIntent.putExtra(InstallPrivilegedDialogActivity.EXTRA_INSTALL_APK, apkFile.getAbsolutePath()); + Intent installIntent = new Intent(activity, InstallExtensionDialogActivity.class); + installIntent.setAction(InstallExtensionDialogActivity.ACTION_INSTALL); + installIntent.putExtra(InstallExtensionDialogActivity.EXTRA_INSTALL_APK, apkFile.getAbsolutePath()); activity.startActivity(installIntent); return; } @@ -195,6 +195,22 @@ abstract public class Installer { return; } + // special case: Install F-Droid Privileged + if (packageName != null && packageName.equals(PrivilegedInstaller.PRIVILEGED_PACKAGE_NAME)) { + Activity activity; + try { + activity = (Activity) mContext; + } catch (ClassCastException e) { + Log.d(TAG, "F-Droid Privileged can only be uninstalled using an activity!"); + return; + } + + Intent uninstallIntent = new Intent(activity, InstallExtensionDialogActivity.class); + uninstallIntent.setAction(InstallExtensionDialogActivity.ACTION_UNINSTALL); + activity.startActivity(uninstallIntent); + return; + } + deletePackageInternal(packageName); } diff --git a/F-Droid/src/org/fdroid/fdroid/installer/PrivilegedInstaller.java b/F-Droid/src/org/fdroid/fdroid/installer/PrivilegedInstaller.java index 6e588336a..8c4bc826d 100644 --- a/F-Droid/src/org/fdroid/fdroid/installer/PrivilegedInstaller.java +++ b/F-Droid/src/org/fdroid/fdroid/installer/PrivilegedInstaller.java @@ -87,15 +87,22 @@ public class PrivilegedInstaller extends Installer { this.mActivity = activity; } - public static boolean isAvailable(Context context) { - - // check if installed + public static boolean isExtensionInstalled(Context context) { PackageManager pm = context.getPackageManager(); try { pm.getPackageInfo(PRIVILEGED_PACKAGE_NAME, PackageManager.GET_ACTIVITIES); + return true; } catch (PackageManager.NameNotFoundException e) { return false; } + } + + public static boolean isExtensionInstalledCorrectly(Context context) { + + // check if installed + if (!isExtensionInstalled(context)) { + return false; + } // check if it has the privileged permissions granted final Object mutex = new Object(); diff --git a/F-Droid/src/org/fdroid/fdroid/privileged/install/InstallPrivileged.java b/F-Droid/src/org/fdroid/fdroid/privileged/install/InstallExtension.java similarity index 69% rename from F-Droid/src/org/fdroid/fdroid/privileged/install/InstallPrivileged.java rename to F-Droid/src/org/fdroid/fdroid/privileged/install/InstallExtension.java index 181244071..34146915d 100644 --- a/F-Droid/src/org/fdroid/fdroid/privileged/install/InstallPrivileged.java +++ b/F-Droid/src/org/fdroid/fdroid/privileged/install/InstallExtension.java @@ -36,17 +36,17 @@ import eu.chainfire.libsuperuser.Shell; * http://omerjerk.in/2014/08/how-to-install-an-app-to-system-partition/ * https://github.com/omerjerk/RemoteDroid/blob/master/app/src/main/java/in/omerjerk/remotedroid/app/MainActivity.java */ -abstract class InstallPrivileged { +abstract class InstallExtension { protected final Context context; private static final String APK_FILE_NAME = "FDroidPrivileged.apk"; - public InstallPrivileged(final Context context) { + public InstallExtension(final Context context) { this.context = context; } - public static InstallPrivileged create(final Context context) { + public static InstallExtension create(final Context context) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { return new LollipopImpl(context); } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { @@ -56,32 +56,27 @@ abstract class InstallPrivileged { } } + final void runInstall(String apkPath) { + onPreInstall(); + Shell.SU.run(getInstallCommands(apkPath)); + } + + final void runUninstall() { + Shell.SU.run(getUninstallCommands()); + } + protected abstract String getSystemFolder(); protected void onPreInstall() { // To be overridden by relevant base class[es] } - public String getWarningInfo() { - return context.getString(R.string.system_install_question); + public String getWarningString() { + return context.getString(R.string.system_install_warning); } - final void runUninstall() { - final String[] commands = { - "am force-stop " + PrivilegedInstaller.PRIVILEGED_PACKAGE_NAME, - "pm clear " + PrivilegedInstaller.PRIVILEGED_PACKAGE_NAME, - "mount -o rw,remount /system", - "pm uninstall " + PrivilegedInstaller.PRIVILEGED_PACKAGE_NAME, - "rm -f " + getInstallPath(), - "sleep 5", - "mount -o ro,remount /system" - }; - Shell.SU.run(commands); - } - - final void runInstall(String apkPath) { - onPreInstall(); - Shell.SU.run(getInstallCommands(apkPath)); + public String getInstallingString() { + return context.getString(R.string.system_install_installing); } protected String getInstallPath() { @@ -111,11 +106,35 @@ abstract class InstallPrivileged { protected List getPostInstallCommands() { final List commands = new ArrayList<>(1); - commands.add("am start -n org.fdroid.fdroid/.installer.InstallIntoSystemDialogActivity --ez post_install true"); + commands.add("am start -n org.fdroid.fdroid/.privileged.install.InstallExtensionDialogActivity --ez " + + InstallExtensionDialogActivity.ACTION_POST_INSTALL + " true"); return commands; } - private static class PreKitKatImpl extends InstallPrivileged { + private List getUninstallCommands() { + final List commands = new ArrayList<>(); + commands.add("am force-stop " + PrivilegedInstaller.PRIVILEGED_PACKAGE_NAME); + commands.add("pm clear " + PrivilegedInstaller.PRIVILEGED_PACKAGE_NAME); + commands.add("mount -o rw,remount /system"); + commands.add("pm uninstall " + PrivilegedInstaller.PRIVILEGED_PACKAGE_NAME); + commands.addAll(getCleanUninstallCommands()); + commands.add("sleep 5"); + commands.add("mount -o ro,remount /system"); + commands.addAll(getPostUninstallCommands()); + return commands; + } + + protected List getCleanUninstallCommands() { + final List commands = new ArrayList<>(1); + commands.add("rm -f " + getInstallPath()); + return commands; + } + + protected List getPostUninstallCommands() { + return new ArrayList<>(0); + } + + private static class PreKitKatImpl extends InstallExtension { public PreKitKatImpl(Context context) { super(context); @@ -128,7 +147,7 @@ abstract class InstallPrivileged { } - private static class KitKatToLollipopImpl extends InstallPrivileged { + private static class KitKatToLollipopImpl extends InstallExtension { public KitKatToLollipopImpl(Context context) { super(context); @@ -149,7 +168,7 @@ abstract class InstallPrivileged { * History of PackageManagerService in Lollipop: * https://github.com/android/platform_frameworks_base/commits/lollipop-release/services/core/java/com/android/server/pm/PackageManagerService.java */ - private static class LollipopImpl extends InstallPrivileged { + private static class LollipopImpl extends InstallExtension { public LollipopImpl(Context context) { super(context); @@ -161,8 +180,12 @@ abstract class InstallPrivileged { Preferences.get().setPostPrivilegedInstall(true); } - public String getWarningInfo() { - return context.getString(R.string.system_install_question_lollipop); + public String getWarningString() { + return context.getString(R.string.system_install_warning_lollipop); + } + + public String getInstallingString() { + return context.getString(R.string.system_install_installing_rebooting); } /** @@ -204,6 +227,23 @@ abstract class InstallPrivileged { return commands; } + @Override + protected List getCleanUninstallCommands() { + final List commands = new ArrayList<>(2); + commands.add("rm -f " + getInstallPath()); + commands.add("rm -f " + getSystemFolder()); + return commands; + } + + @Override + protected List getPostUninstallCommands() { + List commands = new ArrayList<>(3); + commands.add("am broadcast -a android.intent.action.ACTION_SHUTDOWN"); + commands.add("sleep 1"); + commands.add("reboot"); + return commands; + } + } } diff --git a/F-Droid/src/org/fdroid/fdroid/privileged/install/InstallPrivilegedBootReceiver.java b/F-Droid/src/org/fdroid/fdroid/privileged/install/InstallExtensionBootReceiver.java similarity index 87% rename from F-Droid/src/org/fdroid/fdroid/privileged/install/InstallPrivilegedBootReceiver.java rename to F-Droid/src/org/fdroid/fdroid/privileged/install/InstallExtensionBootReceiver.java index 9a1cc0173..f69d1d397 100644 --- a/F-Droid/src/org/fdroid/fdroid/privileged/install/InstallPrivilegedBootReceiver.java +++ b/F-Droid/src/org/fdroid/fdroid/privileged/install/InstallExtensionBootReceiver.java @@ -25,7 +25,7 @@ import android.content.Intent; import org.fdroid.fdroid.Preferences; -public class InstallPrivilegedBootReceiver extends BroadcastReceiver { +public class InstallExtensionBootReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { @@ -33,8 +33,8 @@ public class InstallPrivilegedBootReceiver extends BroadcastReceiver { if (Preferences.get().isPostPrivilegedInstall()) { Preferences.get().setPostPrivilegedInstall(false); - Intent postInstall = new Intent(context.getApplicationContext(), InstallPrivilegedDialogActivity.class); - postInstall.setAction(InstallPrivilegedDialogActivity.ACTION_POST_INSTALL); + Intent postInstall = new Intent(context.getApplicationContext(), InstallExtensionDialogActivity.class); + postInstall.setAction(InstallExtensionDialogActivity.ACTION_POST_INSTALL); postInstall.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(postInstall); } diff --git a/F-Droid/src/org/fdroid/fdroid/privileged/install/InstallPrivilegedDialogActivity.java b/F-Droid/src/org/fdroid/fdroid/privileged/install/InstallExtensionDialogActivity.java similarity index 75% rename from F-Droid/src/org/fdroid/fdroid/privileged/install/InstallPrivilegedDialogActivity.java rename to F-Droid/src/org/fdroid/fdroid/privileged/install/InstallExtensionDialogActivity.java index fc126c131..0add420a7 100644 --- a/F-Droid/src/org/fdroid/fdroid/privileged/install/InstallPrivilegedDialogActivity.java +++ b/F-Droid/src/org/fdroid/fdroid/privileged/install/InstallExtensionDialogActivity.java @@ -48,7 +48,7 @@ import eu.chainfire.libsuperuser.Shell; /** * Note: This activity has no view on its own, it displays consecutive dialogs. */ -public class InstallPrivilegedDialogActivity extends FragmentActivity { +public class InstallExtensionDialogActivity extends FragmentActivity { private static final String TAG = "InstallIntoSystem"; @@ -81,7 +81,7 @@ public class InstallPrivilegedDialogActivity extends FragmentActivity { uninstall(); break; case ACTION_INSTALL: - checkRootTask.execute(); + askBeforeInstall(); break; case ACTION_FIRST_TIME: checkRootTask.execute(); @@ -96,7 +96,7 @@ public class InstallPrivilegedDialogActivity extends FragmentActivity { if (Preferences.get().isFirstTime()) { Preferences.get().setFirstTime(false); - if (PrivilegedInstaller.isAvailable(context)) { + if (PrivilegedInstaller.isExtensionInstalledCorrectly(context)) { Preferences.get().setPrivilegedInstallerEnabled(true); } else { runFirstTime(context); @@ -123,8 +123,8 @@ public class InstallPrivilegedDialogActivity extends FragmentActivity { if (false && probablyRoot) { // looks like we have root, at least su has a version number and is present - Intent installIntent = new Intent(context, InstallPrivilegedDialogActivity.class); - installIntent.setAction(InstallPrivilegedDialogActivity.ACTION_FIRST_TIME); + Intent installIntent = new Intent(context, InstallExtensionDialogActivity.class); + installIntent.setAction(InstallExtensionDialogActivity.ACTION_FIRST_TIME); installIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); PendingIntent resultPendingIntent = @@ -165,19 +165,19 @@ public class InstallPrivilegedDialogActivity extends FragmentActivity { * first time */ private void firstTime() { - // hack to get holo design (which is not automatically applied due to activity's Theme.NoDisplay + // hack to get theme applied (which is not automatically applied due to activity's Theme.NoDisplay ContextThemeWrapper theme = new ContextThemeWrapper(this, FDroidApp.getCurThemeResId()); String message = getString(R.string.system_install_first_time_message) + "

" - + InstallPrivileged.create(getApplicationContext()).getWarningInfo(); + + getString(R.string.system_install_question); AlertDialog.Builder builder = new AlertDialog.Builder(theme) .setMessage(Html.fromHtml(message)) - .setPositiveButton(R.string.system_permission_install_via_root, new DialogInterface.OnClickListener() { + .setPositiveButton(R.string.system_install_button_open, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { // Open details of F-Droid Privileged - Intent intent = new Intent(InstallPrivilegedDialogActivity.this, AppDetails.class); + Intent intent = new Intent(InstallExtensionDialogActivity.this, AppDetails.class); intent.putExtra(AppDetails.EXTRA_APPID, PrivilegedInstaller.PRIVILEGED_PACKAGE_NAME); startActivity(intent); @@ -186,13 +186,37 @@ public class InstallPrivilegedDialogActivity extends FragmentActivity { .setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { - InstallPrivilegedDialogActivity.this.setResult(Activity.RESULT_CANCELED); - InstallPrivilegedDialogActivity.this.finish(); + InstallExtensionDialogActivity.this.setResult(Activity.RESULT_CANCELED); + InstallExtensionDialogActivity.this.finish(); } }); builder.create().show(); } + public void askBeforeInstall() { + // hack to get theme applied (which is not automatically applied due to activity's Theme.NoDisplay + ContextThemeWrapper theme = new ContextThemeWrapper(this, FDroidApp.getCurThemeResId()); + + AlertDialog.Builder alertBuilder = new AlertDialog.Builder(theme); + alertBuilder.setTitle(R.string.system_install_question); + String message = InstallExtension.create(getApplicationContext()).getWarningString(); + alertBuilder.setMessage(Html.fromHtml(message)); + alertBuilder.setPositiveButton(R.string.system_install_button_install, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + checkRootTask.execute(); + } + }); + alertBuilder.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + InstallExtensionDialogActivity.this.setResult(Activity.RESULT_CANCELED); + InstallExtensionDialogActivity.this.finish(); + } + }); + alertBuilder.create().show(); + } + /** * 1. Check for root access */ @@ -203,8 +227,8 @@ public class InstallPrivilegedDialogActivity extends FragmentActivity { protected void onPreExecute() { super.onPreExecute(); - // hack to get holo design (which is not automatically applied due to activity's Theme.NoDisplay - ContextThemeWrapper theme = new ContextThemeWrapper(InstallPrivilegedDialogActivity.this, + // hack to get theme applied (which is not automatically applied due to activity's Theme.NoDisplay + ContextThemeWrapper theme = new ContextThemeWrapper(InstallExtensionDialogActivity.this, FDroidApp.getCurThemeResId()); mProgressDialog = new ProgressDialog(theme); @@ -243,8 +267,8 @@ public class InstallPrivilegedDialogActivity extends FragmentActivity { // root access denied if (!ACTION_FIRST_TIME.equals(action)) { - // hack to get holo design (which is not automatically applied due to activity's Theme.NoDisplay - ContextThemeWrapper theme = new ContextThemeWrapper(InstallPrivilegedDialogActivity.this, + // hack to get theme applied (which is not automatically applied due to activity's Theme.NoDisplay + ContextThemeWrapper theme = new ContextThemeWrapper(InstallExtensionDialogActivity.this, FDroidApp.getCurThemeResId()); AlertDialog.Builder alertBuilder = new AlertDialog.Builder(theme) @@ -253,8 +277,8 @@ public class InstallPrivilegedDialogActivity extends FragmentActivity { .setNeutralButton(android.R.string.ok, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { - InstallPrivilegedDialogActivity.this.setResult(Activity.RESULT_CANCELED); - InstallPrivilegedDialogActivity.this.finish(); + InstallExtensionDialogActivity.this.setResult(Activity.RESULT_CANCELED); + InstallExtensionDialogActivity.this.finish(); } }); alertBuilder.create().show(); @@ -273,12 +297,12 @@ public class InstallPrivilegedDialogActivity extends FragmentActivity { protected void onPreExecute() { super.onPreExecute(); - // hack to get holo design (which is not automatically applied due to activity's Theme.NoDisplay - ContextThemeWrapper theme = new ContextThemeWrapper(InstallPrivilegedDialogActivity.this, + // hack to get theme applied (which is not automatically applied due to activity's Theme.NoDisplay + ContextThemeWrapper theme = new ContextThemeWrapper(InstallExtensionDialogActivity.this, FDroidApp.getCurThemeResId()); mProgressDialog = new ProgressDialog(theme); - mProgressDialog.setMessage(getString(R.string.system_install_installing)); + mProgressDialog.setMessage(InstallExtension.create(getApplicationContext()).getInstallingString()); mProgressDialog.setIndeterminate(true); mProgressDialog.setCancelable(false); mProgressDialog.show(); @@ -286,7 +310,7 @@ public class InstallPrivilegedDialogActivity extends FragmentActivity { @Override protected Void doInBackground(Void... voids) { - InstallPrivileged.create(getApplicationContext()).runInstall(apkFile); + InstallExtension.create(getApplicationContext()).runInstall(apkFile); return null; } }; @@ -295,10 +319,10 @@ public class InstallPrivilegedDialogActivity extends FragmentActivity { * 3. Verify that install worked */ private void postInstall() { - // hack to get holo design (which is not automatically applied due to activity's Theme.NoDisplay + // hack to get theme applied (which is not automatically applied due to activity's Theme.NoDisplay ContextThemeWrapper theme = new ContextThemeWrapper(this, FDroidApp.getCurThemeResId()); - final boolean success = PrivilegedInstaller.isAvailable(this); + final boolean success = PrivilegedInstaller.isExtensionInstalledCorrectly(this); // enable system installer on installation success Preferences.get().setPrivilegedInstallerEnabled(success); @@ -309,9 +333,9 @@ public class InstallPrivilegedDialogActivity extends FragmentActivity { .setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { - InstallPrivilegedDialogActivity.this.setResult(success ? Activity.RESULT_OK : Activity.RESULT_CANCELED); - InstallPrivilegedDialogActivity.this.finish(); - startActivity(new Intent(InstallPrivilegedDialogActivity.this, FDroid.class)); + InstallExtensionDialogActivity.this.setResult(success ? Activity.RESULT_OK : Activity.RESULT_CANCELED); + InstallExtensionDialogActivity.this.finish(); + startActivity(new Intent(InstallExtensionDialogActivity.this, FDroid.class)); } }) .setCancelable(false); @@ -319,15 +343,18 @@ public class InstallPrivilegedDialogActivity extends FragmentActivity { } private void uninstall() { - // hack to get holo design (which is not automatically applied due to activity's Theme.NoDisplay + // hack to get theme applied (which is not automatically applied due to activity's Theme.NoDisplay ContextThemeWrapper theme = new ContextThemeWrapper(this, FDroidApp.getCurThemeResId()); - final boolean isAvailable = PrivilegedInstaller.isAvailable(this); + final boolean isInstalled = PrivilegedInstaller.isExtensionInstalled(this); + + if (isInstalled) { + String message = getString(R.string.system_uninstall_message) + "

" + + InstallExtension.create(getApplicationContext()).getWarningString(); - if (isAvailable) { AlertDialog.Builder builder = new AlertDialog.Builder(theme) .setTitle(R.string.system_uninstall) - .setMessage(R.string.system_uninstall_message) + .setMessage(Html.fromHtml(message)) .setPositiveButton(R.string.system_uninstall_button, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { @@ -337,23 +364,13 @@ public class InstallPrivilegedDialogActivity extends FragmentActivity { .setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { - InstallPrivilegedDialogActivity.this.setResult(Activity.RESULT_CANCELED); - InstallPrivilegedDialogActivity.this.finish(); + InstallExtensionDialogActivity.this.setResult(Activity.RESULT_CANCELED); + InstallExtensionDialogActivity.this.finish(); } }); builder.create().show(); } else { - AlertDialog.Builder builder = new AlertDialog.Builder(theme) - .setTitle(R.string.system_permission_denied_title) - .setMessage(getString(R.string.system_permission_denied_body)) - .setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, int which) { - InstallPrivilegedDialogActivity.this.setResult(Activity.RESULT_CANCELED); - InstallPrivilegedDialogActivity.this.finish(); - } - }); - builder.create().show(); + throw new RuntimeException("Uninstall invoked, but extension is not installed!"); } } @@ -364,8 +381,8 @@ public class InstallPrivilegedDialogActivity extends FragmentActivity { protected void onPreExecute() { super.onPreExecute(); - // hack to get holo design (which is not automatically applied due to activity's Theme.NoDisplay - ContextThemeWrapper theme = new ContextThemeWrapper(InstallPrivilegedDialogActivity.this, + // hack to get theme applied (which is not automatically applied due to activity's Theme.NoDisplay + ContextThemeWrapper theme = new ContextThemeWrapper(InstallExtensionDialogActivity.this, FDroidApp.getCurThemeResId()); mProgressDialog = new ProgressDialog(theme); @@ -377,7 +394,7 @@ public class InstallPrivilegedDialogActivity extends FragmentActivity { @Override protected Void doInBackground(Void... voids) { - InstallPrivileged.create(getApplicationContext()).runUninstall(); + InstallExtension.create(getApplicationContext()).runUninstall(); return null; } diff --git a/F-Droid/src/org/fdroid/fdroid/views/fragments/PreferencesFragment.java b/F-Droid/src/org/fdroid/fdroid/views/fragments/PreferencesFragment.java index 00226f399..7d3c760b9 100644 --- a/F-Droid/src/org/fdroid/fdroid/views/fragments/PreferencesFragment.java +++ b/F-Droid/src/org/fdroid/fdroid/views/fragments/PreferencesFragment.java @@ -3,7 +3,6 @@ package org.fdroid.fdroid.views.fragments; import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; -import android.os.Build; import android.os.Bundle; import android.preference.CheckBoxPreference; import android.preference.EditTextPreference; @@ -21,7 +20,6 @@ import org.fdroid.fdroid.PreferencesActivity; import org.fdroid.fdroid.R; import org.fdroid.fdroid.Utils; import org.fdroid.fdroid.installer.PrivilegedInstaller; -import org.fdroid.fdroid.privileged.install.InstallPrivilegedDialogActivity; import java.util.Locale; @@ -196,30 +194,25 @@ public class PreferencesFragment extends PreferenceFragment final CheckBoxPreference pref = (CheckBoxPreference) preference; if (pref.isChecked()) { - if (PrivilegedInstaller.isAvailable(getActivity())) { - // system-permission are granted, i.e. F-Droid is a system-app + if (PrivilegedInstaller.isExtensionInstalledCorrectly(getActivity())) { + // privileged permission are granted, i.e. the extension is installed correctly SharedPreferences.Editor editor = pref.getSharedPreferences().edit(); editor.putBoolean(Preferences.PREF_PRIVILEGED_INSTALLER, true); editor.commit(); pref.setChecked(true); } else { - // system-permission not available + // privileged permission not available SharedPreferences.Editor editor = pref.getSharedPreferences().edit(); editor.putBoolean(Preferences.PREF_PRIVILEGED_INSTALLER, false); editor.commit(); pref.setChecked(false); AlertDialog.Builder alertBuilder = new AlertDialog.Builder(getActivity()); - alertBuilder.setTitle(R.string.system_permission_denied_title); - String message = getActivity().getString(R.string.system_permission_denied_body) + - "

"; - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { - message += getActivity().getString(R.string.system_install_question_lollipop); - } else { - message += getActivity().getString(R.string.system_install_question); - } + alertBuilder.setTitle(R.string.system_install_denied_title); + String message = getActivity().getString(R.string.system_install_denied_body) + + "

" + getActivity().getString(R.string.system_install_question); alertBuilder.setMessage(Html.fromHtml(message)); - alertBuilder.setPositiveButton(R.string.system_permission_install_via_root, new DialogInterface.OnClickListener() { + alertBuilder.setPositiveButton(R.string.system_install_button_open, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { // Open details of F-Droid Privileged @@ -244,7 +237,7 @@ public class PreferencesFragment extends PreferenceFragment }); } - protected void initUninstallPrivilegedAppPreference() { + protected void initManagePrivilegedAppPreference() { Preference pref = findPreference(Preferences.PREF_UNINSTALL_PRIVILEGED_APP); pref.setPersistent(false); @@ -252,9 +245,11 @@ public class PreferencesFragment extends PreferenceFragment @Override public boolean onPreferenceClick(Preference preference) { - Intent uninstallIntent = new Intent(getActivity(), InstallPrivilegedDialogActivity.class); - uninstallIntent.setAction(InstallPrivilegedDialogActivity.ACTION_UNINSTALL); - startActivity(uninstallIntent); + // Open details of F-Droid Privileged + Intent intent = new Intent(getActivity(), AppDetails.class); + intent.putExtra(AppDetails.EXTRA_APPID, + PrivilegedInstaller.PRIVILEGED_PACKAGE_NAME); + startActivity(intent); return true; } @@ -284,7 +279,7 @@ public class PreferencesFragment extends PreferenceFragment } initPrivilegedInstallerPreference(); - initUninstallPrivilegedAppPreference(); + initManagePrivilegedAppPreference(); } @Override