yashsingh1/xdaforums huggingface dataset:
[G2 and Desire Z Android Development] guhl99:
See the wiki section:

http://xdaforums.com/wiki/index.php?title=HTC_Vision#Unlock_the_Phone.2C_Set_SuperCID.2C_and_Turn_Radio_S-OFF

...

gfree and kernel versions

gfree uses a dynamic in-memory patch of the kernel to remove the kernel's write protection of the radio settings partition.

So, for those of you who have permarooted the old HBOOT way and put on new kernels --The following kernel versions that are known NOT to work yet with gfree. If you have one of the following kernel versions on your phone install a different (stock, OTA or cyanogen) kernel before starting this procedure:

Kernel

Cyanogen kernel of release 6.1.1

pershoots 11/30 build

pershoot's 2.6.32.26 – OC-UV-NEON_FP (1.516GHZ)

2.6.32.26-cm-virtuous-v1.0 rmk@droid#1

It might well be that also other newer kernels to not work with gfree. So if you experience problems with this procedure (either the phone reboots during the process or the procedure completes correctly but the verify still shows that the phone is locked) then it is in general a very good idea to downgrade the kernel to an original stock kernel or even better to this kernel .

Downgrading to 6.1.1 is no enough. Either you downgrade to stock or you get the kernel that is linked there.

Make a nandroid backup first, install the kernel, do gfree and gfree verfify and then restore your nandroid backup.

have fun Guhl
[G2 and Desire Z Android Development] funkeee:
Aha! I misread that part of the wiki. I thought it said I should install one of those kernels. Bah.

I will go to stock and report back. Thanks.

---------------

My only hope is my earliest kernel from CM 6.1 I believe: 2.6.32.21-cyanogenmod. But no luck.

I can't find a kernel that's not on the list, and I'm afraid to pull the boot.img from PC10IMG because of all the brick warnings. What kernel am I supposed to use?

I tried the one suggested in the wiki but it gives me:

C:\Users\Funk\Desktop>fastboot flash boot boot-new.img

downloading 'boot.img'... FAILED (status malformed (1 bytes))

finished. total time: 0.001s

Perhaps that kernel isn't from 6.1.0. Flashing it. I guess we'll see.

--------------------

Update: Flashing 6.1.0 finally worked for gfree. Radio Vision_RADIO_12.28e.60.140f_26.04.02.17 finally fixed my GPS issues (CM 7 #17). http://www.megaupload.com/?d=OKYRIPQW
[G2 and Desire Z Android Development] chopperpl:
Hi,

I have successfully completed wiki procedure to get radio s=off, but I just realized my gps is no longer working. Have you guys seen this before? I've tried different ROMs, but same problem. :(

I'm running the following:

CM7

2.6.32.38

baseband: 12.28b.60.140eU_26.03.02.26_M

hboot: 0.76.2000

Thanks
[G2 and Desire Z Android Development] theSpam:
http://xdaforums.com/showthread.php?t=1028405
[G2 and Desire Z Android Development] EfemaN:
I didn't want to make a separate thread, maybe I can get some help. I ran through the gfree directions; I got an error after "./gfree -f" that the eMMC power cycle failed, so I figured I hadn't gone back far enough in radio versions. I went to flash an older version, and I'm now getting an error that a partition update failed. Any help?

EDIT: Never mind... I was using the very first G2 radio, and I guess it's impossible to flash that now, because the nearly-newest one worked. Disregard the post.
[G2 and Desire Z Android Development] Kangburra:
If you use the RUU for v1.34 it should work. Did you follow the guide?
[G2 and Desire Z Android Development] EfemaN:
I'm going to give that one a shot, thanks! I didn't try any of the 26.03.02.xx versions because the guide said those were the ones with the "fix" from HTC.

EDIT: I flashed the 26.03.02.24 radio ("from RUU_Vision_HTC_WWE_1.34.405.4"), and I'm still getting the following error.

Ideas?
[G2 and Desire Z Android Development] Kangburra:
I don't know if it makes a difference but I seem to recall you need to do this on the phone not on the computer. What do you mean you flashed the radio? You mean you successfully installed 1.34 rom.zip as PC10IMG.zip as an update?
[G2 and Desire Z Android Development] EfemaN:
I'm going completely by the guide in the OP, and that says do everything through adb. I tried it on the phone, and it gave me the same error. As for the radio, I downloaded a radio ROM and flashed it as a PC10IMG.zip through the bootloader as usual; the guide says "Notice: gfree is known not to work for radio firmwares with higher versions then 26.03.02.xx" and that versions above that would block the eMMC power cycling. I tried an older radio, but I would still get that error.
[G2 and Desire Z Android Development] Kangburra:
I am not sure about the radio, I downgraded the whole lot with RUU 1.34 for my region, did the whole wiki guide to get S-OFF and root. I then flashed the ROM I wanted (with root in it). If you are only flashing the radio (which it seems you can) then I can't help. Sorry.
[G2 and Desire Z Android Development] EfemaN:
No problem! Thanks for trying. Anyone else know what I may be doing wrong?
[G2 and Desire Z Android Development] mrbmg:
Try loading the .26 radio, with cyan 6.1.1. I think that is the radio my wife had on her phone when I did it. It might be a different rom, but for sure that radio.

Actually you can dl a workable kernel in the wiki as well. That might be the problem.
[G2 and Desire Z Android Development] firtermish:
Android keeps on crashing

First of all I'd like to salute the XDA community for being so extensive, expansive and supportive. I just have tons of fun learning just by roaming the forums.

I´m an Argentinian who worked in the US for a couple of months as a J1 student and bought a G2, thinking I would be able to root it and unlock it to use it at home no problemo. I happened to had already permarooted my G2 when I was in the US, so I recently had to do all the manual work of downgrading my rom/radio, etc. I have now successfully achieved S-Off, Super CID and Simlock off according to Gfree verify. However, my phone will not recognize my Simcard ( Claro ) and Android will keep on crashing on me if I insert said Simcard.

I tried the SIM on an original stock image with the modified Kernel provided in the good ol wiki tutorial as well as with the stock Kernel provided with Cyanogen mod 7.0.2. Then I tried the radio out of RUU_Vision_HTC_WWE_1.34.405.4 as seen on this topic. Am I doing something wrong ? What could be causing this current issue? Thank you for your support !
[G2 and Desire Z Android Development] t00c00l4m3:
AWWWWWWWsome
[G2 and Desire Z Android Development] guhl99:
Simple answer. Yes and Yes.

Have fun - Guhl
[G2 and Desire Z Android Development] ECBomb:
Sorry to revive a dead thread. I'm having trouble finding a kernel to downgrade to. I'm not sure what's considered a lower version kernel compared to what I have right now which is:

2.6.32.21-g899d047

htc-kernel@and18-2 #1

Tue Oct 26 16:10:01 CST 2010

And for the recommended kernel in the 1st post, it's the boot.img file, but aren't we supposed to be flashing .zip files? Sorry if these are noob questions, but I'm a bit confused right now. I already downgraded my radio and I'm still getting an error after "./gfree -f" that the eMMC power cycle failed, so it's gotta be the kernel. If it's not the kernel, then I'm really not sure what's going on.

Can anyone provide a link or put the boot.img file (with all other necessary files) into a .zip file by any chance?
[G2 and Desire Z Android Development] guhl99:
Hi!

you can get the boot.img attached to http://www.thinkthinkdo.com/trac/project1/wiki/boot_img#no1.

If you already got the engineering hboot installen (bootloader says ENG S-OFF instead of SHIP S-ON) you can get the fatsboot executable attached to http://www.thinkthinkdo.com/trac/project1/wiki/vision_utilities (fastboot.exe is for windows fastboot is for linux) and copy it to your platform-tools directory. Then you can boot your phone to bootloader i.e. using

adb reboot bootloader

and then you can boot the kernel (without installing it) using

fastboot boot boot.img

Or if this sounds to complicated to you i would suggest that you create a nandroid backup from recovery and then just flash the complete cyanogen 6.1.0 (exactly that version) and use gfree. After you are done you just restore your backup from recovery.

Have fun - Guhl
[G2 and Desire Z Android Development] manuele.f:
which of these procedures should i follow in order to re-flash the desire z stock rom on my desire z flashed with a G2 one?...the device should be rooted and s-off but with RUU and recovery i can't complete the restoring successfully!

the first cooked rom mounted was a cyanogenmod the a stock G2 rom still running on it!

any suggestion will be appreciated!
[G2 and Desire Z Android Development] bleedingthru:
i dont know how to search for this but i already have s-off and root achieved but im wanting to get the sim unlocked but no idea how to do this .... i orginally did not use gfree to obtain root and s-off so im a little lost lol ... any help is greatly appreciated
[G2 and Desire Z Android Development] steviewevie:
You can use gfree to get SIM unlock, it doesn't matter that you have S-OFF already. There's a detailed guide in the Wiki on this site, check out the link at the top of the forum.

Sent from my Desire Z running CM7.
[G2 and Desire Z Android Development] bleedingthru:
Ok cool one more dumb question... On step 2 using gfree when it tells u open up a command line and says to navigate to where gfree is located this is where is get stumped and i know its not difficult just need a push lol thanks!
[G2 and Desire Z Android Development] Nipqer:
Use the cd command;

'cd C:\path\to\adb'

Or you can navigate to platform-tools in explorer, hold shift, right click and 'open command window here' (make sure nothing is selected)

-Nipqer
[G2 and Desire Z Android Development] bleedingthru:
ok did that the command popped up and im lost from i have the gfree zip on the root of my C drive but still cant get this thing executed

edit GOT IT UNLOCKED !!! thanks again !!
[G2 and Desire Z Android Development] Ellises:
I have never did the whole unlock the SIM card on my g2, so I decided I'll do it. And well now I ran into a few issues running this command.

the output is as following:

./gfree -f

--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: 0x000138b4 (80052)

Section index for section name string table: 41

String table offset: 0x000136fb (79611)

Searching for .modinfo section...

- Section[16]: .modinfo

-- offset: 0x00000a14 (2580)

-- size: 0x000000cc (204)

Kernel release: 3.0.43+

New .modinfo section size: 192

Attempting to power cycle eMMC...

at this point the device rebooted itself, so it didn't even ran the commands. according to hboot my CID is still T-MOB010 and there is no backup of a partition. also gfree_verify doesn't seem to work either, never outputs anything after running it.

I even tried flashing a very old version of cyanogenmod to try this on and no luck, is this compatible with the dz hboot by anyway?
[G2 and Desire Z Android Development] demkantor:
yes its compatible, are you radio soff? I mean what guide did you follow to root your phone initally? the phone is supposed to reboot at that point (notice the power cycle emmc) id have to look into it further as its been a while but I believe you need to have true soff by using gfree to get supercid
[G2 and Desire Z Android Development] dragon-son:
I had that issue as well a while back.

Notice: gfree is known not to work for radio firmwares with higher versions then 26.03.02.xx

So I had to downgrade my radio. Guide here

Also I had to change back to really old CyanogenMod 6.1.0 for working kernel. You can get it from http://get.cm/get/3F and then follow the instructions for gfree. That's what got it working for me.
[G2 and Desire Z Android Development] Nipqer:
or if you feel like using gfree 0.8 (somewhat experimental), you can use it in clockworkmod 3.0.2.4

gotta come to #G2ROOT on freenode for it though

-Nipqer
[G2 and Desire Z Android Development] citykiid:
I have a question, after using this method can I use a different radio again?
[G2 and Desire Z Android Development] demkantor:
yes, you only need to downgrade to exploit. once everything is complete (root, soff, custom recovery, supercid, etc) you can use any radio
[G2 and Desire Z Android Development] citykiid:
thank you so much, the old kept breaking my 3G/ hpsa i was afraid i would lose my subsidy unlock
[G2 and Desire Z Android Development] Ellises:
Thanks for the information, I'll have to do that, also i did the very first perma root when it came out, i had this phone since launch day. Wow that was a long time ago.
[G2 and Desire Z Android Development] ratchetrizzo:
I copied and pasted the dd commands and used them.

My phone didn't brick so I'm going to assume that those commands are correct.
[G2 and Desire Z Android Development] dadewy:
OK, I just begged and pleaded with my friend and she finally relented and let me temp root her G2 so I could dump the partition. :p She still won't let me permroot it or anything more though, lol...

Anyway, If you hex dump the partition, there's a bunch of nothing (zeros) before 0x80000 and then lots of code for exactly $2fff bytes. After $2fff bytes (at $83000) the wasteland of zeros restarts. This certainly implies that the text and not the dd commands are correct.

So, I continued scrolling down and from $83000 to $b0000 (and probably well beyond, but I stopped scrolling) there's nothing but zeros anyway.

While it certainly looks like you only need to clear 0x80000 through 0x82fff, doing 0x80000 trough 0xb0000 seems totally harmless, in the case of her partition 7, anyway.

So, 6 of one, half a dozen of the other I guess.

(YMMV, I won't be held responsible for bricks, etc etc)
[G2 and Desire Z Android Development] churchmice:
:p, I successfully did it accordingly to the wiki, step by step.

Thank you all the same.

You are truly careful, got to learn from you. ( I even didn't notice the weired difference)
[G2 and Desire Z Android Development] thatruth132:
i dont have 82fff on my .img it stops at 82ff0

and where it says

set the 4 bytes at 0x807fc (decimal offset 526332) to (the hexadecimal values) 49 53 F4 7D

i dont have 0x807fc i have 0x807f0
[G2 and Desire Z Android Development] ratchetrizzo:
0x807F0 is the START of that line. Move over to the right, look at the offset change and you will find what you need. It will be the last 4 sets of numbers at the end of that line.

If you have no/little experience with hexediting, don't try this, you WILL brick your phone. However, if you proceed, after you are done, make damn sure both the new file you just edited and the original .img dump match in EXACT size. If they don't you ****ed something up and need to start from scratch.

Edit--

Picture attached so you can see what I mean. I know what I used is a old dos version of hexed, but I've been using it for so long and it does the job for me.
[G2 and Desire Z Android Development] xl DIGITAL lx:
Can you use HxD as a hex editor for this?

Edit: Ok, I got it unlocked, thanks!
[G2 and Desire Z Android Development] guhl99:
Thanks for your afford but the automatic version that makes a backup of the partition and patches in place is already completed.

So maybe you don't publish your script to avoid to many different versions.

But thanks again (and I will check the docu)

Guhl
[G2 and Desire Z Android Development] liquidhot:
Thanks for everyone who put work into this.

I tried the guide in the wiki using gfree, put my network sim card in, but I didn't get a prompt for the pin code, was I only supposed to do this after putting in the pin and it not working?

In any case, my G2 will not register on the network. I get the error "Unable to connect to the network at this time. Please try again later."

Here is the output of the command window after executing the commands in the wiki:

Any thoughts on this issue?
[G2 and Desire Z Android Development] guhl99:
Can you please do the verifying steps from the old instructions http://xdaforums.com/wiki/index.php?title=HTC_Vision&oldid=10879#5._.28OPTIONAL.29_Verify_you_did_it_right and report you outputs

Thanks
[G2 and Desire Z Android Development] merkwa:
Works!!!!!

just did everything from my phone using gfree way
[G2 and Desire Z Android Development] liquidhot:
I can, do I need to restore before I do it?
[G2 and Desire Z Android Development] guhl99:
No, do them now.
[G2 and Desire Z Android Development] misconcepti0n:
You just used a terminal emulator on your phone and completed the commands without using adb? I was going to try this, but was not sure if it was a viable approach.
[G2 and Desire Z Android Development] liquidhot:
The output doesn't match the wiki, is /dev/smd0 the wrong device perhaps?

C:\Development\android-sdk-windows\tools>adb shell
# stop ril-daemon
stop ril-daemon
# echo -e 'ATE1\r' > /dev/smd0
echo -e 'ATE1\r' > /dev/smd0
#

# echo -e 'ATV1\r' > /dev/smd0
echo -e 'ATV1\r' > /dev/smd0
# echo -e 'AT@CID?\r' > /dev/smd0
echo -e 'AT@CID?\r' > /dev/smd0
# AT@SIMLOCK?40
AT@SIMLOCK?40
AT@SIMLOCK?40: not found
# echo -e 'AT@SIMLOCK?AA\r' > /dev/smd0
echo -e 'AT@SIMLOCK?AA\r' > /dev/smd0
#
[G2 and Desire Z Android Development] dadewy:
I don't see the background cat command, did you run it? If not that's why there's no output. It's the "cat /dev/smd0 &" one.
[G2 and Desire Z Android Development] liquidhot:
:o That's what I missed. Here is the new output:

C:\Development\android-sdk-windows\tools>adb shell
# stop ril-daemon
stop ril-daemon
# cat /dev/smd0 &
cat /dev/smd0 &
# echo -e 'ATE1\r' > /dev/smd0
echo -e 'ATE1\r' > /dev/smd0
# ATE1
OK
echo -e 'ATV1\r' > /dev/smd0
echo -e 'ATV1\r' > /dev/smd0
# ATV1
OK

# echo -e 'AT@CID?\r' > /dev/smd0
echo -e 'AT@CID?\r' > /dev/smd0
# AT@CID?
@CID: 11111111

OK
echo -e 'AT@SIMLOCK?40\r' > /dev/smd0
echo -e 'AT@SIMLOCK?40\r' > /dev/smd0
# AT@SIMLOCK?40
@SIMLOCK= 00

OK

# echo -e 'AT@SIMLOCK?AA\r' > /dev/smd0
echo -e 'AT@SIMLOCK?AA\r' > /dev/smd0
# AT@SIMLOCK?AA
@secu_flag: 0

OK

Just to note, I still get an error trying to register and after multiple restarts I've not been prompted for the unlock pin. (I'm not sure if this bypasses the unlock or not.)
[G2 and Desire Z Android Development] warzchit:
I just did this using gfree.

Download gfree.zip to sdcard

Extracted files with astro manager to gfree folder

Opened terminal typed :

su

cd /data/local

cp /sdcard/download/gfree/gfree /data/local

chmod 777 gfree

./gfree

sync

Reboot

Thanks scotty2 and everyone else who had something to do with this and to fattire for posting
[G2 and Desire Z Android Development] guhl99:
Hi!

So your phone is definitely OK: Unlocked, Super-CID and radio S-OFF

Which ROM are you using?

Which Kernel version?

Which Baseband version?

You are not using my modified libril.so, are you?
[G2 and Desire Z Android Development] JonInAtl:
Any thoughts on why I'm getting this error?

# su
# cd data/local
# chmod 777 gfree
# ./gfree
Section header entry size: 40
Number of section headers: 44
Total section header table size: 1760
Section header file offset: 0x000138b4 (80052)
Section index for section name string table: 41
String table offset: 0x000136fb (79611)
Searching for .modinfo section...
- Section[16]: .modinfo
-- offset: 0x00000a14 (2580)
-- size: 0x000000cc (204)
Kernel release: 2.6.32.26-cyanogenmod
New .modinfo section size: 208
Attempting to power cycle eMMC... OK.
Searching for mmc_blk_issue_rq symbol...
- Address: c02b9254, type: t, name: mmc_blk_issue_rq, module: N/A
Kernel map base: 0xc02b9000
Kernel memory mapped to 0x40001000
Searching for brq filter...
- ***WARNING***: Did not find brq filter.
Patching and backing up partition 7...
Done.

This is the results I get from the test

# stop ril-daemon
# cat /dev/smd0 &
# echo -e 'ATE1\r' > /dev/smd0
# 0
# echo -e 'AT@CID?\r' > /dev/smd0
@CID: 11111111
0
# echo -e 'AT@SIMLOCK?40\r' > /dev/smd0
@SIMLOCK= 00?40
0
# echo -e 'AT@SIMLOCK?AA\r' > /dev/smd0
@secu_flag: 0AA
[G2 and Desire Z Android Development] liquidhot:
ROM: CyanogenMod-6.1.0-RC3-vision

Kernel: 2.6.32.26

Baseband: 12.28b.60.140eU_26.03.02.26_M

I don't believe I've done anything with libril.so.

Thanks for the help.
[G2 and Desire Z Android Development] mcp2009:
I must be blind but where's the download link for gfree?
[G2 and Desire Z Android Development] liquidhot:
http://www.thinkthinkdo.com/trac/project1/raw-attachment/wiki/gfree/gfree.zip
[G2 and Desire Z Android Development] mcp2009:
thanks gonna do this now
[G2 and Desire Z Android Development] amack10:
So I'm trying this from my phones terminal. I extraced the gfree zip and placed the folder in data/local. I type the commands in terminal emulator on my phone wen I get to ./gfree I get permission denied.
[G2 and Desire Z Android Development] Mikey:
did you su first in terminal?
[G2 and Desire Z Android Development] Mikey:
So basically you copied only 1 file into /data/local? gfree

i wonder if sync uses the rest of the files???

Hmmm
[G2 and Desire Z Android Development] digikid:
Great work! question: I've seen issues where people can no longer connect to their carrier's network after using a code to sim unlock their phone. Could that issue crop up with this method?
[G2 and Desire Z Android Development] amack10:
Ya it even said terminal was granted su acsess. But I put the whole gfree folder (excracted from the zip of course) into data/local. Am I supposed to place eachinividual file from the gfree folder into data local

Edit: am I supposed to put the gfree file from the folder in data/local and leave the rest of the files in the gfree folder on my sd
[G2 and Desire Z Android Development] Mikey:
From the directions sounds like just the files, not the folder gets placed into local folder
[G2 and Desire Z Android Development] amack10:
Cool I wasn't sure on that part ill try it and report back. Thanx for the help and quick response
[G2 and Desire Z Android Development] damnoregonian:
nope. the whole reason i developed the method was to fix someone suffering from that problem, and it worked. this rewrites the subsidy information manually instead of letting the radio do it with the unlock code.
[G2 and Desire Z Android Development] Mikey:
Directions worked well, no errors.

Now to find someone with a sim different then T-Mo lol

Although thats not the primary reason for doing this myself.

Is there a way of finding out if sim-unlock works with a different sim?? I know dumb question. lol
[G2 and Desire Z Android Development] warzchit:
Yea just the gfree file..just tested with my friends att sim and its good to go ;)
[G2 and Desire Z Android Development] amack10:
You mikey I just put the individual files in data local (all the files from the gfree folder) and ran the commands thru terminal emulator. Rebooted and put an at&t sim in it and it worked. So by doing this I am now radio unlocked as well
[G2 and Desire Z Android Development] Mikey:
Off-topic:

Off to go flash CM 45 -----RADIO time :)

On-topic:

Thanks for the confirmation on sim unlock :)
[G2 and Desire Z Android Development] amack10:
wat is cm45 does it have a special radio or something. And am I free to flash anything I'm currently on cm rc3.

Lol edit: you mean fm radio
[G2 and Desire Z Android Development] fastludeh22:
Quick question. If I'm reading the wiki correctly, then once I'm radio S-off then I could flash an offical s-on hboot and it would still be s-off?

Also since it says you can now flash offical firmware and not semi-brick, I'm assuming that the radio s-off partation is not the same as the standard radio, and flashing a new radio would not effect the s-off?

If this is correct, then we need a new guide to turn phone back to offical specs for warrenty claims or any other reason for sending phone back.
[G2 and Desire Z Android Development] fattire:
I'm not going to speak out of turn here, but I'd say the answer is yes, yes, and yes.

I rewrote the instructions at the top for clarity and to address some questions I saw here.