Starting with Android Pie, access to certain hidden classes, methods and fields was restricted. Before Pie, it was pretty easy to use these hidden non-SDK components by simply using reflection.
Now, however, apps targeting API 28 (Pie) or later will be met with ClassNotFoundException, NoSuchMethodError or NoSuchFieldException when trying to access components such as
Activity#createDialog(). For most people this is fine, but as someone who likes to hack around the API, it can make things difficult.
How can I work around these restrictions?