diff --git a/app/build.gradle b/app/build.gradle
index 90d03f8..bcbd522 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -28,26 +28,56 @@ android {
}
productFlavors {
- exodus {
+ exodus_google {
applicationId "org.eu.exodus_privacy.exodusprivacy"
+ buildConfigField "boolean", "amal", "false"
}
- amal {
+ amal_google {
applicationId "app.fedilab.amal"
+ buildConfigField "boolean", "amal", "true"
}
- fedilab {
+ fedilab_google {
applicationId "app.fedilab.exodusprivacy"
+ buildConfigField "boolean", "amal", "false"
+ }
+ exodus_fdroid {
+ applicationId "org.eu.exodus_privacy.exodusprivacy"
+ buildConfigField "boolean", "amal", "false"
+ }
+ amal_fdroid {
+ applicationId "app.fedilab.amal"
+ buildConfigField "boolean", "amal", "true"
+ }
+ fedilab_fdroid {
+ applicationId "app.fedilab.exodusprivacy"
+ buildConfigField "boolean", "amal", "false"
}
}
sourceSets {
- exodus {
+ exodus_google {
res.srcDirs = ['src/main/res', 'src/exodus/res']
+ manifest.srcFile 'src/google/AndroidManifest.xml'
}
- fedilab {
+ fedilab_google {
res.srcDirs = ['src/main/res', 'src/fedilab/res']
+ manifest.srcFile 'src/google/AndroidManifest.xml'
}
- amal {
+ amal_google {
res.srcDirs = ['src/main/res', 'src/amal/res']
+ manifest.srcFile 'src/google/AndroidManifest.xml'
+ }
+ exodus_fdroid {
+ res.srcDirs = ['src/main/res', 'src/exodus/res']
+ manifest.srcFile 'src/fdroid/AndroidManifest.xml'
+ }
+ fedilab_fdroid {
+ res.srcDirs = ['src/main/res', 'src/fedilab/res']
+ manifest.srcFile 'src/fdroid/AndroidManifest.xml'
+ }
+ amal_fdroid {
+ res.srcDirs = ['src/main/res', 'src/amal/res']
+ manifest.srcFile 'src/fdroid/AndroidManifest.xml'
}
}
diff --git a/app/src/fdroid/AndroidManifest.xml b/app/src/fdroid/AndroidManifest.xml
new file mode 100644
index 0000000..ce47612
--- /dev/null
+++ b/app/src/fdroid/AndroidManifest.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
diff --git a/app/src/google/AndroidManifest.xml b/app/src/google/AndroidManifest.xml
new file mode 100644
index 0000000..5cd9b43
--- /dev/null
+++ b/app/src/google/AndroidManifest.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 2f52e09..1b12e73 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -3,13 +3,10 @@
xmlns:tools="http://schemas.android.com/tools"
package="org.eu.exodus_privacy.exodusprivacy">
+
-
-
-
-
-
+
{
Uri uri;
//noinspection ConstantConditions
- if (BuildConfig.FLAVOR.equals("exodus")) {
+ if (!BuildConfig.amal) {
uri = Uri.parse("https://reports.exodus-privacy.eu.org/analysis/submit/#" + app_id);
} else {
uri = Uri.parse("https://exodus.phm.education.gouv.fr/analysis/submit/#" + app_id);
diff --git a/app/src/main/java/org/eu/exodus_privacy/exodusprivacy/Utils.java b/app/src/main/java/org/eu/exodus_privacy/exodusprivacy/Utils.java
index 3af03ea..d1c0ad5 100644
--- a/app/src/main/java/org/eu/exodus_privacy/exodusprivacy/Utils.java
+++ b/app/src/main/java/org/eu/exodus_privacy/exodusprivacy/Utils.java
@@ -5,9 +5,7 @@ import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.Signature;
-import android.content.res.Resources;
import android.os.Build;
-import android.util.DisplayMetrics;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
@@ -32,7 +30,7 @@ public class Utils {
public static final String LAST_REFRESH = "last_refresh";
public static String getDomain() {
- return BuildConfig.FLAVOR.compareTo("amal") == 0 ? "exodus.phm.education.gouv.fr" : "reports.exodus-privacy.eu.org";
+ return BuildConfig.amal ? "exodus.phm.education.gouv.fr" : "reports.exodus-privacy.eu.org";
}
@SuppressLint("PackageManagerGetSignatures")
@@ -283,18 +281,4 @@ public class Utils {
}
return builder.toString();
}
-
-
- /**
- * Converts dp to pixel
- *
- * @param dp float - the value in dp to convert
- * @param context Context
- * @return float - the converted value in pixel
- */
- public static float convertDpToPixel(float dp, Context context) {
- Resources resources = context.getResources();
- DisplayMetrics metrics = resources.getDisplayMetrics();
- return dp * ((float) metrics.densityDpi / DisplayMetrics.DENSITY_DEFAULT);
- }
}