Local properties

This commit is contained in:
M66B 2022-02-07 08:24:15 +01:00
parent 86c625e660
commit 00b33dabc4
2 changed files with 13 additions and 6 deletions

View File

@ -8,10 +8,11 @@ def getRevision = { -> return "a" }
def getReleaseName = { -> return "Fulgurotherium" }
// https://en.wikipedia.org/wiki/List_of_dinosaur_genera
def keystorePropertiesFile = rootProject.file("keystore.properties")
def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(rootProject.file("keystore.properties")))
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
Properties localProperties = new Properties()
localProperties.load(new FileInputStream(rootProject.file("local.properties")))
android {
compileSdkVersion 31
@ -155,6 +156,8 @@ android {
buildConfigField "String", "GITHUB_LATEST_API", "\"https://api.github.com/repos/M66B/FairEmail/releases/latest\""
buildConfigField "String", "GITHUB_LATEST_URI", "\"https://github.com/M66B/FairEmail/releases\""
buildConfigField "String", "GRAVATAR_URI", "\"https://www.gravatar.com/avatar/\""
buildConfigField "String", "GPA_URI", localProperties.getProperty("gpa.uri", "")
buildConfigField "String", "PAYPAL_URI", localProperties.getProperty("paypal.uri", "")
}
fdroid {
dimension "all"
@ -167,6 +170,8 @@ android {
buildConfigField "String", "GITHUB_LATEST_API", "\"https://api.github.com/repos/M66B/FairEmail/releases/latest\""
buildConfigField "String", "GITHUB_LATEST_URI", "\"https://github.com/M66B/FairEmail/releases\""
buildConfigField "String", "GRAVATAR_URI", "\"https://www.gravatar.com/avatar/\""
buildConfigField "String", "PAYPAL_URI", "\"\""
buildConfigField "String", "GPA_URI", "\"\""
}
play {
dimension "all"
@ -180,6 +185,8 @@ android {
buildConfigField "String", "GITHUB_LATEST_API", "\"\""
buildConfigField "String", "GITHUB_LATEST_URI", "\"\""
buildConfigField "String", "GRAVATAR_URI", "\"\""
buildConfigField "String", "PAYPAL_URI", "\"\""
buildConfigField "String", "GPA_URI", "\"\""
}
amazon {
dimension "all"
@ -193,6 +200,8 @@ android {
buildConfigField "String", "GITHUB_LATEST_API", "\"\""
buildConfigField "String", "GITHUB_LATEST_URI", "\"\""
buildConfigField "String", "GRAVATAR_URI", "\"\""
buildConfigField "String", "PAYPAL_URI", "\"\""
buildConfigField "String", "GPA_URI", "\"\""
}
}

View File

@ -1354,8 +1354,6 @@ public class HtmlHelper {
// geo:<lat>,<lon>[,<alt>][;u=<uncertainty>]
// tel:<phonenumber>
final Pattern GPA_PATTERN = Pattern.compile("GPA\\.\\d{4}-\\d{4}-\\d{4}-\\d{5}");
final String GPA_LINK = "https://play.google.com/console/u/0/developers/8420080860664580239/orders/";
final String PAYPAL = "https://www.paypal.com/activity/payment/";
final Pattern pattern = Pattern.compile(
"(((?i:mailto):)?" + PatternsCompat.AUTOLINK_EMAIL_ADDRESS.pattern() + ")|" +
PatternsCompat.AUTOLINK_WEB_URL.pattern()
@ -1378,7 +1376,7 @@ public class HtmlHelper {
Element parent = (Element) node.parentNode();
if ("faircode_txn_id".equals(parent.className())) {
Element a = document.createElement("a");
a.attr("href", PAYPAL + text.trim());
a.attr("href", BuildConfig.PAYPAL_URI + text.trim());
a.text(text);
tnode.before(a);
tnode.text("");
@ -1431,7 +1429,7 @@ public class HtmlHelper {
Element a = document.createElement("a");
if (BuildConfig.DEBUG && GPA_PATTERN.matcher(group).matches())
a.attr("href", GPA_LINK + group);
a.attr("href", BuildConfig.GPA_URI + group);
else
a.attr("href", (email ? "mailto:" : "") + group);
a.text(group);