How to obtain the Android class library containing hidden APIs

Source: Internet
Author: User

Many APIs of the android SDK in my blog are hidden and cannot be used directly. However, the complete api library can be obtained by compiling the Android system source code. After compiling the Android system source code, all its API libraries (Java) can be found in the out \ target \ common \ OBJ \ java_libraries directory ). Of course, for general cases, out \ target \ common \ OBJ \ java_libraries \ framework_intermediates \ Classes. jar is enough for us. We can add this android class library, such as classes. jar, to the android project of your eclipse environment to use hidden APIs. For more information about how to use these API libraries in the eclipse Android project, refer to "using hidden APIs in Android (a large number of illustrations)" if you want to extract the complete API, after compiling the Android system source code, you can use getdebugjar. sh script file.

DESTINATION_FOLDER=Debug_libsSOURCE_FOLDER='android/out/target/common/obj/JAVA_LIBRARIES'FILE_NAME='classes-full-debug.jar'echo $DESTINATION_FOLDERif [ -d $DESTINATION_FOLDER ]  then    echo "Checking destination ... OK"  else    echo "Creating destination ..."    mkdir $DESTINATION_FOLDER    if [ $? -ne 0 ]      then        echo "Error!"        exit    fifiecho "Copy files ..."dirs=`ls $SOURCE_FOLDER | tr '\n' ' '`for i in $dirsdo  if [ -f ${SOURCE_FOLDER}/${i}/$FILE_NAME ]  then    file=${i%_intermediates}-${FILE_NAME}    echo Copy $file    cp ${SOURCE_FOLDER}/${i}/$FILE_NAME ${DESTINATION_FOLDER}/$file    if [ $? -ne 0 ]      then        echo "Error! Cannot copy ${SOURCE_FOLDER}/${i}/$FILE_NAME"        exit    fi  fidone

NOTE 1: For details about tr commands, 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.