Anees Ahmad
Anees Ahmad

Reputation: 83

How to Obfuscate Code in a Closed-Source SDK While Keeping Compose Function Parameters Intact?

I am developing a closed-source Android SDK where I need to obfuscate the implementation code to protect it from being reverse-engineered. However, I also need to expose certain functions to developers integrating this SDK.

One of the functions I want to expose is a Jetpack Compose function. When I enable obfuscation (minifyEnabled = true), the Compose function:

Loses its parameter names — This makes it difficult for developers to understand the function signature. Generates additional parameters (e.g., Composer var4, int var5, int var6) which are not present in the original function definition — leading to ambiguity and confusion for developers using the SDK.

Example Code: Expected Function Signature:

@Composable
fun BannerCarouselWithWebView(
    modifier: Modifier = Modifier,
    showWidgetTitle: Boolean = true,
    showWebViewBackButton: Boolean = true,
    configMap: Map<String, String>,
)

Actual Output After Obfuscation:

BannerCarouselWithWebView(
    Modifier var0, boolean var1, boolean var2, Map<String, String> var3, Composer var4, int var5, int var6
)

What I Need:

What I’ve Tried:

Question:

Any insights or solutions would be greatly appreciated!

Upvotes: 1

Views: 20

Answers (0)

Related Questions