chore(build): add google play variant (#558)
This commit is contained in:
parent
af9fe67fb8
commit
cf4e2384d9
6
.github/workflows/build_commit.yaml
vendored
6
.github/workflows/build_commit.yaml
vendored
@ -16,9 +16,5 @@ jobs:
|
||||
|
||||
- uses: actions/upload-artifact@v3.1.1
|
||||
with:
|
||||
name: github-${{ github.sha }}
|
||||
name: ReadYou-GitHub-Build-${{ github.sha }}
|
||||
path: app/build/outputs/apk/github/release/*.apk
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: fdroid-${{ github.sha }}
|
||||
path: app/build/outputs/apk/fdroid/release/*.apk
|
||||
|
24
.github/workflows/build_pull_request.yaml
vendored
24
.github/workflows/build_pull_request.yaml
vendored
@ -1,24 +0,0 @@
|
||||
name: "Build Pull Request"
|
||||
on: pull_request
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3.3.0
|
||||
- uses: actions/setup-java@v3.10.0
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: 17
|
||||
|
||||
- uses: gradle/gradle-build-action@v2.4.2
|
||||
- run: gradle assembleRelease
|
||||
|
||||
- uses: actions/upload-artifact@v3.1.1
|
||||
with:
|
||||
name: github-${{ github.sha }}
|
||||
path: app/build/outputs/apk/github/release/*.apk
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: fdroid-${{ github.sha }}
|
||||
path: app/build/outputs/apk/fdroid/release/*.apk
|
@ -44,6 +44,10 @@ android {
|
||||
fdroid {
|
||||
dimension "channel"
|
||||
}
|
||||
googlePlay {
|
||||
dimension "channel"
|
||||
applicationIdSuffix ".google.play"
|
||||
}
|
||||
github {
|
||||
dimension "channel"
|
||||
}
|
||||
|
55
app/src/googlePlay/AndroidManifest.xml
Normal file
55
app/src/googlePlay/AndroidManifest.xml
Normal file
@ -0,0 +1,55 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
|
||||
|
||||
<queries>
|
||||
<intent>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.APP_BROWSER" />
|
||||
</intent>
|
||||
<intent>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
</intent>
|
||||
</queries>
|
||||
|
||||
<application
|
||||
android:name=".infrastructure.android.AndroidApp"
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/read_you"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.Reader"
|
||||
android:usesCleartextTraffic="true">
|
||||
<activity
|
||||
android:name=".infrastructure.android.MainActivity"
|
||||
android:exported="true"
|
||||
android:theme="@style/Theme.Reader">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<provider
|
||||
android:name="androidx.startup.InitializationProvider"
|
||||
android:authorities="${applicationId}.androidx-startup"
|
||||
tools:node="remove" />
|
||||
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
android:authorities="${applicationId}.fileprovider"
|
||||
android:exported="false"
|
||||
android:grantUriPermissions="true"
|
||||
tools:node="remove">
|
||||
<meta-data
|
||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||
android:resource="@xml/file_paths" />
|
||||
</provider>
|
||||
</application>
|
||||
|
||||
</manifest>
|
BIN
app/src/googlePlay/ic_launcher-playstore.png
Normal file
BIN
app/src/googlePlay/ic_launcher-playstore.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
@ -19,7 +19,7 @@ import me.ash.reader.infrastructure.rss.OPMLDataSource
|
||||
import me.ash.reader.infrastructure.rss.RssHelper
|
||||
import me.ash.reader.ui.ext.del
|
||||
import me.ash.reader.ui.ext.getLatestApk
|
||||
import me.ash.reader.ui.ext.isFdroid
|
||||
import me.ash.reader.ui.ext.isGitHub
|
||||
import okhttp3.OkHttpClient
|
||||
import javax.inject.Inject
|
||||
|
||||
@ -132,7 +132,7 @@ class AndroidApp : Application(), Configuration.Provider {
|
||||
}
|
||||
|
||||
private suspend fun checkUpdate() {
|
||||
if (isFdroid) return
|
||||
if (!isGitHub) return
|
||||
withContext(ioDispatcher) {
|
||||
applicationContext.getLatestApk().let {
|
||||
if (it.exists()) it.del()
|
||||
|
@ -6,6 +6,8 @@ import me.ash.reader.BuildConfig
|
||||
|
||||
const val GITHUB = "github"
|
||||
const val FDROID = "fdroid"
|
||||
const val GOOGLE_PLAY = "googlePlay"
|
||||
|
||||
const val isFdroid = BuildConfig.FLAVOR == FDROID
|
||||
const val notFdroid = !isFdroid
|
||||
const val isFDroid = BuildConfig.FLAVOR == FDROID
|
||||
const val isGitHub = BuildConfig.FLAVOR == GITHUB
|
||||
const val isGooglePlay = BuildConfig.FLAVOR == GOOGLE_PLAY
|
||||
|
@ -7,7 +7,7 @@ import kotlinx.coroutines.flow.*
|
||||
import kotlinx.coroutines.launch
|
||||
import me.ash.reader.domain.service.AppService
|
||||
import me.ash.reader.infrastructure.net.Download
|
||||
import me.ash.reader.ui.ext.notFdroid
|
||||
import me.ash.reader.ui.ext.isGitHub
|
||||
import javax.inject.Inject
|
||||
|
||||
@HiltViewModel
|
||||
@ -22,7 +22,7 @@ class UpdateViewModel @Inject constructor(
|
||||
preProcessor: suspend () -> Unit = {},
|
||||
postProcessor: suspend (Boolean) -> Unit = {},
|
||||
) {
|
||||
if (notFdroid) {
|
||||
if (isGitHub) {
|
||||
viewModelScope.launch {
|
||||
preProcessor()
|
||||
appService.checkUpdate().let {
|
||||
|
Loading…
x
Reference in New Issue
Block a user