There are actually a couple ways to do this, but they're a little labor intensive, so probably should be used as a last resort. With a rooted device, you can extract the symbols from the framework jars on the device and put them into the android.jar in your sdk/platforms/ folder. Used to have a script to do this; lost it in switching jobs.
steps from memory (note you'll probably have trouble as I don't remember the steps... for advanced users who understand what I'm trying to get at):
- adb pull /system/framework/* (these are all jar files). It might be
enough to get framework.jar. unzip them.
- for each one I believe will give you a classes.dex and a manifest. If
you just get class files, skip the next step
- dex2jar the classes.dex and unjar the classes_dex2jar.jar or whatever the
output is from dex2jar, which will give you a bunch of .class files
- take the class files and add them to your android sdk android.jar
file (sdk/platforms/android-#sdk#/android.jar).
I suggest duplicating your android-#sdk# folder into an android-1#sdk# folder, so android-19 becomes android-119, and then change build.prop in the folder to say ro.build.version.sdk=119, and then build against sdk 119. This way you have the choice of building against a clean 119 or your hacked 119. Just don't refer to any com.android.internal.R files because those ids are not accurate in my experience.
You'll now be able to compile against these symbols and access them fine. Though don't get mad if they change how things work, and they have no obligation to maintain compatibility with 3rd party apps.
This works because the hide tag is only used during the SDK compile step and strips these symbols from the android.jar located in your sdk. If we gather all the symbols that are compiled onto the device and stick them into your sdk jar, it's like they were never stripped.
Alternatively you could pull down and build the full android tree (https://source.android.com/source/building.html) and then build your app against the full source, which the first step is essentially getting around by taking already compiled symbols and working with them.