Skip to content

Commit

Permalink
6.5.0 commit
Browse files Browse the repository at this point in the history
  • Loading branch information
XilinJia committed Aug 30, 2024
1 parent 4298995 commit 72b85fe
Show file tree
Hide file tree
Showing 117 changed files with 1,512 additions and 1,144 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ An open source podcast instrument, attuned to Puccini ![Puccini](./images/Puccin

### Rendezvous chez:

[<img src="./images/external/getItGithub.png" alt="GitHub" height="60">](https://github.com/XilinJia/Podcini/releases/latest)
[<img src="./images/external/getItIzzyOnDroid.png" alt="IzzyOnDroid" height="60">](https://apt.izzysoft.de/fdroid/index/apk/ac.mdiq.podcini.R)
[<img src="./images/external/getItOpenapk.png" alt="OpenAPK" height="60">](https://www.openapk.net/podcini/ac.mdiq.podcini/)
[<img src="./images/external/getItf-droid.png" alt="F-Droid" height="60">](https://f-droid.org/packages/ac.mdiq.podcini.R/)
[<img src="./images/external/amazon.png" alt="Amazon" height="50">](https://www.amazon.com/%E8%B4%BE%E8%A5%BF%E6%9E%97-Podcini-R/dp/B0D9WR8P13)
[<img src="./images/external/getItGithub.png" alt="GitHub" height="50">](https://github.com/XilinJia/Podcini/releases/latest)
[<img src="./images/external/getItIzzyOnDroid.png" alt="IzzyOnDroid" height="50">](https://apt.izzysoft.de/fdroid/index/apk/ac.mdiq.podcini.R)
[<img src="./images/external/getItOpenapk.png" alt="OpenAPK" height="50">](https://www.openapk.net/podcini/ac.mdiq.podcini/)
[<img src="./images/external/getItf-droid.png" alt="F-Droid" height="50">](https://f-droid.org/packages/ac.mdiq.podcini.R/)
[<img src="./images/external/amazon.png" alt="Amazon" height="40">](https://www.amazon.com/%E8%B4%BE%E8%A5%BF%E6%9E%97-Podcini-R/dp/B0D9WR8P13)

## Announcement

### Podcini.R version 6 is released. It's not compatible with prior versions. The major overhaul is the replacement of SQLite DB with the object-based Realm DB. With a different application Id, it is installed afresh and in parallel with a previous version. You can migrate certain assets from an earlier version, see [Podcini 6 migrations instructions](migrationTo6.md)
### Podcini.R version 6.5 brings YouTube channels in the app. They can be searched, subscribed and played from within Podcini. For more see the changelogs

This project is based on a fork of [AntennaPod](<https://github.com/AntennaPod/AntennaPod>) as of Feb 5 2024.

Expand Down
52 changes: 32 additions & 20 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ composeCompiler {
// from common.gradle
android {
defaultConfig {
minSdk 23
minSdk 24
compileSdk 34
targetSdk 34

Expand All @@ -31,8 +31,8 @@ android {
testApplicationId "ac.mdiq.podcini.tests"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

versionCode 3020232
versionName "6.4.0"
versionCode 3020233
versionName "6.5.0"

applicationId "ac.mdiq.podcini.R"
def commit = ""
Expand Down Expand Up @@ -70,6 +70,9 @@ android {
}

compileOptions {
// Flag to enable support for the new language APIs
coreLibraryDesugaringEnabled true

sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
Expand All @@ -87,14 +90,14 @@ android {
compose true
}

// splits {
// abi {
// enable true
// reset()
// include "arm64-v8a" // Specify the ABI you want to split.
// universalApk true // This will generate a universal APK that includes all ABIs.
// }
// }
splits {
abi {
enable true
reset()
include "arm64-v8a" // Specify the ABI you want to split.
universalApk true // This will generate a universal APK that includes all ABIs.
}
}

// from playFlavor.gradle
flavorDimensions += ["market"]
Expand Down Expand Up @@ -134,7 +137,6 @@ android {
}
}


buildTypes {
release {
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard.cfg"
Expand All @@ -156,20 +158,28 @@ android {
applicationVariants.configureEach { variant ->
variant.outputs.configureEach { output ->
def applicationName = "Podcini.R"
outputFileName = "${applicationName}_${variant.buildType.name}_${defaultConfig.versionName}.apk"
def buildType = variant.buildType.name
def versionName = variant.versionName
def flavorName = variant.flavorName ?: ""
def abiName = output.getFilter(com.android.build.OutputFile.ABI) ?: "universal"
outputFileName = "${applicationName}_${flavorName}_${buildType}_${versionName}_${abiName}.apk"
}
}

androidResources {
additionalParameters "--no-version-vectors"
}
}

dependencies {
/** Desugaring for using VistaGuide **/
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs_nio:2.1.1'

def composeBom = platform('androidx.compose:compose-bom:2024.08.00')
implementation composeBom
androidTestImplementation composeBom

implementation 'com.github.XilinJia.vistaguide:VistaGuide:lv0.24.2.6'

// implementation 'androidx.compose.material3:material3:1.2.0'
implementation 'androidx.compose.material:material:1.6.8'
// implementation 'androidx.compose.foundation:foundation:1.6.2'
Expand All @@ -193,12 +203,12 @@ dependencies {
implementation 'androidx.coordinatorlayout:coordinatorlayout:1.2.0'
implementation "androidx.fragment:fragment-ktx:1.8.2"
implementation 'androidx.gridlayout:gridlayout:1.0.0'
implementation "androidx.media:media:1.7.0"
implementation "androidx.media3:media3-exoplayer:1.4.0"
implementation "androidx.media3:media3-ui:1.4.0"
implementation "androidx.media3:media3-datasource-okhttp:1.4.0"
implementation "androidx.media3:media3-common:1.4.0"
implementation "androidx.media3:media3-session:1.4.0"
// implementation "androidx.media:media:1.7.0"
implementation "androidx.media3:media3-exoplayer:1.4.1"
implementation "androidx.media3:media3-ui:1.4.1"
implementation "androidx.media3:media3-datasource-okhttp:1.4.1"
implementation "androidx.media3:media3-common:1.4.1"
implementation "androidx.media3:media3-session:1.4.1"
implementation "androidx.palette:palette-ktx:1.0.0"
implementation "androidx.preference:preference-ktx:1.2.1"
implementation "androidx.recyclerview:recyclerview:1.3.2"
Expand All @@ -224,6 +234,8 @@ dependencies {

// implementation "io.reactivex.rxjava2:rxandroid:2.1.1"
implementation "io.reactivex.rxjava2:rxjava:2.2.21"
implementation "io.reactivex.rxjava3:rxjava:3.1.8"
implementation "io.reactivex.rxjava3:rxandroid:3.0.2"

// 5.5.0-b01 is newer than 5.5.0-compose01
implementation 'com.mikepenz:iconics-core:5.5.0-b01'
Expand Down
1 change: 1 addition & 0 deletions app/proguard.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,4 @@
-dontwarn java.lang.management.ThreadMXBean

-dontwarn org.slf4j.impl.StaticLoggerBinder
-dontwarn java.beans.BeanDescriptor
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import ac.mdiq.podcini.storage.model.Feed
import ac.mdiq.podcini.storage.model.Episode
import ac.mdiq.podcini.storage.model.Playable
import ac.mdiq.podcini.ui.widget.WidgetUpdater.WidgetState
import ac.mdiq.podcini.util.event.EventFlow
import ac.mdiq.podcini.util.event.FlowEvent
import ac.mdiq.podcini.util.EventFlow
import ac.mdiq.podcini.util.FlowEvent
import androidx.test.annotation.UiThreadTest
import androidx.test.filters.LargeTest
import androidx.test.platform.app.InstrumentationRegistry
Expand Down
6 changes: 3 additions & 3 deletions app/src/androidTest/kotlin/ac/test/podcini/ui/UITestUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package de.test.podcini.ui
import ac.mdiq.podcini.storage.model.Feed
import ac.mdiq.podcini.storage.model.Episode
import ac.mdiq.podcini.storage.model.EpisodeMedia
import ac.mdiq.podcini.util.event.EventFlow
import ac.mdiq.podcini.util.event.FlowEvent
import ac.mdiq.podcini.util.EventFlow
import ac.mdiq.podcini.util.FlowEvent
import android.content.Context
import android.util.Log
import androidx.test.platform.app.InstrumentationRegistry
Expand Down Expand Up @@ -106,7 +106,7 @@ class UITestUtils(private val context: Context) {
check(!feedDataHosted) { "addHostedFeedData was called twice on the same instance" }
for (i in 0 until NUM_FEEDS) {
val feed = Feed(0, null, "Title $i", "http://example.com/$i", "Description of feed $i",
"http://example.com/pay/feed$i", "author $i", "en", Feed.TYPE_RSS2, "feed$i", null, null,
"http://example.com/pay/feed$i", "author $i", "en", Feed.FeedType.RSS.name, "feed$i", null, null,
"http://example.com/feed/src/$i")

// create items
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package de.test.podcini.util.syndication.feedgenerator

import android.util.Xml
import ac.mdiq.podcini.util.DateFormatter.formatRfc822Date
import ac.mdiq.podcini.util.MiscFormatter.formatRfc822Date
import ac.mdiq.podcini.storage.model.Feed
import ac.mdiq.podcini.net.feed.parser.namespace.PodcastIndex
import de.test.podcini.util.syndication.feedgenerator.GeneratorUtil.addPaymentLink
Expand Down
73 changes: 70 additions & 3 deletions app/src/main/kotlin/ac/mdiq/podcini/PodciniApp.kt
Original file line number Diff line number Diff line change
@@ -1,25 +1,44 @@
package ac.mdiq.podcini

import ac.mdiq.podcini.net.download.VistaDownloaderImpl
import ac.mdiq.podcini.preferences.PreferenceUpgrader
import ac.mdiq.podcini.preferences.UserPreferences.appPrefs
import ac.mdiq.podcini.receiver.SPAReceiver
import ac.mdiq.podcini.storage.database.RealmDB.realm
import ac.mdiq.podcini.ui.activity.SplashActivity
import ac.mdiq.podcini.util.SPAUtil
import ac.mdiq.podcini.util.Localization.Companion.getPreferredContentCountry
import ac.mdiq.podcini.util.Localization.Companion.getPreferredLocalization
import ac.mdiq.podcini.util.Logd
import ac.mdiq.podcini.util.config.ApplicationCallbacks
import ac.mdiq.podcini.util.config.ClientConfig
import ac.mdiq.podcini.util.config.ClientConfigurator
import ac.mdiq.podcini.util.error.CrashReportWriter
import ac.mdiq.vista.extractor.ServiceList
import ac.mdiq.vista.extractor.Vista
import ac.mdiq.vista.extractor.downloader.Downloader
import android.app.Application
import android.content.ComponentName
import android.content.Context
import android.content.Intent
import android.os.StrictMode
import android.util.Log
import androidx.media3.common.util.UnstableApi
import androidx.preference.PreferenceManager
import com.google.android.material.color.DynamicColors
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.runBlocking
import kotlinx.coroutines.withContext

/** Main application class. */
class PodciniApp : Application() {

private val vistaDownloader: Downloader
get() {
val downloader = VistaDownloaderImpl.init(null)
setCookiesToDownloader(downloader)
return downloader
}

@UnstableApi
override fun onCreate() {
super.onCreate()
Expand All @@ -44,17 +63,65 @@ class PodciniApp : Application() {
PreferenceUpgrader.checkUpgrades(this@PodciniApp)
}
}
SPAUtil.sendSPAppsQueryFeedsIntent(this)
Vista.init(vistaDownloader, getPreferredLocalization(this), getPreferredContentCountry(this))
initServices(this)

sendSPAppsQueryFeedsIntent(this)
DynamicColors.applyToActivitiesIfAvailable(this)
}

private fun setCookiesToDownloader(downloader: VistaDownloaderImpl?) {
val prefs = PreferenceManager.getDefaultSharedPreferences(applicationContext)
val key = "recaptcha_cookies_key"
downloader?.setCookie("recaptcha_cookies", prefs.getString(key, null)?:"")
downloader?.updateYoutubeRestrictedModeCookies(applicationContext)
}

private fun initServices(context: Context) {
for (s in ServiceList.all()) {
if (s.serviceId == ServiceList.PeerTube.serviceId) {
// not doing anything now
}
}
}

/**
* Sends an ACTION_SP_APPS_QUERY_FEEDS intent to all Podcini Single Purpose apps.
* The receiving single purpose apps will then send their feeds back to Podcini via an
* ACTION_SP_APPS_QUERY_FEEDS_RESPONSE intent.
* This intent will only be sent once.
*
* @return True if an intent was sent, false otherwise (for example if the intent has already been
* sent before.
*/
@Synchronized
fun sendSPAppsQueryFeedsIntent(context: Context): Boolean {
// assert(context != null) { "context = null" }
val appContext = context.applicationContext
if (appContext == null) {
Log.wtf("App", "Unable to get application context")
return false
}
// val prefs = PreferenceManager.getDefaultSharedPreferences(appContext)
if (!appPrefs.getBoolean(PREF_HAS_QUERIED_SP_APPS, false)) {
appContext.sendBroadcast(Intent(SPAReceiver.ACTION_SP_APPS_QUERY_FEEDS))
Logd("App", "Sending SP_APPS_QUERY_FEEDS intent")
val editor = appPrefs.edit()
editor.putBoolean(PREF_HAS_QUERIED_SP_APPS, true)
editor.apply()
return true
} else return false
}

class ApplicationCallbacksImpl : ApplicationCallbacks {
override fun getApplicationInstance(): Application {
return PodciniApp.getInstance()
return getInstance()
}
}

companion object {
private const val PREF_HAS_QUERIED_SP_APPS = "prefSPAUtil.hasQueriedSPApps"

private lateinit var singleton: PodciniApp

fun getInstance(): PodciniApp {
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit 72b85fe

Please sign in to comment.