How to get an Android class library with hidden APIs

Source: Internet
Author: User

Many APIs of the Android SDK are hidden and I can't use them directly. But we can get the complete API library by compiling the source code of the Android system. After compiling the Android system source code, you can have all of its API libraries (JAVA) in the Out\target\common\obj\java_libraries directory. Of course, for the general situation, Out\target\common\obj\java_libraries\framework_intermediates\classes.jar is enough for us. We can use this Classes.jar Android class library to add to your Eclipse Environment's Android project in order to work with hidden APIs. For more information on how to use these API libraries in the Eclipse Android project, please refer to "Using hidden APIs in Android (lots of illustrations)" If you want to extract the full API, This work can be done by getdebugjar.sh script files after compiling the Android system source code.

destination_folder=debug_libs source_folder='android/out/target/common/obj/java_libraries' file_name=' Classes-full-debug.jar ' Echo $DESTINATION _folderif [ -D $DESTINATION _folder ] Thenecho "Checking destination ... OK " Else echo "Creating destination ..." mkdir $DESTINATION _folder if [ $? -ne 0 ] Thenecho "error!" exit fifiecho "Copy files ..." dirs=' ls $SOURCE _folder | tr ' \ n ' "for i in $dirs Do if [ -F ${Source_folder}/${i}/$FILE _name ] Thenfile=${i%_intermediates}-${file_name} echo Copy $file CP ${Source_folder}/${i}/$FILE _name ${Destination_folder }/$file if [ $? -ne 0 ] Thenecho "error! Cannot copy ${source_folder}/${i}/$FILE _name " exit fi fi DoneNote 1: For the TR command please refer to "TR command Details"
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.