package-private wouldn't help in this case either. All a consumer has to do is put their class into the same package, right? And then they have access that is not desired.
I'm not familiar with @hide, but doing some SO research, it appears it merely hides the method(s) from the documentation.
Can't get to Dokka docs right now. Does it have something to hide a function from the docs?
09/19/2019, 12:05 PM
Android sdk library build process removes all methods/class marked as @hide
This is a stub jar which is used only for compilation of an app. Eventually, when the app is run on the device, the API call is actually resolved by library loaded by dalvik VM on the device.
This approach obviously doesn't work for new support, android x libraries which aren't stub versions and has the actual implementation.
Looks like some kind of code obfuscation would help