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.