yashsingh1/xdaforums huggingface dataset:
[Miscellaneous Android Development] kamal882:
Yes, It will work. I already tested with Lava Iris 501 Jellybean 4.1.1
[Miscellaneous Android Development] akash akya:
Mainly recovery doest depend on system so non matter whatever ROM or firmwere you are using it doesn't affect....
[Miscellaneous Android Development] manrock111:
as fas as i know you cant flash one firmware recovery to another( Gb to ics or JB) specially on samsung phones. coz their kernal confined with it.
[Miscellaneous Android Development] akash akya:
o_O but ICS Recovery works flawlessly in JB lava iris.... may be its depend on device.... ;)
[Android Software/Hacking General [Developers Only]] Androguide.fr:
Reserved
[Android Software/Hacking General [Developers Only]] Androguide.fr:
Reserved too
[Android Software/Hacking General [Developers Only]] Androguide.fr:
Last one
[Android Software/Hacking General [Developers Only]] Divaksh:
You made it possible man.. hats off.. ^_^
[Android Software/Hacking General [Developers Only]] Ashray_Vk:
Will try this out! :)
[Android Software/Hacking General [Developers Only]] xgunax:
This i will test for sure!
[Android Software/Hacking General [Developers Only]] TheDarkLord1997:
Amazing work once again! :D

Sent from my Nexus 4
[Android Software/Hacking General [Developers Only]] dirtyreturn:
For the gsm galaxy nexus at least, choosing two zips (recovery, kernel) brings back a 'file not valid'. Looking forward to the "final" version.

Edit- if this helps.. twrp 2.5.5.0 and trinity kernel. If there is something for me to do please ask.
[Android Software/Hacking General [Developers Only]] rickoslyder:
Flashed a XXEMB6 I9300 Modem+RIL with no problems.
[Android Software/Hacking General [Developers Only]] Androguide.fr:
Make sure there is no whitespace in the name of the zip, otherwise the app won't be able to pick it up.

If it still doesn't work, try shortening the name of the zips, for some reason I had the same issue with files which have long names

Thanks a lot for the feedback
[Android Software/Hacking General [Developers Only]] Androguide.fr:
That's weird, can you please give me a link to the zip you're trying to flash or attach it here ?

Would be very helpful for me to try and track the problem down
[Android Software/Hacking General [Developers Only]] FAdrums:
Top development here! Thanks
[Android Software/Hacking General [Developers Only]] dirtyreturn:
http://db.tt/SHgN82F1. http://db.tt/9hBvqE7d
[Android Software/Hacking General [Developers Only]] scottspa74:
Cool idea. Thanks. :thumbup:
[Android Software/Hacking General [Developers Only]] Androguide.fr:
Thanks a lot :good:

I tried them both after removing flashing from the app and they got extracted and translated properly on my device.

Please make sure you have a proper busybox install, if you do, please give me the output of this command in terminal :

unzip

I made a few fixes and corrections, here is the apk (the one in the OP was updated too)
[Android Software/Hacking General [Developers Only]] BrooklynNY:
Thanx a million :D :thumbup: ;)
[Android Software/Hacking General [Developers Only]] dirtyreturn:
I have busybox v1.20.2-Stericson installed... in /system/xbin. .. in terminal running .unzip. gives the busybox info, 'Usage', followed by extract files from ZIP archives with other options. I am on CM10.1 if that makes a difference. edit- checked the applet manager section and 'unzip' is installed. And had installed updated apk. sorry this post is not much help.
[Android Software/Hacking General [Developers Only]] habylab:
This is GOLD.

Sent from my Galaxy S3. Long live the original Galaxy S :)
[Android Software/Hacking General [Developers Only]] joshuadjohnson22:
GNote 3 right? ;) I really hope so. It needs to be released already.
[Android Software/Hacking General [Developers Only]] thatbigmoose:
Yeah that's what I meant.

According to devs the boot loader is locked down tight but I don't think many have looked into hijacking the boot sequence to boot into CWM.

It must be possible. It's been done on Xperia and DROID devices for awhile now.. Of course it's way over my head though.
[Android Software/Hacking General [Developers Only]] uvbeenzaned:
[MENTION=4434032]thatbigmoose[/MENTION] did you ever try flashing a ROM with flash Gordon? Did anything work with it? I kinda missed a lot of what was going on here.

GS4A ST AT&T
[Android Software/Hacking General [Developers Only]] joshuadjohnson22:
http://xdaforums.com/showpost.php?p=44752278&postcount=174
[Android Software/Hacking General [Developers Only]] uvbeenzaned:
Ahh ok thanks.
[Android Software/Hacking General [Developers Only]] Thunder07:
[MENTION=4752917]Androguide.fr[/MENTION]

i was thinking of using your project as part of my project (was gonna ask for permission after it works, it didnt :p )

im trying to flash modules through the app and extract boot.img

shouldn't this

be this??

i take my logic from "rm -R folder"

this would delete the folder and everything within it and not everything to the root of the partition??

P.S that would also explain why the rom works when you fix permission, as you're setting them wrongly in the 1st place :/
[Android Software/Hacking General [Developers Only]] Androguide.fr:
Oh, yeah, you're right!

Big silly mistake right here, sorry about that. I'll fix the parser asap.
[Android Software/Hacking General [Developers Only]] vpart_aeip:
This application is very amazing :good:... you're great: thumbup:
[Android Software/Hacking General [Developers Only]] Thunder07:
[MENTION=4752917]Androguide.fr[/MENTION],

also, chmod has a --recursive paramter or -r

and for chown may i recommand something like

Edit:

this is what i've come up with,

remove the path loop 1st and add the 2 highlighted lines

Log.v("Recovery Emulator", "chown " + array[0] + ":" + array[1]
+ " " + array[4]);
cmd.su.runWaitFor("echo \"" + "chown " + array[0] + ":" + array[1] + " " + array[4] + "\" >> " + temp + "/flash_gordon.sh");
[B]cmd.su.runWaitFor("echo \"" + "find "+ array[4] + " -exec chown " + array[0] + ":" + array[1] + " {} +;" + "\" >> " + temp + "/flash_gordon.sh");[/B]

Log.v("Recovery Emulator", "chmod " + array[3] + " " + array[4]);
cmd.su.runWaitFor("echo \"" + "chmod " + array[2] + " " + array[4] + "\" >> " + temp + "/flash_gordon.sh");
[B]cmd.su.runWaitFor("echo \"" + "chmod -R " + array[3] + " " + array[4] + "/*\" >> " + temp + "/flash_gordon.sh");[/B]

im not sure about last line,

it might need to be

note the double /*/*

cmd.su.runWaitFor("echo \"" + "chmod -R " + array[3] + " " + array[4] + "/*/*\" >> " + temp + "/flash_gordon.sh");

i have to run, so i haven't tested either, but ill say that one of them should do it.

Edit:

ok its working fine.

i can confirm the 1st one is correct.

also you should probably remove the preserve argument from copy,

as you'll just cause the ownership to be set as sdcard instead of root, i personally think root fits better as the default permission before it get changed by the script (if it does get changed).

with that said,

do you mine if i use your code in my project,

credit will definitely be given.
[Android Software/Hacking General [Developers Only]] Deadpool:
Dream came true

Sent from my C1604
[Android Software/Hacking General [Developers Only]] Androguide.fr:
Thanks a lot, very enlightening post :good:

As you can see my bash skills aren't very good^^

I'll implement those changes as soon as I can, I'm currently cluttered with work.

And as I told you in pm you can go ahead and re-use that code anywhere you want, I forgot to add a license to the repo but consider it GPL'd.
[Android Software/Hacking General [Developers Only]] my-blue-snog-box:
Let me just say how grateful I am to this community of devs, testers, and support. This apk is brilliant
[Android Software/Hacking General [Developers Only]] hotgaofla:
1. Can i push Flash Gordon to system/app ?

2. Can it flash CrossBreeder zip file ?
[Android Software/Hacking General [Developers Only]] Androguide.fr:
1) You can, but it's useless.

2) It should flash it with no problem, people have already reported they flash-gordoned this successfully.
[Android Software/Hacking General [Developers Only]] my-blue-snog-box:
Has anyone tried flashing a TiBu generated update.zip with any success?
[Android Software/Hacking General [Developers Only]] hotgaofla:
uhm, i tried and it crashed. My phone got loop. Android 2.3.6 stock rom v10Q England LG L3 E400. CrossBreeder 7.2.13.
[Android Software/Hacking General [Developers Only]] jesssiii:
I'd love to know this as well!

S4 I545 ME7 ROOTED
[Android Software/Hacking General [Developers Only]] Ricky Divjakovski:
You could make flashing a rom possible!

They select the .zip the wanna flash, eg. Example.zip

They hit a button to flash

Touch /sdcard/openrecoveryscript

Echo install /sdcard/roms/example.zip >> /sdcard/openrecoveryscript

Mv /sdcard/openrecoveryscript /cache/recovery/openrecoveryscript

### at this point add glashgordon to the rom they woulf like to flash by updatibg the .zip keeping the sig ###

Reboot recovery

And that would be how you flash a rom?
[Android Software/Hacking General [Developers Only]] Pos411:
very nice work...:good:
[Android Software/Hacking General [Developers Only]] Androguide.fr:
The whole point of this project is to bypass the need to have a recovery installed to be able to flash zips.

So using OpenRecoveryScript would be kinda counter-productive...
[Android Software/Hacking General [Developers Only]] Ricky Divjakovski:
cant think of any other way to achieve flashing a rom?

also if eliminating recovery is what you wanna do, this project isnt gonna go very far..

sorry, but the most your gonna get out of this is the ability to flash mods, even if that! goodluck with your project! hope it succeeds!
[Android Software/Hacking General [Developers Only]] my-blue-snog-box:
The focus isn't necessarily to eliminate custom recovery: it's for those of us who cannot install one because of a locked bootloader, etc.
[Android Software/Hacking General [Developers Only]] Androguide.fr:
The aim obviously isn't to replace TWRP or CWM for all users, this would be pointless. this is more for people who have a device for which no custom recovery is available.

If you think about it, the recovery is simply a way to copy/replace files, in a sandboxed, separate environment.

In the same way, the update-binary is just a parser which translates Edify to Shell commands. Nothing that can't be done with Java, except for the sandboxed environment.

Flashing mods and kernels already works properly, flashing Roms works on my SGS3 until you reboot the device.
[Android Software/Hacking General [Developers Only]] Thunder07:
have you tried it with the fixes??

my aim was never rom flashing, so i never test it like that.
[Android Software/Hacking General [Developers Only]] Ricky Divjakovski:
exactly, but how are you supposed to re-write the whole system partition while using it? even if so this task is nearly impossible since you are booted and running within it, while flashing a rom it would kill all app-processes including flash gordon.

im not saying that this is a stupid project, i just dont see how you are gonna achieve this.. i mean, a desktop cant ecen do what you want to achieve..?

also on my SGS3 i have tried this not once has it worked. seems like the process stops half way then goes into a forced bootloop, i try manually rebooting and the device boots straight into recovery, on one occasion it didnt even flash the kernel?

also with this being said if it ever becomes possible, it would be a really risky process to do so, as forced bootloop+no recovery=riff box or deadbrick...
[Android Software/Hacking General [Developers Only]] Androguide.fr:
Unfortunately I haven't found time to try your fixes/make a build with them yet, working on other projects atm.

I'll definitely let you know when I do though.
[Android Software/Hacking General [Developers Only]] Ricky Divjakovski:
also from what i see with your universal init.d, you have great skill, why not work on an application that compiles cwm recovery on the device itsself, detecting all partitions, screen res, ect...?
[Android Software/Hacking General [Developers Only]] Androguide.fr:
Actually, overwriting /system/app would only force close system apps, so the Flash Gordon process is safe.

And appart from some binaries/libs, mostly everything can be replaced on the fly while the device is booted.

Given the fact that many Roms can use the same set of binaries (i.e Making a diff of two cm-based roms's /system/bin folder contents should show very little differences.

Given these facts you can replace everything but the few crucial binaries/libs which would crash the device, and you end-up with your new Rom installed after a reboot (the features work and about device shows the new build), however my S3 bootloops after another reboot.

Either way my goal wasn't to make rom flashing possible at the beginning, as if a device doesn't have a recovery it most likely doesn't have a CM build.

But the guys from the S4 Active community were in need of a way to do so, and they had a way to restore back to stock with odin so I thought it might be funny to give it a shot.
[Android Software/Hacking General [Developers Only]] Ricky Divjakovski:
hmm, i have attempted this myself in the past, failed,

mine was designed to allocate a fraction of the sdcard as a recovery partition incase something went wrong, copied all assets and libs being modified to this mini partition, couldnt even release a public beta to flash mods...

so consider yourself a step ahead of me!

and we do appreciate your work, this is great and the beggining of something big within the community, and i hope you didnt take my word to offence! :) great work!

hopefull continue this conversation on IRC or some better form of communication!
[Android Software/Hacking General [Developers Only]] Androguide.fr:
Sure, no hard feelings mate, it's always good to discuss the pros and cons of a project :good:
[Android Software/Hacking General [Developers Only]] fivefour:
Being I thought about writing a similar app a couple of years ago I gave Flash Gordon a try for kicks. I attempted to flash a kernel on my Toro Nexus and although it appeared to be successful upon rebooting the device is still on the stock CM 10.2 kernel. Are there any logs stored so I may diagnose what is failing?
[Android Software/Hacking General [Developers Only]] my-blue-snog-box:
Did you try to pull the /proc/last_kmsg file?

_____________________

Find me on Hangouts

If I helped you, please hit the "Thanks" button.
[Android Software/Hacking General [Developers Only]] fivefour:
This will not be relevant since this log comes from the kernel, the kernel is still stock so the kmsg is from stock.

I was more inquiring about Flash Gordon keeping a log of the last flash. I will pull the code and add logging so I can easily see what's happening, may as well add a display that shows the log after a flash also.

Thanks for trying to help.
[Android Software/Hacking General [Developers Only]] my-blue-snog-box:
D'oh! You're right! Where is my brain tonight? >_<

_____________________

Find me on Hangouts

If I helped you, please hit the "Thanks" button.
[Android Software/Hacking General [Developers Only]] fivefour:
No worries, happens to us all :D
[Android Software/Hacking General [Developers Only]] Ricky Divjakovski:
Hmm I succesfully flashed a kernel?
[Android Software/Hacking General [Developers Only]] remicks:
Anyone tried this on the Moto X? I'm hesitant to try with no recovery, bootloops = bad news bears.

Sent from my super sexy White Moto X
[Android Software/Hacking General [Developers Only]] Infekxion:
I plan on trying in a few days when I get things unpacked from moving and have a day to tinker around.

Sent from my Moto Ghost
[Android Software/Hacking General [Developers Only]] remicks:
Successfully flashed TeamBlackOut's Blacked Out Hangouts zip on my Moto X just now. Used TiBu to uninstall Hangouts first then flashed with FG. Success!

Edit: Blacked Out Play Store and Keep worked as well, no uninstall needed unless you installed Keep from the Market.

Sent from my super sexy White Moto X
[Android Software/Hacking General [Developers Only]] plisskenn:
Has anyone been able to flash a zip Note 3 or another phone rooted with root de la vega and not trip the sammy warranty?
[Android Software/Hacking General [Developers Only]] NSDCars5:
As for the bash commands, why are you doing recursive like this? Just do this (for chown):

chown /r username ./base
[Android Software/Hacking General [Developers Only]] plisskenn:
Thanks for your work and thought into this! It seems like a very nice idea.
[Android Software/Hacking General [Developers Only]] Gunthermic:
Yup, plently.. I have even started a thread over in Verizon Note 3, of some of my Inverted/Darkhorsed Apps that I have verified that flash just fine.
[Android Software/Hacking General [Developers Only]] pyrilium:
First, thanks for making this happen! It's an extremely useful tool for those of us who choose to stick with a rooted stock ROM / stock recovery, or are forced to!

One comment so far: looking through the Git comments, it doesn't look like this has been addressed yet (except for a few posts up, tersely) - the "toy" implementation for set_perm_recursive is not the easiest way to do this, but it's also not the correct behavior!

If I say set_perm_recursive(... /foo/bar), this means to set the indicated permissions and ownership of /foo/bar/ and of everything under it - that is, /foo/bar, /foo/bar/file1, /foo/bar/file2, /foo/bar/baz/file1... all will have their ownership and permissions modified, but /foo/, /foo/file1, /bar, ... will not! This is a very important difference that could have not-so-good consequences.

As another user mentioned, chmod (and chown, usually) have command-line switches to make them recursive; this is how you want to implement set_perm_recursive(). I always forget the switches and have to look them up (man chown / man chmod / $chmod / $chown)... I just found a page (http://spblinux.de/2.0/doc/commands.html) that suggests the appropriate switches for busybox chmod and chown on embedded linux are (as on my mac os system):

$chown -R user:group /foo/bar for ownership (recursive)

and

$chmod -R [I]perms[/I] /foo/bar for permissions.

I hope this is helpful, and great work again on getting this out to the community! :good:
[Android Software/Hacking General [Developers Only]] Androguide.fr:
Yeah that was a really silly mistake (plus it was harder to implement than just adding a -R parameter^^), I'll try to find some time this weekend to fix that and publish a new apk.
[Android Software/Hacking General [Developers Only]] Thunder07:
Do note that -R is not implmented in all versions of chown/chmod [not sure if both or one],

thats why i used find as per my older post.
[Android Software/Hacking General [Developers Only]] Gunthermic:
I am using this app on the locked Verizon Note 3.. and it's an amazing app, becuase we dont have recovery yet. A couple Questions..

1. Can it do a SystemUI?

2. Does your process wipe the folder before unpackign the zip file? As I theme and change stuff, I have found a few times it appears to keep some old rememenants when flashign anewer version of a apk. So not sure you are clearing out the tmp folder before unziping..

3. Can you just add a Reboot button in app, instead of pullign down notification etc? Not a must have, but a nicity.

4. Cant wait for new version you have talked about..

Again awesome app. Just too bad no-way to do a framework File...
[Android Software/Hacking General [Developers Only]] adeelraj:
Can we flash super su and root the device
[Android Software/Hacking General [Developers Only]] premiatul:
This is extremely important work.

I can't wait for the code to be cleaned up.

Very, very nice! Thank you!
[Android Software/Hacking General [Developers Only]] Gunthermic:
No it requires root to function.
[Android Software/Hacking General [Developers Only]] Androguide.fr:
Update

I made a few modifications this weekend, including :

fixed the set_perm() and set_perm_recursive() implementations (chmod -R/chown -R)

(commit)

Added a checkbox for "Safe Mode", when this checkbox is checked, Flash Gordon will try to see if the zip is a valid flashable zip (this was the default behavior until now), but this sometimes doesn't work and it wouldn't allow you to flash some zips. So now, if you are sure your zip is ok, uncheck the checkbox and those checks will be overriden, allowing you to flash anyway.

(commit)

Here's a signed apk which includes those change : https://github.com/Androguide/FlashGordon/blob/master/RecoveryEmulator.apk?raw=true
[Android Software/Hacking General [Developers Only]] krazman325:
Link is broken. Error 404.
[Android Software/Hacking General [Developers Only]] vinaaa:
It's forcing close when i open it.

Xperia Z1 stock rooted
[Android Software/Hacking General [Developers Only]] Cybereu:
Same here, but im using Rarz D1 (xt915) stock rooted with supersu app and lastest busybox installed.

Edit: Adding logcat

Edit2: Installed older version and seens it worked.
[Android Software/Hacking General [Developers Only]] les_garten:
Hi,

I'm on a Note 3 -- Android 4.3, Have BusyBox Free installed and rooted

The app crashes on opening.

Message : Unfortunately Flash Gordon has stopped"

Any ideas what to try?

Neat app and I would Love to have it working!
[Android Software/Hacking General [Developers Only]] millerd79:
+1
[Android Software/Hacking General [Developers Only]] vinaaa:
Where you find it?
[Android Software/Hacking General [Developers Only]] Androguide.fr:
Thanks for the logcat, silly mistake I should have tested the app before publishing.

I'm fixing the bug and will publish a new apk later today.
[Android Software/Hacking General [Developers Only]] Dagrog:
Add one more to the crashing
[Android Software/Hacking General [Developers Only]] Androguide.fr:
Sorry for the delay guys, I now own a Sony Xperia Z1 and the latest firmware is a pain in the ass to get root on.

I committed the fix on my github and here is the tested apk : https://github.com/Androguide/FlashGordon/raw/master/FlashGordon.apk (also available in the OP)

EDIT: Also, I did some reading on both the Edify set_perm_recursive() command and Bash's chmod/chown commands, and I'd like some input on my conclusions:

In Edify, the set_perm_recursive() command takes 5 parameters (the XDA wiki article only mentions 4, maybe the 4th is optional but I've always seen it used with 5 parameters):

Those parameters are as follows:

user

group

mode

dir mode

target

Example:

set_perm_recursive(0, 2000, 0644, 0755, "/path/to/set/permissions/recursively");

So this means that the FlashGordon translation/implementation not only needs to be recursive, but also needs to set different permissions for directories and files.

From my (poor) Bash knowledge, the best translation for the example above would be:

chown -R 0:2000 /path/to/set/permissions/recursively
chmod -R 0644 /path/to/set/permissions/recursively
chmod 0755 $(find /path/to/set/permissions/recursively -type d)

Does that seem correct to you guys? I wanna be sure before re-implementing this command for the 3rd time^^
[Android Software/Hacking General [Developers Only]] les_garten:
I haven't Flashed anything yet but it starts up and appears to work on my TMO Note 3.

Gracias Mi Amigo!
[Android Software/Hacking General [Developers Only]] grazy:
Thanks, it works great to me. I have managed to flash a custom kernel on tab 7.7(stock rom).
[Android Software/Hacking General [Developers Only]] les_garten:
Would Flash Gordon be OK to Flash this:

http://xdaforums.com/showthread.php?t=2480163
[Android Software/Hacking General [Developers Only]] Androguide.fr:
It should flash OK, I took a look at the updater-script and the delete_recursive() command isn't supported atm, so you might need to delete /sdcard/vrtheme manually afterwards. Other than that it should work properly.
[Android Software/Hacking General [Developers Only]] les_garten:
Thanx, I'll see if I can figure that out.