diff --git a/app/FDGH/release/app-FDGH-release.aab b/app/FDGH/release/app-FDGH-release.aab new file mode 100644 index 0000000..da25763 Binary files /dev/null and b/app/FDGH/release/app-FDGH-release.aab differ diff --git a/app/GPS/release/app-GPS-release.aab b/app/GPS/release/app-GPS-release.aab new file mode 100644 index 0000000..04dc3e0 Binary files /dev/null and b/app/GPS/release/app-GPS-release.aab differ diff --git a/app/build.gradle b/app/build.gradle index 55645f4..afb2ffb 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -11,13 +11,29 @@ android { applicationId 'com.saverio.wordoftheday_en' minSdkVersion 16 targetSdkVersion 30 - versionCode 14 - versionName '1.4' + versionCode 15 + versionName '1.4.1' multiDexEnabled true testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } + buildFeatures { + viewBinding true + } + + flavorDimensions "source_store" + productFlavors { + GPS { + dimension "source_store" + buildConfigField "String", "SOURCE_STORE", "\"GPS\"" + } + FDGH { + dimension "source_store" + buildConfigField "String", "SOURCE_STORE", "\"FD-GH\"" + } + } + buildTypes { release { minifyEnabled false diff --git a/app/release/app-release.aab b/app/release/app-release.apk similarity index 76% rename from app/release/app-release.aab rename to app/release/app-release.apk index eca528c..ecaa3d7 100644 Binary files a/app/release/app-release.aab and b/app/release/app-release.apk differ diff --git a/app/release/output-metadata.json b/app/release/output-metadata.json new file mode 100644 index 0000000..bbb5cb6 --- /dev/null +++ b/app/release/output-metadata.json @@ -0,0 +1,18 @@ +{ + "version": 2, + "artifactType": { + "type": "APK", + "kind": "Directory" + }, + "applicationId": "com.saverio.wordoftheday_en", + "variantName": "release", + "elements": [ + { + "type": "SINGLE", + "filters": [], + "versionCode": 14, + "versionName": "1.4", + "outputFile": "app-release.apk" + } + ] +} \ No newline at end of file diff --git a/app/src/main/java/com/saverio/wordoftheday_en/MainActivity.kt b/app/src/main/java/com/saverio/wordoftheday_en/MainActivity.kt index 358b7f9..85cdc5a 100644 --- a/app/src/main/java/com/saverio/wordoftheday_en/MainActivity.kt +++ b/app/src/main/java/com/saverio/wordoftheday_en/MainActivity.kt @@ -16,6 +16,8 @@ import androidx.appcompat.app.AppCompatActivity import androidx.constraintlayout.widget.ConstraintLayout import androidx.core.view.isGone import androidx.lifecycle.Observer +import com.saverio.wordoftheday_en.BuildConfig.SOURCE_STORE +import com.saverio.wordoftheday_en.MainActivity.Companion.SOURCE_STORE //import com.google.android.gms.ads.* import java.text.SimpleDateFormat import java.time.LocalDate @@ -31,6 +33,10 @@ class MainActivity : AppCompatActivity() { var attempts = 0 val maxAttempts = 5 + companion object { + const val SOURCE_STORE: String = BuildConfig.SOURCE_STORE + } + override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) @@ -98,6 +104,11 @@ class MainActivity : AppCompatActivity() { } copyButton.isGone = false + var url = "https://play.google.com/store/apps/details?id=com.saverio.wordoftheday_en" + if (SOURCE_STORE == "FD-GH") { + url = "https://f-droid.org/packages/com.saverio.wordoftheday_en" + } + val shareButton: ImageView = findViewById(R.id.shareButton) shareButton.setOnClickListener { shareText( @@ -105,7 +116,7 @@ class MainActivity : AppCompatActivity() { "{{*{{word}}*}}", word.toString() ) - .replace("{{*{{link}}*}}", "https://bit.ly/2XWj2Mb") + .replace("{{*{{link}}*}}", url) ) } shareButton.isGone = false diff --git a/app/src/main/java/com/saverio/wordoftheday_en/NotificationReceiver.kt b/app/src/main/java/com/saverio/wordoftheday_en/NotificationReceiver.kt index 8f563f7..fdb5553 100644 --- a/app/src/main/java/com/saverio/wordoftheday_en/NotificationReceiver.kt +++ b/app/src/main/java/com/saverio/wordoftheday_en/NotificationReceiver.kt @@ -32,8 +32,10 @@ class NotificationReceiver : BroadcastReceiver() { override fun onReceive(context: Context, intent: Intent) { this.context = context - var loadWord = LoadWord() - loadWord.loadWord(context, attempts, maxAttempts, pattern, notificationReceiver = this) + if (getPushNotifications(context)) { + var loadWord = LoadWord() + loadWord.loadWord(context, attempts, maxAttempts, pattern, notificationReceiver = this) + } } fun sendNow(title: String, text: String, number: Int) { diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 0a5210e..2cd467b 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -25,8 +25,8 @@ Show advertisements In this way you will support the developer freely - Show push notifications - You will receive a push notification every day at 07:00 am.\nThis could not work caused by OS battery optimisation + Show notifications + You will receive a notification every day at 07:00 am.\nThis could not work caused by OS battery optimisation Loading the word of the day… diff --git a/fastlane/metadata/android/en-US/changelogs/15.txt b/fastlane/metadata/android/en-US/changelogs/15.txt new file mode 100644 index 0000000..cec5b13 --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/15.txt @@ -0,0 +1 @@ +Published on F-Droid 🀩 \ No newline at end of file diff --git a/fastlane/metadata/android/en-US/full_description.txt b/fastlane/metadata/android/en-US/full_description.txt index 317badb..798078f 100644 --- a/fastlane/metadata/android/en-US/full_description.txt +++ b/fastlane/metadata/android/en-US/full_description.txt @@ -1,5 +1,5 @@ Every day the app offers a new word to learn, so you will have a vast vocabulary 😍 -You can read the definition of the word πŸ“š, its origin / etymology πŸ—ΊοΈ, its pronounciation / phonetics (RP-IPA) πŸ”Š. +You can read the definition of the word πŸ“š, its origin / etymology πŸ—ΊοΈ, its pronunciation / phonetics (RP-IPA) πŸ”Š. You can copy or share it as well! πŸ“² diff --git a/images/screenshots/feather.png b/images/screenshots/feather.png deleted file mode 100644 index 47bbe29..0000000 Binary files a/images/screenshots/feather.png and /dev/null differ diff --git a/images/screenshots/phone2.png b/images/screenshots/phone2.png deleted file mode 100644 index 23b05d0..0000000 Binary files a/images/screenshots/phone2.png and /dev/null differ diff --git a/server/api/index.php b/server/api/index.php new file mode 100644 index 0000000..8fc4068 --- /dev/null +++ b/server/api/index.php @@ -0,0 +1,47 @@ +set_charset("utf8"); +//GET data + $year = date('Y'); + $month = date("m"); + $day = date("d"); + + $today_date = "YEAR(`date`) = " . $year . " AND MONTH(`date`) = " . $month . " AND DAY(`date`) = " . $day; + + $sql = "SELECT * FROM wordoftheday_en WHERE ${today_date}"; + + $response = null; + + $r = $c->query($sql); + if ($r->num_rows == 1) { + $row = $r->fetch_array(); + $response["date"] = $row["date"]; + $response["word"] = ucfirst($row["word"]); + $response["definition"] = ucfirst($row["definition"]); + $response["type"] = $row["type"]; + $response["phonetics"] = $row["phonetics"]; + $response["etymology"] = ucfirst($row["etymology"]); + $response["source"] = $row["source"]; + } else { + $response["date"] = "null"; + $response["word"] = ""; + $response["definition"] = ""; + $response["type"] = ""; + $response["phonetics"] = ""; + $response["etymology"] = ""; + $response["source"] = ""; + } + + echo json_encode($response); +} else { + echo_null(); +} + +function echo_null() +{ + echo json_encode(null); +} + +?> \ No newline at end of file