[Click Android Development] TheSSJ:
Hi,

this thread is meant as a starting point for every kind of questions. I will write everything I know into this thread and update it (hopefully) frequently ;)

Here are the topics handled for now (if you have any other questions you want to have answered you can PM me, so I can try to handle it if I know the solution and add this to my to do list in point 5!!! :D ):

1. How can I root my phone

1.1 General information/Basic adb-commands

1.2 Do I have to create a goldcard?

1.3 Tools you need

1.4 The automated way

1.5 The manual way (recommended by the author)

1.6 Problems and (hopefully good) solutions

1.7 References

2. Flashing images/ROMs

2.1 What is a recovery image

2.2 What is a boot image

2.3 How to flash/tools needed

2.3.1 Creating a Goldcard

2.4 Where can I get an overview of the existing ROMs?

2.5 Problems during flashing and solutions

2.6 References

3. Information about the Tattoo/Useful stuff

3.1 How to install busybox?

3.2 Can it perform multitouch?

3.3 How to increase battery life?

3.4 Using own ringtones for calls/sms

3.5 How to disable data transfer with a custom ROM?

3.6 How to make the Tattoo ring louder?

3.7 How to replace the home screen?

3.8 Disabling xxx-synchronisation with Google-servers

3.9 Backing up apk's and data to your PC

3.10 How to enable more languages on my mobile?

3.11 How to manually delete system apks? Alternatively with GUI?

4. Dev-Goodies

4.1 Modifying update.zips and resigning them

4.2 Modifying resources in apk-files and resigning them

4.3 Installing apks via adb for getting exact error codes if installation fails

4.4 Everything related to ROM cooking

5. Things I will do better in this thread due to user request

Please note: I won't be giving tutorials about Android-apps usage beside the one mentioned in my tutorial!

Let's start now:

1. How can I root my phone?

1.1 General information/Basic adb-commands

Rooting a phone enables you to do things, which normally aren't possible for the average user like:

- Removing apps which were preinstalled by the provider (like Orange, Vodafone, etc.). My Tattoo had Vodafone apps for buying music and other sh*t, which was installed on the system partition (to which a "normal" user has no rights to write to, including deleting).

The Tattoo was successfully rooted by a bunch of guys here, namely -bm-, mainfram3 and Coburn64 (maybe, I don't remember quite correctly :D). Also the Tattoo was the first phone having a security mechanism hindering a user to mount the filesystems as read/write, which had to be overridden by remapping the read only memory region to a read/write one. This is done by the module Tattoo-hack.ko, also made by mainfram3. He also created the first boot.img, which enabled su directly from adb and loading Tattoo-hack directly from boot on.

A few words about adb:

ADB is a tool for communicating from the PC with the mobile phone. For this a service is running on the phone enabling the communication via Terminal Emulator. Here are the most useful adb-commands:

adb push localFileFromPC /path/on/mobilephone
-> pushes a file "localFileFromPC" to a specified location on the phone
adb pull /path/to/file pathFromPC
-> receives a file from the phone and stores it to "pathFromPC"
adb remount
-> This is only possible in custom ROMs, remounts the file system to r/w automatically
adb shell "command"
-> executes "command" and returns to the computer shell
adb shell
-> opens a shell session on the phone (from here on you have to be very careful! Also you can execute now normal linux commands like rm, mv, ls, chmod and so on, but not cp (this can done through busybox)). You will have to use this more often, so get used to it ;)

1.2 Do I have to create a goldcard?

I read this question quite often. For rooting, you don't need it, but for SIM-locked phones you can't flash custom unbranded ROMs (I think).

A guide to create a goldcard follow this link: http://xdaforums.com/showpost.php?p=5179788&postcount=1 (thanks to MiSSigNNo to this point)

1.3 Tools you need

A complete set of tools can be found here :) Feel free to mirror it:

http://rapidshare.com/files/403766494/Tattoo.rar.html

This package contains:

- adb binaries for Windows (sorry Linux users :( )

- su (Please note: use the su-binary attached in this post, not the one in the archive!!!!!)

- m7 exploit

- Amon_RA recovery.img

- mainfram3 boot.img

- flash_image binary

- tattoo-hack.ko

1.4 The automated way

This method was created by maverixx and can be found here. This basically consists of a package doing everything you need by itself. It roots the phone and flashes maverixx recovery.img, which (no offense) I don't like as much as I like Amon_RA's one!). Just click the batchfile and it does the rest (you have to connect your phone via USB to your PC though ;)).

If you want to use the automated way, but flashing Amon_RA's recovery, just replace the recovery.img from maverixx' package with the recovery.img provided in my archive file (see 1.3 for the link).

In my time here I noticed quite a few users experiencing problems either with a fully functional su or with the recovery image not flashing certain update.zip packages. It seems to be a matter of luck.

1.5 The manual way (recommended by the author)

I personally like what is done when and how, that's why I recommend the manual way. So let's get down to business :) Let's see if you know all the adb-commands I wrote here:

Questions? :D

1.6 Problems and (hopefully good) solutions

Q: How do I execute my command line tool?

A: On your Windows host, go to Start->Run...->type "cmd"

Q: Where is my adb? When I type it in my shell it says that it was not found!

A: The adb binary is found in the archive I supplied above or in the Google SDK. As my archive-file is quite smaller than the Google SDK you should take mine. Let's suppose your adb binary is unpacked in C:\Tattoo, then type:

Your\Current\Location> cd C:\Tattoo
C:\Tattoo> adb <command>

Q: adb says "error: device not found" when I try to launch the shell on the phone!

A: Connect the phone with the usb cable and make sure the sd card is not mounted as drive on your PC!!!

Q: When I want to copy something the phone returns that "cp" is not found! Also when I try to move a file, it says "cross-link device".

A: Well, copying from one partition to another is only possible either via busybox or via

cat file > /location/filename
Example:
cp /data/su /system/bin
is realized by typing
cat /data/su > /system/bin/su

Also make sure that system is r/w!!!

Q: flash_image returns write errors when flashing recovery/boot image!

A:

For boot: Try to redo the flash procedure

For recovery: Note that you can't flash the same recovery.img as the one already installed, so install another recovery.img first (like maverixx) and then Amon_RA's again. If it still doesn't work reboot, remount the partitions r/w, insmod tattoo-hack.ko and retry flashing.

Q: How can I unroot my device?

A: Just delete su from /system/xbin and restore the old boot.img. Alternatively see here for retrieving a stock ROM to flash it on your phone.

PM me with more questions and I'll post them with the possible solution.

1.7 References

- Zecanilis EXCELLENT Root-Recovery-Flash images thread

- maverixx' One-click root method+recovery thread

- Coburn64's Newbie guide for manual rooting (recommended reading!)

2. Flashing images/ROMs

2.1 What is a recovery image

A recovery image is not only useful to flash custom ROMs on your device. It also enables you to backup your entire phone contents to restore it completely in case of a brick, if anything should happen...especially SIM-locked mobiles should be backed up as soon as possible. ;) Also many recovery image modders add several non-standard features like mounting the SD card while in recovery mode or enabling adb support, etc.

2.2 What is a boot image

The boot image not only contains the kernel which brings up your Tattoos, it only can be modified to load up modules enabling ext2/3 support, loading camera, remapping read only code to an r/w area (tattoo-hack.ko), etc. Without a working boot.img, don't even bother trying to boot the phone (maybe if you do a logcat it returns something useful to solve this problem ;) )

2.3 How to flash/tools needed

Execute steps 1 to 4 in topic 1.5 first!

2.3.1 Creating a Goldcard

This is a post I took from MiSSigNNo, kudos to him:

2.4 Where can I get an overview of the existing ROMs?

Look it up here (Excellent work liderzre)

2.5 Problems during flashing and solutions

Q: HEEEEELLLPPP! flash_image says that it couldn't write to some memory addresses! What can I do?

A: Don't panic. First make sure to have loaded tattoo-hack.ko, remounted system and data to r/w and then try again with another recovery.img (either maverixx or Amon_RA). Flashing the same recovery.img again WON'T WORK!!!! That's why you have to take a little detour by first flashing another recovery image.

Q: How do I boot to recovery??

A: Type in your command line while the phone is plugged in:

adb shell "reboot recovery"

. If this doesn't work, turn off your phone, hold down the home-button and press the power-button. Then when the Tattoo logo can be seen, release the home button and the recovery screen should be seen :)

2.6 References

- Zecanilis EXCELLENT Root-Recovery-Flash images thread

- maverixx' One-click root method+recovery thread

3. Information about the Tattoo/Useful stuff

3.1 How to install busybox?

Load the busybox binary here (select the one with arm6 at the end). Put this binary onto your data or system partition (I suggest /system/xbin) and now there are two ways to install/enable it. See below ;)

Method 1 (will extract EVERY FEATURE, but consumes A LOT of your disk space so be careful or switch to method 2)

Do this in your command line:

adb remount (make it r/w if not done already)
adb shell "mkdir /system/xbin" (create dir if it doesn't exist)
adb push busybox /system/xbin (please make sure to have busybox in the same directory as adb ;) )
adb shell
cd /system/xbin
./busybox --install

Method 2 (saves your precious disk space :D)

Do this in your command line

/system/xbin/busybox --install -s /system/xbin

3.2 Can it perform multitouch?

Nope, the Tattoo has a resistive touch screen, which is known to be NON-multitouch...newer generation or high-end phones usually have capacitative screens. My suggestion is not taking the Nexus One anymore, since their touch screen type supports only 2 fingers at once, while phones like the Samsung Galaxy S have a SUPER responsiveness and sensibility (and of course 10 fingers support).

3.3 How to increase battery life?

Okay, here are little tips how to increase battery life - mine holds 7 to 8 days and I surf, call ppl and sms almost every day:

1. Flash either fyodor 0.6.4.2 or Abyzou 2.1.9 - my favourite is fyodor ones (if I still would have a Tattoo, of course ;) )

2. Download APNd roid from the market or here and disable your 3G Internet connection (for activating it, just start the program again!)

3. If you see that you have NO RECEPTION AT ALL in one place (at work for instance), turn off your phone as this will DRASTICALLY decrease battery life because the phone tries constantly to search for a network it can log on to.

4. Try to keep your phone in normal temperature areas (between 20 and 27 degrees celsius = 68 - 80.6 degrees fahrenheit)

5. Kill unneeded apps automatically (there are quite a few apps doing this)

3.4 Using own ringtones for calls/sms

Create a folder called "media" on the root of your SD card and a sub-folder called "audio" there you have to create one folder called "notifications" for SMS and "ringtones" for call sounds. Place every desired track into these folders and reboot your phone. You should see the entries now when choosing ringtones. Alternatively just load "Ringo Pro", a really powerful tool also able to display SMS pop-ups and much more.

3.5 How to disable data transfer with a custom ROM?

As already explained above, load APN droid from the market or here.

3.6 How to make the Tattoo ring louder?

There is a little app called "Louder Volume Hack" enabling your phone to ring much louder than normally. You can load it on any popular w*rez-site ;) Unfortunately I cannot enter the link to the app here or PM it. Any questions requesting a link to this app will be deleted instantly, so don't bother trying and use Google. There are several buttons displayed, but for better visibility I suggest enabling the Widget and hacking the system there. Also please note that ROOT access is required!! Refer to section 1 to root your phone.

3.7 How to replace the home screen?

There are two ways to do it. Method 1 is the easier one, but runs the Google Launcher and the replacement laucher in parrallel, which implies more CPU usage and battery drain. Method 2 is the more brutal one, but enables you to run just one launcher.

Method 1:

Install the replacement home app and press the home button. A dialog should appear asking you which Home Launcher should be used.

Method 2:

Put your home replacement apk onto the root of your SD and make sure you have busybox installed and /system mounted as writeable. Rename the Home replacement apk to Launcher.apk and fire up adb shell:

mv /system/app/Launcher.apk /system/app/Launcher.apk.old && mv /system/app/Launcher.odex /system/app/Launcher.odex.old && cp /sdcard/Launcher.apk /system/app && chmod 755 /system/app/Launcher.apk

Should be a pretty generic approach ;)

3.8 Disabling xxx-synchronisation with Google-servers

Go to settings, data synchonisation and disable the entries you don't want to have synch'ed with Google. Since it's long time ago since I did this (remember that I don't own a Tattoo anymore) the procedure can be slightly different from ROM to ROM.

3.9 Backing up apk's and data to your PC

By popular request, here a topic about how to backup apk's and their corresponding data manually (can be done separately, too if you want just one of the two). Doing it with the tar command HOPEFULLY preserves also all permissions!!! Check it:

Hit up adb shell and make sure have busybox:

for the apks
# tar -cvf /sdcard/dataAppsBackup.tar /data/app
for the data
# tar -cvf /sdcard/dataDataBAckup.tar /data/data

If you want to decompress these files again do:

# tar -xvf /sdcard/dataAppsBackup.tar -C /data
# tar -xvf /sdcard/dataDataBackup.tar -C /data

Note that these files won't be compressed! If you want to save some disk space on your SD then add the parameter 'z' (without the quotes) in the tar arguments (e.g. tar -cvfz for compressing and tar -xvfz for decompressing)

3.10 How to enable more languages on my mobile?

There is an app called MoreLocale in the market enabling you to select more languages. Download it, it's free ;)

3.11 How to manually delete system apks? Alternatively with GUI?

For deleting manually you only need root-access. With GUI you need RootExplorer (buy it or do what you need to do to get this app-but with these features I would suggest to buy the app ;) ).

Note: I do not take any responsibility if you delete the wrong apk and you lose any functionality of the phone. Do this only if you know what you're doing!

The manual way:

Connect the phone via USB, fire up adb shell and type:

insmod /LOCATION TO [URL="http://TATTOOHACK.KO/tattoo-hack.ko"]TATTOOHACK.KO/tattoo-hack.ko[/URL]
mount -o rw,remount /dev/block/mtdblock3 /system
cd /system/app
rm NAMEOFAPK.apk

The GUI way:

Install RootExplorer, open it, navigate to /system/app and press the little "Mount R/W" button at the top of the screen and begin deleting :)

4. Dev-Goodies

4.1 Modifying update.zips and resigning them

See this thread and get enlightened :)

4.2 Modifying resources in apk-files and resigning them

Same procedure as above:

1. Extract the file with WinRAR/WinZIP, delete the contents of META-INF and start modifying what you have to modify

2. Pack everything again into a ZIP file and sign it with the signapk.jar file (can be found somewhere in the forum or here). The syntax of how to use this can be found in the last link (yes, it's only 10 KB :p).

4.3 Installing apks via adb for getting exact error codes if installation fails

Prerequisites: Either know the exact path to the apk or put it into the same directory as your adb executable and hit up your command line:

adb install /path/to/apk/file.apk
OR
adb install file.apk (implies that apk is located in same dir as adb)

4.4 Everything related to ROM cooking

Check this link (thanks to Decad3nce) and this one (thanks to mxlaser).

5. Things I will do better in this thread due to user request

- Nothing :)

The end for now.