FDroid -> F-Droid

Note: There's some FDroid instances in 80-fdroid.sh, that's intentional,
to remove old leftover files
diff --git a/README.md b/README.md
index 7573b77..1e4edf6 100644
--- a/README.md
+++ b/README.md
@@ -40,21 +40,21 @@
 
 ## How do I build it into my ROM?
 
-F-Droid Privileged Extension is designed to be built into ROMs and signed by the ROM key.  F-Droid only gets permissions via F-Droid Privileged Extension's internal key check, not via having a matching signing key or via `"signature" protectionLevel`.  This git repo includes an _Android.mk_ so it can be directly included via `repo`.   Add `FDroidPrivilegedExtension` to the `PRODUCT_PACKAGES` list to include it in the system image, and use a `repo` manifest like this:
+F-Droid Privileged Extension is designed to be built into ROMs and signed by the ROM key.  F-Droid only gets permissions via F-Droid Privileged Extension's internal key check, not via having a matching signing key or via `"signature" protectionLevel`.  This git repo includes an _Android.mk_ so it can be directly included via `repo`.   Add `F-DroidPrivilegedExtension` to the `PRODUCT_PACKAGES` list to include it in the system image, and use a `repo` manifest like this:
 
 ```xml
 <?xml version="1.0" encoding="UTF-8"?>
 <manifest>
 
   <remote name="fdroid" fetch="https://gitlab.com/fdroid/" />
-  <project path="packages/apps/FDroidPrivilegedExtension"
+  <project path="packages/apps/F-DroidPrivilegedExtension"
            name="privileged-extension.git" remote="fdroid"
            revision="refs/tags/0.2" />
 
 </manifest>
 ```
 
-By default, F-Droid Privileged Extension trusts only the official F-Droid builds, and we recommend that https://f-droid.org/FDroid.apk is also included in the ROM. You can verify the binaries using both the APK signature and the PGP key: https://f-droid.org/FDroid.apk.asc
+By default, F-Droid Privileged Extension trusts only the official F-Droid builds, and we recommend that https://f-droid.org/F-Droid.apk is also included in the ROM. You can verify the binaries using both the APK signature and the PGP key: https://f-droid.org/F-Droid.apk.asc
 
 APK signing certificate SHA-256 fingerprint:
 ```
@@ -120,11 +120,11 @@
 
     mkdir system
     mount -o loop system.img system
-    mkdir system/priv-app/FDroidPrivilegedExtension
+    mkdir system/priv-app/F-DroidPrivilegedExtension
 
-Copy the standalone APK to the above created 'FDroidPrivilegedExtension' folder
+Copy the standalone APK to the above created 'F-DroidPrivilegedExtension' folder
 After that, you need to set the correct SELinux context using:
 
-    chcon -R --reference=app/webview system/priv-app/FDroidPrivilegedExtension
+    chcon -R --reference=app/webview system/priv-app/F-DroidPrivilegedExtension
 
 Upon booting the emulator it should have the PrivExt installed, and one can also install the F-Droid app this way, or via the normal methods.
diff --git a/app/build.gradle b/app/build.gradle
index c26c228..b9c8b3a 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -39,7 +39,6 @@
     buildToolsVersion '24.0.0'
 
     defaultConfig {
-        archivesBaseName = "FDroidPrivilegedExtension"
         versionName getVersionName()
 
         testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
diff --git a/app/src/main/Android.mk b/app/src/main/Android.mk
index a9b5617..3959145 100644
--- a/app/src/main/Android.mk
+++ b/app/src/main/Android.mk
@@ -9,7 +9,7 @@
 include $(BUILD_PREBUILT)
 
 include $(CLEAR_VARS)
-LOCAL_PACKAGE_NAME := FDroidPrivilegedExtension
+LOCAL_PACKAGE_NAME := F-DroidPrivilegedExtension
 LOCAL_MODULE_TAGS := optional
 LOCAL_PRIVILEGED_MODULE := true
 LOCAL_SDK_VERSION := current
diff --git a/app/src/main/java/org/fdroid/fdroid/privileged/ClientWhitelist.java b/app/src/main/java/org/fdroid/fdroid/privileged/ClientWhitelist.java
index f42bbd8..c09f83f 100644
--- a/app/src/main/java/org/fdroid/fdroid/privileged/ClientWhitelist.java
+++ b/app/src/main/java/org/fdroid/fdroid/privileged/ClientWhitelist.java
@@ -31,7 +31,7 @@
 public class ClientWhitelist {
 
     public static HashSet<Pair<String, String>> whitelist = new HashSet<>(Arrays.asList(
-            // certificate SHA-256 of https//f-droid.org/FDroid.apk
+            // certificate SHA-256 of https//f-droid.org/F-Droid.apk
             new Pair<>("org.fdroid.fdroid", "43238d512c1e5eb2d6569f4a3afbf5523418b82e0a3ed1552770abb9a9c9ccab")
     ));
 
diff --git a/app/src/main/scripts/80-fdroid.sh b/app/src/main/scripts/80-fdroid.sh
index ec52bc5..f5dadf2 100644
--- a/app/src/main/scripts/80-fdroid.sh
+++ b/app/src/main/scripts/80-fdroid.sh
@@ -9,11 +9,11 @@
 
 list_files() {
 cat <<EOF
-app/FDroid.apk
-app/FDroid/FDroid.apk
+app/F-Droid.apk
+app/F-Droid/F-Droid.apk
 etc/permissions/permissions_org.fdroid.fdroid.privileged.xml
-priv-app/FDroidPrivilegedExtension.apk
-priv-app/FDroidPrivilegedExtension/FDroidPrivilegedExtension.apk
+priv-app/F-DroidPrivilegedExtension.apk
+priv-app/F-DroidPrivilegedExtension/F-DroidPrivilegedExtension.apk
 EOF
 }
 
diff --git a/app/src/main/scripts/update-binary b/app/src/main/scripts/update-binary
index 5d6683c..b793fe9 100755
--- a/app/src/main/scripts/update-binary
+++ b/app/src/main/scripts/update-binary
@@ -19,11 +19,11 @@
 # communicate with it using the recovery api.
 # arg 3 is the zip file
 
-echo -n -e 'ui_print Installing FDroidPrivilegedExtension...\n' > /proc/self/fd/$2
+echo -n -e 'ui_print Installing F-DroidPrivilegedExtension...\n' > /proc/self/fd/$2
 
-FPE_NAME=FDroidPrivilegedExtension
+FPE_NAME=F-DroidPrivilegedExtension
 FPE=${FPE_NAME}.apk
-FDROID_NAME=FDroid
+FDROID_NAME=F-Droid
 FDROID=${FDROID_NAME}.apk
 PERM_DIR="/system/etc/permissions"
 PERM=permissions_org.fdroid.fdroid.privileged.xml
@@ -46,6 +46,10 @@
 rm -f /system/app/FDroid*/*
 rm -f /system/priv-app/FDroid*
 rm -f /system/priv-app/FDroid*/*
+rm -f /system/app/F-Droid*
+rm -f /system/app/F-Droid*/*
+rm -f /system/priv-app/F-Droid*
+rm -f /system/priv-app/F-Droid*/*
 
 BUILD_VERSION_SDK="$(grep -F ro.build.version.sdk /system/build.prop)"
 BUILD_VERSION_SDK_INT="${BUILD_VERSION_SDK#*=}"
@@ -79,7 +83,7 @@
 echo -n -e 'ui_print done\n' > /proc/self/fd/$2
 echo -n -e 'ui_print\n' > /proc/self/fd/$2
 
-echo -n -e 'ui_print Installing FDroid...\n' > /proc/self/fd/$2
+echo -n -e 'ui_print Installing F-Droid...\n' > /proc/self/fd/$2
 cp ${FDROID} ${FDROIDDIR}
 chmod 644 ${FDROIDDIR}/${FDROID}
 
diff --git a/create_ota.sh b/create_ota.sh
index fac3ce5..c03d129 100755
--- a/create_ota.sh
+++ b/create_ota.sh
@@ -50,21 +50,21 @@
     ./gradlew assemble$(echo $VARIANT | tr 'dr' 'DR')
     OUT_DIR=$PROG_DIR/app/build/outputs/apk
     if [ $VARIANT == "debug" ]; then
-	cp $OUT_DIR/FDroidPrivilegedExtension-${VARIANT}.apk \
-	   $TMP_DIR/FDroidPrivilegedExtension.apk
-    elif [ -f $OUT_DIR/FDroidPrivilegedExtension-${VARIANT}-signed.apk ]; then
-	cp $OUT_DIR/FDroidPrivilegedExtension-${VARIANT}-signed.apk \
-	   $TMP_DIR/FDroidPrivilegedExtension.apk
+	cp $OUT_DIR/F-DroidPrivilegedExtension-${VARIANT}.apk \
+	   $TMP_DIR/F-DroidPrivilegedExtension.apk
+    elif [ -f $OUT_DIR/F-DroidPrivilegedExtension-${VARIANT}-signed.apk ]; then
+	cp $OUT_DIR/F-DroidPrivilegedExtension-${VARIANT}-signed.apk \
+	   $TMP_DIR/F-DroidPrivilegedExtension.apk
     else
-	cp $OUT_DIR/FDroidPrivilegedExtension-${VARIANT}-unsigned.apk \
-	   $TMP_DIR/FDroidPrivilegedExtension.apk
+	cp $OUT_DIR/F-DroidPrivilegedExtension-${VARIANT}-unsigned.apk \
+	   $TMP_DIR/F-DroidPrivilegedExtension.apk
     fi
 else
 	curl -L https://f-droid.org/repo/$PRIVEXT_APK > $TMP_DIR/$PRIVEXT_APK
 	curl -L https://f-droid.org/repo/${PRIVEXT_APK}.asc > $TMP_DIR/${PRIVEXT_APK}.asc
 	$GPG --verify $TMP_DIR/${PRIVEXT_APK}.asc
 	rm $TMP_DIR/${PRIVEXT_APK}.asc
-	mv $TMP_DIR/$PRIVEXT_APK $TMP_DIR/FDroidPrivilegedExtension.apk
+	mv $TMP_DIR/$PRIVEXT_APK $TMP_DIR/F-DroidPrivilegedExtension.apk
 fi
 
 # For both
@@ -72,13 +72,13 @@
 curl -L https://f-droid.org/${FDROID_APK}.asc > $TMP_DIR/${FDROID_APK}.asc
 $GPG --verify $TMP_DIR/${FDROID_APK}.asc
 rm $TMP_DIR/${FDROID_APK}.asc
-mv $TMP_DIR/$FDROID_APK $TMP_DIR/FDroid.apk
+mv $TMP_DIR/$FDROID_APK $TMP_DIR/F-Droid.apk
 
 # Make zip
 if [ -z $BINARIES ]; then
-	ZIPBASE=FDroidPrivilegedExtension-${GITVERSION}
+	ZIPBASE=F-DroidPrivilegedExtension-${GITVERSION}
 else
-	ZIPBASE=FDroidPrivilegedExtensionFromBinaries-${GITVERSION}
+	ZIPBASE=F-DroidPrivilegedExtensionFromBinaries-${GITVERSION}
 fi
 if [ $VARIANT == "debug" ]; then
 	ZIP=${ZIPBASE}-debug.zip