question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Reflection Free Configuration and Proguard

See original GitHub issue

Is there any guidance on how to use the reflection free configuration with proguard and obfuscation? Based on looking at the factories, it looks like I’ll need to keep my class names at a minimum (possibly method names too).

-keepnames class com.myapp.**

Do you have any advice on how I can make this more specific?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:20 (9 by maintainers)

github_iconTop GitHub Comments

10reactions
pshmakovcommented, Jan 13, 2018

@stephanenicolas I updated my patch, so that a HashMap is generated instead of switches or ifs. The lookup time should be roughly the same as before, but there is some extra memory usage, which I think shouldn’t be critical: those factories are lightweight, they don’t have any fields at all. The change only affects the case when “support_obfuscation” annotation processing parameter was set to “true”. Otherwise it will generate switches as before.

I’d like to point out that this issue seems to be a “blocker” for using ToothPick in a large portion of commercial projects, because using obfuscation there is absolutely non-negotiable. I work on one of such projects, and would really like to give Toothpick a shot, because it’s awesome. But this issue needs to be fixed first. Otherwise we’ll have to go with Dagger 2, unfortunately (which doesn’t have problems with obfuscation as far as I know).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can I use Reflection with ProGuard obfuscated classes?
ProGuard documentation mentions the following: It is generally impossible to compute which classes have to be preserved (with their original ...
Read more >
ProGuard Manual: Home - Guardsquare
Generate an instrumented build to allow ProGuard finding cases of reflection at run-time. The tailored configuration advice for your application will be ...
Read more >
Shrink, obfuscate, and optimize your app - Android Developers
Enable shrinking, obfuscation, and optimization; R8 configuration files ... The Android Gradle plugin generates proguard-android-optimize.txt , which ...
Read more >
Android's Built-in ProGuard Rules: The Missing Guide
Android's build tools come with a few ProGuard facets to squeeze the most juice out of your release builds. In this post we'll...
Read more >
Getting Started with ProGuard - RayWenderlich.com
ProGuard can still help by obfuscating the code that makes the request to the server. This is an example of using the Kotlin...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found