yashsingh1/xdaforums huggingface dataset:
[G2 and Desire Z Android Development] soypoi:
Is this really the *easiest* way to root the G2?? I'm not familiar with adb commands and that appears to be the only way to get this thing rooted.
[G2 and Desire Z Android Development] sundar2012:
First thread needs to note that egypt radio does not work, im attempting the downgrade procedure right now to then proceed with gfree. wish me luck!
[G2 and Desire Z Android Development] sundar2012:
so what do u do if you are on cm 6.1.1?
[G2 and Desire Z Android Development] guhl99:
- Do a nandroid backup from clockwork recovery (if you don't have it install rom manager from the market and let it install clockwork recovery)

- Install a kernel that is know to work (stock, first ota or get the kernel from here http://www.thinkthinkdo.com/trac/project1/raw-attachment/wiki/boot_img/boot-new.img

- follow the gfree procedure as described here http://xdaforums.com/wiki/index.php?title=HTC_Vision#Unlock_the_Phone.2C_Set_SuperCID.2C_and_Turn_Radio_S-OFF

- check the success as described here http://xdaforums.com/wiki/index.php?title=HTC_Vision#VERIFY_.28using_.22gfree_verify.22.29

- after you are all done boot to recovery, restore your nandroid backup

And btw. if you installed the egypt-radio or any other radio higher than 26.03.02.26 you have to downgrade the radio first.
[G2 and Desire Z Android Development] steviewevie:
The Egypt radio is effectively an "upgrade", not a downgrade, because it's a newer version. But has guhl99 said, you won't be able to use gfree to get S-OFF if you have that radio. If you already put the Egypt radio on, then you need to downgrade before you can use gfree, as he said.

If you accept any OTA update from a carrier (e.g. T-Mo or Bell) or HTC, then you risk accepting something that will lock you out of root/S-OFF. So it would be wise to avoid any OTA updates if you are rooted/S-OFF until it can be confirmed that it's "safe".
[G2 and Desire Z Android Development] sundar2012:
What if you gfree and then flash the egypt radio - will u still be gfree?
[G2 and Desire Z Android Development] xyrcncp:
Finally got around to doing this. Restored to the first CM6.1 stable I had, ran gfree, then restored 6.1.1 and everything is good now :)
[G2 and Desire Z Android Development] sundar2012:
Just did the same. My only question is, now that I have true S-OFF, unlock and supercid, can I upgrade the radio to Egypt? Will I lose these settings?
[G2 and Desire Z Android Development] steviewevie:
You won't lose those settings now you've got them, no. The problem appears to be the other way round, i.e. if you have the Egypt radio but you haven't got all the unlock stuff, then gfree won't work with that Egypt radio.

You should be fine to try upgrading the radio to the Egypt one (not the rest of the ROM though !) and seeing how it works for you.
[G2 and Desire Z Android Development] soypoi:
So I followed everything to a t via the wiki...apparently the only thing that took was the S-Off. When I boot into recovery it says vision pvt s-off but if I type in su on emulator it says something like su unknown root. For some reason I cannot mount the internal sd card to the computer or anything tbh.. I plug the USB to my MacBook and I dont get the option to mount just debugging.

This is frustrating!! it was nothing to root my captivate but supposedly rooting a G2 is easy?? Yikes!! I'd hate to see what you consider hard lol
[G2 and Desire Z Android Development] heybobitsme:
If you think this is hard, go look at the MyTouch 3G Slide forum and the root method there. Then go find the initial root method. I've done both. And then also realize it doesn't even have s-off yet either. This method is cake! I can't wait to root when i get my hands my G2!

Edit: Didn't realize how troll-y that sounded. It was meant more jokingly.:o
[G2 and Desire Z Android Development] soypoi:
No worries I'm just frustrated because I don't see what I'm doing wrong. I really wanted the unlock more than anything since I'm on at&t I can't even use it. I've never used adb before so its even more frustrating.

Sent using two cans and a string
[G2 and Desire Z Android Development] BBOOZE:
can I ask a related tokpic....if I have pershoot's kernel installed does that prevent any permanent unlocking of the phone? I purchased an unlock code before I found this thread and I can unlock my phone but it keeps asking me to reinput the code when I reboot the phone. I should mention that I tried to unlock this using an old expired sim card from Guatemala while still here in the States so maybe that has something to do with it?
[G2 and Desire Z Android Development] jojo_16:
Maybe its a hardware problem?? I think once u input the correct code and it says unlock I think it will not prompt the reinput code for sim unlocking even after you reboot.

Pershoot's kernel?? I think its not compatible for sim unlocking by using gfree if that's your question otherwise pershoot+unlock code doesn't have to do anything about reinput code even after you reboot.

Just permroot and gfree it has more benefits than stock G2.
[G2 and Desire Z Android Development] steviewevie:
A lot of these unlock codes seem to have problems on our phones. Much better to use gfree (I realise you got the unlock code earlier). All you need to do is to put on a kernel/ROM that is compatible with gfree (this thread lists incompatible kernels) temporarily and run gfree.

So do a Nandroid backup via Clockwork, put on a compatible kernel/ROM/whatever, run gfree to fully unclock, then restore your Nandroid backup and you'll be all set.
[G2 and Desire Z Android Development] heybobitsme:
Ya, gfree is easy

I just wanted to report that I just rooted my brand new G2 in about 15 minutes using the gfree method as per the wiki. I just went with the s-off as I don't need sim unlock and all that. Just make sure adb is running correctly.

Thanks guys!

Also, just to be sure, to use fastboot I need the ENG-HBOOT?
[G2 and Desire Z Android Development] KShatzkes:
Finally got around to doing this. Couldn't get it to stick on Cyanogen, so I reverted to my Stock ROM backup, applied gfree, and all is great now on my Cyanogen 6.1.1 w/ Pershoot Kernel ROM.
[G2 and Desire Z Android Development] soypoi:
After some magnificent help from steviewevie and adjustments to user head space and timing I was able to do this easy peasy!!
[G2 and Desire Z Android Development] steviewevie:
Yes, that's right.

Sent from my HTC Desire Z
[G2 and Desire Z Android Development] heybobitsme:
Sweet. Thanks for the reply. :)

Sent from my CM6 Slide
[G2 and Desire Z Android Development] moemoney12:
I did this procedure on the g2 that was permant rooted with visionar 12. And i did it on a new mytouch 4g. They both are unlocked and everything works fine. But I can not purchase any apps from the market. Every time i try it says network error. Try again. But I can download all the free apps. Please help. Thanks in advance.
[G2 and Desire Z Android Development] fattire:
What you describe doesn't seem to have anything to do with the radio or S-OFF. If your network is working overall, I'm thinking this may be a market-related issue.
[G2 and Desire Z Android Development] moemoney12:
Yes you are right. I open another google account and it works fine. I guess i need to contact google.

Thanks
[G2 and Desire Z Android Development] Zak Jones!:
Success!

I had to flash back to RC4, but after I did so, it worked. :)

Thanks for the guide.
[G2 and Desire Z Android Development] ericmky:
Permanent Root

Hi,

I have a problem. I follow all the step of Wiki Vision for S-Off, SuperCID and Unlock.

I use gfree_temp-root, gfree03 and Gfree_verify.

But when finish de gfree and try to execute /data/local/temp/root give me this message of error "mkdir failed for /system/xbin, File exists"

When verify if the process of gfree is correct with gfree_verify the flags are all corrects, but when my Desire Z reboot don´t have Superuser app and if want to install ClockworkRecovery the process end with a message about permissions.

When go to Terminal Emulator and type "su", don´t have permission too.

I have a Desire Z with 2.6.32.21 kernel (original) and 26.03.02.26 radio and 1.34.666.5 version.

Whats i´m doing wrong ??

Thanks for your help.
[G2 and Desire Z Android Development] guhl99:
Well I don't know what you did wrong, but we had this once and the user used visionary before and also had the /system/xbin allready created.

What we did then was:

1. Gain temp root again by using the steps described at http://xdaforums.com/wiki/index.php?title=HTC_Vision#Rooting_the_G2 up to ..."PERMAROOT (using "gfree" + "root")"

2. remount your system read/write and delete /system/xbin:

(you can do this eiter from the terminal program that you used to gain temp root or even better open up a new shell in adb by using

adb shell

you should have root inthis shell too.

Then:

mount -o rw,remount -t ext3 /dev/block/mmcblk0p25 /system
rm -rf /system/xbin

mount system read again:

mount -o ro,remount -t ext3 /dev/block/mmcblk0p25 /system

3. Run the root script again:

/data/local/tmp/root

after this you should have:

busybox as /system/xbin/busybox

Superuser.apk as /system/app/Superuser.apk

su as /system/bin/su

You have to reboot and check if the files are still where they should be
[G2 and Desire Z Android Development] ericmky:
Thanks for your help.

All the files are in the correct directories, but still don´t have Superuser.

Its posible to use Visionary.r14 for obtain Permroot and then use gfree ??

Thanks again.

Regards...

And Merry Christmas..
[G2 and Desire Z Android Development] joemm:
Yes it is, I used r14 to perm root the used gfree.

Remember visionary has caused a lot of bricks when not used correctly here a links to help you out if you need it.

http://xdaforums.com/showthread.php?t=885430

read post #3 in this thread if you are gonna attempt root with visionary r14.

And remember gfree is not working with certain roms, so best bet is to gfree with a stock/rooted rom, but you can check the wiki for roms currently verified not to work with gfree.
[G2 and Desire Z Android Development] ericmky:
Thanks, another question.

Actually i have my Desire Z S-off, Cid-off, etc Temproot with visionary.

The only things i need to do is make the Permroot or i need another step ?

I asked because in the videos they use the hboot file, but i believe i don´t need do this step because i used gfree before.

It is correct ??

Thanks a lot for your time and sorry if my english have mistakes.

Its necessary Permroot for install a custom ROM ?
[G2 and Desire Z Android Development] steviewevie:
This message appears to be normal, on the DZ at least. When I flashed a stock ROM and rooted using rage, I got the message even though I hadn't done anything else to the phone (no Visionary etc).
[G2 and Desire Z Android Development] steviewevie:
I could be wrong, but I think it's S-OFF you need rather than root (temp/perm) to be able to flash a custom ROM. Though if you have root (at least temp) then you can install the ROM Manager app.
[G2 and Desire Z Android Development] ericmky:
Yes, i have installed ClockmodRecovery.

I´m temproot with visionary and s-off, cid-unlock and sim-unlock with gfree.

I download r1 version of Modaco for Desire Z.

I need put this file in my SDcard and reboot in Recovery mode for flashing this Rom ?

Is necessary use Permroot with visionary or not ?

Thanks,
[G2 and Desire Z Android Development] joemm:
If you have ClockworkMod installed, put your new rom on the root of the sdcard, boot into recovery, make a backup of your current rom first, wipe data/cache, choose install zip from sdcard, choose zip from sdcard, flash and reboot, that's it, should be good, new custom roms should have su built into them.
[G2 and Desire Z Android Development] ericmky:
Works perfect.

Thanks a lot again.
[G2 and Desire Z Android Development] Baphometa:
I used this process after using the rage perm root method located http://xdaforums.com/showthread.php?t=834228

Im running CM6.1.1 and I think everything went fine but I noticed on my phones terminal after doing the command before sync that it said

"attempting to power cycle eMMc... Failed."

"Module failed init, check dmesg."

Was this successful and that is a error that shouldve happened or is something amiss?
[G2 and Desire Z Android Development] joemm:
In the OP its says that gfree wont work with CM 6.1.1 flash a older version of CM first or some other rom (stock/rooted) then run gfree, then you can flash CM 6.1.1
[G2 and Desire Z Android Development] prp2:
This part, for me, is where the wheels fell off. Upon attempting to boot normally back into my G2 so I could copy the mmcblk0p7-new.img over, it threw me into a boot loop of the HTC screen.

If it's relevant (probably so), I'm running the Virtuous 0.7.0 ROM with Cyanogen's kernel (virtuous build 2).

Had to recover by booting into ClockworkMod recovery and applying that kernel build again, which I presume rebuilt the boot.img that was killed with the fastboot commands above.

Thoughts?
[G2 and Desire Z Android Development] guhl99:
Hi !

Well it might well be that the kernel that i built from the cyanogen-git sources (to remove the kernels write protection of the radio partition in the mmc-driver) does not work with your Virtuous ROM.

You have the following option:

1. Wait another day or two (or three) until scotty2 finished his dynamic in memory kernel patch - then my custom kernel is obsolete.

2. Recover back to something more like stock or install Cyanogenmod-6.1-RC3 and then my kernel. This is a one-time procedure as soon as you got S-OFF you can recover your old ROM, the radio S-OFF will stay!

Have fun - Guhl
[G2 and Desire Z Android Development] guhl99:
Hi!

Congratulations.

I just wanted to add something for your understanding.

The command AT$QCPWRDN (it means Qualcomm-Powerdown) is supposed to powerdown your device (and when you got clockwork recovery installed will boot into recovery).

It was originally only meant to be used if the check-procedure is carried out from rtask c in hboot (what ever this means - if you don't know, don't bother) to exit rtask c without pulling the battery.

I will remove this from the docu on the wiki because it is not necessary just causes confusion.

Have fun - Guhl
[G2 and Desire Z Android Development] JonInAtl:
SUGGESTION: (Because you KNOW it'll happen)

If I weren't at work I'd do it myself, but, may I suggest someone post before and after screenshots of each step of the HEX Edits?

That should help head off any problems of someone entering the wrong values in the wrong places.

Awesome work guys!
[G2 and Desire Z Android Development] MLonon:
What about us virgins?

I have sealed g2 in my closet. Can I use this to sim unlock my phone without buying a code or is this only for people who have borked their phones using an unlock code they bought/got?
[G2 and Desire Z Android Development] guhl99:
Of course you can use this to SIM unlock your phone without buying a code.

This was maybe not the most important reason to be after this, but it is a nice side effect.
[G2 and Desire Z Android Development] steviewevie:
Awesome work guys ! :D

Anyone verified this method on the Desire Z ?
[G2 and Desire Z Android Development] nycjv321:
...

Well I got all the feedback from the guide. After running the command AT$QCPWRDN, it rebooted so I guess it works :D. This is awesome Thanks guhl99 and scotty2 and whoever else was involved. Does anyone want me to post screenshots of what I hexedited?
[G2 and Desire Z Android Development] themobijew:
my G2 arrives today (free from cyber monday deal hehe) i cant wait to wait until the version where i dont brick it on day one comes out so i can do it lol
[G2 and Desire Z Android Development] Kalandros:
What if I already have perm?

If I already have perm-root and have S-OFF already, would there be the ability to just do a SIM Unlock by pulling bits from the Guide? As I really don't care about leaving the country and using the other carriers, I'm more interested in using simply using AT&T every now and then. Would that be possible?
[G2 and Desire Z Android Development] prp2:
Thanks for the reply! :) I may do a Nandroid backup of my current setup, then flash CM 6.1RC3 to apply your kernel again. The 8GB microSD card that came in the phone is already pretty well full for me, but I have a 4GB that I used for backing up my original stock ROM, so I could just use that again.

Definitely appreciate all your hard work, and it'll be great to have a fully unlocked phone.
[G2 and Desire Z Android Development] JonInAtl:
That would be great!
[G2 and Desire Z Android Development] dhkr123:
You don't. You have a hacked hboot only.

There is no difference. SIM unlock is SIM unlock. It doesn't distinguish between ATT and... any foreign carrier. Neither is tmobile.

Or are you just confused about the "foreign image" part related to SUPERCID? This has thing to do with using it internationally, this has to do with being able to flash the... europe system image, presumably to use AT HOME.

You want to... do only part of it? Why?

If you're going to the trouble of only dealing with 1 or 2 of the things, then you might as well do them all.

Note: leaving parts out does NOT make you any more secure. It just limits your freedoms. You might as well just do it all.
[G2 and Desire Z Android Development] ratchetrizzo:
I just did this, and everything looks like it works, but now I can't get a signal.

--

Edit, nevermind, a subsequent reboot fixed it.

restoring nandroid now
[G2 and Desire Z Android Development] dadewy:
Haha lovely timing!

The three G2s I ordered for free from tmo yesterday + this free subsidy unlock = happy camper :D

Thanks guys!
[G2 and Desire Z Android Development] prp2:
Got this working before I headed off to work this afternoon. Running Virtuous 0.7.1 ROM, had to back it up wth Nandroid first, then download and install CyanogenMod 6.1RC3, before loading the custom boot.img in the wiki. After doing that, was able to boot into CM normally to gain adb shell and finish up the commands. Restored everything again back to Virtuous and my original kernel. Verified the changes stuck permanently.

Great stuff!
[G2 and Desire Z Android Development] JonInAtl:
Is it safe to assume this would be rolled back by a radio update from HTC/TMobile or am I making a bad assumption?
[G2 and Desire Z Android Development] dadewy:
edit: While working on this patch I just noticed a discrepancy in the original guide....

This is a biggie so you may want to hold off until clarified!

It says to clear 80000 to 82fff which is of course 0x82fff - 0x80000 = 0x2fff bytes worth (12287 decimal). But if you look at the dd command used to accomplish this:

dd if=/dev/zero of=mmcblk0p7-new.img seek=524288 bs=1 count=[B]196608[/B]

The command in fact clears 196608 bytes of data. Or 0x30000 in hex (I'm guessing 0x2ffff + 1 ?) I'm not worried about the +1, I'm worried about the order of magnitude difference between 0x2ffff (4 f's) in the dd commands and 0x2fff (3 f's) in the explanation.

The 2nd dd command starts seeking at 720896 (0xB0000 hex). Not 0x82fff as stated in the instructions:

dd if=mmcblk0p7-ori.img of=mmcblk0p7-new.img bs=1 seek=720896 skip=720896

So, which one is it? Clear 0x80000-0x82fff as instructed in the text or clear 0x80000 through 0xB0000 as the dd command is currently doing?

old post ignore, for now:

Anyone who's already done this guide and is willing to help out for a minute?

I've made an .ips patch that will automagically do the hexediting parts but I'm hesitant to post it as it's totally untested. I'm currently G2-less or I'd try it myself.

I'd just need you to do the following:

-run my ips patch against a virgin copy of your partition 7 dump (so this would require that you still HAVE a copy of that file! - mmcblk0p7-ORI.img if you followed the guide's naming convention)

-compare that against the mmcblk0p7-NEW.img file you edited manually and have running successfully on your G2. (md5sum both files and see if the checksums match, for example)

PM me if you can help. Otherwise I'll post the patch when tmo delivers my G2s and I can test myself.
[G2 and Desire Z Android Development] churchmice:
So where is the ips.pl script ?
[G2 and Desire Z Android Development] dadewy:
It's just a generic IPS patcher written in perl. I found it online and modified it to be a little more verbose. Any IPS patcher for any OS will do. They are typically used to patch ROMs (as in gameboy/nes/snes, etc, not phone ROMs :D). Google should find one you can use.

However I edited my original post, please read it to see why things are on hold right now. I'd hate to brick my phone over a typo :o
[G2 and Desire Z Android Development] Baphometa:
Sorry shoulda read that well i read it, it just didnt click that i needed to reflash XD will reflash and try it again Ill post back here after words

Update: Worked this time around Thank You very much! =D
[G2 and Desire Z Android Development] wpickel:
I am already rooted but I am having issues with this as well.

I am using 6.1 with 2632.26-oc-uv-xtra-neon_fp-120810

Here is what I get, after a few seconds at "patching secu_flag" the phone reboots. gfree_verify reports that the patch did not work. There is a partition7 backup on my sdcard though

--secu_flag off set
--cid set. CID will be changed to: 11111111
--sim_unlock. SIMLOCK will be removed
Section header entry size: 40
Number of section headers: 44
Total section header table size: 1760
Section header file offset: 0x00015454 (87124)
Section index for section name string table: 41
String table offset: 0x0001529b (86683)
Searching for .modinfo section...
- Section[16]: .modinfo
-- offset: 0x000011c4 (4548)
-- size: 0x000000d0 (208)
Kernel release: 2.6.32.26-cyanogenmod
New .modinfo section size: 208
Attempting to power cycle eMMC... OK.
Write protect was successfully disabled.
Searching for mmc_blk_issue_rq symbol...
- Address: c02c5f78, type: t, name: mmc_blk_issue_rq, module: N/A
Kernel map base: 0xc02c5000
Kernel memory mapped to 0x40009000
Searching for brq filter...
- ***WARNING***: Did not find brq filter.
Patching and backing up partition 7...
patching secu_flag: 0
[G2 and Desire Z Android Development] wpickel:
Solved...Ended up changing to the kernel recommended in the wiki. gfree_verify reports:

./gfree_verify
gfree verify_cid returned:
@CID: 11111111

OK

gfree verify_secu_flag returned:
@secu_flag: 0

OK

gfree verify_simlock returned:
@SIMLOCK= 00

OK

Does anyone know if I can update kernels now? Or am I locked into this one?
[G2 and Desire Z Android Development] cbmm:
i did the original root, what benefit would this give me?
[G2 and Desire Z Android Development] J-Hop2o6:
this is TRUE s-off.. the eng-hboot was a FAKE s-off.. so do this one also.. have have both gfree & eng-hboot
[G2 and Desire Z Android Development] cbmm:
how can i change the kernel with clockworkmod?
[G2 and Desire Z Android Development] J-Hop2o6:
Two ways via Rom Manager or manually in recovery (via Rom Manager or [phone off] hold vol. down+pwr > recovery)

1. Rom Manager>Download Rom>((choose a kernel cooker [Cyano; Pershoot]))>(kernel name)>Download>((keep both unchecked--or atleast checkmark 'Backup Rom' just in case))

2. Manually: recovery>install zip from sd>choose zip from sd>(find .zip)>yes
[G2 and Desire Z Android Development] cbmm:
his kernel dl is img extension. do i just zip the file?
[G2 and Desire Z Android Development] cbmm:
from what i read the cyanogen and pershoot kernels are not supported
[G2 and Desire Z Android Development] Beast11:
Sorry I just wanted to confirm. So if i have a Bell Desire Z with radio: 26.03.02.xx this will work? Any radios above this will not?

TIA!

Edit: I should be following the wiki... but still that will work?
[G2 and Desire Z Android Development] guhl99:
Yes
[G2 and Desire Z Android Development] cbmm:
got it, thanks
[G2 and Desire Z Android Development] J-Hop2o6:
talking to me?
[G2 and Desire Z Android Development] cbmm:
jhop

yes
[G2 and Desire Z Android Development] yelti:
I flashed gfree and had an extra feature, namely vol up + trackpad + power got me to another recovery mode than I was used to. I had to use vol down + power.

Maybe this can be added to the start post?

just my to 2 cents