Skip to content

Commit 04b47bc

Browse files
Merge branch 'refactor' into Uploader-reply-indicator
2 parents fdd6caf + f16becc commit 04b47bc

81 files changed

Lines changed: 1455 additions & 1616 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/image-minimizer.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ module.exports = async ({github, context}) => {
3333

3434
// Regex for finding images (simple variant) ![ALT_TEXT](https://*.githubusercontent.com/<number>/<variousHexStringsAnd->.<fileExtension>)
3535
const REGEX_USER_CONTENT_IMAGE_LOOKUP = /\!\[([^\]]*)\]\((https:\/\/[-a-z0-9]+\.githubusercontent\.com\/\d+\/[-0-9a-f]{32,512}\.(jpg|gif|png))\)/gm;
36-
const REGEX_ASSETS_IMAGE_LOCKUP = /\!\[([^\]]*)\]\((https:\/\/github\.com\/[-\w\d]+\/[-\w\d]+\/assets\/\d+\/[\-0-9a-f]{32,512})\)/gm;
36+
const REGEX_ASSETS_IMAGE_LOOKUP = /\!\[([^\]]*)\]\((https:\/\/github\.com\/(?:user-attachments\/assets|[-\w\d]+\/[-\w\d]+\/assets\/\d+)\/[\-0-9a-f]{32,512})\)/gm;
3737

3838
// Check if we found something
3939
let foundSimpleImages = REGEX_USER_CONTENT_IMAGE_LOOKUP.test(initialBody)
40-
|| REGEX_ASSETS_IMAGE_LOCKUP.test(initialBody);
40+
|| REGEX_ASSETS_IMAGE_LOOKUP.test(initialBody);
4141
if (!foundSimpleImages) {
4242
console.log('Found no simple images to process');
4343
return;
@@ -52,7 +52,7 @@ module.exports = async ({github, context}) => {
5252

5353
// Try to find and replace the images with minimized ones
5454
let newBody = await replaceAsync(initialBody, REGEX_USER_CONTENT_IMAGE_LOOKUP, minimizeAsync);
55-
newBody = await replaceAsync(newBody, REGEX_ASSETS_IMAGE_LOCKUP, minimizeAsync);
55+
newBody = await replaceAsync(newBody, REGEX_ASSETS_IMAGE_LOOKUP, minimizeAsync);
5656

5757
if (!wasMatchModified) {
5858
console.log('Nothing was modified. Skipping update');

app/build.gradle

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@ plugins {
99
alias libs.plugins.kotlin.compose
1010
alias libs.plugins.kotlin.kapt
1111
alias libs.plugins.kotlin.parcelize
12+
alias libs.plugins.kotlinx.serialization
1213
alias libs.plugins.checkstyle
1314
alias libs.plugins.sonarqube
1415
alias libs.plugins.hilt
1516
alias libs.plugins.aboutlibraries
1617
}
1718

1819
android {
19-
compileSdk 34
20+
compileSdk 35
2021
namespace 'org.schabi.newpipe'
2122

2223
defaultConfig {
@@ -27,9 +28,9 @@ android {
2728
if (System.properties.containsKey('versionCodeOverride')) {
2829
versionCode System.getProperty('versionCodeOverride') as Integer
2930
} else {
30-
versionCode 1003
31+
versionCode 1004
3132
}
32-
versionName "0.27.6"
33+
versionName "0.27.7"
3334
if (System.properties.containsKey('versionNameSuffix')) {
3435
versionNameSuffix System.getProperty('versionNameSuffix')
3536
}
@@ -101,6 +102,10 @@ android {
101102
androidTest.assets.srcDirs += files("$projectDir/schemas".toString())
102103
}
103104

105+
androidResources {
106+
generateLocaleConfig = true
107+
}
108+
104109
buildFeatures {
105110
viewBinding true
106111
compose true
@@ -222,7 +227,6 @@ dependencies {
222227
implementation libs.androidx.fragment.compose
223228
implementation libs.androidx.lifecycle.livedata
224229
implementation libs.androidx.lifecycle.viewmodel
225-
implementation libs.androidx.localbroadcastmanager
226230
implementation libs.androidx.media
227231
implementation libs.androidx.preference
228232
implementation libs.androidx.recyclerview
@@ -315,6 +319,9 @@ dependencies {
315319
// Scroll
316320
implementation libs.lazycolumnscrollbar
317321

322+
// Kotlinx Serialization
323+
implementation libs.kotlinx.serialization.json
324+
318325
/** Debugging **/
319326
// Memory leak detection
320327
debugImplementation libs.leakcanary.object.watcher

app/proguard-rules.pro

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,18 @@
3434

3535
## For some reason NotificationModeConfigFragment wasn't kept (only referenced in a preference xml)
3636
-keep class org.schabi.newpipe.settings.notifications.** { *; }
37+
38+
## Keep Kotlinx Serialization classes
39+
-keepclassmembers class kotlinx.serialization.json.** {
40+
*** Companion;
41+
}
42+
-keepclasseswithmembers class kotlinx.serialization.json.** {
43+
kotlinx.serialization.KSerializer serializer(...);
44+
}
45+
-keep,includedescriptorclasses class org.schabi.newpipe.**$$serializer { *; }
46+
-keepclassmembers class org.schabi.newpipe.** {
47+
*** Companion;
48+
}
49+
-keepclasseswithmembers class org.schabi.newpipe.** {
50+
kotlinx.serialization.KSerializer serializer(...);
51+
}

app/src/main/AndroidManifest.xml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
1010
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
1111
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
12+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
1213
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
1314

1415
<!-- We need to be able to open links in the browser on API 30+ -->
@@ -90,8 +91,10 @@
9091
android:exported="false"
9192
android:label="@string/title_activity_about" />
9293

93-
<service android:name=".local.subscription.services.SubscriptionsImportService" />
94-
<service android:name=".local.subscription.services.SubscriptionsExportService" />
94+
<service
95+
android:name="androidx.work.impl.foreground.SystemForegroundService"
96+
android:foregroundServiceType="dataSync"
97+
tools:node="merge" />
9598
<service android:name=".local.feed.service.FeedLoadService" />
9699

97100
<activity

app/src/main/java/org/schabi/newpipe/MainActivity.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,8 @@ protected void onCreate(final Bundle savedInstanceState) {
186186
&& ReleaseVersionUtil.INSTANCE.isReleaseApk()) {
187187
UpdateSettingsFragment.askForConsentToUpdateChecks(this);
188188
}
189+
190+
Localization.migrateAppLanguageSettingIfNecessary(getApplicationContext());
189191
}
190192

191193
@Override

app/src/main/java/org/schabi/newpipe/database/subscription/SubscriptionDAO.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ abstract class SubscriptionDAO : BasicDAO<SubscriptionEntity> {
9090
internal abstract fun silentInsertAllInternal(entities: List<SubscriptionEntity>): List<Long>
9191

9292
@Transaction
93-
open fun upsertAll(entities: List<SubscriptionEntity>): List<SubscriptionEntity> {
93+
open fun upsertAll(entities: List<SubscriptionEntity>) {
9494
val insertUidList = silentInsertAllInternal(entities)
9595

9696
insertUidList.forEachIndexed { index: Int, uidFromInsert: Long ->
@@ -106,7 +106,5 @@ abstract class SubscriptionDAO : BasicDAO<SubscriptionEntity> {
106106
update(entity)
107107
}
108108
}
109-
110-
return entities
111109
}
112110
}

0 commit comments

Comments
 (0)