1

I wonder is the document put a wrong (opposite) meaning to use ProGuard?

enter image description here

Source: https://developer.android.com/google/play/billing/billing_library_overview

But my understanding is: I MUST NOT add this line into the ProGuard configuration file, does anyone also notice this? Or confirm it?

 -keep class com.android.vending.billing.**
Amos
  • 2,222
  • 1
  • 26
  • 42
  • down-voted, because it explains what to obfuscate - and what not to obfuscate. – Martin Zeitler Jan 16 '19 at 07:05
  • @MartinZeitler maybe you can't get my meaning: if that line is added, from my understanding it's actually **NOT** obfuscating the code, but the document is saying add that line **WILL** obfuscate the code. Reference: https://jebware.com/blog/?p=418 – Amos Jan 16 '19 at 07:26

1 Answers1

2

The documentation is correct. I agree with you that it may look confusing when states that if you obfuscate your code then you must add such ProGuard rule to keep the vending.billing classes.

To clarify its meaning, if you use obfuscation in your project, then in order to NOT break the billing library then such entry must be added to the ProGuard rules.

This is required because though com.android.vending.billing isn't part of the billing library as it belongs to the Google Play Services, it is accessed through AIDL and obfuscating the project may remove/rename the vending references.

PerracoLabs
  • 16,449
  • 15
  • 74
  • 127
  • thanks man! so glad somebody understand my concerns! i understand your interpretation, but the result seems un-match: because i didn't add that rule to ProGuard, and the billing process works fine, how do you think? – Amos Feb 04 '19 at 01:51
  • As far as I'm aware the latest support billing library doesn't have/use its own set of ProGuard rules. Therefore, if your project works without the required rule specified in the documentation, then such scenario is just a consequence of your current project configuration and a bit risky. To be on the safe side would be better to add the rule. Also, you may keep a watch in the release notes of future billing library updates to check if such step at some point will no longer be necessary. – PerracoLabs Feb 04 '19 at 02:28
  • this make sense, thank you very much for your professional opinion! – Amos Feb 04 '19 at 02:36