Android

From YobiWiki
Jump to navigation Jump to search

Links

App stores

Alternate views on the official market:

Alternate markets:

User manuals

Nexus S

Versions

physical sticker behind battery:

  • Model: GT-I9023
  • FCC ID: A3LGTI9023
  • SSN: -I9023GSMH
  • IMEI: xxxxxxx
  • S/N: xxxxxxx

under 'About phone' from the settings:

  • Android 2.3.3
  • Baseband I9023XXKB3
  • Kernel 2.6.35.7-g1d030a7
  • Build GRI54

under fastboot:

  • Product name - HERRING
  • HW Version - rev 52
  • Bootloader version - I9020XXKA3
  • Baseband version - I9020XXKB3
  • Carrier info - EUR
  • Serial number - xxxxxxx

USB permissions on the host

On the host, example how to solve permissions:
Create /etc/udev/rules.d/99-android.rules for Nexus phones:

SUBSYSTEMS=="usb", ATTRS{idVendor}=="0bb4", ATTRS{idProduct}=="0fff", MODE="0666", OWNER="<your_account>" # Nexus One Fastboot
SUBSYSTEMS=="usb", ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="4e11", MODE="0666", OWNER="<your_account>" # Nexus One Normal
SUBSYSTEMS=="usb", ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="4e12", MODE="0666", OWNER="<your_account>" # Nexus One Debug/Recovery
SUBSYSTEMS=="usb", ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="4e20", MODE="0666", OWNER="<your_account>" # Nexus S Fastboot
SUBSYSTEMS=="usb", ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="4e21", MODE="0666", OWNER="<your_account>" # Nexus S Normal
SUBSYSTEMS=="usb", ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="4e22", MODE="0666", OWNER="<your_account>" # Nexus S Debug/Recovery
SUBSYSTEMS=="usb", ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="4e23", MODE="0666", OWNER="<your_account>" # ???
SUBSYSTEMS=="usb", ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="4e24", MODE="0666", OWNER="<your_account>" # Nexus S USB tethering
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0bb4", ATTRS{idProduct}=="0c8b", MODE="0666", OWNER="<your_account>" # HTC Normal

Then execute /etc/init.d/udev reload

Restoring factory ROM

Warning, it will destroy everything, make your backups first!!

  • Get firmware here for a European Nexus S i9023, mine needs the I9023XXKB3 one.
  • Rename tar.md5 as tar
  • Get Odin sw from here, choose i9023
    • e.g. I9003_Odin3_v1.82.rar & SAMSUNG_USB.rar
  • Run Odin (works in a virtualbox if needed), load the 4 files:
    • bootloader: I9023_EUR_GRI54_XXKB3/I9023_EUR_GRI54_XXKB3/Bootloader_I9023XXKA3.tar
    • PDA: I9023_EUR_GRI54_XXKB3/I9023_EUR_GRI54_XXKB3/PDA_SOJU_GRI54_TMO_EUR_MR1_SIGNED.tar
    • Phone: I9023_EUR_GRI54_XXKB3/I9023_EUR_GRI54_XXKB3/MODEM_I9023XXKB3_REV_00_CL912571_SIGNED.tar
    • CSC: I9023_EUR_GRI54_XXKB3/I9023_EUR_GRI54_XXKB3/DGS_I9023_EUR.tar
  • Turn phone off
  • Plug USB
  • Just before battery icon showing, enter download mode by pressing middle of volume up / volume down button for long, you'll get a big yellow warning triangle
  • If using virtualbox, bring USB device (Samsung serial) to virtualbox
  • Now Odin should show a yellow rectangle with COM0
  • Press "start" in Odin

Sources:

Restoring (most of) factory ROM with fastboot

Ok previous section was about restoring *everything* as genuine but it requires Windows and most of the time all you screwed up was the boot image, the recovery image or the system image so here is how to restore them or part of them provided that you can still enter fastboot:

fastboot oem unlock                  # if needed
fastboot flash recovery recovery.img # from Samsung PDA_SOJU_GRI54_TMO_EUR_MR1_SIGNED.tar
fastboot flash system system.img     # from Samsung PDA_SOJU_GRI54_TMO_EUR_MR1_SIGNED.tar
fastboot flash boot boot.img         # from Samsung PDA_SOJU_GRI54_TMO_EUR_MR1_SIGNED.tar

Warning: I got /sdcard content erased, maybe because I tried to enter the native recovery, but anyway, make backups first before trying anything you risk regretting!!!

E.g. to make a backup with clockwordmod:

  • Put phone into fastboot mode
  • Enter recovery
  • Choose backup & restore / backup
  • Choose mount / mount USB storage
  • From host: copy clockwordmod/backup/*

Entering fastboot mode

  • Power off phone
  • Press Volume up and power button together for long
  • You've entered fastboot
  • Alternatively, fastboot can be triggererd from adb: adb reboot-bootloader

For getting fastboot on the host, see further below

Rooting

!! Don't touch boot image or try CW 3.0.0.0, one of them caused the phone to not start android anymore, I had to perform the full factory restore with Odin !!

  • enter recovery mode from fastboot
    • You can make a backup now
    • install zip from sdcard -> choose -> su-2.3.6.1-ef-signed.zip
    • reboot

Sources:

Android 2.3

Getting fastboot & Android sources

There are several binaries around but I wanted to build my own. Maybe not the shortest way... I downloaded all android sources...
cf http://source.android.com/source/downloading.html
Some missing deps on my 64-but debian when I tried to compile everything: gperf, libc6-dev-i386, lib32ncurses5-dev ia32-libs g++-multilib lib32z1-dev lib32readline6-dev

. build/envsetup.sh
lunch crespo-eng
make -j2

Maybe we can just compile adb & fastboot:

make adb
make fastboot

cf http://www.cduce.org/~abate/build-android-adb-debian-sid-amd64

Getting adb & Android SDK

Get it from http://developer.android.com/sdk/index.html
Run tools/android -> get Android SDK Platform-tools, revision 3
It brings also adb but not fastboot
If you want to update SDK: tools/android update sdk

adb

You need to activate USB debugging:

  • Settings > Applications > Development > USB debugging

Some examples:

  • adb devices
  • adb shell
  • adb logcat

adb as root

Once the phone is rooted, you can, from a shell with e.g. adb shell invoke "su" & get root.
But to get immediately into root, the file /default.prop needs to contain ro.secure=0
But that file is restored from boot.img at each boot so you need to modify that one
See http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack%2C_Edit%2C_and_Re-Pack_Boot_Images#Alternative_Method
but there is also abootimg in debian:

  • Taking the boot.img from Samsung (see above in I9023_EUR_GRI54_XXKB3/I9023_EUR_GRI54_XXKB3/PDA_SOJU_GRI54_TMO_EUR_MR1_SIGNED.tar). I tried also with a boot.img taken by CW backup but the modified version was apparently too big to be flashed back. Anyway CW backup version is orig boot.img extended to the physical partition size (8M)
abootimg -x boot.img
mkdir ramdisk
cd ramdisk
gzip -dc ../initrd.img | cpio -i
sed -i default.prop 's/ro.secure=1/ro.secure=0/'
find . -print|cpio -o -Hnewc|gzip > ../initrd.img2
cd ..
abootimg -u boot.img -r initrd.img2
fastboot flash boot boot.img

For the last command, the phone needs of course to be in fastboot mode
Reboot phone
I had to re-enable USB debugging but now adb shell brings me immediately a root shell :)


Without this setup, it's a bit cumbersome to automate root commands from host, it looks like

adb shell su -c "netcfg usb0 dhcp"

and the SuperUser app prompts you for confirmation on the phone for each new command

Screenshots

Run ddms (from SDK) -> Tools / Device / Screen capture

USB tethering

Plug phone & PC via USB
Activate USB tethering (Settings / Wireless & networks / Tethering / USB Tethering)
It works OOB on Debian, nothing to do

Getting busybox

Need rooted phone, see above
Google's stripped busybox, called toolbox, is far from enough once you get a shell on the phone

Examples to use busybox versions instead of toolbox versions when the command exists twice:

# busybox mount -o remount,rw /system
# /system/xbin/mount -o remount,rw /system

Wi-Fi & client certs

To be able to authenticate to a Wi-Fi network using client certificates via TLS:
If needed, export certificate from IE in Pkcs#12 PFX, *with* private key, *with* all certs, *without* strong enc, *without* deletion of private key.
Rename .pfx file as .p12
(source: http://www.google.com/support/mobile/bin/answer.py?answer=168466&topic=27214#1086573)
Copy pkcs#12 certificate to root of USB storage.
File must end with .p12, not .pfx!
One single file with key+cert+cacerts is ok
Wi-Fi params: 802.1x EAP / TLS / phase2: None / CA cert: cf previous import / user cert: idem / Identity: DOMAIN\user... / Anonymous id: empty / password:...

Importing CA certs

I could only manage it via a webserver & crafted headers:

<?php
header("Content-Type: application/x-x509-ca-cert");
?>
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----

You may try this free service: http://www.realmb.com/droidCert/ which seems to do the same.
But even if imported they seem not to be used e.g. for IMAP TLS.
There is a heavier procedure to include CA certs in the phone root list, see CACert wiki, not tried yet.

Applications

Here is a list of potentially useful applications

Network

  • 2G-3G OnOff : widget to add a shortcut to the settings to enable/disable data
  • Quickteth : for an easy shortcut to USB tethering (add widget to desktop)

To be sorted

  • Apps Organizer : To group apps
  • Android Agenda Widget : See your agenda on your home screen
  • Bluetooth Switch : Activates BT when the phone is docked in the car
  • Bubble : Water level using the phone sensors
  • Buienalarm : (NL) rain alarm, tells you if precipitations are expected at your current location
  • Chrome to Phone : easy to send URL's or text from Google Chrome to the phone
  • Touch Calendar : calendar with easy scroll & zoom in/out
  • Notes (developer: Yuli) : simple application for notes
  • ColorNote Notepad (Notes)
  • Droid48 (shagrath; HP48 emulator)
  • My Tracks (My Tracks Team at Google; GPS tracking system)
  • Skype (Skype)
  • SMS Backup & Restore (Ritesh Sahu)
  • RealCalc Scientific Calculator (Brain Overspill)
  • Android Terminal Emulator (Jack Palevitch; Linux access through a terminal)
  • Hears (bytesequencing.com)
  • Text-To-Speech Extension (Eyes-Free Project)
  • SilentMode OnOff (CurveFish)
  • DailyStrip (FuseTree LLC)
  • Test de vitesse Speedtest (Ookla)
  • ASTRO Gestionnaire de fichiers (Metago)
  • Wifi Connecter Library (farproc)
  • Advanced Task Killer (ReChild)
  • APN Backup & Restore (Ritesh Sahu)

Google

  • Google Goggles (Google)
  • Google Earth (Google)
  • Google Maps (Google)
  • Google Search (Google)
  • Google Sky Map (Google)
  • Google Traduction (Google)
  • Gmail (Google)

Alternatives to default apps

  • Dialer One : Alternative dialer

Dictionaries

  • Dictionnaire Littré (Alexis Robert)
  • Van Dale French-Dutch (Paragon Software)
  • Van Dale English-Dutch (Paragon Software)
  • Van Dale Dutch Pocket (Paragon Software)
  • Van Dale German-Dutch (Paragon Software)
  • QuickDic German Dictionary (Thad Hughes)

Games

  • Reversi (Bluesky Studio)
  • Angry Birds : game, now full version for free
  • Move it! Free (AI Factory Limited; logical game of moving blocks)
  • National Flags Quiz (FractalGate; game)

Sensing

  • Boussole (Catch.com ; compass)
  • Shazam : Can identify music by listening to it for about 10s
  • Barcode Scanner (ZXing Team)
  • Wifi Analyzer (farproc)
  • GPS Status (EclipSim)

Open Source applications

GPS with offline maps

Commercial

  • Copilot Live (59€ for Europe)
  • Tomtom planned for next HTC phones, with free map of the country of purchase

Free

From this post:
Create your own maps with Mobile Atlas Creator (Java-based) & use them e.g. with RMaps, AndNav, Maverick, TrekBuddy,... (bitmaps so ok only for small areas such as cities)

  • Get e.g. RMaps from Android Market
  • Get latest release of Mobile Atlas Creator & unzip it
  • Get latest SqliteJDBC library and copy it inside th eMobile Atlas Creator directory
  • Run it (start.sh)
  • Choose your source, e.g. OpenStreetMaps, Google Maps,...
  • Select area: Right click to Drag, Scroll to zoom In/Out, Left click to select downloadable area
  • Select one or more zoom levels, e.g. from 12 to 18 for all levels of details of a city
  • Do “add selection” with a name of your choice
  • Select “BigPlanet SQLite” from “Atlas Settings” (for RMaps, otherwise Maverick Atlas Format for Maverick etc)
  • "Create Atlas"
  • Download the .sqlitedb map into the phone SDcard/rmaps/maps
  • Disconnect the phone
  • Open RMaps and Menu > More > Settings > User defined maps > BigPlanet_maps.sqlitedb > Enabled Maps
  • Return to main maps screen and then Menu > Maps > BigPlanet_maps.sqlitedb.

Free Navit - OSM

  • Install Navit from here
  • Install preprocessed OSM map from here and put it as /sdcard/navitmap.bin