Michael Langford
03/02/2022, 5:01 PMYoussef Shoaib [MOD]
03/03/2022, 3:11 PMinline
functions to shine. I think if you make that function inline, make its body wrapped in a if(BuildConfig.DEBUG)
, then use proguard, the function will disappear, and there won't be any hooks available. I think that proguard should optimize away the contents of the if block because DEBUG
is known to be false at compile time, but it's worth a test just in case.James Hamilton
03/04/2022, 4:06 PMI think that proguard should optimize away the contents of the if block becauseIndeed, that should work! Some other ProGuard config options that could be potentially be useful for you: •is known to be false at compile time, but it's worth a test just in case.DEBUG
-assumenosideeffects
to tell ProGuard that some method has no side effects and then ProGuard can potentially remove calls to that method (typically used for removing Android logging code).
• -assumevalues
to tell ProGuard that some method always returns some or some field always has some value. For example, you can potentially use any field you like in the same way as BuildConfig.DEBUG
to guard some debug code by configuring -assumevalues
false
for that field in your release ProGuard config
If you have any specific ProGuard questions a good place to ask them is the Guardsquare community https://community.guardsquare.com/Michael Langford
03/06/2022, 7:49 PM