yashsingh1/xdaforums huggingface dataset:
[Android Software/Hacking General [Developers Only]] vooks:
Trying to flash this

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

And it says zip is invalid
[Android Software/Hacking General [Developers Only]] drdenilson:
Thanks!

OMG! IT WORKS! Device: Blu Energy Diamond Mini (Still no custom recovery for it...)
[Android Software/Hacking General [Developers Only]] Redalpha2:
Hi is this possible with no root? And has this been updated since 2013? Thanks!
[Android Software/Hacking General [Developers Only]] Kurajmo:
Someone tried this on Any Samsung device?

I have Galaxy Grand Neo Plus Android 4.4.4 without Google apps. I think about Flash gaaps.

But one question. This app is safe?

I dont have acess to pc
[Android Software/Hacking General [Developers Only]] MPeti1:
In the main post you mention it can be used with locked bootloader, but you need to have root privileges to use the app. How is the two possible in the same time?
[Android Software/Hacking General [Developers Only]] Looke116:
You can root your phone with "Kingo Root". It is a one key root app that works on most phones.

But I don't think that rooting requires unlocked bootloader because even though I rooted my phone with Kingo Root I wanted to change to Magisk and I did download the zip and flashed it in recovery, maybe was the already rooted phone maybe the fact that Magisk is a system-less root I don't know.
[Android Software/Hacking General [Developers Only]] MPeti1:
But for systemless things you need to modify the boot image, and in the other hand you need to flash a custom recovery to install these kind of things, which also needs to unlock the bootloader. if your bootloader is locked, you cant modify it, and cant flash custom recovery. Or i know something wrong?
[Android Software/Hacking General [Developers Only]] Ticklefish:
It depends on your device. Most devices can be rooted and have a custom recovery without touching the bootloader. Some may not have any way of rooting without flashing a modified kernel, which needs an unlocked bootloader.
[Android Software/Hacking General [Developers Only]] MPeti1:
Thanks for reply. In my case i only need to flash the recovery image to install twrp, and supersu only modifies the boot.img to be systemless (also writes some data somewhere, but it modifies nothing other than boot.img, and does this just to be systemless), but i've read here on xda that for some people (maybe all of who tried) their redmi 3s prime got hard bricked after locking bootloader with modified boot.img
[Android Software/Hacking General [Developers Only]] javad0644:
You can use FLASH FIRE app with that you can install everything(zip-img...)rom,recovery and...its work as a recovery you can create back up from ur system and then restore it
[Android Software/Hacking General [Developers Only]] SkyWo1f:
Could i get the unsecure version? I'm trying to flash xposed to some old devices nut in some of them it doesn't finish
[Android Software/Hacking General [Developers Only]] wrwolf2:
UPDATE ( Feb 23rd 2018 )

once rooted .... we can use flashify to flash most zips and img.

haven't got a handset at hand for tests atm... ( i restored stock LG firmware ) , i believe though you can flash custom recoveries, gapps possibly kernel ( maybe not an entire rom without recovery. )

btw... a way to flash GAPPS on a device without root privileges, anyone ? ( android TV device for instance )
[Android Software/Hacking General [Developers Only]] alecthenice:
I am also looking for a solution to this
[Android Software/Hacking General [Developers Only]] wrwolf2:
what is it that you want to flash ?
[Android Software/Hacking General [Developers Only]] Dmitry87:
Trying to flash Aptx HD zip from this thread https://xdaforums.com/android/software/mod-aptx-hd-bluetooth-hi-res-audio-t3501991

get this error "The package you selected is not a valid flashable zip!" is there a way to make it flashable ?
[Android Software/Hacking General [Developers Only]] MaCianz:
Maybe the zip's name is too long...try with a short name
[Android Software/Hacking General [Developers Only]] Dmitry87:
Nope, still doesn't work. Can I somehow know what exactly Flash Gordon doesn't like. Maybe it's something wrong in the manifest?
[Android Software/Hacking General [Developers Only]] MaCianz:
Well...i don't know, the project seems to be discontinued...i've been using flash gordon in my me173x stock with stock recovery and never got any problem

Edit:check if in your busybox the applets are properly installed

Edit 2 : you can check the log of the flash process in a folder, created by the app in your memory, called RecoveryEmulator...inside the folder there should be a file called flash_gordon.sh

And...the op says that the app supports froyo to jelly bean:rolleyes:
[Android Software/Hacking General [Developers Only]] Sunnyovi:
So can I flash my update.zip of my Android
[Android Software/Hacking General [Developers Only]] MaCianz:
No...you can't flash a rom or a recovery
[Android Software/Hacking General [Developers Only]] Sanjay v Kundhiya:
Sanjaykundhiya12@gmail.com
[Android Software/Hacking General [Developers Only]] Dildoman:
Does it ll work on android 8.1.0 Oreo ??
[Android Software/Hacking General [Developers Only]] Dildoman:
Will this work on android 8.1
[Android Software/Hacking General [Developers Only]] BHart1990:
It is good!
[Android Software/Hacking General [Developers Only]] AchillesTheGod:
deleted.
[Android Software/Hacking General [Developers Only]] enygyzer:
Pity it's not for tbe unrooted population; some who also have no recovery access
[Android Software/Hacking General [Developers Only]] tutibreaker:
dude, the post have 10 years old, that totally useless right now, and yes, you need root for anything that means change the system
[Android Software/Hacking General [Developers Only]] casonswag:
Okay i tried flashing a modded aokp camera zip and after it flashed i got a bunch of fcs and i rebooted and got into a bootloop?

NEXUS⁴
[Android Software/Hacking General [Developers Only]] Androguide.fr:
The fcs happen when the zip you're flashing replaces system files your alreay have (i.e here the camera app I guess).

Does the zip you flashed contain a /system/framework folder ? Because when already existing framework files get replaced while the device is running, it causes it to reboot instantly, and this cuts the installation halfway, resulting in a bootloop.

I'll add a check for already existing framework files in the zip, so that it cancels the flashing before harm is done.
[Android Software/Hacking General [Developers Only]] casonswag:
Ohh okay i get what your saying but no inside the zip is only the cam well gallery u know how the cam is inside the gallery but the zip is suppose to replace the cam i got with the modded one in the zip but thats when i got the fcs in your app maybe i should just flash that

NEXUS⁴
[Android Software/Hacking General [Developers Only]] Androguide.fr:
Yeah for the moment I recommend you flash through recovery if you can, this is really far from being a real recovery replacement atm, it's just experimental.

The idea popped up in my head less than a week ago, so this is a very very early version, just to show it can be done.

Thanks for trying it and providing feedback either way, very useful :good:
[Android Software/Hacking General [Developers Only]] casonswag:
Well u have a master mind for this one bro this is gonna work wonders great idea cant wait to see where u take this

NEXUS⁴
[Android Software/Hacking General [Developers Only]] T-Macgnolia:
Love the work you have done here man. I just tried it out with this zip and it gives me the following message in Flash Gordon. "The package you selected is not a valid flashable zip". It flashes fine via recovery so I do not know if the app have some kind of conflict with the updater-script in the zip or what but I thought it might be helpful for to you as far as further advancement of the app.

Also I have a suggestion for something to add to the app. When you download a flashable zip on your device and you select it in the notifications or through the default download manager Android asks you what app you would like to use for this action. You should add the ability of Android to include Flash Gordon in the list of available apps that can handle .zip files.
[Android Software/Hacking General [Developers Only]] Androguide.fr:
Thanks a lot for your nice words man :)

Thanks a lot mate, gonna look into your zip.

Flash Gordon already shows-up in the list of apps to choose a zip, it's the grey folder with a green bugdroid on it ;) (I'll change the icon soon).

A few things I can suggest off the bat is to make sure your zip has no whitespace in its name, if it doesn't then try to shorten its name, preferably all letters.

If this still doesn't work, maybe retry choosing the zip with Flash Gordon's built-in file explorer.

EDIT : my bad, I think I misunderstood your suggestion, it shows up as a file chooser but not as zip handler, that's right, I'll add that in the future thanks a lot
[Android Software/Hacking General [Developers Only]] Androguide.fr:
[MENTION=3007199]T-Macgnolia[/MENTION] I fixed the problem, I attached the updated apk (also updated in the OP), can you please try again with it and tell me if it indeed fixes your issue?

Thanks a lot for the feedback, much appreciated:good:
[Android Software/Hacking General [Developers Only]] T-Macgnolia:
Tried with your new version and of the app still same thing. I shorten the name by taking out the underscores but no change. This may just be a problem on my device, but I can not open the new apk download with the default download manager. I have to use a file explore to get it to install. Gives the message, "Note not found.It may have been moved, deleted, or renamed ."

May not have explained what I was suggesting. When I open my dropbox app and then select the zip I get the screen I have attached. As you can see Flash Gordon is not in the chooses. I hope this helps you understand better.

Edit: You also know me as Tony Roach from the XDA G+ Community ;)
[Android Software/Hacking General [Developers Only]] Androguide.fr:
That's weird, when I downloaded your zip and tried it, it gave me the same error ("The zip you selected is not a valid flashable zip"), but after making my changes, it extracted properly.

The message you get with the download manager would be because I updated the zip I attached a second time (added some fixes for kernel flashing when the dev uses package_extract_file() instead of write_raw_image()), so clicking on the first one would try to re-download it and it will fail as it's not here anymore.

Yeah, now I get your suggestion, and it's a good one, definitely gonna implement it in the future. :good:

If you got time, please put your zip in /sdcard, and tell me what's the output of this command for you in terminal :

unzip /sdcard/camera42_patched_v2.zip -d /sdcard/RecoveryEmulator/tmp
[Android Software/Hacking General [Developers Only]] T-Macgnolia:
This is my output in terminal.

a42_patched_v2.zip -d /sdcard/RecoveryEmulator/tmp <
/system/bin/sh: unzip: not found
127|u0_a210@android:/ $
[Android Software/Hacking General [Developers Only]] Androguide.fr:
Perfect :)

Please install busybox by Stericsson (free on the playstore), use the "smart install" feature, then go to the applet manager and make sure the unzip applet is installed, if not, install it.

That should definitely solve the issue

I'll implement the use of a private version of busybox for the app in order to avoid this kind of issue and to make it work even if the user doesn't have busybox installed, thanks for giving me the idea :p
[Android Software/Hacking General [Developers Only]] dirtyreturn:
[MENTION=4752917]Androguide.fr[/MENTION] v1.2 +when selecting the kernel.zip I had posted I don't get an invalid zip error anymore+. It goes on to 'extracting' then 'the changes require a reboot'. The kernel doesn't change it seems.
[Android Software/Hacking General [Developers Only]] T-Macgnolia:
Ahh man I had not realize I had not installed busybox, I feel like a dumbass. I went to system/bin before installing it and aure enough I did not have busybox, it is now lol. I tryed the zip again and Flash Gordon worked like a charm. I had to do a reboot before the new camera app and gallery app should up in my app drawer. Oh and just for your knowledge I have a T-Mobile Samsung Galaxy Note II (SGH-T889)
[Android Software/Hacking General [Developers Only]] Androguide.fr:
Yeah I'm studying the updater-script of the Trinity kernel you posted, it uses a weird way to install, it dumps your current boot.img, adds its own zImage to it and then repacks it and installs it.

I had never seen this way of doing it before, so currently Flash Gordon isn't able to interpret some of this updater-script, but I'm definitely going to work on making it able to.

It would be very helpful if you could do the following :

Open flash gordon, tap the "select a zip" button and select the trinity kernel you posted,then hit the "flash now" button

Post the content of this file : /sdcard/RecoveryEmulator/tmp/flash_gordon.sh here

Thanks a lot for your help
[Android Software/Hacking General [Developers Only]] Androguide.fr:
There's really no problem, thanks a lot bro, glad it worked properly :)
[Android Software/Hacking General [Developers Only]] dirtyreturn:
Post the content of this file : /sdcard/RecoveryEmulator/tmp/flash_gordon.sh here

Thanks a lot for your help[/QUOTE]

http://db.tt/RNqhJXcO
[Android Software/Hacking General [Developers Only]] Androguide.fr:
Thanks you so much, there's actually only one line that the parser wasn't able to interpret, working on it.

Meanwhile, I modified this line so that Flash Gordon can pick it up and process it. I attached the updated zip if you wanna give it a try.

It should install properly unless this command returns an error in terminal :

su
sh /tmp/unpackbootimg -i /tmp/boot.img -o /tmp/
[Android Software/Hacking General [Developers Only]] dirtyreturn:
Androguide.fr I'm not a dev. or anything. I got the updated kernel zip you posted and no luck on my end. I ran the command you posted and it came back with tmp/unpackbootimg not valid or does not exist. I checked recoveryemulator/tmp/kernel and unpackbootimg is definitely there.
[Android Software/Hacking General [Developers Only]] Androguide.fr:
Thanks a lot, really, you've been of great help :good:

I'm going to try and figure out a way to get past this, I'll let you if I do. It's only a problem with kernels which use this method for installing though.
[Android Software/Hacking General [Developers Only]] NYSEAN1:
Sounds great!!! Will try....
[Android Software/Hacking General [Developers Only]] trevd:
Hi

Wouldn't it be easier to just run the update-binary which seems to do a perfectly good job of parsing and executing the script or do you feel there's something to be gained by converting it to bash?
[Android Software/Hacking General [Developers Only]] Androguide.fr:
Yeah it's a good idea, I tried it but couldn't find the right syntax to call it, it always returns 'invalid number of arguments (x)'.

I investigated the update-binary source code & the stock recovery code, with no success. I indeed see the error message I'm having, but as I really don't know much C/C++, didn't help me much.

The edify source code is of great help though, I use it as a manpage.

If you know more about it, or how to call it, please share.
[Android Software/Hacking General [Developers Only]] trevd:
Yeah sure it's

./update-binary 2 0 /sdcard/update.zip

The first parameter is api version ( normally 2 or 3 ) the second parameter is a linux file descriptor number to a file that receives the output message, 1 or 2 is fine for this as that stderr and stdout or it could be a file number you've open as writeable. The 3rd one is pretty self explanatory I would think. :D

Most of your update action goes on in the updater.c [ source code ] the install.c in same directory contains the common functions.

Bear in mind that the functions and/or parameters defined in install.c are not set in stone , carriers and oem's often add functions or even change the parameter counts as every updater-binary is potentially unique, some are not even binary files as it can be just an executable bash script.

I think writing a converter is unnecessary unless your goal is to write a converter then "fill yer boots" but In you're case it's just a means to an end

This thread is pretty useful [TUTORIAL] Making Flashable ZIPs, EDIFY Script, ZIP Signing & Key Creation [19.01.13] for understanding edify, updater binaries and their quirks

I think what you're trying to do has already been covered by an app call flashgui, I've not tried it but it's the only one I found when I was thinking about this... There's always room for another kid on the block tho :)

A tip about replacing system files, well more a thought, If you want to keep apps running you could try copying the current system files into a diskimage in memory and mounting it over the top of the existing system which would then leave you free to update the real system partition, Kinda pulling the rug from underneath it... I've not tested that, It's just what I would of tried first if I wasn't so lazy and actually wrote the apps have ideas for. LOL :silly:

Hope that helps
[Android Software/Hacking General [Developers Only]] Androguide.fr:
Awesome, really helpful, thank you so much! :good:

All I have to do then is to write a parser which will modify some edify commands to make them work when not in recovery (i.e mounting /system using mount point doesn't work, so I'll have to call busybox instead, and folder paths such as /tmp aren't created by package_extract_dir/file, so I'll have to add an mkdir call, and binary calls are alkways made from /sbin/ in updater-scripts afaik so I'll need to change it to xbin, etc...)

I know update-binaries vary a lot, but as long as the app executes the one that comes with the zip the user has selected, it should be all right I guess.

Your idea of mounting a pseudo system image is really good, but would you include only the system files which get modified or would you have to dump a whole system partition ?

Could you please give me a bash example of how you would do it ?

Again, thanks, you made my project do a leap forward here.

(Already used my daily thanks :()
[Android Software/Hacking General [Developers Only]] hisname:
hmm... interesting, will you make it work hand in hand with PmR?

Sent from my supercharged :tank:
[Android Software/Hacking General [Developers Only]] nevadasaga:
Dude, will this works for flashing a flashable zip? My current device doesnt have any recovery yet

Sorry just ignore my stupidity. Didnt read the full title
[Android Software/Hacking General [Developers Only]] eushaun99:
That's the whole purpose of this app. Its designed for devices without recovery. :)
[Android Software/Hacking General [Developers Only]] Androguide.fr:
Yeah it will, but unless you're an adventurous man, I don't recommend you try it yet if your device doesn't have a recovery, as if somehow the flashing goes wrong or the updater-script can't be fully interpreted, you won't be able to restore your device.

If you want, post your zip here I'll tell you if it should flash properly or not.

Yup, once it's stable enough I'll merge it into Pimp My Rom, but as of now, it would just be a bad google play reviews generator I guess :silly:
[Android Software/Hacking General [Developers Only]] nevadasaga:
http://xdaforums.com/showthread.php?t=2097279. From that one

---------- Post added at 09:49 PM ---------- Previous post was at 09:47 PM ----------

One more thing, worst case scenario?
[Android Software/Hacking General [Developers Only]] trevd:
Not a problem,

The update.zip files are self contained and doesn't ( shouldn't ) rely on anything provided by the recovery filesystem, all recovery does is act as shell to display messages and do the initial extraction of the update-binary to /tmp ( normally ), this is the code that handles initial extraction in CWM android_bootable_recovery/blob/cm-10.1/install.c. the update-binary is it's own program it even unpacks the zipfile, that's why you'll see busybox or other additional utilities ( unpackimage for example ) included in a lot of flashable mods.

So I suppose, All you would really need to do is a preflight sanity check on the updater-script and fixup anything that might cause issue on a live system ( i.e umounting the system ), then take a copy of the zip, update that with the fixed up script, extract the update-binary and pass it the new update.zip and then let it do it's work... that's just how I'd approach it, There's probably a couple of different ways but that's the joy of code. :D

I thought so too but I've just been playing around with it, as always the devil is in the detail, there's all the running native services in /system/bin that i'd conveniently forgotten about. It's probably still do-able but there a little more to it than just a casual copy and remount, :(

more thought required on that one, I'll probably end up wasting a couple of hours on it because it's "done my head in" as we say round our way :D
[Android Software/Hacking General [Developers Only]] nevadasaga:
Excuse me sir, what is the worst case scenario?
[Android Software/Hacking General [Developers Only]] sifat3d:
Worst possible case:

SOFT bricked device,

eg:bootloop/bootstuck

& Thanks op for your awesome work.

Please mention that flashing Kernels are NO GO.
[Android Software/Hacking General [Developers Only]] nevadasaga:
So you are made to flash zip? Just a little bit scary because if i use this app it will be the first time i m flashing zip:D
[Android Software/Hacking General [Developers Only]] sifat3d:
Yes you can flash zip,

but be sure you can RESTORE A BACKUP or FLASH a rom if something goes wrong.
[Android Software/Hacking General [Developers Only]] Androguide.fr:
Thanks for the nice words.

I successfully flashed several different kernels on my sgs3 & nexus 7, could you please post a link to kernels you had trouble with ? Investigating their updater-script could be helpful.

And yeah, worst case scenario your device bootloops and you'll need to flash a new rom, or a nandroid backup, or get back to stock.

I really wouldn't recommend you flash your first flashable zip using this app for the moment, this is really experimental as of now.
[Android Software/Hacking General [Developers Only]] LeftyGR:
Some feedback on this.

After nandroid back up, I did some experimenting. The camera/gallery is a system app, but not a critical one say like systemui, touchwiz, etc. So I did some playing around and yeah, I got a few fc and boot loops with camera, gallery, playstore, gmail, and keyboard. But I feel I have found what it would take to mitigate the problems with flashing a system app replacement zip.

For this I used playstore as the example.

*uninstall any updates.

*delete all data and cache for the app.

Both of these can be done in settings/app manager.

After this, I had no problems flashing any non critical system app. It may be a lot to ask someone to wipe all data for an app they use just to upgrade. The solution may be to use an app like titanium backup to restore data after.

If others want to try this and leave feedback, it will help our man Andro with Flash.

Edit. Always make sure you have a recent backup first!
[Android Software/Hacking General [Developers Only]] Androguide.fr:
Thanks a lot for the feedback, this is really good news if wiping the app data/cache fixes the fc when flashing, as I can easily make the app do it automatically.

I'll look into it, as well as the update-binary solution

Either way, now I released the beta of Pimp my Rom I have more time to dedicate to my other projects so there should be some progress soon.