github 위의android 원본을 다운로드하여 배우기 (android 원본 다운로드 주소 첨부)

본고는 주로 Github에서android 원본을 다운로드하는 스크립트와 본인이 다운로드한android 원본을 공유한다.
스크립트 코드는 다음과 같습니다.
#!/bin/bash

# --------------------------------------------------------------------------
# Filename:             gitandroid.sh
# Revision:             1.1
# Date:                 2013/09/01
# Author:               Geek_Soledad
# Email:                [email protected]
# WebSite:              http://maosidiaoxian.iteye.com
# Description:  a shell to download android source form github.com/android
# Modify:
# Revision      Author          comment
# 1.1           Geek_Soledad           
# --------------------------------------------------------------------------
# Copyright (c) 2013 CFuture09, Institute of Software, 
# Guangdong Ocean University, Zhanjiang, GuangDong, China.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


#    
ROOT_DIR=`pwd`

ALL_REPO=0
DONE_REPO=0

#$1      ,$2     
function cloneit()
{
        cd ${ROOT_DIR}
        ((ALL_REPO++))
        if [ -d $1 ]
        then
                echo -e "\033[0;38;40m $2 has been git clone \033[0m"
                echo "git pull --depth 1 $1"
                cd $1
                git pull --depth 1
        else 
                echo -e "\033[0;31;40m git clone --depth=1 $2 $1 \033[0m"
                git clone --depth=1 $2 $1 
        fi
        local rtnvalue=$?
        if [[ 0 = ${rtnvalue} ]]
        then
                ((DONE_REPO++))
        else
                echo "the return value is ${rtnvalue}"
        fi
        echo finish $(date) $1
        echo "done ${DONE_REPO} / ${ALL_REPO}  repo"
}

#    
function cloneall()
{
        cloneit platform/frameworks/base https://github.com/android/platform_frameworks_base.git
        cloneit platform/build https://github.com/android/platform_build.git
        cloneit platform/system/core https://github.com/android/platform_system_core.git
        cloneit platform/packages/apps/music https://github.com/android/platform_packages_apps_music.git
        cloneit platform/hardware/libhardware https://github.com/android/platform_hardware_libhardware.git
        cloneit platform/dalvik https://github.com/android/platform_dalvik.git
        cloneit platform/external/neven https://github.com/android/platform_external_neven.git
        cloneit platform/external/netperf https://github.com/android/platform_external_netperf.git
        cloneit platform/external/netcat https://github.com/android/platform_external_netcat.git
        cloneit platform/external/skia https://github.com/android/platform_external_skia.git
        cloneit platform/external/safe-iop https://github.com/android/platform_external_safe-iop.git
        cloneit platform/external/qemu https://github.com/android/platform_external_qemu.git
        cloneit platform/external/libpcap https://github.com/android/platform_external_libpcap.git
        cloneit platform/external/jhead https://github.com/android/platform_external_jhead.git
        cloneit platform/external/libxml2 https://github.com/android/platform_external_libxml2.git
        cloneit platform/external/libpng https://github.com/android/platform_external_libpng.git
        cloneit platform/external/protobuf https://github.com/android/platform_external_protobuf.git
        cloneit platform/external/ppp https://github.com/android/platform_external_ppp.git
        cloneit platform/external/oprofile https://github.com/android/platform_external_oprofile.git
        cloneit platform/external/openssl https://github.com/android/platform_external_openssl.git
        cloneit platform/external/sonivox https://github.com/android/platform_external_sonivox.git
        cloneit platform/frameworks/support https://github.com/android/platform_frameworks_support.git
        cloneit platform/packages/providers/downloadprovider https://github.com/android/platform_packages_providers_downloadprovider.git
        cloneit platform/system/bluetooth https://github.com/android/platform_system_bluetooth.git
        cloneit platform/packages/providers/telephonyprovider https://github.com/android/platform_packages_providers_telephonyprovider.git
        cloneit platform/packages/providers/mediaprovider https://github.com/android/platform_packages_providers_mediaprovider.git
        cloneit platform/packages/providers/contactsprovider https://github.com/android/platform_packages_providers_contactsprovider.git
        cloneit platform/packages/apps/phone https://github.com/android/platform_packages_apps_phone.git
        cloneit platform/packages/providers/drmprovider https://github.com/android/platform_packages_providers_drmprovider.git
        cloneit platform/packages/apps/voicedialer https://github.com/android/platform_packages_apps_voicedialer.git
        cloneit platform/packages/apps/mms https://github.com/android/platform_packages_apps_mms.git
        cloneit platform/packages/apps/camera https://github.com/android/platform_packages_apps_camera.git
        cloneit platform/packages/apps/calendar https://github.com/android/platform_packages_apps_calendar.git
        cloneit platform/hardware/ril https://github.com/android/platform_hardware_ril.git
        cloneit platform/packages/providers/calendarprovider https://github.com/android/platform_packages_providers_calendarprovider.git
        cloneit platform/packages/apps/stk https://github.com/android/platform_packages_apps_stk.git
        cloneit platform/packages/apps/packageinstaller https://github.com/android/platform_packages_apps_packageinstaller.git
        cloneit platform/packages/apps/email https://github.com/android/platform_packages_apps_email.git
        cloneit platform/packages/apps/settings https://github.com/android/platform_packages_apps_settings.git
        cloneit platform/manifest https://github.com/android/platform_manifest.git
        cloneit platform/packages/apps/contacts https://github.com/android/platform_packages_apps_contacts.git
        cloneit platform/packages/apps/browser https://github.com/android/platform_packages_apps_browser.git
        cloneit platform/external/webkit https://github.com/android/platform_external_webkit.git
        cloneit platform/external/zlib https://github.com/android/platform_external_zlib.git
        cloneit platform/bionic https://github.com/android/platform_bionic.git
        cloneit platform/external/srec https://github.com/android/platform_external_srec.git
        cloneit platform/external/sqlite https://github.com/android/platform_external_sqlite.git
        cloneit platform/external/dbus https://github.com/android/platform_external_dbus.git
        cloneit platform/external/expat https://github.com/android/platform_external_expat.git
        cloneit platform/development https://github.com/android/platform_development.git
        cloneit platform/external/jpeg https://github.com/android/platform_external_jpeg.git
        cloneit platform/external/dhcpcd https://github.com/android/platform_external_dhcpcd.git
        cloneit platform/external/emma https://github.com/android/platform_external_emma.git
        cloneit platform/external/elfutils https://github.com/android/platform_external_elfutils.git
        cloneit platform/external/icu4c https://github.com/android/platform_external_icu4c.git
        cloneit platform/external/iptables https://github.com/android/platform_external_iptables.git
        cloneit platform/external/ping https://github.com/android/platform_external_ping.git
        cloneit platform/packages/apps/htmlviewer https://github.com/android/platform_packages_apps_htmlviewer.git
        cloneit platform/packages/apps/calculator https://github.com/android/platform_packages_apps_calculator.git
        cloneit platform/packages/apps/soundrecorder https://github.com/android/platform_packages_apps_soundrecorder.git
        cloneit platform/external/yaffs2 https://github.com/android/platform_external_yaffs2.git
        cloneit platform/external/tinyxml https://github.com/android/platform_external_tinyxml.git
        cloneit platform/external/tcpdump https://github.com/android/platform_external_tcpdump.git
        cloneit platform/external/tagsoup https://github.com/android/platform_external_tagsoup.git
        cloneit platform/external/strace https://github.com/android/platform_external_strace.git
        cloneit platform/external/freetype https://github.com/android/platform_external_freetype.git
        cloneit platform/external/dropbear https://github.com/android/platform_external_dropbear.git
        cloneit platform/external/esd https://github.com/android/platform_external_esd.git
        cloneit platform/external/fdlibm https://github.com/android/platform_external_fdlibm.git
        cloneit platform/external/libffi https://github.com/android/platform_external_libffi.git
        cloneit platform/external/jdiff https://github.com/android/platform_external_jdiff.git
        cloneit platform/external/giflib https://github.com/android/platform_external_giflib.git
        cloneit platform/external/apache-http https://github.com/android/platform_external_apache-http.git
        cloneit kernel/common https://github.com/android/kernel_common.git
        cloneit kernel/msm https://github.com/android/kernel_msm.git
        cloneit platform/prebuilt https://github.com/android/platform_prebuilt.git
        cloneit android.github.io https://github.com/android/android.github.io.git
        cloneit tools/repo https://github.com/android/tools_repo.git
        cloneit platform/external/wpa/supplicant https://github.com/android/platform_external_wpa_supplicant.git
        cloneit platform/packages/apps/googlesearch https://github.com/android/platform_packages_apps_googlesearch.git
        cloneit platform/system/wlan/ti https://github.com/android/platform_system_wlan_ti.git
        cloneit platform/packages/providers/googlecontactsprovider https://github.com/android/platform_packages_providers_googlecontactsprovider.git
        cloneit platform/packages/apps/im https://github.com/android/platform_packages_apps_im.git
        cloneit platform/packages/providers/improvider https://github.com/android/platform_packages_providers_improvider.git
        cloneit platform/external/tremor https://github.com/android/platform_external_tremor.git
        cloneit platform/packages/apps/sync https://github.com/android/platform_packages_apps_sync.git
        cloneit platform/packages/apps/alarmclock https://github.com/android/platform_packages_apps_alarmclock.git
        cloneit platform/external/aes https://github.com/android/platform_external_aes.git
        cloneit platform/external/clearsilver https://github.com/android/platform_external_clearsilver.git
        cloneit platform/external/googleclient https://github.com/android/platform_external_googleclient.git
        cloneit platform/packages/apps/launcher https://github.com/android/platform_packages_apps_launcher.git
        cloneit platform/external/bluez https://github.com/android/platform_external_bluez.git 
        cloneit platform/external/gdata https://github.com/android/platform_external_gdata.git
        cloneit platform/frameworks/opt/com.google.android https://github.com/android/platform_frameworks_opt_com.google.android.git
        cloneit platform/external/elfcopy https://github.com/android/platform_external_elfcopy.git
        cloneit platform/frameworks/policies/base https://github.com/android/platform_frameworks_policies_base.git
        cloneit platform/packages/apps/updater https://github.com/android/platform_packages_apps_updater.git
        cloneit platform/external/opencore https://github.com/android/platform_external_opencore.git
}

LOGDIR=log
if [ ! -d "${LOGDIR}" ]
then
    mkdir ${LOGDIR}
fi
LOGFILE=${LOGDIR}/`date +%m%d%H%M%S`.log
cloneall | tee -a ${LOGFILE}

인터넷 속도가 빠르면 위의 - depth 1 파라미터를 제거하는 것을 권장합니다.또한 위에서 다운로드한 안드로이드 코드는 본인이 성공적으로 컴파일한 적이 없고 단지 코드를 연구하기 위해서였다.
이 스크립트의 최신 버전은 다음 명령을 통해 얻을 수 있습니다.
svn cat http://source-about-android.googlecode.com/svn/trunk/gitandroid.sh>gitandroid.sh

위의 각본은 본인이 작성한 것이니 문제가 있으면 지적해 주십시오.
또한, 본인이 이미 다운로드한 코드 패키지 주소를 동봉합니다. 일부 사람들은 네트워크가 좋지 않아서 다운로드가 끊기기 쉽기 때문입니다. 본인은 다운로드 중git검출 코드가 끊기면 다시 다운로드해야 한다는 것을 발견했기 때문에 여기에서 코드 다운로드를 제공하여 여러분이 연구할 수 있도록 합니다.마침 최근 인터넷의 몇몇 거물들이 온라인 쇼핑몰을 하여 360온라인 쇼핑몰에 올랐다.
현재 코드는 업로드 중입니다. 먼저 부분적으로 업로드된 코드의 주소를 붙입니다.
gitandroid.sh:http://yunpan.cn/QXCPxwYPLc7ZY
android.github.io.zip:http://yunpan.cn/QXCPStjQQJ7rH
tools.zip:http://yunpan.cn/QXCP6KHGbdU8b
kernel.zip:http://yunpan.cn/QXCPknWqNW9bJ
platform-bonic:http://yunpan.cn/QGdmAPamArsIN
platform-build:http://yunpan.cn/QGdmKBNzwVLgJ
platform-dalvik:http://yunpan.cn/QGdmdJnX77eII
platform-development:http://yunpan.cn/QGdmm5e62YFhB
platform-external:http://yunpan.cn/QGdm3q6tymhwd
platform-framework:http://yunpan.cn/QGdmrQzws7SNk
platform-hardware:http://yunpan.cn/QGdmYWTX8LAnG
platform-manifest:http://yunpan.cn/QGdmqNk99rDJe
platform-packkages:http://yunpan.cn/QGdmSdHYGIpqz
platform-prebuilt:http://yunpan.cn/QGdmRtJEMJrCU
platform-system:http://yunpan.cn/QGdm6QyYfhELd

좋은 웹페이지 즐겨찾기