Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 1.8.22 #262

Merged
merged 13 commits into from
May 25, 2024
64 changes: 44 additions & 20 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build release APK and prepare Github release draft
name: Build release artifacts and draft Github release

on:
# Trigger by pushing a version tag (which are protected)
Expand All @@ -14,17 +14,17 @@ permissions:
contents: write

jobs:
release:
build-release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'
- name: Get version name from git tag
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: Setup build tool version variable
shell: bash
Expand All @@ -33,15 +33,14 @@ jobs:
echo "BUILD_TOOL_VERSION=$BUILD_TOOL_VERSION" >> $GITHUB_ENV
echo Last build tool version is: $BUILD_TOOL_VERSION

- name: Get version name from git tag
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
# F-Droid APK

- name: Generate "fdroid" release APK
- name: Assemble F-Droid APK
run: ./gradlew assembleFdroidRelease --stacktrace
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Sign APK using key store from repo secrets

- name: Sign F-Droid APK
uses: r0adkll/sign-android-release@v1
id: sign_fdroid_apk
with:
Expand All @@ -52,23 +51,25 @@ jobs:
env:
BUILD_TOOLS_VERSION: ${{ env.BUILD_TOOL_VERSION }}

- name: Rename APK file
- name: Rename F-Droid APK file
run: mv ${{steps.sign_fdroid_apk.outputs.signedReleaseFile}} orgzly-revived-fdroid-${{ env.VERSION }}.apk

# "Premium" APK

- name: Add Dropbox app identifier
shell: bash
run: |
echo "dropbox.app_key = \"${{ secrets.DROPBOX_APP_KEY }}\"" >> app.properties
echo "dropbox.app_key_schema = \"db-${{ secrets.DROPBOX_APP_KEY }}\"" >> app.properties

- name: Generate "premium" release APK
- name: Assemble "premium" APK
run: ./gradlew assemblePremiumRelease --stacktrace
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Sign APK using key store from repo secrets
- name: Sign "premium" APK
uses: r0adkll/sign-android-release@v1
id: sign_apk
id: sign_premium_apk
with:
releaseDirectory: app/build/outputs/apk/premium/release
signingKeyBase64: ${{ secrets.APK_SIGNING_KEYSTORE_FILE }}
Expand All @@ -77,11 +78,34 @@ jobs:
env:
BUILD_TOOLS_VERSION: ${{ env.BUILD_TOOL_VERSION }}

- name: Rename APK file
run: mv ${{steps.sign_apk.outputs.signedReleaseFile}} orgzly-revived-${{ env.VERSION }}.apk
- name: Rename "premium" APK file
run: mv ${{steps.sign_premium_apk.outputs.signedReleaseFile}} orgzly-revived-${{ env.VERSION }}.apk

# "Premium" AAB

- name: Assemble "premium" AAB
run: ./gradlew bundlePremiumRelease --stacktrace
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Sign "premium" AAB
uses: r0adkll/sign-android-release@v1
id: sign_premium_aab
with:
releaseDirectory: app/build/outputs/bundle/premiumRelease
signingKeyBase64: ${{ secrets.APK_SIGNING_KEYSTORE_FILE }}
alias: orgzly-revived-20231013
keyStorePassword: ${{ secrets.APK_SIGNING_KEYSTORE_PASSWORD }}
env:
BUILD_TOOLS_VERSION: ${{ env.BUILD_TOOL_VERSION }}

- name: Rename "premium" AAB file
run: mv ${{steps.sign_premium_aab.outputs.signedReleaseFile}} orgzly-revived-${{ env.VERSION }}.aab

- name: Upload APK and create Github release draft
- name: Upload artifacts and create Github release draft
uses: softprops/action-gh-release@v1
with:
files: 'orgzly-revived-*.apk'
files: |
*.apk
*.aab
draft: true
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ android {
defaultConfig {
minSdkVersion 21
targetSdkVersion 33
versionCode 202
versionName "1.8.21"
versionCode 208
versionName "1.8.22"
applicationId = "com.orgzlyrevived"
resValue "string", "application_id", "com.orgzlyrevived"

Expand Down
3 changes: 3 additions & 0 deletions app/src/main/java/com/orgzly/android/sync/SyncState.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ data class SyncState(val type: Type, val message: String? = null, val current: I
FAILED_NO_CONNECTION,
FAILED_NO_STORAGE_PERMISSION,
FAILED_NO_BOOKS_FOUND,
FAILED_NO_ALARMS_PERMISSION,
FAILED_EXCEPTION
}

Expand All @@ -33,6 +34,7 @@ data class SyncState(val type: Type, val message: String? = null, val current: I
Type.FAILED_NO_CONNECTION,
Type.FAILED_NO_STORAGE_PERMISSION,
Type.FAILED_NO_BOOKS_FOUND,
Type.FAILED_NO_ALARMS_PERMISSION,
Type.FAILED_EXCEPTION ->
true
else ->
Expand Down Expand Up @@ -83,6 +85,7 @@ data class SyncState(val type: Type, val message: String? = null, val current: I
Type.FAILED_NO_REPOS -> getString(R.string.no_repos)
Type.FAILED_NO_CONNECTION -> getString(R.string.no_connection)
Type.FAILED_NO_STORAGE_PERMISSION -> getString(R.string.storage_permissions_missing)
Type.FAILED_NO_ALARMS_PERMISSION -> getString(R.string.alarms_permissions_missing)
Type.FAILED_NO_BOOKS_FOUND -> getString(R.string.no_books)
Type.FAILED_EXCEPTION -> message
}
Expand Down
30 changes: 30 additions & 0 deletions app/src/main/java/com/orgzly/android/sync/SyncWorker.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package com.orgzly.android.sync

import android.content.Context
import android.content.Intent
import android.net.Uri
import android.os.Build
import android.provider.Settings
import androidx.work.CoroutineWorker
import androidx.work.ForegroundInfo
import androidx.work.WorkerParameters
Expand All @@ -15,6 +19,7 @@ import com.orgzly.android.prefs.AppPreferences
import com.orgzly.android.reminders.RemindersScheduler
import com.orgzly.android.repos.*
import com.orgzly.android.ui.notifications.SyncNotifications
import com.orgzly.android.ui.util.getAlarmManager
import com.orgzly.android.ui.util.haveNetworkConnection
import com.orgzly.android.util.AppPermissions
import com.orgzly.android.util.LogMajorEvents
Expand Down Expand Up @@ -162,6 +167,31 @@ class SyncWorker(val context: Context, val params: WorkerParameters) :
}
}

/* Make sure we have permission to set alarms & reminders,
* since this typically happens when new books are parsed.
*/
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
if (!context.getAlarmManager().canScheduleExactAlarms()) {
if (
AppPreferences.remindersForDeadlineEnabled(context) ||
AppPreferences.remindersForScheduledEnabled(context) ||
AppPreferences.remindersForEventsEnabled(context)
) {
if (App.getCurrentActivity() != null) {
val uri = Uri.parse("package:" + BuildConfig.APPLICATION_ID)
App.getCurrentActivity().startActivity(
Intent(
Settings.ACTION_REQUEST_SCHEDULE_EXACT_ALARM,
uri
)
)
}
return SyncState.getInstance((SyncState.Type.FAILED_NO_ALARMS_PERMISSION))
}
}
}


return null
}

Expand Down
1 change: 1 addition & 0 deletions app/src/main/java/com/orgzly/android/ui/CommonFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ open class CommonFragment : Fragment() {
FAILED_NO_REPOS,
FAILED_NO_CONNECTION,
FAILED_NO_STORAGE_PERMISSION,
FAILED_NO_ALARMS_PERMISSION,
FAILED_NO_BOOKS_FOUND,
FAILED_EXCEPTION ->
progressIndicator.visibility = View.GONE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ class SyncFragment : Fragment() {
SyncState.Type.FAILED_NO_REPOS,
SyncState.Type.FAILED_NO_CONNECTION,
SyncState.Type.FAILED_NO_STORAGE_PERMISSION,
SyncState.Type.FAILED_NO_ALARMS_PERMISSION,
SyncState.Type.FAILED_NO_BOOKS_FOUND,
SyncState.Type.FAILED_EXCEPTION -> {
setAnimation(false)
Expand Down
25 changes: 25 additions & 0 deletions app/src/main/res/layout/dialog_whats_new.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,31 @@
android:layout_height="wrap_content" />


<TextView
style="@style/WhatsNewVersion"
android:text="v1.8.22"
tools:ignore="HardcodedText" />

<com.orgzly.android.ui.views.WhatsNewChange
style="@style/WhatsNewChange"
app:text="Prompt user to grant permission for alarms, notifications" />

<com.orgzly.android.ui.views.WhatsNewChange
style="@style/WhatsNewChange"
app:text="Temporarily disable Git repos in Play Store build" />

<com.orgzly.android.ui.views.WhatsNewChange
style="@style/WhatsNewChange"
app:text="Enable sync failure notifications by default" />

<com.orgzly.android.ui.views.WhatsNewChange
style="@style/WhatsNewChange"
app:text="Target Android 13" />

<com.orgzly.android.ui.views.WhatsNewChange
style="@style/WhatsNewChange"
app:text="Git repos: Lower the garbage collection threshold" />

<TextView
style="@style/WhatsNewVersion"
android:text="v1.8.21"
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,7 @@
</plurals>

<string name="storage_permissions_missing">No storage permission</string>
<string name="alarms_permissions_missing">No permission to set reminders</string>
<string name="file_does_not_exist">File does not exist: %s</string>

<string name="import_from">Import from “%1$s”?</string>
Expand Down
2 changes: 2 additions & 0 deletions metadata/en-US/changelogs/203.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
• Target Android 13
• Prompt user to grant permission for alarms, notifications
1 change: 1 addition & 0 deletions metadata/en-US/changelogs/206.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
• Enable sync failure notifications by default
4 changes: 4 additions & 0 deletions metadata/en-US/changelogs/208.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
• Target Android 13
• Prompt user to grant permission for alarms, notifications
• Enable sync failure notifications by default
• Git repos: Lower the garbage collection threshold
Loading