yashsingh1/xdaforums huggingface dataset:
[Galaxy S II Original Android Development] tazsob:
I was getting this problem too until I realised that AVG anti virus app locker may be interfering. I disabled AVG and tried again and it worked flawlessly. If you have any app lock or similar it may be the cause behind your problem.. I'm running ICS 4.0.4 on a sgs2 all stock.
[Galaxy S II Original Android Development] iekansh:
Signature verification fails for me in method one. What to do? Lp7 ics
[Galaxy S II Original Android Development] Phil3759:
CWM on i9100 does not check for signature. If you get a signature error it means you are doing things wrong: flashing root zip file in stock recovery. You need to first flash temporary cwm, then flash the root file in cwm
[Galaxy S II Original Android Development] Phil3759:
Updated Post 1

Changes:
[Galaxy S II Original Android Development] xenover:
I have a quick question. Is it necessary to unroot before updating to stock 4.0.4 when it hits? I definitely want to update my phone to 4.0.4 some day but I don't want to mess anything up. :) I used method 1 fyi.
[Galaxy S II Original Android Development] iekansh:
@Phil: I am flashing the cwm recovery first but it's not happening.. I've attached the pic.
[Galaxy S II Original Android Development] Phil3759:
No, you do not need to unroot, but root will often be lost after flash stock ROM. Just apply the root script again, no harm will happen

In Recovery 3e (stock), you have to select: "apply update from external storage" and select the

"recovery-clockwork-touch-5.8.1.5-galaxys2.zip"

file. This will run into temporary CWM from where you apply the root file

I think the confusion is that people are flashing the root file from within stock 3e recovery

I will edit first post to make it more clear
[Galaxy S II Original Android Development] iekansh:
That's exactly what i have been trying to do since past 4-5 hours man. It gives the same error again and again.
[Galaxy S II Original Android Development] Phil3759:
Did you install ROM Manager application once?

Are you on stock ROM LP7 and stock kernel or some custom kernel?

Did you flash Cyanogen Mod or any other custom ROM before?

Your phone is the international i9100 version or another variant of the i9100?

In any case, this message is triggered by stock recovery when a file doesn't have Samsung Signature. But, the cwm recovery included here should not trigger that warning.

I suggest 2 options:

- flash again the stock LP7 kernel in odin, it should reset the stock recovery if it was messed up by another ROM / kernel

- download again the clockwork mod image for your phone, from clockworkmod site. Maybe your zip file was corrupted in someway.

- Give a try to the CWM non touch classic version

Please give a feedback on the results after having tried these. This issue is common and asked in many forums and I never saw a definitive answer fix.
[Galaxy S II Original Android Development] Entropy512:
Thanks for this information. Koush told me he'd rebuilt his recoveries, but this indicates he did not.
[Galaxy S II Original Android Development] Stileth:
Thanks for the info although me and numerous other people have used this touch version cwm.zip and nothing happened. I have bad chip, so maybe it's related just to Note?

Odoslané z GT-I9100 cez Tapatalk 2
[Galaxy S II Original Android Development] cowbutt:
From the reading I've done, it seems it depends on the kernel you were using, whether you used CWM to wipe or not, and whether you were lucky or not...
[Galaxy S II Original Android Development] Stileth:
I have used 3 different 4.0.4 ROMS with stock kernels and of course I have never did wipe via CWM. That would be a suicide.

Odoslané z GT-I9100 cez Tapatalk 2
[Galaxy S II Original Android Development] Entropy512:
Correct. On I9100, the first affected kernels were XXLQ5 and XWLPM.

If you use this ZIP and wipe, it can cause unrecoverable damage. It's not guaranteed, it only happens in certain situations (and it's not possible to tell whether your eMMC is in a "safe to wipe" state or not) - but the only way to be sure is not to use recoveries that are capable of issuing secure erase commands.

It's a much bigger problem for the Note because every ICS leak and stock kernel for that device allowed erase commands through. With I9100, every kernel prior to XXLQ5 and XWLPM blocked all erase commands.

Now that dangerous kernels have appeared for I9100, I9100 users will need to be much more careful.

The problem is that even though the instructions provided in threads like this just use CWM to flash Superuser or SuperSU, the presence of a wipe command causes users to sometimes use it. Also, since it appears stock recovery will flash ZIPs signed with testkeys, it's probably possible to just properly sign SuperSU and flash it directly.
[Galaxy S II Original Android Development] Phil3759:
First, the script I use will never touch the data and cache partitions. Someone in previous posts asked to add a delete command on /data/app/eu.chainfire...apk but I refused. The main reason was that I wanted to avoid touching the /data partition in anyway, despite delete command was never shown to be bad.

Now, either in CWM or in a custom non patched kernel that comes with cwm, the problem is the same. Remember CF_Root LQ5 v5.5 that caused many bricks to people before it was patched to v5.6. CWM is probably same source for all (Koush). Even Chainfire that provides his custom built from scratch recovery probably uses same CWM scripts from Koush. In fact, he patched the kernel, not the CWM. Only Koush seems to be able to patch the CWM. Till then, people have to get a patched non stock kernel to wipe under CWM.

As it is provided in instructions, the method 1 will never cause the superbrick. I have no reports of it, neither in rachmad thread or in many other forums using this script

Now, I am aware of a report by PM of someone that used my method and did a wipe under CWM. He got a superbrick (ICS 4.0.4 stock)

Anyway, I added a very visible warning in instructions of method 1.

I still feel this method is one of the most proper rooting methods for anyone that wants only root, no fancy kernels. CF_Root kernels are great but are not stock. They from time to time come with bugs, like emmc mount error, bootloops, bricks. This method, when followed, will not add extra bugs to a stock ROM.

Other advantage is having the busybox installed, which no longer comes in CF_Root or Mobile Odin Pro.

I am also working on a universal proper uninstall of busybox and its symlinked commands
[Galaxy S II Original Android Development] JakeLee28:
question: does this wipe user data at all?
[Galaxy S II Original Android Development] Phil3759:
No!! Otherwise it will wipe all your phone data

It is written in above post: It does not touch data and cache partitions, only delete 2 files from /system and copy 3 files to /system

So it is 100% safe, concerning superbrick bug. Over 3000 downloads include older versions and mediafire links and no brick reported
[Galaxy S II Original Android Development] Phil3759:
No, it will not flash ZIPs signed with testkeys as far as I know and tested. It would be a big security issue
[Galaxy S II Original Android Development] Phil3759:
In fact, it would be great to be able to sign zips for stock recovery, cwm will be mostly useless
[Galaxy S II Original Android Development] Phil3759:
I doubt that as cf_root is a non touch recovery and it caused the superbrick in LQ5 v5.5 when wiping /data :confused:

Best approach is to follow instructions in post 1 and never wipe or format in cwm unless you know what you do (safe kernel, /system, non bad chipset...)
[Galaxy S II Original Android Development] Entropy512:
WRONG. In fact Chainfire is quite explicit about the fact that he is unable to patch the kernel because it is a Samsung binary - which is why it is still possible to superbrick if you flash an update zip with a bad update-binary.

The only thing that Koush has explicit access to is the touch UI for CWM. Source code for non-touch CWM is maintained in the Cyanogenmod repos. That has had the option to disable MMC erase cycles since mid-June - http://review.cyanogenmod.com/#/c/17326/

You can put all the warnings you want, people will see that wipe option and they will use it - same thing happened in the Note forums. Known dangerous recoveries and update-binaries should not be distributed, and if you can't control distribution, they should not be linked.

It won't? Then how does your process work at all? - it's fundamentally flashing a CWM fakeflash. If you can flash the CWM fakeflash, you should be able to flash anything else signed with the same key.

Koush's CWM for this device is still CWM 4.x - Anything prior to 5.5 is safe.

He claimed that he rebuilt safe binaries but I'm seeing evidence he didn't. I didn't have enough time to check this last night.
[Galaxy S II Original Android Development] Phil3759:
Thanks for the clarification, but still has a doubt:

In this thread, Tungstwenty showed that CF_Root LQ5 v5.5 is not patched while the kernel v5.6 is patched. He looks at binaries from samsung sources. So it should mean as I understand it that kernel was patched by Chainfire. Tungstwenty even developped a patch routine making stock kernels safe to be wiped under touch CWM and he showed that same pattern he patches in stock kernels is patched in CF_Root kernel.

So, how could Chainfire did not change the kernel in his LQ5 v5.6 safe kernel?

I can fully understand your point, but I do not share your idea of sanctioning all people because there will be always some dumbass. Like saying we need prohibit the cars because there are some that will misuse it and cause accidents...

He is using some particular signature. The private key is not shared, or at least never saw it. Playing with winrar while keeping signature files will fail with "

whole

signature verification error".

Also signing with a testkey with signapk results in "signature verification error". So, until someone provides cwm private key or I am missing something, there is no way to do it like you say. Something that comforts me in this idea is that except cwm, I never saw any custom update ZIP or ROM being able to be flashed in Stock Recovery

Fair enough. I will edit post 1 and replace touch recovery with CWM 4.x non touch version.
[Galaxy S II Original Android Development] Phil3759:
As discussed in my above post, I edited post 1 with the following changes:

Keep in mind that this version has one draw back: you can't install zip files from external sd, only from internal sd. For advanced users that are aware of the risks, I advise the touch version from clockworkmod site.
[Galaxy S II Original Android Development] Entropy512:
jarsigner -certs -verify -verbose CWM_Root_SuperSU_0.94_Busybox_1.20.2.zip

Attempting to check the certs of one of your releases with jarsigner results in:

s = signature was verified
m = entry is listed in manifest
k = at least one certificate was found in keystore
i = at least one certificate was found in identity scope

no manifest.
jar is unsigned. (signatures missing or not parsable)

So it's obvious that won't flash in stock recovery.
[Galaxy S II Original Android Development] Phil3759:
Of course, I removed signatures on purpose as it was meant for CWM which bypasses the signature

Now, I tested the Chainfire CWM-SuperSU-v0.94.zip in stock recovery 3e and you are right, it works when apply update is selected

Now, my issue, if you can help me, is to get the key + certificate pair for that

Using some testkeys I have and generating personal keys + sign in jarsigner or signapk will fail

If you or someone can provide the keystore certificate for jarsigner or the key+certificate pair for signapk, I would make it for stock 3e recovery
[Galaxy S II Original Android Development] kopitalk:
And that's gonna be a real break through, Phil. I support Rachmat's method in both SGS2 and Note. Sadly for Note community, the kindergarten teacher send the boys home early for not following instruction.
[Galaxy S II Original Android Development] Entropy512:
Hmm. It's one of the platform testkeys included somewhere in the AOSP source build - CM9/10 zips built from source are signed with the same key. So it's interesting, you might be able to flash CM9/10 straight from stock recovery.
[Galaxy S II Original Android Development] Entropy512:
Well, your test zip doesn't do anything at all... Do the ui_prints when using Chainfire's SuperSU work? If they don't, then nothing will happen with your ZIP.

Chainfire has some contacts at Samsung - but not anything special in this regard. He's using the standard platform testkeys (nothing special or Samsung specific), and apparently new Samsung stock recoveries are allowing this.

There's a possibility that since you are using Windows, something might be signing the ZIP improperly.

As to CM9 instructing CWM - it's assumed that stock recovery won't flash with testkeys - this assumption is starting to look like it may be false for Samsung ICS recoveries. Also, CM9 nightlies might be signed differently (due to being official) than unofficial source builds - I know when I build from source, I get a ZIP signed with the same keys as SuperSU and CWM.
[Galaxy S II Original Android Development] Phil3759:
It is a test zip only, do not stop at the ui_prints. Chainfire ui_prints and show_progress work. My zip will fail signature verification in stock 3e recovery and will not be processed at all. The ui_prints have nothing to do with that. The signing is the issue and stops the flash with a signature verification error

The signing procedure should not be affected by windows as I tried with signapk, jarsigner and also under android with zipsigner2. Apks signed that way are ok for android. Also, look at it closer, my test-signed.zip file has same signature output as chainfire zip. Only the certificate is probably different

You seem to forget that I am not the exception, but Koush and Chainfire are. All kernels, roms, mods released in dev section will only flash under cwm, not 3e. Add to that, most ROMs provided in dev section do a wipe /cache, a format /system and sometimes do wipe /data. So by far, a worst situation then my script here or Rachmd one.

Try to sign a file yourself to see then provide the key/certificate and if it worked in 3e for you. Then i will test it too
[Galaxy S II Original Android Development] Entropy512:
I won't have time until this weekend to try 3e. I'll mess with it then on my I777. :)

As to dangerous update-binaries - they need to start getting removed when they are found. That reminds me, I need to check to see if westcrip fixed Resurrection Remix. 3.0.1 was dangerous and has bricked at least two devices so far.
[Galaxy S II Original Android Development] Phil3759:
Great. I am impatient to see your conclusions about the signature in 3e.

About binary-update, if you know a good binary, i will use it instead. It is rather easy to see if a given binary supports all the commands that the script uses.
[Galaxy S II Original Android Development] flixblixclix:
Hi dev.. Rit now i am on cf-root with stock ics4.0.3 . If i flash the stock kernel which i got from insecured kernel thread for XWLP7. . will my root stay and also triangle will go away. . Pls guide me devs. . clearly.
[Galaxy S II Original Android Development] Phil3759:
Why do you flash a stock unsecure kernel over cf_root which is also stock+unsecures but adds root and cwm?
[Galaxy S II Original Android Development] flixblixclix:
No...... no...... i mean...... i need the original kernel which came from samsung..... and if i flash that original kernel.... will my root and cwm stay or it will go away as i am moving to..... and how about that triangle too..... did u get bro..... sorry about a big story....
[Galaxy S II Original Android Development] Stileth:
The root should stay, CWM will be removed and triangle should disappear too.

Odoslané z GT-I9100 cez Tapatalk 2
[Galaxy S II Original Android Development] Phil3759:
Yes, root stays, yellow triangle is gone and you have the counter increment stays
[Galaxy S II Original Android Development] Phil3759:
Ok, i had to start from the basics :p Got the certificates and keys. Will try in jarsigner and signapk and feedback later this night.
[Galaxy S II Original Android Development] Entropy512:
I think (but am not sure), the zips that work were done using jarsigner.

The keys themselves are somewhere within the AOSP source tree, I'm not sure exactly where. As an example, simply building Cyanogenmod for a device will result in a ZIP signed with the same keys as CWM and SuperSU. I have not tested to see if this ZIP flashes yet - probably tomorrow.
[Galaxy S II Original Android Development] Phil3759:
I really appreciate your support in this thread :o

CWM_SuperSU-v0.94.zip was signed by SignApk

I could find how to rebuild the certificates from android its self. I also found them ready to use, so will test soon in jarsigner and signApk
[Galaxy S II Original Android Development] Phil3759:
After digging into it even more, I ended with this conclusion

Koush temporary CWM.zip and Chainfire CWM_SuperSU-v0.94.zip both use the same testkey.x509.pem certificate we find in android source depository

Now, what probably happens is that they both use a different private testkey.pk8 to sign the files than the private key we find in cyanogenmod and google android depositories

I do not see another explanation

So, unless Chainfire or Koush release the private key (which they will never do for obvious reasons), we will never be able to sign valid 3e updates and we still need the CWM to do it

So, all this search was useless, but at least I learnt a bit more about the signing process basics
[Galaxy S II Original Android Development] Flash05:
if i do method 1 do i get to keep CWM?

is this safe for 4.0.3? only 4.0.4 is affected by brick bug?

will i still get OTA 4.0.4 with this? and keep root after OTA?

thanks.
[Galaxy S II Original Android Development] Stileth:
No, the CWM is only temporary. Yes, it's safe for 4.0.3, but unless you wipe from CWM then it's safe for 4.0.4 too. If OTA will be full ROM then yes, you will loose the root and need to repeat the procedure again, but I did it several times already so don't worry about it.

Odoslané z GT-I9100 cez Tapatalk 2
[Galaxy S II Original Android Development] Phil3759:
I agree with what Stileth told you except the brick bug:

Now, I included CWM4 attached, no more the touch CWM5. Entropy512 who contributed a lot on this issue said that only CWM5.5 and later are affected, so, no more risks now even for noobs.

Advanced users can still go to clockworkmod site and download the touch version to make advanced tasks like wipe and use of external SD
[Galaxy S II Original Android Development] Phil3759:
Great news to day:

No more need to use cwm temporary at all (i9100 and some other Samsung phones)

A BIG BIG thank you to Chainfire who supported me in fixing the flash in stock recovery 3e and to Entropy512 who pushed me to look at a fix

I updated all the files so that they can be flashed in Stock Recovery 3e.

I updated instructions in method 1

I made some cosmetic changes to the script

I added a BIG BIG credit to Chainfire for the stock recovery 3e updates

Enjoy and feed back, over 3000 downloads before I updated the files ;)

Now, I will be looking at complete and clean uninstall of all busybox trash so the unroot script will be complete and you get a stock phone
[Galaxy S II Original Android Development] Stileth:
Thx Phil, excellent job! Mind you to share where was the problem with signing? :rolleyes:

Odoslané z GT-I9100 cez Tapatalk 2
[Galaxy S II Original Android Development] Flash05:
@Stileth / Phil3759 - thanks so much for the info. i personally prefer the non-touch version. i accidentally wiped my nexus S with the touch version of CWM. :(

any difference between non-touch and touch? of simply being touch controlled?

after the rooting process, how can i make the cwm permanent? from the SU app?

sorry, flash permanently CWM using ROM manager? how can i restore stock recovery in case?
[Galaxy S II Original Android Development] Phil3759:
it was just a rather undocumented option in signapk.

More info here:

http://www.xinotes.org/notes/note/996/

But remember, it is due to Samsung releasing broken kernels/recoveries. It could be patched anytime by Samsung and I already received PM from people not being able to flash cwm temporary on their recovery because of signature error

Non touch only supports nandroid backup to internal sd. I do prefer the touch for that. There are other less visible enhancements but less important

To make cwm permanent on the S2, you are obliged to flash a custom kernel as the recovery comes in the kernel. For people that need a permanent cwm, they should really root with CF_Root
[Galaxy S II Original Android Development] Flash05:
^ ah yes i remember. samsung is unique. kernel and recovery comes together. i mentioned ROM manager because i checked my Desire Z - i flashed recovery via ROM Manager.

so non touch nandroid to internal SD only. well seems ok for me... thanks!
[Galaxy S II Original Android Development] Spacemonkie4207:
How would i know if i have a bad chip?

GT-I9100 using Slim ICS 4.2
[Galaxy S II Original Android Development] Phil3759:
When you wipe /data in CWM, your phone is dead completely and forever

Another less risky way is to use the Got BrickBug app from Chainfire here: http://xdaforums.com/showthread.php?t=1693704
[Galaxy S II Original Android Development] RovG:
Hi Phil, was just wondering if you are done with this yet? :eek: Hehe:D Just kidding.

Thank you for all your efforts.:thumbup:
[Galaxy S II Original Android Development] Phil3759:
Sorry, no

Script is done on paper and is working perfect in terminal

But I have to find some time to put it in edify or maybe aroma

Will be done but not before 1 - 2 weeks maybe, so busy...box :D
[General Questions and Answers] pkumar_s:
Hi Exerts,

I have a Galaxy S2 for TMobile (T989). I received an unlock code from T Mobile customer care which worked.

My question is will i still be able to root the phone ? Will the phone be locked again ?

If yes, then can i use the same unlock code provided my T Mobile. Please help me find the link to root this phone.

Thanks for your time and help.

Regards,

Pkumar.
[General Questions and Answers] droid_ra:
Once unlocked the phone remains unlocked.

Rooting does not change the unlocked phone back to a locked phone.
[Captivate General] hadidy:
My phone is Captivate with KK4 stock kernel

used Heimdale to flash that one when ODIN failed to connect or show any response to the phone

Every time i follow the exact instruction... and wait for the yellow box to appear to start flashing but no response

I tried uninstalling and re installing the USB drivers but all in vain, i even tried using different cables and USB ports... read lots of posts and tried many versions and no use

the phone is detected only when it is powered on... NOT IN DOWNLOAD MODE

Does anyone have an idea
[Captivate General] 4-2ndtwin:
See the "Captivate Connection Issues..." stickied thread in the General forum...

And Heimdall drivers only install to the specific port u r plugged into at the time of install. Other ports (ones directly connected to motherboard preferably) can be used for Odin.

....But if u installed drivers for Odin AFTER the install of the Heimdall drivers then u will need to redo the ones for Heimdall if u want to use that again.
[Captivate General] 4-2ndtwin:
OP...

For future reference, Questions belong in the Q & A forum, not the General. And also, there is no need to double post.

Post only once in the correct forum and be patient. Ur question will be answered.
[Vibrant Q&A, Help & Troubleshooting] lartious:
Hi was wondering if anyone knew which Rom was faster between [NIGHTLY][ROM][4.0.4] CyanogenMod 9 and Remics-UX v1.2**BETA 7/2/2012** :cyclops:. Just looking to get the consensus. Thanks