Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ jobs:
working-directory: OneSignalSDK
run: |
./gradlew testDebugUnitTest --console=plain --continue
- name: "[Build] Demo app (minified release)"
working-directory: OneSignalSDK
run: |
./gradlew :app:assembleGmsRelease --console=plain
- name: "[Diff Coverage] Check for bypass"
id: coverage_bypass
run: |
Expand Down
11 changes: 10 additions & 1 deletion OneSignalSDK/onesignal/notifications/consumer-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,13 @@
# Keep OneSignal WorkManager workers and constructors used for runtime instantiation.
-keep class com.onesignal.notifications.internal.** extends androidx.work.ListenableWorker {
public <init>(android.content.Context, androidx.work.WorkerParameters);
}
}

# WorkManager instantiates InputMerger classes via reflection (InputMerger.fromClassName).
# R8 full mode (AGP 8+) strips no-arg constructors, causing:
# java.lang.NoSuchMethodException: androidx.work.OverwritingInputMerger.<init>()
# WM-WorkerWrapper E Could not create Input Merger androidx.work.OverwritingInputMerger
# Keep all InputMerger subclasses (OverwritingInputMerger, ArrayCreatingInputMerger, etc.)
-keep class * extends androidx.work.InputMerger {
public <init>();
}
9 changes: 7 additions & 2 deletions examples/demo/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ android {

buildTypes {
release {
isMinifyEnabled = false
// Minify MUST be enabled to exercise R8 and validate WorkManager/ProGuard rules.
// See: SDK-4185, https://github.com/OneSignal/OneSignal-Android-SDK/issues/2582
isMinifyEnabled = true
isShrinkResources = true
signingConfig = signingConfigs.getByName("debug")
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
Expand All @@ -65,7 +69,8 @@ android {
initWith(getByName("release"))
isDebuggable = false
isProfileable = true
isMinifyEnabled = false
isMinifyEnabled = true
isShrinkResources = true
signingConfig = signingConfigs.getByName("debug")
matchingFallbacks += listOf("release")
}
Expand Down
5 changes: 5 additions & 0 deletions examples/demo/app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,8 @@
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

# Demo-only suppression for optional OTel transitive classes.
-dontwarn com.fasterxml.jackson.core.JsonFactory
-dontwarn com.fasterxml.jackson.core.JsonGenerator
-dontwarn com.google.auto.value.AutoValue$CopyAnnotations
Loading