Skip to content

fix(proguard): scope protobuf keep rule to SDK-generated messages#975

Merged
davidliu merged 1 commit into
livekit:mainfrom
adrian-niculescu:fix/proguard-protobuf-keep-scope
Jul 13, 2026
Merged

fix(proguard): scope protobuf keep rule to SDK-generated messages#975
davidliu merged 1 commit into
livekit:mainfrom
adrian-niculescu:fix/proguard-protobuf-keep-scope

Conversation

@adrian-niculescu

@adrian-niculescu adrian-niculescu commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

The protobuf keep rule matched class * extends GeneratedMessageLite, so it keeps <fields> for every protobuf message in the consuming app, including the app's own protos and unrelated protobuf-using libraries. A consumer rule should only keep what the SDK itself needs.

This scopes it to livekit.** for the SDK's generated messages and com.google.protobuf.** for the well-known types they embed (Timestamp and friends). protobuf-javalite resolves those fields reflectively by name, so both scopes are required.

Tested by deploying an optimized release build of an app that uses the SDK to real devices on Android 13 and Android 17 (latest beta). LiveKit worked as expected with these changes.

The rule matched every GeneratedMessageLite subclass in the consuming
app, keeping fields for the app's own protos and unrelated protobuf
libraries. Scope it to livekit.** and the com.google.protobuf.**
well-known types the SDK's messages embed.
@changeset-bot

changeset-bot Bot commented Jul 1, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1738e0f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
client-sdk-android Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@davidliu davidliu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, tested and works fine here as well.

@davidliu
davidliu merged commit 7855be2 into livekit:main Jul 13, 2026
5 checks passed
@davidliu davidliu mentioned this pull request Jul 13, 2026
@adrian-niculescu

Copy link
Copy Markdown
Contributor Author

Thanks!

@adrian-niculescu
adrian-niculescu deleted the fix/proguard-protobuf-keep-scope branch July 13, 2026 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants