Nexus One
From Doowon Kim
Contents |
C programming
- 안드로이드에서 C 프로그램을 돌릴 수 있는 방법은 두가지이다. (static, dynamic)
- static
- http://www.codesourcery.com/sgpp/lite/arm/portal/subscription?@template=lite 여기가서 eabi gcc를 다운받고 설치한다.
- arm-none-linux-gnueabi-gcc -o hello -static hello.c
- adb push hello /data/local/test
- adb shell
- cd /data/local
- chmod 755 test
- ./test
- dynamic
- http://www.pocketmagic.net/?p=682
- http://android-tricks.blogspot.com/2009/02/hello-world-c-program-on-using-android.html
- agcc를 다운받아서 안드로이드 플랫폼 경로와 ndk prebuilt 경로를 잘 선택해준다.
- static
Hacking
cyanogen & kernel build
- download cyanogen & set environment for building cyanogen : http://wiki.cyanogenmod.com/index.php?title=Compile_CyanogenMod_for_Passion
- kernel compile
- cyanogen에 있는 kernel-msm 을 지우고, nexus one usb host 되는 커널을 소스를 다운 받아 대체한다.
- kernel-msm/arch/arm/configs 에 .config 파일을 cyanogen 뭐로 바꾼다.
- make
unlock bootloader & rooting
Step 1: Unlock your bootloader In order to flash a new recovery image, you must unlock your bootloader. This process is quite simple, but it will wipe your phone. Reboot phone into fastboot: Power off device and hold down trackball while powering back on. (The fastboot screen is the one with the Androids on skateboards) Open a command prompt and navigate to your Android SDK tools folder. Type ‘fastboot devices‘ to make sure your phone is recognized. Type ‘fastboot oem unlock‘ to unlock the bootloader. Use volume keys to navigate to yes and press the power button to confirm. Step 2: Flash a new recovery image Next we will download a new recovery image that allows us to flash custom zip packages. Visit XDA and download Amon_RA’s recovery image for the Nexus One. Copy the file to your Android SDK tools folder. Open a command prompt and navigate to your Android SDK tools folder. Type ‘fastboot flash recovery recovery-RA-nexus-v1.5.3.img‘. (Note filename will change as recovery image is updated) Step 3: Boot into recovery mode and flash N1 Addon Now that the new recovery image is installed, it is time to reboot into recovery mode and flash a custom zip package. Since your phone was just wiped, you might have to enable usb debugging again so ADB and fastboot commands will work. Double check: Go to Settings > Application settings > Development > USB debugging (enable) For this guide we will be flashing Cyanogen’s N1 Addon. Visit XDA and download Cyanogen’s N1 Addon. (or any other custom .zip file you want to flash) Copy the .zip file to the root directory of your SD card. Open a command prompt and navigate to your Android SDK tools folder. Type ‘adb reboot recovery‘ to reboot the phone into recovery mode. (The recovery screen says “Android system recovery” with green text on black background) Use the trackball to navigate to “Flash zip from sdcard” and then select the zip file you wish to flash. Follow the on screen instructions. Press the trackball to begin the flash when prompted. When the flash is complete, navigate to reboot and press the trackball to reboot. Congratulations, you are finished and it is now time to download some root apps from the Android Market. Search the Market for SetCPU for Root Users, Nexus One Torch, or use the term “Nexus root” and see what you find. Problems? If you run into any serious problems please visit our forums and we will do our best to help. The XDA Nexus One forums are also a great resource. Please share any other Nexus One hacks and root apps in the comments and we will add them to this post.
Basic
- 커널 버전 : 2.6.32.9-27227-g3c98b0d haley@m4-dev #1
- 빌드 번호 : 2.15.1010.2 CL203557 release-keys
- 공장 초기화 : http://mycodes.tistory.com/125
- 초기화할 때 sd카드에 PASSIMG.zip이 있으면 sd카드에 있는 내용으로 초기화된다.
- sshd : http://forum.xda-developers.com/showthread.php?t=442754
- http://ilikemygooglephone.com/2010/01/06/complete-guide-with-images-unlock-bootloader-and-root-google-nexus-one-mac-windows-linux/
- http://www.cyanogenmod.com/
- Kernel
- 히어로 : http://adq.livejournal.com/95689.html
- http://elinux.org/Android_Intro
- http://www.cianer.com/androidg1/28-building-android-kernel-images
- http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack,_Edit,_and_Re-Pack_Boot_Images
- quicksshd
- cyanogenmod 빌드한 후 키보드가 보이지 않는데 그럴 경우 키보드 apk를 다운받아서 설치한다. (예를 들어 swype.apk)
USB
Hardware Nexus One Micro USB OTG cable (e.g.) USB Dual Power Cable (e.g.) to provide power to the hub chip through the uplink port, since the Nexus One doesn’t provide bus power (yet) Powered USB 2.0 hub (will charge the Nexus One) (e.g.) and optionally a battery pack for mobile use (e.g.) (some power calculations) Software Android 2.2 Froyo (2.1 may work, too) ConnectBot Download binaries… boot.img or zImage Modules …or build a Nexus One kernel from source # Fetch msm kernel tree git clone git://android.git.kernel.org/kernel/msm.git cd msm # Switch to Nexus One 2.2 Froyo git checkout origin/android-msm-2.6.32 # Get config wget http://sven.killig.de/android/N1/2.2/usb_host/.config # Patch (No device mode, Andrew de Quincey’s work not ported yet.) wget http://sven.killig.de/android/N1/2.2/usb_host/android-kernel_msm-v2.6.30-rc2-27223-g248970b_Nexus-One_usb-host.patch patch -p1 < android-kernel_msm-v2.6.30-rc2-27223-g248970b_Nexus-One_usb-host.patch # Build make -j2 ARCH=arm CROSS_COMPILE=/android-ndk-r4/build/prebuilt/linux-x86/arm-eabi-4.4.0/bin/arm-eabi- Install kernel # Boot from RAM (till next reset)… fastboot boot arch/arm/boot/zImage # …or write to flash (boot.img from a nandroid backup) /getramdisk.py boot.img /mydroid/out/host/linux-x86/bin/mkbootimg --kernel arch/arm/boot/zImage --ramdisk ramdisk.img --base 0x20000000 -o boot_usb-host.img fastboot flash boot boot_usb-host.img Start ConnectBot and connect to Local su insmod drivers/usb/core/usbcore.ko insmod drivers/usb/host/ehci-hcd.ko insmod drivers/hid/usbhid/usbhid.ko insmod drivers/usb/storage/usb-storage.ko # Wait for usb-storage to enumerate partitions mount /dev/block/sda1 /sdcard/usbstick To use adb over WLAN adb connect IPAddress:5555 Related posts: Jokes MA Only by Jay Mohr Host of the Interactive Achievement Award Show Jay Mohr hosted the Interactive Achievement Awards show and the... Nexus One Scores A Hat Trick Of Fail First, there was Google Wave, which was ushered in with... Most Current Android Cell Phones Will Not Have Flash….Ever Gizmodo recently posted an article about the upcoming Flash 10.1 (currently... Adobe Flash 10.1 for Android 2.1 First Half of 2010 Adobe is pressing forward with Flash 10.1 for Android... Android 2.2 Overview- Google Brings the Smackdown The Android 2.2 platform introduces many new and exciting features...
