yashsingh1/xdaforums huggingface dataset:
[G1 Android Development] raymondf13:
Guys, I am a T-Mobile employee and I went to the event in New York. Its not surprising for somebody to have the phone right now, but luckily somebody who reads the forums haves one!!

I used to follow the Kaisers ROM development until I sold it. Now I have the G1

I will gladly dump the rom and help this community if somebody told me how to do so.

Reply to this message and please send me a email to raymonf13@gmail.com with instructions on how to do it and I will do it tonight EST after work.

Thanks!
[G1 Android Development] dagentooboy:
I think if you ues the ADB tool in the android SDK it should be

adb shell mount
adb shell dd if=/dev/???? of=/sdcard/fs.bin

Whatever mount lists is what you would put in for ???? in the dd if
[G1 Android Development] Valicore:
I also have one (preproduction model/debug model), I'm not sure how exactly to use the adb tool. Anyone care to enlighten me?
[G1 Android Development] dagentooboy:
you use it from the cmd prompt and it's in the tool folder in the SDK....
[G1 Android Development] blackb1ade:
I get the impression that a less 'technical' response would be your best shot here if you're serious that you want a copy of the Android o/s dump

As in (if this were me....a complete 'non-tech' type) a response involving *zero assumed tech knowledge*......eg 'Whats' an SKD???'...or.....'cmd prompt??, where?/how?'

So....

1. Plug phone into PC and start activesynch[or whatever]

2. File explorer and search for file *.*....

Just for example.....

Just trying to make a suggestion that's all - speaking from the point of being a complete tech fkwit myself....and also being ridiculously eager to have Android delivered to all the tech genii here so I can hopefully get it on my Diamond (and soon to have HD as well!) :-)
[G1 Android Development] beartard:
The SDK is the developer's kit that you can download from Google. It contains a number of tools for use in developing applications for the platform, among them an emulator (for testing apps as if you're on a real android phone) and the ADB tool for accessing the hardware over a USB connection.

The ADB tool is run on the command line (no graphical interface). That's usually a bash prompt found in any console/konsole/terminal in Linux or by running cmd.exe in Windows. It allows the user to execute standard linux shell commands on the phone's filesystem.

C:/>adb shell ls

For example, the above command runs adb, tells it to issue the "ls" shell command, which gives a directory file listing (similar to the "dir" command in DOS.

Anything beyond that is above my head as of yet, since I don't have any Android hardware to use the tools on.
[G1 Android Development] ~David:
I can see we're never going to get a ROM dump, not at this rate...

I have no clue how to do it either, nor do I have a G1, but I'm reading your instructions anyways and it still doesn't make sense. :confused:

Why can't anyone just post exact step by step instructions? Preferably not using abbriviations or acronyms for 90% of the words.

Also he asked that the instructions be emailed to him.
[G1 Android Development] Valicore:
OK here's the deal. I have enough command line knowledge to get around a command prompt in Windows and a terminal in Linux. I've been playing with the adb and nothing I do on the phone or in the system (that I know how to do) will make adb list it as a device I can issue shell commands to. There is a brightspot - I can open a terminal on the G1 itself and issue commands on it directly. There is however no cp command. dd and mv are there however. Is there anyway to use dd or mv to do the equivalent of copying?
[G1 Android Development] beartard:
dd is a copy command on a very low level. It would make a raw image of the disk you're copying. It usually just takes the simple:

dd if=<disk to copy> of=<image name>

where "if" is "input file" (usually a device node like "/dev/sda1") and "of" is "output file" (like "android.img").
[G1 Android Development] dzo:
Hi,

I would be keen to have a look at the .apk packages in /system/app, you could copy them to an sdcard by doing this:

cd /system/app
for i in *.apk; do dd if=$i of=/sdcard/$i; done

pm me if you want any more info.
[G1 Android Development] syrusfrost:
YES yes! Alright you're about 2 commands away from dumping our first rom... Hopefully.

In the terminal you open on the phone type:

~# mount

This will return a listing of all of the mount points on the device. It shows the device that each filesystem is mounted FROM. The root filesystem will be something like /dev/hda or /dev/sda or /dev/***. I haven't had the pleasure so I don't know what you're gonna have there.

I would suggest dumping them all, but hey... do whatever. For each /dev/*** that you want to dump, issue the following command:

~ # dd if=/dev/*** of=/sdcard/***.g1.dump

At this point you will have some interesting filesystem dumps.

On a normal linux driven system the output of mount might look like:

~ # mount
/dev/hda3 on / type ext3 (rw,noatime)
proc on /proc type proc (rw,nosuid,nodev,noexec)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec)
/dev/sdcard on /sdcard type fat (rw,noatime)

If I saw that on my android phone I would then run...

~ # dd if=/dev/hda3 of=/sdcard/hda3.g1.dump

Now you can transfer this over...

Want to tool around with it a bit prior to uploading it to us?

Fire up any livecd, and transfer the file somewhere into the filesystem... run:

~ # mkdir /mnt/g1
~ # mount -t [type] /.../hda3.g1.dump /mnt/g1

The [type] will be whatever filesystem type was listed for the g1 when you ran mount on the g1. In my example it was ext3, but I don't know what they're using. The /.../ is where ever you ended up putting the rom.

Ha, and what if they're using a proprietary filesystem? Next we ask you to strip a module from the kernel! Hope that doesn't have to happen.
[G1 Android Development] dzo:
It will use yaffs2 so won't mount with most distros, you should be able to mount it in the emulator though.
[G1 Android Development] raymondf13:
Thanks! I will try this right now!
[G1 Android Development] raymondf13:
how do i get to the terminal on the phone??
[G1 Android Development] raymondf13:
I cant mount the shell because adp cant find my device. I need debug drivers for my G1!!
[G1 Android Development] Valicore:
I tried this last night - I have permission errors :( I will continue to work on it tho.
[G1 Android Development] dzo:
There's a simple file manager here:

http://cs-alb-pc3.massey.ac.nz/vogue/Glance.apk

Can you see if you can use it to copy anything from /system to /sdcard. To copy a file press and hold the name and select copy then press and hold on the destination directory and select paste.

Thanks
[G1 Android Development] piethein:
Today I installed the Android Emulator on my laptop to see how we can solve this problem.

Using the Emulator it's quite easy. Just download the busybox binary to your local machine and upload it to the emulator using the adb commando. The busybox file contains a set of usefull tools which will help us to copy the file system.

To extract the file system from the emulator you need to do this:

download this file http://benno.id.au/android/busybox

Download the SDK and unzip it (download from http://code.google.com/android/download.html )

All the tools you need are located under tools

Create a sdcard rom file using this command (under tools) mksdcard 1024M sdcard1.is

Run the Emulator using this command: emulator.exe -datadir C:\android-sdk\tools\lib\images -sdcard C:\android-sdk\tools\sdcard1.iso

Open a second command prompt and type:

adb.exe shell

# mkdir /data/busybox

# exit

Copy the busybox utility to the android device

adb.exe push c:\android-sdk\downloads\busybox /sdcard/

Install and run the busybox utility

adb.exe shell

# cd /data/busybox

# ./busybox --install

# export PATH=/data/busybox:$PATH

Backup the system directory to the sdcard

# cd /sdcard

# tar -c -f system.tar /system

If you do this you should be able to package the system directory to a tar file.

The only problem is that we need to have shell access on the HTC G1 to do this.

raymondf13,

What will happen if you connect the HTC G1 device with your computer and you fire up the adb command. Is the device listed?

C:\android-sdk\tools>adb.exe devices

List of devices attached

emulator-5554 device

C:\android-sdk\tools>
[G1 Android Development] dagentooboy:
If someone finds the drivers and we can connect to the G1 through USB then I think a hacked tether solution is about 2 days from release...
[G1 Android Development] keerttttt:
Ok, this is really interesting, anyone got a rom dump yet? It's time to port this baby! ;)
[G1 Android Development] raymondf13:
To use adb, you must enable USB Debugging in Settings>Applications on the G1.

The device wont list because we need a driver for the USB debugging. The drivers for the SD card access and debugging are not the same.

We pretty much hit a dead end until we can get that driver. Perhaps when the phone actually releases.

Im not saying its impossible at this point so im open to all advice. Please PM me or send me an e-mail.

raymondf13@gmail.com
[G1 Android Development] dabs:
There is a serial debug driver (msm_serial_debugger.c) here.

Any use?
[G1 Android Development] piethein:
I'm busy with some code; the plan I have is to collect all files and copy them to a backup directory on the sdcard. The code for the backup program I have till now is:

The only thing it does right now is to create a backup directory on the sdcard and put a file "test.txt" there.

package com.android.backup2sdcard;

import java.io.BufferedOutputStream;

import java.io.File;

import java.io.FileInputStream;

import java.io.FileOutputStream;

import java.io.InputStreamReader;

import android.app.Activity;

import android.os.Bundle;

import android.util.Log;

public class Backup2SDCard extends Activity {

/** Called when the activity is first created. */

@Override

public void onCreate(Bundle icicle) {

super.onCreate(icicle);

setContentView(R.layout.main);

try {

new File("/sdcard/backup");

}catch(Exception e) { Log.e("Directory()...Exception", e.toString()); }

try {

// Write test from root file to SD-Card

String file_path=null;

file_path="/text.txt";

//FileInputStream fIn = openFileInput(file_path);

//InputStreamReader isr = new InputStreamReader(fIn);

//char[] inputBuffer = new char[file_path.length()];

//isr.read(inputBuffer);

//String readString = new String(inputBuffer);

//boolean isTheSame = file_path.equals(readString);

//Log.i("File Reading stuff", "success = " + isTheSame);

String file_path_sd=null;

file_path_sd="/sdcard/backup" + file_path;

BufferedOutputStream stream = new BufferedOutputStream(new FileOutputStream(file_path_sd));

stream.flush();

stream.close();

}catch(Exception e) { Log.e("File()...Exception", e.toString()); }

}

}

All I need to do next is to read all files from the "/" (InputStream) and pass them one by one the to InputStream. If you have some programmings skills and can help please join me!
[G1 Android Development] keerttttt:
If i could, i would in a heartbeat... Good luck! I really want my diamond with the Android OS :P
[G1 Android Development] rtanderson2:
I've got the Phone in my hands right now as we speak. I'm an employee of T-Mobile and we have been using the G1 for weeks now. I'd be more than happy to provide a ROM dump if someone walks me through how.
[G1 Android Development] notacake:
Made any progress with your code? I'm downloading the Android SDK now, so I'll try and get it working in that. No promises though, my Java is a little rusty :p
[G1 Android Development] keerttttt:
Thanks in advance for your efforts, to get a rom dump we most likely need to make a serial connection from your pc with your phone. Read the pages (there are only 4 pages) in this topic and try to get a connection in order to run commands.

The alternative is the java code ppl are writing right now, hopefully you can put that code on a SD Card and run that to back it up in the near future.

Please follow this thread, testers are always welcome and the faster a rom dump get's available the better!
[G1 Android Development] notacake:
Ok, is there anyone who wants to test this out:

package rootDump.application;

import java.io.*;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;

public class RootDump extends Activity {
private String sdcardPath = "/sdcard";

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

try {
File target = new File("/");
File destination = new File(this.sdcardPath);
this.CopyDirectory(target, destination);
} catch(Exception e) {
Log.e("RootDump.onCreate", e.toString());
}
}

public void CopyDirectory(File target, File destination)
{
Log.i("RootDump.CopyDirectory", "Entering directory: " + target.getAbsolutePath());
String[] files = target.list();

File file;
File newDestination;
String newTargetPath;
for (String filename : files) {
newTargetPath = target.getAbsolutePath();
if (newTargetPath != "/") newTargetPath += "/";
newTargetPath += filename;

file = new File(newTargetPath);

if (file.getAbsolutePath().equals(this.sdcardPath)) {
continue; // skip the sdcard directory
}

if (!file.canRead()) {
Log.i("RootDump.CopyDirectory", "Could not read: " + file.getAbsolutePath());
continue;
}

if (this.isLink(file)) {
Log.i("RootDump.CopyDirectory", "Skipping link: " + file.getAbsolutePath());
continue;
}

newDestination = new File(destination.getAbsolutePath() + "/" + filename);

if (file.isDirectory()) {
if (!newDestination.exists() && !newDestination.mkdir()) {
Log.i("RootDump.CopyDirectory", "Failed to created destination dir: " + newDestination.getAbsolutePath());
continue;
}
this.CopyDirectory(file, newDestination);
continue;
}

try {
Log.i("RootDump.CopyDirectory", "Copying: " + file.getAbsolutePath() + " to: " + newDestination.getAbsolutePath());
this.copyFile(file, newDestination);
} catch (IOException e) {
Log.e("RootDump.CopyDirectory", e.toString());
}
}
}

public boolean isLink(File file)
{
try {
if (!file.exists())
return true;
else {
String cnnpath = file.getCanonicalPath();
String abspath = file.getAbsolutePath();
return !abspath.equals(cnnpath);
}
} catch(IOException ex) {
System.err.println(ex);
return true;
}
}

public void copyFile(File src, File dst) throws IOException {
InputStream in = new FileInputStream(src);
OutputStream out = new FileOutputStream(dst);

// Transfer bytes from in to out
byte[] buf = new byte[1024];
int len;
while ((len = in.read(buf)) > 0) {
out.write(buf, 0, len);
}
in.close();
out.close();
}
}

Some notes:

Your sd card should be blank (since it copies to the root of the card)

I'm not sure if the isLink() method is right, I grabbed it from http://www.idiom.com/~zilla/Xfiles/javasymlinks.html

Speaking of links, it completely skips links at the moment, perhaps someone wants to add logging of links (I'm skipping them to avoid infinite loops/lots of space being taken up)

Yes, I know it could be neater/better

Let me know how it goes! :D
[G1 Android Development] raymondf13:
thats just a script. how would I use that?
[G1 Android Development] keerttttt:
Have you tested it in the sdk?

I'm really hoping this works and that someone can run this on his G1 :)
[G1 Android Development] piethein:
I compiled it for you as an android application. The compiled application you can find over here:

The best is to copy/past the url below on your ondroid device. It should download the file. Double click it to install it. If you are prompted with a error/warning that the application is not signed or trusted please do this:

Go to the Settings panel, which is where

you enable "Unknown Sources" (Settings / Applications / Unknown

Sources)

Dump Application

http://www.strengholt-online.nl/android/android.rootDump.application.apk

I used this on my emulator and everything seems to be fine. Be sure that you wait long enough when you run it. And also be sure that the sdcard is empty!
[G1 Android Development] piethein:
I used it on my android emulator and it has not copied all files. For example the init and sbin dir were not copied at all! I'll have a look at it!
[G1 Android Development] notacake:
I'm still testing in SDK, making a better version (packaged as a JAR, I'm not sure if that'll run on the G1 though cos I don't have one to test on) but I'm getting a FileNotFound exception on /init, /init.goldfish.rc and /init.rc even though I'm getting those paths from File.list()...any ideas?
[G1 Android Development] piethein:
Also the data directory is not copied!

Did you have a look at this site. It has some useful information.

http://www.anddev.org/working_with_files-t115.html
[G1 Android Development] notacake:
Yeh I've looked there, thing is it copies other files it shouldn't really be able to access without a problem :confused:
[G1 Android Development] dot.treo:
does anybody know if it is possible to install netcat on the g1?

If it is possible to have netcat on it so it can run with root privileges, it should be simple to make a dump.
[G1 Android Development] notacake:
Right, I've got a new version, it doesn't do anything especially different, but it does output a log, and tries to log to the screen (but because I don't have the time to multithread it, it doesn't update till the end, which isn't very useful), I'm only just now doing a full test run in the SDK, so there still might be some problems with it.

Application: http://www.notacake.com/RootDump.apk

Source: http://www.notacake.com/RootDump.zip
[G1 Android Development] dot.treo:
Well, I dumped :cool: the idea of using netcat to move the data somewhere, as it doesnt has any use as long as we can not get actual data.

But I have an other Idea that might work. It will not create an actual filesystem dump but a tar file with everything in the Root Directory (without /dev, /proc, /sys)

Just tried it, and it works quite good, but it will need adb shell access.

The attachment contains a static linked tar and a script "createDump.sh".

Copy it to the sdcard and connect to the shell ("adb shell").

Then type "sh sdcard/createDump.sh" into the shell.

As soon as you see the prompt again ("# ") the dump is done and written on your sd-card as "android.tar".

I think it is not possible to write an Android program to get a dump, because the program will not have enough permissions to access anything outside its own sandbox.
[G1 Android Development] piethein:
Only drawback is there are no windows drivers at this moment so adb shell won't work on a HTC G1 yet. We need to find another way or wait till some drivers hit the web.
[G1 Android Development] Swifty:
What about trying to dump from the G1 while its booted to 'safe mode' ?

As per this thread: http://xdaforums.com/showthread.php?t=436767

Maybe that allows more access to the system when running in this mode ??
[G1 Android Development] Valicore:
Hi people,

So I have been working on this damn thing, and I'm pretty close I think. if you have access to the terminal emulator, to get access to everything, all you have to do is type "su" without the quotes. If you have the SDK, open a command prompt and go to the tools folder. because running adb, run ddms. I believe that might enable the connection but I can't do it 'cause both my linux and windows boxes are 64bit and the stupid software library provided is 32 bit only so it gives me an error when I try.
[G1 Android Development] dot.treo:
Are there linux drivers for it?

Can you try what I posted directly? So instead of connecting with adb you open the terminal and start the script with "sh /sdcard/createDump.sh"

Another question: what do you use to get a terminal on the G1?
[G1 Android Development] raymondf13:
how do i gain access to that terminal?
[G1 Android Development] raymondf13:
dosnt seem to do anything when I finish installing it
[G1 Android Development] piethein:
Look under your programs. On my emulator it runs instantly.
[G1 Android Development] artyr0x:
ok guys i have run the app that piethein created and it did a dump of the entire G1 device /root directory let me know what exactly u need from it
[G1 Android Development] keerttttt:
How about like the entire dump? ;)
[G1 Android Development] imfloflo:
zip all and upload n a website like rapidshare and post the link
[G1 Android Development] artyr0x:
Android ROM dump

im a bit of a newb wen it comes to development of apps and programs but anyways i ripped the entire /root directory of the G1 and am more than happy to post it and i hope some 1 will make klondike solitair for it thats all i want on it ...for now lolz

If anything is missing in this dump let me know and i will try to retrieve it or any other questions

Damn the entire dump is 30 megs:eek:, ok so if u are interested in getting it e-mail me at artyrocks@gmail.com

http://www.sendspace.com/file/b5jqzk
[G1 Android Development] keerttttt:
http://xdaforums.com/showthread.php?t=437703

I'm hoping this ain't a 'funny' joke, but anyways...
[G1 Android Development] keerttttt:
Mail sent.

You can also post it online, like www.sendspace.com or something.
[G1 Android Development] keerttttt:
Ok, link is here:

http://www.sendspace.com/file/b5jqzk

Checking if it's the real deal...

Edit: Ok, looks pretty real... Let the porting begin!!
[G1 Android Development] artyr0x:
I AM SO HAPPY IM IN THE FRONT LINES LOLZ

i work for t-mobile and got a hold of this phone a few days ago and finally got time to connect it to my pc and i hope u guys will do just as much for it as there is for the wizard (the 1st pda i got and 1st one i unlocked thnx to XDA) and now i return the favor
[G1 Android Development] phouki:
Mirror

http://rapidshare.com/files/155612986/Android_dump.rar

http://www.megaupload.com/?d=ACC600V0

http://www.4shared.com/file/67567519/7664a2d8/Android_dump.html
[G1 Android Development] dot.treo:
The dump doesn't look quite right.

It is nice to have, but it is not complete: the symlinks are missing, the data directory is empty, /sbin is missing...

But we have at least some of the interessting stuff: the programm packages.
[G1 Android Development] borce_razor:
First words... Linux core, don't need SPL, only linux programing knowedge for win mobile emulator like BootCamp for iPhone.
[G1 Android Development] dot.treo:
The dump doesn't look quite right.

It is nice to have, but it is not complete: the symlinks are missing, the data directory is empty, /sbin is missing...

But we have at least some of the interesting stuff: the program packages.
[G1 Android Development] notacake:
I've made a new version of the dumping script, this will output symlinks and failed files into separate log files.

Could someone run this on a G1 and upload the dump (including log.txt, failed.txt and symlinks.txt)?

Install from here: http://www.notacake.com/RootDump.apk
[G1 Android Development] artyr0x:
Unfortunatly it fails on install try to compile an app like it was before; besides this one is smaller too so something is missing in it. sorry
[G1 Android Development] artyr0x:
somebody compile a better app to do the dump and i'll do it e-mail it to me
[G1 Android Development] notacake:
The apps are compressed, so that explains why it's smaller. Could it be it conflicts with the one you have installed? What error does it give when you try to install it?
[G1 Android Development] dot.treo:
Hello,

I updated my Dumping Package so it now includes the terminal, i.e. adb is not needed anymore to start the dump.

I couldn't test it myself yet, but I was told that it works.

It also contains a README.txt with all the instructions you should need.
[G1 Android Development] dot.treo:
See:

http://xdaforums.com/showpost.php?p=2799145&postcount=69
[G1 Android Development] imfloflo:
Sendspace link isn't avalaible "Sorry, the file you requested is not available."

Can someone re upload it on sendspace it's the only server my proxy don't block thanks.
[G1 Android Development] keerttttt:
Eum, check the second post...
[G1 Android Development] imfloflo:
So no rapidshare, no megaupload, no 4shared.

Thanks so i'll wait to night and go back home.
[G1 Android Development] -Mr. X-:
OMGZ *runs around in a circle screaming*

now im excited