Skip to content

Conversation

timbotimbo
Copy link
Collaborator

Description

The build script adds -keep class com.unity3d.plugin.* { *; } to the proguard file.
In most setups this simply works, but in some configurations it gets appended to a line that doesn't end in a line break.

For example in #762
-dontwarn com.google.android.play.core.tasks.Task-keep class com.unity3d.plugin.* { *; }

I combined both lines that edit the proguard file to ensure it always add a \n.

-  proguardText = proguardText.Replace("-ignorewarnings", "-keep class com.xraph.plugin.** { *; }\n-ignorewarnings");
-  proguardText += "-keep class com.unity3d.plugin.* { *; }";
+  proguardText = proguardText.Replace("-ignorewarnings", "-keep class com.xraph.plugin.** { *; }\n-keep class com.unity3d.plugin.* { *; }\n-ignorewarnings");

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore

@timbotimbo timbotimbo requested a review from RoyalCoder88 March 15, 2023 09:05
Copy link
Collaborator

@RoyalCoder88 RoyalCoder88 left a comment

Choose a reason for hiding this comment

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

This problem was fixed by @timbotimbo, it's a very common problem for a lot of users!

@timbotimbo timbotimbo merged commit 1cfd4f3 into juicycleff:master Mar 27, 2023
@RoyalCoder88 RoyalCoder88 requested a review from Ahmadre March 27, 2023 15:56
@timbotimbo timbotimbo deleted the proguard_linebreak branch April 6, 2023 11:38
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.

3 participants